From 4f7e8ff14c0232b250894902a6db8b39db376ab8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=C3=A1=C5=A1=20Krch?= <23259342+tkrch@users.noreply.github.com> Date: Wed, 24 Jul 2024 13:23:53 +0200 Subject: [PATCH] release v1.1.0 (#208) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * MT-28 XbyK upgrade 29.2.0 & obsolete configuration removed - breaking changes on MediatR resolved - obsolete project cleared - upgrade of solution dependencies * MT-28 legacy XbyK DB model regeneration + implied fixes * MT-17 migration of documents with non-unique DocumentGuid * MT-17 non-unique DocumentGUID & NodeGUID support * MT-17 cleanup * #184 deprecation of XbKConnectionString * #184 deprecation of XbKConnectionString - md file update * #198 migration of media file refactor; fails for member users resoved * confict resolving in relation to master branch * solution reformat to match master formatting * eol crlf * dotnet format autofix * merge conflicts fix * .editorconfig update & global reformat * reformat and code cleanup * dotnet format uncommented * Feat/199 unpublished doc versions published (#209) * document PublishTo & PublishFrom migration path support * whitespace corrections --------- Co-authored-by: Tomáš Krch * naming conventions update, obsolete class removal * handling of multiple attachments with same guid in source instance - meaningful warning message --------- Co-authored-by: Tomáš Krch Co-authored-by: fialafilip <99190657+fialafilip@users.noreply.github.com> --- .editorconfig | 2 +- .gitattributes | 1 + .github/workflows/build.yml | 154 +- .../Auxiliary/NodeXmlAdapter.cs | 153 +- .../Behaviors/CommandConstraintBehavior.cs | 390 +- .../Behaviors/RequestHandlingBehavior.cs | 77 +- .../Behaviors/XbKApiContextBehavior.cs | 81 +- .../Contexts/PrimaryKeyMappingContext.cs | 573 +- .../Contexts/SourceInstanceContext.cs | 197 +- KVA/Migration.Toolkit.Source/Exceptions.cs | 26 +- KVA/Migration.Toolkit.Source/Extensions.cs | 82 +- .../MigrateAttachmentsCommandHandler.cs | 71 +- .../MigrateCategoriesCommandHandler.cs | 383 +- .../MigrateCustomModulesCommandHandler.cs | 854 +- .../Handlers/MigrateCustomTablesHandler.cs | 417 +- .../Handlers/MigrateFormsCommandHandler.cs | 527 +- .../MigrateMediaLibrariesCommandHandler.cs | 519 +- .../MigratePageTypesCommandHandler.cs | 339 +- .../Handlers/MigratePagesCommandHandler.cs | 1396 +- .../Helpers/AdminUserHelper.cs | 51 + .../Helpers/KenticoHelper.cs | 32 +- .../Helpers/PageBuilderWidgetsPatcher.cs | 148 +- .../Helpers/PrintHelper.cs | 14 +- .../Helpers/Printer.cs | 229 +- KVA/Migration.Toolkit.Source/ISourceModel.cs | 27 +- .../KsCoreDiExtensions.cs | 205 +- .../Mappers/AlternativeFormMapper.cs | 198 +- .../Mappers/CmsAttachmentMapper.cs | 110 +- .../Mappers/CmsClassMapper.cs | 731 +- .../Mappers/CmsFormMapper.cs | 256 +- .../Mappers/ContentItemMapper.cs | 1723 +-- .../Mappers/MediaFileInfoMapper.cs | 311 +- .../Mappers/MediaLibraryInfoMapper.cs | 42 + .../Mappers/MemberInfoMapper.cs | 357 +- .../PageTemplateConfigurationMapper.cs | 460 +- .../Mappers/ResourceMapper.cs | 94 +- .../Mappers/TagMapper.cs | 81 +- .../Migration.Toolkit.Source.csproj | 16 +- .../Model/CmsAlternativeForm.cs | 267 +- .../Model/CmsAlternativeUrl.cs | 189 +- .../Model/CmsAttachment.cs | 324 +- .../Model/CmsCategory.cs | 272 +- .../Model/CmsClass.cs | 496 +- .../Model/CmsClassSite.cs | 189 +- .../Model/CmsConsent.cs | 205 +- .../Model/CmsConsentAgreement.cs | 208 +- .../Model/CmsConsentArchive.cs | 206 +- .../Model/CmsCountry.cs | 205 +- .../Model/CmsCulture.cs | 207 +- .../Model/CmsDocument.cs | 523 +- .../Model/CmsDocumentCategory.cs | 189 +- KVA/Migration.Toolkit.Source/Model/CmsForm.cs | 337 +- .../Model/CmsFormUserControl.cs | 387 +- .../Model/CmsPageFormerUrlPath.cs | 190 +- .../Model/CmsPageTemplateConfiguration.cs | 209 +- .../Model/CmsPageUrlPath.cs | 184 +- .../Model/CmsRelationship.cs | 205 +- .../Model/CmsResource.cs | 267 +- KVA/Migration.Toolkit.Source/Model/CmsRole.cs | 209 +- .../Model/CmsSettingsKey.cs | 298 +- KVA/Migration.Toolkit.Source/Model/CmsSite.cs | 246 +- .../Model/CmsSiteCulture.cs | 189 +- .../Model/CmsState.cs | 205 +- KVA/Migration.Toolkit.Source/Model/CmsTree.cs | 342 +- KVA/Migration.Toolkit.Source/Model/CmsUser.cs | 350 +- .../Model/CmsUserSetting.cs | 419 +- .../Model/CmsVersionHistory.cs | 313 +- .../Model/MediaFile.cs | 176 + .../Model/MediaLibrary.cs | 141 + .../Model/OmActivity.cs | 300 +- .../Model/OmContact.cs | 425 +- .../Model/OmContactStatus.cs | 193 +- .../ICmsPageTemplateConfiguration.cs | 36 +- KVA/Migration.Toolkit.Source/ModelFacade.cs | 396 +- .../Providers/ContentItemNameProvider.cs | 89 +- .../Providers/ContentItemNameValidator.cs | 43 +- .../UniqueContentItemNameProvider.cs | 86 +- .../Services/AttachmentMigrator.cs | 519 +- .../Services/ClassService.cs | 64 +- .../Services/CmsRelationshipService.cs | 63 +- .../Services/DeferredPathService.cs | 30 +- .../Services/IPrimaryKeyLocatorService.cs | 22 +- .../Services/Model/AttachmentSelectorItem.cs | 22 +- .../Model/EditableAreasConfiguration.cs | 378 +- .../Services/Model/PageSelectorItem.cs | 22 +- .../Model/PageTemplateConfiguration.cs | 59 +- .../Services/ModuleLoader.cs | 70 +- .../Services/PageTemplateMigrator.cs | 104 +- .../Services/PrimaryKeyLocatorService.cs | 466 +- .../Services/ReusableSchemaService.cs | 265 +- .../Services/SpoiledGuidContext.cs | 131 + .../ConfigurationValidator.cs | 362 +- .../MIGRATION_PROTOCOL_REFERENCE.md | 66 +- .../Migration.Toolkit.CLI.csproj | 49 +- Migration.Toolkit.CLI/Program.cs | 444 +- Migration.Toolkit.CLI/README.md | 469 +- Migration.Toolkit.CLI/appsettings.json | 14 +- .../Abstractions/Command.cs | 36 +- .../Abstractions/CommandResult.cs | 16 +- .../Abstractions/EntityMapperBase.cs | 352 +- .../Abstractions/IEntityMapper.cs | 26 +- .../Abstractions/IModuleLoader.cs | 12 +- .../Abstractions/ModelMappingResult.cs | 90 +- .../Abstractions/UmtMapperBase.cs | 23 +- Migration.Toolkit.Common/Commands.cs | 290 +- .../CommonDiExtensions.cs | 31 +- .../ConfigurationNames.cs | 121 +- .../EntityConfiguration.cs | 102 +- .../Enumerations/K12SystemClass.cs | 961 +- .../Enumerations/K12SystemResource.cs | 315 +- .../Enumerations/KsFieldDataType.cs | 117 +- .../Enumerations/Kx13FormControls.cs | 532 +- .../Enumerations/Kx13SystemClasses.cs | 355 +- .../Enumerations/Kx13SystemResource.cs | 146 +- .../Enumerations/NodeXmlColumns.cs | 84 +- .../Enumerations/XbKSystemClasses.cs | 222 +- .../Enumerations/XbkSystemResource.cs | 107 +- Migration.Toolkit.Common/Extensions.cs | 354 +- .../Helpers/AlignResult.cs | 22 +- .../Helpers/ConsoleHelper.cs | 72 +- .../DeferrableItemEnumerableWrapper.cs | 93 +- .../Helpers/EnumerableHelper.cs | 23 +- .../Helpers/GuidHelper.cs | 34 +- Migration.Toolkit.Common/Helpers/GuidV5.cs | 149 +- .../Helpers/MediaHelper.cs | 227 +- .../Helpers/ReflectionHelper.cs | 258 +- .../Helpers/SerializationHelper.cs | 58 +- .../Helpers/SimpleAligner.cs | 267 +- .../Helpers/TreePathConvertor.cs | 132 +- .../Helpers/UniqueTreePathProvider.cs | 156 +- .../Helpers/UriHelperXbyk.cs | 138 +- .../Helpers/VersionHelper.cs | 34 +- .../IPrimaryKeyMappingContext.cs | 36 +- Migration.Toolkit.Common/IPrinter.cs | 18 +- Migration.Toolkit.Common/LogExtensions.cs | 153 +- .../Migration.Toolkit.Common.csproj | 8 +- .../DebugMigrationProtocol.cs | 94 +- .../MigrationProtocol/HandbookReference.cs | 320 +- .../MigrationProtocol/HandbookReferences.cs | 264 +- .../MigrationProtocol/IMigrationProtocol.cs | 39 +- .../MigrationProtocol/IProtocol.cs | 11 +- .../NullMigrationProtocol.cs | 91 +- .../MigrationProtocol/Protocol.cs | 166 +- .../TextMigrationProtocol.cs | 181 +- Migration.Toolkit.Common/OptInFeatures.cs | 118 +- Migration.Toolkit.Common/Resources.resx | 19 +- Migration.Toolkit.Common/SemanticVersion.cs | 200 +- .../Services/BulkCopy/BulkCopyRequest.cs | 55 +- .../Services/BulkCopy/BulkDataCopyService.cs | 466 +- .../Services/BulkCopy/DataReaderProxyBase.cs | 103 +- .../Services/BulkCopy/FilteredDbDataReader.cs | 60 +- .../BulkCopy/ValueInterceptingReader.cs | 133 +- .../Services/CommandParser.cs | 292 +- .../Services/CoupledDataService.cs | 77 +- .../Services/ICommandParser.cs | 16 +- .../Services/IPrintService.cs | 18 +- .../Services/ISpoiledGuidContext.cs | 9 + .../Services/Ipc/IpcService.cs | 232 +- .../Services/Ipc/Model.cs | 91 +- .../ToolkitConfiguration.cs | 318 +- .../Auxiliary/NodeXmlAdapter.cs | 76 - .../Behaviors/CommandConstraintBehavior.cs | 394 +- .../Behaviors/RequestHandlingBehavior.cs | 75 +- .../Behaviors/XbKApiContextBehavior.cs | 86 +- .../Contexts/KeyMappingContext.cs | 67 +- .../Contexts/PrimaryKeyMappingContext.cs | 572 +- .../Contexts/SourceInstanceContext.cs | 99 - Migration.Toolkit.Core.K11/Exceptions.cs | 14 +- Migration.Toolkit.Core.K11/GlobalUsings.cs | 3 +- .../MigrateContactManagementCommandHandler.cs | 754 +- .../MigrateDataProtectionCommandHandler.cs | 565 +- .../Handlers/MigrateMembersCommandHandler.cs | 208 +- .../MigrateSettingKeysCommandHandler.cs | 174 +- .../Handlers/MigrateSitesCommandHandler.cs | 475 +- .../Handlers/MigrateUsersCommandHandler.cs | 539 +- .../Helpers/KenticoHelper.cs | 92 +- .../Helpers/PrintHelper.cs | 14 +- Migration.Toolkit.Core.K11/Helpers/Printer.cs | 222 +- .../K11CoreDiExtensions.cs | 176 +- .../Mappers/AlternativeFormMapper.cs | 180 +- .../Mappers/CmsAttachmentMapper.cs | 114 +- .../Mappers/CmsConsentAgreementMapper.cs | 67 +- .../Mappers/CmsConsentArchiveMapper.cs | 63 +- .../Mappers/CmsConsentMapper.cs | 151 +- .../Mappers/CmsFormMapper.cs | 163 +- .../Mappers/CmsSettingsCategoryMapper.cs | 184 +- .../Mappers/CmsSettingsKeyMapper.cs | 131 +- .../Mappers/CmsUserMapper.cs | 114 +- .../Mappers/CountryInfoMapper.cs | 52 +- .../Mappers/MediaLibraryInfoMapper.cs | 38 - .../Mappers/MemberInfoMapper.cs | 378 +- .../Mappers/OmContactGroupMapper.cs | 62 +- .../Mappers/OmContactMapper.cs | 85 - .../Mappers/OmContactStatusMapper.cs | 54 +- .../Mappers/ResourceMapper.cs | 45 - .../Mappers/RoleInfoMapper.cs | 55 +- .../Mappers/StateInfoMapper.cs | 62 +- .../Mappers/UserInfoMapper.cs | 188 +- .../Mappers/UserRoleInfoMapper.cs | 60 +- .../Migration.Toolkit.Core.K11.csproj | 5 +- .../Providers/ContentItemNameProvider.cs | 89 +- .../Providers/ContentItemNameValidator.cs | 43 +- .../UniqueContentItemNameProvider.cs | 86 +- .../CmsClass/AttachmentSelectorItem.cs | 22 +- .../CmsClass/EditableAreasConfiguration.cs | 375 +- .../Services/CmsClass/PageSelectorItem.cs | 24 +- .../CmsClass/PageTemplateConfiguration.cs | 60 +- .../Services/CountryMigrator.cs | 207 +- .../Services/IPrimaryKeyLocatorService.cs | 22 +- .../Services/KeyLocatorService.cs | 217 +- .../Services/PrimaryKeyLocatorService.cs | 465 +- .../Services/TableReflectionService.cs | 91 +- .../Auxiliary/NodeXmlAdapter.cs | 76 - .../Behaviors/CommandConstraintBehavior.cs | 529 +- .../Behaviors/RequestHandlingBehavior.cs | 75 +- .../Behaviors/XbKApiContextBehavior.cs | 95 +- .../Contexts/KeyMappingContext.cs | 76 +- .../Contexts/PrimaryKeyMappingContext.cs | 584 +- .../Contexts/SourceInstanceContext.cs | 112 - Migration.Toolkit.Core.KX12/Exceptions.cs | 26 +- Migration.Toolkit.Core.KX12/GlobalUsings.cs | 6 +- .../MigrateContactManagementCommandHandler.cs | 760 +- .../MigrateDataProtectionCommandHandler.cs | 565 +- .../MigrateMediaLibrariesCommandHandler.cs | 247 - .../Handlers/MigrateMembersCommandHandler.cs | 222 +- .../MigrateSettingKeysCommandHandler.cs | 189 +- .../Handlers/MigrateSitesCommandHandler.cs | 377 +- .../Handlers/MigrateUsersCommandHandler.cs | 488 +- .../Helpers/KenticoHelper.cs | 92 +- .../Helpers/PrintHelper.cs | 14 +- .../Helpers/Printer.cs | 224 +- .../KX12CoreDiExtensions.cs | 176 +- .../Mappers/AlternativeFormMapper.cs | 186 +- .../Mappers/CmsAttachmentMapper.cs | 121 +- .../Mappers/CmsConsentAgreementMapper.cs | 73 +- .../Mappers/CmsConsentArchiveMapper.cs | 67 +- .../Mappers/CmsConsentMapper.cs | 159 +- .../Mappers/CmsFormMapper.cs | 183 +- .../Mappers/CmsSettingsCategoryMapper.cs | 194 +- .../Mappers/CmsSettingsKeyMapper.cs | 138 +- .../Mappers/CmsUserMapper.cs | 121 +- .../Mappers/CountryInfoMapper.cs | 59 +- .../Mappers/MediaFileInfoMapper.cs | 174 - .../Mappers/MediaLibraryInfoMapper.cs | 42 - .../Mappers/MemberInfoMapper.cs | 368 +- .../Mappers/OmContactGroupMapper.cs | 71 +- .../Mappers/OmContactMapper.cs | 95 - .../Mappers/OmContactStatusMapper.cs | 63 +- .../Mappers/ResourceMapper.cs | 52 - .../Mappers/RoleInfoMapper.cs | 62 +- .../Mappers/StateInfoMapper.cs | 69 +- .../Mappers/UserInfoMapper.cs | 210 +- .../Mappers/UserRoleInfoMapper.cs | 66 +- .../Migration.Toolkit.Core.KX12.csproj | 9 +- .../Providers/ContentItemNameProvider.cs | 89 +- .../Providers/ContentItemNameValidator.cs | 43 +- .../UniqueContentItemNameProvider.cs | 86 +- .../CmsClass/AttachmentSelectorItem.cs | 22 +- .../CmsClass/EditableAreasConfiguration.cs | 186 - .../Services/CmsClass/PageSelectorItem.cs | 11 - .../CmsClass/PageTemplateConfiguration.cs | 29 - .../Services/CountryMigrator.cs | 227 +- .../Services/IPrimaryKeyLocatorService.cs | 22 +- .../Services/KeyLocatorService.cs | 230 +- .../Services/PrimaryKeyLocatorService.cs | 482 +- .../Services/TableReflectionService.cs | 45 - .../Auxiliary/NodeXmlAdapter.cs | 76 - .../Behaviors/CommandConstraintBehavior.cs | 533 +- .../Behaviors/RequestHandlingBehavior.cs | 87 +- .../Behaviors/XbKApiContextBehavior.cs | 95 +- .../Contexts/KeyMappingContext.cs | 76 +- .../Contexts/PrimaryKeyMappingContext.cs | 572 +- .../Contexts/SourceInstanceContext.cs | 110 - .../DependencyInjectionExtensions.cs | 176 +- Migration.Toolkit.Core.KX13/Exceptions.cs | 26 +- Migration.Toolkit.Core.KX13/GlobalUsings.cs | 5 +- .../MigrateContactManagementCommandHandler.cs | 775 +- .../MigrateDataProtectionCommandHandler.cs | 565 +- .../MigrateMediaLibrariesCommandHandler.cs | 247 - .../Handlers/MigrateMembersCommandHandler.cs | 223 +- .../MigrateSettingKeysCommandHandler.cs | 189 +- .../Handlers/MigrateSitesCommandHandler.cs | 382 +- .../Handlers/MigrateUsersCommandHandler.cs | 491 +- .../Helpers/KenticoHelper.cs | 92 +- .../Helpers/PrintHelper.cs | 14 +- .../Helpers/Printer.cs | 224 +- .../Mappers/AlternativeFormMapper.cs | 186 +- .../Mappers/CmsAttachmentMapper.cs | 121 +- .../Mappers/CmsConsentAgreementMapper.cs | 73 +- .../Mappers/CmsConsentArchiveMapper.cs | 67 +- .../Mappers/CmsConsentMapper.cs | 159 +- .../Mappers/CmsSettingsCategoryMapper.cs | 194 +- .../Mappers/CmsSettingsKeyMapper.cs | 138 +- .../Mappers/CmsUserMapper.cs | 121 +- .../Mappers/CountryInfoMapper.cs | 59 +- .../Mappers/MediaFileInfoMapper.cs | 174 - .../Mappers/MediaLibraryInfoMapper.cs | 42 - .../Mappers/MemberInfoMapper.cs | 377 +- .../Mappers/OmContactGroupMapper.cs | 71 +- .../Mappers/OmContactMapper.cs | 95 - .../Mappers/OmContactStatusMapper.cs | 63 +- .../PageTemplateConfigurationMapper.cs | 223 - .../Mappers/ResourceMapper.cs | 52 - .../Mappers/RoleInfoMapper.cs | 62 +- .../Mappers/StateInfoMapper.cs | 69 +- .../Mappers/UserInfoMapper.cs | 210 +- .../Mappers/UserRoleInfoMapper.cs | 66 +- .../Migration.Toolkit.Core.KX13.csproj | 9 +- .../Providers/ContentItemNameProvider.cs | 89 +- .../Providers/ContentItemNameValidator.cs | 43 +- .../UniqueContentItemNameProvider.cs | 86 +- .../CmsClass/AttachmentSelectorItem.cs | 22 +- .../CmsClass/EditableAreasConfiguration.cs | 186 - .../Services/CmsClass/PageSelectorItem.cs | 11 - .../CmsClass/PageTemplateConfiguration.cs | 29 - .../Services/CountryMigrator.cs | 228 +- .../Services/IPrimaryKeyLocatorService.cs | 22 +- .../Services/KeyLocatorService.cs | 230 +- .../Services/PrimaryKeyLocatorService.cs | 478 +- .../Services/TableReflectionService.cs | 44 - .../Auxiliary/Kx13FormControls.cs | 467 +- Migration.Toolkit.K11/Context/K11Context.cs | 11310 ++++++++-------- .../ContextCustomizations.cs | 28 +- .../DependencyInjectionExtensions.cs | 29 +- .../Migration.Toolkit.K11.csproj | 10 +- .../Migration.Toolkit.K11.csproj.DotSettings | 7 +- .../Models/AnalyticsCampaign.cs | 147 +- .../Models/AnalyticsCampaignAsset.cs | 69 +- .../Models/AnalyticsCampaignAssetUrl.cs | 59 +- .../Models/AnalyticsCampaignConversion.cs | 111 +- .../Models/AnalyticsCampaignConversionHit.cs | 61 +- .../Models/AnalyticsCampaignObjective.cs | 73 +- .../Models/AnalyticsConversion.cs | 71 +- .../Models/AnalyticsDayHit.cs | 61 +- .../Models/AnalyticsExitPage.cs | 53 +- .../Models/AnalyticsHourHit.cs | 61 +- .../Models/AnalyticsMonthHit.cs | 61 +- .../Models/AnalyticsStatistic.cs | 99 +- .../Models/AnalyticsWeekHit.cs | 61 +- .../Models/AnalyticsYearHit.cs | 61 +- Migration.Toolkit.K11/Models/BadWordsWord.cs | 77 +- Migration.Toolkit.K11/Models/BlogComment.cs | 121 +- .../Models/BlogPostSubscription.cs | 87 +- Migration.Toolkit.K11/Models/BoardBoard.cs | 233 +- Migration.Toolkit.K11/Models/BoardMessage.cs | 139 +- .../Models/BoardSubscription.cs | 87 +- .../Models/ChatInitiatedChatRequest.cs | 99 +- Migration.Toolkit.K11/Models/ChatMessage.cs | 107 +- .../Models/ChatNotification.cs | 109 +- .../Models/ChatOnlineSupport.cs | 73 +- .../Models/ChatOnlineUser.cs | 85 +- .../Models/ChatPopupWindowSetting.cs | 55 +- Migration.Toolkit.K11/Models/ChatRoom.cs | 161 +- Migration.Toolkit.K11/Models/ChatRoomUser.cs | 87 +- .../Models/ChatSupportCannedResponse.cs | 79 +- .../Models/ChatSupportTakenRoom.cs | 69 +- Migration.Toolkit.K11/Models/ChatUser.cs | 121 +- .../Models/CiFileMetadatum.cs | 43 +- Migration.Toolkit.K11/Models/CiMigration.cs | 47 +- .../Models/CmsAbuseReport.cs | 113 +- Migration.Toolkit.K11/Models/CmsAcl.cs | 77 +- Migration.Toolkit.K11/Models/CmsAclitem.cs | 111 +- .../Models/CmsAlternativeForm.cs | 119 +- Migration.Toolkit.K11/Models/CmsAttachment.cs | 181 +- .../Models/CmsAttachmentHistory.cs | 179 +- .../Models/CmsAutomationHistory.cs | 163 +- .../Models/CmsAutomationState.cs | 141 +- Migration.Toolkit.K11/Models/CmsAvatar.cs | 121 +- Migration.Toolkit.K11/Models/CmsBadge.cs | 71 +- Migration.Toolkit.K11/Models/CmsBannedIp.cs | 107 +- Migration.Toolkit.K11/Models/CmsBanner.cs | 127 +- .../Models/CmsBannerCategory.cs | 79 +- Migration.Toolkit.K11/Models/CmsCategory.cs | 133 +- Migration.Toolkit.K11/Models/CmsClass.cs | 441 +- Migration.Toolkit.K11/Models/CmsConsent.cs | 69 +- .../Models/CmsConsentAgreement.cs | 77 +- .../Models/CmsConsentArchive.cs | 63 +- Migration.Toolkit.K11/Models/CmsCountry.cs | 97 +- .../Models/CmsCssStylesheet.cs | 99 +- Migration.Toolkit.K11/Models/CmsCulture.cs | 121 +- .../Models/CmsDeviceProfile.cs | 87 +- .../Models/CmsDeviceProfileLayout.cs | 87 +- Migration.Toolkit.K11/Models/CmsDocument.cs | 567 +- .../Models/CmsDocumentAlias.cs | 109 +- .../Models/CmsDocumentTypeScope.cs | 89 +- Migration.Toolkit.K11/Models/CmsEmail.cs | 137 +- .../Models/CmsEmailAttachment.cs | 85 +- .../Models/CmsEmailTemplate.cs | 117 +- Migration.Toolkit.K11/Models/CmsEmailUser.cs | 71 +- Migration.Toolkit.K11/Models/CmsEventLog.cs | 113 +- .../Models/CmsExternalLogin.cs | 57 +- Migration.Toolkit.K11/Models/CmsForm.cs | 181 +- .../Models/CmsFormUserControl.cs | 217 +- Migration.Toolkit.K11/Models/CmsHelpTopic.cs | 71 +- Migration.Toolkit.K11/Models/CmsLayout.cs | 125 +- Migration.Toolkit.K11/Models/CmsLicenseKey.cs | 53 +- .../Models/CmsMacroIdentity.cs | 65 +- Migration.Toolkit.K11/Models/CmsMacroRule.cs | 93 +- Migration.Toolkit.K11/Models/CmsMembership.cs | 85 +- .../Models/CmsMembershipUser.cs | 69 +- Migration.Toolkit.K11/Models/CmsMetaFile.cs | 123 +- .../Models/CmsModuleLicenseKey.cs | 57 +- .../Models/CmsModuleUsageCounter.cs | 39 +- .../Models/CmsObjectSetting.cs | 123 +- .../Models/CmsObjectVersionHistory.cs | 145 +- .../Models/CmsObjectWorkflowTrigger.cs | 91 +- Migration.Toolkit.K11/Models/CmsOpenIduser.cs | 61 +- .../Models/CmsPageTemplate.cs | 283 +- .../Models/CmsPageTemplateCategory.cs | 109 +- .../Models/CmsPageTemplateScope.cs | 113 +- Migration.Toolkit.K11/Models/CmsPermission.cs | 131 +- .../Models/CmsPersonalization.cs | 98 +- Migration.Toolkit.K11/Models/CmsQuery.cs | 89 +- .../Models/CmsRelationship.cs | 89 +- .../Models/CmsRelationshipName.cs | 77 +- Migration.Toolkit.K11/Models/CmsResource.cs | 169 +- .../Models/CmsResourceLibrary.cs | 51 +- .../Models/CmsResourceString.cs | 53 +- .../Models/CmsResourceTranslation.cs | 65 +- Migration.Toolkit.K11/Models/CmsRole.cs | 195 +- .../Models/CmsScheduledTask.cs | 223 +- .../Models/CmsSearchEngine.cs | 67 +- .../Models/CmsSearchIndex.cs | 173 +- Migration.Toolkit.K11/Models/CmsSearchTask.cs | 81 +- .../Models/CmsSearchTaskAzure.cs | 73 +- Migration.Toolkit.K11/Models/CmsSession.cs | 131 +- .../Models/CmsSettingsCategory.cs | 119 +- .../Models/CmsSettingsKey.cs | 137 +- Migration.Toolkit.K11/Models/CmsSite.cs | 815 +- .../Models/CmsSiteDomainAlias.cs | 81 +- Migration.Toolkit.K11/Models/CmsSmtpserver.cs | 91 +- Migration.Toolkit.K11/Models/CmsState.cs | 105 +- Migration.Toolkit.K11/Models/CmsTag.cs | 69 +- Migration.Toolkit.K11/Models/CmsTagGroup.cs | 87 +- .../Models/CmsTemplateDeviceLayout.cs | 111 +- Migration.Toolkit.K11/Models/CmsTimeZone.cs | 85 +- .../Models/CmsTransformation.cs | 101 +- .../Models/CmsTranslationService.cs | 105 +- .../Models/CmsTranslationSubmission.cs | 151 +- .../Models/CmsTranslationSubmissionItem.cs | 115 +- Migration.Toolkit.K11/Models/CmsTree.cs | 367 +- Migration.Toolkit.K11/Models/CmsUielement.cs | 231 +- Migration.Toolkit.K11/Models/CmsUser.cs | 679 +- .../Models/CmsUserCulture.cs | 75 +- .../Models/CmsUserMacroIdentity.cs | 69 +- Migration.Toolkit.K11/Models/CmsUserRole.cs | 67 +- .../Models/CmsUserSetting.cs | 341 +- Migration.Toolkit.K11/Models/CmsUserSite.cs | 61 +- .../Models/CmsVersionHistory.cs | 233 +- .../Models/CmsWebFarmServer.cs | 67 +- .../Models/CmsWebFarmServerLog.cs | 43 +- .../Models/CmsWebFarmServerMonitoring.cs | 37 +- .../Models/CmsWebFarmServerTask.cs | 61 +- .../Models/CmsWebFarmTask.cs | 83 +- Migration.Toolkit.K11/Models/CmsWebPart.cs | 171 +- .../Models/CmsWebPartCategory.cs | 101 +- .../Models/CmsWebPartContainer.cs | 75 +- .../Models/CmsWebPartLayout.cs | 99 +- .../Models/CmsWebTemplate.cs | 79 +- Migration.Toolkit.K11/Models/CmsWidget.cs | 167 +- .../Models/CmsWidgetCategory.cs | 101 +- Migration.Toolkit.K11/Models/CmsWidgetRole.cs | 75 +- Migration.Toolkit.K11/Models/CmsWorkflow.cs | 189 +- .../Models/CmsWorkflowAction.cs | 131 +- .../Models/CmsWorkflowHistory.cs | 175 +- .../Models/CmsWorkflowScope.cs | 119 +- .../Models/CmsWorkflowStep.cs | 229 +- .../Models/CmsWorkflowStepRole.cs | 65 +- .../Models/CmsWorkflowStepUser.cs | 65 +- .../Models/CmsWorkflowTransition.cs | 91 +- Migration.Toolkit.K11/Models/ComAddress.cs | 147 +- Migration.Toolkit.K11/Models/ComBrand.cs | 101 +- Migration.Toolkit.K11/Models/ComCarrier.cs | 85 +- Migration.Toolkit.K11/Models/ComCollection.cs | 89 +- Migration.Toolkit.K11/Models/ComCouponCode.cs | 69 +- Migration.Toolkit.K11/Models/ComCurrency.cs | 111 +- .../Models/ComCurrencyExchangeRate.cs | 77 +- Migration.Toolkit.K11/Models/ComCustomer.cs | 157 +- .../Models/ComCustomerCreditHistory.cs | 91 +- Migration.Toolkit.K11/Models/ComDepartment.cs | 97 +- Migration.Toolkit.K11/Models/ComDiscount.cs | 147 +- .../Models/ComExchangeTable.cs | 81 +- Migration.Toolkit.K11/Models/ComGiftCard.cs | 117 +- .../Models/ComGiftCardCouponCode.cs | 65 +- .../Models/ComInternalStatus.cs | 79 +- .../Models/ComManufacturer.cs | 95 +- .../Models/ComMultiBuyCouponCode.cs | 69 +- .../Models/ComMultiBuyDiscount.cs | 195 +- .../Models/ComMultiBuyDiscountBrand.cs | 63 +- .../Models/ComMultiBuyDiscountCollection.cs | 63 +- .../Models/ComMultiBuyDiscountTree.cs | 63 +- .../Models/ComOptionCategory.cs | 131 +- Migration.Toolkit.K11/Models/ComOrder.cs | 305 +- .../Models/ComOrderAddress.cs | 125 +- Migration.Toolkit.K11/Models/ComOrderItem.cs | 139 +- .../Models/ComOrderItemSkufile.cs | 65 +- .../Models/ComOrderStatus.cs | 127 +- .../Models/ComOrderStatusUser.cs | 101 +- .../Models/ComPaymentOption.cs | 165 +- .../Models/ComPublicStatus.cs | 79 +- .../Models/ComShippingCost.cs | 65 +- .../Models/ComShippingOption.cs | 139 +- .../Models/ComShoppingCart.cs | 213 +- .../Models/ComShoppingCartCouponCode.cs | 51 +- .../Models/ComShoppingCartSku.cs | 97 +- Migration.Toolkit.K11/Models/ComSku.cs | 555 +- Migration.Toolkit.K11/Models/ComSkufile.cs | 85 +- .../Models/ComSkuoptionCategory.cs | 71 +- Migration.Toolkit.K11/Models/ComSupplier.cs | 97 +- Migration.Toolkit.K11/Models/ComTaxClass.cs | 103 +- .../Models/ComTaxClassCountry.cs | 67 +- .../Models/ComTaxClassState.cs | 67 +- .../Models/ComVolumeDiscount.cs | 69 +- Migration.Toolkit.K11/Models/ComWishlist.cs | 75 +- .../Models/CommunityFriend.cs | 117 +- .../Models/CommunityGroup.cs | 219 +- .../Models/CommunityGroupMember.cs | 121 +- .../Models/CommunityGroupRolePermission.cs | 75 +- .../Models/CommunityInvitation.cs | 105 +- .../Models/ContentArticle.cs | 45 +- Migration.Toolkit.K11/Models/ContentBlog.cs | 111 +- .../Models/ContentBlogMonth.cs | 37 +- .../Models/ContentBlogPost.cs | 73 +- .../Models/ContentBookingEvent.cs | 77 +- .../Models/ContentCellphone.cs | 97 +- Migration.Toolkit.K11/Models/ContentEbook.cs | 45 +- Migration.Toolkit.K11/Models/ContentEvent.cs | 49 +- Migration.Toolkit.K11/Models/ContentFaq.cs | 41 +- Migration.Toolkit.K11/Models/ContentFile.cs | 43 +- .../Models/ContentHeadlineBanner.cs | 45 +- .../Models/ContentImageGallery.cs | 41 +- Migration.Toolkit.K11/Models/ContentJob.cs | 57 +- .../Models/ContentKbarticle.cs | 55 +- Migration.Toolkit.K11/Models/ContentLaptop.cs | 107 +- .../Models/ContentMenuItem.cs | 43 +- Migration.Toolkit.K11/Models/ContentNews.cs | 49 +- Migration.Toolkit.K11/Models/ContentOffice.cs | 121 +- .../Models/ContentPressRelease.cs | 53 +- .../Models/ContentProduct.cs | 33 +- .../Models/ContentSimpleArticle.cs | 37 +- .../Models/ContentSmartphone.cs | 111 +- .../Models/ContentSoftware.cs | 51 +- .../Models/CustomtableSampleTable.cs | 59 +- .../Models/DancingGoatArticle.cs | 47 +- .../Models/DancingGoatBrewer.cs | 45 +- .../Models/DancingGoatCafe.cs | 83 +- .../Models/DancingGoatCity.cs | 39 +- .../Models/DancingGoatCoffee.cs | 73 +- .../Models/DancingGoatEbook.cs | 41 +- .../Models/DancingGoatElectricGrinder.cs | 49 +- .../Models/DancingGoatFilterPack.cs | 49 +- .../Models/DancingGoatGrinder.cs | 45 +- .../Models/DancingGoatMembership.cs | 45 +- .../Models/DancingGoatOffice.cs | 75 +- .../Models/DancingGoatPartnerCafe.cs | 51 +- .../Models/DancingGoatTableware.cs | 45 +- .../Models/EcommerceCheckoutStep.cs | 33 +- .../Models/EcommerceCheckoutWizard.cs | 33 +- .../Models/EventsAttendee.cs | 79 +- Migration.Toolkit.K11/Models/ExportHistory.cs | 75 +- Migration.Toolkit.K11/Models/ExportTask.cs | 77 +- Migration.Toolkit.K11/Models/FormContactU.cs | 63 +- ...DancingGoatBusinessCustomerRegistration.cs | 77 +- .../Models/FormDancingGoatContactU.cs | 65 +- .../Models/FormDancingGoatMachineRental.cs | 65 +- .../Models/FormDancingGoatTryFreeSample.cs | 91 +- .../FormEcommerceSiteGeneralQuestion.cs | 45 +- .../FormEcommerceSiteProductQuestion.cs | 51 +- .../Models/ForumsAttachment.cs | 105 +- Migration.Toolkit.K11/Models/ForumsForum.cs | 293 +- .../Models/ForumsForumGroup.cs | 177 +- .../Models/ForumsForumPost.cs | 247 +- .../Models/ForumsForumRole.cs | 75 +- .../Models/ForumsForumSubscription.cs | 103 +- .../Models/ForumsUserFavorite.cs | 111 +- .../Models/IntegrationConnector.cs | 71 +- .../Models/IntegrationSyncLog.cs | 53 +- .../Models/IntegrationSynchronization.cs | 79 +- .../Models/IntegrationTask.cs | 119 +- .../Models/IntranetPortalDepartment.cs | 55 +- .../IntranetPortalWorkingEnvironment.cs | 51 +- Migration.Toolkit.K11/Models/MediaFile.cs | 155 +- Migration.Toolkit.K11/Models/MediaLibrary.cs | 121 +- .../Models/MediaLibraryRolePermission.cs | 75 +- .../Models/MessagingMessage.cs | 111 +- .../Models/NewsletterAbtest.cs | 107 +- .../Models/NewsletterClickedLink.cs | 59 +- .../Models/NewsletterEmail.cs | 111 +- .../Models/NewsletterEmailTemplate.cs | 137 +- .../Models/NewsletterEmailWidget.cs | 95 +- .../Models/NewsletterEmailWidgetTemplate.cs | 61 +- .../Models/NewsletterIssueContactGroup.cs | 51 +- .../Models/NewsletterLink.cs | 67 +- .../Models/NewsletterNewsletter.cs | 231 +- .../Models/NewsletterNewsletterIssue.cs | 251 +- .../Models/NewsletterOpenedEmail.cs | 59 +- .../Models/NewsletterSubscriber.cs | 113 +- .../Models/NewsletterSubscriberNewsletter.cs | 79 +- .../Models/NewsletterUnsubscription.cs | 79 +- .../Models/NotificationGateway.cs | 95 +- .../Models/NotificationSubscription.cs | 153 +- .../Models/NotificationTemplate.cs | 79 +- .../Models/NotificationTemplateText.cs | 87 +- Migration.Toolkit.K11/Models/OmAbtest.cs | 137 +- Migration.Toolkit.K11/Models/OmAbvariant.cs | 97 +- Migration.Toolkit.K11/Models/OmAccount.cs | 227 +- .../Models/OmAccountContact.cs | 77 +- .../Models/OmAccountStatus.cs | 49 +- Migration.Toolkit.K11/Models/OmActivity.cs | 157 +- .../Models/OmActivityRecalculationQueue.cs | 33 +- .../Models/OmActivityType.cs | 77 +- Migration.Toolkit.K11/Models/OmContact.cs | 281 +- .../OmContactChangeRecalculationQueue.cs | 45 +- .../Models/OmContactGroup.cs | 77 +- .../Models/OmContactGroupMember.cs | 71 +- Migration.Toolkit.K11/Models/OmContactRole.cs | 49 +- .../Models/OmContactStatus.cs | 49 +- Migration.Toolkit.K11/Models/OmMembership.cs | 67 +- .../Models/OmMvtcombination.cs | 97 +- Migration.Toolkit.K11/Models/OmMvtest.cs | 133 +- Migration.Toolkit.K11/Models/OmMvtvariant.cs | 121 +- .../Models/OmPersonalizationVariant.cs | 119 +- Migration.Toolkit.K11/Models/OmRule.cs | 117 +- Migration.Toolkit.K11/Models/OmScore.cs | 93 +- .../Models/OmScoreContactRule.cs | 87 +- .../Models/OmVisitorToContact.cs | 53 +- .../Models/PersonasPersona.cs | 81 +- .../Models/PersonasPersonaContactHistory.cs | 55 +- .../Models/PersonasPersonaNode.cs | 51 +- Migration.Toolkit.K11/Models/PollsPoll.cs | 143 +- .../Models/PollsPollAnswer.cs | 89 +- .../Models/ReportingReport.cs | 123 +- .../Models/ReportingReportCategory.cs | 101 +- .../Models/ReportingReportGraph.cs | 137 +- .../Models/ReportingReportSubscription.cs | 185 +- .../Models/ReportingReportTable.cs | 93 +- .../Models/ReportingReportValue.cs | 99 +- .../Models/ReportingSavedGraph.cs | 67 +- .../Models/ReportingSavedReport.cs | 95 +- .../Models/SharePointSharePointConnection.cs | 109 +- .../Models/SharePointSharePointFile.cs | 113 +- .../Models/SharePointSharePointLibrary.cs | 103 +- .../Models/SmFacebookAccount.cs | 115 +- .../Models/SmFacebookApplication.cs | 85 +- .../Models/SmFacebookPost.cs | 177 +- Migration.Toolkit.K11/Models/SmInsight.cs | 77 +- .../Models/SmInsightHitDay.cs | 57 +- .../Models/SmInsightHitMonth.cs | 57 +- .../Models/SmInsightHitWeek.cs | 57 +- .../Models/SmInsightHitYear.cs | 57 +- .../Models/SmLinkedInAccount.cs | 101 +- .../Models/SmLinkedInApplication.cs | 79 +- .../Models/SmLinkedInPost.cs | 169 +- .../Models/SmTwitterAccount.cs | 127 +- .../Models/SmTwitterApplication.cs | 85 +- Migration.Toolkit.K11/Models/SmTwitterPost.cs | 141 +- Migration.Toolkit.K11/Models/StagingServer.cs | 123 +- .../Models/StagingSynchronization.cs | 69 +- Migration.Toolkit.K11/Models/StagingTask.cs | 127 +- .../Models/StagingTaskGroup.cs | 53 +- .../Models/StagingTaskGroupTask.cs | 61 +- .../Models/StagingTaskGroupUser.cs | 61 +- .../Models/StagingTaskUser.cs | 61 +- .../Models/StorecontentBook.cs | 49 +- .../Models/StorecontentCellPhone.cs | 141 +- .../Models/StorecontentComputer.cs | 79 +- .../Models/StorecontentCup.cs | 45 +- .../Models/StorecontentLaptop.cs | 125 +- .../Models/StorecontentMediaPlayer.cs | 71 +- .../Models/StorecontentPant.cs | 39 +- .../Models/StorecontentPerfume.cs | 39 +- .../Models/StorecontentShoe.cs | 39 +- .../Models/StorecontentTablet.cs | 107 +- .../Models/StorecontentTshirt.cs | 39 +- .../Models/StorecontentTv.cs | 97 +- .../Models/StorecontentWatch.cs | 57 +- Migration.Toolkit.K11/Models/TempFile.cs | 97 +- .../Models/ViewBoardsBoardMessageJoined.cs | 317 +- .../Models/ViewCmsAclitemItemsAndOperator.cs | 89 +- .../ViewCmsObjectVersionHistoryUserJoined.cs | 247 +- ...sPageTemplateCategoryPageTemplateJoined.cs | 115 +- .../Models/ViewCmsRelationshipJoined.cs | 101 +- .../Models/ViewCmsResourceStringJoined.cs | 87 +- .../Models/ViewCmsResourceTranslatedJoined.cs | 55 +- .../ViewCmsRoleResourcePermissionJoined.cs | 45 +- .../Models/ViewCmsSiteDocumentCount.cs | 93 +- .../ViewCmsSiteRoleResourceUielementJoined.cs | 57 +- .../Models/ViewCmsTreeJoined.cs | 583 +- Migration.Toolkit.K11/Models/ViewCmsUser.cs | 435 +- .../Models/ViewCmsUserDocument.cs | 111 +- .../Models/ViewCmsUserRoleJoined.cs | 97 +- .../Models/ViewCmsUserRoleMembershipRole.cs | 49 +- ...msUserRoleMembershipRoleValidOnlyJoined.cs | 36 +- .../Models/ViewCmsUserSettingsRoleJoined.cs | 83 +- .../ViewCmsWebPartCategoryWebpartJoined.cs | 135 +- .../ViewCmsWidgetCategoryWidgetJoined.cs | 127 +- ...omSkuoptionCategoryOptionCategoryJoined.cs | 127 +- .../Models/ViewCommunityFriendFriend.cs | 487 +- .../ViewCommunityFriendRequestedFriend.cs | 487 +- .../Models/ViewCommunityGroup.cs | 133 +- .../Models/ViewCommunityMember.cs | 497 +- .../Models/ViewForumsGroupForumPostJoined.cs | 455 +- .../Models/ViewIntegrationTaskJoined.cs | 129 +- .../ViewMembershipMembershipUserJoined.cs | 61 +- .../Models/ViewMessagingContactList.cs | 67 +- .../Models/ViewMessagingIgnoreList.cs | 51 +- .../ViewNewsletterSubscriptionsJoined.cs | 77 +- .../ViewOmAccountContactAccountJoined.cs | 63 +- .../ViewOmAccountContactContactJoined.cs | 81 +- .../Models/ViewOmAccountJoined.cs | 203 +- .../ViewOmContactGroupMemberAccountJoined.cs | 155 +- .../ViewOmContactGroupMemberContactJoined.cs | 201 +- .../Models/ViewPollAnswerCount.cs | 103 +- .../ViewReportingCategoryReportJoined.cs | 103 +- Migration.Toolkit.K11/SettingsKeys.cs | 1499 +- Migration.Toolkit.K11/SettingsKeys.tt | 2 - Migration.Toolkit.K11/genModel.ps1 | 6 +- .../Auxiliary/Kx13FormControls.cs | 467 +- Migration.Toolkit.KX12/Context/KX12Context.cs | 10281 +++++++------- .../ContextCustomizations.cs | 28 +- .../DependencyInjectionExtensions.cs | 31 +- .../Migration.Toolkit.KX12.csproj | 12 +- .../Models/AnalyticsCampaign.cs | 147 +- .../Models/AnalyticsCampaignAsset.cs | 69 +- .../Models/AnalyticsCampaignAssetUrl.cs | 59 +- .../Models/AnalyticsCampaignConversion.cs | 111 +- .../Models/AnalyticsCampaignConversionHit.cs | 61 +- .../Models/AnalyticsCampaignObjective.cs | 73 +- .../Models/AnalyticsConversion.cs | 71 +- .../Models/AnalyticsDayHit.cs | 61 +- .../Models/AnalyticsExitPage.cs | 53 +- .../Models/AnalyticsHourHit.cs | 61 +- .../Models/AnalyticsMonthHit.cs | 61 +- .../Models/AnalyticsStatistic.cs | 99 +- .../Models/AnalyticsWeekHit.cs | 61 +- .../Models/AnalyticsYearHit.cs | 61 +- Migration.Toolkit.KX12/Models/BadWordsWord.cs | 77 +- Migration.Toolkit.KX12/Models/BlogComment.cs | 121 +- .../Models/BlogPostSubscription.cs | 87 +- Migration.Toolkit.KX12/Models/BoardBoard.cs | 233 +- Migration.Toolkit.KX12/Models/BoardMessage.cs | 139 +- .../Models/BoardSubscription.cs | 87 +- .../Models/ChatInitiatedChatRequest.cs | 99 +- Migration.Toolkit.KX12/Models/ChatMessage.cs | 107 +- .../Models/ChatNotification.cs | 109 +- .../Models/ChatOnlineSupport.cs | 73 +- .../Models/ChatOnlineUser.cs | 85 +- .../Models/ChatPopupWindowSetting.cs | 55 +- Migration.Toolkit.KX12/Models/ChatRoom.cs | 161 +- Migration.Toolkit.KX12/Models/ChatRoomUser.cs | 87 +- .../Models/ChatSupportCannedResponse.cs | 79 +- .../Models/ChatSupportTakenRoom.cs | 69 +- Migration.Toolkit.KX12/Models/ChatUser.cs | 121 +- .../Models/CiFileMetadatum.cs | 43 +- Migration.Toolkit.KX12/Models/CiMigration.cs | 47 +- .../Models/CmsAbuseReport.cs | 113 +- Migration.Toolkit.KX12/Models/CmsAcl.cs | 77 +- Migration.Toolkit.KX12/Models/CmsAclitem.cs | 111 +- .../Models/CmsAlternativeForm.cs | 119 +- .../Models/CmsAlternativeUrl.cs | 75 +- .../Models/CmsAttachment.cs | 181 +- .../Models/CmsAttachmentHistory.cs | 179 +- .../Models/CmsAutomationHistory.cs | 163 +- .../Models/CmsAutomationState.cs | 141 +- Migration.Toolkit.KX12/Models/CmsAvatar.cs | 121 +- Migration.Toolkit.KX12/Models/CmsBadge.cs | 71 +- Migration.Toolkit.KX12/Models/CmsBannedIp.cs | 107 +- Migration.Toolkit.KX12/Models/CmsBanner.cs | 127 +- .../Models/CmsBannerCategory.cs | 79 +- Migration.Toolkit.KX12/Models/CmsCategory.cs | 133 +- Migration.Toolkit.KX12/Models/CmsClass.cs | 441 +- Migration.Toolkit.KX12/Models/CmsConsent.cs | 69 +- .../Models/CmsConsentAgreement.cs | 77 +- .../Models/CmsConsentArchive.cs | 63 +- Migration.Toolkit.KX12/Models/CmsCountry.cs | 97 +- .../Models/CmsCssStylesheet.cs | 99 +- Migration.Toolkit.KX12/Models/CmsCulture.cs | 121 +- .../Models/CmsDeviceProfile.cs | 87 +- .../Models/CmsDeviceProfileLayout.cs | 87 +- Migration.Toolkit.KX12/Models/CmsDocument.cs | 587 +- .../Models/CmsDocumentAlias.cs | 109 +- .../Models/CmsDocumentTypeScope.cs | 89 +- Migration.Toolkit.KX12/Models/CmsEmail.cs | 137 +- .../Models/CmsEmailAttachment.cs | 85 +- .../Models/CmsEmailTemplate.cs | 117 +- Migration.Toolkit.KX12/Models/CmsEmailUser.cs | 71 +- Migration.Toolkit.KX12/Models/CmsEventLog.cs | 113 +- .../Models/CmsExternalLogin.cs | 57 +- Migration.Toolkit.KX12/Models/CmsForm.cs | 189 +- .../Models/CmsFormUserControl.cs | 217 +- Migration.Toolkit.KX12/Models/CmsHelpTopic.cs | 75 +- Migration.Toolkit.KX12/Models/CmsLayout.cs | 125 +- .../Models/CmsLicenseKey.cs | 53 +- .../Models/CmsMacroIdentity.cs | 65 +- Migration.Toolkit.KX12/Models/CmsMacroRule.cs | 97 +- .../Models/CmsMembership.cs | 85 +- .../Models/CmsMembershipUser.cs | 69 +- Migration.Toolkit.KX12/Models/CmsMetaFile.cs | 123 +- .../Models/CmsModuleLicenseKey.cs | 57 +- .../Models/CmsModuleUsageCounter.cs | 39 +- .../Models/CmsObjectSetting.cs | 123 +- .../Models/CmsObjectVersionHistory.cs | 145 +- .../Models/CmsObjectWorkflowTrigger.cs | 91 +- .../Models/CmsOpenIduser.cs | 61 +- .../Models/CmsPageTemplate.cs | 271 +- .../Models/CmsPageTemplateCategory.cs | 109 +- .../Models/CmsPageTemplateConfiguration.cs | 79 +- .../Models/CmsPageTemplateScope.cs | 113 +- .../Models/CmsPermission.cs | 131 +- .../Models/CmsPersonalization.cs | 98 +- Migration.Toolkit.KX12/Models/CmsQuery.cs | 89 +- .../Models/CmsRelationship.cs | 89 +- .../Models/CmsRelationshipName.cs | 77 +- Migration.Toolkit.KX12/Models/CmsResource.cs | 169 +- .../Models/CmsResourceLibrary.cs | 51 +- .../Models/CmsResourceString.cs | 53 +- .../Models/CmsResourceTranslation.cs | 65 +- Migration.Toolkit.KX12/Models/CmsRole.cs | 195 +- .../Models/CmsScheduledTask.cs | 223 +- .../Models/CmsSearchEngine.cs | 67 +- .../Models/CmsSearchIndex.cs | 173 +- .../Models/CmsSearchTask.cs | 81 +- .../Models/CmsSearchTaskAzure.cs | 73 +- Migration.Toolkit.KX12/Models/CmsSession.cs | 131 +- .../Models/CmsSettingsCategory.cs | 119 +- .../Models/CmsSettingsKey.cs | 137 +- Migration.Toolkit.KX12/Models/CmsSite.cs | 827 +- .../Models/CmsSiteDomainAlias.cs | 81 +- .../Models/CmsSmtpserver.cs | 91 +- Migration.Toolkit.KX12/Models/CmsState.cs | 105 +- Migration.Toolkit.KX12/Models/CmsTag.cs | 69 +- Migration.Toolkit.KX12/Models/CmsTagGroup.cs | 87 +- .../Models/CmsTemplateDeviceLayout.cs | 111 +- Migration.Toolkit.KX12/Models/CmsTimeZone.cs | 85 +- .../Models/CmsTransformation.cs | 101 +- .../Models/CmsTranslationService.cs | 105 +- .../Models/CmsTranslationSubmission.cs | 151 +- .../Models/CmsTranslationSubmissionItem.cs | 115 +- Migration.Toolkit.KX12/Models/CmsTree.cs | 367 +- Migration.Toolkit.KX12/Models/CmsUielement.cs | 231 +- Migration.Toolkit.KX12/Models/CmsUser.cs | 611 +- .../Models/CmsUserCulture.cs | 75 +- .../Models/CmsUserMacroIdentity.cs | 69 +- Migration.Toolkit.KX12/Models/CmsUserRole.cs | 67 +- .../Models/CmsUserSetting.cs | 335 +- Migration.Toolkit.KX12/Models/CmsUserSite.cs | 61 +- .../Models/CmsVersionHistory.cs | 233 +- .../Models/CmsWebFarmServer.cs | 67 +- .../Models/CmsWebFarmServerLog.cs | 43 +- .../Models/CmsWebFarmServerMonitoring.cs | 37 +- .../Models/CmsWebFarmServerTask.cs | 61 +- .../Models/CmsWebFarmTask.cs | 83 +- Migration.Toolkit.KX12/Models/CmsWebPart.cs | 171 +- .../Models/CmsWebPartCategory.cs | 101 +- .../Models/CmsWebPartContainer.cs | 75 +- .../Models/CmsWebPartLayout.cs | 99 +- .../Models/CmsWebTemplate.cs | 79 +- Migration.Toolkit.KX12/Models/CmsWidget.cs | 167 +- .../Models/CmsWidgetCategory.cs | 101 +- .../Models/CmsWidgetRole.cs | 75 +- Migration.Toolkit.KX12/Models/CmsWorkflow.cs | 189 +- .../Models/CmsWorkflowAction.cs | 131 +- .../Models/CmsWorkflowHistory.cs | 175 +- .../Models/CmsWorkflowScope.cs | 119 +- .../Models/CmsWorkflowStep.cs | 229 +- .../Models/CmsWorkflowStepRole.cs | 65 +- .../Models/CmsWorkflowStepUser.cs | 65 +- .../Models/CmsWorkflowTransition.cs | 91 +- Migration.Toolkit.KX12/Models/ComAddress.cs | 147 +- Migration.Toolkit.KX12/Models/ComBrand.cs | 101 +- Migration.Toolkit.KX12/Models/ComCarrier.cs | 85 +- .../Models/ComCollection.cs | 89 +- .../Models/ComCouponCode.cs | 69 +- Migration.Toolkit.KX12/Models/ComCurrency.cs | 111 +- .../Models/ComCurrencyExchangeRate.cs | 77 +- Migration.Toolkit.KX12/Models/ComCustomer.cs | 157 +- .../Models/ComCustomerCreditHistory.cs | 91 +- .../Models/ComDepartment.cs | 101 +- Migration.Toolkit.KX12/Models/ComDiscount.cs | 147 +- .../Models/ComExchangeTable.cs | 81 +- Migration.Toolkit.KX12/Models/ComGiftCard.cs | 117 +- .../Models/ComGiftCardCouponCode.cs | 65 +- .../Models/ComInternalStatus.cs | 79 +- .../Models/ComManufacturer.cs | 95 +- .../Models/ComMultiBuyCouponCode.cs | 69 +- .../Models/ComMultiBuyDiscount.cs | 195 +- .../Models/ComMultiBuyDiscountBrand.cs | 63 +- .../Models/ComMultiBuyDiscountCollection.cs | 63 +- .../Models/ComMultiBuyDiscountTree.cs | 63 +- .../Models/ComOptionCategory.cs | 131 +- Migration.Toolkit.KX12/Models/ComOrder.cs | 263 +- .../Models/ComOrderAddress.cs | 127 +- Migration.Toolkit.KX12/Models/ComOrderItem.cs | 139 +- .../Models/ComOrderItemSkufile.cs | 65 +- .../Models/ComOrderStatus.cs | 127 +- .../Models/ComOrderStatusUser.cs | 101 +- .../Models/ComPaymentOption.cs | 165 +- .../Models/ComPublicStatus.cs | 79 +- .../Models/ComShippingCost.cs | 65 +- .../Models/ComShippingOption.cs | 139 +- .../Models/ComShoppingCart.cs | 213 +- .../Models/ComShoppingCartCouponCode.cs | 51 +- .../Models/ComShoppingCartSku.cs | 97 +- Migration.Toolkit.KX12/Models/ComSku.cs | 555 +- Migration.Toolkit.KX12/Models/ComSkufile.cs | 85 +- .../Models/ComSkuoptionCategory.cs | 71 +- Migration.Toolkit.KX12/Models/ComSupplier.cs | 97 +- Migration.Toolkit.KX12/Models/ComTaxClass.cs | 103 +- .../Models/ComTaxClassCountry.cs | 67 +- .../Models/ComTaxClassState.cs | 67 +- .../Models/ComVolumeDiscount.cs | 69 +- Migration.Toolkit.KX12/Models/ComWishlist.cs | 75 +- .../Models/CommunityGroup.cs | 219 +- .../Models/CommunityGroupMember.cs | 121 +- .../Models/CommunityGroupRolePermission.cs | 75 +- .../Models/CommunityInvitation.cs | 105 +- Migration.Toolkit.KX12/Models/ContentFile.cs | 43 +- .../Models/EventsAttendee.cs | 79 +- .../Models/ExportHistory.cs | 75 +- Migration.Toolkit.KX12/Models/ExportTask.cs | 77 +- .../Models/ForumsAttachment.cs | 105 +- Migration.Toolkit.KX12/Models/ForumsForum.cs | 293 +- .../Models/ForumsForumGroup.cs | 177 +- .../Models/ForumsForumPost.cs | 247 +- .../Models/ForumsForumRole.cs | 75 +- .../Models/ForumsForumSubscription.cs | 103 +- .../Models/ForumsUserFavorite.cs | 111 +- .../Models/IntegrationConnector.cs | 71 +- .../Models/IntegrationSyncLog.cs | 53 +- .../Models/IntegrationSynchronization.cs | 79 +- .../Models/IntegrationTask.cs | 119 +- Migration.Toolkit.KX12/Models/MediaFile.cs | 155 +- Migration.Toolkit.KX12/Models/MediaLibrary.cs | 121 +- .../Models/MediaLibraryRolePermission.cs | 75 +- .../Models/NewsletterAbtest.cs | 107 +- .../Models/NewsletterClickedLink.cs | 59 +- .../Models/NewsletterEmail.cs | 111 +- .../Models/NewsletterEmailTemplate.cs | 137 +- .../Models/NewsletterEmailWidget.cs | 95 +- .../Models/NewsletterEmailWidgetTemplate.cs | 61 +- .../Models/NewsletterIssueContactGroup.cs | 51 +- .../Models/NewsletterLink.cs | 67 +- .../Models/NewsletterNewsletter.cs | 231 +- .../Models/NewsletterNewsletterIssue.cs | 251 +- .../Models/NewsletterOpenedEmail.cs | 59 +- .../Models/NewsletterSubscriber.cs | 113 +- .../Models/NewsletterSubscriberNewsletter.cs | 79 +- .../Models/NewsletterUnsubscription.cs | 79 +- .../Models/NotificationGateway.cs | 95 +- .../Models/NotificationSubscription.cs | 153 +- .../Models/NotificationTemplate.cs | 79 +- .../Models/NotificationTemplateText.cs | 87 +- Migration.Toolkit.KX12/Models/OmAbtest.cs | 143 +- Migration.Toolkit.KX12/Models/OmAbvariant.cs | 97 +- .../Models/OmAbvariantDatum.cs | 65 +- Migration.Toolkit.KX12/Models/OmAccount.cs | 227 +- .../Models/OmAccountContact.cs | 77 +- .../Models/OmAccountStatus.cs | 49 +- Migration.Toolkit.KX12/Models/OmActivity.cs | 157 +- .../Models/OmActivityRecalculationQueue.cs | 33 +- .../Models/OmActivityType.cs | 77 +- Migration.Toolkit.KX12/Models/OmContact.cs | 281 +- .../OmContactChangeRecalculationQueue.cs | 45 +- .../Models/OmContactGroup.cs | 77 +- .../Models/OmContactGroupMember.cs | 71 +- .../Models/OmContactRole.cs | 49 +- .../Models/OmContactStatus.cs | 49 +- Migration.Toolkit.KX12/Models/OmMembership.cs | 67 +- .../Models/OmMvtcombination.cs | 97 +- Migration.Toolkit.KX12/Models/OmMvtest.cs | 133 +- Migration.Toolkit.KX12/Models/OmMvtvariant.cs | 121 +- .../Models/OmPersonalizationVariant.cs | 119 +- Migration.Toolkit.KX12/Models/OmRule.cs | 117 +- Migration.Toolkit.KX12/Models/OmScore.cs | 93 +- .../Models/OmScoreContactRule.cs | 87 +- .../Models/OmVisitorToContact.cs | 53 +- .../Models/PersonasPersona.cs | 81 +- .../Models/PersonasPersonaContactHistory.cs | 55 +- .../Models/PersonasPersonaNode.cs | 51 +- Migration.Toolkit.KX12/Models/PollsPoll.cs | 143 +- .../Models/PollsPollAnswer.cs | 89 +- .../Models/ReportingReport.cs | 123 +- .../Models/ReportingReportCategory.cs | 101 +- .../Models/ReportingReportGraph.cs | 137 +- .../Models/ReportingReportSubscription.cs | 185 +- .../Models/ReportingReportTable.cs | 93 +- .../Models/ReportingReportValue.cs | 99 +- .../Models/ReportingSavedGraph.cs | 67 +- .../Models/ReportingSavedReport.cs | 95 +- .../Models/SharePointSharePointConnection.cs | 109 +- .../Models/SharePointSharePointFile.cs | 113 +- .../Models/SharePointSharePointLibrary.cs | 103 +- .../Models/SmFacebookAccount.cs | 109 +- .../Models/SmFacebookApplication.cs | 85 +- .../Models/SmFacebookPost.cs | 177 +- Migration.Toolkit.KX12/Models/SmInsight.cs | 77 +- .../Models/SmInsightHitDay.cs | 57 +- .../Models/SmInsightHitMonth.cs | 57 +- .../Models/SmInsightHitWeek.cs | 57 +- .../Models/SmInsightHitYear.cs | 57 +- .../Models/SmLinkedInAccount.cs | 95 +- .../Models/SmLinkedInApplication.cs | 79 +- .../Models/SmLinkedInPost.cs | 169 +- .../Models/SmTwitterAccount.cs | 127 +- .../Models/SmTwitterApplication.cs | 85 +- .../Models/SmTwitterPost.cs | 141 +- .../Models/StagingServer.cs | 123 +- .../Models/StagingSynchronization.cs | 69 +- Migration.Toolkit.KX12/Models/StagingTask.cs | 127 +- .../Models/StagingTaskGroup.cs | 53 +- .../Models/StagingTaskGroupTask.cs | 61 +- .../Models/StagingTaskGroupUser.cs | 61 +- .../Models/StagingTaskUser.cs | 61 +- Migration.Toolkit.KX12/Models/TempFile.cs | 97 +- .../Models/TempPageBuilderWidget.cs | 43 +- .../Models/ViewBoardsBoardMessageJoined.cs | 317 +- .../Models/ViewCmsAclitemItemsAndOperator.cs | 89 +- .../ViewCmsObjectVersionHistoryUserJoined.cs | 247 +- ...sPageTemplateCategoryPageTemplateJoined.cs | 115 +- .../Models/ViewCmsRelationshipJoined.cs | 101 +- .../Models/ViewCmsResourceStringJoined.cs | 87 +- .../Models/ViewCmsResourceTranslatedJoined.cs | 55 +- .../ViewCmsRoleResourcePermissionJoined.cs | 45 +- .../Models/ViewCmsSiteDocumentCount.cs | 93 +- .../ViewCmsSiteRoleResourceUielementJoined.cs | 57 +- .../Models/ViewCmsTreeJoined.cs | 597 +- Migration.Toolkit.KX12/Models/ViewCmsUser.cs | 429 +- .../Models/ViewCmsUserDocument.cs | 111 +- .../Models/ViewCmsUserRoleJoined.cs | 97 +- .../Models/ViewCmsUserRoleMembershipRole.cs | 49 +- ...msUserRoleMembershipRoleValidOnlyJoined.cs | 36 +- .../Models/ViewCmsUserSettingsRoleJoined.cs | 83 +- .../ViewCmsWebPartCategoryWebpartJoined.cs | 135 +- .../ViewCmsWidgetCategoryWidgetJoined.cs | 127 +- ...omSkuoptionCategoryOptionCategoryJoined.cs | 127 +- .../Models/ViewCommunityGroup.cs | 133 +- .../Models/ViewCommunityMember.cs | 491 +- .../Models/ViewForumsGroupForumPostJoined.cs | 455 +- .../Models/ViewIntegrationTaskJoined.cs | 129 +- .../ViewMembershipMembershipUserJoined.cs | 61 +- .../ViewNewsletterSubscriptionsJoined.cs | 77 +- .../ViewOmAccountContactAccountJoined.cs | 63 +- .../ViewOmAccountContactContactJoined.cs | 81 +- .../Models/ViewOmAccountJoined.cs | 203 +- .../ViewOmContactGroupMemberAccountJoined.cs | 155 +- .../Models/ViewPollAnswerCount.cs | 103 +- .../ViewReportingCategoryReportJoined.cs | 103 +- Migration.Toolkit.KX12/SettingsKeys.cs | 1498 +- Migration.Toolkit.KX12/SettingsKeys.tt | 2 - Migration.Toolkit.KX12/genModel.ps1 | 6 +- Migration.Toolkit.KX13/Context/KX13Context.cs | 8039 ++++++----- .../DependencyInjectionExtensions.cs | 31 +- .../KX13ContextCustomizations.cs | 28 +- .../Migration.Toolkit.KX13.csproj | 40 +- .../Models/AnalyticsCampaign.cs | 147 +- .../Models/AnalyticsCampaignAsset.cs | 69 +- .../Models/AnalyticsCampaignAssetUrl.cs | 59 +- .../Models/AnalyticsCampaignConversion.cs | 111 +- .../Models/AnalyticsCampaignConversionHit.cs | 61 +- .../Models/AnalyticsCampaignObjective.cs | 73 +- .../Models/AnalyticsDayHit.cs | 61 +- .../Models/AnalyticsExitPage.cs | 65 +- .../Models/AnalyticsHourHit.cs | 61 +- .../Models/AnalyticsMonthHit.cs | 61 +- .../Models/AnalyticsStatistic.cs | 99 +- .../Models/AnalyticsWeekHit.cs | 61 +- .../Models/AnalyticsYearHit.cs | 61 +- .../Models/CiFileMetadatum.cs | 43 +- Migration.Toolkit.KX13/Models/CiMigration.cs | 47 +- Migration.Toolkit.KX13/Models/CmsAcl.cs | 77 +- Migration.Toolkit.KX13/Models/CmsAclitem.cs | 111 +- .../Models/CmsAlternativeForm.cs | 119 +- .../Models/CmsAlternativeUrl.cs | 77 +- .../Models/CmsAttachment.cs | 181 +- .../Models/CmsAttachmentHistory.cs | 179 +- .../Models/CmsAutomationHistory.cs | 163 +- .../Models/CmsAutomationState.cs | 141 +- .../Models/CmsAutomationTemplate.cs | 59 +- Migration.Toolkit.KX13/Models/CmsAvatar.cs | 87 +- Migration.Toolkit.KX13/Models/CmsCategory.cs | 133 +- Migration.Toolkit.KX13/Models/CmsClass.cs | 391 +- Migration.Toolkit.KX13/Models/CmsConsent.cs | 69 +- .../Models/CmsConsentAgreement.cs | 77 +- .../Models/CmsConsentArchive.cs | 63 +- Migration.Toolkit.KX13/Models/CmsCountry.cs | 97 +- Migration.Toolkit.KX13/Models/CmsCulture.cs | 107 +- Migration.Toolkit.KX13/Models/CmsDocument.cs | 333 +- .../Models/CmsDocumentTypeScope.cs | 83 +- Migration.Toolkit.KX13/Models/CmsEmail.cs | 137 +- .../Models/CmsEmailAttachment.cs | 85 +- .../Models/CmsEmailTemplate.cs | 117 +- Migration.Toolkit.KX13/Models/CmsEmailUser.cs | 71 +- Migration.Toolkit.KX13/Models/CmsEventLog.cs | 113 +- .../Models/CmsExternalLogin.cs | 57 +- Migration.Toolkit.KX13/Models/CmsForm.cs | 187 +- .../Models/CmsFormUserControl.cs | 189 +- Migration.Toolkit.KX13/Models/CmsHelpTopic.cs | 75 +- Migration.Toolkit.KX13/Models/CmsLayout.cs | 87 +- .../Models/CmsLicenseKey.cs | 53 +- .../Models/CmsMacroIdentity.cs | 65 +- Migration.Toolkit.KX13/Models/CmsMacroRule.cs | 97 +- .../Models/CmsMembership.cs | 85 +- .../Models/CmsMembershipUser.cs | 69 +- Migration.Toolkit.KX13/Models/CmsMetaFile.cs | 123 +- .../Models/CmsModuleLicenseKey.cs | 57 +- .../Models/CmsModuleUsageCounter.cs | 39 +- .../Models/CmsObjectSetting.cs | 123 +- .../Models/CmsObjectVersionHistory.cs | 145 +- .../Models/CmsObjectWorkflowTrigger.cs | 91 +- .../Models/CmsPageFormerUrlPath.cs | 85 +- .../Models/CmsPageTemplate.cs | 147 +- .../Models/CmsPageTemplateCategory.cs | 103 +- .../Models/CmsPageTemplateConfiguration.cs | 79 +- .../Models/CmsPageUrlPath.cs | 91 +- .../Models/CmsPermission.cs | 119 +- .../Models/CmsPersonalization.cs | 81 +- Migration.Toolkit.KX13/Models/CmsQuery.cs | 89 +- .../Models/CmsRelationship.cs | 89 +- .../Models/CmsRelationshipName.cs | 77 +- Migration.Toolkit.KX13/Models/CmsResource.cs | 169 +- .../Models/CmsResourceLibrary.cs | 51 +- .../Models/CmsResourceString.cs | 53 +- .../Models/CmsResourceTranslation.cs | 65 +- Migration.Toolkit.KX13/Models/CmsRole.cs | 145 +- .../Models/CmsScheduledTask.cs | 227 +- .../Models/CmsSearchEngine.cs | 67 +- .../Models/CmsSearchIndex.cs | 151 +- .../Models/CmsSearchTask.cs | 87 +- .../Models/CmsSearchTaskAzure.cs | 79 +- .../Models/CmsSettingsCategory.cs | 119 +- .../Models/CmsSettingsKey.cs | 137 +- Migration.Toolkit.KX13/Models/CmsSite.cs | 621 +- .../Models/CmsSiteDomainAlias.cs | 79 +- .../Models/CmsSmtpserver.cs | 91 +- Migration.Toolkit.KX13/Models/CmsState.cs | 105 +- Migration.Toolkit.KX13/Models/CmsTag.cs | 69 +- Migration.Toolkit.KX13/Models/CmsTagGroup.cs | 87 +- Migration.Toolkit.KX13/Models/CmsTimeZone.cs | 85 +- .../Models/CmsTransformation.cs | 79 +- .../Models/CmsTranslationService.cs | 101 +- .../Models/CmsTranslationSubmission.cs | 151 +- .../Models/CmsTranslationSubmissionItem.cs | 115 +- Migration.Toolkit.KX13/Models/CmsTree.cs | 281 +- Migration.Toolkit.KX13/Models/CmsUielement.cs | 231 +- Migration.Toolkit.KX13/Models/CmsUser.cs | 447 +- .../Models/CmsUserCulture.cs | 75 +- .../Models/CmsUserMacroIdentity.cs | 69 +- Migration.Toolkit.KX13/Models/CmsUserRole.cs | 67 +- .../Models/CmsUserSetting.cs | 243 +- Migration.Toolkit.KX13/Models/CmsUserSite.cs | 61 +- .../Models/CmsVersionHistory.cs | 215 +- .../Models/CmsWebFarmServer.cs | 67 +- .../Models/CmsWebFarmServerLog.cs | 43 +- .../Models/CmsWebFarmServerMonitoring.cs | 37 +- .../Models/CmsWebFarmServerTask.cs | 61 +- .../Models/CmsWebFarmTask.cs | 83 +- Migration.Toolkit.KX13/Models/CmsWebPart.cs | 167 +- .../Models/CmsWebPartCategory.cs | 101 +- .../Models/CmsWebPartContainer.cs | 75 +- .../Models/CmsWebPartLayout.cs | 99 +- Migration.Toolkit.KX13/Models/CmsWidget.cs | 145 +- .../Models/CmsWidgetCategory.cs | 101 +- .../Models/CmsWidgetRole.cs | 75 +- Migration.Toolkit.KX13/Models/CmsWorkflow.cs | 189 +- .../Models/CmsWorkflowAction.cs | 143 +- .../Models/CmsWorkflowHistory.cs | 175 +- .../Models/CmsWorkflowScope.cs | 119 +- .../Models/CmsWorkflowStep.cs | 229 +- .../Models/CmsWorkflowStepRole.cs | 65 +- .../Models/CmsWorkflowStepUser.cs | 65 +- .../Models/CmsWorkflowTransition.cs | 91 +- Migration.Toolkit.KX13/Models/ComAddress.cs | 147 +- Migration.Toolkit.KX13/Models/ComBrand.cs | 101 +- Migration.Toolkit.KX13/Models/ComCarrier.cs | 85 +- .../Models/ComCollection.cs | 89 +- .../Models/ComCouponCode.cs | 69 +- Migration.Toolkit.KX13/Models/ComCurrency.cs | 111 +- .../Models/ComCurrencyExchangeRate.cs | 77 +- Migration.Toolkit.KX13/Models/ComCustomer.cs | 157 +- .../Models/ComCustomerCreditHistory.cs | 91 +- .../Models/ComDepartment.cs | 101 +- Migration.Toolkit.KX13/Models/ComDiscount.cs | 147 +- .../Models/ComExchangeTable.cs | 81 +- Migration.Toolkit.KX13/Models/ComGiftCard.cs | 117 +- .../Models/ComGiftCardCouponCode.cs | 65 +- .../Models/ComInternalStatus.cs | 79 +- .../Models/ComManufacturer.cs | 95 +- .../Models/ComMultiBuyCouponCode.cs | 69 +- .../Models/ComMultiBuyDiscount.cs | 195 +- .../Models/ComMultiBuyDiscountBrand.cs | 63 +- .../Models/ComMultiBuyDiscountCollection.cs | 63 +- .../Models/ComMultiBuyDiscountTree.cs | 63 +- .../Models/ComOptionCategory.cs | 131 +- Migration.Toolkit.KX13/Models/ComOrder.cs | 263 +- .../Models/ComOrderAddress.cs | 127 +- Migration.Toolkit.KX13/Models/ComOrderItem.cs | 139 +- .../Models/ComOrderItemSkufile.cs | 65 +- .../Models/ComOrderStatus.cs | 127 +- .../Models/ComOrderStatusUser.cs | 101 +- .../Models/ComPaymentOption.cs | 165 +- .../Models/ComPublicStatus.cs | 79 +- .../Models/ComShippingCost.cs | 65 +- .../Models/ComShippingOption.cs | 139 +- .../Models/ComShoppingCart.cs | 213 +- .../Models/ComShoppingCartCouponCode.cs | 51 +- .../Models/ComShoppingCartSku.cs | 97 +- Migration.Toolkit.KX13/Models/ComSku.cs | 539 +- Migration.Toolkit.KX13/Models/ComSkufile.cs | 85 +- .../Models/ComSkuoptionCategory.cs | 71 +- Migration.Toolkit.KX13/Models/ComSupplier.cs | 97 +- Migration.Toolkit.KX13/Models/ComTaxClass.cs | 103 +- .../Models/ComTaxClassCountry.cs | 67 +- .../Models/ComTaxClassState.cs | 67 +- .../Models/ComVolumeDiscount.cs | 69 +- Migration.Toolkit.KX13/Models/ComWishlist.cs | 75 +- .../Models/ExportHistory.cs | 75 +- Migration.Toolkit.KX13/Models/ExportTask.cs | 77 +- .../Models/IntegrationConnector.cs | 71 +- .../Models/IntegrationSyncLog.cs | 53 +- .../Models/IntegrationSynchronization.cs | 79 +- .../Models/IntegrationTask.cs | 119 +- Migration.Toolkit.KX13/Models/MediaFile.cs | 155 +- Migration.Toolkit.KX13/Models/MediaLibrary.cs | 109 +- .../Models/MediaLibraryRolePermission.cs | 75 +- .../Models/NewsletterAbtest.cs | 107 +- .../Models/NewsletterClickedLink.cs | 59 +- .../Models/NewsletterEmail.cs | 111 +- .../Models/NewsletterEmailTemplate.cs | 137 +- .../Models/NewsletterEmailWidget.cs | 95 +- .../Models/NewsletterEmailWidgetTemplate.cs | 61 +- .../Models/NewsletterIssueContactGroup.cs | 51 +- .../Models/NewsletterLink.cs | 67 +- .../Models/NewsletterNewsletter.cs | 231 +- .../Models/NewsletterNewsletterIssue.cs | 255 +- .../Models/NewsletterOpenedEmail.cs | 59 +- .../Models/NewsletterSubscriber.cs | 113 +- .../Models/NewsletterSubscriberNewsletter.cs | 79 +- .../Models/NewsletterUnsubscription.cs | 79 +- Migration.Toolkit.KX13/Models/OmAbtest.cs | 137 +- .../Models/OmAbvariantDatum.cs | 65 +- Migration.Toolkit.KX13/Models/OmAccount.cs | 227 +- .../Models/OmAccountContact.cs | 77 +- .../Models/OmAccountStatus.cs | 49 +- Migration.Toolkit.KX13/Models/OmActivity.cs | 149 +- .../Models/OmActivityRecalculationQueue.cs | 33 +- .../Models/OmActivityType.cs | 85 +- Migration.Toolkit.KX13/Models/OmContact.cs | 281 +- .../OmContactChangeRecalculationQueue.cs | 45 +- .../Models/OmContactGroup.cs | 77 +- .../Models/OmContactGroupMember.cs | 71 +- .../Models/OmContactRole.cs | 49 +- .../Models/OmContactStatus.cs | 49 +- Migration.Toolkit.KX13/Models/OmMembership.cs | 67 +- Migration.Toolkit.KX13/Models/OmRule.cs | 141 +- Migration.Toolkit.KX13/Models/OmScore.cs | 103 +- .../Models/OmScoreContactRule.cs | 87 +- .../Models/OmVisitorToContact.cs | 53 +- .../Models/PersonasPersona.cs | 77 +- .../Models/PersonasPersonaContactHistory.cs | 55 +- .../Models/ReportingReport.cs | 123 +- .../Models/ReportingReportCategory.cs | 101 +- .../Models/ReportingReportGraph.cs | 137 +- .../Models/ReportingReportSubscription.cs | 185 +- .../Models/ReportingReportTable.cs | 93 +- .../Models/ReportingReportValue.cs | 99 +- .../Models/ReportingSavedGraph.cs | 67 +- .../Models/ReportingSavedReport.cs | 95 +- .../Models/SharePointSharePointConnection.cs | 91 +- .../Models/SharePointSharePointFile.cs | 113 +- .../Models/SharePointSharePointLibrary.cs | 103 +- .../Models/SmFacebookAccount.cs | 109 +- .../Models/SmFacebookApplication.cs | 85 +- .../Models/SmFacebookPost.cs | 177 +- Migration.Toolkit.KX13/Models/SmInsight.cs | 77 +- .../Models/SmInsightHitDay.cs | 57 +- .../Models/SmInsightHitMonth.cs | 57 +- .../Models/SmInsightHitWeek.cs | 57 +- .../Models/SmInsightHitYear.cs | 57 +- .../Models/SmLinkedInAccount.cs | 95 +- .../Models/SmLinkedInApplication.cs | 79 +- .../Models/SmLinkedInPost.cs | 169 +- .../Models/SmTwitterAccount.cs | 127 +- .../Models/SmTwitterApplication.cs | 85 +- .../Models/SmTwitterPost.cs | 141 +- .../Models/StagingServer.cs | 123 +- .../Models/StagingSynchronization.cs | 69 +- Migration.Toolkit.KX13/Models/StagingTask.cs | 127 +- .../Models/StagingTaskGroup.cs | 53 +- .../Models/StagingTaskGroupTask.cs | 61 +- .../Models/StagingTaskGroupUser.cs | 61 +- .../Models/StagingTaskUser.cs | 61 +- Migration.Toolkit.KX13/Models/TempFile.cs | 97 +- .../Models/TempPageBuilderWidget.cs | 43 +- .../Models/ViewCmsAclitemItemsAndOperator.cs | 83 +- .../ViewCmsObjectVersionHistoryUserJoined.cs | 243 +- ...sPageTemplateCategoryPageTemplateJoined.cs | 103 +- .../Models/ViewCmsRelationshipJoined.cs | 113 +- .../Models/ViewCmsResourceStringJoined.cs | 87 +- .../Models/ViewCmsResourceTranslatedJoined.cs | 55 +- .../ViewCmsRoleResourcePermissionJoined.cs | 45 +- .../Models/ViewCmsSiteDocumentCount.cs | 81 +- .../ViewCmsSiteRoleResourceUielementJoined.cs | 57 +- .../Models/ViewCmsTreeJoined.cs | 341 +- Migration.Toolkit.KX13/Models/ViewCmsUser.cs | 347 +- .../Models/ViewCmsUserDocument.cs | 105 +- .../Models/ViewCmsUserRoleJoined.cs | 91 +- .../Models/ViewCmsUserRoleMembershipRole.cs | 49 +- ...msUserRoleMembershipRoleValidOnlyJoined.cs | 36 +- .../Models/ViewCmsUserSettingsRoleJoined.cs | 83 +- .../ViewCmsWebPartCategoryWebpartJoined.cs | 135 +- .../ViewCmsWidgetCategoryWidgetJoined.cs | 107 +- ...omSkuoptionCategoryOptionCategoryJoined.cs | 127 +- .../Models/ViewIntegrationTaskJoined.cs | 129 +- .../ViewMembershipMembershipUserJoined.cs | 61 +- .../ViewNewsletterSubscriptionsJoined.cs | 77 +- .../ViewOmAccountContactAccountJoined.cs | 63 +- .../ViewOmAccountContactContactJoined.cs | 81 +- .../Models/ViewOmAccountJoined.cs | 203 +- .../ViewOmContactGroupMemberAccountJoined.cs | 155 +- .../ViewReportingCategoryReportJoined.cs | 103 +- Migration.Toolkit.KX13/SettingsKeys.cs | 958 +- Migration.Toolkit.KX13/SettingsKeys.tt | 2 - Migration.Toolkit.KX13/genModel.ps1 | 6 +- .../Auxiliary/DummyFormFile.cs | 66 +- .../Auxiliary/FormComponents.cs | 399 +- .../Auxiliary/UserHelper.cs | 9 + .../DependencyInjectionExtensions.cs | 55 +- .../Enums/UserPrivilegeLevelEnum.cs | 43 +- .../KxpApiInitializer.cs | 65 +- Migration.Toolkit.KXP.Api/KxpClassFacade.cs | 153 +- .../KxpMediaFileFacade.cs | 164 +- .../Migration.Toolkit.KXP.Api.csproj | 8 +- .../CmsClass/FieldMigrationService.cs | 172 +- .../CmsClass/FormDefinitionPatcher.cs | 843 +- .../CmsClass/FormFieldMappingModel.cs | 197 +- .../LegacyAttachmentHandler.cs | 190 +- .../Migration.Toolkit.KXP.Extensions.csproj | 10 +- Migration.Toolkit.KXP.Extensions/README.MD | 37 +- Migration.Toolkit.KXP/Context/KxpContext.cs | 2593 ++-- .../DependencyInjectionExtensions.cs | 42 +- .../Migration.Toolkit.KXP.csproj | 26 +- Migration.Toolkit.KXP/Models/CdMigration.cs | 47 +- .../Models/CiFileMetadatum.cs | 43 +- Migration.Toolkit.KXP/Models/CiMigration.cs | 47 +- .../Models/CmsAlternativeForm.cs | 97 +- .../Models/CmsApplicationPermission.cs | 63 +- .../Models/CmsAutomationHistory.cs | 163 +- .../Models/CmsAutomationState.cs | 125 +- .../Models/CmsAutomationTemplate.cs | 59 +- Migration.Toolkit.KXP/Models/CmsChannel.cs | 90 +- Migration.Toolkit.KXP/Models/CmsClass.cs | 193 +- Migration.Toolkit.KXP/Models/CmsConsent.cs | 69 +- .../Models/CmsConsentAgreement.cs | 77 +- .../Models/CmsConsentArchive.cs | 63 +- .../Models/CmsContentFolder.cs | 125 +- .../Models/CmsContentItem.cs | 133 +- .../Models/CmsContentItemCommonDatum.cs | 97 +- .../Models/CmsContentItemLanguageMetadatum.cs | 148 +- .../Models/CmsContentItemReference.cs | 75 +- .../Models/CmsContentItemTag.cs | 63 +- .../Models/CmsContentLanguage.cs | 103 +- .../Models/CmsContentTypeChannel.cs | 61 +- .../Models/CmsContentWorkflow.cs | 61 +- .../Models/CmsContentWorkflowContentType.cs | 61 +- .../Models/CmsContentWorkflowStep.cs | 95 +- .../Models/CmsContentWorkflowStepRole.cs | 61 +- Migration.Toolkit.KXP/Models/CmsCountry.cs | 79 +- Migration.Toolkit.KXP/Models/CmsCulture.cs | 79 +- Migration.Toolkit.KXP/Models/CmsEmail.cs | 137 +- .../Models/CmsEmailAttachment.cs | 79 +- Migration.Toolkit.KXP/Models/CmsEventLog.cs | 91 +- .../Models/CmsExternalLogin.cs | 57 +- Migration.Toolkit.KXP/Models/CmsForm.cs | 108 +- .../Models/CmsFormFeaturedField.cs | 76 +- .../Models/CmsHeadlessChannel.cs | 87 +- .../Models/CmsHeadlessItem.cs | 73 +- .../Models/CmsHeadlessToken.cs | 116 +- Migration.Toolkit.KXP/Models/CmsLicenseKey.cs | 53 +- .../Models/CmsMacroIdentity.cs | 65 +- Migration.Toolkit.KXP/Models/CmsMacroRule.cs | 83 +- .../Models/CmsMacroRuleCategory.cs | 63 +- .../Models/CmsMacroRuleMacroRuleCategory.cs | 61 +- Migration.Toolkit.KXP/Models/CmsMember.cs | 67 +- .../Models/CmsMemberExternalLogin.cs | 51 +- .../Models/CmsObjectWorkflowTrigger.cs | 91 +- .../Models/CmsPageTemplateConfiguration.cs | 61 +- Migration.Toolkit.KXP/Models/CmsQuery.cs | 85 +- Migration.Toolkit.KXP/Models/CmsResource.cs | 79 +- .../Models/CmsResourceString.cs | 53 +- .../Models/CmsResourceTranslation.cs | 65 +- Migration.Toolkit.KXP/Models/CmsRole.cs | 79 +- .../Models/CmsScheduledTask.cs | 147 +- .../Models/CmsSettingsCategory.cs | 119 +- .../Models/CmsSettingsKey.cs | 115 +- .../Models/CmsSmartFolder.cs | 46 + Migration.Toolkit.KXP/Models/CmsState.cs | 87 +- Migration.Toolkit.KXP/Models/CmsTag.cs | 102 +- Migration.Toolkit.KXP/Models/CmsTaxonomy.cs | 64 +- Migration.Toolkit.KXP/Models/CmsUser.cs | 219 +- .../Models/CmsUserMacroIdentity.cs | 69 +- Migration.Toolkit.KXP/Models/CmsUserRole.cs | 61 +- .../Models/CmsWebFarmServer.cs | 63 +- .../Models/CmsWebFarmServerLog.cs | 43 +- .../Models/CmsWebFarmServerMonitoring.cs | 37 +- .../Models/CmsWebFarmServerTask.cs | 61 +- .../Models/CmsWebFarmTask.cs | 83 +- .../Models/CmsWebPageFormerUrlPath.cs | 93 +- .../Models/CmsWebPageItem.cs | 123 +- .../Models/CmsWebPageUrlPath.cs | 107 +- .../Models/CmsWebsiteCaptchaSetting.cs | 59 +- .../Models/CmsWebsiteChannel.cs | 106 +- Migration.Toolkit.KXP/Models/CmsWorkflow.cs | 162 +- .../Models/CmsWorkflowAction.cs | 130 +- .../Models/CmsWorkflowStep.cs | 187 +- .../Models/CmsWorkflowTransition.cs | 91 +- .../Models/EmailLibraryEmailBounce.cs | 45 +- .../Models/EmailLibraryEmailChannel.cs | 81 +- .../Models/EmailLibraryEmailChannelSender.cs | 67 +- .../Models/EmailLibraryEmailConfiguration.cs | 119 +- .../Models/EmailLibraryEmailLink.cs | 67 +- .../EmailLibraryEmailMarketingRecipient.cs | 85 +- .../Models/EmailLibraryEmailStatistic.cs | 85 +- .../Models/EmailLibraryEmailStatisticsHit.cs | 75 +- ...ailLibraryEmailSubscriptionConfirmation.cs | 75 +- .../Models/EmailLibraryEmailTemplate.cs | 61 +- .../EmailLibraryEmailTemplateContentType.cs | 61 +- .../EmailLibraryRecipientListSetting.cs | 79 +- .../Models/EmailLibrarySendConfiguration.cs | 77 +- Migration.Toolkit.KXP/Models/MediaFile.cs | 141 +- Migration.Toolkit.KXP/Models/MediaLibrary.cs | 73 +- Migration.Toolkit.KXP/Models/OmAccount.cs | 227 +- .../Models/OmAccountContact.cs | 77 +- .../Models/OmAccountStatus.cs | 49 +- Migration.Toolkit.KXP/Models/OmActivity.cs | 153 +- .../Models/OmActivityRecalculationQueue.cs | 33 +- .../Models/OmActivityType.cs | 85 +- Migration.Toolkit.KXP/Models/OmContact.cs | 273 +- .../OmContactChangeRecalculationQueue.cs | 45 +- .../Models/OmContactGroup.cs | 93 +- .../Models/OmContactGroupMember.cs | 71 +- Migration.Toolkit.KXP/Models/OmContactRole.cs | 49 +- .../Models/OmContactStatus.cs | 49 +- .../Models/OmTrackedWebsite.cs | 71 +- .../Models/OmVisitorToContact.cs | 53 +- Migration.Toolkit.KXP/Models/TempFile.cs | 97 +- .../Models/TempPageBuilderWidget.cs | 43 +- .../Models/ViewCmsResourceStringJoined.cs | 87 +- .../Models/ViewCmsResourceTranslatedJoined.cs | 55 +- .../ViewOmAccountContactAccountJoined.cs | 63 +- .../ViewOmAccountContactContactJoined.cs | 81 +- .../Models/ViewOmAccountJoined.cs | 203 +- .../ViewOmContactGroupMemberAccountJoined.cs | 155 +- .../ConfigurationValidator.cs | 102 - .../ConsoleHelper.cs | 27 - .../DocumentPageBuilderWidgetsModel.cs | 187 - Migration.Toolkit.TestConsole/GenHelper.cs | 21 - .../Migration.Toolkit.TestConsole.csproj | 36 - Migration.Toolkit.TestConsole/Program.cs | 168 - .../appsettings.json | 49 - Migration.Toolkit.Tests/MediaHelperTest.cs | 125 +- .../Migration.Toolkit.Tests.csproj | 10 +- Migration.Toolkit.Tests/Usings.cs | 2 +- Migration.Toolkit.sln | 9 - 1463 files changed, 108992 insertions(+), 112972 deletions(-) create mode 100644 .gitattributes rename {Migration.Toolkit.Core.K11 => KVA/Migration.Toolkit.Source}/Handlers/MigrateMediaLibrariesCommandHandler.cs (52%) create mode 100644 KVA/Migration.Toolkit.Source/Helpers/AdminUserHelper.cs rename {Migration.Toolkit.Core.K11 => KVA/Migration.Toolkit.Source}/Mappers/MediaFileInfoMapper.cs (55%) create mode 100644 KVA/Migration.Toolkit.Source/Mappers/MediaLibraryInfoMapper.cs create mode 100644 KVA/Migration.Toolkit.Source/Model/MediaFile.cs create mode 100644 KVA/Migration.Toolkit.Source/Model/MediaLibrary.cs create mode 100644 KVA/Migration.Toolkit.Source/Services/SpoiledGuidContext.cs create mode 100644 Migration.Toolkit.Common/Services/ISpoiledGuidContext.cs delete mode 100644 Migration.Toolkit.Core.K11/Auxiliary/NodeXmlAdapter.cs delete mode 100644 Migration.Toolkit.Core.K11/Contexts/SourceInstanceContext.cs delete mode 100644 Migration.Toolkit.Core.K11/Mappers/MediaLibraryInfoMapper.cs delete mode 100644 Migration.Toolkit.Core.K11/Mappers/OmContactMapper.cs delete mode 100644 Migration.Toolkit.Core.K11/Mappers/ResourceMapper.cs delete mode 100644 Migration.Toolkit.Core.KX12/Auxiliary/NodeXmlAdapter.cs delete mode 100644 Migration.Toolkit.Core.KX12/Contexts/SourceInstanceContext.cs delete mode 100644 Migration.Toolkit.Core.KX12/Handlers/MigrateMediaLibrariesCommandHandler.cs delete mode 100644 Migration.Toolkit.Core.KX12/Mappers/MediaFileInfoMapper.cs delete mode 100644 Migration.Toolkit.Core.KX12/Mappers/MediaLibraryInfoMapper.cs delete mode 100644 Migration.Toolkit.Core.KX12/Mappers/OmContactMapper.cs delete mode 100644 Migration.Toolkit.Core.KX12/Mappers/ResourceMapper.cs delete mode 100644 Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs delete mode 100644 Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs delete mode 100644 Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs delete mode 100644 Migration.Toolkit.Core.KX12/Services/TableReflectionService.cs delete mode 100644 Migration.Toolkit.Core.KX13/Auxiliary/NodeXmlAdapter.cs delete mode 100644 Migration.Toolkit.Core.KX13/Contexts/SourceInstanceContext.cs delete mode 100644 Migration.Toolkit.Core.KX13/Handlers/MigrateMediaLibrariesCommandHandler.cs delete mode 100644 Migration.Toolkit.Core.KX13/Mappers/MediaFileInfoMapper.cs delete mode 100644 Migration.Toolkit.Core.KX13/Mappers/MediaLibraryInfoMapper.cs delete mode 100644 Migration.Toolkit.Core.KX13/Mappers/OmContactMapper.cs delete mode 100644 Migration.Toolkit.Core.KX13/Mappers/PageTemplateConfigurationMapper.cs delete mode 100644 Migration.Toolkit.Core.KX13/Mappers/ResourceMapper.cs delete mode 100644 Migration.Toolkit.Core.KX13/Services/CmsClass/EditableAreasConfiguration.cs delete mode 100644 Migration.Toolkit.Core.KX13/Services/CmsClass/PageSelectorItem.cs delete mode 100644 Migration.Toolkit.Core.KX13/Services/CmsClass/PageTemplateConfiguration.cs delete mode 100644 Migration.Toolkit.Core.KX13/Services/TableReflectionService.cs create mode 100644 Migration.Toolkit.KXP.Api/Auxiliary/UserHelper.cs create mode 100644 Migration.Toolkit.KXP/Models/CmsSmartFolder.cs delete mode 100644 Migration.Toolkit.TestConsole/ConfigurationValidator.cs delete mode 100644 Migration.Toolkit.TestConsole/ConsoleHelper.cs delete mode 100644 Migration.Toolkit.TestConsole/DocumentPageBuilderWidgetsModel.cs delete mode 100644 Migration.Toolkit.TestConsole/GenHelper.cs delete mode 100644 Migration.Toolkit.TestConsole/Migration.Toolkit.TestConsole.csproj delete mode 100644 Migration.Toolkit.TestConsole/Program.cs delete mode 100644 Migration.Toolkit.TestConsole/appsettings.json diff --git a/.editorconfig b/.editorconfig index f649bc7f..0022fd75 100644 --- a/.editorconfig +++ b/.editorconfig @@ -1,4 +1,4 @@ -# Severity levels of analyzers https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019#severity-levels-of-analyzers +# Severity levels of analyzers https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019#severity-levels-of-analyzers root = true diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 00000000..db2a596a --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +* text eol=crlf \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 380e5400..8d07f674 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,77 +1,77 @@ -name: "CI: Build and Test" - -on: - push: - branches: [master] - paths: - - "**.cs" - - "**.tsx" - - "**.js" - - "**.csproj" - - "**.props" - - "**.targets" - - "**.sln" - pull_request: - branches: [master] - paths: - - ".github/workflows/build.yml" - - "**.cs" - - "**.cshtml" - - "**.tsx" - - "**.js" - - "**.json" - - "**.csproj" - - "**.props" - - "**.targets" - - "**.sln" - -jobs: - dotnet-format: - name: .Net Format Check - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - # - name: Run dotnet format - # run: dotnet format --exclude ./examples/** --verify-no-changes - - build_and_test: - name: Build and Test - runs-on: ubuntu-latest - needs: dotnet-format - defaults: - run: - shell: pwsh - - env: - ASPNETCORE_ENVIRONMENT: CI - DOTNET_CLI_TELEMETRY_OPTOUT: 1 - DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 - DOTNET_NOLOGO: 1 - - steps: - - uses: actions/checkout@v4 - - - name: Setup .NET - uses: actions/setup-dotnet@v4 - with: - global-json-file: global.json - - - name: Install dependencies - run: | - dotnet restore ` - --locked-mode - - - name: Build Solution - run: | - dotnet build ` - --configuration Release ` - --no-restore - - - name: Test Solution - run: | - dotnet test ` - --configuration Release ` - --no-build ` - --no-restore +name: "CI: Build and Test" + +on: + push: + branches: [master] + paths: + - "**.cs" + - "**.tsx" + - "**.js" + - "**.csproj" + - "**.props" + - "**.targets" + - "**.sln" + pull_request: + branches: [master] + paths: + - ".github/workflows/build.yml" + - "**.cs" + - "**.cshtml" + - "**.tsx" + - "**.js" + - "**.json" + - "**.csproj" + - "**.props" + - "**.targets" + - "**.sln" + +jobs: + dotnet-format: + name: .Net Format Check + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Run dotnet format + run: dotnet format --exclude ./examples/** --verify-no-changes + + build_and_test: + name: Build and Test + runs-on: ubuntu-latest + needs: dotnet-format + defaults: + run: + shell: pwsh + + env: + ASPNETCORE_ENVIRONMENT: CI + DOTNET_CLI_TELEMETRY_OPTOUT: 1 + DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 + DOTNET_NOLOGO: 1 + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + global-json-file: global.json + + - name: Install dependencies + run: | + dotnet restore ` + --locked-mode + + - name: Build Solution + run: | + dotnet build ` + --configuration Release ` + --no-restore + + - name: Test Solution + run: | + dotnet test ` + --configuration Release ` + --no-build ` + --no-restore diff --git a/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs b/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs index 43dd3387..011ba0f2 100644 --- a/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs +++ b/KVA/Migration.Toolkit.Source/Auxiliary/NodeXmlAdapter.cs @@ -1,76 +1,77 @@ -namespace Migration.Toolkit.Source.Auxiliary; - -using System; -using System.Xml.Linq; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Enumerations; - -internal class NodeXmlAdapter -{ - private readonly XElement _xClass; - - public bool ParsingSuccessful { get; } - - public NodeXmlAdapter(string xml) - { - var xDoc = XDocument.Parse(xml); - if (xDoc.Root?.FirstNode is XElement dClass) - { - _xClass = dClass; - ParsingSuccessful = true; - } - else - { - _xClass = null!; - ParsingSuccessful = false; - } - } - - public string? GetValue(string columnName) - { - return _xClass.Element(columnName)?.Value; - } - - public bool HasValueSet(string columnName) - { - return _xClass.Element(columnName) != null; - } - - public int? NodeID => _xClass.Element(NodeXmlColumns.NODE_ID)?.Value(); - public string? NodeAliasPath => _xClass.Element(NodeXmlColumns.NODE_ALIAS_PATH)?.Value; - public string? NodeName => _xClass.Element(NodeXmlColumns.NODE_NAME)?.Value; - public string? NodeAlias => _xClass.Element(NodeXmlColumns.NODE_ALIAS)?.Value; - public int? NodeClassID => _xClass.Element(NodeXmlColumns.NODE_CLASS_ID)?.Value(); - public int? NodeParentID => _xClass.Element(NodeXmlColumns.NODE_PARENT_ID)?.Value(); - public int? NodeLevel => _xClass.Element(NodeXmlColumns.NODE_LEVEL)?.Value(); - public int? NodeSiteID => _xClass.Element(NodeXmlColumns.NODE_SITE_ID)?.Value(); - public Guid? NodeGUID => _xClass.Element(NodeXmlColumns.NODE_GUID)?.Value(); - public int? NodeOrder => _xClass.Element(NodeXmlColumns.NODE_ORDER)?.Value(); - public int? NodeOwner => _xClass.Element(NodeXmlColumns.NODE_OWNER)?.Value(); - public bool? NodeHasChildren => _xClass.Element(NodeXmlColumns.NODE_HAS_CHILDREN)?.ValueAsBool(); - public bool? NodeHasLinks => _xClass.Element(NodeXmlColumns.NODE_HAS_LINKS)?.ValueAsBool(); - public int? NodeOriginalNodeID => _xClass.Element(NodeXmlColumns.NODE_ORIGINAL_NODE_ID)?.Value(); - public bool? NodeIsPage => _xClass.Element(NodeXmlColumns.NODE_IS_PAGE)?.ValueAsBool(); - public bool? NodeIsSecured => _xClass.Element(NodeXmlColumns.NODE_IS_SECURED)?.ValueAsBool(); - public int? DocumentID => _xClass.Element(NodeXmlColumns.DOCUMENT_ID)?.Value(); - public string? DocumentName => _xClass.Element(NodeXmlColumns.DOCUMENT_NAME)?.Value; - public DateTime? DocumentModifiedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_WHEN)?.Value(); - public int? DocumentModifiedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_BY_USER_ID)?.Value(); - public int? DocumentCreatedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_BY_USER_ID)?.Value(); - public DateTime? DocumentCreatedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_WHEN)?.Value(); - public int? DocumentCheckedOutVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID)?.Value(); - public int? DocumentPublishedVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_PUBLISHED_VERSION_HISTORY_ID)?.Value(); - public int? DocumentWorkflowStepID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_STEP_ID)?.Value(); - public string? DocumentCulture => _xClass.Element(NodeXmlColumns.DOCUMENT_CULTURE)?.Value; - public int? DocumentNodeID => _xClass.Element(NodeXmlColumns.DOCUMENT_NODE_ID)?.Value(); - public string? DocumentContent => _xClass.Element(NodeXmlColumns.DOCUMENT_CONTENT)?.Value; - public string? DocumentLastVersionNumber => _xClass.Element(NodeXmlColumns.DOCUMENT_LAST_VERSION_NUMBER)?.Value; - public bool? DocumentIsArchived => _xClass.Element(NodeXmlColumns.DOCUMENT_IS_ARCHIVED)?.ValueAsBool(); - public Guid? DocumentGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_GUID)?.Value(); - public Guid? DocumentWorkflowCycleGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_CYCLE_GUID)?.Value(); - public bool? DocumentCanBePublished => _xClass.Element(NodeXmlColumns.DOCUMENT_CAN_BE_PUBLISHED)?.ValueAsBool(); - public string? DocumentPageBuilderWidgets => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_BUILDER_WIDGETS)?.Value; - public string? ClassName => _xClass.Element(NodeXmlColumns.CLASS_NAME)?.Value; - - public string? DocumentPageTemplateConfiguration => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_TEMPLATE_CONFIGURATION)?.Value; -} \ No newline at end of file +using System.Xml.Linq; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Enumerations; +// ReSharper disable InconsistentNaming // generated class + +namespace Migration.Toolkit.Source.Auxiliary; + +internal class NodeXmlAdapter +{ + private readonly XElement xClass; + + public NodeXmlAdapter(string xml) + { + var xDoc = XDocument.Parse(xml); + if (xDoc.Root?.FirstNode is XElement dClass) + { + xClass = dClass; + ParsingSuccessful = true; + } + else + { + xClass = null!; + ParsingSuccessful = false; + } + } + + public bool ParsingSuccessful { get; } + + public int? NodeID => xClass.Element(NodeXmlColumns.NODE_ID)?.Value(); + public string? NodeAliasPath => xClass.Element(NodeXmlColumns.NODE_ALIAS_PATH)?.Value; + public string? NodeName => xClass.Element(NodeXmlColumns.NODE_NAME)?.Value; + public string? NodeAlias => xClass.Element(NodeXmlColumns.NODE_ALIAS)?.Value; + public int? NodeClassID => xClass.Element(NodeXmlColumns.NODE_CLASS_ID)?.Value(); + public int? NodeParentID => xClass.Element(NodeXmlColumns.NODE_PARENT_ID)?.Value(); + public int? NodeLevel => xClass.Element(NodeXmlColumns.NODE_LEVEL)?.Value(); + public int? NodeSiteID => xClass.Element(NodeXmlColumns.NODE_SITE_ID)?.Value(); + + [Obsolete("NodeGUID is not unique, use other means of node identification", true)] + public Guid? NodeGUID => xClass.Element(NodeXmlColumns.NODE_GUID)?.Value(); + + public int? NodeOrder => xClass.Element(NodeXmlColumns.NODE_ORDER)?.Value(); + public int? NodeOwner => xClass.Element(NodeXmlColumns.NODE_OWNER)?.Value(); + public bool? NodeHasChildren => xClass.Element(NodeXmlColumns.NODE_HAS_CHILDREN)?.ValueAsBool(); + public bool? NodeHasLinks => xClass.Element(NodeXmlColumns.NODE_HAS_LINKS)?.ValueAsBool(); + public int? NodeOriginalNodeID => xClass.Element(NodeXmlColumns.NODE_ORIGINAL_NODE_ID)?.Value(); + public bool? NodeIsPage => xClass.Element(NodeXmlColumns.NODE_IS_PAGE)?.ValueAsBool(); + public bool? NodeIsSecured => xClass.Element(NodeXmlColumns.NODE_IS_SECURED)?.ValueAsBool(); + public int? DocumentID => xClass.Element(NodeXmlColumns.DOCUMENT_ID)?.Value(); + public string? DocumentName => xClass.Element(NodeXmlColumns.DOCUMENT_NAME)?.Value; + public DateTime? DocumentModifiedWhen => xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_WHEN)?.Value(); + public int? DocumentModifiedByUserID => xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_BY_USER_ID)?.Value(); + public int? DocumentCreatedByUserID => xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_BY_USER_ID)?.Value(); + public DateTime? DocumentCreatedWhen => xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_WHEN)?.Value(); + public int? DocumentCheckedOutVersionHistoryID => xClass.Element(NodeXmlColumns.DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID)?.Value(); + public int? DocumentPublishedVersionHistoryID => xClass.Element(NodeXmlColumns.DOCUMENT_PUBLISHED_VERSION_HISTORY_ID)?.Value(); + public int? DocumentWorkflowStepID => xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_STEP_ID)?.Value(); + public string? DocumentCulture => xClass.Element(NodeXmlColumns.DOCUMENT_CULTURE)?.Value; + public int? DocumentNodeID => xClass.Element(NodeXmlColumns.DOCUMENT_NODE_ID)?.Value(); + public string? DocumentContent => xClass.Element(NodeXmlColumns.DOCUMENT_CONTENT)?.Value; + public string? DocumentLastVersionNumber => xClass.Element(NodeXmlColumns.DOCUMENT_LAST_VERSION_NUMBER)?.Value; + public bool? DocumentIsArchived => xClass.Element(NodeXmlColumns.DOCUMENT_IS_ARCHIVED)?.ValueAsBool(); + + [Obsolete("DocumentGUID is not unique, use other means of document identification", true)] + public Guid? DocumentGUID => xClass.Element(NodeXmlColumns.DOCUMENT_GUID)?.Value(); + + public Guid? DocumentWorkflowCycleGUID => xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_CYCLE_GUID)?.Value(); + public bool? DocumentCanBePublished => xClass.Element(NodeXmlColumns.DOCUMENT_CAN_BE_PUBLISHED)?.ValueAsBool(); + public string? DocumentPageBuilderWidgets => xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_BUILDER_WIDGETS)?.Value; + public string? ClassName => xClass.Element(NodeXmlColumns.CLASS_NAME)?.Value; + + public string? DocumentPageTemplateConfiguration => xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_TEMPLATE_CONFIGURATION)?.Value; + + public string? GetValue(string columnName) => xClass.Element(columnName)?.Value; + + public bool HasValueSet(string columnName) => xClass.Element(columnName) != null; +} diff --git a/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs index fd533131..d9228b24 100644 --- a/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs +++ b/KVA/Migration.Toolkit.Source/Behaviors/CommandConstraintBehavior.cs @@ -1,283 +1,107 @@ -namespace Migration.Toolkit.Source.Behaviors; - -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Model; - -public class CommandConstraintBehavior( - ILogger> logger, - IMigrationProtocol protocol, - ToolkitConfiguration toolkitConfiguration, - ModelFacade modelFacade) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - try - { - var criticalCheckPassed = PerformChecks(request); - if (!criticalCheckPassed) - { - return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); - } - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogCritical(ex, "Error occured while checking command constraints"); - return (TResponse)(CommandResult)new CommandCheckFailedResult(false); - } - - return await next(); - } - - private bool PerformChecks(TRequest request) - { - var criticalCheckPassed = true; - // const string supportedVersion = "13.0.64"; - // const string supportedVersion = "13.0.0"; - // if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) - // { - // criticalCheckPassed &= CheckVersion(minimalVersion); - // } - - // var sites = _toolkitConfiguration.RequireExplicitMapping(s => s.SiteId); - var sourceSites = modelFacade.SelectAll() - .ToList(); - - foreach (var site in sourceSites) - { - criticalCheckPassed &= CheckSite(sourceSites, site.SiteID); - } - - - if (request is ICultureReliantCommand cultureReliantCommand) - { - var cultures = modelFacade.SelectAll().ToList(); - var siteCultures = modelFacade.SelectAll().ToList(); - criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites, cultures, siteCultures); - } - - // criticalCheckPassed &= CheckDbCollations(); - - return criticalCheckPassed; - } - - // private bool CheckVersion(KX13Context kx13Context, SemanticVersion minimalVersion) - // { - // var criticalCheckPassed = true; - // - // #region Check conclusion methods - // - // void UnableToReadVersionKey(string keyName) - // { - // logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - // protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - // { - // ErrorKind = "Settings key value incorrect format", - // SettingsKeyName = keyName, - // SupportedVersion = minimalVersion.ToString() - // })); - // criticalCheckPassed = false; - // } - // - // void VersionKeyNotFound(string keyName) - // { - // logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - // protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - // { - // ErrorKind = "Settings key not found", - // SettingsKeyName = keyName, - // SupportedVersion = minimalVersion.ToString() - // })); - // criticalCheckPassed = false; - // } - // - // void UpgradeNeeded(string keyName, string currentVersion) - // { - // logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); - // protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - // { - // CurrentVersion = currentVersion, - // SupportedVersion = minimalVersion.ToString() - // })); - // criticalCheckPassed = false; - // } - // - // void LowHotfix(string keyName, int currentHotfix) - // { - // logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); - // protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - // { - // CurrentHotfix = currentHotfix.ToString(), - // SupportedVersion = minimalVersion.ToString() - // })); - // criticalCheckPassed = false; - // } - // - // #endregion - // - // if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) - // { - // if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) - // { - // if (cmsDataVer.IsLesserThan(minimalVersion)) - // { - // UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); - // } - // } - // else - // { - // UnableToReadVersionKey(SettingsKeys.CMSDataVersion); - // } - // } - // else - // { - // VersionKeyNotFound(SettingsKeys.CMSDataVersion); - // } - // - // if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) - // { - // if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) - // { - // if (cmsDataVer.IsLesserThan(minimalVersion)) - // { - // UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); - // } - // } - // else - // { - // UnableToReadVersionKey(SettingsKeys.CMSDBVersion); - // } - // } - // else - // { - // VersionKeyNotFound(SettingsKeys.CMSDBVersion); - // } - // - // if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) - // { - // if (int.TryParse(cmsHotfixDataVersion.KeyValue, out var version)) - // { - // if (version < minimalVersion.Hotfix) - // { - // LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); - // } - // } - // else - // { - // UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); - // } - // } - // else - // { - // VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); - // } - // - // if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) - // { - // if (int.TryParse(cmsHotfixVersion.KeyValue, out var version)) - // { - // if (version < minimalVersion.Hotfix) - // { - // LowHotfix(SettingsKeys.CMSHotfixVersion, version); - // } - // } - // else - // { - // UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); - // } - // } - // else - // { - // VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); - // } - // - // return criticalCheckPassed; - // } - - private bool CheckSite(List sourceSites, int sourceSiteId) - { - var criticalCheckPassed = true; - if (sourceSites.All(s => s.SiteID != sourceSiteId)) - { - var supportedSites = sourceSites.Select(x => new - { - x.SiteName, - x.SiteID - }).ToArray(); - var supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); - logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, - supportedSitesStr); - protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") - .WithMessage("Check program argument '--siteId'") - .WithData(new - { - sourceSiteId, - AvailableSites = supportedSites - })); - criticalCheckPassed = false; - } - - return criticalCheckPassed; - } - - private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites, List cultures, List cmsSiteCultures) - { - - var criticalCheckPassed = true; - var cultureCode = cultureReliantCommand.CultureCode; - - foreach (var site in sourceSites) - { - var siteCultures = cmsSiteCultures - .Where(x => x.SiteID == site.SiteID) - .Select(x => cultures.FirstOrDefault(c => c.CultureID == x.CultureID)?.CultureCode) - .Where(x => !string.IsNullOrWhiteSpace(x)) - .ToArray(); - - if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) - { - var supportedCultures = string.Join(", ", siteCultures); - logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, - site.SiteID, supportedCultures); - protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") - .WithMessage("Check program argument '--culture'") - .WithData(new { cultureCode, site.SiteID, SiteCultures = supportedCultures })); - criticalCheckPassed = false; - } - } - - return criticalCheckPassed; - } - - // TODO tk: 2022-11-02 create global rule - private bool CheckDbCollations() - { - var kxCollation = GetDbCollationName(toolkitConfiguration.KxConnectionString ?? throw new InvalidOperationException("KxConnectionString is required")); - var xbkCollation = GetDbCollationName(toolkitConfiguration.XbKConnectionString ?? throw new InvalidOperationException("XbKConnectionString is required")); - var collationAreSame = kxCollation == xbkCollation; - if (!collationAreSame) - { - logger.LogCritical("Source db collation '{SourceDbCollation}' is not same as target db collation {TargetDbCollation} => same collations are required", kxCollation, xbkCollation); - } - - return collationAreSame; - } - - private string? GetDbCollationName(string connectionString) - { - using var sqlConnection = new SqlConnection(connectionString); - using var sqlCommand = sqlConnection.CreateCommand(); - sqlCommand.CommandText = "SELECT DATABASEPROPERTYEX(DB_NAME(), 'Collation')"; - - sqlConnection.Open(); - return sqlCommand.ExecuteScalar() as string; - } -} \ No newline at end of file +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Behaviors; + +public class CommandConstraintBehavior( + ILogger> logger, + IMigrationProtocol protocol, + ModelFacade modelFacade) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + try + { + bool criticalCheckPassed = PerformChecks(request); + if (!criticalCheckPassed) + { + return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); + } + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogCritical(ex, "Error occured while checking command constraints"); + return (TResponse)(CommandResult)new CommandCheckFailedResult(false); + } + + return await next(); + } + + private bool PerformChecks(TRequest request) + { + bool criticalCheckPassed = true; + + var sourceSites = modelFacade.SelectAll() + .ToList(); + + foreach (var site in sourceSites) + { + criticalCheckPassed &= CheckSite(sourceSites, site.SiteID); + } + + + if (request is ICultureReliantCommand cultureReliantCommand) + { + var cultures = modelFacade.SelectAll().ToList(); + var siteCultures = modelFacade.SelectAll().ToList(); + criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites, cultures, siteCultures); + } + + return criticalCheckPassed; + } + + private bool CheckSite(List sourceSites, int sourceSiteId) + { + bool criticalCheckPassed = true; + if (sourceSites.All(s => s.SiteID != sourceSiteId)) + { + var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteID }).ToArray(); + string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); + logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, + supportedSitesStr); + protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") + .WithMessage("Check program argument '--siteId'") + .WithData(new { sourceSiteId, AvailableSites = supportedSites })); + criticalCheckPassed = false; + } + + return criticalCheckPassed; + } + + private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites, List cultures, List cmsSiteCultures) + { + bool criticalCheckPassed = true; + string cultureCode = cultureReliantCommand.CultureCode; + + foreach (var site in sourceSites) + { + string?[] siteCultures = cmsSiteCultures + .Where(x => x.SiteID == site.SiteID) + .Select(x => cultures.FirstOrDefault(c => c.CultureID == x.CultureID)?.CultureCode) + .Where(x => !string.IsNullOrWhiteSpace(x)) + .ToArray(); + + if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) + { + string supportedCultures = string.Join(", ", siteCultures); + logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, + site.SiteID, supportedCultures); + protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") + .WithMessage("Check program argument '--culture'") + .WithData(new { cultureCode, site.SiteID, SiteCultures = supportedCultures })); + criticalCheckPassed = false; + } + } + + return criticalCheckPassed; + } +} diff --git a/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs index 682c3455..82407e94 100644 --- a/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs +++ b/KVA/Migration.Toolkit.Source/Behaviors/RequestHandlingBehavior.cs @@ -1,37 +1,40 @@ -namespace Migration.Toolkit.Source.Behaviors; - -using System.Diagnostics; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; - -public class RequestHandlingBehavior( - ILogger> logger, - IMigrationProtocol protocol) : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - var sw = Stopwatch.StartNew(); - logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); - try - { - protocol.CommandRequest(request); - var response = await next(); - protocol.CommandFinished(request, response); - return response; - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogError(ex, "Error occured"); - throw; - } - finally - { - logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); - } - } -} \ No newline at end of file +using System.Diagnostics; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; + +namespace Migration.Toolkit.Source.Behaviors; + +public class RequestHandlingBehavior( + ILogger> logger, + IMigrationProtocol protocol) : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + var sw = Stopwatch.StartNew(); + logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); + try + { + protocol.CommandRequest(request); + var response = await next(); + protocol.CommandFinished(request, response); + return response; + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogError(ex, "Error occured"); + throw; + } + finally + { + logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); + } + } +} diff --git a/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs b/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs index ed204f12..f2a87906 100644 --- a/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs +++ b/KVA/Migration.Toolkit.Source/Behaviors/XbKApiContextBehavior.cs @@ -1,39 +1,42 @@ -namespace Migration.Toolkit.Source.Behaviors; - -using CMS.Base; -using CMS.Membership; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; - -public class XbKApiContextBehavior( - ILogger> logger, - IMigrationProtocol protocol, - KxpApiInitializer initializer) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - initializer.EnsureApiIsInitialized(); - - var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); - if (defaultAdmin == null) - { - protocol.Append(HandbookReferences - .MissingRequiredDependency() - .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") - ); - throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); - } - - using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) - { - logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); - return await next(); - } - } -} \ No newline at end of file +using CMS.Base; +using CMS.Membership; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Source.Behaviors; + +public class XbKApiContextBehavior( + ILogger> logger, + IMigrationProtocol protocol, + KxpApiInitializer initializer) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + initializer.EnsureApiIsInitialized(); + + var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); + if (defaultAdmin == null) + { + protocol.Append(HandbookReferences + .MissingRequiredDependency() + .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") + ); + throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); + } + + using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) + { + logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); + return await next(); + } + } +} diff --git a/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs b/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs index e4a8245f..4647025e 100644 --- a/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs +++ b/KVA/Migration.Toolkit.Source/Contexts/PrimaryKeyMappingContext.cs @@ -1,286 +1,287 @@ -namespace Migration.Toolkit.Source.Contexts; - -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reflection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Source.Services; - -public class PrimaryKeyMappingContext( - ILogger logger, - IPrimaryKeyLocatorService primaryKeyLocatorService, - ToolkitConfiguration toolkitConfiguration) - : IPrimaryKeyMappingContext -{ - private readonly Dictionary _mappings = new(StringComparer.OrdinalIgnoreCase); - - private int? GetExplicitMappingOrNull(string memberName, int? sourceId) - { - if (sourceId == null) return null; - - var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; - if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) - { - return memberMappings.TryGetValue($"{sourceId}", out var mappedId) ? mappedId : null; - } - - return null; - } - - private static string CreateKey(Expression> keyNameSelector, int sourceId) - { - return $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; - } - - public void SetMapping(Type type, string keyName, int sourceId, int targetId) - { - Debug.Assert(sourceId > 0, "sourceId > 0"); - Debug.Assert(targetId > 0, "targetId > 0"); - - var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); - - Debug.Assert(foundProp != null, "foundProp != null"); - - var fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; - - _mappings[fullKeyName] = targetId; - logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); - } - - public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - var fullKeyName = CreateKey(keyNameSelector, sourceId); - _mappings[fullKeyName] = targetId; - logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); - } - - public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) - { - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sourceId); - if (sourceId == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out var targetId)) - { - SetMapping(keyNameSelector, sourceId, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) - { - targetIdResult = -1; - if (!(sourceId is int sid)) - { - return false; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - targetIdResult = explicitlyMappedId; - return true; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - targetIdResult = resultId; - return true; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - targetIdResult = targetId; - return true; - } - - return false; - } - - public int? MapFromSource(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, $"Target entity is missing"); - } - - public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - return null; - } - - public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return new MapSourceIdResult(true, null); - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return new MapSourceIdResult(true, null); - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return new MapSourceIdResult(true, explicitlyMappedId); - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return new MapSourceIdResult(true, resultId); - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return new MapSourceIdResult(true, targetId); - } - - return new MapSourceIdResult(false, null); - } - - public void PreloadDependencies(Expression> keyNameSelector) - { - foreach (var (sourceId, targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) - { - SetMapping(keyNameSelector, sourceId, targetId); - } - } - - public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return true; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - return true; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { }) - { - return true; - } - - if (_mappings.TryGetValue(fullKeyName, out _)) - { - return true; - } - - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) - { - return true; - } - - return false; - } -} \ No newline at end of file +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Source.Services; + +namespace Migration.Toolkit.Source.Contexts; + +public class PrimaryKeyMappingContext( + ILogger logger, + IPrimaryKeyLocatorService primaryKeyLocatorService, + ToolkitConfiguration toolkitConfiguration) + : IPrimaryKeyMappingContext +{ + private readonly Dictionary mappingCache = new(StringComparer.OrdinalIgnoreCase); + + public void SetMapping(Type type, string keyName, int sourceId, int targetId) + { + Debug.Assert(sourceId > 0, "sourceId > 0"); + Debug.Assert(targetId > 0, "targetId > 0"); + + var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); + + Debug.Assert(foundProp != null, "foundProp != null"); + + string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; + + mappingCache[fullKeyName] = targetId; + logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); + } + + public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) + { + string fullKeyName = CreateKey(keyNameSelector, sourceId); + mappingCache[fullKeyName] = targetId; + logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); + } + + public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) + { + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sourceId); + if (sourceId == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) + { + SetMapping(keyNameSelector, sourceId, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) + { + targetIdResult = -1; + if (sourceId is not int sid) + { + return false; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + targetIdResult = explicitlyMappedId; + return true; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + targetIdResult = resultId; + return true; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + targetIdResult = targetId; + return true; + } + + return false; + } + + public int? MapFromSource(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + return null; + } + + public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return new MapSourceIdResult(true, null); + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return new MapSourceIdResult(true, null); + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return new MapSourceIdResult(true, explicitlyMappedId); + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return new MapSourceIdResult(true, resultId); + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return new MapSourceIdResult(true, targetId); + } + + return new MapSourceIdResult(false, null); + } + + public void PreloadDependencies(Expression> keyNameSelector) + { + foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) + { + SetMapping(keyNameSelector, sourceId, targetId); + } + } + + public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + return true; + } + + if (GetExplicitMappingOrNull(memberName, sid) is not null) + { + return true; + } + + if (mappingCache.TryGetValue(fullKeyName, out _)) + { + return true; + } + + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) + { + return true; + } + + return false; + } + + private int? GetExplicitMappingOrNull(string memberName, int? sourceId) + { + if (sourceId == null) + { + return null; + } + + var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; + if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) + { + return memberMappings.GetValueOrDefault($"{sourceId}"); + } + + return null; + } + + private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; +} diff --git a/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs b/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs index 8da61af3..ddbc8f05 100644 --- a/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs +++ b/KVA/Migration.Toolkit.Source/Contexts/SourceInstanceContext.cs @@ -1,100 +1,97 @@ -namespace Migration.Toolkit.Source.Contexts; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.Source.Model; - -public class SourceInstanceContext( - IpcService ipcService, - ILogger logger, - ToolkitConfiguration configuration, - ModelFacade modelFacade) -{ - private readonly Dictionary _cachedInfos = new(StringComparer.InvariantCultureIgnoreCase); - - private bool _sourceInfoLoaded; - - public bool HasInfo => _cachedInfos.Count > 0 && _sourceInfoLoaded; - - public bool IsQuerySourceInstanceEnabled() - { - return configuration.OptInFeatures?.QuerySourceInstanceApi?.Enabled ?? false; - } - - public async Task RequestSourceInstanceInfo() - { - if (!_sourceInfoLoaded) - { - var result = await ipcService.GetSourceInstanceDiscoveredInfos(); - foreach (var (key, value) in result) - { - _cachedInfos.Add(key, value); - logger.LogInformation("Source instance info loaded for site '{SiteName}' successfully", key); - } - - _sourceInfoLoaded = true; - } - - return _sourceInfoLoaded; - } - - public List? GetWidgetPropertyFormComponents(string siteName, string widgetIdentifier) - { - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.WidgetProperties != null && info.WidgetProperties.TryGetValue(widgetIdentifier, out var widgetProperties) - ? widgetProperties - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - - public List? GetPageTemplateFormComponents(string siteName, string pageTemplateIdentifier) - { - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.PageTemplateProperties != null && info.PageTemplateProperties.TryGetValue(pageTemplateIdentifier, out var pageTemplate) - ? pageTemplate - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - - public List? GetWidgetPropertyFormComponents(int siteId, string widgetIdentifier) - { - var siteName = - modelFacade.SelectById(siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - return GetWidgetPropertyFormComponents(siteName, widgetIdentifier); - } - - public List? GetPageTemplateFormComponents(int siteId, string pageTemplateIdentifier) - { - var siteName = - modelFacade.SelectById(siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - return GetPageTemplateFormComponents(siteName, pageTemplateIdentifier); - } - - public List? GetSectionFormComponents(int siteId, string sectionIdentifier) - { - var siteName = - modelFacade.SelectById(siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.SectionProperties != null && info.SectionProperties.TryGetValue(sectionIdentifier, out var sectionFcs) - ? sectionFcs - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Services.Ipc; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Contexts; + +public class SourceInstanceContext( + IpcService ipcService, + ILogger logger, + ToolkitConfiguration configuration, + ModelFacade modelFacade) +{ + private readonly Dictionary cachedInfos = new(StringComparer.InvariantCultureIgnoreCase); + + private bool sourceInfoLoaded; + + public bool HasInfo => cachedInfos.Count > 0 && sourceInfoLoaded; + + public bool IsQuerySourceInstanceEnabled() => configuration.OptInFeatures?.QuerySourceInstanceApi?.Enabled ?? false; + + public async Task RequestSourceInstanceInfo() + { + if (!sourceInfoLoaded) + { + var result = await ipcService.GetSourceInstanceDiscoveredInfos(); + foreach ((string key, var value) in result) + { + cachedInfos.Add(key, value); + logger.LogInformation("Source instance info loaded for site '{SiteName}' successfully", key); + } + + sourceInfoLoaded = true; + } + + return sourceInfoLoaded; + } + + public List? GetWidgetPropertyFormComponents(string siteName, string widgetIdentifier) + { + if (cachedInfos.TryGetValue(siteName, out var info)) + { + return info.WidgetProperties != null && info.WidgetProperties.TryGetValue(widgetIdentifier, out var widgetProperties) + ? widgetProperties + : null; + } + + throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); + } + + public List? GetPageTemplateFormComponents(string siteName, string pageTemplateIdentifier) + { + if (cachedInfos.TryGetValue(siteName, out var info)) + { + return info.PageTemplateProperties != null && info.PageTemplateProperties.TryGetValue(pageTemplateIdentifier, out var pageTemplate) + ? pageTemplate + : null; + } + + throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); + } + + public List? GetWidgetPropertyFormComponents(int siteId, string widgetIdentifier) + { + string siteName = + modelFacade.SelectById(siteId)?.SiteName + ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); + + return GetWidgetPropertyFormComponents(siteName, widgetIdentifier); + } + + public List? GetPageTemplateFormComponents(int siteId, string pageTemplateIdentifier) + { + string siteName = + modelFacade.SelectById(siteId)?.SiteName + ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); + + return GetPageTemplateFormComponents(siteName, pageTemplateIdentifier); + } + + public List? GetSectionFormComponents(int siteId, string sectionIdentifier) + { + string siteName = + modelFacade.SelectById(siteId)?.SiteName + ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); + + if (cachedInfos.TryGetValue(siteName, out var info)) + { + return info.SectionProperties != null && info.SectionProperties.TryGetValue(sectionIdentifier, out var sectionFcs) + ? sectionFcs + : null; + } + + throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); + } +} diff --git a/KVA/Migration.Toolkit.Source/Exceptions.cs b/KVA/Migration.Toolkit.Source/Exceptions.cs index a8a26ddc..82d0bec0 100644 --- a/KVA/Migration.Toolkit.Source/Exceptions.cs +++ b/KVA/Migration.Toolkit.Source/Exceptions.cs @@ -1,13 +1,13 @@ -namespace Migration.Toolkit.Source; - -public class MappingFailureException : InvalidOperationException -{ - public string KeyName { get; } - public string Reason { get; } - - public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") - { - KeyName = keyName; - Reason = reason; - } -} \ No newline at end of file +namespace Migration.Toolkit.Source; + +public class MappingFailureException : InvalidOperationException +{ + public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") + { + KeyName = keyName; + Reason = reason; + } + + public string KeyName { get; } + public string Reason { get; } +} diff --git a/KVA/Migration.Toolkit.Source/Extensions.cs b/KVA/Migration.Toolkit.Source/Extensions.cs index 12a4d3c3..35f77f33 100644 --- a/KVA/Migration.Toolkit.Source/Extensions.cs +++ b/KVA/Migration.Toolkit.Source/Extensions.cs @@ -1,38 +1,44 @@ -namespace Migration.Toolkit.Source; - -using System.ComponentModel.DataAnnotations; -using System.Diagnostics.CodeAnalysis; -using System.Text; -using Kentico.Xperience.UMT.Services; -using Microsoft.Extensions.Logging; - -public static class Extensions -{ - public record AssertSuccessResult( - [property: MemberNotNullWhen(returnValue: true, member: "Info")] bool Success, - TResult? Info - ); - public static async Task> AssertSuccess(this Task resultTask, ILogger logger) - { - switch (await resultTask) - { - case { Success: true, Imported: TResult info }: - { - return new(true, info); - } - case { } result: - { - var sb = new StringBuilder(); - if (result.ModelValidationResults is { } validationResults) - validationResults.ForEach(vr => sb.Append($"[{string.Join(",", vr.MemberNames)}]: {vr.ErrorMessage}")); - - if (result.Exception is { } exception) - { - logger.LogError(exception, "Error occured while importing entity {ValidationErrors}", sb); - } - return new(false, default); - } - default: throw new NotImplementedException("Undefined state"); - } - } -} \ No newline at end of file +using System.Diagnostics.CodeAnalysis; +using System.Text; + +using Kentico.Xperience.UMT.Services; + +using Microsoft.Extensions.Logging; + +namespace Migration.Toolkit.Source; + +public static class Extensions +{ + public static async Task> AssertSuccess(this Task resultTask, ILogger logger) + { + switch (await resultTask) + { + case { Success: true, Imported: TResult info }: + { + return new AssertSuccessResult(true, info); + } + case { } result: + { + var sb = new StringBuilder(); + if (result.ModelValidationResults is { } validationResults) + { + validationResults.ForEach(vr => sb.Append($"[{string.Join(",", vr.MemberNames)}]: {vr.ErrorMessage}")); + } + + if (result.Exception is { } exception) + { + logger.LogError(exception, "Error occured while importing entity {ValidationErrors}", sb); + } + + return new AssertSuccessResult(false, default); + } + default: + throw new NotImplementedException("Undefined state"); + } + } + + public record AssertSuccessResult( + [property: MemberNotNullWhen(true, "Info")] bool Success, + TResult? Info + ); +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs index e248c428..e6056898 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateAttachmentsCommandHandler.cs @@ -1,34 +1,37 @@ -namespace Migration.Toolkit.Source.Handlers; - -using MediatR; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; - -// ReSharper disable once UnusedMember.Global [implicit use] -public class MigrateAttachmentsCommandHandler( - ModelFacade modelFacade, - AttachmentMigrator attachmentMigrator -) : IRequestHandler -{ - public async Task Handle(MigrateAttachmentsCommand request, CancellationToken cancellationToken) - { - var kx13CmsAttachments = modelFacade.SelectAll(); - - foreach (var kx13CmsAttachment in kx13CmsAttachments) - { - if (kx13CmsAttachment.AttachmentIsUnsorted != true || kx13CmsAttachment.AttachmentGroupGUID != null) - { - // those must be migrated with pages - continue; - } - - var (_, canContinue, _, _) = attachmentMigrator.MigrateAttachment(kx13CmsAttachment); - if (!canContinue) - break; - } - - return new GenericCommandResult(); - } -} \ No newline at end of file +using MediatR; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Source.Model; +using Migration.Toolkit.Source.Services; + +namespace Migration.Toolkit.Source.Handlers; + +// ReSharper disable once UnusedMember.Global [implicit use] +public class MigrateAttachmentsCommandHandler( + ModelFacade modelFacade, + AttachmentMigrator attachmentMigrator +) : IRequestHandler +{ + public Task Handle(MigrateAttachmentsCommand request, CancellationToken cancellationToken) + { + var ksCmsAttachments = modelFacade.SelectAll(); + + foreach (var ksCmsAttachment in ksCmsAttachments) + { + if (ksCmsAttachment.AttachmentIsUnsorted != true || ksCmsAttachment.AttachmentGroupGUID != null) + { + // those must be migrated with pages + continue; + } + + (_, bool canContinue, _, _) = attachmentMigrator.MigrateAttachment(ksCmsAttachment); + if (!canContinue) + { + break; + } + } + + return Task.FromResult(new GenericCommandResult()); + } +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs index 8df9fa1e..f58b879f 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateCategoriesCommandHandler.cs @@ -1,191 +1,192 @@ -namespace Migration.Toolkit.Source.Handlers; - -using System.Collections; -using CMS.ContentEngine; -using CMS.ContentEngine.Internal; -using CMS.DataEngine; -using CMS.FormEngine; -using Kentico.Xperience.UMT.Model; -using Kentico.Xperience.UMT.Services; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; -using Newtonsoft.Json; - -public class MigrateCategoriesCommandHandler( - ILogger logger, - ModelFacade modelFacade, - IImporter importer, - ReusableSchemaService reusableSchemaService, - IUmtMapper tagModelMapper -) : IRequestHandler -{ - public async Task Handle(MigrateCategoriesCommand request, CancellationToken cancellationToken) - { - var taxonomyName = "Categories"; - var result = await importer.ImportAsync(new TaxonomyModel - { - TaxonomyName = taxonomyName, - TaxonomyGUID = GuidHelper.CreateTaxonomyGuid(taxonomyName), - TaxonomyTitle = "Categories", - TaxonomyDescription = "Container for legacy taxonomy", - TaxonomyTranslations = null - }); - - if (result.Imported is TaxonomyInfo taxonomy) - { - var query = """ - SELECT C.ClassName, C.ClassGuid, C.ClassID - FROM View_CMS_Tree_Joined [TJ] - JOIN dbo.CMS_DocumentCategory [CDC] on [TJ].DocumentID = [CDC].DocumentID - JOIN CMS_Class [C] ON TJ.NodeClassID = [C].ClassID - JOIN dbo.CMS_Category CC on CDC.CategoryID = CC.CategoryID AND CC.CategoryUserID IS NULL - GROUP BY C.ClassName, C.ClassGuid, C.ClassID - """; - - var classesWithCategories = modelFacade.Select(query, (reader, version) => new - { - ClassName = reader.Unbox("ClassName"), - ClassGuid = reader.Unbox("ClassGuid"), - ClassID = reader.Unbox("ClassID"), - }); - - var skippedClasses = new List(); - Guid schemaGuid = Guid.Empty; - var categoryFieldName = "Category_Legacy"; - foreach (var classWithCategoryUsage in classesWithCategories) - { - var targetDataClass = DataClassInfoProvider.ProviderObject.Get(classWithCategoryUsage.ClassGuid); - if (targetDataClass == null) - { - skippedClasses.Add(classWithCategoryUsage.ClassID); - logger.LogWarning("Data class not found by ClassGuid {Guid}", classWithCategoryUsage.ClassGuid); - continue; - } - - if (Guid.Empty.Equals(schemaGuid)) - { - schemaGuid = EnsureReusableFieldSchema(taxonomy, categoryFieldName, "Category"); - } - - if (!reusableSchemaService.HasClassReusableSchema(targetDataClass, schemaGuid)) - { - reusableSchemaService.AddReusableSchemaToDataClass(targetDataClass, schemaGuid); - DataClassInfoProvider.SetDataClassInfo(targetDataClass); - } - } - - var categories = modelFacade.Select( - "CategoryEnabled = 1 AND CategoryUserID IS NULL", - "CategoryLevel ASC, CategoryOrder ASC" - ); - - var categoryId2Guid = new Dictionary(); - - foreach (var cmsCategory in categories) - { - categoryId2Guid.Add(cmsCategory.CategoryID, cmsCategory.CategoryGUID); - // CategorySiteID - not migrated, Taxonomies are global! - - var mapped = tagModelMapper.Map(new TagModelSource( - taxonomy.TaxonomyGUID, - cmsCategory, - categoryId2Guid - )); - - foreach (var umtModel in mapped) - { - if (await importer - .ImportAsync(umtModel) - .AssertSuccess(logger) is { Success: true, Info: { } tag }) - { - query = """ - SELECT TJ.DocumentGUID, CDC.CategoryID, TJ.DocumentCheckedOutVersionHistoryID, TJ.NodeClassID - FROM View_CMS_Tree_Joined [TJ] - JOIN dbo.CMS_DocumentCategory [CDC] on [TJ].DocumentID = [CDC].DocumentID - JOIN dbo.CMS_Category CC on CDC.CategoryID = CC.CategoryID AND CC.CategoryUserID IS NULL - WHERE CDC.CategoryID = @categoryId - """; - - var docsWithCategories = modelFacade.Select(query, (reader, _) => new - { - DocumentGUID = reader.Unbox("DocumentGUID"), - CategoryID = reader.Unbox("CategoryID"), - DocumentCheckedOutVersionHistoryID = reader.Unbox("DocumentCheckedOutVersionHistoryID"), - NodeClassID = reader.Unbox("NodeClassID") - }, new SqlParameter("categoryId", cmsCategory.CategoryID)); - - foreach (var dwc in docsWithCategories) - { - if (skippedClasses.Contains(dwc.NodeClassID)) - { - logger.LogWarning("ContentItemCommonDataInfo cannot have categories migrated, data class is not patched with taxonomy field. DocumentGuid {Guid}", dwc.DocumentGUID); - continue; - } - - var commonData = ContentItemCommonDataInfo.Provider.Get() - .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataGUID), dwc.DocumentGUID) - .FirstOrDefault(); - - if (commonData is null) - { - logger.LogWarning("ContentItemCommonDataInfo not found by guid {Guid}, taxonomy cannot be migrated", dwc.DocumentGUID); - continue; - } - - var infosWithTag = ContentItemCommonDataInfo.Provider.Get() - .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentItemID), commonData.ContentItemCommonDataContentItemID) - .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentLanguageID), commonData.ContentItemCommonDataContentLanguageID); - - foreach (var infoWithTag in infosWithTag) - { - List tagReferences = []; - if (infoWithTag[categoryFieldName] is string jsonTags) - { - tagReferences = JsonConvert.DeserializeObject>(jsonTags) ?? []; - } - - tagReferences.Add(new TagReference { Identifier = tag.TagGUID }); - - infoWithTag[categoryFieldName] = JsonConvert.SerializeObject(tagReferences); - - ContentItemCommonDataInfo.Provider.Set(infoWithTag); - } - } - } - } - } - } - - return new GenericCommandResult(); - } - - private Guid EnsureReusableFieldSchema(TaxonomyInfo taxonomy, string categoryFieldName, string categoryFieldDisplayName) - { - return reusableSchemaService.EnsureReusableFieldSchema( - "categories_container", - "Categories container", - "Container for legacy categories", - new FormFieldInfo - { - Enabled = true, - Visible = true, - AllowEmpty = true, - DataType = "taxonomy", - Name = categoryFieldName, - Caption = categoryFieldDisplayName, - Guid = new Guid("F65FE16C-53B0-47F7-B865-E8E300EC5F91"), - Settings = new Hashtable - { - { "controlname", "Kentico.Administration.TagSelector" }, - { "TaxonomyGroup", $"[\"{taxonomy.TaxonomyGUID}\"]" } - } - }); - } -} \ No newline at end of file +using System.Collections; + +using CMS.ContentEngine; +using CMS.ContentEngine.Internal; +using CMS.DataEngine; +using CMS.FormEngine; + +using Kentico.Xperience.UMT.Model; +using Kentico.Xperience.UMT.Services; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Source.Mappers; +using Migration.Toolkit.Source.Model; +using Migration.Toolkit.Source.Services; + +using Newtonsoft.Json; + +namespace Migration.Toolkit.Source.Handlers; + +public class MigrateCategoriesCommandHandler( + ILogger logger, + ModelFacade modelFacade, + IImporter importer, + ReusableSchemaService reusableSchemaService, + IUmtMapper tagModelMapper, + SpoiledGuidContext spoiledGuidContext +) : IRequestHandler +{ + public async Task Handle(MigrateCategoriesCommand request, CancellationToken cancellationToken) + { + string taxonomyName = "Categories"; + var result = await importer.ImportAsync(new TaxonomyModel + { + TaxonomyName = taxonomyName, + TaxonomyGUID = GuidHelper.CreateTaxonomyGuid(taxonomyName), + TaxonomyTitle = "Categories", + TaxonomyDescription = "Container for legacy taxonomy", + TaxonomyTranslations = null + }); + + if (result.Imported is TaxonomyInfo taxonomy) + { + string query = """ + SELECT C.ClassName, C.ClassGuid, C.ClassID + FROM View_CMS_Tree_Joined [TJ] + JOIN dbo.CMS_DocumentCategory [CDC] on [TJ].DocumentID = [CDC].DocumentID + JOIN CMS_Class [C] ON TJ.NodeClassID = [C].ClassID + JOIN dbo.CMS_Category CC on CDC.CategoryID = CC.CategoryID AND CC.CategoryUserID IS NULL + GROUP BY C.ClassName, C.ClassGuid, C.ClassID + """; + + var classesWithCategories = modelFacade.Select(query, (reader, version) => new { ClassName = reader.Unbox("ClassName"), ClassGuid = reader.Unbox("ClassGuid"), ClassID = reader.Unbox("ClassID") }); + + var skippedClasses = new List(); + var schemaGuid = Guid.Empty; + string categoryFieldName = "Category_Legacy"; + foreach (var classWithCategoryUsage in classesWithCategories) + { + var targetDataClass = DataClassInfoProvider.ProviderObject.Get(classWithCategoryUsage.ClassGuid); + if (targetDataClass == null) + { + skippedClasses.Add(classWithCategoryUsage.ClassID); + logger.LogWarning("Data class not found by ClassGuid {Guid}", classWithCategoryUsage.ClassGuid); + continue; + } + + if (Guid.Empty.Equals(schemaGuid)) + { + schemaGuid = EnsureReusableFieldSchema(taxonomy, categoryFieldName, "Category"); + } + + if (!reusableSchemaService.HasClassReusableSchema(targetDataClass, schemaGuid)) + { + reusableSchemaService.AddReusableSchemaToDataClass(targetDataClass, schemaGuid); + DataClassInfoProvider.SetDataClassInfo(targetDataClass); + } + } + + var categories = modelFacade.Select( + "CategoryEnabled = 1 AND CategoryUserID IS NULL", + "CategoryLevel ASC, CategoryOrder ASC" + ); + + var categoryId2Guid = new Dictionary(); + + foreach (var cmsCategory in categories) + { + categoryId2Guid.Add(cmsCategory.CategoryID, cmsCategory.CategoryGUID); + // CategorySiteID - not migrated, Taxonomies are global! + + var mapped = tagModelMapper.Map(new TagModelSource( + taxonomy.TaxonomyGUID, + cmsCategory, + categoryId2Guid + )); + + foreach (var umtModel in mapped) + { + if (await importer + .ImportAsync(umtModel) + .AssertSuccess(logger) is { Success: true, Info: { } tag }) + { + query = """ + SELECT TJ.DocumentGUID, TJ.NodeSiteID, TJ.NodeID, TJ.DocumentID, CDC.CategoryID, TJ.DocumentCheckedOutVersionHistoryID, TJ.NodeClassID + FROM View_CMS_Tree_Joined [TJ] + JOIN dbo.CMS_DocumentCategory [CDC] on [TJ].DocumentID = [CDC].DocumentID + JOIN dbo.CMS_Category CC on CDC.CategoryID = CC.CategoryID AND CC.CategoryUserID IS NULL + WHERE CDC.CategoryID = @categoryId + """; + + var docsWithCategories = modelFacade.Select(query, (reader, _) => new + { + CategoryID = reader.Unbox("CategoryID"), + DocumentCheckedOutVersionHistoryID = reader.Unbox("DocumentCheckedOutVersionHistoryID"), + NodeClassID = reader.Unbox("NodeClassID"), + NodeSiteID = reader.Unbox("NodeSiteID"), + DocumentGUID = spoiledGuidContext.EnsureDocumentGuid( + reader.Unbox("DocumentGUID"), + reader.Unbox("NodeSiteID"), + reader.Unbox("NodeID"), + reader.Unbox("DocumentID") + ) + }, new SqlParameter("categoryId", cmsCategory.CategoryID)); + + foreach (var dwc in docsWithCategories) + { + if (skippedClasses.Contains(dwc.NodeClassID)) + { + logger.LogWarning("ContentItemCommonDataInfo cannot have categories migrated, data class is not patched with taxonomy field. DocumentGuid {Guid}", dwc.DocumentGUID); + continue; + } + + var commonData = ContentItemCommonDataInfo.Provider.Get() + .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataGUID), dwc.DocumentGUID) + .FirstOrDefault(); + + if (commonData is null) + { + logger.LogWarning("ContentItemCommonDataInfo not found by guid {Guid}, taxonomy cannot be migrated", dwc.DocumentGUID); + continue; + } + + var infosWithTag = ContentItemCommonDataInfo.Provider.Get() + .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentItemID), commonData.ContentItemCommonDataContentItemID) + .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentLanguageID), commonData.ContentItemCommonDataContentLanguageID); + + foreach (var infoWithTag in infosWithTag) + { + List tagReferences = []; + if (infoWithTag[categoryFieldName] is string jsonTags) + { + tagReferences = JsonConvert.DeserializeObject>(jsonTags) ?? []; + } + + tagReferences.Add(new TagReference { Identifier = tag.TagGUID }); + + infoWithTag[categoryFieldName] = JsonConvert.SerializeObject(tagReferences); + + ContentItemCommonDataInfo.Provider.Set(infoWithTag); + } + } + } + } + } + } + + return new GenericCommandResult(); + } + + private Guid EnsureReusableFieldSchema(TaxonomyInfo taxonomy, string categoryFieldName, string categoryFieldDisplayName) => reusableSchemaService.EnsureReusableFieldSchema( + "categories_container", + "Categories container", + "Container for legacy categories", + new FormFieldInfo + { + Enabled = true, + Visible = true, + AllowEmpty = true, + DataType = "taxonomy", + Name = categoryFieldName, + Caption = categoryFieldDisplayName, + Guid = new Guid("F65FE16C-53B0-47F7-B865-E8E300EC5F91"), + Settings = new Hashtable { { "controlname", "Kentico.Administration.TagSelector" }, { "TaxonomyGroup", $"[\"{taxonomy.TaxonomyGUID}\"]" } } + }); +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs index 7f08277f..7757e8ce 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomModulesCommandHandler.cs @@ -1,427 +1,427 @@ -namespace Migration.Toolkit.Source.Handlers; - -using System.Collections.Immutable; -using System.Diagnostics; -using System.Xml.Linq; -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Modules; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.Source; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; - -public class MigrateCustomModulesCommandHandler( - ILogger logger, - KxpClassFacade kxpClassFacade, - IEntityMapper dataClassMapper, - IEntityMapper resourceMapper, - IEntityMapper alternativeFormMapper, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - BulkDataCopyService bulkDataCopyService, - FieldMigrationService fieldMigrationService, - ModelFacade modelFacade - ) - : IRequestHandler -{ - public async Task Handle(MigrateCustomModulesCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - await MigrateResources(cancellationToken); - - await MigrateClasses(entityConfiguration, cancellationToken); - - return new GenericCommandResult(); - } - - private async Task MigrateClasses(EntityConfiguration entityConfiguration, CancellationToken cancellationToken) - { - using var cmsClasses = EnumerableHelper.CreateDeferrableItemWrapper( - modelFacade.SelectWhere("(ClassIsForm=0 OR ClassIsForm IS NULL) AND (ClassIsDocumentType=0 OR ClassIsDocumentType IS NULL)") - .OrderBy(x => x.ClassID) - ); - - while (cmsClasses.GetNext(out var di)) - { - var (_, cmsClass) = di; - - var resource = modelFacade.SelectById(cmsClass.ClassResourceID); - if (resource?.ResourceName.StartsWith("CMS.") == true) - { - continue; - } - - if (cmsClass.ClassIsCustomTable) - { - continue; - } - - if (cmsClass.ClassInheritsFromClassID is { } classInheritsFromClassId && !primaryKeyMappingContext.HasMapping(c => c.ClassID, classInheritsFromClassId)) - { - // defer migration to later stage - if (cmsClasses.TryDeferItem(di)) - { - logger.LogTrace("Class {Class} inheritance parent not found, deferring migration to end. Attempt {Attempt}", Printer.GetEntityIdentityPrint(cmsClass), di.Recurrence); - } - else - { - logger.LogErrorMissingDependency(cmsClass, nameof(cmsClass.ClassInheritsFromClassID), cmsClass.ClassInheritsFromClassID, typeof(DataClassInfo)); - protocol.Append(HandbookReferences - .MissingRequiredDependency(nameof(ICmsClass.ClassID), classInheritsFromClassId) - .NeedsManualAction() - ); - } - - continue; - } - - protocol.FetchedSource(cmsClass); - - var k12ResourceName = modelFacade.SelectById(cmsClass.ClassResourceID)?.ResourceName; - if (k12ResourceName != null && K12SystemResource.All.Contains(k12ResourceName) && !K12SystemResource.ConvertToNonSysResource.Contains(k12ResourceName)) - { - if (!K12SystemClass.Customizable.Contains(cmsClass.ClassName)) - { - logger.LogDebug("Class '{ClassClassName}' is part of system resource '{ResourceName}' and is not customizable", cmsClass.ClassName, cmsClass.ClassName); - continue; - } - - logger.LogInformation("Class '{ClassClassName}' is part of system resource '{ResourceName}' and is customizable => migrated partially", cmsClass.ClassName, - cmsClass.ClassName); - } - - if (entityConfiguration.ExcludeCodeNames.Contains(cmsClass.ClassName, StringComparer.InvariantCultureIgnoreCase)) - { - protocol.Warning(HandbookReferences.EntityExplicitlyExcludedByCodeName(cmsClass.ClassName, "CustomModule"), cmsClass); - logger.LogWarning("CmsClass: {ClassName} was skipped => it is explicitly excluded in configuration", cmsClass.ClassName); - continue; - } - - var xbkDataClass = kxpClassFacade.GetClass(cmsClass.ClassGUID); - - protocol.FetchedTarget(xbkDataClass); - - if (SaveClassUsingKxoApi(cmsClass, xbkDataClass) is { } savedDataClass) - { - Debug.Assert(savedDataClass.ClassID != 0, "xbkDataClass.ClassID != 0"); - xbkDataClass = DataClassInfoProvider.ProviderObject.Get(savedDataClass.ClassID); - await MigrateAlternativeForms(cmsClass, savedDataClass, cancellationToken); - - #region Migrate coupled data class data - - if (cmsClass.ClassShowAsSystemTable is false) - { - Debug.Assert(xbkDataClass.ClassTableName != null, "k12Class.ClassTableName != null"); - - XNamespace nsSchema = "http://www.w3.org/2001/XMLSchema"; - XNamespace msSchema = "urn:schemas-microsoft-com:xml-msdata"; - var xDoc = XDocument.Parse(xbkDataClass.ClassXmlSchema); - var autoIncrementColumns = xDoc.Descendants(nsSchema + "element") - .Where(x => x.Attribute(msSchema + "AutoIncrement")?.Value == "true") - .Select(x => x.Attribute("name")?.Value).ToImmutableHashSet(); - - Debug.Assert(autoIncrementColumns.Count == 1, "autoIncrementColumns.Count == 1"); - - var r = (xbkDataClass.ClassTableName, xbkDataClass.ClassGUID, autoIncrementColumns); - logger.LogTrace("Class '{ClassGuild}' Resolved as: {Result}", cmsClass.ClassGUID, r); - - try - { - // check if data is present in target tables - if (bulkDataCopyService.CheckIfDataExistsInTargetTable(xbkDataClass.ClassTableName)) - { - logger.LogWarning("Data exists in target coupled data table '{TableName}' - cannot migrate, skipping form data migration", r.ClassTableName); - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable(xbkDataClass.ClassTableName)); - continue; - } - - var bulkCopyRequest = new BulkCopyRequest( - xbkDataClass.ClassTableName, - s => true, // s => !autoIncrementColumns.Contains(s), - _ => true, - 20000 - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Error while copying data to table"); - } - } - - #endregion - } - } - - // special case - member migration (CMS_User splits into CMS_User and CMS_Member in XbK) - await MigrateMemberClass(cancellationToken); - } - - private async Task MigrateMemberClass(CancellationToken cancellationToken) - { - var cmsUser = modelFacade.SelectAll().FirstOrDefault(x => x.ClassName == K12SystemClass.cms_user); - var cmsUserSettings = modelFacade.SelectAll().FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); - - if (cmsUser == null) - { - protocol.Warning(HandbookReferences.InvalidSourceData().WithMessage($"{K12SystemClass.cms_user} class not found"), null); - return; - } - - if (cmsUserSettings == null) - { - protocol.Warning(HandbookReferences.InvalidSourceData().WithMessage($"{K12SystemClass.cms_usersettings} class not found"), null); - return; - } - - var target = kxpClassFacade.GetClass("CMS.Member"); - - PatchClass(cmsUser, out var cmsUserCsi, out var cmsUserFi); - PatchClass(cmsUserSettings, out var cmsUserSettingsCsi, out var cmsUserSettingsFi); - - var memberFormInfo = new FormInfo(target.ClassFormDefinition); - - var includedSystemFields = toolkitConfiguration.MemberIncludeUserSystemFields?.Split('|', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); - - var memberColumns = memberFormInfo.GetColumnNames(); - - foreach (var uColumn in cmsUserFi.GetColumnNames()) - { - var field = cmsUserFi.GetFormField(uColumn); - - if ( - !memberColumns.Contains(uColumn) && - !field.PrimaryKey && - !MemberInfoMapper.MigratedUserFields.Contains(uColumn, StringComparer.InvariantCultureIgnoreCase) - && (includedSystemFields.Contains(uColumn) || !field.System) - ) - { - field.System = false; // no longer system field - memberFormInfo.AddFormItem(field); - } - } - - foreach (var usColumn in cmsUserSettingsFi.GetColumnNames()) - { - var field = cmsUserSettingsFi.GetFormField(usColumn); - - if ( - !memberColumns.Contains(usColumn) && - !field.PrimaryKey - && (includedSystemFields.Contains(usColumn) || !field.System)) - { - field.System = false; // no longer system field - memberFormInfo.AddFormItem(field); - } - } - - target.ClassFormDefinition = memberFormInfo.GetXmlDefinition(); - DataClassInfoProvider.ProviderObject.Set(target); - } - - private void PatchClass(ICmsClass cmsClass, out ClassStructureInfo classStructureInfo, out FormInfo cmsUserFormInfo) - { - classStructureInfo = new ClassStructureInfo(cmsClass.ClassName, cmsClass.ClassXmlSchema, cmsClass.ClassTableName); - var patcher = new FormDefinitionPatcher( - logger, - cmsClass.ClassFormDefinition, - fieldMigrationService, - cmsClass.ClassIsForm.GetValueOrDefault(false), - cmsClass.ClassIsDocumentType, - false, - false - ); - patcher.PatchFields(); - patcher.RemoveCategories(); - var result = patcher.GetPatched(); - cmsUserFormInfo = new FormInfo(result); - } - - private async Task MigrateAlternativeForms(ICmsClass k12Class, DataClassInfo xbkDataClass, CancellationToken cancellationToken) - { - var k12AlternativeForms = modelFacade.SelectAll() - .Where(af => af.FormClassID == k12Class.ClassID); - - foreach (var k12AlternativeForm in k12AlternativeForms) - { - protocol.FetchedSource(k12AlternativeForm); - - var xbkAlternativeForm = AlternativeFormInfoProvider.ProviderObject.Get(k12AlternativeForm.FormGUID); - protocol.FetchedTarget(xbkAlternativeForm); - - var mappingSource = new AlternativeFormMapperSource(k12AlternativeForm, xbkDataClass); - var mapped = alternativeFormMapper.Map(mappingSource, xbkAlternativeForm); - protocol.MappedTarget(mapped); - - try - { - if (mapped is { Success: true }) - { - var (alternativeFormInfo, newInstance) = mapped; - ArgumentNullException.ThrowIfNull(alternativeFormInfo, nameof(alternativeFormInfo)); - - AlternativeFormInfoProvider.ProviderObject.Set(alternativeFormInfo); - - protocol.Success(k12AlternativeForm, alternativeFormInfo, mapped); - logger.LogEntitySetAction(newInstance, alternativeFormInfo); - - primaryKeyMappingContext.SetMapping( - r => r.FormID, - k12AlternativeForm.FormID, - alternativeFormInfo.FormID - ); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Error while saving alternative form {ResourceName}", k12AlternativeForm.FormName); - } - } - } - - private Task> GetResourceClasses(int k12ResourceId) - { - return Task.FromResult(modelFacade - .SelectWhere("ClassResourceID = @classResourceId", new SqlParameter("classResourceId", k12ResourceId)) - .ToList()); - } - - private async Task MigrateResources(CancellationToken cancellationToken) - { - var k12CmsResources = modelFacade.SelectAll(); - - foreach (var k12CmsResource in k12CmsResources) - { - protocol.FetchedSource(k12CmsResource); - - var xbkResource = ResourceInfoProvider.ProviderObject.Get(k12CmsResource.ResourceGUID); - - protocol.FetchedTarget(xbkResource); - - var sysResourceInclude = K12SystemResource.ConvertToNonSysResource.Contains(k12CmsResource.ResourceName); - var isSystemResource = K12SystemResource.All.Contains(k12CmsResource.ResourceName); - if (isSystemResource) - { - if (sysResourceInclude) - { - logger.LogDebug("CMSResource is system resource ({Resource}) and is included in migration", Printer.GetEntityIdentityPrint(k12CmsResource)); - } - else - { - logger.LogDebug("CMSResource is system resource ({Resource})", Printer.GetEntityIdentityPrint(k12CmsResource)); - - var k12Classes = await GetResourceClasses(k12CmsResource.ResourceID); - if (k12Classes.Any(x => K12SystemClass.Customizable.Contains(x.ClassName))) - { - logger.LogDebug("CMSResource ({Resource}) contains customizable classes", Printer.GetEntityIdentityPrint(k12CmsResource)); - if (xbkResource != null) - { - var handbookRef = HandbookReferences - .NotSupportedSkip() - .WithIdentityPrint(k12CmsResource); - - logger.LogInformation("CMSResource is system resource and exists in target instance ({Resource}) => skipping", Printer.GetEntityIdentityPrint(k12CmsResource)); - protocol.Append(handbookRef); - continue; - } - - logger.LogInformation("CMSResource is system resource and NOT exists in target instance ({Resource}), contains customizable classes => will be migrated", - Printer.GetEntityIdentityPrint(k12CmsResource)); - } - else - { - var handbookRef = HandbookReferences - .NotSupportedSkip() - .WithIdentityPrint(k12CmsResource); - - logger.LogInformation("CMSResource is system resource and exists in target instance ({Resource}) => skipping", Printer.GetEntityIdentityPrint(k12CmsResource)); - protocol.Append(handbookRef); - continue; - } - } - } - else - { - logger.LogDebug("CMSResource is CUSTOM resource ({Resource})", Printer.GetEntityIdentityPrint(k12CmsResource)); - } - - var mapped = resourceMapper.Map(k12CmsResource, xbkResource); - protocol.MappedTarget(mapped); - - try - { - if (mapped is { Success: true }) - { - var (resourceInfo, newInstance) = mapped; - ArgumentNullException.ThrowIfNull(resourceInfo, nameof(resourceInfo)); - - ResourceInfoProvider.ProviderObject.Set(resourceInfo); - - protocol.Success(k12CmsResource, resourceInfo, mapped); - logger.LogEntitySetAction(newInstance, resourceInfo); - - primaryKeyMappingContext.SetMapping( - r => r.ResourceID, - k12CmsResource.ResourceID, - resourceInfo.ResourceID - ); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Error while saving resource {ResourceName}", k12CmsResource.ResourceName); - } - } - } - - private DataClassInfo? SaveClassUsingKxoApi(ICmsClass k12Class, DataClassInfo kxoDataClass) - { - var mapped = dataClassMapper.Map(k12Class, kxoDataClass); - protocol.MappedTarget(mapped); - - try - { - if (mapped is { Success: true } result) - { - var (dataClassInfo, newInstance) = result; - ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); - - kxpClassFacade.SetClass(dataClassInfo); - - protocol.Success(k12Class, dataClassInfo, mapped); - logger.LogEntitySetAction(newInstance, dataClassInfo); - - primaryKeyMappingContext.SetMapping( - r => r.ClassID, - k12Class.ClassID, - dataClassInfo.ClassID - ); - - return dataClassInfo; - } - } - catch (Exception ex) - { - logger.LogError(ex, "Error while saving page type {ClassName}", k12Class.ClassName); - } - - return null; - } -} \ No newline at end of file +using System.Collections.Immutable; +using System.Diagnostics; +using System.Xml.Linq; + +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Modules; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Api.Services.CmsClass; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Helpers; +using Migration.Toolkit.Source.Mappers; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Handlers; + +public class MigrateCustomModulesCommandHandler( + ILogger logger, + KxpClassFacade kxpClassFacade, + IEntityMapper dataClassMapper, + IEntityMapper resourceMapper, + IEntityMapper alternativeFormMapper, + ToolkitConfiguration toolkitConfiguration, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + BulkDataCopyService bulkDataCopyService, + FieldMigrationService fieldMigrationService, + ModelFacade modelFacade +) + : IRequestHandler +{ + public async Task Handle(MigrateCustomModulesCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); + + await MigrateResources(cancellationToken); + + await MigrateClasses(entityConfiguration, cancellationToken); + + return new GenericCommandResult(); + } + + private async Task MigrateClasses(EntityConfiguration entityConfiguration, CancellationToken cancellationToken) + { + using var cmsClasses = EnumerableHelper.CreateDeferrableItemWrapper( + modelFacade.SelectWhere("(ClassIsForm=0 OR ClassIsForm IS NULL) AND (ClassIsDocumentType=0 OR ClassIsDocumentType IS NULL)") + .OrderBy(x => x.ClassID) + ); + + while (cmsClasses.GetNext(out var di)) + { + var (_, cmsClass) = di; + + var resource = modelFacade.SelectById(cmsClass.ClassResourceID); + if (resource?.ResourceName.StartsWith("CMS.") == true) + { + continue; + } + + if (cmsClass.ClassIsCustomTable) + { + continue; + } + + if (cmsClass.ClassInheritsFromClassID is { } classInheritsFromClassId && !primaryKeyMappingContext.HasMapping(c => c.ClassID, classInheritsFromClassId)) + { + // defer migration to later stage + if (cmsClasses.TryDeferItem(di)) + { + logger.LogTrace("Class {Class} inheritance parent not found, deferring migration to end. Attempt {Attempt}", Printer.GetEntityIdentityPrint(cmsClass), di.Recurrence); + } + else + { + logger.LogErrorMissingDependency(cmsClass, nameof(cmsClass.ClassInheritsFromClassID), cmsClass.ClassInheritsFromClassID, typeof(DataClassInfo)); + protocol.Append(HandbookReferences + .MissingRequiredDependency(nameof(ICmsClass.ClassID), classInheritsFromClassId) + .NeedsManualAction() + ); + } + + continue; + } + + protocol.FetchedSource(cmsClass); + + string? k12ResourceName = modelFacade.SelectById(cmsClass.ClassResourceID)?.ResourceName; + if (k12ResourceName != null && K12SystemResource.All.Contains(k12ResourceName) && !K12SystemResource.ConvertToNonSysResource.Contains(k12ResourceName)) + { + if (!K12SystemClass.Customizable.Contains(cmsClass.ClassName)) + { + logger.LogDebug("Class '{ClassClassName}' is part of system resource '{ResourceName}' and is not customizable", cmsClass.ClassName, cmsClass.ClassName); + continue; + } + + logger.LogInformation("Class '{ClassClassName}' is part of system resource '{ResourceName}' and is customizable => migrated partially", cmsClass.ClassName, + cmsClass.ClassName); + } + + if (entityConfiguration.ExcludeCodeNames.Contains(cmsClass.ClassName, StringComparer.InvariantCultureIgnoreCase)) + { + protocol.Warning(HandbookReferences.EntityExplicitlyExcludedByCodeName(cmsClass.ClassName, "CustomModule"), cmsClass); + logger.LogWarning("CmsClass: {ClassName} was skipped => it is explicitly excluded in configuration", cmsClass.ClassName); + continue; + } + + var xbkDataClass = kxpClassFacade.GetClass(cmsClass.ClassGUID); + + protocol.FetchedTarget(xbkDataClass); + + if (SaveClassUsingKxoApi(cmsClass, xbkDataClass) is { } savedDataClass) + { + Debug.Assert(savedDataClass.ClassID != 0, "xbkDataClass.ClassID != 0"); + xbkDataClass = DataClassInfoProvider.ProviderObject.Get(savedDataClass.ClassID); + await MigrateAlternativeForms(cmsClass, savedDataClass, cancellationToken); + + #region Migrate coupled data class data + + if (cmsClass.ClassShowAsSystemTable is false) + { + Debug.Assert(xbkDataClass.ClassTableName != null, "k12Class.ClassTableName != null"); + + XNamespace nsSchema = "http://www.w3.org/2001/XMLSchema"; + XNamespace msSchema = "urn:schemas-microsoft-com:xml-msdata"; + var xDoc = XDocument.Parse(xbkDataClass.ClassXmlSchema); + var autoIncrementColumns = xDoc.Descendants(nsSchema + "element") + .Where(x => x.Attribute(msSchema + "AutoIncrement")?.Value == "true") + .Select(x => x.Attribute("name")?.Value).ToImmutableHashSet(); + + Debug.Assert(autoIncrementColumns.Count == 1, "autoIncrementColumns.Count == 1"); + + var r = (xbkDataClass.ClassTableName, xbkDataClass.ClassGUID, autoIncrementColumns); + logger.LogTrace("Class '{ClassGuild}' Resolved as: {Result}", cmsClass.ClassGUID, r); + + try + { + // check if data is present in target tables + if (bulkDataCopyService.CheckIfDataExistsInTargetTable(xbkDataClass.ClassTableName)) + { + logger.LogWarning("Data exists in target coupled data table '{TableName}' - cannot migrate, skipping form data migration", r.ClassTableName); + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable(xbkDataClass.ClassTableName)); + continue; + } + + var bulkCopyRequest = new BulkCopyRequest( + xbkDataClass.ClassTableName, + s => true, // s => !autoIncrementColumns.Contains(s), + _ => true, + 20000 + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Error while copying data to table"); + } + } + + #endregion + } + } + + // special case - member migration (CMS_User splits into CMS_User and CMS_Member in XbK) + await MigrateMemberClass(cancellationToken); + } + + private async Task MigrateMemberClass(CancellationToken cancellationToken) + { + var cmsUser = modelFacade.SelectAll().FirstOrDefault(x => x.ClassName == K12SystemClass.cms_user); + var cmsUserSettings = modelFacade.SelectAll().FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); + + if (cmsUser == null) + { + protocol.Warning(HandbookReferences.InvalidSourceData().WithMessage($"{K12SystemClass.cms_user} class not found"), null); + return; + } + + if (cmsUserSettings == null) + { + protocol.Warning(HandbookReferences.InvalidSourceData().WithMessage($"{K12SystemClass.cms_usersettings} class not found"), null); + return; + } + + var target = kxpClassFacade.GetClass("CMS.Member"); + + PatchClass(cmsUser, out var cmsUserCsi, out var cmsUserFi); + PatchClass(cmsUserSettings, out var cmsUserSettingsCsi, out var cmsUserSettingsFi); + + var memberFormInfo = new FormInfo(target.ClassFormDefinition); + + string[] includedSystemFields = toolkitConfiguration.MemberIncludeUserSystemFields?.Split('|', StringSplitOptions.RemoveEmptyEntries) ?? Array.Empty(); + + var memberColumns = memberFormInfo.GetColumnNames(); + + foreach (string? uColumn in cmsUserFi.GetColumnNames()) + { + var field = cmsUserFi.GetFormField(uColumn); + + if ( + !memberColumns.Contains(uColumn) && + !field.PrimaryKey && + !MemberInfoMapper.MigratedUserFields.Contains(uColumn, StringComparer.InvariantCultureIgnoreCase) + && (includedSystemFields.Contains(uColumn) || !field.System) + ) + { + field.System = false; // no longer system field + memberFormInfo.AddFormItem(field); + } + } + + foreach (string? usColumn in cmsUserSettingsFi.GetColumnNames()) + { + var field = cmsUserSettingsFi.GetFormField(usColumn); + + if ( + !memberColumns.Contains(usColumn) && + !field.PrimaryKey + && (includedSystemFields.Contains(usColumn) || !field.System)) + { + field.System = false; // no longer system field + memberFormInfo.AddFormItem(field); + } + } + + target.ClassFormDefinition = memberFormInfo.GetXmlDefinition(); + DataClassInfoProvider.ProviderObject.Set(target); + } + + private void PatchClass(ICmsClass cmsClass, out ClassStructureInfo classStructureInfo, out FormInfo cmsUserFormInfo) + { + classStructureInfo = new ClassStructureInfo(cmsClass.ClassName, cmsClass.ClassXmlSchema, cmsClass.ClassTableName); + var patcher = new FormDefinitionPatcher( + logger, + cmsClass.ClassFormDefinition, + fieldMigrationService, + cmsClass.ClassIsForm.GetValueOrDefault(false), + cmsClass.ClassIsDocumentType, + false, + false + ); + patcher.PatchFields(); + patcher.RemoveCategories(); + string? result = patcher.GetPatched(); + cmsUserFormInfo = new FormInfo(result); + } + + private async Task MigrateAlternativeForms(ICmsClass k12Class, DataClassInfo xbkDataClass, CancellationToken cancellationToken) + { + var k12AlternativeForms = modelFacade.SelectAll() + .Where(af => af.FormClassID == k12Class.ClassID); + + foreach (var k12AlternativeForm in k12AlternativeForms) + { + protocol.FetchedSource(k12AlternativeForm); + + var xbkAlternativeForm = AlternativeFormInfoProvider.ProviderObject.Get(k12AlternativeForm.FormGUID); + protocol.FetchedTarget(xbkAlternativeForm); + + var mappingSource = new AlternativeFormMapperSource(k12AlternativeForm, xbkDataClass); + var mapped = alternativeFormMapper.Map(mappingSource, xbkAlternativeForm); + protocol.MappedTarget(mapped); + + try + { + if (mapped is { Success: true }) + { + (var alternativeFormInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(alternativeFormInfo, nameof(alternativeFormInfo)); + + AlternativeFormInfoProvider.ProviderObject.Set(alternativeFormInfo); + + protocol.Success(k12AlternativeForm, alternativeFormInfo, mapped); + logger.LogEntitySetAction(newInstance, alternativeFormInfo); + + primaryKeyMappingContext.SetMapping( + r => r.FormID, + k12AlternativeForm.FormID, + alternativeFormInfo.FormID + ); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Error while saving alternative form {ResourceName}", k12AlternativeForm.FormName); + } + } + } + + private Task> GetResourceClasses(int k12ResourceId) => Task.FromResult(modelFacade + .SelectWhere("ClassResourceID = @classResourceId", new SqlParameter("classResourceId", k12ResourceId)) + .ToList()); + + private async Task MigrateResources(CancellationToken cancellationToken) + { + var k12CmsResources = modelFacade.SelectAll(); + + foreach (var k12CmsResource in k12CmsResources) + { + protocol.FetchedSource(k12CmsResource); + + var xbkResource = ResourceInfoProvider.ProviderObject.Get(k12CmsResource.ResourceGUID); + + protocol.FetchedTarget(xbkResource); + + bool sysResourceInclude = K12SystemResource.ConvertToNonSysResource.Contains(k12CmsResource.ResourceName); + bool isSystemResource = K12SystemResource.All.Contains(k12CmsResource.ResourceName); + if (isSystemResource) + { + if (sysResourceInclude) + { + logger.LogDebug("CMSResource is system resource ({Resource}) and is included in migration", Printer.GetEntityIdentityPrint(k12CmsResource)); + } + else + { + logger.LogDebug("CMSResource is system resource ({Resource})", Printer.GetEntityIdentityPrint(k12CmsResource)); + + var k12Classes = await GetResourceClasses(k12CmsResource.ResourceID); + if (k12Classes.Any(x => K12SystemClass.Customizable.Contains(x.ClassName))) + { + logger.LogDebug("CMSResource ({Resource}) contains customizable classes", Printer.GetEntityIdentityPrint(k12CmsResource)); + if (xbkResource != null) + { + var handbookRef = HandbookReferences + .NotSupportedSkip() + .WithIdentityPrint(k12CmsResource); + + logger.LogInformation("CMSResource is system resource and exists in target instance ({Resource}) => skipping", Printer.GetEntityIdentityPrint(k12CmsResource)); + protocol.Append(handbookRef); + continue; + } + + logger.LogInformation("CMSResource is system resource and NOT exists in target instance ({Resource}), contains customizable classes => will be migrated", + Printer.GetEntityIdentityPrint(k12CmsResource)); + } + else + { + var handbookRef = HandbookReferences + .NotSupportedSkip() + .WithIdentityPrint(k12CmsResource); + + logger.LogInformation("CMSResource is system resource and exists in target instance ({Resource}) => skipping", Printer.GetEntityIdentityPrint(k12CmsResource)); + protocol.Append(handbookRef); + continue; + } + } + } + else + { + logger.LogDebug("CMSResource is CUSTOM resource ({Resource})", Printer.GetEntityIdentityPrint(k12CmsResource)); + } + + var mapped = resourceMapper.Map(k12CmsResource, xbkResource); + protocol.MappedTarget(mapped); + + try + { + if (mapped is { Success: true }) + { + (var resourceInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(resourceInfo, nameof(resourceInfo)); + + ResourceInfoProvider.ProviderObject.Set(resourceInfo); + + protocol.Success(k12CmsResource, resourceInfo, mapped); + logger.LogEntitySetAction(newInstance, resourceInfo); + + primaryKeyMappingContext.SetMapping( + r => r.ResourceID, + k12CmsResource.ResourceID, + resourceInfo.ResourceID + ); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Error while saving resource {ResourceName}", k12CmsResource.ResourceName); + } + } + } + + private DataClassInfo? SaveClassUsingKxoApi(ICmsClass k12Class, DataClassInfo kxoDataClass) + { + var mapped = dataClassMapper.Map(k12Class, kxoDataClass); + protocol.MappedTarget(mapped); + + try + { + if (mapped is { Success: true } result) + { + (var dataClassInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); + + kxpClassFacade.SetClass(dataClassInfo); + + protocol.Success(k12Class, dataClassInfo, mapped); + logger.LogEntitySetAction(newInstance, dataClassInfo); + + primaryKeyMappingContext.SetMapping( + r => r.ClassID, + k12Class.ClassID, + dataClassInfo.ClassID + ); + + return dataClassInfo; + } + } + catch (Exception ex) + { + logger.LogError(ex, "Error while saving page type {ClassName}", k12Class.ClassName); + } + + return null; + } +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs index 04e9469c..07a4f322 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateCustomTablesHandler.cs @@ -1,205 +1,212 @@ -namespace Migration.Toolkit.Source.Handlers; - -using System.Collections.Immutable; -using System.Diagnostics; -using System.Xml.Linq; -using CMS.DataEngine; -using CMS.Modules; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; - -public class MigrateCustomTablesHandler( - ILogger logger, - ModelFacade modelFacade, - KxpClassFacade kxpClassFacade, - IProtocol protocol, - BulkDataCopyService bulkDataCopyService, - IEntityMapper dataClassMapper, - PrimaryKeyMappingContext primaryKeyMappingContext - // ReusableSchemaService reusableSchemaService - ) - : IRequestHandler -{ - public async Task Handle(MigrateCustomTablesCommand request, CancellationToken cancellationToken) - { - await MigrateCustomTables(); - - return new GenericCommandResult(); - } - - private readonly Guid _resourceGuidNamespace = new("C4E3F5FD-9220-4300-91CE-8EB565D3235E"); - private ResourceInfo? _customTableResource; - - private async Task EnsureCustomTablesResource() - { - if (_customTableResource != null) return _customTableResource; - - const string resourceName = "customtables"; - var resourceGuid = GuidV5.NewNameBased(_resourceGuidNamespace, resourceName); - var resourceInfo = await ResourceInfoProvider.ProviderObject.GetAsync(resourceGuid); - if (resourceInfo == null) - { - resourceInfo = new ResourceInfo - { - ResourceDisplayName = "Custom tables", - ResourceName = resourceName, - ResourceDescription = $"Container resource for migrated custom tables", - ResourceGUID = resourceGuid, - ResourceLastModified = default, - ResourceIsInDevelopment = false - }; - ResourceInfoProvider.ProviderObject.Set(resourceInfo); - } - - _customTableResource = resourceInfo; - return resourceInfo; - } - - private async Task MigrateCustomTables() - { - using var srcClassesDe = EnumerableHelper.CreateDeferrableItemWrapper( - modelFacade.Select("ClassIsCustomTable=1", "ClassID ASC") - ); - - while (srcClassesDe.GetNext(out var di)) - { - var (_, srcClass) = di; - - if (!srcClass.ClassIsCustomTable) - { - continue; - } - - if (srcClass.ClassInheritsFromClassID is { } classInheritsFromClassId && !primaryKeyMappingContext.HasMapping(c => c.ClassID, classInheritsFromClassId)) - { - // defer migration to later stage - if (srcClassesDe.TryDeferItem(di)) - { - logger.LogTrace("Class {Class} inheritance parent not found, deferring migration to end. Attempt {Attempt}", Printer.GetEntityIdentityPrint(srcClass), di.Recurrence); - } - else - { - logger.LogErrorMissingDependency(srcClass, nameof(srcClass.ClassInheritsFromClassID), srcClass.ClassInheritsFromClassID, typeof(DataClassInfo)); - protocol.Append(HandbookReferences - .MissingRequiredDependency(nameof(ICmsClass.ClassID), classInheritsFromClassId) - .NeedsManualAction() - ); - } - - continue; - } - - protocol.FetchedSource(srcClass); - - var xbkDataClass = kxpClassFacade.GetClass(srcClass.ClassGUID); - - protocol.FetchedTarget(xbkDataClass); - - if (await SaveClassUsingKxoApi(srcClass, xbkDataClass) is { } savedDataClass) - { - Debug.Assert(savedDataClass.ClassID != 0, "xbkDataClass.ClassID != 0"); - // MigrateClassSiteMappings(kx13Class, xbkDataClass); - - xbkDataClass = DataClassInfoProvider.ProviderObject.Get(savedDataClass.ClassID); - // await MigrateAlternativeForms(srcClass, savedDataClass, cancellationToken); - - #region Migrate coupled data class data - - if (srcClass.ClassShowAsSystemTable is false) - { - Debug.Assert(xbkDataClass.ClassTableName != null, "kx13Class.ClassTableName != null"); - // var csi = new ClassStructureInfo(kx13Class.ClassXmlSchema, kx13Class.ClassXmlSchema, kx13Class.ClassTableName); - - XNamespace nsSchema = "http://www.w3.org/2001/XMLSchema"; - XNamespace msSchema = "urn:schemas-microsoft-com:xml-msdata"; - var xDoc = XDocument.Parse(xbkDataClass.ClassXmlSchema); - var autoIncrementColumns = xDoc.Descendants(nsSchema + "element") - .Where(x => x.Attribute(msSchema + "AutoIncrement")?.Value == "true") - .Select(x => x.Attribute("name")?.Value).ToImmutableHashSet(); - - Debug.Assert(autoIncrementColumns.Count == 1, "autoIncrementColumns.Count == 1"); - var r = (xbkDataClass.ClassTableName, xbkDataClass.ClassGUID, autoIncrementColumns); - logger.LogTrace("Class '{ClassGuild}' Resolved as: {Result}", srcClass.ClassGUID, r); - - try - { - // check if data is present in target tables - if (bulkDataCopyService.CheckIfDataExistsInTargetTable(xbkDataClass.ClassTableName)) - { - logger.LogWarning("Data exists in target coupled data table '{TableName}' - cannot migrate, skipping form data migration", r.ClassTableName); - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable(xbkDataClass.ClassTableName)); - continue; - } - - var bulkCopyRequest = new BulkCopyRequest( - xbkDataClass.ClassTableName, - s => true, // s => !autoIncrementColumns.Contains(s), - _ => true, - 20000 - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Error while copying data to table"); - } - } - - #endregion - } - } - } - - private async Task SaveClassUsingKxoApi(ICmsClass srcClass, DataClassInfo kxoDataClass) - { - var mapped = dataClassMapper.Map(srcClass, kxoDataClass); - protocol.MappedTarget(mapped); - - try - { - if (mapped is { Success: true } result) - { - var (dataClassInfo, newInstance) = result; - - ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); - - // if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(dataClassInfo.ClassName)) - // { - // dataClassInfo = reusableSchemaService.ConvertToReusableSchema(dataClassInfo); - // } - - var containerResource = await EnsureCustomTablesResource(); - dataClassInfo.ClassResourceID = containerResource.ResourceID; - kxpClassFacade.SetClass(dataClassInfo); - - protocol.Success(srcClass, dataClassInfo, mapped); - logger.LogEntitySetAction(newInstance, dataClassInfo); - - primaryKeyMappingContext.SetMapping( - r => r.ClassID, - srcClass.ClassID, - dataClassInfo.ClassID - ); - - return dataClassInfo; - } - } - catch (Exception ex) - { - logger.LogError(ex, "Error while saving page type {ClassName}", srcClass.ClassName); - } - - return null; - } -} \ No newline at end of file +using System.Collections.Immutable; +using System.Diagnostics; +using System.Xml.Linq; + +using CMS.DataEngine; +using CMS.Modules; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Helpers; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Handlers; + +public class MigrateCustomTablesHandler( + ILogger logger, + ModelFacade modelFacade, + KxpClassFacade kxpClassFacade, + IProtocol protocol, + BulkDataCopyService bulkDataCopyService, + IEntityMapper dataClassMapper, + PrimaryKeyMappingContext primaryKeyMappingContext +// ReusableSchemaService reusableSchemaService +) + : IRequestHandler +{ + private readonly Guid resourceGuidNamespace = new("C4E3F5FD-9220-4300-91CE-8EB565D3235E"); + private ResourceInfo? customTableResource; + + public async Task Handle(MigrateCustomTablesCommand request, CancellationToken cancellationToken) + { + await MigrateCustomTables(); + + return new GenericCommandResult(); + } + + private async Task EnsureCustomTablesResource() + { + if (customTableResource != null) + { + return customTableResource; + } + + const string resourceName = "customtables"; + var resourceGuid = GuidV5.NewNameBased(resourceGuidNamespace, resourceName); + var resourceInfo = await ResourceInfoProvider.ProviderObject.GetAsync(resourceGuid); + if (resourceInfo == null) + { + resourceInfo = new ResourceInfo + { + ResourceDisplayName = "Custom tables", + ResourceName = resourceName, + ResourceDescription = "Container resource for migrated custom tables", + ResourceGUID = resourceGuid, + ResourceLastModified = default, + ResourceIsInDevelopment = false + }; + ResourceInfoProvider.ProviderObject.Set(resourceInfo); + } + + customTableResource = resourceInfo; + return resourceInfo; + } + + private async Task MigrateCustomTables() + { + using var srcClassesDe = EnumerableHelper.CreateDeferrableItemWrapper( + modelFacade.Select("ClassIsCustomTable=1", "ClassID ASC") + ); + + while (srcClassesDe.GetNext(out var di)) + { + var (_, srcClass) = di; + + if (!srcClass.ClassIsCustomTable) + { + continue; + } + + if (srcClass.ClassInheritsFromClassID is { } classInheritsFromClassId && !primaryKeyMappingContext.HasMapping(c => c.ClassID, classInheritsFromClassId)) + { + // defer migration to later stage + if (srcClassesDe.TryDeferItem(di)) + { + logger.LogTrace("Class {Class} inheritance parent not found, deferring migration to end. Attempt {Attempt}", Printer.GetEntityIdentityPrint(srcClass), di.Recurrence); + } + else + { + logger.LogErrorMissingDependency(srcClass, nameof(srcClass.ClassInheritsFromClassID), srcClass.ClassInheritsFromClassID, typeof(DataClassInfo)); + protocol.Append(HandbookReferences + .MissingRequiredDependency(nameof(ICmsClass.ClassID), classInheritsFromClassId) + .NeedsManualAction() + ); + } + + continue; + } + + protocol.FetchedSource(srcClass); + + var xbkDataClass = kxpClassFacade.GetClass(srcClass.ClassGUID); + + protocol.FetchedTarget(xbkDataClass); + + if (await SaveClassUsingKxoApi(srcClass, xbkDataClass) is { } savedDataClass) + { + Debug.Assert(savedDataClass.ClassID != 0, "xbkDataClass.ClassID != 0"); + // MigrateClassSiteMappings(kx13Class, xbkDataClass); + + xbkDataClass = DataClassInfoProvider.ProviderObject.Get(savedDataClass.ClassID); + // await MigrateAlternativeForms(srcClass, savedDataClass, cancellationToken); + + #region Migrate coupled data class data + + if (srcClass.ClassShowAsSystemTable is false) + { + Debug.Assert(xbkDataClass.ClassTableName != null, "kx13Class.ClassTableName != null"); + // var csi = new ClassStructureInfo(kx13Class.ClassXmlSchema, kx13Class.ClassXmlSchema, kx13Class.ClassTableName); + + XNamespace nsSchema = "http://www.w3.org/2001/XMLSchema"; + XNamespace msSchema = "urn:schemas-microsoft-com:xml-msdata"; + var xDoc = XDocument.Parse(xbkDataClass.ClassXmlSchema); + var autoIncrementColumns = xDoc.Descendants(nsSchema + "element") + .Where(x => x.Attribute(msSchema + "AutoIncrement")?.Value == "true") + .Select(x => x.Attribute("name")?.Value).ToImmutableHashSet(); + + Debug.Assert(autoIncrementColumns.Count == 1, "autoIncrementColumns.Count == 1"); + var r = (xbkDataClass.ClassTableName, xbkDataClass.ClassGUID, autoIncrementColumns); + logger.LogTrace("Class '{ClassGuild}' Resolved as: {Result}", srcClass.ClassGUID, r); + + try + { + // check if data is present in target tables + if (bulkDataCopyService.CheckIfDataExistsInTargetTable(xbkDataClass.ClassTableName)) + { + logger.LogWarning("Data exists in target coupled data table '{TableName}' - cannot migrate, skipping form data migration", r.ClassTableName); + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable(xbkDataClass.ClassTableName)); + continue; + } + + var bulkCopyRequest = new BulkCopyRequest( + xbkDataClass.ClassTableName, + s => true, // s => !autoIncrementColumns.Contains(s), + _ => true, + 20000 + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Error while copying data to table"); + } + } + + #endregion + } + } + } + + private async Task SaveClassUsingKxoApi(ICmsClass srcClass, DataClassInfo kxoDataClass) + { + var mapped = dataClassMapper.Map(srcClass, kxoDataClass); + protocol.MappedTarget(mapped); + + try + { + if (mapped is { Success: true } result) + { + (var dataClassInfo, bool newInstance) = result; + + ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); + + // if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(dataClassInfo.ClassName)) + // { + // dataClassInfo = reusableSchemaService.ConvertToReusableSchema(dataClassInfo); + // } + + var containerResource = await EnsureCustomTablesResource(); + dataClassInfo.ClassResourceID = containerResource.ResourceID; + kxpClassFacade.SetClass(dataClassInfo); + + protocol.Success(srcClass, dataClassInfo, mapped); + logger.LogEntitySetAction(newInstance, dataClassInfo); + + primaryKeyMappingContext.SetMapping( + r => r.ClassID, + srcClass.ClassID, + dataClassInfo.ClassID + ); + + return dataClassInfo; + } + } + catch (Exception ex) + { + logger.LogError(ex, "Error while saving page type {ClassName}", srcClass.ClassName); + } + + return null; + } +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs index de3600e9..a2e0ad07 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateFormsCommandHandler.cs @@ -1,263 +1,264 @@ -namespace Migration.Toolkit.Source.Handlers; - -using System.Collections.Immutable; -using System.Diagnostics; -using System.Xml.Linq; -using CMS.Base; -using CMS.DataEngine; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -public class MigrateFormsCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IEntityMapper dataClassMapper, - IEntityMapper cmsFormMapper, - KxpClassFacade kxpClassFacade, - BulkDataCopyService bulkDataCopyService, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - ModelFacade modelFacade, - ToolkitConfiguration configuration - ) - : IRequestHandler, IDisposable -{ - private KxpContext _kxpContext = kxpContextFactory.CreateDbContext(); - - public async Task Handle(MigrateFormsCommand request, CancellationToken cancellationToken) - { - var cmsClassForms = modelFacade.Select("ClassIsForm = 1", "ClassID"); - foreach (var ksClass in cmsClassForms) - { - protocol.FetchedSource(ksClass); - - var kxoDataClass = kxpClassFacade.GetClass(ksClass.ClassGUID); - protocol.FetchedTarget(kxoDataClass); - - var classSuccessFullySaved = MapAndSaveUsingKxoApi(ksClass, kxoDataClass); - if (!classSuccessFullySaved) - { - continue; - } - - var cmsForms = modelFacade.Select("FormClassID = @classId", "FormID", new SqlParameter("ClassID", ksClass.ClassID)); - - foreach (var ksCmsForm in cmsForms) - { - protocol.FetchedSource(ksCmsForm); - - var kxoCmsForm = _kxpContext.CmsForms.FirstOrDefault(f => f.FormGuid == ksCmsForm.FormGUID); - - protocol.FetchedTarget(kxoCmsForm); - - var mapped = cmsFormMapper.Map(ksCmsForm, kxoCmsForm); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsForm, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsForm, nameof(cmsForm)); - - try - { - if (newInstance) - { - _kxpContext.CmsForms.Add(cmsForm); - } - else - { - _kxpContext.CmsForms.Update(cmsForm); - } - - await _kxpContext.SaveChangesAsync(cancellationToken); - logger.LogEntitySetAction(newInstance, cmsForm); - - primaryKeyMappingContext.SetMapping( - r => r.FormId, - ksClass.ClassID, - cmsForm.FormId - ); - } - catch (Exception ex) - { - await _kxpContext.DisposeAsync(); // reset context errors - _kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(cmsForm) - ); - logger.LogEntitySetError(ex, newInstance, cmsForm); - - continue; - } - } - - Debug.Assert(ksClass.ClassTableName != null, "kx13Class.ClassTableName != null"); - // var csi = new ClassStructureInfo(kx13Class.ClassXmlSchema, kx13Class.ClassXmlSchema, kx13Class.ClassTableName); - - XNamespace nsSchema = "http://www.w3.org/2001/XMLSchema"; - XNamespace msSchema = "urn:schemas-microsoft-com:xml-msdata"; - var xDoc = XDocument.Parse(ksClass.ClassXmlSchema); - var autoIncrementColumns = xDoc.Descendants(nsSchema + "element") - .Where(x => x.Attribute(msSchema + "AutoIncrement")?.Value == "true") - .Select(x => x.Attribute("name")?.Value).ToImmutableHashSet(); - - Debug.Assert(autoIncrementColumns.Count == 1, "autoIncrementColumns.Count == 1"); - // TODO tk: 2022-07-08 not true : autoIncrementColumns.First() == csi.IDColumn - // Debug.Assert(autoIncrementColumns.First() == csi.IDColumn, "autoIncrementColumns.First() == csi.IDColumn"); - - var r = (ksClass.ClassTableName, ksClass.ClassGUID, autoIncrementColumns); - logger.LogTrace("Class '{ClassGuild}' Resolved as: {Result}", ksClass.ClassGUID, r); - - // check if data is present in target tables - if (bulkDataCopyService.CheckIfDataExistsInTargetTable(ksClass.ClassTableName)) - { - logger.LogWarning("Data exists in target coupled data table '{TableName}' - cannot migrate, skipping form data migration", r.ClassTableName); - protocol.Append(HandbookReferences - .DataMustNotExistInTargetInstanceTable(ksClass.ClassTableName) - ); - continue; - } - - var bulkCopyRequest = new BulkCopyRequest( - ksClass.ClassTableName, s => !autoIncrementColumns.Contains(s), _ => true, - 20000 - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - } - - await GlobalizeBizFormFiles(); - - return new GenericCommandResult(); - } - - #region Directory globalization - - private async Task GlobalizeBizFormFiles() - { - foreach (var cmsSite in modelFacade.SelectAll()) - { - var globalBizformFiles = CMS.IO.Path.Combine(SystemContext.WebApplicationPhysicalPath, "BizFormFiles"); - var siteBizFormFiles = CMS.IO.Path.Combine(configuration.KxCmsDirPath, cmsSite.SiteName, "bizformfiles"); - if (CMS.IO.Directory.Exists(siteBizFormFiles)) - { - Debug.WriteLine($"Copying site bizformfiles from '{siteBizFormFiles}' to global bizformfiles '{globalBizformFiles}'"); - try - { - var source = CMS.IO.DirectoryInfo.New(siteBizFormFiles); - var target = CMS.IO.DirectoryInfo.New(globalBizformFiles); - CopyAll(source, target); - } - catch (Exception ex) - { - logger.LogWarning($"Moving site bizformfiles failed with {ex}"); - } - } - else - { - Debug.WriteLine($"Directory '{siteBizFormFiles}' not exists"); - } - } - } - - internal static void CopyAll(CMS.IO.DirectoryInfo source, CMS.IO.DirectoryInfo target) - { - var stack = new Stack<(CMS.IO.DirectoryInfo source, CMS.IO.DirectoryInfo target)>(); - stack.Push((source, target)); - - while (stack.Count > 0) - { - var (s, t) = stack.Pop(); - if (string.Equals(s.FullName, t.FullName, StringComparison.InvariantCultureIgnoreCase)) - { - continue; - } - - // Check if the target directory exists, if not, create it. - if (!CMS.IO.Directory.Exists(t.FullName)) - { - CMS.IO.Directory.CreateDirectory(t.FullName); - } - - // Copy each file into it's new directory. - foreach (var fi in s.GetFiles()) - { - Debug.WriteLine($@"Moving {t.FullName}\{fi.Name}"); - fi.CopyTo(CMS.IO.Path.Combine(t.FullName, fi.Name), true); - // fi.Delete(); - } - - // Copy each subdirectory using recursion. - foreach (var diSourceSubDir in s.GetDirectories()) - { - var nextTargetSubDir = t.CreateSubdirectory(diSourceSubDir.Name); - stack.Push((diSourceSubDir, nextTargetSubDir)); - } - } - - // missing overload in source.Delete(true);, replaced with: - // CMS.IO.Directory.Delete(source.FullName, true); - } - - #endregion - - private bool MapAndSaveUsingKxoApi(ICmsClass ksClass, DataClassInfo kxoDataClass) - { - var mapped = dataClassMapper.Map(ksClass, kxoDataClass); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true }) - { - var (dataClassInfo, newInstance) = mapped; - ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); - - try - { - kxpClassFacade.SetClass(dataClassInfo); - - protocol.Success(ksClass, dataClassInfo, mapped); - logger.LogEntitySetAction(newInstance, dataClassInfo); - - primaryKeyMappingContext.SetMapping( - r => r.ClassId, - ksClass.ClassID, - dataClassInfo.ClassID - ); - - return true; - } - catch (Exception ex) - { - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(dataClassInfo) - ); - logger.LogEntitySetError(ex, newInstance, dataClassInfo); - } - } - - return false; - } - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file +using System.Collections.Immutable; +using System.Diagnostics; +using System.Xml.Linq; + +using CMS.Base; +using CMS.DataEngine; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.KXP.Models; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Handlers; + +public class MigrateFormsCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + IEntityMapper dataClassMapper, + IEntityMapper cmsFormMapper, + KxpClassFacade kxpClassFacade, + BulkDataCopyService bulkDataCopyService, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + ModelFacade modelFacade, + ToolkitConfiguration configuration +) + : IRequestHandler, IDisposable +{ + private KxpContext kxpContext = kxpContextFactory.CreateDbContext(); + + public void Dispose() => kxpContext.Dispose(); + + public async Task Handle(MigrateFormsCommand request, CancellationToken cancellationToken) + { + var cmsClassForms = modelFacade.Select("ClassIsForm = 1", "ClassID"); + foreach (var ksClass in cmsClassForms) + { + protocol.FetchedSource(ksClass); + + var kxoDataClass = kxpClassFacade.GetClass(ksClass.ClassGUID); + protocol.FetchedTarget(kxoDataClass); + + bool classSuccessFullySaved = MapAndSaveUsingKxoApi(ksClass, kxoDataClass); + if (!classSuccessFullySaved) + { + continue; + } + + var cmsForms = modelFacade.Select("FormClassID = @classId", "FormID", new SqlParameter("ClassID", ksClass.ClassID)); + + foreach (var ksCmsForm in cmsForms) + { + protocol.FetchedSource(ksCmsForm); + + var kxoCmsForm = kxpContext.CmsForms.FirstOrDefault(f => f.FormGuid == ksCmsForm.FormGUID); + + protocol.FetchedTarget(kxoCmsForm); + + var mapped = cmsFormMapper.Map(ksCmsForm, kxoCmsForm); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsForm, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsForm, nameof(cmsForm)); + + try + { + if (newInstance) + { + kxpContext.CmsForms.Add(cmsForm); + } + else + { + kxpContext.CmsForms.Update(cmsForm); + } + + await kxpContext.SaveChangesAsync(cancellationToken); + logger.LogEntitySetAction(newInstance, cmsForm); + + primaryKeyMappingContext.SetMapping( + r => r.FormId, + ksClass.ClassID, + cmsForm.FormId + ); + } + catch (Exception ex) + { + await kxpContext.DisposeAsync(); // reset context errors + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(cmsForm) + ); + logger.LogEntitySetError(ex, newInstance, cmsForm); + + continue; + } + } + + Debug.Assert(ksClass.ClassTableName != null, "kx13Class.ClassTableName != null"); + // var csi = new ClassStructureInfo(kx13Class.ClassXmlSchema, kx13Class.ClassXmlSchema, kx13Class.ClassTableName); + + XNamespace nsSchema = "http://www.w3.org/2001/XMLSchema"; + XNamespace msSchema = "urn:schemas-microsoft-com:xml-msdata"; + var xDoc = XDocument.Parse(ksClass.ClassXmlSchema); + var autoIncrementColumns = xDoc.Descendants(nsSchema + "element") + .Where(x => x.Attribute(msSchema + "AutoIncrement")?.Value == "true") + .Select(x => x.Attribute("name")?.Value).ToImmutableHashSet(); + + Debug.Assert(autoIncrementColumns.Count == 1, "autoIncrementColumns.Count == 1"); + // TODO tk: 2022-07-08 not true : autoIncrementColumns.First() == csi.IDColumn + // Debug.Assert(autoIncrementColumns.First() == csi.IDColumn, "autoIncrementColumns.First() == csi.IDColumn"); + + var r = (ksClass.ClassTableName, ksClass.ClassGUID, autoIncrementColumns); + logger.LogTrace("Class '{ClassGuild}' Resolved as: {Result}", ksClass.ClassGUID, r); + + // check if data is present in target tables + if (bulkDataCopyService.CheckIfDataExistsInTargetTable(ksClass.ClassTableName)) + { + logger.LogWarning("Data exists in target coupled data table '{TableName}' - cannot migrate, skipping form data migration", r.ClassTableName); + protocol.Append(HandbookReferences + .DataMustNotExistInTargetInstanceTable(ksClass.ClassTableName) + ); + continue; + } + + var bulkCopyRequest = new BulkCopyRequest( + ksClass.ClassTableName, s => !autoIncrementColumns.Contains(s), _ => true, + 20000 + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + } + + await GlobalizeBizFormFiles(); + + return new GenericCommandResult(); + } + + private bool MapAndSaveUsingKxoApi(ICmsClass ksClass, DataClassInfo kxoDataClass) + { + var mapped = dataClassMapper.Map(ksClass, kxoDataClass); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true }) + { + (var dataClassInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); + + try + { + kxpClassFacade.SetClass(dataClassInfo); + + protocol.Success(ksClass, dataClassInfo, mapped); + logger.LogEntitySetAction(newInstance, dataClassInfo); + + primaryKeyMappingContext.SetMapping( + r => r.ClassId, + ksClass.ClassID, + dataClassInfo.ClassID + ); + + return true; + } + catch (Exception ex) + { + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(dataClassInfo) + ); + logger.LogEntitySetError(ex, newInstance, dataClassInfo); + } + } + + return false; + } + + #region Directory globalization + + private async Task GlobalizeBizFormFiles() + { + foreach (var cmsSite in modelFacade.SelectAll()) + { + string globalBizformFiles = CMS.IO.Path.Combine(SystemContext.WebApplicationPhysicalPath, "BizFormFiles"); + string siteBizFormFiles = CMS.IO.Path.Combine(configuration.KxCmsDirPath, cmsSite.SiteName, "bizformfiles"); + if (CMS.IO.Directory.Exists(siteBizFormFiles)) + { + Debug.WriteLine($"Copying site bizformfiles from '{siteBizFormFiles}' to global bizformfiles '{globalBizformFiles}'"); + try + { + var source = CMS.IO.DirectoryInfo.New(siteBizFormFiles); + var target = CMS.IO.DirectoryInfo.New(globalBizformFiles); + CopyAll(source, target); + } + catch (Exception ex) + { + logger.LogWarning($"Moving site bizformfiles failed with {ex}"); + } + } + else + { + Debug.WriteLine($"Directory '{siteBizFormFiles}' not exists"); + } + } + } + + internal static void CopyAll(CMS.IO.DirectoryInfo source, CMS.IO.DirectoryInfo target) + { + var stack = new Stack<(CMS.IO.DirectoryInfo source, CMS.IO.DirectoryInfo target)>(); + stack.Push((source, target)); + + while (stack.Count > 0) + { + var (s, t) = stack.Pop(); + if (string.Equals(s.FullName, t.FullName, StringComparison.InvariantCultureIgnoreCase)) + { + continue; + } + + // Check if the target directory exists, if not, create it. + if (!CMS.IO.Directory.Exists(t.FullName)) + { + CMS.IO.Directory.CreateDirectory(t.FullName); + } + + // Copy each file into it's new directory. + foreach (var fi in s.GetFiles()) + { + Debug.WriteLine($@"Moving {t.FullName}\{fi.Name}"); + fi.CopyTo(CMS.IO.Path.Combine(t.FullName, fi.Name), true); + // fi.Delete(); + } + + // Copy each subdirectory using recursion. + foreach (var diSourceSubDir in s.GetDirectories()) + { + var nextTargetSubDir = t.CreateSubdirectory(diSourceSubDir.Name); + stack.Push((diSourceSubDir, nextTargetSubDir)); + } + } + + // missing overload in source.Delete(true);, replaced with: + // CMS.IO.Directory.Delete(source.FullName, true); + } + + #endregion +} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateMediaLibrariesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs similarity index 52% rename from Migration.Toolkit.Core.K11/Handlers/MigrateMediaLibrariesCommandHandler.cs rename to KVA/Migration.Toolkit.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs index 223ed29c..2aad9fe8 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateMediaLibrariesCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigrateMediaLibrariesCommandHandler.cs @@ -1,256 +1,263 @@ -namespace Migration.Toolkit.Core.K11.Handlers; - -using CMS.Base; -using CMS.MediaLibrary; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Mappers; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Context; - -public class MigrateMediaLibrariesCommandHandler(ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory k11ContextFactory, - IEntityMapper mediaLibraryInfoMapper, - KxpMediaFileFacade mediaFileFacade, - IEntityMapper mediaFileInfoMapper, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string DIR_MEDIA = "media"; - - private KxpContext _kxpContext = kxpContextFactory.CreateDbContext(); - - public async Task Handle(MigrateMediaLibrariesCommand request, CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - var skippedMediaLibraries = new HashSet(); - var unsuitableMediaLibraries = k11Context.MediaLibraries - .Include(ml => ml.LibrarySite) - .GroupBy(l => l.LibraryName); - - foreach (var mlg in unsuitableMediaLibraries) - { - if (mlg.Count() <= 1) continue; - - logger.LogError(""" - Media libraries with LibraryGuid ({LibraryGuids}) have same LibraryName '{LibraryName}', due to removal of sites and media library globalization it is required to set unique LibraryName and LibraryFolder - """, string.Join(",", mlg.Select(l => l.LibraryGuid)), mlg.Key); - - foreach (var ml in mlg) - { - if (ml.LibraryGuid is { } libraryGuid) - { - skippedMediaLibraries.Add(libraryGuid); - } - - protocol.Append(HandbookReferences.NotCurrentlySupportedSkip() - .WithMessage($"Media library '{ml.LibraryName}' with LibraryGuid '{ml.LibraryGuid}' doesn't satisfy unique LibraryName and LibraryFolder condition for migration") - .WithIdentityPrint(ml) - .WithData(new { ml.LibraryGuid, ml.LibraryName, ml.LibrarySiteId, ml.LibraryFolder }) - ); - } - } - - var k11MediaLibraries = k11Context.MediaLibraries - .Include(ml => ml.LibrarySite) - .OrderBy(t => t.LibraryId) - ; - - var migratedMediaLibraries = new List<(MediaLibrary sourceLibrary, MediaLibraryInfo targetLibrary)>(); - foreach (var k11MediaLibrary in k11MediaLibraries) - { - if (k11MediaLibrary.LibraryGuid is { } libraryGuid && skippedMediaLibraries.Contains(libraryGuid)) - { - continue; - } - - protocol.FetchedSource(k11MediaLibrary); - - if (k11MediaLibrary.LibraryGuid is not { } mediaLibraryGuid) - { - protocol.Append(HandbookReferences - .InvalidSourceData() - .WithId(nameof(MediaLibrary.LibraryId), k11MediaLibrary.LibraryId) - .WithMessage("Media library has missing MediaLibraryGUID") - ); - continue; - } - - var mediaLibraryInfo = mediaFileFacade.GetMediaLibraryInfo(mediaLibraryGuid); - - protocol.FetchedTarget(mediaLibraryInfo); - - var mapped = mediaLibraryInfoMapper.Map(k11MediaLibrary, mediaLibraryInfo); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (mfi, newInstance) = result; - ArgumentNullException.ThrowIfNull(mfi, nameof(mfi)); - - try - { - mediaFileFacade.SetMediaLibrary(mfi); - - protocol.Success(k11MediaLibrary, mfi, mapped); - logger.LogEntitySetAction(newInstance, mfi); - } - catch (Exception ex) - { - await _kxpContext.DisposeAsync(); // reset context errors - _kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(mfi) - ); - logger.LogEntitySetError(ex, newInstance, mfi); - continue; - } - - primaryKeyMappingContext.SetMapping( - r => r.LibraryId, - k11MediaLibrary.LibraryId, - mfi.LibraryID - ); - - migratedMediaLibraries.Add((k11MediaLibrary, mfi)); - } - } - - await RequireMigratedMediaFiles(migratedMediaLibraries, k11Context, cancellationToken); - - return new GenericCommandResult(); - } - - private record LoadMediaFileResult(bool Found, IUploadedFile? File); - private LoadMediaFileResult LoadMediaFileBinary(string? sourceMediaLibraryPath, string relativeFilePath, string contentType) - { - if (sourceMediaLibraryPath == null) - { - return new LoadMediaFileResult(false, null); - } - - var filePath = Path.Combine(sourceMediaLibraryPath, relativeFilePath); - if (File.Exists(filePath)) - { - var data = File.ReadAllBytes(filePath); - var dummyFile = DummyUploadedFile.FromByteArray(data, contentType, data.LongLength, Path.GetFileName(filePath)); - return new LoadMediaFileResult(true, dummyFile); - } - - return new LoadMediaFileResult(false, null); - } - - private async Task RequireMigratedMediaFiles( - List<(MediaLibrary sourceLibrary, MediaLibraryInfo targetLibrary)> migratedMediaLibraries, - K11Context k11Context, CancellationToken cancellationToken) - { - var kxoDbContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - try - { - foreach (var (sourceMediaLibrary, targetMediaLibrary) in migratedMediaLibraries) - { - string? sourceMediaLibraryPath = null; - var loadMediaFileData = false; - if (!toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(true) && - !string.IsNullOrWhiteSpace(toolkitConfiguration.KxCmsDirPath)) - { - sourceMediaLibraryPath = Path.Combine(toolkitConfiguration.KxCmsDirPath, sourceMediaLibrary.LibrarySite.SiteName, DIR_MEDIA, sourceMediaLibrary.LibraryFolder); - loadMediaFileData = true; - } - - var k11MediaFiles = k11Context.MediaFiles - .Where(x => x.FileLibraryId == sourceMediaLibrary.LibraryId); - - foreach (var k11MediaFile in k11MediaFiles) - { - protocol.FetchedSource(k11MediaFile); - - bool found = false; - IUploadedFile? uploadedFile = null; - if (loadMediaFileData) - { - (found, uploadedFile) = LoadMediaFileBinary(sourceMediaLibraryPath, k11MediaFile.FilePath, k11MediaFile.FileMimeType); - if (!found) - { - // TODO tk: 2022-07-07 report missing file (currently reported in mapper) - } - } - - var librarySubfolder = Path.GetDirectoryName(k11MediaFile.FilePath); - - var kxoMediaFile = mediaFileFacade.GetMediaFile(k11MediaFile.FileGuid); - - protocol.FetchedTarget(kxoMediaFile); - - var source = new MediaFileInfoMapperSource(k11MediaFile, targetMediaLibrary.LibraryID, found ? uploadedFile : null, - librarySubfolder, toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false)); - var mapped = mediaFileInfoMapper.Map(source, kxoMediaFile); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (mf, newInstance) = result; - ArgumentNullException.ThrowIfNull(mf, nameof(mf)); - - try - { - if (newInstance) - { - mediaFileFacade.EnsureMediaFilePathExistsInLibrary(mf, targetMediaLibrary.LibraryID); - } - - mediaFileFacade.SetMediaFile(mf, newInstance); - await _kxpContext.SaveChangesAsync(cancellationToken); - - protocol.Success(k11MediaFile, mf, mapped); - logger.LogEntitySetAction(newInstance, mf); - } - catch (Exception ex) // TODO tk: 2022-05-18 handle exceptions - { - await kxoDbContext.DisposeAsync(); // reset context errors - kxoDbContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); - - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(mf) - ); - logger.LogEntitySetError(ex, newInstance, mf); - continue; - } - - primaryKeyMappingContext.SetMapping( - r => r.FileId, - k11MediaFile.FileId, - mf.FileID - ); - } - } - } - } - finally - { - await kxoDbContext.DisposeAsync(); - } - } - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file +using System.Collections.Immutable; + +using CMS.Base; +using CMS.MediaLibrary; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.KXP.Models; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Mappers; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Handlers; + +public class MigrateMediaLibrariesCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + ModelFacade modelFacade, + KxpMediaFileFacade mediaFileFacade, + IEntityMapper mediaFileInfoMapper, + IEntityMapper mediaLibraryInfoMapper, + ToolkitConfiguration toolkitConfiguration, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string DirMedia = "media"; + + private KxpContext kxpContext = kxpContextFactory.CreateDbContext(); + + public void Dispose() => kxpContext.Dispose(); + + public async Task Handle(MigrateMediaLibrariesCommand request, CancellationToken cancellationToken) + { + var skippedMediaLibraries = new HashSet(); + var unsuitableMediaLibraries = + modelFacade.Select(""" + SELECT LibraryName, STRING_AGG(CAST(LibraryGUID AS NVARCHAR(max)), '|') as [LibraryGUIDs] + FROM Media_Library + GROUP BY LibraryName + HAVING COUNT(*) > 1 + """, + (reader, _) => new { LibraryName = reader.Unbox("LibraryName"), LibraryGuids = reader.Unbox("LibraryGUIDs")?.Split('|').Select(Guid.Parse).ToImmutableList() ?? [] }); + + foreach (var mlg in unsuitableMediaLibraries) + { + logger.LogError( + "Media libraries with LibraryGuid ({LibraryGuids}) have same LibraryName '{LibraryName}', due to removal of sites and media library globalization it is required to set unique LibraryName and LibraryFolder", + string.Join(",", mlg.LibraryGuids), mlg.LibraryName); + + foreach (var libraryGuid in mlg.LibraryGuids) + { + skippedMediaLibraries.Add(libraryGuid); + + protocol.Append(HandbookReferences.NotCurrentlySupportedSkip() + .WithMessage($"Media library '{mlg.LibraryName}' with LibraryGuid '{libraryGuid}' doesn't satisfy unique LibraryName and LibraryFolder condition for migration") + .WithData(new { LibraryGuid = libraryGuid, mlg.LibraryName }) + ); + } + } + + var ksMediaLibraries = modelFacade.SelectAll(" ORDER BY LibraryID"); + + var migratedMediaLibraries = new List<(IMediaLibrary sourceLibrary, ICmsSite sourceSite, MediaLibraryInfo targetLibrary)>(); + foreach (var ksMediaLibrary in ksMediaLibraries) + { + if (ksMediaLibrary.LibraryGUID is { } libraryGuid && skippedMediaLibraries.Contains(libraryGuid)) + { + continue; + } + + protocol.FetchedSource(ksMediaLibrary); + + if (ksMediaLibrary.LibraryGUID is not { } mediaLibraryGuid) + { + protocol.Append(HandbookReferences + .InvalidSourceData() + .WithId(nameof(MediaLibrary.LibraryId), ksMediaLibrary.LibraryID) + .WithMessage("Media library has missing MediaLibraryGUID") + ); + continue; + } + + var mediaLibraryInfo = mediaFileFacade.GetMediaLibraryInfo(mediaLibraryGuid); + + protocol.FetchedTarget(mediaLibraryInfo); + + if (modelFacade.SelectById(ksMediaLibrary.LibrarySiteID) is not { } ksSite) + { + protocol.Append(HandbookReferences + .InvalidSourceData() + .WithId(nameof(MediaLibrary.LibraryId), ksMediaLibrary.LibraryID) + .WithMessage("Media library has missing site assigned") + ); + logger.LogError("Missing site, SiteID=={SiteId}", ksMediaLibrary.LibrarySiteID); + continue; + } + + var mapped = mediaLibraryInfoMapper.Map(new MediaLibraryInfoMapperSource(ksMediaLibrary, ksSite), mediaLibraryInfo); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var mfi, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(mfi, nameof(mfi)); + + try + { + mediaFileFacade.SetMediaLibrary(mfi); + + protocol.Success(ksMediaLibrary, mfi, mapped); + logger.LogEntitySetAction(newInstance, mfi); + } + catch (Exception ex) + { + await kxpContext.DisposeAsync(); // reset context errors + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(mfi) + ); + logger.LogEntitySetError(ex, newInstance, mfi); + continue; + } + + primaryKeyMappingContext.SetMapping( + r => r.LibraryId, + ksMediaLibrary.LibraryID, + mfi.LibraryID + ); + + migratedMediaLibraries.Add((ksMediaLibrary, ksSite, mfi)); + } + } + + await RequireMigratedMediaFiles(migratedMediaLibraries, cancellationToken); + + return new GenericCommandResult(); + } + + private LoadMediaFileResult LoadMediaFileBinary(string? sourceMediaLibraryPath, string relativeFilePath, string contentType) + { + if (sourceMediaLibraryPath == null) + { + return new LoadMediaFileResult(false, null); + } + + string filePath = Path.Combine(sourceMediaLibraryPath, relativeFilePath); + if (File.Exists(filePath)) + { + byte[] data = File.ReadAllBytes(filePath); + var dummyFile = DummyUploadedFile.FromByteArray(data, contentType, data.LongLength, Path.GetFileName(filePath)); + return new LoadMediaFileResult(true, dummyFile); + } + + return new LoadMediaFileResult(false, null); + } + + private async Task RequireMigratedMediaFiles(List<(IMediaLibrary sourceLibrary, ICmsSite sourceSite, MediaLibraryInfo targetLibrary)> migratedMediaLibraries, CancellationToken cancellationToken) + { + var kxoDbContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + try + { + foreach (var (ksMediaLibrary, ksSite, targetMediaLibrary) in migratedMediaLibraries) + { + string? sourceMediaLibraryPath = null; + bool loadMediaFileData = false; + if (!toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(true) && + !string.IsNullOrWhiteSpace(toolkitConfiguration.KxCmsDirPath)) + { + sourceMediaLibraryPath = Path.Combine(toolkitConfiguration.KxCmsDirPath, ksSite.SiteName, DirMedia, ksMediaLibrary.LibraryFolder); + loadMediaFileData = true; + } + + var ksMediaFiles = modelFacade.SelectWhere("FileLibraryID = @FileLibraryId", new SqlParameter("FileLibraryId", ksMediaLibrary.LibraryID)); + + foreach (var ksMediaFile in ksMediaFiles) + { + protocol.FetchedSource(ksMediaFile); + + bool found = false; + IUploadedFile? uploadedFile = null; + if (loadMediaFileData) + { + (found, uploadedFile) = LoadMediaFileBinary(sourceMediaLibraryPath, ksMediaFile.FilePath, ksMediaFile.FileMimeType); + if (!found) + { + // report missing file (currently reported in mapper) + } + } + + string? librarySubfolder = Path.GetDirectoryName(ksMediaFile.FilePath); + + var kxoMediaFile = mediaFileFacade.GetMediaFile(ksMediaFile.FileGUID); + + protocol.FetchedTarget(kxoMediaFile); + + var source = new MediaFileInfoMapperSource(ksMediaFile, targetMediaLibrary.LibraryID, found ? uploadedFile : null, + librarySubfolder, toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false)); + var mapped = mediaFileInfoMapper.Map(source, kxoMediaFile); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var mf, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(mf, nameof(mf)); + + try + { + if (newInstance) + { + mediaFileFacade.EnsureMediaFilePathExistsInLibrary(mf, targetMediaLibrary.LibraryID); + } + + mediaFileFacade.SetMediaFile(mf, newInstance); + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(ksMediaFile, mf, mapped); + logger.LogEntitySetAction(newInstance, mf); + } + catch (Exception ex) + { + await kxoDbContext.DisposeAsync(); // reset context errors + kxoDbContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(mf) + ); + logger.LogEntitySetError(ex, newInstance, mf); + continue; + } + + primaryKeyMappingContext.SetMapping( + r => r.FileId, + ksMediaFile.FileID, + mf.FileID + ); + } + } + } + } + finally + { + await kxoDbContext.DisposeAsync(); + } + } + + private record LoadMediaFileResult(bool Found, IUploadedFile? File); +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs index 012e6d32..67a30e66 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigratePageTypesCommandHandler.cs @@ -1,168 +1,171 @@ -namespace Migration.Toolkit.Source.Handlers; - -using CMS.ContentEngine; -using CMS.DataEngine; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; - -public class MigratePageTypesCommandHandler( - ILogger logger, - IEntityMapper dataClassMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - KxpClassFacade kxpClassFacade, - IProtocol protocol, - ToolkitConfiguration toolkitConfiguration, - ModelFacade modelFacade, - PageTemplateMigrator pageTemplateMigrator, - ReusableSchemaService reusableSchemaService -) - : IRequestHandler -{ - private const string CLASS_CMS_ROOT = "CMS.Root"; - - public async Task Handle(MigratePageTypesCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - using var ksClasses = EnumerableHelper.CreateDeferrableItemWrapper( - modelFacade.Select("ClassIsDocumentType=1", "ClassID") - .OrderBy(x => x.ClassID) - ); - - while (ksClasses.GetNext(out var di)) - { - var (_, ksClass) = di; - - if (ksClass.ClassInheritsFromClassID is { } classInheritsFromClassId && !primaryKeyMappingContext.HasMapping(c => c.ClassId, classInheritsFromClassId)) - { - // defer migration to later stage - if (ksClasses.TryDeferItem(di)) - { - logger.LogTrace("Class {Class} inheritance parent not found, deferring migration to end. Attempt {Attempt}", Printer.GetEntityIdentityPrint(ksClass), di.Recurrence); - } - else - { - logger.LogErrorMissingDependency(ksClass, nameof(ksClass.ClassInheritsFromClassID), ksClass.ClassInheritsFromClassID, typeof(DataClassInfo)); - protocol.Append(HandbookReferences - .MissingRequiredDependency(nameof(CmsClass.ClassId), classInheritsFromClassId) - .NeedsManualAction() - ); - } - - continue; - } - - protocol.FetchedSource(ksClass); - - if (entityConfiguration.ExcludeCodeNames.Contains(ksClass.ClassName, StringComparer.InvariantCultureIgnoreCase)) - { - protocol.Warning(HandbookReferences.EntityExplicitlyExcludedByCodeName(ksClass.ClassName, "PageType"), ksClass); - logger.LogWarning("CmsClass: {ClassName} was skipped => it is explicitly excluded in configuration", ksClass.ClassName); - continue; - } - - if (string.Equals(ksClass.ClassName, CLASS_CMS_ROOT, StringComparison.InvariantCultureIgnoreCase)) - { - protocol.Warning(HandbookReferences.CmsClassCmsRootClassTypeSkip, ksClass); - logger.LogInformation("CmsClass: {ClassName} was skipped => CMS.Root cannot be migrated", ksClass.ClassName); - continue; - } - - if (string.Equals(ksClass.ClassName, "cms.site", StringComparison.InvariantCultureIgnoreCase)) - { - continue; - } - - var kxoDataClass = kxpClassFacade.GetClass(ksClass.ClassGUID); - protocol.FetchedTarget(kxoDataClass); - - if (SaveUsingKxoApi(ksClass, kxoDataClass) is { } targetClassId) - { - foreach (var cmsClassSite in modelFacade.SelectWhere("ClassID = @classId", new SqlParameter("classId", ksClass.ClassID))) - { - if (modelFacade.SelectById(cmsClassSite.SiteID) is { SiteGUID: var siteGuid }) - { - if (ChannelInfoProvider.ProviderObject.Get(siteGuid) is { ChannelID: var channelId }) - { - var info = new ContentTypeChannelInfo { ContentTypeChannelChannelID = channelId, ContentTypeChannelContentTypeID = targetClassId }; - ContentTypeChannelInfoProvider.ProviderObject.Set(info); - } - else - { - logger.LogWarning("Channel for site with SiteGUID '{SiteGuid}' not found", siteGuid); - } - } - else - { - logger.LogWarning("Source site with SiteID '{SiteId}' not found", cmsClassSite.SiteID); - } - } - } - } - - await MigratePageTemplateConfigurations(); - - return new GenericCommandResult(); - } - - private async Task MigratePageTemplateConfigurations() - { - if (modelFacade.IsAvailable()) - { - foreach (var ksPageTemplateConfiguration in modelFacade.SelectAll()) - { - await pageTemplateMigrator.MigratePageTemplateConfigurationAsync(ksPageTemplateConfiguration); - } - } - } - - private int? SaveUsingKxoApi(ICmsClass ksClass, DataClassInfo kxoDataClass) - { - var mapped = dataClassMapper.Map(ksClass, kxoDataClass); - protocol.MappedTarget(mapped); - - try - { - if (mapped is { Success: true }) - { - var (dataClassInfo, newInstance) = mapped; - ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); - - if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(dataClassInfo.ClassName)) - { - dataClassInfo = reusableSchemaService.ConvertToReusableSchema(dataClassInfo); - } - - kxpClassFacade.SetClass(dataClassInfo); - - protocol.Success(ksClass, dataClassInfo, mapped); - logger.LogEntitySetAction(newInstance, dataClassInfo); - - primaryKeyMappingContext.SetMapping( - r => r.ClassId, - ksClass.ClassID, - dataClassInfo.ClassID - ); - - return dataClassInfo.ClassID; - } - } - catch (Exception ex) - { - logger.LogError(ex, "Error while saving page type {ClassName}", ksClass.ClassName); - } - - return null; - } -} \ No newline at end of file +using CMS.ContentEngine; +using CMS.DataEngine; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Models; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Helpers; +using Migration.Toolkit.Source.Model; +using Migration.Toolkit.Source.Services; + +namespace Migration.Toolkit.Source.Handlers; + +public class MigratePageTypesCommandHandler( + ILogger logger, + IEntityMapper dataClassMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + KxpClassFacade kxpClassFacade, + IProtocol protocol, + ToolkitConfiguration toolkitConfiguration, + ModelFacade modelFacade, + PageTemplateMigrator pageTemplateMigrator, + ReusableSchemaService reusableSchemaService +) + : IRequestHandler +{ + private const string CLASS_CMS_ROOT = "CMS.Root"; + + public async Task Handle(MigratePageTypesCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); + + using var ksClasses = EnumerableHelper.CreateDeferrableItemWrapper( + modelFacade.Select("ClassIsDocumentType=1", "ClassID") + .OrderBy(x => x.ClassID) + ); + + while (ksClasses.GetNext(out var di)) + { + var (_, ksClass) = di; + + if (ksClass.ClassInheritsFromClassID is { } classInheritsFromClassId && !primaryKeyMappingContext.HasMapping(c => c.ClassId, classInheritsFromClassId)) + { + // defer migration to later stage + if (ksClasses.TryDeferItem(di)) + { + logger.LogTrace("Class {Class} inheritance parent not found, deferring migration to end. Attempt {Attempt}", Printer.GetEntityIdentityPrint(ksClass), di.Recurrence); + } + else + { + logger.LogErrorMissingDependency(ksClass, nameof(ksClass.ClassInheritsFromClassID), ksClass.ClassInheritsFromClassID, typeof(DataClassInfo)); + protocol.Append(HandbookReferences + .MissingRequiredDependency(nameof(CmsClass.ClassId), classInheritsFromClassId) + .NeedsManualAction() + ); + } + + continue; + } + + protocol.FetchedSource(ksClass); + + if (entityConfiguration.ExcludeCodeNames.Contains(ksClass.ClassName, StringComparer.InvariantCultureIgnoreCase)) + { + protocol.Warning(HandbookReferences.EntityExplicitlyExcludedByCodeName(ksClass.ClassName, "PageType"), ksClass); + logger.LogWarning("CmsClass: {ClassName} was skipped => it is explicitly excluded in configuration", ksClass.ClassName); + continue; + } + + if (string.Equals(ksClass.ClassName, CLASS_CMS_ROOT, StringComparison.InvariantCultureIgnoreCase)) + { + protocol.Warning(HandbookReferences.CmsClassCmsRootClassTypeSkip, ksClass); + logger.LogInformation("CmsClass: {ClassName} was skipped => CMS.Root cannot be migrated", ksClass.ClassName); + continue; + } + + if (string.Equals(ksClass.ClassName, "cms.site", StringComparison.InvariantCultureIgnoreCase)) + { + continue; + } + + var kxoDataClass = kxpClassFacade.GetClass(ksClass.ClassGUID); + protocol.FetchedTarget(kxoDataClass); + + if (SaveUsingKxoApi(ksClass, kxoDataClass) is { } targetClassId) + { + foreach (var cmsClassSite in modelFacade.SelectWhere("ClassID = @classId", new SqlParameter("classId", ksClass.ClassID))) + { + if (modelFacade.SelectById(cmsClassSite.SiteID) is { SiteGUID: var siteGuid }) + { + if (ChannelInfoProvider.ProviderObject.Get(siteGuid) is { ChannelID: var channelId }) + { + var info = new ContentTypeChannelInfo { ContentTypeChannelChannelID = channelId, ContentTypeChannelContentTypeID = targetClassId }; + ContentTypeChannelInfoProvider.ProviderObject.Set(info); + } + else + { + logger.LogWarning("Channel for site with SiteGUID '{SiteGuid}' not found", siteGuid); + } + } + else + { + logger.LogWarning("Source site with SiteID '{SiteId}' not found", cmsClassSite.SiteID); + } + } + } + } + + await MigratePageTemplateConfigurations(); + + return new GenericCommandResult(); + } + + private async Task MigratePageTemplateConfigurations() + { + if (modelFacade.IsAvailable()) + { + foreach (var ksPageTemplateConfiguration in modelFacade.SelectAll()) + { + await pageTemplateMigrator.MigratePageTemplateConfigurationAsync(ksPageTemplateConfiguration); + } + } + } + + private int? SaveUsingKxoApi(ICmsClass ksClass, DataClassInfo kxoDataClass) + { + var mapped = dataClassMapper.Map(ksClass, kxoDataClass); + protocol.MappedTarget(mapped); + + try + { + if (mapped is { Success: true }) + { + (var dataClassInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(dataClassInfo, nameof(dataClassInfo)); + + if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(dataClassInfo.ClassName)) + { + dataClassInfo = reusableSchemaService.ConvertToReusableSchema(dataClassInfo); + } + + kxpClassFacade.SetClass(dataClassInfo); + + protocol.Success(ksClass, dataClassInfo, mapped); + logger.LogEntitySetAction(newInstance, dataClassInfo); + + primaryKeyMappingContext.SetMapping( + r => r.ClassId, + ksClass.ClassID, + dataClassInfo.ClassID + ); + + return dataClassInfo.ClassID; + } + } + catch (Exception ex) + { + logger.LogError(ex, "Error while saving page type {ClassName}", ksClass.ClassName); + } + + return null; + } +} diff --git a/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs b/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs index d64e9eb6..f8b6603b 100644 --- a/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs +++ b/KVA/Migration.Toolkit.Source/Handlers/MigratePagesCommandHandler.cs @@ -1,689 +1,707 @@ -namespace Migration.Toolkit.Source.Handlers; - -using System.Collections.Concurrent; -using System.Diagnostics; -using CMS.ContentEngine; -using CMS.ContentEngine.Internal; -using CMS.DataEngine; -using CMS.DataEngine.Query; -using CMS.Websites; -using CMS.Websites.Internal; -using Kentico.Xperience.UMT.Model; -using Kentico.Xperience.UMT.Services; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Providers; -using Migration.Toolkit.Source.Services; -using Migration.Toolkit.Source.Services.Model; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -// ReSharper disable once UnusedType.Global -public class MigratePagesCommandHandler( - ILogger logger, - ToolkitConfiguration toolkitConfiguration, - IProtocol protocol, - IImporter importer, - IUmtMapper mapper, - ModelFacade modelFacade, - DeferredPathService deferredPathService -) - : IRequestHandler -{ - private const string CLASS_CMS_ROOT = "CMS.Root"; - - private readonly ContentItemNameProvider _contentItemNameProvider = new(new ContentItemNameValidator()); - - public async Task Handle(MigratePagesCommand request, CancellationToken cancellationToken) - { - var classEntityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - var cultureCodeToLanguageGuid = modelFacade.SelectAll() - .ToDictionary(c => c.CultureCode, c => c.CultureGUID, StringComparer.InvariantCultureIgnoreCase); - - var sites = modelFacade.SelectAll(); - foreach (var ksSite in sites) - { - var channelInfo = ChannelInfoProvider.ProviderObject.Get(ksSite.SiteGUID); - if (channelInfo == null) - { - logger.LogError("Target channel for site '{SiteName}' not exists!", ksSite.SiteName); - continue; - } - - logger.LogInformation("Migrating pages for site '{SourceSiteName}' to target channel '{TargetChannelName}' as content items", ksSite.SiteName, channelInfo.ChannelName); - - var ksTrees = modelFacade.Select( - "NodeSiteId = @siteId", - "NodeLevel, NodeOrder", - new SqlParameter("siteId", ksSite.SiteID) - ); - - foreach (var ksTreeOriginal in ksTrees) - { - logger.LogDebug("Page '{NodeAliasPath}' migration", ksTreeOriginal.NodeAliasPath); - - protocol.FetchedSource(ksTreeOriginal); - - var ksNode = ksTreeOriginal; - var nodeLinkedNode = modelFacade.SelectById(ksNode.NodeLinkedNodeID); - var migratedDocuments = modelFacade - .SelectWhere("DocumentNodeID = @nodeId", new SqlParameter("nodeId", ksNode.NodeID)) - .ToList(); - - if (nodeLinkedNode != null) - { - if (nodeLinkedNode.NodeSiteID != ksNode.NodeSiteID) - { - // skip & write to protocol - logger.LogWarning("Linked node with NodeGuid {NodeGuid} is linked from different site - unable to migrate", ksTreeOriginal.NodeGUID); - protocol.Warning(HandbookReferences.CmsTreeTreeIsLinkFromDifferentSite, ksNode); - continue; - } - - // materialize linked node & write to protocol - var linkedNode = modelFacade.SelectWhere("NodeSiteID = @nodeSiteID AND NodeGUID = @nodeGuid", - new SqlParameter("nodeSiteID", ksNode.NodeSiteID), - new SqlParameter("nodeGuid", nodeLinkedNode.NodeGUID) - ).SingleOrDefault(); - - Debug.Assert(ksNode != null, nameof(ksNode) + " != null"); - Debug.Assert(linkedNode != null, nameof(linkedNode) + " != null"); - - migratedDocuments.Clear(); - - var linkedNodeDocuments = modelFacade - .SelectWhere("DocumentNodeID = @nodeId", new SqlParameter("nodeId", linkedNode.NodeID)) - .ToList(); - - for (var i = 0; i < linkedNodeDocuments.Count; i++) - { - var linkedDocument = linkedNodeDocuments[i]; - var fixedDocumentGuid = GuidHelper.CreateDocumentGuid($"{linkedDocument.DocumentID}|{ksNode.NodeID}|{ksNode.NodeSiteID}"); //Guid.NewGuid(); - if (ContentItemInfo.Provider.Get(ksNode.NodeGUID)?.ContentItemID is { } contentItemId) - { - if (cultureCodeToLanguageGuid.TryGetValue(linkedDocument.DocumentCulture, out var languageGuid) && - ContentLanguageInfoProvider.ProviderObject.Get(languageGuid) is { } languageInfo) - { - if (ContentItemCommonDataInfo.Provider.Get() - .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentItemID), contentItemId) - .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentLanguageID), languageInfo.ContentLanguageID) - .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataIsLatest), true) - .FirstOrDefault() is { } contentItemCommonDataInfo) - { - fixedDocumentGuid = contentItemCommonDataInfo.ContentItemCommonDataGUID; - logger.LogTrace("Page '{NodeAliasPath}' is linked => ContentItemCommonDataGUID copy to DocumentGuid", ksNode.NodeAliasPath); - } - } - } - - linkedNodeDocuments[i] = linkedDocument switch - { - CmsDocumentK11 doc => doc with { DocumentGUID = fixedDocumentGuid, DocumentID = 0 }, - CmsDocumentK12 doc => doc with { DocumentGUID = fixedDocumentGuid, DocumentID = 0 }, - CmsDocumentK13 doc => doc with { DocumentGUID = fixedDocumentGuid, DocumentID = 0 }, - _ => linkedNodeDocuments[i] - }; - - migratedDocuments.Add(linkedNodeDocuments[i]); - ksNode = ksNode switch - { - CmsTreeK11 node => node with { NodeLinkedNodeID = null, NodeLinkedNodeSiteID = null }, - CmsTreeK12 node => node with { NodeLinkedNodeID = null, NodeLinkedNodeSiteID = null }, - CmsTreeK13 node => node with { NodeLinkedNodeID = null, NodeLinkedNodeSiteID = null }, - _ => ksNode - }; - logger.LogTrace("Linked node with NodeGuid {NodeGuid} was materialized", ksNode.NodeGUID); - } - } - - var ksNodeClass = modelFacade.SelectById(ksNode.NodeClassID) ?? throw new InvalidOperationException($"Node with missing class, node id '{ksNode.NodeID}'"); - var nodeClassClassName = ksNodeClass.ClassName; - if (classEntityConfiguration.ExcludeCodeNames.Contains(nodeClassClassName, StringComparer.InvariantCultureIgnoreCase)) - { - protocol.Warning(HandbookReferences.EntityExplicitlyExcludedByCodeName(nodeClassClassName, "PageType"), ksNode); - logger.LogWarning("Page: page of class {ClassName} was skipped => it is explicitly excluded in configuration", nodeClassClassName); - continue; - } - - if (nodeClassClassName == CLASS_CMS_ROOT) - { - logger.LogInformation("Root node skipped, V27 has no support for root nodes"); - continue; - } - - Debug.Assert(migratedDocuments.Count > 0, "migratedDocuments.Count > 0"); - - if (ksTreeOriginal is { NodeSKUID: not null }) - { - logger.LogWarning("Page '{NodeAliasPath}' has SKU bound, SKU info will be discarded", ksTreeOriginal.NodeAliasPath); - protocol.Append(HandbookReferences.NotCurrentlySupportedSkip() - .WithMessage($"Page '{ksTreeOriginal.NodeAliasPath}' has SKU bound, SKU info will be discarded") - .WithIdentityPrint(ksTreeOriginal) - .WithData(new { NodeSKUID = ksTreeOriginal.NodeSKUID }) - ); - } - - var safeNodeName = await _contentItemNameProvider.Get(ksNode.NodeName); - var ksNodeParent = modelFacade.SelectById(ksNode.NodeParentID); - var nodeParentGuid = ksNodeParent?.NodeAliasPath == "/" || ksNodeParent == null - ? (Guid?)null - : ksNodeParent?.NodeGUID; - - var targetClass = DataClassInfoProvider.ProviderObject.Get(ksNodeClass.ClassGUID); - - var results = mapper.Map(new CmsTreeMapperSource( - ksNode, - safeNodeName, - ksSite.SiteGUID, - nodeParentGuid, - cultureCodeToLanguageGuid, - targetClass.ClassFormDefinition, - ksNodeClass.ClassFormDefinition, - migratedDocuments - )); - try - { - WebPageItemInfo? webPageItemInfo = null; - List commonDataInfos = new List(); - foreach (var umtModel in results) - { - var result = await importer.ImportAsync(umtModel); - if (result is { Success: false }) - { - logger.LogError("Failed to import: {Exception}, {ValidationResults}", result.Exception, JsonConvert.SerializeObject(result.ModelValidationResults)); - } - - switch (result) - { - case { Success: true, Imported: ContentItemCommonDataInfo ccid }: - { - commonDataInfos.Add(ccid); - Debug.Assert(ccid.ContentItemCommonDataContentLanguageID != 0, "ccid.ContentItemCommonDataContentLanguageID != 0"); - break; - } - case { Success: true, Imported: ContentItemLanguageMetadataInfo cclm }: - { - Debug.Assert(cclm.ContentItemLanguageMetadataContentLanguageID != 0, "ccid.ContentItemCommonDataContentLanguageID != 0"); - break; - } - case { Success: true, Imported: WebPageItemInfo wp }: - { - webPageItemInfo = wp; - break; - } - } - } - - AsserVersionStatusRule(commonDataInfos); - - if (webPageItemInfo != null && targetClass is { ClassWebPageHasUrl: true }) - { - foreach (var migratedDocument in migratedDocuments) - { - await MigratePageUrlPaths( - webPageItemInfo.WebPageItemGUID, - webPageItemInfo.WebPageItemID, ksSite.SiteGUID, - cultureCodeToLanguageGuid[migratedDocument.DocumentCulture], - commonDataInfos, - migratedDocument, - ksNode - ); - } - - MigrateFormerUrls(ksNode, webPageItemInfo); - - var urls = WebPageUrlPathInfo.Provider.Get() - .WhereEquals(nameof(WebPageUrlPathInfo.WebPageUrlPathWebPageItemID), webPageItemInfo.WebPageItemID); - - if (urls.Count < 1) - { - logger.LogWarning("No url for page {Page}", new { webPageItemInfo.WebPageItemName, webPageItemInfo.WebPageItemTreePath, webPageItemInfo.WebPageItemGUID }); - } - } - else - { - logger.LogTrace("No webpage item produced for '{NodeAliasPath}'", ksNode.NodeAliasPath); - } - } - - catch (Exception ex) - { - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(ksNode) - ); - logger.LogError("Failed to import content item: {Exception}", ex); - } - } - } - - await ExecDeferredPageBuilderPatch(); - - return new GenericCommandResult(); - } - - [Conditional("DEBUG")] - private static void AsserVersionStatusRule(List commonDataInfos) - { - foreach (var contentItemCommonDataInfos in commonDataInfos.GroupBy(x => x.ContentItemCommonDataContentLanguageID)) - { - VersionStatus? versionStatus = null; - var onlyOneStatus = contentItemCommonDataInfos.Aggregate(true, (acc, i) => - { - try - { - if (versionStatus.HasValue) - { - return versionStatus != i.ContentItemCommonDataVersionStatus; - } - - return true; - } - finally - { - versionStatus = i.ContentItemCommonDataVersionStatus; - } - }); - Debug.Assert(onlyOneStatus); - } - } - - private async Task MigratePageUrlPaths(Guid webPageItemGuid, int webPageItemId, Guid webSiteChannelGuid, Guid languageGuid, - List contentItemCommonDataInfos, ICmsDocument ksDocument, ICmsTree ksTree) - { - // TODO tomas.krch 2024-03-27: we will need to create even missing ones.. WebPageUrlPathInfo - // migration of cmspageurlpath is not available => fallback needed - - if (modelFacade.IsAvailable()) - { - var ksPaths = modelFacade.SelectWhere("PageUrlPathNodeId = @nodeId AND PageUrlPathCulture = @culture", - new SqlParameter("nodeId", ksTree.NodeID), - new SqlParameter("culture", ksDocument.DocumentCulture) - ).ToList(); - - var existingPaths = WebPageUrlPathInfo.Provider.Get() - .WhereEquals(nameof(WebPageUrlPathInfo.WebPageUrlPathWebPageItemID), webPageItemId) - .ToList(); - - var languageInfo = ContentLanguageInfoProvider.ProviderObject.Get(languageGuid); - var webSiteChannel = WebsiteChannelInfoProvider.ProviderObject.Get(webSiteChannelGuid); - if (ksPaths.Count > 0) - { - foreach (var ksPath in ksPaths) - { - logger.LogTrace("Page url path: C={Culture} S={Site} P={Path}", ksPath.PageUrlPathCulture, ksPath.PageUrlPathSiteID, ksPath.PageUrlPathUrlPath); - - foreach (var contentItemCommonDataInfo in contentItemCommonDataInfos.Where(x => x.ContentItemCommonDataContentLanguageID == languageInfo.ContentLanguageID)) - { - logger.LogTrace("Page url path common data info: CIID={ContentItemId} CLID={Language} ID={Id}", contentItemCommonDataInfo.ContentItemCommonDataContentItemID, - contentItemCommonDataInfo.ContentItemCommonDataContentLanguageID, contentItemCommonDataInfo.ContentItemCommonDataID); - - Debug.Assert(!string.IsNullOrWhiteSpace(ksPath.PageUrlPathUrlPath), "!string.IsNullOrWhiteSpace(kx13PageUrlPath.PageUrlPathUrlPath)"); - - var webPageUrlPath = new WebPageUrlPathModel - { - WebPageUrlPathGUID = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus == VersionStatus.Draft - ? Guid.NewGuid() - : ksPath.PageUrlPathGUID, - WebPageUrlPath = ksPath.PageUrlPathUrlPath, - WebPageUrlPathHash = ksPath.PageUrlPathUrlPathHash, - WebPageUrlPathWebPageItemGuid = webPageItemGuid, - WebPageUrlPathWebsiteChannelGuid = webSiteChannelGuid, - WebPageUrlPathContentLanguageGuid = languageGuid, - WebPageUrlPathIsLatest = contentItemCommonDataInfo.ContentItemCommonDataIsLatest, - WebPageUrlPathIsDraft = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus switch - { - VersionStatus.InitialDraft => false, - VersionStatus.Draft => true, - VersionStatus.Published => false, - VersionStatus.Archived => false, - _ => throw new ArgumentOutOfRangeException() - }, - }; - - var ep = existingPaths.FirstOrDefault(ep => - ep.WebPageUrlPath == webPageUrlPath.WebPageUrlPath && - ep.WebPageUrlPathContentLanguageID == languageInfo.ContentLanguageID && - ep.WebPageUrlPathIsDraft == webPageUrlPath.WebPageUrlPathIsDraft && - ep.WebPageUrlPathIsLatest == webPageUrlPath.WebPageUrlPathIsLatest && - ep.WebPageUrlPathWebsiteChannelID == webSiteChannel.WebsiteChannelID - ); - - if (ep != null) - { - webPageUrlPath.WebPageUrlPathGUID = ep.WebPageUrlPathGUID; - logger.LogTrace("Existing page url path found for '{Path}', fixing GUID to '{Guid}'", ksPath.PageUrlPathUrlPath, webPageUrlPath.WebPageUrlPathGUID); - } - - switch (await importer.ImportAsync(webPageUrlPath)) - { - case { Success: true, Imported: WebPageUrlPathInfo imported }: - { - logger.LogInformation("Page url path imported '{Path}' '{Guid}'", imported.WebPageUrlPath, imported.WebPageUrlPathGUID); - break; - } - case { Success: false, Exception: { } exception }: - { - logger.LogError("Failed to import page url path: {Error}", exception.ToString()); - break; - } - case { Success: false, ModelValidationResults: { } validation }: - { - foreach (var validationResult in validation) - { - logger.LogError("Failed to import page url path {Members}: {Error}", string.Join(",", validationResult.MemberNames), validationResult.ErrorMessage); - } - - break; - } - } - } - } - } - else - { - foreach (var contentItemCommonDataInfo in contentItemCommonDataInfos.Where(x => x.ContentItemCommonDataContentLanguageID == languageInfo.ContentLanguageID)) - { - logger.LogTrace("Page url path common data info: CIID={ContentItemId} CLID={Language} ID={Id} - fallback", - contentItemCommonDataInfo.ContentItemCommonDataContentItemID, contentItemCommonDataInfo.ContentItemCommonDataContentLanguageID, - contentItemCommonDataInfo.ContentItemCommonDataID); - - var webPageUrlPath = new WebPageUrlPathModel - { - WebPageUrlPathGUID = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus == VersionStatus.Draft - ? GuidHelper.CreateWebPageUrlPathGuid($"{ksDocument.DocumentGUID}|{ksDocument.DocumentCulture}|{ksTree.NodeAliasPath}|DRAFT") - : GuidHelper.CreateWebPageUrlPathGuid($"{ksDocument.DocumentGUID}|{ksDocument.DocumentCulture}|{ksTree.NodeAliasPath}"), - WebPageUrlPath = ksTree.NodeAliasPath, //ksPath.PageUrlPathUrlPath, - // WebPageUrlPathHash = ksPath.PageUrlPathUrlPathHash, - WebPageUrlPathWebPageItemGuid = webPageItemGuid, - WebPageUrlPathWebsiteChannelGuid = webSiteChannelGuid, - WebPageUrlPathContentLanguageGuid = languageGuid, - WebPageUrlPathIsLatest = contentItemCommonDataInfo.ContentItemCommonDataIsLatest, - WebPageUrlPathIsDraft = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus switch - { - VersionStatus.InitialDraft => false, - VersionStatus.Draft => true, - VersionStatus.Published => false, - VersionStatus.Archived => false, - _ => throw new ArgumentOutOfRangeException() - }, - }; - - var ep = existingPaths.FirstOrDefault(ep => - ep.WebPageUrlPath == webPageUrlPath.WebPageUrlPath && - ep.WebPageUrlPathContentLanguageID == languageInfo.ContentLanguageID && - ep.WebPageUrlPathIsDraft == webPageUrlPath.WebPageUrlPathIsDraft && - ep.WebPageUrlPathIsLatest == webPageUrlPath.WebPageUrlPathIsLatest && - ep.WebPageUrlPathWebsiteChannelID == webSiteChannel.WebsiteChannelID - ); - - if (ep != null) - { - webPageUrlPath.WebPageUrlPathGUID = ep.WebPageUrlPathGUID; - logger.LogTrace("Existing page url path found for '{Path}', fixing GUID to '{Guid}'", webPageUrlPath.WebPageUrlPath, webPageUrlPath.WebPageUrlPathGUID); - } - - switch (await importer.ImportAsync(webPageUrlPath)) - { - case { Success: true, Imported: WebPageUrlPathInfo imported }: - { - logger.LogInformation("Page url path imported '{Path}' '{Guid}'", imported.WebPageUrlPath, imported.WebPageUrlPathGUID); - break; - } - case { Success: false, Exception: { } exception }: - { - logger.LogError("Failed to import page url path: {Error}", exception.ToString()); - break; - } - case { Success: false, ModelValidationResults: { } validation }: - { - foreach (var validationResult in validation) - { - logger.LogError("Failed to import page url path {Members}: {Error}", string.Join(",", validationResult.MemberNames), validationResult.ErrorMessage); - } - - break; - } - } - } - } - } - else - { - var languageInfo = ContentLanguageInfoProvider.ProviderObject.Get(languageGuid); - - var webSiteChannel = WebsiteChannelInfoProvider.ProviderObject.Get(webSiteChannelGuid); - foreach (var contentItemCommonDataInfo in contentItemCommonDataInfos.Where(x => x.ContentItemCommonDataContentLanguageID == languageInfo.ContentLanguageID)) - { - logger.LogTrace("Page url path common data info: CIID={ContentItemId} CLID={Language} ID={Id}", contentItemCommonDataInfo.ContentItemCommonDataContentItemID, - contentItemCommonDataInfo.ContentItemCommonDataContentLanguageID, contentItemCommonDataInfo.ContentItemCommonDataID); - - var urlPath = (ksDocument switch - { - CmsDocumentK11 doc => doc.DocumentUrlPath, - CmsDocumentK12 doc => doc.DocumentUrlPath, - _ => null - }).NullIf(string.Empty) ?? ksTree.NodeAliasPath; - - var webPageUrlPath = new WebPageUrlPathModel - { - WebPageUrlPathGUID = GuidHelper.CreateWebPageUrlPathGuid($"{urlPath}|{ksDocument.DocumentCulture}|{webSiteChannel.WebsiteChannelGUID}"), - WebPageUrlPath = urlPath, - // WebPageUrlPathHash = kx13PageUrlPath.PageUrlPathUrlPathHash, - WebPageUrlPathWebPageItemGuid = webPageItemGuid, - WebPageUrlPathWebsiteChannelGuid = webSiteChannelGuid, - WebPageUrlPathContentLanguageGuid = languageGuid, - WebPageUrlPathIsLatest = contentItemCommonDataInfo.ContentItemCommonDataIsLatest, - WebPageUrlPathIsDraft = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus switch - { - VersionStatus.InitialDraft => false, - VersionStatus.Draft => true, - VersionStatus.Published => false, - VersionStatus.Archived => false, - _ => throw new ArgumentOutOfRangeException() - }, - }; - - switch (await importer.ImportAsync(webPageUrlPath)) - { - case { Success: true, Imported: WebPageUrlPathInfo imported }: - { - logger.LogInformation("Page url path imported '{Path}' '{Guid}'", imported.WebPageUrlPath, imported.WebPageUrlPathGUID); - break; - } - case { Success: false, Exception: { } exception }: - { - logger.LogError("Failed to import page url path: {Error}", exception.ToString()); - break; - } - case { Success: false, ModelValidationResults: { } validation }: - { - foreach (var validationResult in validation) - { - logger.LogError("Failed to import page url path {Members}: {Error}", string.Join(",", validationResult.MemberNames), validationResult.ErrorMessage); - } - - break; - } - } - } - } - } - - private readonly ConcurrentDictionary _languages = new(StringComparer.InvariantCultureIgnoreCase); - - private void MigrateFormerUrls(ICmsTree ksNode, WebPageItemInfo targetPage) - { - if (modelFacade.IsAvailable()) - { - var formerUrlPaths = modelFacade.SelectWhere( - "PageFormerUrlPathSiteID = @siteId AND PageFormerUrlPathNodeID = @nodeId", - new SqlParameter("siteId", ksNode.NodeSiteID), - new SqlParameter("nodeId", ksNode.NodeID) - ); - foreach (var cmsPageFormerUrlPath in formerUrlPaths) - { - logger.LogDebug("PageFormerUrlPath migration '{PageFormerUrlPath}' ", cmsPageFormerUrlPath); - protocol.FetchedSource(cmsPageFormerUrlPath); - - switch (cmsPageFormerUrlPath) - { - case CmsPageFormerUrlPathK11: - case CmsPageFormerUrlPathK12: - { - logger.LogError("Unexpected type '{Type}'", cmsPageFormerUrlPath.GetType().FullName); - break; - } - case CmsPageFormerUrlPathK13 pfup: - { - try - { - var languageInfo = _languages.GetOrAdd( - pfup.PageFormerUrlPathCulture, - s => ContentLanguageInfoProvider.ProviderObject.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageName), s).SingleOrDefault() ?? throw new InvalidOperationException($"Missing content language '{s}'") - ); - - var ktPath = WebPageFormerUrlPathInfo.Provider.Get() - .WhereEquals(nameof(WebPageFormerUrlPathInfo.WebPageFormerUrlPathHash), GetWebPageUrlPathHashQueryExpression(pfup.PageFormerUrlPathUrlPath)) - .WhereEquals(nameof(WebPageFormerUrlPathInfo.WebPageFormerUrlPathWebsiteChannelID), targetPage.WebPageItemWebsiteChannelID) - .WhereEquals(nameof(WebPageFormerUrlPathInfo.WebPageFormerUrlPathContentLanguageID), languageInfo.ContentLanguageID) - .SingleOrDefault(); - - if (ktPath != null) protocol.FetchedTarget(ktPath); - - var webPageFormerUrlPathInfo = ktPath ?? new WebPageFormerUrlPathInfo(); - webPageFormerUrlPathInfo.WebPageFormerUrlPath = pfup.PageFormerUrlPathUrlPath; - webPageFormerUrlPathInfo.WebPageFormerUrlPathHash = modelFacade.HashPath(pfup.PageFormerUrlPathUrlPath); - webPageFormerUrlPathInfo.WebPageFormerUrlPathWebPageItemID = targetPage.WebPageItemID; - webPageFormerUrlPathInfo.WebPageFormerUrlPathWebsiteChannelID = targetPage.WebPageItemWebsiteChannelID; - webPageFormerUrlPathInfo.WebPageFormerUrlPathContentLanguageID = languageInfo.ContentLanguageID; - webPageFormerUrlPathInfo.WebPageFormerUrlPathLastModified = pfup.PageFormerUrlPathLastModified; - - WebPageFormerUrlPathInfo.Provider.Set(webPageFormerUrlPathInfo); - logger.LogInformation("Former page url path imported '{Path}'", webPageFormerUrlPathInfo.WebPageFormerUrlPath); - } - catch (Exception ex) - { - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(pfup) - ); - logger.LogError("Failed to import page former url path: {Exception}", ex); - } - - break; - } - default: - throw new ArgumentOutOfRangeException(nameof(cmsPageFormerUrlPath)); - } - } - } - else - { - logger.LogDebug("CmsPageFormerUrlPath not supported in source instance"); - } - } - - internal static QueryExpression GetWebPageUrlPathHashQueryExpression(string urlPath) - { - return $"CONVERT(VARCHAR(64), HASHBYTES('SHA2_256', LOWER(N'{SqlHelper.EscapeQuotes(urlPath)}')), 2)".AsExpression(); - } - - // private async Task MigrateAlternativeUrls() - // { - // if (modelFacade.IsAvailable()) - // { - // } - // else - // { - // } - // } - - #region Deffered patch - - private async Task ExecDeferredPageBuilderPatch() - { - logger.LogInformation("Executing TreePath patch"); - - foreach (var (uniqueId, className, webSiteChannelId) in deferredPathService.GetWidgetsToPatch()) - { - if (className == ContentItemCommonDataInfo.TYPEINFO.ObjectClassName) - { - var contentItemCommonDataInfo = await ContentItemCommonDataInfo.Provider.GetAsync(uniqueId); - - contentItemCommonDataInfo.ContentItemCommonDataPageBuilderWidgets = DeferredPatchPageBuilderWidgets( - contentItemCommonDataInfo.ContentItemCommonDataPageBuilderWidgets, webSiteChannelId, out var anythingChangedW); - contentItemCommonDataInfo.ContentItemCommonDataPageTemplateConfiguration = DeferredPatchPageTemplateConfiguration( - contentItemCommonDataInfo.ContentItemCommonDataPageTemplateConfiguration, webSiteChannelId, out var anythingChangedC); - - if (anythingChangedC || anythingChangedW) - { - contentItemCommonDataInfo.Update(); - } - } - else if (className == PageTemplateConfigurationInfo.TYPEINFO.ObjectClassName) - { - var pageTemplateConfigurationInfo = await PageTemplateConfigurationInfo.Provider.GetAsync(uniqueId); - pageTemplateConfigurationInfo.PageTemplateConfigurationWidgets = DeferredPatchPageBuilderWidgets( - pageTemplateConfigurationInfo.PageTemplateConfigurationWidgets, - webSiteChannelId, - out var anythingChangedW - ); - pageTemplateConfigurationInfo.PageTemplateConfigurationTemplate = DeferredPatchPageTemplateConfiguration( - pageTemplateConfigurationInfo.PageTemplateConfigurationTemplate, - webSiteChannelId, - out var anythingChangedC - ); - if (anythingChangedW || anythingChangedC) - { - PageTemplateConfigurationInfo.Provider.Set(pageTemplateConfigurationInfo); - } - } - } - } - - private string DeferredPatchPageTemplateConfiguration(string documentPageTemplateConfiguration, int webSiteChannelId, out bool anythingChanged) - { - if (!string.IsNullOrWhiteSpace(documentPageTemplateConfiguration)) - { - var configuration = JObject.Parse(documentPageTemplateConfiguration); - PageBuilderWidgetsPatcher.DeferredPatchProperties(configuration, TreePathConvertor.GetSiteConverter(webSiteChannelId), out anythingChanged); - return JsonConvert.SerializeObject(configuration); - } - - anythingChanged = false; - return documentPageTemplateConfiguration; - } - - private string DeferredPatchPageBuilderWidgets(string documentPageBuilderWidgets, int webSiteChannelId, out bool anythingChanged) - { - if (!string.IsNullOrWhiteSpace(documentPageBuilderWidgets)) - { - var patched = PageBuilderWidgetsPatcher.DeferredPatchConfiguration( - JsonConvert.DeserializeObject(documentPageBuilderWidgets), - TreePathConvertor.GetSiteConverter(webSiteChannelId), - out anythingChanged - ); - return JsonConvert.SerializeObject(patched); - } - else - { - anythingChanged = false; - return documentPageBuilderWidgets; - } - } - - #endregion -} \ No newline at end of file +using System.Collections.Concurrent; +using System.Diagnostics; + +using CMS.ContentEngine; +using CMS.ContentEngine.Internal; +using CMS.DataEngine; +using CMS.DataEngine.Query; +using CMS.Websites; +using CMS.Websites.Internal; + +using Kentico.Xperience.UMT.Model; +using Kentico.Xperience.UMT.Services; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Models; +using Migration.Toolkit.Source.Helpers; +using Migration.Toolkit.Source.Mappers; +using Migration.Toolkit.Source.Model; +using Migration.Toolkit.Source.Providers; +using Migration.Toolkit.Source.Services; +using Migration.Toolkit.Source.Services.Model; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Migration.Toolkit.Source.Handlers; + +// ReSharper disable once UnusedType.Global +public class MigratePagesCommandHandler( + ILogger logger, + ToolkitConfiguration toolkitConfiguration, + IProtocol protocol, + IImporter importer, + IUmtMapper mapper, + ModelFacade modelFacade, + DeferredPathService deferredPathService, + SpoiledGuidContext spoiledGuidContext +) + : IRequestHandler +{ + private const string ClassCmsRoot = "CMS.Root"; + + private readonly ContentItemNameProvider contentItemNameProvider = new(new ContentItemNameValidator()); + + private readonly ConcurrentDictionary languages = new(StringComparer.InvariantCultureIgnoreCase); + + public async Task Handle(MigratePagesCommand request, CancellationToken cancellationToken) + { + var classEntityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); + + var cultureCodeToLanguageGuid = modelFacade.SelectAll() + .ToDictionary(c => c.CultureCode, c => c.CultureGUID, StringComparer.InvariantCultureIgnoreCase); + + var sites = modelFacade.SelectAll(); + foreach (var ksSite in sites) + { + var channelInfo = ChannelInfoProvider.ProviderObject.Get(ksSite.SiteGUID); + if (channelInfo == null) + { + logger.LogError("Target channel for site '{SiteName}' not exists!", ksSite.SiteName); + continue; + } + + logger.LogInformation("Migrating pages for site '{SourceSiteName}' to target channel '{TargetChannelName}' as content items", ksSite.SiteName, channelInfo.ChannelName); + + var ksTrees = modelFacade.Select( + "NodeSiteId = @siteId", + "NodeLevel, NodeOrder", + new SqlParameter("siteId", ksSite.SiteID) + ); + + foreach (var ksTreeOriginal in ksTrees) + { + logger.LogDebug("Page '{NodeAliasPath}' migration", ksTreeOriginal.NodeAliasPath); + + protocol.FetchedSource(ksTreeOriginal); + + var ksNode = ksTreeOriginal; + var nodeLinkedNode = modelFacade.SelectById(ksNode.NodeLinkedNodeID); + var migratedDocuments = modelFacade + .SelectWhere("DocumentNodeID = @nodeId", new SqlParameter("nodeId", ksNode.NodeID)) + .ToList(); + + if (nodeLinkedNode != null) + { + if (nodeLinkedNode.NodeSiteID != ksNode.NodeSiteID) + { + // skip & write to protocol + logger.LogWarning("Linked node with NodeGuid {NodeGuid} is linked from different site - unable to migrate", ksTreeOriginal.NodeGUID); + protocol.Warning(HandbookReferences.CmsTreeTreeIsLinkFromDifferentSite, ksNode); + continue; + } + + // materialize linked node & write to protocol + var linkedNode = modelFacade.SelectWhere("NodeSiteID = @nodeSiteID AND NodeGUID = @nodeGuid", + new SqlParameter("nodeSiteID", ksNode.NodeSiteID), + new SqlParameter("nodeGuid", nodeLinkedNode.NodeGUID) + ).SingleOrDefault(); + + Debug.Assert(ksNode != null, nameof(ksNode) + " != null"); + Debug.Assert(linkedNode != null, nameof(linkedNode) + " != null"); + + migratedDocuments.Clear(); + + var linkedNodeDocuments = modelFacade + .SelectWhere("DocumentNodeID = @nodeId", new SqlParameter("nodeId", linkedNode.NodeID)) + .ToList(); + + for (int i = 0; i < linkedNodeDocuments.Count; i++) + { + var linkedDocument = linkedNodeDocuments[i]; + var fixedDocumentGuid = GuidHelper.CreateDocumentGuid($"{linkedDocument.DocumentID}|{ksNode.NodeID}|{ksNode.NodeSiteID}"); //Guid.NewGuid(); + var patchedNodeGuid = spoiledGuidContext.EnsureNodeGuid(ksNode.NodeGUID, ksNode.NodeSiteID, ksNode.NodeID); + if (ContentItemInfo.Provider.Get(patchedNodeGuid)?.ContentItemID is { } contentItemId) + { + if (cultureCodeToLanguageGuid.TryGetValue(linkedDocument.DocumentCulture, out var languageGuid) && + ContentLanguageInfoProvider.ProviderObject.Get(languageGuid) is { } languageInfo) + { + if (ContentItemCommonDataInfo.Provider.Get() + .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentItemID), contentItemId) + .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentLanguageID), languageInfo.ContentLanguageID) + .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataIsLatest), true) + .FirstOrDefault() is { } contentItemCommonDataInfo) + { + fixedDocumentGuid = contentItemCommonDataInfo.ContentItemCommonDataGUID; + logger.LogTrace("Page '{NodeAliasPath}' is linked => ContentItemCommonDataGUID copy to DocumentGuid", ksNode.NodeAliasPath); + } + } + } + + linkedNodeDocuments[i] = linkedDocument switch + { + CmsDocumentK11 doc => doc with { DocumentGUID = fixedDocumentGuid, DocumentID = 0 }, + CmsDocumentK12 doc => doc with { DocumentGUID = fixedDocumentGuid, DocumentID = 0 }, + CmsDocumentK13 doc => doc with { DocumentGUID = fixedDocumentGuid, DocumentID = 0 }, + _ => linkedNodeDocuments[i] + }; + + migratedDocuments.Add(linkedNodeDocuments[i]); + ksNode = ksNode switch + { + CmsTreeK11 node => node with { NodeLinkedNodeID = null, NodeLinkedNodeSiteID = null }, + CmsTreeK12 node => node with { NodeLinkedNodeID = null, NodeLinkedNodeSiteID = null }, + CmsTreeK13 node => node with { NodeLinkedNodeID = null, NodeLinkedNodeSiteID = null }, + _ => ksNode + }; + logger.LogTrace("Linked node with NodeGuid {NodeGuid} was materialized", ksNode.NodeGUID); + } + } + + var ksNodeClass = modelFacade.SelectById(ksNode.NodeClassID) ?? throw new InvalidOperationException($"Node with missing class, node id '{ksNode.NodeID}'"); + string nodeClassClassName = ksNodeClass.ClassName; + if (classEntityConfiguration.ExcludeCodeNames.Contains(nodeClassClassName, StringComparer.InvariantCultureIgnoreCase)) + { + protocol.Warning(HandbookReferences.EntityExplicitlyExcludedByCodeName(nodeClassClassName, "PageType"), ksNode); + logger.LogWarning("Page: page of class {ClassName} was skipped => it is explicitly excluded in configuration", nodeClassClassName); + continue; + } + + if (nodeClassClassName == ClassCmsRoot) + { + logger.LogInformation("Root node skipped, V27 has no support for root nodes"); + continue; + } + + Debug.Assert(migratedDocuments.Count > 0, "migratedDocuments.Count > 0"); + + if (ksTreeOriginal is { NodeSKUID: not null }) + { + logger.LogWarning("Page '{NodeAliasPath}' has SKU bound, SKU info will be discarded", ksTreeOriginal.NodeAliasPath); + protocol.Append(HandbookReferences.NotCurrentlySupportedSkip() + .WithMessage($"Page '{ksTreeOriginal.NodeAliasPath}' has SKU bound, SKU info will be discarded") + .WithIdentityPrint(ksTreeOriginal) + .WithData(new { ksTreeOriginal.NodeSKUID }) + ); + } + + string safeNodeName = await contentItemNameProvider.Get(ksNode.NodeName); + var ksNodeParent = modelFacade.SelectById(ksNode.NodeParentID); + var nodeParentGuid = ksNodeParent?.NodeAliasPath == "/" || ksNodeParent == null + ? (Guid?)null + : spoiledGuidContext.EnsureNodeGuid(ksNodeParent); + + var targetClass = DataClassInfoProvider.ProviderObject.Get(ksNodeClass.ClassGUID); + + var results = mapper.Map(new CmsTreeMapperSource( + ksNode, + safeNodeName, + ksSite.SiteGUID, + nodeParentGuid, + cultureCodeToLanguageGuid, + targetClass.ClassFormDefinition, + ksNodeClass.ClassFormDefinition, + migratedDocuments + )); + try + { + WebPageItemInfo? webPageItemInfo = null; + var commonDataInfos = new List(); + foreach (var umtModel in results) + { + var result = await importer.ImportAsync(umtModel); + if (result is { Success: false }) + { + logger.LogError("Failed to import: {Exception}, {ValidationResults}", result.Exception, JsonConvert.SerializeObject(result.ModelValidationResults)); + } + + switch (result) + { + case { Success: true, Imported: ContentItemCommonDataInfo ccid }: + { + commonDataInfos.Add(ccid); + Debug.Assert(ccid.ContentItemCommonDataContentLanguageID != 0, "ccid.ContentItemCommonDataContentLanguageID != 0"); + break; + } + case { Success: true, Imported: ContentItemLanguageMetadataInfo cclm }: + { + Debug.Assert(cclm.ContentItemLanguageMetadataContentLanguageID != 0, "ccid.ContentItemCommonDataContentLanguageID != 0"); + break; + } + case { Success: true, Imported: WebPageItemInfo wp }: + { + webPageItemInfo = wp; + break; + } + + default: + break; + } + } + + AsserVersionStatusRule(commonDataInfos); + + if (webPageItemInfo != null && targetClass is { ClassWebPageHasUrl: true }) + { + foreach (var migratedDocument in migratedDocuments) + { + await MigratePageUrlPaths( + webPageItemInfo.WebPageItemGUID, + webPageItemInfo.WebPageItemID, ksSite.SiteGUID, + cultureCodeToLanguageGuid[migratedDocument.DocumentCulture], + commonDataInfos, + migratedDocument, + ksNode + ); + } + + MigrateFormerUrls(ksNode, webPageItemInfo); + + var urls = WebPageUrlPathInfo.Provider.Get() + .WhereEquals(nameof(WebPageUrlPathInfo.WebPageUrlPathWebPageItemID), webPageItemInfo.WebPageItemID); + + if (urls.Count < 1) + { + logger.LogWarning("No url for page {Page}", new { webPageItemInfo.WebPageItemName, webPageItemInfo.WebPageItemTreePath, webPageItemInfo.WebPageItemGUID }); + } + } + else + { + logger.LogTrace("No webpage item produced for '{NodeAliasPath}'", ksNode.NodeAliasPath); + } + } + + catch (Exception ex) + { + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(ksNode) + ); + logger.LogError("Failed to import content item: {Exception}", ex); + } + } + } + + await ExecDeferredPageBuilderPatch(); + + return new GenericCommandResult(); + } + + [Conditional("DEBUG")] + private static void AsserVersionStatusRule(List commonDataInfos) + { + foreach (var contentItemCommonDataInfos in commonDataInfos.GroupBy(x => x.ContentItemCommonDataContentLanguageID)) + { + VersionStatus? versionStatus = null; + bool onlyOneStatus = contentItemCommonDataInfos.Aggregate(true, (acc, i) => + { + try + { + if (versionStatus.HasValue) + { + return versionStatus != i.ContentItemCommonDataVersionStatus; + } + + return true; + } + finally + { + versionStatus = i.ContentItemCommonDataVersionStatus; + } + }); + Debug.Assert(onlyOneStatus); + } + } + + private async Task MigratePageUrlPaths(Guid webPageItemGuid, int webPageItemId, Guid webSiteChannelGuid, Guid languageGuid, + List contentItemCommonDataInfos, ICmsDocument ksDocument, ICmsTree ksTree) + { + // TODO tomas.krch 2024-03-27: we will need to create even missing ones.. WebPageUrlPathInfo + // migration of cmspageurlpath is not available => fallback needed + + if (modelFacade.IsAvailable()) + { + var ksPaths = modelFacade.SelectWhere("PageUrlPathNodeId = @nodeId AND PageUrlPathCulture = @culture", + new SqlParameter("nodeId", ksTree.NodeID), + new SqlParameter("culture", ksDocument.DocumentCulture) + ).ToList(); + + var existingPaths = WebPageUrlPathInfo.Provider.Get() + .WhereEquals(nameof(WebPageUrlPathInfo.WebPageUrlPathWebPageItemID), webPageItemId) + .ToList(); + + var languageInfo = ContentLanguageInfoProvider.ProviderObject.Get(languageGuid); + var webSiteChannel = WebsiteChannelInfoProvider.ProviderObject.Get(webSiteChannelGuid); + if (ksPaths.Count > 0) + { + foreach (var ksPath in ksPaths) + { + logger.LogTrace("Page url path: C={Culture} S={Site} P={Path}", ksPath.PageUrlPathCulture, ksPath.PageUrlPathSiteID, ksPath.PageUrlPathUrlPath); + + foreach (var contentItemCommonDataInfo in contentItemCommonDataInfos.Where(x => x.ContentItemCommonDataContentLanguageID == languageInfo.ContentLanguageID)) + { + logger.LogTrace("Page url path common data info: CIID={ContentItemId} CLID={Language} ID={Id}", contentItemCommonDataInfo.ContentItemCommonDataContentItemID, + contentItemCommonDataInfo.ContentItemCommonDataContentLanguageID, contentItemCommonDataInfo.ContentItemCommonDataID); + + Debug.Assert(!string.IsNullOrWhiteSpace(ksPath.PageUrlPathUrlPath), "!string.IsNullOrWhiteSpace(kx13PageUrlPath.PageUrlPathUrlPath)"); + + var webPageUrlPath = new WebPageUrlPathModel + { + WebPageUrlPathGUID = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus == VersionStatus.Draft + ? Guid.NewGuid() + : ksPath.PageUrlPathGUID, + WebPageUrlPath = ksPath.PageUrlPathUrlPath, + WebPageUrlPathHash = ksPath.PageUrlPathUrlPathHash, + WebPageUrlPathWebPageItemGuid = webPageItemGuid, + WebPageUrlPathWebsiteChannelGuid = webSiteChannelGuid, + WebPageUrlPathContentLanguageGuid = languageGuid, + WebPageUrlPathIsLatest = contentItemCommonDataInfo.ContentItemCommonDataIsLatest, + WebPageUrlPathIsDraft = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus switch + { + VersionStatus.InitialDraft => false, + VersionStatus.Draft => true, + VersionStatus.Published => false, + VersionStatus.Archived => false, + _ => throw new ArgumentOutOfRangeException() + } + }; + + var ep = existingPaths.FirstOrDefault(ep => + ep.WebPageUrlPath == webPageUrlPath.WebPageUrlPath && + ep.WebPageUrlPathContentLanguageID == languageInfo.ContentLanguageID && + ep.WebPageUrlPathIsDraft == webPageUrlPath.WebPageUrlPathIsDraft && + ep.WebPageUrlPathIsLatest == webPageUrlPath.WebPageUrlPathIsLatest && + ep.WebPageUrlPathWebsiteChannelID == webSiteChannel.WebsiteChannelID + ); + + if (ep != null) + { + webPageUrlPath.WebPageUrlPathGUID = ep.WebPageUrlPathGUID; + logger.LogTrace("Existing page url path found for '{Path}', fixing GUID to '{Guid}'", ksPath.PageUrlPathUrlPath, webPageUrlPath.WebPageUrlPathGUID); + } + + switch (await importer.ImportAsync(webPageUrlPath)) + { + case { Success: true, Imported: WebPageUrlPathInfo imported }: + { + logger.LogInformation("Page url path imported '{Path}' '{Guid}'", imported.WebPageUrlPath, imported.WebPageUrlPathGUID); + break; + } + case { Success: false, Exception: { } exception }: + { + logger.LogError("Failed to import page url path: {Error}", exception.ToString()); + break; + } + case { Success: false, ModelValidationResults: { } validation }: + { + foreach (var validationResult in validation) + { + logger.LogError("Failed to import page url path {Members}: {Error}", string.Join(",", validationResult.MemberNames), validationResult.ErrorMessage); + } + + break; + } + + default: + break; + } + } + } + } + else + { + foreach (var contentItemCommonDataInfo in contentItemCommonDataInfos.Where(x => x.ContentItemCommonDataContentLanguageID == languageInfo.ContentLanguageID)) + { + logger.LogTrace("Page url path common data info: CIID={ContentItemId} CLID={Language} ID={Id} - fallback", + contentItemCommonDataInfo.ContentItemCommonDataContentItemID, contentItemCommonDataInfo.ContentItemCommonDataContentLanguageID, + contentItemCommonDataInfo.ContentItemCommonDataID); + + var webPageUrlPath = new WebPageUrlPathModel + { + WebPageUrlPathGUID = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus == VersionStatus.Draft + ? GuidHelper.CreateWebPageUrlPathGuid($"{ksDocument.DocumentGUID}|{ksDocument.DocumentCulture}|{ksTree.NodeAliasPath}|DRAFT") + : GuidHelper.CreateWebPageUrlPathGuid($"{ksDocument.DocumentGUID}|{ksDocument.DocumentCulture}|{ksTree.NodeAliasPath}"), + WebPageUrlPath = ksTree.NodeAliasPath, //ksPath.PageUrlPathUrlPath, + // WebPageUrlPathHash = ksPath.PageUrlPathUrlPathHash, + WebPageUrlPathWebPageItemGuid = webPageItemGuid, + WebPageUrlPathWebsiteChannelGuid = webSiteChannelGuid, + WebPageUrlPathContentLanguageGuid = languageGuid, + WebPageUrlPathIsLatest = contentItemCommonDataInfo.ContentItemCommonDataIsLatest, + WebPageUrlPathIsDraft = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus switch + { + VersionStatus.InitialDraft => false, + VersionStatus.Draft => true, + VersionStatus.Published => false, + VersionStatus.Unpublished => false, + _ => throw new ArgumentOutOfRangeException() + } + }; + + var ep = existingPaths.FirstOrDefault(ep => + ep.WebPageUrlPath == webPageUrlPath.WebPageUrlPath && + ep.WebPageUrlPathContentLanguageID == languageInfo.ContentLanguageID && + ep.WebPageUrlPathIsDraft == webPageUrlPath.WebPageUrlPathIsDraft && + ep.WebPageUrlPathIsLatest == webPageUrlPath.WebPageUrlPathIsLatest && + ep.WebPageUrlPathWebsiteChannelID == webSiteChannel.WebsiteChannelID + ); + + if (ep != null) + { + webPageUrlPath.WebPageUrlPathGUID = ep.WebPageUrlPathGUID; + logger.LogTrace("Existing page url path found for '{Path}', fixing GUID to '{Guid}'", webPageUrlPath.WebPageUrlPath, webPageUrlPath.WebPageUrlPathGUID); + } + + switch (await importer.ImportAsync(webPageUrlPath)) + { + case { Success: true, Imported: WebPageUrlPathInfo imported }: + { + logger.LogInformation("Page url path imported '{Path}' '{Guid}'", imported.WebPageUrlPath, imported.WebPageUrlPathGUID); + break; + } + case { Success: false, Exception: { } exception }: + { + logger.LogError("Failed to import page url path: {Error}", exception.ToString()); + break; + } + case { Success: false, ModelValidationResults: { } validation }: + { + foreach (var validationResult in validation) + { + logger.LogError("Failed to import page url path {Members}: {Error}", string.Join(",", validationResult.MemberNames), validationResult.ErrorMessage); + } + + break; + } + + default: + break; + } + } + } + } + else + { + var languageInfo = ContentLanguageInfoProvider.ProviderObject.Get(languageGuid); + + var webSiteChannel = WebsiteChannelInfoProvider.ProviderObject.Get(webSiteChannelGuid); + foreach (var contentItemCommonDataInfo in contentItemCommonDataInfos.Where(x => x.ContentItemCommonDataContentLanguageID == languageInfo.ContentLanguageID)) + { + logger.LogTrace("Page url path common data info: CIID={ContentItemId} CLID={Language} ID={Id}", contentItemCommonDataInfo.ContentItemCommonDataContentItemID, + contentItemCommonDataInfo.ContentItemCommonDataContentLanguageID, contentItemCommonDataInfo.ContentItemCommonDataID); + + string urlPath = (ksDocument switch + { + CmsDocumentK11 doc => doc.DocumentUrlPath, + CmsDocumentK12 doc => doc.DocumentUrlPath, + _ => null + }).NullIf(string.Empty) ?? ksTree.NodeAliasPath; + + var webPageUrlPath = new WebPageUrlPathModel + { + WebPageUrlPathGUID = GuidHelper.CreateWebPageUrlPathGuid($"{urlPath}|{ksDocument.DocumentCulture}|{webSiteChannel.WebsiteChannelGUID}"), + WebPageUrlPath = urlPath, + // WebPageUrlPathHash = kx13PageUrlPath.PageUrlPathUrlPathHash, + WebPageUrlPathWebPageItemGuid = webPageItemGuid, + WebPageUrlPathWebsiteChannelGuid = webSiteChannelGuid, + WebPageUrlPathContentLanguageGuid = languageGuid, + WebPageUrlPathIsLatest = contentItemCommonDataInfo.ContentItemCommonDataIsLatest, + WebPageUrlPathIsDraft = contentItemCommonDataInfo.ContentItemCommonDataVersionStatus switch + { + VersionStatus.InitialDraft => false, + VersionStatus.Draft => true, + VersionStatus.Published => false, + VersionStatus.Archived => false, + _ => throw new ArgumentOutOfRangeException() + } + }; + + switch (await importer.ImportAsync(webPageUrlPath)) + { + case { Success: true, Imported: WebPageUrlPathInfo imported }: + { + logger.LogInformation("Page url path imported '{Path}' '{Guid}'", imported.WebPageUrlPath, imported.WebPageUrlPathGUID); + break; + } + case { Success: false, Exception: { } exception }: + { + logger.LogError("Failed to import page url path: {Error}", exception.ToString()); + break; + } + case { Success: false, ModelValidationResults: { } validation }: + { + foreach (var validationResult in validation) + { + logger.LogError("Failed to import page url path {Members}: {Error}", string.Join(",", validationResult.MemberNames), validationResult.ErrorMessage); + } + + break; + } + + default: + break; + } + } + } + } + + private void MigrateFormerUrls(ICmsTree ksNode, WebPageItemInfo targetPage) + { + if (modelFacade.IsAvailable()) + { + var formerUrlPaths = modelFacade.SelectWhere( + "PageFormerUrlPathSiteID = @siteId AND PageFormerUrlPathNodeID = @nodeId", + new SqlParameter("siteId", ksNode.NodeSiteID), + new SqlParameter("nodeId", ksNode.NodeID) + ); + foreach (var cmsPageFormerUrlPath in formerUrlPaths) + { + logger.LogDebug("PageFormerUrlPath migration '{PageFormerUrlPath}' ", cmsPageFormerUrlPath); + protocol.FetchedSource(cmsPageFormerUrlPath); + + switch (cmsPageFormerUrlPath) + { + case CmsPageFormerUrlPathK11: + case CmsPageFormerUrlPathK12: + { + logger.LogError("Unexpected type '{Type}'", cmsPageFormerUrlPath.GetType().FullName); + break; + } + case CmsPageFormerUrlPathK13 pfup: + { + try + { + var languageInfo = languages.GetOrAdd( + pfup.PageFormerUrlPathCulture, + s => ContentLanguageInfoProvider.ProviderObject.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageName), s).SingleOrDefault() ?? throw new InvalidOperationException($"Missing content language '{s}'") + ); + + var ktPath = WebPageFormerUrlPathInfo.Provider.Get() + .WhereEquals(nameof(WebPageFormerUrlPathInfo.WebPageFormerUrlPathHash), GetWebPageUrlPathHashQueryExpression(pfup.PageFormerUrlPathUrlPath)) + .WhereEquals(nameof(WebPageFormerUrlPathInfo.WebPageFormerUrlPathWebsiteChannelID), targetPage.WebPageItemWebsiteChannelID) + .WhereEquals(nameof(WebPageFormerUrlPathInfo.WebPageFormerUrlPathContentLanguageID), languageInfo.ContentLanguageID) + .SingleOrDefault(); + + if (ktPath != null) + { + protocol.FetchedTarget(ktPath); + } + + var webPageFormerUrlPathInfo = ktPath ?? new WebPageFormerUrlPathInfo(); + webPageFormerUrlPathInfo.WebPageFormerUrlPath = pfup.PageFormerUrlPathUrlPath; + webPageFormerUrlPathInfo.WebPageFormerUrlPathHash = modelFacade.HashPath(pfup.PageFormerUrlPathUrlPath); + webPageFormerUrlPathInfo.WebPageFormerUrlPathWebPageItemID = targetPage.WebPageItemID; + webPageFormerUrlPathInfo.WebPageFormerUrlPathWebsiteChannelID = targetPage.WebPageItemWebsiteChannelID; + webPageFormerUrlPathInfo.WebPageFormerUrlPathContentLanguageID = languageInfo.ContentLanguageID; + webPageFormerUrlPathInfo.WebPageFormerUrlPathLastModified = pfup.PageFormerUrlPathLastModified; + + WebPageFormerUrlPathInfo.Provider.Set(webPageFormerUrlPathInfo); + logger.LogInformation("Former page url path imported '{Path}'", webPageFormerUrlPathInfo.WebPageFormerUrlPath); + } + catch (Exception ex) + { + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(pfup) + ); + logger.LogError("Failed to import page former url path: {Exception}", ex); + } + + break; + } + default: + throw new ArgumentOutOfRangeException(nameof(cmsPageFormerUrlPath)); + } + } + } + else + { + logger.LogDebug("CmsPageFormerUrlPath not supported in source instance"); + } + } + + internal static QueryExpression GetWebPageUrlPathHashQueryExpression(string urlPath) => $"CONVERT(VARCHAR(64), HASHBYTES('SHA2_256', LOWER(N'{SqlHelper.EscapeQuotes(urlPath)}')), 2)".AsExpression(); + + // private async Task MigrateAlternativeUrls() + // { + // if (modelFacade.IsAvailable()) + // { + // } + // else + // { + // } + // } + + #region Deffered patch + + private async Task ExecDeferredPageBuilderPatch() + { + logger.LogInformation("Executing TreePath patch"); + + foreach ((var uniqueId, string className, int webSiteChannelId) in deferredPathService.GetWidgetsToPatch()) + { + if (className == ContentItemCommonDataInfo.TYPEINFO.ObjectClassName) + { + var contentItemCommonDataInfo = await ContentItemCommonDataInfo.Provider.GetAsync(uniqueId); + + contentItemCommonDataInfo.ContentItemCommonDataPageBuilderWidgets = DeferredPatchPageBuilderWidgets( + contentItemCommonDataInfo.ContentItemCommonDataPageBuilderWidgets, webSiteChannelId, out bool anythingChangedW); + contentItemCommonDataInfo.ContentItemCommonDataPageTemplateConfiguration = DeferredPatchPageTemplateConfiguration( + contentItemCommonDataInfo.ContentItemCommonDataPageTemplateConfiguration, webSiteChannelId, out bool anythingChangedC); + + if (anythingChangedC || anythingChangedW) + { + contentItemCommonDataInfo.Update(); + } + } + else if (className == PageTemplateConfigurationInfo.TYPEINFO.ObjectClassName) + { + var pageTemplateConfigurationInfo = await PageTemplateConfigurationInfo.Provider.GetAsync(uniqueId); + pageTemplateConfigurationInfo.PageTemplateConfigurationWidgets = DeferredPatchPageBuilderWidgets( + pageTemplateConfigurationInfo.PageTemplateConfigurationWidgets, + webSiteChannelId, + out bool anythingChangedW + ); + pageTemplateConfigurationInfo.PageTemplateConfigurationTemplate = DeferredPatchPageTemplateConfiguration( + pageTemplateConfigurationInfo.PageTemplateConfigurationTemplate, + webSiteChannelId, + out bool anythingChangedC + ); + if (anythingChangedW || anythingChangedC) + { + PageTemplateConfigurationInfo.Provider.Set(pageTemplateConfigurationInfo); + } + } + } + } + + private string DeferredPatchPageTemplateConfiguration(string documentPageTemplateConfiguration, int webSiteChannelId, out bool anythingChanged) + { + if (!string.IsNullOrWhiteSpace(documentPageTemplateConfiguration)) + { + var configuration = JObject.Parse(documentPageTemplateConfiguration); + PageBuilderWidgetsPatcher.DeferredPatchProperties(configuration, TreePathConvertor.GetSiteConverter(webSiteChannelId), out anythingChanged); + return JsonConvert.SerializeObject(configuration); + } + + anythingChanged = false; + return documentPageTemplateConfiguration; + } + + private string DeferredPatchPageBuilderWidgets(string documentPageBuilderWidgets, int webSiteChannelId, out bool anythingChanged) + { + if (!string.IsNullOrWhiteSpace(documentPageBuilderWidgets)) + { + var patched = PageBuilderWidgetsPatcher.DeferredPatchConfiguration( + JsonConvert.DeserializeObject(documentPageBuilderWidgets), + TreePathConvertor.GetSiteConverter(webSiteChannelId), + out anythingChanged + ); + return JsonConvert.SerializeObject(patched); + } + + anythingChanged = false; + return documentPageBuilderWidgets; + } + + #endregion +} diff --git a/KVA/Migration.Toolkit.Source/Helpers/AdminUserHelper.cs b/KVA/Migration.Toolkit.Source/Helpers/AdminUserHelper.cs new file mode 100644 index 00000000..6087a0b4 --- /dev/null +++ b/KVA/Migration.Toolkit.Source/Helpers/AdminUserHelper.cs @@ -0,0 +1,51 @@ +using CMS.Base; + +using Microsoft.Extensions.DependencyInjection; + +using Migration.Toolkit.Common; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Helpers; + +public class AdminUserHelper +{ + /// + /// maps source user id to target admin user + /// + /// source user id + /// in case user was migrated to member, replacement admin user shall be returned + /// called when no admin user exists in target instance, but is expected to exist + /// Target admin user ID + public static int? MapTargetAdminUser(int? sourceUserId, int memberFallbackTargetUserId, Action? onAdminNotFound = null) + { + if (sourceUserId is null) + { + return null; + } + + var modelFacade = KsCoreDiExtensions.ServiceProvider.GetRequiredService(); + if (modelFacade.SelectById(sourceUserId) is { } modifiedByUser) + { + if (UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(modifiedByUser.UserPrivilegeLevel)) + { + var primaryKeyMappingContext = KsCoreDiExtensions.ServiceProvider.GetRequiredService(); + switch (primaryKeyMappingContext.MapSourceId(u => u.UserID, sourceUserId)) + { + case { Success: true, MappedId: { } targetUserId }: + return targetUserId; + default: + { + onAdminNotFound?.Invoke(); + return null; + } + } + } + + return CMSActionContext.CurrentUser.UserID; + } + + // user not found, setting fallback + return CMSActionContext.CurrentUser.UserID; + } +} diff --git a/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs b/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs index 5197ae1e..1206790e 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs +++ b/KVA/Migration.Toolkit.Source/Helpers/KenticoHelper.cs @@ -1,16 +1,16 @@ -namespace Migration.Toolkit.Source.Helpers; - -using CMS.Helpers; - -public static class KenticoHelper -{ - public static void CopyCustomData(ContainerCustomData target, string? sourceXml) - { - var customNodeData = new ContainerCustomData(); - customNodeData.LoadData(sourceXml); - foreach (var columnName in customNodeData.ColumnNames) - { - target.SetValue(columnName, customNodeData.GetValue(columnName)); - } - } -} \ No newline at end of file +using CMS.Helpers; + +namespace Migration.Toolkit.Source.Helpers; + +public static class KenticoHelper +{ + public static void CopyCustomData(ContainerCustomData target, string? sourceXml) + { + var customNodeData = new ContainerCustomData(); + customNodeData.LoadData(sourceXml); + foreach (string? columnName in customNodeData.ColumnNames) + { + target.SetValue(columnName, customNodeData.GetValue(columnName)); + } + } +} diff --git a/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs b/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs index 5304fb83..6b8a91e5 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs +++ b/KVA/Migration.Toolkit.Source/Helpers/PageBuilderWidgetsPatcher.cs @@ -1,70 +1,78 @@ -namespace Migration.Toolkit.Source.Helpers; - -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Source.Services.Model; -using Newtonsoft.Json.Linq; - -public static class PageBuilderWidgetsPatcher -{ - public static EditableAreasConfiguration DeferredPatchConfiguration(EditableAreasConfiguration configuration, TreePathConvertor convertor, out bool anythingChanged) - { - anythingChanged = false; - foreach (var configurationEditableArea in configuration.EditableAreas ?? new()) - { - foreach (var sectionConfiguration in configurationEditableArea.Sections ?? new()) - { - foreach (var sectionConfigurationZone in sectionConfiguration.Zones ?? new()) - { - foreach (var configurationZoneWidget in sectionConfigurationZone.Widgets ?? new()) - { - DeferredPatchWidget(configurationZoneWidget, convertor, out var anythingChangedTmp); - anythingChanged = anythingChanged || anythingChangedTmp; - } - } - } - } - - return configuration; - } - - private static void DeferredPatchWidget(WidgetConfiguration configurationZoneWidget, TreePathConvertor convertor, out bool anythingChanged) - { - anythingChanged = false; - if (configurationZoneWidget == null) return; - - var list = configurationZoneWidget.Variants ?? new(); - for (var i = 0; i < list.Count; i++) - { - var variant = JObject.FromObject(list[i]); - DeferredPatchProperties(variant, convertor, out var anythingChangedTmp); - - list[i] = variant.ToObject(); - anythingChanged = anythingChanged || anythingChangedTmp; - } - } - - public static void DeferredPatchProperties(JObject propertyContainer, TreePathConvertor convertor, out bool anythingChanged) - { - anythingChanged = false; - if (propertyContainer?["properties"] is JObject { Count: 1 } properties) - { - foreach (var (key, value) in properties) - { - switch (key) - { - case "TreePath": - { - var nodeAliasPath = value?.Value(); - var treePath = convertor.GetConvertedOrUnchangedAssumingChannel(nodeAliasPath); - if (!TreePathConvertor.TreePathComparer.Equals(nodeAliasPath, treePath)) - { - properties["TreePath"] = JToken.FromObject(treePath); - anythingChanged = true; - } - break; - } - } - } - } - } -} \ No newline at end of file +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Source.Services.Model; + +using Newtonsoft.Json.Linq; + +namespace Migration.Toolkit.Source.Helpers; + +public static class PageBuilderWidgetsPatcher +{ + public static EditableAreasConfiguration DeferredPatchConfiguration(EditableAreasConfiguration configuration, TreePathConvertor convertor, out bool anythingChanged) + { + anythingChanged = false; + foreach (var configurationEditableArea in configuration.EditableAreas ?? []) + { + foreach (var sectionConfiguration in configurationEditableArea.Sections ?? []) + { + foreach (var sectionConfigurationZone in sectionConfiguration.Zones ?? []) + { + foreach (var configurationZoneWidget in sectionConfigurationZone.Widgets ?? []) + { + DeferredPatchWidget(configurationZoneWidget, convertor, out bool anythingChangedTmp); + anythingChanged = anythingChanged || anythingChangedTmp; + } + } + } + } + + return configuration; + } + + private static void DeferredPatchWidget(WidgetConfiguration configurationZoneWidget, TreePathConvertor convertor, out bool anythingChanged) + { + anythingChanged = false; + if (configurationZoneWidget == null) + { + return; + } + + var list = configurationZoneWidget.Variants ?? []; + for (int i = 0; i < list.Count; i++) + { + var variant = JObject.FromObject(list[i]); + DeferredPatchProperties(variant, convertor, out bool anythingChangedTmp); + + list[i] = variant.ToObject(); + anythingChanged = anythingChanged || anythingChangedTmp; + } + } + + public static void DeferredPatchProperties(JObject propertyContainer, TreePathConvertor convertor, out bool anythingChanged) + { + anythingChanged = false; + if (propertyContainer?["properties"] is JObject { Count: 1 } properties) + { + foreach ((string key, var value) in properties) + { + switch (key) + { + case "TreePath": + { + string? nodeAliasPath = value?.Value(); + string treePath = convertor.GetConvertedOrUnchangedAssumingChannel(nodeAliasPath); + if (!TreePathConvertor.TreePathComparer.Equals(nodeAliasPath, treePath)) + { + properties["TreePath"] = JToken.FromObject(treePath); + anythingChanged = true; + } + + break; + } + + default: + break; + } + } + } + } +} diff --git a/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs b/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs index 67451839..c2bf9524 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs +++ b/KVA/Migration.Toolkit.Source/Helpers/PrintHelper.cs @@ -1,7 +1,7 @@ -namespace Migration.Toolkit.Source.Helpers; - -public static class PrintHelper -{ - public static string PrintDictionary(Dictionary dictionary) => - string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); -} \ No newline at end of file +namespace Migration.Toolkit.Source.Helpers; + +public static class PrintHelper +{ + public static string PrintDictionary(Dictionary dictionary) => + string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); +} diff --git a/KVA/Migration.Toolkit.Source/Helpers/Printer.cs b/KVA/Migration.Toolkit.Source/Helpers/Printer.cs index 20619dd2..be7ed9c5 100644 --- a/KVA/Migration.Toolkit.Source/Helpers/Printer.cs +++ b/KVA/Migration.Toolkit.Source/Helpers/Printer.cs @@ -1,123 +1,106 @@ -namespace Migration.Toolkit.Source.Helpers; - -using CMS.DataEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Source.Model; - -public class Printer -{ - public static string PrintKxpModelInfo(T model) - { - var currentTypeName = ReflectionHelper.CurrentType.Name; - - return model switch - { - KXP.Models.MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", - KXP.Models.MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", - KXP.Models.CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", - KXP.Models.CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", - KXP.Models.CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", - KXP.Models.CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", - KXP.Models.CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", - KXP.Models.CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", - KXP.Models.OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", - - null => $"{currentTypeName}: ", - _ => $"TODO: {typeof(T).FullName}" - }; - } - - public static string GetEntityIdentityPrint(T model, bool printType = true) - { - var currentTypeName = ReflectionHelper.CurrentType.Name; - - string Fallback(object obj) => printType - ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" - : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}" - ; - - string FormatModel(string inner) => printType - ? $"{currentTypeName}({inner})" - : $"{inner}" - ; - - return model switch - { - MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), - MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), - DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - - CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - - ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), - CMS.FormEngine.AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), - UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), - RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), - MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), - - KXP.Models.CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), - KXP.Models.CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), - KXP.Models.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - KXP.Models.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - KXP.Models.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - KXP.Models.CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), - - CmsPageTemplateConfigurationK11 item => FormatModel($"Item not exists in K11 {item}"), - CmsPageTemplateConfigurationK12 item => FormatModel($"ID={item.PageTemplateConfigurationID}, GUID={item.PageTemplateConfigurationGUID}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteID}"), - CmsPageTemplateConfigurationK13 item => FormatModel($"ID={item.PageTemplateConfigurationID}, GUID={item.PageTemplateConfigurationGUID}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteID}"), - ICmsRole item => FormatModel($"ID={item.RoleID}, GUID={item.RoleGUID}, Name={item.RoleName}, SiteId={item.SiteID}"), - ICmsAttachment item => FormatModel($"ID={item.AttachmentID}, GUID={item.AttachmentGUID}, Name={item.AttachmentName}"), - ICmsClass item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - ICmsConsent item => FormatModel($"ID={item.ConsentID}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - ICmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveID}, GUID={item.ConsentArchiveGuid}"), - ICmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementID}, GUID={item.ConsentAgreementGuid}"), - ICmsCountry item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - ICmsState item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - ICmsTree item => FormatModel($"NodeID={item.NodeID}, NodeGUID={item.NodeGUID}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), - ICmsDocument item => FormatModel($"NodeID={item.DocumentNodeID}, DocumentID={item.DocumentID}, DocumentGUID={item.DocumentGUID}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), - ICmsResource item => FormatModel($"ID={item.ResourceID}, GUID={item.ResourceGUID}, Name={item.ResourceName}"), - - null => $" ref of {currentTypeName}", - _ => Fallback(model) - }; - } - - public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") - { - return string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); - } - - public static string PrintEnumValues(string separator) where TEnum : struct, Enum - { - return string.Join(separator, Enum.GetValues()); - } -} - -public class PrintService : IPrintService -{ - public string PrintKxpModelInfo(T model) - { - return Printer.PrintKxpModelInfo(model); - } - - public string GetEntityIdentityPrint(T model, bool printType = true) - { - return Printer.GetEntityIdentityPrint(model, printType); - } - - public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") - { - return Printer.GetEntityIdentityPrints(models, separator); - } - - public string PrintEnumValues(string separator) where TEnum : struct, Enum - { - return Printer.PrintEnumValues(separator); - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; + +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.KXP.Models; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Helpers; + +public class Printer +{ + public static string PrintKxpModelInfo(T model) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + return model switch + { + MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", + MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", + CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", + CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", + CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", + CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", + CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", + CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", + OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", + + null => $"{currentTypeName}: ", + _ => $"TODO: {typeof(T).FullName}" + }; + } + + public static string GetEntityIdentityPrint(T model, bool printType = true) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + string Fallback(object obj) => printType + ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" + : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; + + string FormatModel(string inner) => printType + ? $"{currentTypeName}({inner})" + : $"{inner}"; + + return model switch + { + MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), + MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), + DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + + CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + + ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), + AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), + UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), + RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), + MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), + + CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), + CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), + CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), + + CmsPageTemplateConfigurationK11 item => FormatModel($"Item not exists in K11 {item}"), + CmsPageTemplateConfigurationK12 item => FormatModel($"ID={item.PageTemplateConfigurationID}, GUID={item.PageTemplateConfigurationGUID}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteID}"), + CmsPageTemplateConfigurationK13 item => FormatModel($"ID={item.PageTemplateConfigurationID}, GUID={item.PageTemplateConfigurationGUID}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteID}"), + ICmsRole item => FormatModel($"ID={item.RoleID}, GUID={item.RoleGUID}, Name={item.RoleName}, SiteId={item.SiteID}"), + ICmsAttachment item => FormatModel($"ID={item.AttachmentID}, GUID={item.AttachmentGUID}, Name={item.AttachmentName}"), + ICmsClass item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + ICmsConsent item => FormatModel($"ID={item.ConsentID}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + ICmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveID}, GUID={item.ConsentArchiveGuid}"), + ICmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementID}, GUID={item.ConsentAgreementGuid}"), + ICmsCountry item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + ICmsState item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + ICmsTree item => FormatModel($"NodeID={item.NodeID}, NodeGUID={item.NodeGUID}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), + ICmsDocument item => FormatModel($"NodeID={item.DocumentNodeID}, DocumentID={item.DocumentID}, DocumentGUID={item.DocumentGUID}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), + ICmsResource item => FormatModel($"ID={item.ResourceID}, GUID={item.ResourceGUID}, Name={item.ResourceName}"), + + null => $" ref of {currentTypeName}", + _ => Fallback(model) + }; + } + + public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); + + public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); +} + +public class PrintService : IPrintService +{ + public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); + + public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); + + public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); + + public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); +} diff --git a/KVA/Migration.Toolkit.Source/ISourceModel.cs b/KVA/Migration.Toolkit.Source/ISourceModel.cs index 046b55e5..c9c71277 100644 --- a/KVA/Migration.Toolkit.Source/ISourceModel.cs +++ b/KVA/Migration.Toolkit.Source/ISourceModel.cs @@ -1,13 +1,14 @@ -namespace Migration.Toolkit.Source; - -using System.Data; -using Migration.Toolkit.Common; - -public interface ISourceModel -{ - static abstract bool IsAvailable(SemanticVersion version); - static abstract string GetPrimaryKeyName(SemanticVersion version); - static abstract string TableName { get; } - static abstract string GuidColumnName { get; } - static abstract T FromReader(IDataReader reader, SemanticVersion version); -} \ No newline at end of file +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source; + +public interface ISourceModel +{ + static abstract string TableName { get; } + static abstract string GuidColumnName { get; } + static abstract bool IsAvailable(SemanticVersion version); + static abstract string GetPrimaryKeyName(SemanticVersion version); + static abstract T FromReader(IDataReader reader, SemanticVersion version); +} diff --git a/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs b/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs index 6fae5c11..b917140e 100644 --- a/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs +++ b/KVA/Migration.Toolkit.Source/KsCoreDiExtensions.cs @@ -1,115 +1,90 @@ -namespace Migration.Toolkit.Source; - -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using CMS.OnlineForms; -using CMS.Websites; -using Kentico.Xperience.UMT; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Behaviors; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Handlers; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; - -public static class KsCoreDiExtensions -{ - public static IServiceCollection UseKsToolkitCore(this IServiceCollection services) - { - var printService = new PrintService(); - services.AddSingleton(printService); - HandbookReference.PrintService = printService; - LogExtensions.PrintService = printService; - - services.AddTransient(); - // services.AddSingleton(); - - services.AddSingleton(); - - // services.AddSingleton(); - - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddScoped(); - services.AddScoped(); - // services.AddScoped(); - services.AddScoped(); - - services.AddMediatR(typeof(KsCoreDiExtensions)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); - - // services.AddSingleton(s => new TableReflectionService(s.GetRequiredService>())); - services.AddSingleton(); - services.AddSingleton(); - services.AddTransient(); - services.AddTransient(); - - services.AddScoped(); - // services.AddSingleton(); - services.AddScoped(); - // services.AddSingleton(); - - // commands - // services.AddTransient(); - // services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - // services.AddTransient(); - // services.AddTransient(); - // services.AddTransient(); - // services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - - // services.AddTransient(); - - // umt mappers - services.AddTransient, ContentItemMapper>(); - services.AddTransient, TagMapper>(); - - // mappers - services.AddTransient, CmsAttachmentMapper>(); - services.AddTransient, CmsClassMapper>(); - // services.AddTransient, CmsConsentMapper>(); - // services.AddTransient, CmsConsentAgreementMapper>(); - // services.AddTransient, CmsConsentArchiveMapper>(); - services.AddTransient, CmsFormMapper>(); - services.AddTransient, CmsFormMapperEf>(); - services.AddTransient, ResourceMapper>(); - services.AddTransient, AlternativeFormMapper>(); - // services.AddTransient, RoleInfoMapper>(); - // services.AddTransient, CmsSettingsCategoryMapper>(); - // services.AddTransient, CmsSettingsKeyMapper>(); - // services.AddTransient, UserInfoMapper>(); - services.AddTransient, MemberInfoMapper>(); - // services.AddTransient, UserRoleInfoMapper>(); - // services.AddTransient, MediaLibraryInfoMapper>(); - // services.AddTransient, OmContactMapper>(); - // services.AddTransient, OmContactGroupMapper>(); - // services.AddTransient, OmContactStatusMapper>(); - // services.AddTransient, MediaFileInfoMapper>(); - // services.AddTransient, CountryInfoMapper>(); - // services.AddTransient, StateInfoMapper>(); - services.AddTransient, PageTemplateConfigurationMapper>(); - - services.AddUniversalMigrationToolkit(); - - return services; - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; +using CMS.OnlineForms; +using CMS.Websites; + +using Kentico.Xperience.UMT; + +using MediatR; + +using Microsoft.Extensions.DependencyInjection; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.Common.Services.Ipc; +using Migration.Toolkit.KXP.Models; +using Migration.Toolkit.Source.Behaviors; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Helpers; +using Migration.Toolkit.Source.Mappers; +using Migration.Toolkit.Source.Model; +using Migration.Toolkit.Source.Services; + +namespace Migration.Toolkit.Source; + +public static class KsCoreDiExtensions +{ + public static IServiceProvider ServiceProvider { get; private set; } = null!; + public static void InitServiceProvider(IServiceProvider serviceProvider) => ServiceProvider = serviceProvider; + + public static IServiceCollection UseKsToolkitCore(this IServiceCollection services) + { + var printService = new PrintService(); + services.AddSingleton(printService); + HandbookReference.PrintService = printService; + LogExtensions.PrintService = printService; + + services.AddTransient(); + + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(s => s.GetRequiredService() as SpoiledGuidContext ?? throw new InvalidOperationException()); + + services.AddTransient(); + services.AddTransient(); + services.AddTransient(); + services.AddScoped(); + services.AddScoped(); + services.AddScoped(); + + services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(KsCoreDiExtensions).Assembly)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); + + services.AddSingleton(); + services.AddSingleton(); + services.AddTransient(); + services.AddTransient(); + + services.AddScoped(); + services.AddScoped(s => s.GetRequiredService()); + services.AddScoped(); + + // umt mappers + services.AddTransient, ContentItemMapper>(); + services.AddTransient, TagMapper>(); + + // mappers + services.AddTransient, CmsAttachmentMapper>(); + services.AddTransient, CmsClassMapper>(); + services.AddTransient, CmsFormMapper>(); + services.AddTransient, CmsFormMapperEf>(); + services.AddTransient, ResourceMapper>(); + services.AddTransient, AlternativeFormMapper>(); + services.AddTransient, MemberInfoMapper>(); + services.AddTransient, PageTemplateConfigurationMapper>(); + services.AddTransient, MediaLibraryInfoMapper>(); + services.AddTransient, MediaFileInfoMapper>(); + + services.AddUniversalMigrationToolkit(); + + return services; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs index ac698869..df043c3f 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/AlternativeFormMapper.cs @@ -1,98 +1,100 @@ -namespace Migration.Toolkit.Source.Mappers; - -using CMS.DataEngine; -using CMS.FormEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; - -public record AlternativeFormMapperSource(ICmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); - -public class AlternativeFormMapper( - ILogger logger, - PrimaryKeyMappingContext pkContext, - IProtocol protocol, - FieldMigrationService fieldMigrationService, - ModelFacade modelFacade - ) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - => AlternativeFormInfo.New(); - - protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (source, xbkFormClass) = sourceObj; - - target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassID, source.FormClassID, out var classId) - ? classId ?? 0 - : 0; - target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassID, source.FormCoupledClassID, out var coupledClassId) - ? coupledClassId ?? 0 - : 0; - - var formCoupledClass = modelFacade.SelectById(source.FormCoupledClassID); - var formClass = modelFacade.SelectById(source.FormClassID); - - var coupledClassIsDeprecated = - formCoupledClass?.ClassName is { } coupledClassName && - K12SystemClass.NoLongerSupported.Contains(coupledClassName); - - var classIsSysInternal = K12SystemClass.All.Contains(formClass.ClassName); - - var mergedDefinition = formClass.ClassFormDefinition; - if (formCoupledClass != null) - { - logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", formCoupledClass.ClassName, formClass.ClassName); - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, formCoupledClass.ClassFormDefinition); - } - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); - - var patcher = new FormDefinitionPatcher( - logger, - mergedDefinition, - fieldMigrationService, - formClass.ClassIsForm.GetValueOrDefault(false), - formClass.ClassIsDocumentType, - false, - !classIsSysInternal, - true - ); - - var fieldNames = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); - - patcher.PatchFields(); - - var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); - - if (coupledClassIsDeprecated && formCoupledClass != null) - { - logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", formCoupledClass.ClassName); - patcher.RemoveFields(formCoupledClass.ClassFormDefinition); - - var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); - } - - var result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); - - var formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); - - target.FormDefinition = formDefinitionDifference; - - target.FormDisplayName = source.FormDisplayName; - target.FormGUID = source.FormGUID; - target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); - target.FormLastModified = source.FormLastModified; - target.FormName = source.FormName; - - return target; - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api.Services.CmsClass; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public record AlternativeFormMapperSource(ICmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); + +public class AlternativeFormMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + FieldMigrationService fieldMigrationService, + ModelFacade modelFacade +) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + => AlternativeFormInfo.New(); + + protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (source, xbkFormClass) = sourceObj; + + target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassID, source.FormClassID, out int? classId) + ? classId ?? 0 + : 0; + target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassID, source.FormCoupledClassID, out int? coupledClassId) + ? coupledClassId ?? 0 + : 0; + + var formCoupledClass = modelFacade.SelectById(source.FormCoupledClassID); + var formClass = modelFacade.SelectById(source.FormClassID); + + bool coupledClassIsDeprecated = + formCoupledClass?.ClassName is { } coupledClassName && + K12SystemClass.NoLongerSupported.Contains(coupledClassName); + + bool classIsSysInternal = K12SystemClass.All.Contains(formClass.ClassName); + + string mergedDefinition = formClass.ClassFormDefinition; + if (formCoupledClass != null) + { + logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", formCoupledClass.ClassName, formClass.ClassName); + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, formCoupledClass.ClassFormDefinition); + } + + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); + + var patcher = new FormDefinitionPatcher( + logger, + mergedDefinition, + fieldMigrationService, + formClass.ClassIsForm.GetValueOrDefault(false), + formClass.ClassIsDocumentType, + false, + !classIsSysInternal, + true + ); + + var fieldNames = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); + + patcher.PatchFields(); + + var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); + + if (coupledClassIsDeprecated && formCoupledClass != null) + { + logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", formCoupledClass.ClassName); + patcher.RemoveFields(formCoupledClass.ClassFormDefinition); + + var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); + } + + string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); + + string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); + + target.FormDefinition = formDefinitionDifference; + + target.FormDisplayName = source.FormDisplayName; + target.FormGUID = source.FormGUID; + target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); + target.FormLastModified = source.FormLastModified; + target.FormName = source.FormName; + + return target; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs index 69196f7a..c57086f8 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/CmsAttachmentMapper.cs @@ -1,55 +1,55 @@ -namespace Migration.Toolkit.Source.Mappers; - -using CMS.Base; -using CMS.MediaLibrary; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Helpers; -using Migration.Toolkit.Source.Model; - -public record CmsAttachmentMapperSource(ICmsAttachment Attachment, int TargetLibraryId, IUploadedFile File, string LibrarySubFolder, ICmsTree? AttachmentNode); - -public class CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) - : EntityMapperBase(logger, pkContext, protocol) -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - { - // library name is generated with site name in it - return new MediaFileInfo(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); - } - - protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (cmsAttachment, targetLibraryId, _, _, attachmentNode) = args; - - target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); - target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; - target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; - target.FileExtension = cmsAttachment.AttachmentExtension; - target.FileMimeType = cmsAttachment.AttachmentMimeType; - target.FileSize = cmsAttachment.AttachmentSize; - target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; - target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; - target.FileGUID = cmsAttachment.AttachmentGUID; - target.FileLibraryID = targetLibraryId; - - // target.FileCreatedByUserID = cmsAttachment.?; - // target.FileModifiedByUserID = cmsAttachment.?; - // target.FileCreatedWhen = cmsAttachment.?; - - target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; - - KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); - - if (attachmentNode != null) - { - target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentNode.NodeAliasPath); - } - - return target; - } -} \ No newline at end of file +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Helpers; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public record CmsAttachmentMapperSource(ICmsAttachment Attachment, int TargetLibraryId, IUploadedFile File, string LibrarySubFolder, ICmsTree? AttachmentNode); + +public class CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) + : EntityMapperBase(logger, pkContext, protocol) +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + // library name is generated with site name in it + new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); + + protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var cmsAttachment, int targetLibraryId, _, _, var attachmentNode) = args; + + target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); + target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; + target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; + target.FileExtension = cmsAttachment.AttachmentExtension; + target.FileMimeType = cmsAttachment.AttachmentMimeType; + target.FileSize = cmsAttachment.AttachmentSize; + target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; + target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; + target.FileGUID = cmsAttachment.AttachmentGUID; + target.FileLibraryID = targetLibraryId; + + // target.FileCreatedByUserID = cmsAttachment.?; + // target.FileModifiedByUserID = cmsAttachment.?; + // target.FileCreatedWhen = cmsAttachment.?; + + target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; + + KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); + + if (attachmentNode != null) + { + target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentNode.NodeAliasPath); + } + + return target; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs index a1569ef6..bbd1df72 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/CmsClassMapper.cs @@ -1,361 +1,370 @@ -namespace Migration.Toolkit.Source.Mappers; - -using System.Diagnostics; -using System.Xml; -using CMS.ContentEngine; -using CMS.Core; -using CMS.DataEngine; -using CMS.FormEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; - -public class CmsClassMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - FieldMigrationService fieldMigrationService, - ModelFacade modelFacade - ) - : EntityMapperBase(logger, - primaryKeyMappingContext, protocol) -{ - protected override DataClassInfo? CreateNewInstance(ICmsClass source, MappingHelper mappingHelper, AddFailure addFailure) => - DataClassInfo.New(); - - protected override DataClassInfo MapInternal(ICmsClass source, DataClassInfo target, bool newInstance, MappingHelper mappingHelper, - AddFailure addFailure) - { - target.ClassDisplayName = source.ClassDisplayName; - target.ClassName = source.ClassName; - - var isCustomizableSystemClass = false; - var classIsCustom = true; - var classResource = modelFacade.SelectById(source.ClassResourceID); - if (classResource?.ResourceName is { } resourceName) - { - isCustomizableSystemClass = source.ClassShowAsSystemTable.GetValueOrDefault(false) && - K12SystemResource.All.Contains(resourceName); - - classIsCustom = !K12SystemResource.All.Contains(resourceName); - - logger.LogDebug("{ClassName} is {@Properties}", source.ClassName, new { isCustomizableSystemClass, classIsCustom, source.ClassResourceID, classResource?.ResourceName }); - } - - MapFormDefinitionFields(source, target, isCustomizableSystemClass, classIsCustom); - - target.ClassHasUnmanagedDbSchema = false; - if (!string.IsNullOrWhiteSpace(source.ClassTableName)) - { - target.ClassTableName = source.ClassTableName; - } - target.ClassShowTemplateSelection = source.ClassShowTemplateSelection.UseKenticoDefault(); - target.ClassLastModified = source.ClassLastModified; - target.ClassGUID = source.ClassGUID; - - if (source.ClassContactMapping != null) - { - var mapInfo = new FormInfo(source.ClassContactMapping); - var newMappings = new FormInfo(); - if (mapInfo.ItemsList.Count > 0) - { - var ffiLookup = mapInfo.ItemsList.OfType().ToLookup(f => f.MappedToField, f => f); - - foreach (var formFieldInfos in ffiLookup) - { - newMappings.AddFormItem(formFieldInfos.First()); - } - } - - target.ClassContactMapping = newMappings.GetXmlDefinition(); - } - - target.ClassContactOverwriteEnabled = source.ClassContactOverwriteEnabled.UseKenticoDefault(); - target.ClassConnectionString = source.ClassConnectionString; - target.ClassDefaultObjectType = source.ClassDefaultObjectType; - target.ClassCodeGenerationSettings = source.ClassCodeGenerationSettings; - target.ClassIconClass = source.ClassIconClass; - if (source.ClassIsDocumentType) - { - target.ClassWebPageHasUrl = source switch - { - CmsClassK13 { ClassHasURL: false } => false, - _ => true - }; - } - - if (mappingHelper.TranslateIdAllowNulls(c => c.ResourceID, source.ClassResourceID, out var resourceId)) - { - if (resourceId.HasValue) - { - target.ClassResourceID = resourceId.Value; - } - } - - switch (source) - { - // Special - case { ClassName: { } className } when - className.Equals("cms.site", StringComparison.InvariantCultureIgnoreCase) || - className.Equals("cms.root", StringComparison.InvariantCultureIgnoreCase) - : - { - throw new Exception("Unable to map obsolete dataclass"); - return target; - } - // Target Other,null - // Target System,null - case not null when target is { ClassType: ClassType.OTHER or ClassType.SYSTEM_TABLE }: - { - break; - } - } - - switch (source) - { - // Custom class from custom resource? - case - { - ClassIsForm: false or null, - ClassIsDocumentType: false, - ClassResourceID: { } classResourceId - }: - { - target.ClassType = ClassType.OTHER; - target.ClassContentTypeType = null; - - target = PatchDataClassInfo(target, out var oldPrimaryKeyName, out var documentNameField); - - break; - } - - // Target Form,null - case - { - ClassIsDocumentType: false, - ClassIsCoupledClass: true, - ClassIsForm: true, - // ClassIsPage: false - } - : - { - target.ClassType = ClassType.FORM; - target.ClassContentTypeType = ""; - - break; - } - - // Target Content,Reusable - case - { - ClassIsDocumentType: false, - ClassIsForm: false or null, - ClassShowAsSystemTable: false, - ClassIsCustomTable: false, - // ClassIsPage: false - }: - { - target.ClassType = ClassType.CONTENT_TYPE; - target.ClassContentTypeType = ClassContentTypeType.REUSABLE; - - target = PatchDataClassInfo(target, out var oldPrimaryKeyName, out var documentNameField); - break; - } - - // Target Content,Website - case { ClassName: { } className } when className.Equals("cms.folder", StringComparison.InvariantCultureIgnoreCase): - case - { - ClassIsDocumentType: true, - ClassIsForm: false or null, - // ClassIsPage: true - }: - { - target.ClassType = ClassType.CONTENT_TYPE; - target.ClassContentTypeType = ClassContentTypeType.WEBSITE; - - target = PatchDataClassInfo(target, out var oldPrimaryKeyName, out var documentNameField); - break; - } - } - - return target; - } - - private void MapFormDefinitionFields(ICmsClass source, DataClassInfo target, bool isCustomizableSystemClass, bool classIsCustom) - { - if (!string.IsNullOrWhiteSpace(source.ClassFormDefinition)) - { - var patcher = new FormDefinitionPatcher( - logger, - source.ClassFormDefinition, - fieldMigrationService, - source.ClassIsForm.GetValueOrDefault(false), - source.ClassIsDocumentType, - isCustomizableSystemClass, - classIsCustom - ); - - patcher.PatchFields(); - patcher.RemoveCategories(); // TODO tk: 2022-10-11 remove when supported - - var result = patcher.GetPatched(); - if (isCustomizableSystemClass) - { - result = FormHelper.MergeFormDefinitions(target.ClassFormDefinition, result); - } - - var formInfo = new FormInfo(result); - target.ClassFormDefinition = formInfo.GetXmlDefinition(); - } - else - { - target.ClassFormDefinition = new FormInfo().GetXmlDefinition(); - } - } - - private DataClassInfo PatchDataClassInfo(DataClassInfo dataClass, out string? oldPrimaryKeyName, out string? documentNameField) - { - oldPrimaryKeyName = null; - documentNameField = null; - if (dataClass.ClassType is ClassType.CONTENT_TYPE) - { - var fi = new FormInfo(dataClass.ClassFormDefinition); - var tableName = dataClass.ClassTableName; - var contentTypeManager = Service.Resolve(); - contentTypeManager.Initialize(dataClass); - if (!string.IsNullOrWhiteSpace(tableName)) - { - dataClass.ClassTableName = tableName; - } - var nfi = new FormInfo(dataClass.ClassFormDefinition); - - foreach (var dataDefinitionItem in fi.GetFormElements(true, true) ?? new()) - { - if (dataDefinitionItem is FormFieldInfo ffi) - { - if (ffi is { PrimaryKey: true }) - { - oldPrimaryKeyName = ffi.Name; - continue; - } - - if (ffi.DataType.Equals("contentitems", StringComparison.InvariantCultureIgnoreCase)) - { - ffi.DataType = "contentitemreference"; - if (!ffi.AllowEmpty) - { - ffi.ValidationRuleConfigurationsXmlData = AppendRequiredValidationRule(ffi.ValidationRuleConfigurationsXmlData); - } - } - - if (ffi.DataType.Equals("pages", StringComparison.InvariantCultureIgnoreCase)) - { - ffi.DataType = "webpages"; - } - - if (string.IsNullOrWhiteSpace(ffi.Settings["controlname"] as string)) - { - ffi.Visible = false; - } - } - - nfi.AddFormItem(dataDefinitionItem); - } - - Debug.WriteLineIf(oldPrimaryKeyName == null, $"WARN: old PK is null for class '{dataClass.ClassName}'"); - - AppendDocumentNameField(nfi, dataClass.ClassName, out documentNameField); - - dataClass.ClassFormDefinition = nfi.GetXmlDefinition(); - - return dataClass; - } - - return dataClass; - } - - public static string? GetLegacyDocumentName(FormInfo nfi, string className) - { - if (nfi.GetFields(true, true, true).FirstOrDefault(f => GuidHelper.CreateDocumentNameFieldGuid($"documentname|{className}").Equals(f.Guid)) is { } foundField) - { - return foundField.Name; - } - else - { - return null; - } - } - - private static void AppendDocumentNameField(FormInfo nfi, string className, out string documentNameField) - { - if (GetLegacyDocumentName(nfi, className) is { } fieldName) - { - documentNameField = fieldName; - return; - } - - // no DocumentName in v27, we supply one in migration - documentNameField = "DocumentName"; - var i = 0; - while (nfi.GetFormField(documentNameField) is not null) - { - documentNameField = $"DocumentName{++i}"; - } - - nfi.AddFormItem(new FormFieldInfo - { - Caption = "Page name", // as in v26.x.x - Name = documentNameField, - AllowEmpty = false, - DataType = "text", - Size = 100, - Precision = 0, - DefaultValue = null, - Guid = GuidHelper.CreateDocumentNameFieldGuid($"documentname|{className}"), - System = false, // no longer system field, system doesn't rely on this field anymore - Settings = { { "controlname", "Kentico.Administration.TextInput" } } - }); - } - - private const string REQUIRED_RULE_IDENTIFIER = "Kentico.Administration.RequiredValue"; - - private string AppendRequiredValidationRule(string rulesXml) - { - if (string.IsNullOrWhiteSpace(rulesXml)) - { - return - @"Kentico.Administration.RequiredValue"; - } - - XmlDocument document = new XmlDocument(); - document.LoadXml($"{rulesXml}"); - var mbIdentifierNodes = document.SelectNodes("//ValidationRuleIdentifier"); - - if (mbIdentifierNodes != null) - { - if (mbIdentifierNodes.Cast().Any(identifierNode => identifierNode is { InnerText: REQUIRED_RULE_IDENTIFIER })) - { - return rulesXml; - } - } - - const string RULE_PROTOTYPE = - @"Kentico.Administration.RequiredValue"; - var prototype = new XmlDocument(); - prototype.LoadXml(RULE_PROTOTYPE); - - Debug.Assert(prototype.FirstChild != null, "prototype.FirstChild != null"); - var oNode = prototype.FirstChild.CloneNode(true); - - Debug.Assert(document.FirstChild != null, "document.FirstChild != null"); - document.FirstChild.AppendChild(document.ImportNode(oNode, true)); - return document.FirstChild.InnerXml; - } -} \ No newline at end of file +using System.Diagnostics; +using System.Xml; + +using CMS.ContentEngine; +using CMS.Core; +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api.Services.CmsClass; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public class CmsClassMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + FieldMigrationService fieldMigrationService, + ModelFacade modelFacade +) + : EntityMapperBase(logger, + primaryKeyMappingContext, protocol) +{ + private const string REQUIRED_RULE_IDENTIFIER = "Kentico.Administration.RequiredValue"; + + protected override DataClassInfo? CreateNewInstance(ICmsClass source, MappingHelper mappingHelper, AddFailure addFailure) => + DataClassInfo.New(); + + protected override DataClassInfo MapInternal(ICmsClass source, DataClassInfo target, bool newInstance, MappingHelper mappingHelper, + AddFailure addFailure) + { + target.ClassDisplayName = source.ClassDisplayName; + target.ClassName = source.ClassName; + + bool isCustomizableSystemClass = false; + bool classIsCustom = true; + var classResource = modelFacade.SelectById(source.ClassResourceID); + if (classResource?.ResourceName is { } resourceName) + { + isCustomizableSystemClass = source.ClassShowAsSystemTable.GetValueOrDefault(false) && + K12SystemResource.All.Contains(resourceName); + + classIsCustom = !K12SystemResource.All.Contains(resourceName); + + logger.LogDebug("{ClassName} is {@Properties}", source.ClassName, new { isCustomizableSystemClass, classIsCustom, source.ClassResourceID, classResource?.ResourceName }); + } + + MapFormDefinitionFields(source, target, isCustomizableSystemClass, classIsCustom); + + target.ClassHasUnmanagedDbSchema = false; + if (!string.IsNullOrWhiteSpace(source.ClassTableName)) + { + target.ClassTableName = source.ClassTableName; + } + + target.ClassShowTemplateSelection = source.ClassShowTemplateSelection.UseKenticoDefault(); + target.ClassLastModified = source.ClassLastModified; + target.ClassGUID = source.ClassGUID; + + if (source.ClassContactMapping != null) + { + var mapInfo = new FormInfo(source.ClassContactMapping); + var newMappings = new FormInfo(); + if (mapInfo.ItemsList.Count > 0) + { + var ffiLookup = mapInfo.ItemsList.OfType().ToLookup(f => f.MappedToField, f => f); + + foreach (var formFieldInfos in ffiLookup) + { + newMappings.AddFormItem(formFieldInfos.First()); + } + } + + target.ClassContactMapping = newMappings.GetXmlDefinition(); + } + + target.ClassContactOverwriteEnabled = source.ClassContactOverwriteEnabled.UseKenticoDefault(); + target.ClassConnectionString = source.ClassConnectionString; + target.ClassDefaultObjectType = source.ClassDefaultObjectType; + target.ClassCodeGenerationSettings = source.ClassCodeGenerationSettings; + target.ClassIconClass = source.ClassIconClass; + if (source.ClassIsDocumentType) + { + target.ClassWebPageHasUrl = source switch + { + CmsClassK13 { ClassHasURL: false } => false, + _ => true + }; + } + + if (mappingHelper.TranslateIdAllowNulls(c => c.ResourceID, source.ClassResourceID, out int? resourceId)) + { + if (resourceId.HasValue) + { + target.ClassResourceID = resourceId.Value; + } + } + + switch (source) + { + // Special + case { ClassName: { } className } when + className.Equals("cms.site", StringComparison.InvariantCultureIgnoreCase) || + className.Equals("cms.root", StringComparison.InvariantCultureIgnoreCase) + : + { + throw new Exception("Unable to map obsolete dataclass"); + return target; + } + // Target Other,null + // Target System,null + case not null when target is { ClassType: ClassType.OTHER or ClassType.SYSTEM_TABLE }: + { + break; + } + + default: + break; + } + + switch (source) + { + // Custom class from custom resource? + case + { + ClassIsForm: false or null, + ClassIsDocumentType: false, + ClassResourceID: { } classResourceId + }: + { + target.ClassType = ClassType.OTHER; + target.ClassContentTypeType = null; + + target = PatchDataClassInfo(target, out string? oldPrimaryKeyName, out string? documentNameField); + + break; + } + + // Target Form,null + case + { + ClassIsDocumentType: false, + ClassIsCoupledClass: true, + ClassIsForm: true + // ClassIsPage: false + } + : + { + target.ClassType = ClassType.FORM; + target.ClassContentTypeType = ""; + + break; + } + + // Target Content,Reusable + case + { + ClassIsDocumentType: false, + ClassIsForm: false or null, + ClassShowAsSystemTable: false, + ClassIsCustomTable: false + // ClassIsPage: false + }: + { + target.ClassType = ClassType.CONTENT_TYPE; + target.ClassContentTypeType = ClassContentTypeType.REUSABLE; + + target = PatchDataClassInfo(target, out string? oldPrimaryKeyName, out string? documentNameField); + break; + } + + // Target Content,Website + case { ClassName: { } className } when className.Equals("cms.folder", StringComparison.InvariantCultureIgnoreCase): + case + { + ClassIsDocumentType: true, + ClassIsForm: false or null + // ClassIsPage: true + }: + { + target.ClassType = ClassType.CONTENT_TYPE; + target.ClassContentTypeType = ClassContentTypeType.WEBSITE; + + target = PatchDataClassInfo(target, out string? oldPrimaryKeyName, out string? documentNameField); + break; + } + + default: + break; + } + + return target; + } + + private void MapFormDefinitionFields(ICmsClass source, DataClassInfo target, bool isCustomizableSystemClass, bool classIsCustom) + { + if (!string.IsNullOrWhiteSpace(source.ClassFormDefinition)) + { + var patcher = new FormDefinitionPatcher( + logger, + source.ClassFormDefinition, + fieldMigrationService, + source.ClassIsForm.GetValueOrDefault(false), + source.ClassIsDocumentType, + isCustomizableSystemClass, + classIsCustom + ); + + patcher.PatchFields(); + patcher.RemoveCategories(); // TODO tk: 2022-10-11 remove when supported + + string? result = patcher.GetPatched(); + if (isCustomizableSystemClass) + { + result = FormHelper.MergeFormDefinitions(target.ClassFormDefinition, result); + } + + var formInfo = new FormInfo(result); + target.ClassFormDefinition = formInfo.GetXmlDefinition(); + } + else + { + target.ClassFormDefinition = new FormInfo().GetXmlDefinition(); + } + } + + private DataClassInfo PatchDataClassInfo(DataClassInfo dataClass, out string? oldPrimaryKeyName, out string? documentNameField) + { + oldPrimaryKeyName = null; + documentNameField = null; + if (dataClass.ClassType is ClassType.CONTENT_TYPE) + { + var fi = new FormInfo(dataClass.ClassFormDefinition); + string tableName = dataClass.ClassTableName; + var contentTypeManager = Service.Resolve(); + contentTypeManager.Initialize(dataClass); + if (!string.IsNullOrWhiteSpace(tableName)) + { + dataClass.ClassTableName = tableName; + } + + var nfi = new FormInfo(dataClass.ClassFormDefinition); + + foreach (var dataDefinitionItem in fi.GetFormElements(true, true) ?? []) + { + if (dataDefinitionItem is FormFieldInfo ffi) + { + if (ffi is { PrimaryKey: true }) + { + oldPrimaryKeyName = ffi.Name; + continue; + } + + if (ffi.DataType.Equals("contentitems", StringComparison.InvariantCultureIgnoreCase)) + { + ffi.DataType = "contentitemreference"; + if (!ffi.AllowEmpty) + { + ffi.ValidationRuleConfigurationsXmlData = AppendRequiredValidationRule(ffi.ValidationRuleConfigurationsXmlData); + } + } + + if (ffi.DataType.Equals("pages", StringComparison.InvariantCultureIgnoreCase)) + { + ffi.DataType = "webpages"; + } + + if (string.IsNullOrWhiteSpace(ffi.Settings["controlname"] as string)) + { + ffi.Visible = false; + } + } + + nfi.AddFormItem(dataDefinitionItem); + } + + Debug.WriteLineIf(oldPrimaryKeyName == null, $"WARN: old PK is null for class '{dataClass.ClassName}'"); + + AppendDocumentNameField(nfi, dataClass.ClassName, out documentNameField); + + dataClass.ClassFormDefinition = nfi.GetXmlDefinition(); + + return dataClass; + } + + return dataClass; + } + + public static string? GetLegacyDocumentName(FormInfo nfi, string className) + { + if (nfi.GetFields(true, true).FirstOrDefault(f => GuidHelper.CreateDocumentNameFieldGuid($"documentname|{className}").Equals(f.Guid)) is { } foundField) + { + return foundField.Name; + } + + return null; + } + + private static void AppendDocumentNameField(FormInfo nfi, string className, out string documentNameField) + { + if (GetLegacyDocumentName(nfi, className) is { } fieldName) + { + documentNameField = fieldName; + return; + } + + // no DocumentName in v27, we supply one in migration + documentNameField = "DocumentName"; + int i = 0; + while (nfi.GetFormField(documentNameField) is not null) + { + documentNameField = $"DocumentName{++i}"; + } + + nfi.AddFormItem(new FormFieldInfo + { + Caption = "Page name", // as in v26.x.x + Name = documentNameField, + AllowEmpty = false, + DataType = "text", + Size = 100, + Precision = 0, + DefaultValue = null, + Guid = GuidHelper.CreateDocumentNameFieldGuid($"documentname|{className}"), + System = false, // no longer system field, system doesn't rely on this field anymore + Settings = { { "controlname", "Kentico.Administration.TextInput" } } + }); + } + + private string AppendRequiredValidationRule(string rulesXml) + { + if (string.IsNullOrWhiteSpace(rulesXml)) + { + return + @"Kentico.Administration.RequiredValue"; + } + + var document = new XmlDocument(); + document.LoadXml($"{rulesXml}"); + var mbIdentifierNodes = document.SelectNodes("//ValidationRuleIdentifier"); + + if (mbIdentifierNodes != null) + { + if (mbIdentifierNodes.Cast().Any(identifierNode => identifierNode is { InnerText: REQUIRED_RULE_IDENTIFIER })) + { + return rulesXml; + } + } + + const string RULE_PROTOTYPE = + @"Kentico.Administration.RequiredValue"; + var prototype = new XmlDocument(); + prototype.LoadXml(RULE_PROTOTYPE); + + Debug.Assert(prototype.FirstChild != null, "prototype.FirstChild != null"); + var oNode = prototype.FirstChild.CloneNode(true); + + Debug.Assert(document.FirstChild != null, "document.FirstChild != null"); + document.FirstChild.AppendChild(document.ImportNode(oNode, true)); + return document.FirstChild.InnerXml; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs index fdf498fb..f38ed79a 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/CmsFormMapper.cs @@ -1,123 +1,133 @@ -namespace Migration.Toolkit.Source.Mappers; - -using CMS.FormEngine; -using CMS.OnlineForms; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -public class CmsFormMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override BizFormInfo? CreateNewInstance(ICmsForm source, MappingHelper mappingHelper, AddFailure addFailure) - { - var newBizFormInfo = BizFormInfo.New(); - newBizFormInfo.FormGUID = source.FormGUID; - return newBizFormInfo; - } - - protected override BizFormInfo MapInternal(ICmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - target.FormAccess = source.FormAccess.AsEnum(); - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormLastModified = source.FormLastModified; - switch (source) - { - case CmsFormK11 s: - { - target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); - break; - } - case CmsFormK12 s: - { - target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); - target.FormBuilderLayout = s.FormBuilderLayout; - break; - } - case CmsFormK13 s: - { - target.FormLogActivity = s.FormLogActivity; - target.FormBuilderLayout = s.FormBuilderLayout; - break; - } - } - if (mappingHelper.TranslateRequiredId(c => c.ClassID, source.FormClassID, out var formClassId)) - { - target.FormClassID = formClassId; - } - - return target; - } -} - -public class CmsFormMapperEf : EntityMapperBase -{ - public CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override Migration.Toolkit.KXP.Models.CmsForm? CreateNewInstance(ICmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override Migration.Toolkit.KXP.Models.CmsForm MapInternal(ICmsForm source, Migration.Toolkit.KXP.Models.CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - // target.FormSendToEmail = source.FormSendToEmail; - // target.FormSendFromEmail = source.FormSendFromEmail; - // target.FormEmailSubject = source.FormEmailSubject; - // target.FormEmailTemplate = source.FormEmailTemplate; - // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - // target.FormConfirmationEmailField = source.FormConfirmationEmailField; - // target.FormConfirmationTemplate = source.FormConfirmationTemplate; - // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; - // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; - target.FormAccess = source.FormAccess; - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormGuid = source.FormGUID; - target.FormLastModified = source.FormLastModified; - switch (source) - { - case CmsFormK11 s: - { - target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); - break; - } - case CmsFormK12 s: - { - target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); - target.FormBuilderLayout = s.FormBuilderLayout; - break; - } - case CmsFormK13 s: - { - target.FormLogActivity = s.FormLogActivity; - target.FormBuilderLayout = s.FormBuilderLayout; - break; - } - } - - // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitMode = source.FormAfterSubmitMode; - // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitRelatedValue = source.FormAfterSubmitRelatedValue; - - if (mappingHelper.TranslateRequiredId(c => c.ClassID, source.FormClassID, out var classId)) - { - target.FormClassId = classId; - } - - return target; - } -} \ No newline at end of file +using CMS.FormEngine; +using CMS.OnlineForms; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Models; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public class CmsFormMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override BizFormInfo? CreateNewInstance(ICmsForm source, MappingHelper mappingHelper, AddFailure addFailure) + { + var newBizFormInfo = BizFormInfo.New(); + newBizFormInfo.FormGUID = source.FormGUID; + return newBizFormInfo; + } + + protected override BizFormInfo MapInternal(ICmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + target.FormAccess = source.FormAccess.AsEnum(); + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormLastModified = source.FormLastModified; + switch (source) + { + case CmsFormK11 s: + { + target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); + break; + } + case CmsFormK12 s: + { + target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); + target.FormBuilderLayout = s.FormBuilderLayout; + break; + } + case CmsFormK13 s: + { + target.FormLogActivity = s.FormLogActivity; + target.FormBuilderLayout = s.FormBuilderLayout; + break; + } + + default: + break; + } + + if (mappingHelper.TranslateRequiredId(c => c.ClassID, source.FormClassID, out int formClassId)) + { + target.FormClassID = formClassId; + } + + return target; + } +} + +public class CmsFormMapperEf : EntityMapperBase +{ + public CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CmsForm? CreateNewInstance(ICmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsForm MapInternal(ICmsForm source, CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + // target.FormSendToEmail = source.FormSendToEmail; + // target.FormSendFromEmail = source.FormSendFromEmail; + // target.FormEmailSubject = source.FormEmailSubject; + // target.FormEmailTemplate = source.FormEmailTemplate; + // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + // target.FormConfirmationEmailField = source.FormConfirmationEmailField; + // target.FormConfirmationTemplate = source.FormConfirmationTemplate; + // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; + // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; + target.FormAccess = source.FormAccess; + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormGuid = source.FormGUID; + target.FormLastModified = source.FormLastModified; + switch (source) + { + case CmsFormK11 s: + { + target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); + break; + } + case CmsFormK12 s: + { + target.FormLogActivity = s.FormLogActivity.UseKenticoDefault(); + target.FormBuilderLayout = s.FormBuilderLayout; + break; + } + case CmsFormK13 s: + { + target.FormLogActivity = s.FormLogActivity; + target.FormBuilderLayout = s.FormBuilderLayout; + break; + } + + default: + break; + } + + // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitMode = source.FormAfterSubmitMode; + // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitRelatedValue = source.FormAfterSubmitRelatedValue; + + if (mappingHelper.TranslateRequiredId(c => c.ClassID, source.FormClassID, out int classId)) + { + target.FormClassId = classId; + } + + return target; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs index a73af628..6aa5cd75 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/ContentItemMapper.cs @@ -1,839 +1,884 @@ -namespace Migration.Toolkit.Source.Mappers; - -using System.Diagnostics; -using CMS.ContentEngine; -using CMS.ContentEngine.Internal; -using CMS.FormEngine; -using CMS.MediaLibrary; -using CMS.Websites; -using Kentico.Components.Web.Mvc.FormComponents; -using Kentico.Xperience.UMT.Model; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Auxiliary; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services; -using Migration.Toolkit.Source.Services.Model; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -public record CmsTreeMapperSource( - ICmsTree CmsTree, - string SafeNodeName, - Guid SiteGuid, - Guid? NodeParentGuid, - Dictionary CultureToLanguageGuid, - string TargetFormDefinition, - string SourceFormDefinition, - List MigratedDocuments -); - -public class ContentItemMapper( - ILogger logger, - CoupledDataService coupledDataService, - ClassService classService, - AttachmentMigrator attachmentMigrator, - CmsRelationshipService relationshipService, - SourceInstanceContext sourceInstanceContext, - FieldMigrationService fieldMigrationService, - KxpMediaFileFacade mediaFileFacade, - ModelFacade modelFacade, - ReusableSchemaService reusableSchemaService, - DeferredPathService deferredPathService -) : UmtMapperBase -{ - private const string CLASS_FIELD_CONTROL_NAME = "controlname"; - - protected override IEnumerable MapInternal(CmsTreeMapperSource source) - { - var (cmsTree, safeNodeName, siteGuid, nodeParentGuid, cultureToLanguageGuid, targetFormDefinition, sourceFormDefinition, migratedDocuments) = source; - - var nodeClass = modelFacade.SelectById(cmsTree.NodeClassID); - if (nodeClass == null) - { - throw new InvalidOperationException($"Fatal: node class is missing, class id '{cmsTree.NodeClassID}'"); - } - - var contentItemGuid = cmsTree.NodeGUID; - yield return new ContentItemModel - { - ContentItemGUID = contentItemGuid, - ContentItemName = safeNodeName, - ContentItemIsReusable = false, // page is not reusable - ContentItemIsSecured = cmsTree.IsSecuredNode ?? false, - ContentItemDataClassGuid = nodeClass.ClassGUID, - ContentItemChannelGuid = siteGuid, - }; - - var websiteChannelInfo = WebsiteChannelInfoProvider.ProviderObject.Get(siteGuid); - var treePathConvertor = TreePathConvertor.GetSiteConverter(websiteChannelInfo.WebsiteChannelID); - var (treePathIsDifferent, treePath) = treePathConvertor.ConvertAndEnsureUniqueness(cmsTree.NodeAliasPath).GetAwaiter().GetResult(); - if (treePathIsDifferent) - { - logger.LogInformation($"Original node alias path '{cmsTree.NodeAliasPath}' of '{cmsTree.NodeName}' item was converted to '{treePath}' since the value does not allow original range of allowed characters."); - } - - foreach (var cmsDocument in migratedDocuments) - { - if (!cultureToLanguageGuid.TryGetValue(cmsDocument.DocumentCulture, out var languageGuid)) - // TODO tomas.krch: 2023-11-15 WARN about skipped document - continue; - - var hasDraft = cmsDocument.DocumentPublishedVersionHistoryID is not null && - cmsDocument.DocumentPublishedVersionHistoryID != cmsDocument.DocumentCheckedOutVersionHistoryID; - - var checkoutVersion = hasDraft - ? modelFacade.SelectById(cmsDocument.DocumentCheckedOutVersionHistoryID) - : null; - - var draftMigrated = false; - if (checkoutVersion is { PublishFrom: null } draftVersion) - { - List? migratedDraft = null; - try - { - migratedDraft = MigrateDraft(draftVersion, cmsTree, sourceFormDefinition, targetFormDefinition, contentItemGuid, languageGuid, nodeClass, websiteChannelInfo).ToList(); - draftMigrated = true; - } - catch - { - logger.LogWarning("Failed to migrate checkout version of document with DocumentID={CmsDocumentDocumentId} VersionHistoryID={CmsDocumentDocumentCheckedOutVersionHistoryId}", - cmsDocument.DocumentID, cmsDocument.DocumentCheckedOutVersionHistoryID); - draftMigrated = false; - } - - if (migratedDraft != null) - { - foreach (var umtModel in migratedDraft) - { - yield return umtModel; - } - } - } - - var versionStatus = cmsDocument switch - { - { DocumentIsArchived: true } => VersionStatus.Archived, - { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: null } => VersionStatus.Published, - { DocumentPublishedVersionHistoryID: { } pubId, DocumentCheckedOutVersionHistoryID: { } chId } when pubId <= chId => VersionStatus.Published, - { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: not null } => VersionStatus.InitialDraft, - _ => draftMigrated ? VersionStatus.Published : VersionStatus.InitialDraft - }; - - string? contentItemCommonDataPageBuilderWidgets = null; - string? contentItemCommonDataPageTemplateConfiguration = null; - switch (cmsDocument) - { - case CmsDocumentK11: - { - break; - } - case CmsDocumentK12 doc: - { - contentItemCommonDataPageBuilderWidgets = doc.DocumentPageBuilderWidgets; - contentItemCommonDataPageTemplateConfiguration = doc.DocumentPageTemplateConfiguration; - break; - } - case CmsDocumentK13 doc: - { - contentItemCommonDataPageBuilderWidgets = doc.DocumentPageBuilderWidgets; - contentItemCommonDataPageTemplateConfiguration = doc.DocumentPageTemplateConfiguration; - break; - } - } - - PatchJsonDefinitions(source.CmsTree.NodeSiteID, ref contentItemCommonDataPageTemplateConfiguration, ref contentItemCommonDataPageBuilderWidgets, out var ndp); - - var commonDataModel = new ContentItemCommonDataModel - { - ContentItemCommonDataGUID = cmsDocument.DocumentGUID ?? throw new InvalidOperationException($"DocumentGUID is null"), - ContentItemCommonDataContentItemGuid = contentItemGuid, - ContentItemCommonDataContentLanguageGuid = languageGuid, // DocumentCulture -> language entity needs to be created and its ID used here - ContentItemCommonDataVersionStatus = versionStatus, - ContentItemCommonDataIsLatest = !draftMigrated, // Flag for latest record to know what to retrieve for the UI - ContentItemCommonDataPageBuilderWidgets = contentItemCommonDataPageBuilderWidgets, - ContentItemCommonDataPageTemplateConfiguration = contentItemCommonDataPageTemplateConfiguration, - }; - - if (ndp) - { - deferredPathService.AddPatch( - commonDataModel.ContentItemCommonDataGUID ?? throw new InvalidOperationException("DocumentGUID is null"), - nodeClass.ClassName, - websiteChannelInfo.WebsiteChannelID - ); - } - - var dataModel = new ContentItemDataModel - { - ContentItemDataGUID = commonDataModel.ContentItemCommonDataGUID, - ContentItemDataCommonDataGuid = commonDataModel.ContentItemCommonDataGUID, - ContentItemContentTypeName = nodeClass.ClassName - }; - - var fi = new FormInfo(targetFormDefinition); - if (nodeClass.ClassIsCoupledClass) - { - var sfi = new FormInfo(sourceFormDefinition); - var primaryKeyName = ""; - foreach (var sourceFieldInfo in sfi.GetFields(true, true)) - { - if (sourceFieldInfo.PrimaryKey) - { - primaryKeyName = sourceFieldInfo.Name; - } - } - - if (string.IsNullOrWhiteSpace(primaryKeyName)) - { - throw new Exception("Error, unable to find coupled data primary key"); - } - - var commonFields = UnpackReusableFieldSchemas(fi.GetFields()).ToArray(); - var sourceColumns = commonFields - .Select(cf => ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, cf.Name)) - .Union(fi.GetColumnNames(false)) - .Except([CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName)]) - .ToList(); - - var coupledDataRow = coupledDataService.GetSourceCoupledDataRow(nodeClass.ClassTableName, primaryKeyName, cmsDocument.DocumentForeignKeyValue); - MapCoupledDataFieldValues(dataModel.CustomProperties, - (columnName) => coupledDataRow?[columnName], - columnName => coupledDataRow?.ContainsKey(columnName) ?? false, - cmsTree, cmsDocument.DocumentID, sourceColumns, sfi, fi, false, nodeClass - ); - - foreach (var formFieldInfo in commonFields) - { - var originalFieldName = ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, formFieldInfo.Name); - if (dataModel.CustomProperties.TryGetValue(originalFieldName, out object? value)) - { - commonDataModel.CustomProperties ??= []; - logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' populated", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); - commonDataModel.CustomProperties[formFieldInfo.Name] = value; - dataModel.CustomProperties.Remove(originalFieldName); - } - else - { - logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' missing", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); - } - } - } - - if (CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName) is { } legacyDocumentNameFieldName) - { - if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(nodeClass.ClassName)) - { - var fieldName = ReusableSchemaService.GetUniqueFieldName(nodeClass.ClassName, legacyDocumentNameFieldName); - commonDataModel.CustomProperties.Add(fieldName, cmsDocument.DocumentName); - } - else - { - dataModel.CustomProperties.Add(legacyDocumentNameFieldName, cmsDocument.DocumentName); - } - } - - yield return commonDataModel; - yield return dataModel; - - Guid? documentCreatedByUserGuid = null; - if (modelFacade.TrySelectGuid(cmsDocument.DocumentCreatedByUserID, out var createdByUserGuid)) - { - documentCreatedByUserGuid = createdByUserGuid; - } - - Guid? documentModifiedByUserGuid = null; - if (modelFacade.TrySelectGuid(cmsDocument.DocumentModifiedByUserID, out var modifiedByUserGuid)) - { - documentModifiedByUserGuid = modifiedByUserGuid; - } - - var languageMetadataInfo = new ContentItemLanguageMetadataModel - { - ContentItemLanguageMetadataGUID = cmsDocument.DocumentGUID, - ContentItemLanguageMetadataContentItemGuid = contentItemGuid, - ContentItemLanguageMetadataDisplayName = cmsDocument.DocumentName, // For the admin UI only - ContentItemLanguageMetadataLatestVersionStatus = draftMigrated ? VersionStatus.Draft : versionStatus, // That's the latest status of th item for admin optimization - ContentItemLanguageMetadataCreatedWhen = cmsDocument.DocumentCreatedWhen, // DocumentCreatedWhen - ContentItemLanguageMetadataModifiedWhen = cmsDocument.DocumentModifiedWhen, // DocumentModifiedWhen - ContentItemLanguageMetadataCreatedByUserGuid = documentCreatedByUserGuid, - ContentItemLanguageMetadataModifiedByUserGuid = documentModifiedByUserGuid, - // logic inaccessible, not supported - // ContentItemLanguageMetadataHasImageAsset = ContentItemAssetHasImageArbiter.HasImage(contentItemDataInfo), // This is for admin UI optimization - set to true if latest version contains a field with an image asset - ContentItemLanguageMetadataHasImageAsset = false, - ContentItemLanguageMetadataContentLanguageGuid = languageGuid // DocumentCulture -> language entity needs to be created and its ID used here - }; - yield return languageMetadataInfo; - } - - // mapping of linked nodes is not supported - Debug.Assert(cmsTree.NodeLinkedNodeID == null, "cmsTree.NodeLinkedNodeId == null"); - Debug.Assert(cmsTree.NodeLinkedNodeSiteID == null, "cmsTree.NodeLinkedNodeSiteId == null"); - - yield return new WebPageItemModel - { - WebPageItemParentGuid = nodeParentGuid, // NULL => under root - WebPageItemGUID = contentItemGuid, - WebPageItemName = safeNodeName, - WebPageItemTreePath = treePath, - WebPageItemWebsiteChannelGuid = siteGuid, - WebPageItemContentItemGuid = contentItemGuid, - WebPageItemOrder = cmsTree.NodeOrder ?? 0 // 0 is nullish value - }; - } - - private void PatchJsonDefinitions(int sourceSiteId, ref string? pageTemplateConfiguration, ref string? pageBuilderWidgets, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - if (sourceInstanceContext.HasInfo) - { - if (pageTemplateConfiguration != null) - { - var pageTemplateConfigurationObj = JsonConvert.DeserializeObject(pageTemplateConfiguration); - if (pageTemplateConfigurationObj?.Identifier != null) - { - logger.LogTrace("Walk page template configuration {Identifier}", pageTemplateConfigurationObj.Identifier); - - var pageTemplateConfigurationFcs = - sourceInstanceContext.GetPageTemplateFormComponents(sourceSiteId, pageTemplateConfigurationObj?.Identifier); - if (pageTemplateConfigurationObj.Properties is { Count: > 0 }) - { - WalkProperties(pageTemplateConfigurationObj.Properties, pageTemplateConfigurationFcs, out var ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - - pageTemplateConfiguration = JsonConvert.SerializeObject(pageTemplateConfigurationObj); - } - } - - if (pageBuilderWidgets != null) - { - var areas = JsonConvert.DeserializeObject(pageBuilderWidgets); - if (areas?.EditableAreas is { Count: > 0 }) - { - WalkAreas(sourceSiteId, areas.EditableAreas, out var ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - - pageBuilderWidgets = JsonConvert.SerializeObject(areas); - } - } - } - - private IEnumerable MigrateDraft(ICmsVersionHistory checkoutVersion, ICmsTree cmsTree, string sourceFormClassDefinition, string targetFormDefinition, Guid contentItemGuid, - Guid contentLanguageGuid, ICmsClass nodeClass, WebsiteChannelInfo websiteChannelInfo) - { - var adapter = new NodeXmlAdapter(checkoutVersion.NodeXML); - - ContentItemCommonDataModel? commonDataModel = null; - ContentItemDataModel? dataModel = null; - try - { - var pageTemplateConfiguration = adapter.DocumentPageTemplateConfiguration; - var pageBuildWidgets = adapter.DocumentPageBuilderWidgets; - PatchJsonDefinitions(checkoutVersion.NodeSiteID, ref pageTemplateConfiguration, ref pageBuildWidgets, out var ndp); - - #region Find existing guid - - var contentItemCommonDataGuid = Guid.NewGuid(); - var contentItemInfo = ContentItemInfo.Provider.Get() - .WhereEquals(nameof(ContentItemInfo.ContentItemGUID), contentItemGuid) - .FirstOrDefault(); - if (contentItemInfo != null) - { - var contentItems = ContentItemCommonDataInfo.Provider.Get() - .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentItemID), contentItemInfo.ContentItemID) - .ToList() - ; - - var existingDraft = contentItems.FirstOrDefault(x => x.ContentItemCommonDataVersionStatus == VersionStatus.Draft); - if (existingDraft is { ContentItemCommonDataGUID: { } existingGuid }) - { - contentItemCommonDataGuid = existingGuid; - } - } - - #endregion - - commonDataModel = new ContentItemCommonDataModel - { - ContentItemCommonDataGUID = contentItemCommonDataGuid, // adapter.DocumentGUID ?? throw new InvalidOperationException($"DocumentGUID is null"), - ContentItemCommonDataContentItemGuid = contentItemGuid, - ContentItemCommonDataContentLanguageGuid = contentLanguageGuid, - ContentItemCommonDataVersionStatus = VersionStatus.Draft, - ContentItemCommonDataIsLatest = true, // Flag for latest record to know what to retrieve for the UI - ContentItemCommonDataPageBuilderWidgets = pageBuildWidgets, - ContentItemCommonDataPageTemplateConfiguration = pageTemplateConfiguration, - }; - - if (ndp) - { - - deferredPathService.AddPatch( - commonDataModel.ContentItemCommonDataGUID ?? throw new InvalidOperationException("DocumentGUID is null"), - nodeClass.ClassName, - websiteChannelInfo.WebsiteChannelID - ); - } - - dataModel = new ContentItemDataModel - { - ContentItemDataGUID = commonDataModel.ContentItemCommonDataGUID, - ContentItemDataCommonDataGuid = commonDataModel.ContentItemCommonDataGUID, - ContentItemContentTypeName = nodeClass.ClassName - }; - - if (nodeClass.ClassIsCoupledClass) - { - var fi = new FormInfo(targetFormDefinition); - var sfi = new FormInfo(sourceFormClassDefinition); - var primaryKeyName = ""; - foreach (var sourceFieldInfo in sfi.GetFields(true, true)) - { - if (sourceFieldInfo.PrimaryKey) - { - primaryKeyName = sourceFieldInfo.Name; - } - } - - if (string.IsNullOrWhiteSpace(primaryKeyName)) - { - throw new Exception("Error, unable to find coupled data primary key"); - } - - var commonFields = UnpackReusableFieldSchemas(fi.GetFields()).ToArray(); - var sourceColumns = commonFields - .Select(cf => ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, cf.Name)) - .Union(fi.GetColumnNames(false)) - .Except([CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName)]) - .ToList(); - - MapCoupledDataFieldValues(dataModel.CustomProperties, - s => adapter.GetValue(s), - s => adapter.HasValueSet(s) - , cmsTree, adapter.DocumentID, sourceColumns, sfi, fi, true, nodeClass); - - foreach (var formFieldInfo in commonFields) - { - var originalFieldName = ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, formFieldInfo.Name); - if (dataModel.CustomProperties.TryGetValue(originalFieldName, out object? value)) - { - commonDataModel.CustomProperties ??= []; - logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' populated", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); - commonDataModel.CustomProperties[formFieldInfo.Name] = value; - dataModel.CustomProperties.Remove(originalFieldName); - } - else - { - logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' missing", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); - } - } - } - - // supply document name - if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(nodeClass.ClassName)) - { - var fieldName = ReusableSchemaService.GetUniqueFieldName(nodeClass.ClassName, "DocumentName"); - commonDataModel.CustomProperties.Add(fieldName, adapter.DocumentName); - } - else - { - dataModel.CustomProperties.Add("DocumentName", adapter.DocumentName); - } - } - catch (Exception ex) - { - Debug.WriteLine($"Failed attempt to create draft from '{checkoutVersion}' {ex}"); - throw; - } - - if (dataModel != null && commonDataModel != null) - { - yield return commonDataModel; - yield return dataModel; - } - } - - #region "Page template & page widget walkers" - - private void WalkAreas(int siteId, List areas, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var area in areas) - { - logger.LogTrace("Walk area {Identifier}", area.Identifier); - - if (area.Sections is { Count: > 0 }) - { - WalkSections(siteId, area.Sections, out var ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - } - } - - private void WalkSections(int siteId, List sections, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var section in sections) - { - logger.LogTrace("Walk section {TypeIdentifier}|{Identifier}", section.TypeIdentifier, section.Identifier); - - // TODO tk: 2022-09-14 find other acronym for FormComponents - var sectionFcs = sourceInstanceContext.GetSectionFormComponents(siteId, section.TypeIdentifier); - WalkProperties(section.Properties, sectionFcs, out var ndp1); - needsDeferredPatch = ndp1 || needsDeferredPatch; - - if (section.Zones is { Count: > 0 }) - { - WalkZones(siteId, section.Zones, out var ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - } - } - - private void WalkZones(int siteId, List zones, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var zone in zones) - { - logger.LogTrace("Walk zone {Name}|{Identifier}", zone.Name, zone.Identifier); - - if (zone.Widgets is { Count: > 0 }) - { - WalkWidgets(siteId, zone.Widgets, out var ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - } - } - - private void WalkWidgets(int siteId, List widgets, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var widget in widgets) - { - logger.LogTrace("Walk widget {TypeIdentifier}|{Identifier}", widget.TypeIdentifier, widget.Identifier); - - var widgetFcs = sourceInstanceContext.GetWidgetPropertyFormComponents(siteId, widget.TypeIdentifier); - foreach (var variant in widget.Variants) - { - logger.LogTrace("Walk widget variant {Name}|{Identifier}", variant.Name, variant.Identifier); - - if (variant.Properties is { Count: > 0 }) - { - WalkProperties(variant.Properties, widgetFcs, out var ndp); - needsDeferredPatch = ndp || needsDeferredPatch; - } - } - } - } - - private void WalkProperties(JObject properties, List? formControlModels, out bool needsDeferredPatch) - { - needsDeferredPatch = false; - foreach (var (key, value) in properties) - { - logger.LogTrace("Walk property {Name}|{Identifier}", key, value?.ToString()); - - var editingFcm = formControlModels?.FirstOrDefault(x => x.PropertyName.Equals(key, StringComparison.InvariantCultureIgnoreCase)); - if (editingFcm != null) - { - if (FieldMappingInstance.BuiltInModel.NotSupportedInKxpLegacyMode - .SingleOrDefault(x => x.OldFormComponent == editingFcm.FormComponentIdentifier) is var (oldFormComponent, newFormComponent)) - { - - logger.LogTrace("Editing form component found {FormComponentName} => no longer supported {Replacement}", editingFcm.FormComponentIdentifier, newFormComponent); - - switch (oldFormComponent) - { - // case Kx13FormComponents.Kentico_PathSelector: - // { - // // new PathSelectorItem() - // break; - // } - case Kx13FormComponents.Kentico_AttachmentSelector when newFormComponent == FormComponents.AdminAssetSelectorComponent: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - properties[key] = JToken.FromObject(items.Select(x => new AssetRelatedItem { Identifier = x.FileGuid }).ToList()); - } - - logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); - break; - } - case Kx13FormComponents.Kentico_PageSelector when newFormComponent == FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - properties[key] = JToken.FromObject(items.Select(x => new WebPageRelatedItem { WebPageGuid = x.NodeGuid }).ToList()); - } - - logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); - break; - } - } - } - else if (FieldMappingInstance.BuiltInModel.SupportedInKxpLegacyMode.Contains(editingFcm.FormComponentIdentifier)) - { - // OK - logger.LogTrace("Editing form component found {FormComponentName} => supported in legacy mode", editingFcm.FormComponentIdentifier); - } - else - { - // unknown control, probably custom - logger.LogTrace("Editing form component found {FormComponentName} => custom or inlined component, don't forget to migrate code accordingly", editingFcm.FormComponentIdentifier); - } - } - - if ("NodeAliasPath".Equals(key, StringComparison.InvariantCultureIgnoreCase)) - { - needsDeferredPatch = true; - properties["TreePath"] = value; - properties.Remove(key); - } - } - } - - #endregion - - private void MapCoupledDataFieldValues( - Dictionary target, - Func getSourceValue, - Func containsSourceValue, - ICmsTree cmsTree, - int? documentId, - List newColumnNames, - FormInfo oldFormInfo, - FormInfo newFormInfo, - bool migratingFromVersionHistory, - ICmsClass nodeClass - ) - { - Debug.Assert(nodeClass.ClassTableName != null, "cmsTree.NodeClass.ClassTableName != null"); - - foreach (var columnName in newColumnNames) - { - if ( - columnName.Equals("ContentItemDataID", StringComparison.InvariantCultureIgnoreCase) || - columnName.Equals("ContentItemDataCommonDataID", StringComparison.InvariantCultureIgnoreCase) || - columnName.Equals("ContentItemDataGUID", StringComparison.InvariantCultureIgnoreCase) || - columnName.Equals(CmsClassMapper.GetLegacyDocumentName(newFormInfo, nodeClass.ClassName), StringComparison.InvariantCultureIgnoreCase) - ) - { - continue; - } - -#pragma warning disable CS0618 // Type or member is obsolete - if (oldFormInfo.GetFormField(columnName)?.External is true) -#pragma warning restore CS0618 // Type or member is obsolete - { - continue; - } - - if (!containsSourceValue(columnName)) - { - if (migratingFromVersionHistory) - { - logger.LogDebug("Value is not contained in source, field '{Field}' (possibly because version existed before field was added to class form)", columnName); - } - else - { - logger.LogWarning("Value is not contained in source, field '{Field}'", columnName); - } - - continue; - } - - - var field = oldFormInfo.GetFormField(columnName); - var controlName = field.Settings[CLASS_FIELD_CONTROL_NAME]?.ToString()?.ToLowerInvariant(); - - var value = getSourceValue(columnName); - target[columnName] = value; - - MediaFileInfo?[]? mfis = null; - bool hasMigratedMediaFile = false; - - var fieldMigration = fieldMigrationService.GetFieldMigration(field.DataType, controlName, columnName); - if (fieldMigration?.Actions?.Contains(TcaDirective.ConvertToAsset) ?? false) - { - if (value is string link && - MediaHelper.MatchMediaLink(link) is (true, var mediaLinkKind, var mediaKind, var path, var mediaGuid)) - { - if (mediaLinkKind == MediaLinkKind.Path) - { - // path needs to be converted to GUID - if (mediaKind == MediaKind.Attachment && path != null) - { - switch (attachmentMigrator.TryMigrateAttachmentByPath(path, $"__{columnName}")) - { - case (true, _, var mediaFileInfo, _): - { - mfis = new[] { mediaFileInfo }; - hasMigratedMediaFile = true; - break; - } - default: - { - logger.LogTrace("Unsuccessful attachment migration '{Field}': '{Value}'", columnName, path); - break; - } - } - } - - if (mediaKind == MediaKind.MediaFile) - { - // _mediaFileFacade.GetMediaFile() - // TODO tomas.krch: 2023-03-07 get media file by path - // attachmentDocument.DocumentNode.NodeAliasPath - } - } - - if (mediaGuid is { } mg) - { - if (mediaKind == MediaKind.Attachment && - attachmentMigrator.MigrateAttachment(mg, $"__{columnName}") is (_, _, var mediaFileInfo, _) { Success: true }) - { - mfis = new[] { mediaFileInfo }; - hasMigratedMediaFile = true; - logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}'", columnName, mg); - } - - if (mediaKind == MediaKind.MediaFile && mediaFileFacade.GetMediaFile(mg) is { } mfi) - { - mfis = new[] { mfi }; - hasMigratedMediaFile = true; - logger.LogTrace("MediaFile migrated from media file '{Field}': '{Value}'", columnName, mg); - } - } - } - else if (classService.GetFormControlDefinition(controlName) is { } formControl) - { - switch (formControl) - { - case { UserControlForFile: true }: - { - if (value is Guid attachmentGuid) - { - var (success, _, mediaFileInfo, mediaLibraryInfo) = attachmentMigrator.MigrateAttachment(attachmentGuid, $"__{columnName}"); - if (success && mediaFileInfo != null) - { - mfis = new[] { mediaFileInfo }; - hasMigratedMediaFile = true; - logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}'", columnName, attachmentGuid); - } - } - else if (value is string attachmentGuidStr && Guid.TryParse(attachmentGuidStr, out attachmentGuid)) - { - var (success, _, mediaFileInfo, mediaLibraryInfo) = attachmentMigrator.MigrateAttachment(attachmentGuid, $"__{columnName}"); - if (success && mediaFileInfo != null) - { - mfis = new[] { mediaFileInfo }; - hasMigratedMediaFile = true; - logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}' (parsed)", columnName, attachmentGuid); - } - } - - break; - } - case { UserControlForDocAttachments: true }: - { - if (documentId is { } docId) - { - var migratedAttachments = - attachmentMigrator.MigrateGroupedAttachments(docId, field.Guid, field.Name); - - mfis = migratedAttachments - .Where(x => x.MediaFileInfo != null) - .Select(x => x.MediaFileInfo).ToArray(); - hasMigratedMediaFile = true; - } - - break; - } - } - } - else - { - logger.LogWarning("Unable to map value based on selected migration '{Migration}', value: '{Value}'", fieldMigration, value); - continue; - } - - if (hasMigratedMediaFile && mfis is { Length: > 0 }) - { - target.SetValueAsJson(columnName, - mfis.Select(x => new AssetRelatedItem - { - Identifier = x.FileGUID, - Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth, }, - Name = x.FileName, - Size = x.FileSize - }) - ); - } - - continue; - } - - if (controlName != null) - { - if (fieldMigration.Actions?.Contains(TcaDirective.ConvertToPages) ?? false) - { - // relation to other document - var convertedRelation = relationshipService.GetNodeRelationships(cmsTree.NodeID, nodeClass.ClassName, field.Guid) - .Select(r => new WebPageRelatedItem { WebPageGuid = r.RightNode.NodeGUID }); - - target.SetValueAsJson(columnName, convertedRelation); - } - else - { - // leave as is - target[columnName] = value; - } - - if (fieldMigration.TargetFormComponent == "webpages") - { - if (value is string pageReferenceJson) - { - target[columnName] = pageReferenceJson.Replace("\"NodeGuid\"", "\"WebPageGuid\""); - } - } - } - else - { - target[columnName] = value; - } - } - } - - private static IEnumerable UnpackReusableFieldSchemas(IEnumerable schemaInfos) - { - using var siEnum = schemaInfos.GetEnumerator(); - - if (siEnum.MoveNext() && FormHelper.GetFormInfo(ContentItemCommonDataInfo.TYPEINFO.ObjectClassName, true) is { } cfi) - { - do - { - var fsi = siEnum.Current; - var formFieldInfos = cfi - .GetFields(true, true, true) - .Where(f => string.Equals(f.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY] as string, fsi.Guid.ToString(), - StringComparison.InvariantCultureIgnoreCase)); - - foreach (var formFieldInfo in formFieldInfos) - { - yield return formFieldInfo; - } - } while (siEnum.MoveNext()); - } - } -} \ No newline at end of file +using System.Diagnostics; + +using CMS.ContentEngine; +using CMS.ContentEngine.Internal; +using CMS.Core; +using CMS.Core.Internal; +using CMS.FormEngine; +using CMS.MediaLibrary; +using CMS.Websites; + +using Kentico.Xperience.UMT.Model; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Common.Services.Ipc; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Api.Services.CmsClass; +using Migration.Toolkit.Source.Auxiliary; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; +using Migration.Toolkit.Source.Services; +using Migration.Toolkit.Source.Services.Model; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Migration.Toolkit.Source.Mappers; + +public record CmsTreeMapperSource( + ICmsTree CmsTree, + string SafeNodeName, + Guid SiteGuid, + Guid? NodeParentGuid, + Dictionary CultureToLanguageGuid, + string TargetFormDefinition, + string SourceFormDefinition, + List MigratedDocuments +); + +public class ContentItemMapper( + ILogger logger, + CoupledDataService coupledDataService, + ClassService classService, + AttachmentMigrator attachmentMigrator, + CmsRelationshipService relationshipService, + SourceInstanceContext sourceInstanceContext, + FieldMigrationService fieldMigrationService, + KxpMediaFileFacade mediaFileFacade, + ModelFacade modelFacade, + ReusableSchemaService reusableSchemaService, + DeferredPathService deferredPathService, + SpoiledGuidContext spoiledGuidContext +) : UmtMapperBase +{ + private const string CLASS_FIELD_CONTROL_NAME = "controlname"; + + protected override IEnumerable MapInternal(CmsTreeMapperSource source) + { + (var cmsTree, string safeNodeName, var siteGuid, var nodeParentGuid, var cultureToLanguageGuid, string targetFormDefinition, string sourceFormDefinition, var migratedDocuments) = source; + + var nodeClass = modelFacade.SelectById(cmsTree.NodeClassID) ?? throw new InvalidOperationException($"Fatal: node class is missing, class id '{cmsTree.NodeClassID}'"); + + var contentItemGuid = spoiledGuidContext.EnsureNodeGuid(cmsTree.NodeGUID, cmsTree.NodeSiteID, cmsTree.NodeID); + yield return new ContentItemModel + { + ContentItemGUID = contentItemGuid, + ContentItemName = safeNodeName, + ContentItemIsReusable = false, // page is not reusable + ContentItemIsSecured = cmsTree.IsSecuredNode ?? false, + ContentItemDataClassGuid = nodeClass.ClassGUID, + ContentItemChannelGuid = siteGuid + }; + + var websiteChannelInfo = WebsiteChannelInfoProvider.ProviderObject.Get(siteGuid); + var treePathConvertor = TreePathConvertor.GetSiteConverter(websiteChannelInfo.WebsiteChannelID); + (bool treePathIsDifferent, string treePath) = treePathConvertor.ConvertAndEnsureUniqueness(cmsTree.NodeAliasPath).GetAwaiter().GetResult(); + if (treePathIsDifferent) + { + logger.LogInformation($"Original node alias path '{cmsTree.NodeAliasPath}' of '{cmsTree.NodeName}' item was converted to '{treePath}' since the value does not allow original range of allowed characters."); + } + + foreach (var cmsDocument in migratedDocuments) + { + if (!cultureToLanguageGuid.TryGetValue(cmsDocument.DocumentCulture, out var languageGuid)) + { + // TODO tomas.krch: 2023-11-15 WARN about skipped document + continue; + } + + bool hasDraft = cmsDocument.DocumentPublishedVersionHistoryID is not null && + cmsDocument.DocumentPublishedVersionHistoryID != cmsDocument.DocumentCheckedOutVersionHistoryID; + + var checkoutVersion = hasDraft + ? modelFacade.SelectById(cmsDocument.DocumentCheckedOutVersionHistoryID) + : null; + + bool draftMigrated = false; + if (checkoutVersion is { PublishFrom: null } draftVersion) + { + List? migratedDraft = null; + try + { + migratedDraft = MigrateDraft(draftVersion, cmsTree, sourceFormDefinition, targetFormDefinition, contentItemGuid, languageGuid, nodeClass, websiteChannelInfo).ToList(); + draftMigrated = true; + } + catch + { + logger.LogWarning("Failed to migrate checkout version of document with DocumentID={CmsDocumentDocumentId} VersionHistoryID={CmsDocumentDocumentCheckedOutVersionHistoryId}", + cmsDocument.DocumentID, cmsDocument.DocumentCheckedOutVersionHistoryID); + draftMigrated = false; + } + + if (migratedDraft != null) + { + foreach (var umtModel in migratedDraft) + { + yield return umtModel; + } + } + } + + var versionStatus = cmsDocument switch + { + { DocumentIsArchived: true } => VersionStatus.Unpublished, + { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: null } => VersionStatus.Published, + { DocumentPublishedVersionHistoryID: { } pubId, DocumentCheckedOutVersionHistoryID: { } chId } when pubId <= chId => VersionStatus.Published, + { DocumentPublishedVersionHistoryID: null, DocumentCheckedOutVersionHistoryID: not null } => VersionStatus.InitialDraft, + _ => draftMigrated ? VersionStatus.Published : VersionStatus.InitialDraft + }; + + DateTime? scheduledPublishWhen = null; + DateTime? scheduleUnpublishWhen = null; + + if (cmsDocument.DocumentPublishFrom is { } publishFrom) + { + var now = Service.Resolve().GetDateTimeNow(); + if (publishFrom > now) + { + versionStatus = VersionStatus.Unpublished; + } + else + { + scheduledPublishWhen = publishFrom; + } + } + + if (cmsDocument.DocumentPublishTo is { } publishTo) + { + var now = Service.Resolve().GetDateTimeNow(); + if (publishTo < now) + { + versionStatus = VersionStatus.Unpublished; + } + else + { + scheduleUnpublishWhen = publishTo; + } + } + + string? contentItemCommonDataPageBuilderWidgets = null; + string? contentItemCommonDataPageTemplateConfiguration = null; + switch (cmsDocument) + { + case CmsDocumentK11: + { + break; + } + case CmsDocumentK12 doc: + { + contentItemCommonDataPageBuilderWidgets = doc.DocumentPageBuilderWidgets; + contentItemCommonDataPageTemplateConfiguration = doc.DocumentPageTemplateConfiguration; + break; + } + case CmsDocumentK13 doc: + { + contentItemCommonDataPageBuilderWidgets = doc.DocumentPageBuilderWidgets; + contentItemCommonDataPageTemplateConfiguration = doc.DocumentPageTemplateConfiguration; + break; + } + + default: + break; + } + + PatchJsonDefinitions(source.CmsTree.NodeSiteID, ref contentItemCommonDataPageTemplateConfiguration, ref contentItemCommonDataPageBuilderWidgets, out bool ndp); + + var documentGuid = spoiledGuidContext.EnsureDocumentGuid( + cmsDocument.DocumentGUID ?? throw new InvalidOperationException("DocumentGUID is null"), + cmsTree.NodeSiteID, + cmsTree.NodeID, + cmsDocument.DocumentID + ); + + var commonDataModel = new ContentItemCommonDataModel + { + ContentItemCommonDataGUID = documentGuid, + ContentItemCommonDataContentItemGuid = contentItemGuid, + ContentItemCommonDataContentLanguageGuid = languageGuid, // DocumentCulture -> language entity needs to be created and its ID used here + ContentItemCommonDataVersionStatus = versionStatus, + ContentItemCommonDataIsLatest = !draftMigrated, // Flag for latest record to know what to retrieve for the UI + ContentItemCommonDataPageBuilderWidgets = contentItemCommonDataPageBuilderWidgets, + ContentItemCommonDataPageTemplateConfiguration = contentItemCommonDataPageTemplateConfiguration, + }; + + if (ndp) + { + deferredPathService.AddPatch( + commonDataModel.ContentItemCommonDataGUID ?? throw new InvalidOperationException("DocumentGUID is null"), + nodeClass.ClassName, + websiteChannelInfo.WebsiteChannelID + ); + } + + var dataModel = new ContentItemDataModel { ContentItemDataGUID = commonDataModel.ContentItemCommonDataGUID, ContentItemDataCommonDataGuid = commonDataModel.ContentItemCommonDataGUID, ContentItemContentTypeName = nodeClass.ClassName }; + + var fi = new FormInfo(targetFormDefinition); + if (nodeClass.ClassIsCoupledClass) + { + var sfi = new FormInfo(sourceFormDefinition); + string primaryKeyName = ""; + foreach (var sourceFieldInfo in sfi.GetFields(true, true)) + { + if (sourceFieldInfo.PrimaryKey) + { + primaryKeyName = sourceFieldInfo.Name; + } + } + + if (string.IsNullOrWhiteSpace(primaryKeyName)) + { + throw new Exception("Error, unable to find coupled data primary key"); + } + + var commonFields = UnpackReusableFieldSchemas(fi.GetFields()).ToArray(); + var sourceColumns = commonFields + .Select(cf => ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, cf.Name)) + .Union(fi.GetColumnNames(false)) + .Except([CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName)]) + .ToList(); + + var coupledDataRow = coupledDataService.GetSourceCoupledDataRow(nodeClass.ClassTableName, primaryKeyName, cmsDocument.DocumentForeignKeyValue); + MapCoupledDataFieldValues(dataModel.CustomProperties, + columnName => coupledDataRow?[columnName], + columnName => coupledDataRow?.ContainsKey(columnName) ?? false, + cmsTree, cmsDocument.DocumentID, sourceColumns, sfi, fi, false, nodeClass + ); + + foreach (var formFieldInfo in commonFields) + { + string originalFieldName = ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, formFieldInfo.Name); + if (dataModel.CustomProperties.TryGetValue(originalFieldName, out object? value)) + { + commonDataModel.CustomProperties ??= []; + logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' populated", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); + commonDataModel.CustomProperties[formFieldInfo.Name] = value; + dataModel.CustomProperties.Remove(originalFieldName); + } + else + { + logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' missing", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); + } + } + } + + if (CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName) is { } legacyDocumentNameFieldName) + { + if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(nodeClass.ClassName)) + { + string fieldName = ReusableSchemaService.GetUniqueFieldName(nodeClass.ClassName, legacyDocumentNameFieldName); + commonDataModel.CustomProperties.Add(fieldName, cmsDocument.DocumentName); + } + else + { + dataModel.CustomProperties.Add(legacyDocumentNameFieldName, cmsDocument.DocumentName); + } + } + + yield return commonDataModel; + yield return dataModel; + + Guid? documentCreatedByUserGuid = null; + if (modelFacade.TrySelectGuid(cmsDocument.DocumentCreatedByUserID, out var createdByUserGuid)) + { + documentCreatedByUserGuid = createdByUserGuid; + } + + Guid? documentModifiedByUserGuid = null; + if (modelFacade.TrySelectGuid(cmsDocument.DocumentModifiedByUserID, out var modifiedByUserGuid)) + { + documentModifiedByUserGuid = modifiedByUserGuid; + } + + var languageMetadataInfo = new ContentItemLanguageMetadataModel + { + ContentItemLanguageMetadataGUID = documentGuid, + ContentItemLanguageMetadataContentItemGuid = contentItemGuid, + ContentItemLanguageMetadataDisplayName = cmsDocument.DocumentName, // For the admin UI only + ContentItemLanguageMetadataLatestVersionStatus = draftMigrated ? VersionStatus.Draft : versionStatus, // That's the latest status of th item for admin optimization + ContentItemLanguageMetadataCreatedWhen = cmsDocument.DocumentCreatedWhen, // DocumentCreatedWhen + ContentItemLanguageMetadataModifiedWhen = cmsDocument.DocumentModifiedWhen, // DocumentModifiedWhen + ContentItemLanguageMetadataCreatedByUserGuid = documentCreatedByUserGuid, + ContentItemLanguageMetadataModifiedByUserGuid = documentModifiedByUserGuid, + // logic inaccessible, not supported + // ContentItemLanguageMetadataHasImageAsset = ContentItemAssetHasImageArbiter.HasImage(contentItemDataInfo), // This is for admin UI optimization - set to true if latest version contains a field with an image asset + ContentItemLanguageMetadataHasImageAsset = false, + ContentItemLanguageMetadataContentLanguageGuid = languageGuid, // DocumentCulture -> language entity needs to be created and its ID used here + ContentItemLanguageMetadataScheduledPublishWhen = scheduledPublishWhen, + ContentItemLanguageMetadataScheduledUnpublishWhen = scheduleUnpublishWhen + }; + yield return languageMetadataInfo; + } + + // mapping of linked nodes is not supported + Debug.Assert(cmsTree.NodeLinkedNodeID == null, "cmsTree.NodeLinkedNodeId == null"); + Debug.Assert(cmsTree.NodeLinkedNodeSiteID == null, "cmsTree.NodeLinkedNodeSiteId == null"); + + yield return new WebPageItemModel + { + WebPageItemParentGuid = nodeParentGuid, // NULL => under root + WebPageItemGUID = contentItemGuid, + WebPageItemName = safeNodeName, + WebPageItemTreePath = treePath, + WebPageItemWebsiteChannelGuid = siteGuid, + WebPageItemContentItemGuid = contentItemGuid, + WebPageItemOrder = cmsTree.NodeOrder ?? 0 // 0 is nullish value + }; + } + + private void PatchJsonDefinitions(int sourceSiteId, ref string? pageTemplateConfiguration, ref string? pageBuilderWidgets, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + if (sourceInstanceContext.HasInfo) + { + if (pageTemplateConfiguration != null) + { + var pageTemplateConfigurationObj = JsonConvert.DeserializeObject(pageTemplateConfiguration); + if (pageTemplateConfigurationObj?.Identifier != null) + { + logger.LogTrace("Walk page template configuration {Identifier}", pageTemplateConfigurationObj.Identifier); + + var pageTemplateConfigurationFcs = + sourceInstanceContext.GetPageTemplateFormComponents(sourceSiteId, pageTemplateConfigurationObj?.Identifier); + if (pageTemplateConfigurationObj.Properties is { Count: > 0 }) + { + WalkProperties(sourceSiteId, pageTemplateConfigurationObj.Properties, pageTemplateConfigurationFcs, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + + pageTemplateConfiguration = JsonConvert.SerializeObject(pageTemplateConfigurationObj); + } + } + + if (pageBuilderWidgets != null) + { + var areas = JsonConvert.DeserializeObject(pageBuilderWidgets); + if (areas?.EditableAreas is { Count: > 0 }) + { + WalkAreas(sourceSiteId, areas.EditableAreas, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + + pageBuilderWidgets = JsonConvert.SerializeObject(areas); + } + } + } + + private IEnumerable MigrateDraft(ICmsVersionHistory checkoutVersion, ICmsTree cmsTree, string sourceFormClassDefinition, string targetFormDefinition, Guid contentItemGuid, + Guid contentLanguageGuid, ICmsClass nodeClass, WebsiteChannelInfo websiteChannelInfo) + { + var adapter = new NodeXmlAdapter(checkoutVersion.NodeXML); + + ContentItemCommonDataModel? commonDataModel = null; + ContentItemDataModel? dataModel = null; + try + { + string? pageTemplateConfiguration = adapter.DocumentPageTemplateConfiguration; + string? pageBuildWidgets = adapter.DocumentPageBuilderWidgets; + PatchJsonDefinitions(checkoutVersion.NodeSiteID, ref pageTemplateConfiguration, ref pageBuildWidgets, out bool ndp); + + #region Find existing guid + + var contentItemCommonDataGuid = Guid.NewGuid(); + var contentItemInfo = ContentItemInfo.Provider.Get() + .WhereEquals(nameof(ContentItemInfo.ContentItemGUID), contentItemGuid) + .FirstOrDefault(); + if (contentItemInfo != null) + { + var contentItems = ContentItemCommonDataInfo.Provider.Get() + .WhereEquals(nameof(ContentItemCommonDataInfo.ContentItemCommonDataContentItemID), contentItemInfo.ContentItemID) + .ToList() + ; + + var existingDraft = contentItems.FirstOrDefault(x => x.ContentItemCommonDataVersionStatus == VersionStatus.Draft); + if (existingDraft is { ContentItemCommonDataGUID: { } existingGuid }) + { + contentItemCommonDataGuid = existingGuid; + } + } + + #endregion + + commonDataModel = new ContentItemCommonDataModel + { + ContentItemCommonDataGUID = contentItemCommonDataGuid, // adapter.DocumentGUID ?? throw new InvalidOperationException($"DocumentGUID is null"), + ContentItemCommonDataContentItemGuid = contentItemGuid, + ContentItemCommonDataContentLanguageGuid = contentLanguageGuid, + ContentItemCommonDataVersionStatus = VersionStatus.Draft, + ContentItemCommonDataIsLatest = true, // Flag for latest record to know what to retrieve for the UI + ContentItemCommonDataPageBuilderWidgets = pageBuildWidgets, + ContentItemCommonDataPageTemplateConfiguration = pageTemplateConfiguration + }; + + if (ndp) + { + deferredPathService.AddPatch( + commonDataModel.ContentItemCommonDataGUID ?? throw new InvalidOperationException("DocumentGUID is null"), + nodeClass.ClassName, + websiteChannelInfo.WebsiteChannelID + ); + } + + dataModel = new ContentItemDataModel { ContentItemDataGUID = commonDataModel.ContentItemCommonDataGUID, ContentItemDataCommonDataGuid = commonDataModel.ContentItemCommonDataGUID, ContentItemContentTypeName = nodeClass.ClassName }; + + if (nodeClass.ClassIsCoupledClass) + { + var fi = new FormInfo(targetFormDefinition); + var sfi = new FormInfo(sourceFormClassDefinition); + string primaryKeyName = ""; + foreach (var sourceFieldInfo in sfi.GetFields(true, true)) + { + if (sourceFieldInfo.PrimaryKey) + { + primaryKeyName = sourceFieldInfo.Name; + } + } + + if (string.IsNullOrWhiteSpace(primaryKeyName)) + { + throw new Exception("Error, unable to find coupled data primary key"); + } + + var commonFields = UnpackReusableFieldSchemas(fi.GetFields()).ToArray(); + var sourceColumns = commonFields + .Select(cf => ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, cf.Name)) + .Union(fi.GetColumnNames(false)) + .Except([CmsClassMapper.GetLegacyDocumentName(fi, nodeClass.ClassName)]) + .ToList(); + + MapCoupledDataFieldValues(dataModel.CustomProperties, + s => adapter.GetValue(s), + s => adapter.HasValueSet(s) + , cmsTree, adapter.DocumentID, sourceColumns, sfi, fi, true, nodeClass); + + foreach (var formFieldInfo in commonFields) + { + string originalFieldName = ReusableSchemaService.RemoveClassPrefix(nodeClass.ClassName, formFieldInfo.Name); + if (dataModel.CustomProperties.TryGetValue(originalFieldName, out object? value)) + { + commonDataModel.CustomProperties ??= []; + logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' populated", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); + commonDataModel.CustomProperties[formFieldInfo.Name] = value; + dataModel.CustomProperties.Remove(originalFieldName); + } + else + { + logger.LogTrace("Reusable schema field '{FieldName}' from schema '{SchemaGuid}' missing", formFieldInfo.Name, formFieldInfo.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY]); + } + } + } + + // supply document name + if (reusableSchemaService.IsConversionToReusableFieldSchemaRequested(nodeClass.ClassName)) + { + string fieldName = ReusableSchemaService.GetUniqueFieldName(nodeClass.ClassName, "DocumentName"); + commonDataModel.CustomProperties.Add(fieldName, adapter.DocumentName); + } + else + { + dataModel.CustomProperties.Add("DocumentName", adapter.DocumentName); + } + } + catch (Exception ex) + { + Debug.WriteLine($"Failed attempt to create draft from '{checkoutVersion}' {ex}"); + throw; + } + + if (dataModel != null && commonDataModel != null) + { + yield return commonDataModel; + yield return dataModel; + } + } + + private void MapCoupledDataFieldValues( + Dictionary target, + Func getSourceValue, + Func containsSourceValue, + ICmsTree cmsTree, + int? documentId, + List newColumnNames, + FormInfo oldFormInfo, + FormInfo newFormInfo, + bool migratingFromVersionHistory, + ICmsClass nodeClass + ) + { + Debug.Assert(nodeClass.ClassTableName != null, "cmsTree.NodeClass.ClassTableName != null"); + + foreach (string columnName in newColumnNames) + { + if ( + columnName.Equals("ContentItemDataID", StringComparison.InvariantCultureIgnoreCase) || + columnName.Equals("ContentItemDataCommonDataID", StringComparison.InvariantCultureIgnoreCase) || + columnName.Equals("ContentItemDataGUID", StringComparison.InvariantCultureIgnoreCase) || + columnName.Equals(CmsClassMapper.GetLegacyDocumentName(newFormInfo, nodeClass.ClassName), StringComparison.InvariantCultureIgnoreCase) + ) + { + continue; + } + +#pragma warning disable CS0618 // Type or member is obsolete + if (oldFormInfo.GetFormField(columnName)?.External is true) +#pragma warning restore CS0618 // Type or member is obsolete + { + continue; + } + + if (!containsSourceValue(columnName)) + { + if (migratingFromVersionHistory) + { + logger.LogDebug("Value is not contained in source, field '{Field}' (possibly because version existed before field was added to class form)", columnName); + } + else + { + logger.LogWarning("Value is not contained in source, field '{Field}'", columnName); + } + + continue; + } + + + var field = oldFormInfo.GetFormField(columnName); + string? controlName = field.Settings[CLASS_FIELD_CONTROL_NAME]?.ToString()?.ToLowerInvariant(); + + object? value = getSourceValue(columnName); + target[columnName] = value; + + MediaFileInfo?[]? mfis = null; + bool hasMigratedMediaFile = false; + + var fieldMigration = fieldMigrationService.GetFieldMigration(field.DataType, controlName, columnName); + if (fieldMigration?.Actions?.Contains(TcaDirective.ConvertToAsset) ?? false) + { + if (value is string link && + MediaHelper.MatchMediaLink(link) is (true, var mediaLinkKind, var mediaKind, var path, var mediaGuid)) + { + if (mediaLinkKind == MediaLinkKind.Path) + { + // path needs to be converted to GUID + if (mediaKind == MediaKind.Attachment && path != null) + { + switch (attachmentMigrator.TryMigrateAttachmentByPath(path, $"__{columnName}")) + { + case (true, _, var mediaFileInfo, _): + { + mfis = new[] { mediaFileInfo }; + hasMigratedMediaFile = true; + break; + } + default: + { + logger.LogTrace("Unsuccessful attachment migration '{Field}': '{Value}'", columnName, path); + break; + } + } + } + + if (mediaKind == MediaKind.MediaFile) + { + // _mediaFileFacade.GetMediaFile() + // TODO tomas.krch: 2023-03-07 get media file by path + // attachmentDocument.DocumentNode.NodeAliasPath + } + } + + if (mediaGuid is { } mg) + { + if (mediaKind == MediaKind.Attachment && + attachmentMigrator.MigrateAttachment(mg, $"__{columnName}") is (_, _, var mediaFileInfo, _) { Success: true }) + { + mfis = new[] { mediaFileInfo }; + hasMigratedMediaFile = true; + logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}'", columnName, mg); + } + + if (mediaKind == MediaKind.MediaFile && mediaFileFacade.GetMediaFile(mg) is { } mfi) + { + mfis = new[] { mfi }; + hasMigratedMediaFile = true; + logger.LogTrace("MediaFile migrated from media file '{Field}': '{Value}'", columnName, mg); + } + } + } + else if (classService.GetFormControlDefinition(controlName) is { } formControl) + { + switch (formControl) + { + case { UserControlForFile: true }: + { + if (value is Guid attachmentGuid) + { + (bool success, _, var mediaFileInfo, var mediaLibraryInfo) = attachmentMigrator.MigrateAttachment(attachmentGuid, $"__{columnName}"); + if (success && mediaFileInfo != null) + { + mfis = new[] { mediaFileInfo }; + hasMigratedMediaFile = true; + logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}'", columnName, attachmentGuid); + } + } + else if (value is string attachmentGuidStr && Guid.TryParse(attachmentGuidStr, out attachmentGuid)) + { + (bool success, _, var mediaFileInfo, var mediaLibraryInfo) = attachmentMigrator.MigrateAttachment(attachmentGuid, $"__{columnName}"); + if (success && mediaFileInfo != null) + { + mfis = new[] { mediaFileInfo }; + hasMigratedMediaFile = true; + logger.LogTrace("MediaFile migrated from attachment '{Field}': '{Value}' (parsed)", columnName, attachmentGuid); + } + } + + break; + } + case { UserControlForDocAttachments: true }: + { + if (documentId is { } docId) + { + var migratedAttachments = + attachmentMigrator.MigrateGroupedAttachments(docId, field.Guid, field.Name); + + mfis = migratedAttachments + .Where(x => x.MediaFileInfo != null) + .Select(x => x.MediaFileInfo).ToArray(); + hasMigratedMediaFile = true; + } + + break; + } + + default: + break; + } + } + else + { + logger.LogWarning("Unable to map value based on selected migration '{Migration}', value: '{Value}'", fieldMigration, value); + continue; + } + + if (hasMigratedMediaFile && mfis is { Length: > 0 }) + { + target.SetValueAsJson(columnName, + mfis.Select(x => new AssetRelatedItem { Identifier = x.FileGUID, Dimensions = new AssetDimensions { Height = x.FileImageHeight, Width = x.FileImageWidth }, Name = x.FileName, Size = x.FileSize }) + ); + } + + continue; + } + + if (controlName != null) + { + if (fieldMigration.Actions?.Contains(TcaDirective.ConvertToPages) ?? false) + { + // relation to other document + var convertedRelation = relationshipService.GetNodeRelationships(cmsTree.NodeID, nodeClass.ClassName, field.Guid) + .Select(r => new WebPageRelatedItem { WebPageGuid = spoiledGuidContext.EnsureNodeGuid(r.RightNode.NodeGUID, r.RightNode.NodeSiteID, r.RightNode.NodeID) }); + + target.SetValueAsJson(columnName, convertedRelation); + } + else + { + // leave as is + target[columnName] = value; + } + + if (fieldMigration.TargetFormComponent == "webpages") + { + if (value is string pageReferenceJson) + { + var parsed = JObject.Parse(pageReferenceJson); + foreach (var jToken in parsed.DescendantsAndSelf()) + { + if (jToken.Path.EndsWith("NodeGUID", StringComparison.InvariantCultureIgnoreCase)) + { + var patchedGuid = spoiledGuidContext.EnsureNodeGuid(jToken.Value(), cmsTree.NodeSiteID); + jToken.Replace(JToken.FromObject(patchedGuid)); + } + } + + target[columnName] = parsed.ToString().Replace("\"NodeGuid\"", "\"WebPageGuid\""); + } + } + } + else + { + target[columnName] = value; + } + } + } + + private static IEnumerable UnpackReusableFieldSchemas(IEnumerable schemaInfos) + { + using var siEnum = schemaInfos.GetEnumerator(); + + if (siEnum.MoveNext() && FormHelper.GetFormInfo(ContentItemCommonDataInfo.TYPEINFO.ObjectClassName, true) is { } cfi) + { + do + { + var fsi = siEnum.Current; + var formFieldInfos = cfi + .GetFields(true, true) + .Where(f => string.Equals(f.Properties[ReusableFieldSchemaConstants.SCHEMA_IDENTIFIER_KEY] as string, fsi.Guid.ToString(), + StringComparison.InvariantCultureIgnoreCase)); + + foreach (var formFieldInfo in formFieldInfos) + { + yield return formFieldInfo; + } + } while (siEnum.MoveNext()); + } + } + + #region "Page template & page widget walkers" + + private record WalkerContext(int SiteId); + + private void WalkAreas(int siteId, List areas, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach (var area in areas) + { + logger.LogTrace("Walk area {Identifier}", area.Identifier); + + if (area.Sections is { Count: > 0 }) + { + WalkSections(siteId, area.Sections, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + } + } + + private void WalkSections(int siteId, List sections, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach (var section in sections) + { + logger.LogTrace("Walk section {TypeIdentifier}|{Identifier}", section.TypeIdentifier, section.Identifier); + + // TODO tk: 2022-09-14 find other acronym for FormComponents + var sectionFcs = sourceInstanceContext.GetSectionFormComponents(siteId, section.TypeIdentifier); + WalkProperties(siteId, section.Properties, sectionFcs, out bool ndp1); + needsDeferredPatch = ndp1 || needsDeferredPatch; + + if (section.Zones is { Count: > 0 }) + { + WalkZones(siteId, section.Zones, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + } + } + + private void WalkZones(int siteId, List zones, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach (var zone in zones) + { + logger.LogTrace("Walk zone {Name}|{Identifier}", zone.Name, zone.Identifier); + + if (zone.Widgets is { Count: > 0 }) + { + WalkWidgets(siteId, zone.Widgets, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + } + } + + private void WalkWidgets(int siteId, List widgets, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach (var widget in widgets) + { + logger.LogTrace("Walk widget {TypeIdentifier}|{Identifier}", widget.TypeIdentifier, widget.Identifier); + + var widgetFcs = sourceInstanceContext.GetWidgetPropertyFormComponents(siteId, widget.TypeIdentifier); + foreach (var variant in widget.Variants) + { + logger.LogTrace("Walk widget variant {Name}|{Identifier}", variant.Name, variant.Identifier); + + if (variant.Properties is { Count: > 0 }) + { + WalkProperties(siteId, variant.Properties, widgetFcs, out bool ndp); + needsDeferredPatch = ndp || needsDeferredPatch; + } + } + } + } + + private void WalkProperties(int siteId, JObject properties, List? formControlModels, out bool needsDeferredPatch) + { + needsDeferredPatch = false; + foreach ((string key, var value) in properties) + { + logger.LogTrace("Walk property {Name}|{Identifier}", key, value?.ToString()); + + var editingFcm = formControlModels?.FirstOrDefault(x => x.PropertyName.Equals(key, StringComparison.InvariantCultureIgnoreCase)); + if (editingFcm != null) + { + if (FieldMappingInstance.BuiltInModel.NotSupportedInKxpLegacyMode + .SingleOrDefault(x => x.OldFormComponent == editingFcm.FormComponentIdentifier) is var (oldFormComponent, newFormComponent)) + { + logger.LogTrace("Editing form component found {FormComponentName} => no longer supported {Replacement}", editingFcm.FormComponentIdentifier, newFormComponent); + + switch (oldFormComponent) + { + // case Kx13FormComponents.Kentico_PathSelector: + // { + // // new PathSelectorItem() + // break; + // } + case Kx13FormComponents.Kentico_AttachmentSelector when newFormComponent == FormComponents.AdminAssetSelectorComponent: + { + if (value?.ToObject>() is { Count: > 0 } items) + { + properties[key] = JToken.FromObject(items.Select(x => new AssetRelatedItem { Identifier = x.FileGuid }).ToList()); + } + + logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); + break; + } + case Kx13FormComponents.Kentico_PageSelector when newFormComponent == FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent: + { + if (value?.ToObject>() is { Count: > 0 } items) + { + properties[key] = JToken.FromObject(items.Select(x => new WebPageRelatedItem { WebPageGuid = spoiledGuidContext.EnsureNodeGuid(x.NodeGuid, siteId) }).ToList()); + } + + logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); + break; + } + + default: + break; + } + } + else if (FieldMappingInstance.BuiltInModel.SupportedInKxpLegacyMode.Contains(editingFcm.FormComponentIdentifier)) + { + // OK + logger.LogTrace("Editing form component found {FormComponentName} => supported in legacy mode", editingFcm.FormComponentIdentifier); + } + else + { + // unknown control, probably custom + logger.LogTrace("Editing form component found {FormComponentName} => custom or inlined component, don't forget to migrate code accordingly", editingFcm.FormComponentIdentifier); + } + } + + if ("NodeAliasPath".Equals(key, StringComparison.InvariantCultureIgnoreCase)) + { + needsDeferredPatch = true; + properties["TreePath"] = value; + properties.Remove(key); + } + } + } + + #endregion +} diff --git a/Migration.Toolkit.Core.K11/Mappers/MediaFileInfoMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/MediaFileInfoMapper.cs similarity index 55% rename from Migration.Toolkit.Core.K11/Mappers/MediaFileInfoMapper.cs rename to KVA/Migration.Toolkit.Source/Mappers/MediaFileInfoMapper.cs index 12f8f093..c342aea0 100644 --- a/Migration.Toolkit.Core.K11/Mappers/MediaFileInfoMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/MediaFileInfoMapper.cs @@ -1,160 +1,151 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using System.Data; -using CMS.Base; -using CMS.MediaLibrary; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; - -public record MediaFileInfoMapperSource(MediaFile MediaFile, int TargetLibraryId, IUploadedFile? File, string? LibrarySubFolder, - bool MigrateOnlyMediaFileInfo); - -public class MediaFileInfoMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - KxpClassFacade classFacade, - IProtocol protocol, - ToolkitConfiguration toolkitConfiguration, - KeyMappingContext keyMappingContext) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - private readonly IProtocol _protocol = protocol; - - - protected override MediaFileInfo? CreateNewInstance(MediaFileInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - { - if (source.File != null) - { - var mf = new MediaFileInfo(source.File, source.TargetLibraryId, source.LibrarySubFolder ?? "", 0, 0, 0); - mf.SaveFileToDisk(true); - return mf; - } - - return new MediaFileInfo(); - } - - protected override MediaFileInfo MapInternal(MediaFileInfoMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (mediaFile, targetLibraryId, file, _, migrateOnlyMediaFileInfo) = args; - - target.FileName = mediaFile.FileName; - target.FileTitle = mediaFile.FileTitle; - target.FileDescription = mediaFile.FileDescription; - target.FileExtension = mediaFile.FileExtension; - target.FileMimeType = mediaFile.FileMimeType; - target.FileSize = mediaFile.FileSize; - target.FileImageWidth = mediaFile.FileImageWidth ?? 0; - target.FileImageHeight = mediaFile.FileImageHeight ?? 0; - target.FileGUID = mediaFile.FileGuid; - target.FileCreatedWhen = mediaFile.FileCreatedWhen; - target.FileModifiedWhen = mediaFile.FileModifiedWhen; - KenticoHelper.CopyCustomData(target.FileCustomData, mediaFile.FileCustomData); - - MigrateCustomizedFields(target, mediaFile); - - target.FileLibraryID = targetLibraryId; - - var targetCreatedMemberId = keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - mediaFile.FileCreatedByUserId, - t => t.MemberId, - t => t.MemberGuid - ); - if (targetCreatedMemberId.Success) - { - // user was migrated to MEMBER => setting user would break foreign key - target.SetValue(nameof(target.FileCreatedByUserID), CMSActionContext.CurrentUser.UserID); - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.UserId, mediaFile.FileCreatedByUserId, out var createdByUserId)) - { - target.SetValue(nameof(target.FileCreatedByUserID), createdByUserId); - } - - var targetModifiedMemberId = keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - mediaFile.FileModifiedByUserId, - t => t.MemberId, - t => t.MemberGuid - ); - if (targetModifiedMemberId.Success) - { - // user was migrated to MEMBER => setting user would break foreign key - target.SetValue(nameof(target.FileModifiedByUserID), CMSActionContext.CurrentUser.UserID); - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.UserId, mediaFile.FileModifiedByUserId, out var modifiedByUserId)) - { - target.SetValue(nameof(target.FileModifiedByUserID), modifiedByUserId); - } - - if (string.IsNullOrWhiteSpace(target.FilePath)) - { - target.FilePath = mediaFile.FilePath; - } - - if (file == null && !migrateOnlyMediaFileInfo) - { - addFailure(HandbookReferences.MediaFileIsMissingOnSourceFilesystem - .WithId(nameof(mediaFile.FileId), mediaFile.FileId) - .WithData(new - { - mediaFile.FilePath, - mediaFile.FileGuid, - mediaFile.FileLibraryId, - mediaFile.FileSiteId - }) - .AsFailure() - ); - } - - return target; - } - - private void MigrateCustomizedFields(MediaFileInfo target, MediaFile mediaFile) - { - var customizedFields = classFacade.GetCustomizedFieldInfos(MediaFileInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count <= 0) return; - - try - { - var query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {MediaFileInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {MediaFileInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", mediaFile.FileId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load MediaFileInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load MediaFileInfo custom data from source database"); - } - } -} \ No newline at end of file +using System.Data; + +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Helpers; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public record MediaFileInfoMapperSource( + IMediaFile MediaFile, + int TargetLibraryId, + IUploadedFile? File, + string? LibrarySubFolder, + bool MigrateOnlyMediaFileInfo); + +public class MediaFileInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + KxpClassFacade classFacade, + IProtocol protocol, + ToolkitConfiguration toolkitConfiguration, + ModelFacade modelFacade +) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override MediaFileInfo? CreateNewInstance(MediaFileInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + { + if (source.File != null) + { + var mf = new MediaFileInfo(source.File, source.TargetLibraryId, source.LibrarySubFolder ?? "", 0, 0, 0); + mf.SaveFileToDisk(true); + return mf; + } + + return new MediaFileInfo(); + } + + protected override MediaFileInfo MapInternal(MediaFileInfoMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var mediaFile, int targetLibraryId, var file, _, bool migrateOnlyMediaFileInfo) = args; + + target.FileName = mediaFile.FileName; + target.FileTitle = mediaFile.FileTitle; + target.FileDescription = mediaFile.FileDescription; + target.FileExtension = mediaFile.FileExtension; + target.FileMimeType = mediaFile.FileMimeType; + target.FileSize = mediaFile.FileSize; + target.FileImageWidth = mediaFile.FileImageWidth ?? 0; + target.FileImageHeight = mediaFile.FileImageHeight ?? 0; + target.FileGUID = mediaFile.FileGUID; + target.FileCreatedWhen = mediaFile.FileCreatedWhen; + target.FileModifiedWhen = mediaFile.FileModifiedWhen; + KenticoHelper.CopyCustomData(target.FileCustomData, mediaFile.FileCustomData); + + MigrateCustomizedFields(target, mediaFile); + + target.FileLibraryID = targetLibraryId; + + int? createdByUserId = AdminUserHelper.MapTargetAdminUser( + mediaFile.FileCreatedByUserID, + CMSActionContext.CurrentUser.UserID, + () => addFailure(HandbookReferences + .MissingRequiredDependency(nameof(mediaFile.FileCreatedByUserID), mediaFile.FileCreatedByUserID) + .NeedsManualAction() + .AsFailure() + ) + ); + target.SetValue(nameof(target.FileCreatedByUserID), createdByUserId); + + int? modifiedByUserId = AdminUserHelper.MapTargetAdminUser( + mediaFile.FileModifiedByUserID, + CMSActionContext.CurrentUser.UserID, + () => addFailure(HandbookReferences + .MissingRequiredDependency(nameof(mediaFile.FileModifiedByUserID), mediaFile.FileModifiedByUserID) + .NeedsManualAction() + .AsFailure() + ) + ); + target.SetValue(nameof(target.FileModifiedByUserID), modifiedByUserId); + + if (string.IsNullOrWhiteSpace(target.FilePath)) + { + target.FilePath = mediaFile.FilePath; + } + + if (file == null && !migrateOnlyMediaFileInfo) + { + addFailure(HandbookReferences.MediaFileIsMissingOnSourceFilesystem + .WithId(nameof(mediaFile.FileID), mediaFile.FileID) + .WithData(new { mediaFile.FilePath, mediaFile.FileGUID, mediaFile.FileLibraryID, mediaFile.FileSiteID }) + .AsFailure() + ); + } + + return target; + } + + private void MigrateCustomizedFields(MediaFileInfo target, IMediaFile sourceMediaFile) + { + var customizedFields = classFacade.GetCustomizedFieldInfos(MediaFileInfo.TYPEINFO.ObjectClassName).ToList(); + if (customizedFields.Count <= 0) + { + return; + } + + try + { + string query = + $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {MediaFileInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {MediaFileInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", sourceMediaFile.FileID); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in customizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load MediaFileInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load MediaFileInfo custom data from source database"); + } + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/MediaLibraryInfoMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/MediaLibraryInfoMapper.cs new file mode 100644 index 00000000..7d7e1baf --- /dev/null +++ b/KVA/Migration.Toolkit.Source/Mappers/MediaLibraryInfoMapper.cs @@ -0,0 +1,42 @@ +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public record MediaLibraryInfoMapperSource(IMediaLibrary MediaLibrary, ICmsSite Site); + +public class MediaLibraryInfoMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override MediaLibraryInfo? CreateNewInstance(MediaLibraryInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + MediaLibraryInfo.New(); + + protected override MediaLibraryInfo MapInternal(MediaLibraryInfoMapperSource s, MediaLibraryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (ksLibrary, ksSite) = s; + + // Sets the library properties + target.LibraryDisplayName = ksLibrary.LibraryDisplayName; + target.LibraryName = ksLibrary.LibraryName; + target.LibraryDescription = ksLibrary.LibraryDescription; + target.LibraryFolder = ksLibrary.LibraryFolder; + target.LibraryGUID = mappingHelper.Require(ksLibrary.LibraryGUID, nameof(ksLibrary.LibraryGUID)); + target.LibraryDisplayName = ksLibrary.LibraryDisplayName; + target.LibraryDescription = ksLibrary.LibraryDescription; + + if (!target.LibraryFolder.StartsWith($"{ksSite.SiteName}_", StringComparison.InvariantCultureIgnoreCase)) + { + target.LibraryFolder = $"{ksSite.SiteName}_{ksLibrary.LibraryFolder}"; + } + + target.LibraryLastModified = mappingHelper.Require(ksLibrary.LibraryLastModified, nameof(ksLibrary.LibraryLastModified)); + + return target; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs index 937e5adb..5eb7bc8b 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/MemberInfoMapper.cs @@ -1,177 +1,180 @@ -namespace Migration.Toolkit.Source.Mappers; - -using System.Data; -using CMS.FormEngine; -using CMS.Membership; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -public record MemberInfoMapperSource(ICmsUser User, ICmsUserSetting UserSetting); - -public class MemberInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration, - ModelFacade modelFacade - ) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - public static IReadOnlyList MigratedUserFields = new List - { - nameof(ICmsUser.UserGUID), - nameof(ICmsUser.UserName), - nameof(ICmsUser.Email), - // nameof(ICmsUser.UserPassword), - nameof(ICmsUser.UserEnabled), - nameof(ICmsUser.UserCreated), - nameof(ICmsUser.UserSecurityStamp), - }; - - protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (user, userSetting) = source; - - if (!newInstance && user.UserGUID != target.MemberGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.MemberName = user.UserName; - - // target.FirstName = source.FirstName; - // target.LastName = source.LastName; - - // target.Email = source.Email; - target.MemberEmail = user.Email; - - target.MemberPassword = null; // source.UserPassword; // not migrated - - target.MemberEnabled = user.UserEnabled; - - target.SetValue("UserCreated", user.UserCreated); - target.MemberCreated = user.UserCreated.GetValueOrDefault(); - - target.MemberGuid = user.UserGUID; - target.MemberSecurityStamp = user.UserSecurityStamp; - - // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // OBSOLETE: target.UserIsPendingRegistration = false; - // OBSOLETE: target.UserPasswordLastChanged = null; - // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); - foreach (var customizedFieldInfo in customized) - { - var fieldName = customizedFieldInfo.FieldName; - - if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out var value) || - ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) - { - target.SetValue(fieldName, value); - } - } - - var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(MemberInfo.TYPEINFO.ObjectClassName).ToList(); - if (userCustomizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.User.UserID); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - - var usDci = modelFacade - .SelectAll() - .Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }) - .FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); - - if (usDci != null) - { - var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); - if (userSettingsCustomizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsID); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userSettingsCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserSettingsInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); - } - } - } - - - return target; - } -} \ No newline at end of file +using System.Data; + +using CMS.FormEngine; +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public record MemberInfoMapperSource(ICmsUser User, ICmsUserSetting UserSetting); + +public class MemberInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolkitConfiguration toolkitConfiguration, + ModelFacade modelFacade +) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + public static IReadOnlyList MigratedUserFields = new List + { + nameof(ICmsUser.UserGUID), + nameof(ICmsUser.UserName), + nameof(ICmsUser.Email), + // nameof(ICmsUser.UserPassword), + nameof(ICmsUser.UserEnabled), + nameof(ICmsUser.UserCreated), + nameof(ICmsUser.UserSecurityStamp) + }; + + protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (user, userSetting) = source; + + if (!newInstance && user.UserGUID != target.MemberGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.MemberName = user.UserName; + + // target.FirstName = source.FirstName; + // target.LastName = source.LastName; + + // target.Email = source.Email; + target.MemberEmail = user.Email; + + target.MemberPassword = null; // source.UserPassword; // not migrated + + target.MemberEnabled = user.UserEnabled; + + target.SetValue("UserCreated", user.UserCreated); + target.MemberCreated = user.UserCreated.GetValueOrDefault(); + + target.MemberGuid = user.UserGUID; + target.MemberSecurityStamp = user.UserSecurityStamp; + + // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // OBSOLETE: target.UserIsPendingRegistration = false; + // OBSOLETE: target.UserPasswordLastChanged = null; + // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); + foreach (var customizedFieldInfo in customized) + { + string fieldName = customizedFieldInfo.FieldName; + + if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || + ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) + { + target.SetValue(fieldName, value); + } + } + + var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(MemberInfo.TYPEINFO.ObjectClassName).ToList(); + if (userCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.User.UserID); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + + var usDci = modelFacade + .SelectAll() + .Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }) + .FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); + + if (usDci != null) + { + var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); + if (userSettingsCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsID); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userSettingsCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserSettingsInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); + } + } + } + + + return target; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs index 837baa7f..ec579cb8 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/PageTemplateConfigurationMapper.cs @@ -1,229 +1,231 @@ -namespace Migration.Toolkit.Source.Mappers; - -using AngleSharp.Text; -using CMS.MediaLibrary; -using CMS.Websites; -using Kentico.Components.Web.Mvc.FormComponents; -using Kentico.PageBuilder.Web.Mvc; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Migration.Toolkit.KXP.Models; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; -using Migration.Toolkit.Source.Services.Model; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -public class PageTemplateConfigurationMapper( - ILogger logger, - PrimaryKeyMappingContext pkContext, - IProtocol protocol, - SourceInstanceContext sourceInstanceContext) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override PageTemplateConfigurationInfo? CreateNewInstance(ICmsPageTemplateConfiguration source, MappingHelper mappingHelper, AddFailure addFailure) - => source switch - { - CmsPageTemplateConfigurationK11 => null, - CmsPageTemplateConfigurationK12 => PageTemplateConfigurationInfo.New(), - CmsPageTemplateConfigurationK13 => PageTemplateConfigurationInfo.New(), - _ => null - }; - - protected override PageTemplateConfigurationInfo MapInternal(ICmsPageTemplateConfiguration s, PageTemplateConfigurationInfo target, - bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (s is ICmsPageTemplateConfigurationK12K13 source) - { - target.PageTemplateConfigurationDescription = source.PageTemplateConfigurationDescription; - target.PageTemplateConfigurationName = source.PageTemplateConfigurationName; - target.PageTemplateConfigurationLastModified = source.PageTemplateConfigurationLastModified; - target.PageTemplateConfigurationIcon = "xp-custom-element"; // TODO tomas.krch: 2023-11-27 some better default icon pick? - - if (newInstance) - { - target.PageTemplateConfigurationGUID = source.PageTemplateConfigurationGUID; - } - - if (sourceInstanceContext.HasInfo) - { - if (source.PageTemplateConfigurationTemplate != null) - { - var pageTemplateConfiguration = JsonConvert.DeserializeObject(source.PageTemplateConfigurationTemplate); - if (pageTemplateConfiguration?.Identifier != null) - { - logger.LogTrace("Walk page template configuration {Identifier}", pageTemplateConfiguration.Identifier); - - - var pageTemplateConfigurationFcs = - sourceInstanceContext.GetPageTemplateFormComponents(source.PageTemplateConfigurationSiteID, pageTemplateConfiguration.Identifier); - if (pageTemplateConfiguration.Properties is { Count: > 0 }) - { - WalkProperties(pageTemplateConfiguration.Properties, pageTemplateConfigurationFcs); - } - - target.PageTemplateConfigurationTemplate = JsonConvert.SerializeObject(pageTemplateConfiguration); - } - } - - if (source.PageTemplateConfigurationWidgets != null) - { - var areas = JsonConvert.DeserializeObject(source.PageTemplateConfigurationWidgets); - if (areas?.EditableAreas is { Count: > 0 }) - { - WalkAreas(source.PageTemplateConfigurationSiteID, areas.EditableAreas); - } - - target.PageTemplateConfigurationWidgets = JsonConvert.SerializeObject(areas); - } - } - else - { - // simply copy if no info is available - target.PageTemplateConfigurationTemplate = source.PageTemplateConfigurationTemplate; - target.PageTemplateConfigurationWidgets = source.PageTemplateConfigurationWidgets; - } - - return target; - } - else - { - return null; - } - } - - #region "Page template & page widget walkers" - - private void WalkAreas(int siteId, List areas) - { - foreach (var area in areas) - { - logger.LogTrace("Walk area {Identifier}", area.Identifier); - - if (area.Sections is { Count: > 0 }) - { - WalkSections(siteId, area.Sections); - } - } - } - - private void WalkSections(int siteId, List sections) - { - foreach (var section in sections) - { - logger.LogTrace("Walk section {TypeIdentifier}|{Identifier}", section.TypeIdentifier, section.Identifier); - - var sectionFcs = sourceInstanceContext.GetSectionFormComponents(siteId, section.TypeIdentifier); - WalkProperties(section.Properties, sectionFcs); - - if (section.Zones is { Count: > 0 }) - { - WalkZones(siteId, section.Zones); - } - } - } - - private void WalkZones(int siteId, List zones) - { - foreach (var zone in zones) - { - logger.LogTrace("Walk zone {Name}|{Identifier}", zone.Name, zone.Identifier); - - if (zone.Widgets is { Count: > 0 }) - { - WalkWidgets(siteId, zone.Widgets); - } - } - } - - private void WalkWidgets(int siteId, List widgets) - { - foreach (var widget in widgets) - { - logger.LogTrace("Walk widget {TypeIdentifier}|{Identifier}", widget.TypeIdentifier, widget.Identifier); - - var widgetFcs = sourceInstanceContext.GetWidgetPropertyFormComponents(siteId, widget.TypeIdentifier); - foreach (var variant in widget.Variants) - { - logger.LogTrace("Walk widget variant {Name}|{Identifier}", variant.Name, variant.Identifier); - - if (variant.Properties is { Count: > 0 }) - { - WalkProperties(variant.Properties, widgetFcs); - } - } - } - } - - private void WalkProperties(JObject properties, List? formControlModels) - { - foreach (var (key, value) in properties) - { - logger.LogTrace("Walk property {Name}|{Identifier}", key, value?.ToString()); - - var editingFcm = formControlModels?.FirstOrDefault(x => x.PropertyName.Equals(key, StringComparison.InvariantCultureIgnoreCase)); - if (editingFcm != null) - { - if (FieldMappingInstance.BuiltInModel.NotSupportedInKxpLegacyMode - .SingleOrDefault(x => x.OldFormComponent == editingFcm.FormComponentIdentifier) is var (oldFormComponent, newFormComponent)) - { - Protocol.Append(HandbookReferences.FormComponentNotSupportedInLegacyMode(oldFormComponent, newFormComponent)); - logger.LogTrace("Editing form component found {FormComponentName} => no longer supported {Replacement}", - editingFcm.FormComponentIdentifier, newFormComponent); - - switch (oldFormComponent) - { - case Kx13FormComponents.Kentico_AttachmentSelector when newFormComponent == FormComponents.AdminAssetSelectorComponent: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - properties[key] = JToken.FromObject(items.Select(x => new AssetRelatedItem { Identifier = x.FileGuid }).ToList()); - } - - logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); - break; - } - case Kx13FormComponents.Kentico_PageSelector when newFormComponent == FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - properties[key] = JToken.FromObject(items.Select(x => new WebPageRelatedItem { WebPageGuid = x.NodeGuid }).ToList()); - } - - logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); - break; - } - case Kx13FormComponents.Kentico_FileUploader: - { - // TODO tomas.krch 2024-03-27: implement! - break; - } - } - } - else if (FieldMappingInstance.BuiltInModel.SupportedInKxpLegacyMode.Contains(editingFcm.FormComponentIdentifier)) - { - // TODO tomas.krch 2024-03-27: nothing is supported in legacy mode (no legacy mode) - - // OK - logger.LogTrace("Editing form component found {FormComponentName} => supported in legacy mode", - editingFcm.FormComponentIdentifier); - } - else - { - // unknown control, probably custom - Protocol.Append(HandbookReferences.FormComponentCustom(editingFcm.FormComponentIdentifier)); - logger.LogTrace( - "Editing form component found {FormComponentName} => custom or inlined component, don't forget to migrate code accordingly", - editingFcm.FormComponentIdentifier); - } - } - } - } - - #endregion -} \ No newline at end of file +using AngleSharp.Text; + +using CMS.MediaLibrary; +using CMS.Websites; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services.Ipc; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Api.Services.CmsClass; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; +using Migration.Toolkit.Source.Services; +using Migration.Toolkit.Source.Services.Model; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Migration.Toolkit.Source.Mappers; + +public class PageTemplateConfigurationMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + SourceInstanceContext sourceInstanceContext, + SpoiledGuidContext spoiledGuidContext) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override PageTemplateConfigurationInfo? CreateNewInstance(ICmsPageTemplateConfiguration source, MappingHelper mappingHelper, AddFailure addFailure) + => source switch + { + CmsPageTemplateConfigurationK11 => null, + CmsPageTemplateConfigurationK12 => PageTemplateConfigurationInfo.New(), + CmsPageTemplateConfigurationK13 => PageTemplateConfigurationInfo.New(), + _ => null + }; + + protected override PageTemplateConfigurationInfo MapInternal(ICmsPageTemplateConfiguration s, PageTemplateConfigurationInfo target, + bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (s is ICmsPageTemplateConfigurationK12K13 source) + { + target.PageTemplateConfigurationDescription = source.PageTemplateConfigurationDescription; + target.PageTemplateConfigurationName = source.PageTemplateConfigurationName; + target.PageTemplateConfigurationLastModified = source.PageTemplateConfigurationLastModified; + target.PageTemplateConfigurationIcon = "xp-custom-element"; // TODO tomas.krch: 2023-11-27 some better default icon pick? + + if (newInstance) + { + target.PageTemplateConfigurationGUID = source.PageTemplateConfigurationGUID; + } + + if (sourceInstanceContext.HasInfo) + { + if (source.PageTemplateConfigurationTemplate != null) + { + var pageTemplateConfiguration = JsonConvert.DeserializeObject(source.PageTemplateConfigurationTemplate); + if (pageTemplateConfiguration?.Identifier != null) + { + logger.LogTrace("Walk page template configuration {Identifier}", pageTemplateConfiguration.Identifier); + + + var pageTemplateConfigurationFcs = + sourceInstanceContext.GetPageTemplateFormComponents(source.PageTemplateConfigurationSiteID, pageTemplateConfiguration.Identifier); + if (pageTemplateConfiguration.Properties is { Count: > 0 }) + { + WalkProperties(source.PageTemplateConfigurationSiteID, pageTemplateConfiguration.Properties, pageTemplateConfigurationFcs); + } + + target.PageTemplateConfigurationTemplate = JsonConvert.SerializeObject(pageTemplateConfiguration); + } + } + + if (source.PageTemplateConfigurationWidgets != null) + { + var areas = JsonConvert.DeserializeObject(source.PageTemplateConfigurationWidgets); + if (areas?.EditableAreas is { Count: > 0 }) + { + WalkAreas(source.PageTemplateConfigurationSiteID, areas.EditableAreas); + } + + target.PageTemplateConfigurationWidgets = JsonConvert.SerializeObject(areas); + } + } + else + { + // simply copy if no info is available + target.PageTemplateConfigurationTemplate = source.PageTemplateConfigurationTemplate; + target.PageTemplateConfigurationWidgets = source.PageTemplateConfigurationWidgets; + } + + return target; + } + + return null; + } + + #region "Page template & page widget walkers" + + private void WalkAreas(int siteId, List areas) + { + foreach (var area in areas) + { + logger.LogTrace("Walk area {Identifier}", area.Identifier); + + if (area.Sections is { Count: > 0 }) + { + WalkSections(siteId, area.Sections); + } + } + } + + private void WalkSections(int siteId, List sections) + { + foreach (var section in sections) + { + logger.LogTrace("Walk section {TypeIdentifier}|{Identifier}", section.TypeIdentifier, section.Identifier); + + var sectionFcs = sourceInstanceContext.GetSectionFormComponents(siteId, section.TypeIdentifier); + WalkProperties(siteId, section.Properties, sectionFcs); + + if (section.Zones is { Count: > 0 }) + { + WalkZones(siteId, section.Zones); + } + } + } + + private void WalkZones(int siteId, List zones) + { + foreach (var zone in zones) + { + logger.LogTrace("Walk zone {Name}|{Identifier}", zone.Name, zone.Identifier); + + if (zone.Widgets is { Count: > 0 }) + { + WalkWidgets(siteId, zone.Widgets); + } + } + } + + private void WalkWidgets(int siteId, List widgets) + { + foreach (var widget in widgets) + { + logger.LogTrace("Walk widget {TypeIdentifier}|{Identifier}", widget.TypeIdentifier, widget.Identifier); + + var widgetFcs = sourceInstanceContext.GetWidgetPropertyFormComponents(siteId, widget.TypeIdentifier); + foreach (var variant in widget.Variants) + { + logger.LogTrace("Walk widget variant {Name}|{Identifier}", variant.Name, variant.Identifier); + + if (variant.Properties is { Count: > 0 }) + { + WalkProperties(siteId, variant.Properties, widgetFcs); + } + } + } + } + + private void WalkProperties(int siteId, JObject properties, List? formControlModels) + { + foreach ((string key, var value) in properties) + { + logger.LogTrace("Walk property {Name}|{Identifier}", key, value?.ToString()); + + var editingFcm = formControlModels?.FirstOrDefault(x => x.PropertyName.Equals(key, StringComparison.InvariantCultureIgnoreCase)); + if (editingFcm != null) + { + if (FieldMappingInstance.BuiltInModel.NotSupportedInKxpLegacyMode + .SingleOrDefault(x => x.OldFormComponent == editingFcm.FormComponentIdentifier) is var (oldFormComponent, newFormComponent)) + { + Protocol.Append(HandbookReferences.FormComponentNotSupportedInLegacyMode(oldFormComponent, newFormComponent)); + logger.LogTrace("Editing form component found {FormComponentName} => no longer supported {Replacement}", + editingFcm.FormComponentIdentifier, newFormComponent); + + switch (oldFormComponent) + { + case Kx13FormComponents.Kentico_AttachmentSelector when newFormComponent == FormComponents.AdminAssetSelectorComponent: + { + if (value?.ToObject>() is { Count: > 0 } items) + { + properties[key] = JToken.FromObject(items.Select(x => new AssetRelatedItem { Identifier = x.FileGuid }).ToList()); + } + + logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); + break; + } + case Kx13FormComponents.Kentico_PageSelector when newFormComponent == FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent: + { + if (value?.ToObject>() is { Count: > 0 } items) + { + properties[key] = JToken.FromObject(items.Select(x => new WebPageRelatedItem { WebPageGuid = spoiledGuidContext.EnsureNodeGuid(x.NodeGuid, siteId) }).ToList()); + } + + logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); + break; + } + case Kx13FormComponents.Kentico_FileUploader: + { + // TODO tomas.krch 2024-03-27: implement! + break; + } + + default: + break; + } + } + else if (FieldMappingInstance.BuiltInModel.SupportedInKxpLegacyMode.Contains(editingFcm.FormComponentIdentifier)) + { + // OK + logger.LogTrace("Editing form component found {FormComponentName} => supported in legacy mode", + editingFcm.FormComponentIdentifier); + } + else + { + // unknown control, probably custom + Protocol.Append(HandbookReferences.FormComponentCustom(editingFcm.FormComponentIdentifier)); + logger.LogTrace( + "Editing form component found {FormComponentName} => custom or inlined component, don't forget to migrate code accordingly", + editingFcm.FormComponentIdentifier); + } + } + } + } + + #endregion +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs index ed7befe7..050ab944 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/ResourceMapper.cs @@ -1,46 +1,48 @@ -namespace Migration.Toolkit.Source.Mappers; - -using CMS.Modules; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Contexts; -using Migration.Toolkit.Source.Model; - -public class ResourceMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override ResourceInfo? CreateNewInstance(ICmsResource source, MappingHelper mappingHelper, AddFailure addFailure) - => ResourceInfo.New(); - - protected override ResourceInfo MapInternal(ICmsResource source, ResourceInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ResourceDescription = source.ResourceDescription; - target.ResourceDisplayName = source.ResourceDisplayName; - target.ResourceGUID = source.ResourceGUID; - target.ResourceIsInDevelopment = false; // TODO tk: 2022-10-10 if true, module is not shown in UI of XbK - target.ResourceLastModified = source.ResourceLastModified; - target.ResourceName = source.ResourceName; - - if (target.ResourceName == Kx13SystemResource.Licenses) - { - target.ResourceName = XbkSystemResource.CMS_Licenses; - logger.LogInformation("Patching CMS Resource 'Licences': name changed to '{ResourceNamePatched}'", XbkSystemResource.CMS_Licenses); - } - - if (!XbkSystemResource.All.Contains(target.ResourceName) || Kx13SystemResource.ConvertToNonSysResource.Contains(target.ResourceName)) - { - // custom resource - - if (target.ResourceName.StartsWith("CMS.", StringComparison.InvariantCultureIgnoreCase)) - { - var targetResourceNamePatched = target.ResourceName.Substring(4, target.ResourceName.Length - 4); - logger.LogInformation("Patching CMS Resource '{ResourceName}': name changed to '{ResourceNamePatched}'", target.ResourceName, targetResourceNamePatched); - target.ResourceName = targetResourceNamePatched; - } - } - - return target; - } -} \ No newline at end of file +using CMS.Modules; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Source.Contexts; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public class ResourceMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override ResourceInfo? CreateNewInstance(ICmsResource source, MappingHelper mappingHelper, AddFailure addFailure) + => ResourceInfo.New(); + + protected override ResourceInfo MapInternal(ICmsResource source, ResourceInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ResourceDescription = source.ResourceDescription; + target.ResourceDisplayName = source.ResourceDisplayName; + target.ResourceGUID = source.ResourceGUID; + target.ResourceIsInDevelopment = false; // TODO tk: 2022-10-10 if true, module is not shown in UI of XbK + target.ResourceLastModified = source.ResourceLastModified; + target.ResourceName = source.ResourceName; + + if (target.ResourceName == Kx13SystemResource.Licenses) + { + target.ResourceName = XbkSystemResource.CMS_Licenses; + logger.LogInformation("Patching CMS Resource 'Licences': name changed to '{ResourceNamePatched}'", XbkSystemResource.CMS_Licenses); + } + + if (!XbkSystemResource.All.Contains(target.ResourceName) || Kx13SystemResource.ConvertToNonSysResource.Contains(target.ResourceName)) + { + // custom resource + + if (target.ResourceName.StartsWith("CMS.", StringComparison.InvariantCultureIgnoreCase)) + { + string targetResourceNamePatched = target.ResourceName[4..]; + logger.LogInformation("Patching CMS Resource '{ResourceName}': name changed to '{ResourceNamePatched}'", target.ResourceName, targetResourceNamePatched); + target.ResourceName = targetResourceNamePatched; + } + } + + return target; + } +} diff --git a/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs b/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs index aa6889e2..ed18af0f 100644 --- a/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs +++ b/KVA/Migration.Toolkit.Source/Mappers/TagMapper.cs @@ -1,39 +1,42 @@ -namespace Migration.Toolkit.Source.Mappers; - -using Kentico.Xperience.UMT.Model; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Source.Model; - -public record TagModelSource(Guid TaxonomyGuid, ICmsCategory CmsCategory, Dictionary CategoryId2Guid); -public class TagMapper(ILogger logger) : UmtMapperBase -{ - protected override IEnumerable MapInternal(TagModelSource source) - { - var (taxonomyGuid, cmsCategory, id2Guid) = source; - var tag = new TagModel - { - TagName = cmsCategory.CategoryName, - TagTitle = cmsCategory.CategoryDisplayName, - TagDescription = cmsCategory.CategoryDescription, - TagGUID = cmsCategory.CategoryGUID, - TagTaxonomyGUID = taxonomyGuid, - TagOrder = 0, - TagTranslations = new Dictionary(), - }; - - if (cmsCategory.CategoryParentID is { } categoryParentId) - { - if (id2Guid.TryGetValue(categoryParentId, out var categoryGuid)) - { - tag.TagParentGUID = categoryGuid; - } - else - { - logger.LogWarning("Missing parent category {CategoryParentID} in source instance", categoryParentId); - } - } - - yield return tag; - } -} \ No newline at end of file +using Kentico.Xperience.UMT.Model; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Mappers; + +public record TagModelSource(Guid TaxonomyGuid, ICmsCategory CmsCategory, Dictionary CategoryId2Guid); + +public class TagMapper(ILogger logger) : UmtMapperBase +{ + protected override IEnumerable MapInternal(TagModelSource source) + { + var (taxonomyGuid, cmsCategory, id2Guid) = source; + var tag = new TagModel + { + TagName = cmsCategory.CategoryName, + TagTitle = cmsCategory.CategoryDisplayName, + TagDescription = cmsCategory.CategoryDescription, + TagGUID = cmsCategory.CategoryGUID, + TagTaxonomyGUID = taxonomyGuid, + TagOrder = 0, + TagTranslations = [] + }; + + if (cmsCategory.CategoryParentID is { } categoryParentId) + { + if (id2Guid.TryGetValue(categoryParentId, out var categoryGuid)) + { + tag.TagParentGUID = categoryGuid; + } + else + { + logger.LogWarning("Missing parent category {CategoryParentID} in source instance", categoryParentId); + } + } + + yield return tag; + } +} diff --git a/KVA/Migration.Toolkit.Source/Migration.Toolkit.Source.csproj b/KVA/Migration.Toolkit.Source/Migration.Toolkit.Source.csproj index 0018ee84..7ed0a262 100644 --- a/KVA/Migration.Toolkit.Source/Migration.Toolkit.Source.csproj +++ b/KVA/Migration.Toolkit.Source/Migration.Toolkit.Source.csproj @@ -7,15 +7,17 @@ - - - + + + - + - - - + + + + IDE0060 + diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs index 0d336e96..3492adec 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeForm.cs @@ -1,113 +1,154 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsAlternativeForm : ISourceModel -{ - int FormID { get; } - string FormDisplayName { get; } - string FormName { get; } - int FormClassID { get; } - string? FormDefinition { get; } - string? FormLayout { get; } - Guid FormGUID { get; } - DateTime FormLastModified { get; } - int? FormCoupledClassID { get; } - bool? FormHideNewParentFields { get; } - string? FormLayoutType { get; } - string? FormVersionGUID { get; } - string? FormCustomizedColumns { get; } - bool? FormIsCustom { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAlternativeFormK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsAlternativeFormK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsAlternativeFormK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAlternativeFormK11.IsAvailable(version), - { Major: 12 } => CmsAlternativeFormK12.IsAvailable(version), - { Major: 13 } => CmsAlternativeFormK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_AlternativeForm"; - static string ISourceModel.GuidColumnName => "FormGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsAlternativeForm ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAlternativeFormK11.FromReader(reader, version), - { Major: 12 } => CmsAlternativeFormK12.FromReader(reader, version), - { Major: 13 } => CmsAlternativeFormK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsAlternativeFormK11(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_AlternativeForm"; - public static string GuidColumnName => "FormGUID"; - static CmsAlternativeFormK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeFormK11( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - } - public static CmsAlternativeFormK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeFormK11( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - } -}; -public partial record CmsAlternativeFormK12(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_AlternativeForm"; - public static string GuidColumnName => "FormGUID"; - static CmsAlternativeFormK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeFormK12( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - } - public static CmsAlternativeFormK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeFormK12( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - } -}; -public partial record CmsAlternativeFormK13(int FormID, string FormDisplayName, string FormName, int FormClassID, string? FormDefinition, string? FormLayout, Guid FormGUID, DateTime FormLastModified, int? FormCoupledClassID, bool? FormHideNewParentFields, string? FormLayoutType, string? FormVersionGUID, string? FormCustomizedColumns, bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_AlternativeForm"; - public static string GuidColumnName => "FormGUID"; - static CmsAlternativeFormK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeFormK13( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - } - public static CmsAlternativeFormK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeFormK13( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsAlternativeForm : ISourceModel +{ + int FormID { get; } + string FormDisplayName { get; } + string FormName { get; } + int FormClassID { get; } + string? FormDefinition { get; } + string? FormLayout { get; } + Guid FormGUID { get; } + DateTime FormLastModified { get; } + int? FormCoupledClassID { get; } + bool? FormHideNewParentFields { get; } + string? FormLayoutType { get; } + string? FormVersionGUID { get; } + string? FormCustomizedColumns { get; } + bool? FormIsCustom { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeFormK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsAlternativeFormK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsAlternativeFormK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeFormK11.IsAvailable(version), + { Major: 12 } => CmsAlternativeFormK12.IsAvailable(version), + { Major: 13 } => CmsAlternativeFormK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_AlternativeForm"; + static string ISourceModel.GuidColumnName => "FormGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsAlternativeForm ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeFormK11.FromReader(reader, version), + { Major: 12 } => CmsAlternativeFormK12.FromReader(reader, version), + { Major: 13 } => CmsAlternativeFormK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsAlternativeFormK11( + int FormID, + string FormDisplayName, + string FormName, + int FormClassID, + string? FormDefinition, + string? FormLayout, + Guid FormGUID, + DateTime FormLastModified, + int? FormCoupledClassID, + bool? FormHideNewParentFields, + string? FormLayoutType, + string? FormVersionGUID, + string? FormCustomizedColumns, + bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_AlternativeForm"; + public static string GuidColumnName => "FormGUID"; + + static CmsAlternativeFormK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), + reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), + reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); + + public static CmsAlternativeFormK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), + reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), + reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); +} + +public record CmsAlternativeFormK12( + int FormID, + string FormDisplayName, + string FormName, + int FormClassID, + string? FormDefinition, + string? FormLayout, + Guid FormGUID, + DateTime FormLastModified, + int? FormCoupledClassID, + bool? FormHideNewParentFields, + string? FormLayoutType, + string? FormVersionGUID, + string? FormCustomizedColumns, + bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_AlternativeForm"; + public static string GuidColumnName => "FormGUID"; + + static CmsAlternativeFormK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), + reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), + reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); + + public static CmsAlternativeFormK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), + reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), + reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); +} + +public record CmsAlternativeFormK13( + int FormID, + string FormDisplayName, + string FormName, + int FormClassID, + string? FormDefinition, + string? FormLayout, + Guid FormGUID, + DateTime FormLastModified, + int? FormCoupledClassID, + bool? FormHideNewParentFields, + string? FormLayoutType, + string? FormVersionGUID, + string? FormCustomizedColumns, + bool? FormIsCustom) : ICmsAlternativeForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_AlternativeForm"; + public static string GuidColumnName => "FormGUID"; + + static CmsAlternativeFormK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), + reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), + reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); + + public static CmsAlternativeFormK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormClassID"), reader.Unbox("FormDefinition"), reader.Unbox("FormLayout"), + reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormCoupledClassID"), reader.Unbox("FormHideNewParentFields"), reader.Unbox("FormLayoutType"), + reader.Unbox("FormVersionGUID"), reader.Unbox("FormCustomizedColumns"), reader.Unbox("FormIsCustom") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs index ea29820e..e605e960 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsAlternativeUrl.cs @@ -1,100 +1,89 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsAlternativeUrl : ISourceModel -{ - - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAlternativeUrlK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsAlternativeUrlK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsAlternativeUrlK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAlternativeUrlK11.IsAvailable(version), - { Major: 12 } => CmsAlternativeUrlK12.IsAvailable(version), - { Major: 13 } => CmsAlternativeUrlK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_AlternativeUrl"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsAlternativeUrl ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAlternativeUrlK11.FromReader(reader, version), - { Major: 12 } => CmsAlternativeUrlK12.FromReader(reader, version), - { Major: 13 } => CmsAlternativeUrlK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsAlternativeUrlK11() : ICmsAlternativeUrl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_AlternativeUrl"; - public static string GuidColumnName => ""; - static CmsAlternativeUrlK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeUrlK11( - - ); - } - public static CmsAlternativeUrlK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeUrlK11( - - ); - } -}; -public partial record CmsAlternativeUrlK12(int AlternativeUrlID, Guid AlternativeUrlGUID, int AlternativeUrlDocumentID, int AlternativeUrlSiteID, string AlternativeUrlUrl, DateTime AlternativeUrlLastModified) : ICmsAlternativeUrl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AlternativeUrlID"; - public static string TableName => "CMS_AlternativeUrl"; - public static string GuidColumnName => "AlternativeUrlGUID"; - static CmsAlternativeUrlK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeUrlK12( - reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") - ); - } - public static CmsAlternativeUrlK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeUrlK12( - reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") - ); - } -}; -public partial record CmsAlternativeUrlK13(int AlternativeUrlID, Guid AlternativeUrlGUID, int AlternativeUrlDocumentID, int AlternativeUrlSiteID, string AlternativeUrlUrl, DateTime AlternativeUrlLastModified) : ICmsAlternativeUrl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AlternativeUrlID"; - public static string TableName => "CMS_AlternativeUrl"; - public static string GuidColumnName => "AlternativeUrlGUID"; - static CmsAlternativeUrlK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeUrlK13( - reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") - ); - } - public static CmsAlternativeUrlK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAlternativeUrlK13( - reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), reader.Unbox("AlternativeUrlLastModified") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsAlternativeUrl : ISourceModel +{ + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeUrlK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsAlternativeUrlK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsAlternativeUrlK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeUrlK11.IsAvailable(version), + { Major: 12 } => CmsAlternativeUrlK12.IsAvailable(version), + { Major: 13 } => CmsAlternativeUrlK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_AlternativeUrl"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsAlternativeUrl ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsAlternativeUrlK11.FromReader(reader, version), + { Major: 12 } => CmsAlternativeUrlK12.FromReader(reader, version), + { Major: 13 } => CmsAlternativeUrlK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsAlternativeUrlK11 : ICmsAlternativeUrl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_AlternativeUrl"; + public static string GuidColumnName => ""; + + static CmsAlternativeUrlK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + ); + + public static CmsAlternativeUrlK11 FromReader(IDataReader reader, SemanticVersion version) => new( + ); +} + +public record CmsAlternativeUrlK12(int AlternativeUrlID, Guid AlternativeUrlGUID, int AlternativeUrlDocumentID, int AlternativeUrlSiteID, string AlternativeUrlUrl, DateTime AlternativeUrlLastModified) + : ICmsAlternativeUrl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AlternativeUrlID"; + public static string TableName => "CMS_AlternativeUrl"; + public static string GuidColumnName => "AlternativeUrlGUID"; + + static CmsAlternativeUrlK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), + reader.Unbox("AlternativeUrlLastModified") + ); + + public static CmsAlternativeUrlK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), + reader.Unbox("AlternativeUrlLastModified") + ); +} + +public record CmsAlternativeUrlK13(int AlternativeUrlID, Guid AlternativeUrlGUID, int AlternativeUrlDocumentID, int AlternativeUrlSiteID, string AlternativeUrlUrl, DateTime AlternativeUrlLastModified) + : ICmsAlternativeUrl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AlternativeUrlID"; + public static string TableName => "CMS_AlternativeUrl"; + public static string GuidColumnName => "AlternativeUrlGUID"; + + static CmsAlternativeUrlK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), + reader.Unbox("AlternativeUrlLastModified") + ); + + public static CmsAlternativeUrlK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AlternativeUrlID"), reader.Unbox("AlternativeUrlGUID"), reader.Unbox("AlternativeUrlDocumentID"), reader.Unbox("AlternativeUrlSiteID"), reader.Unbox("AlternativeUrlUrl"), + reader.Unbox("AlternativeUrlLastModified") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs b/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs index f5ddd466..2e92214d 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsAttachment.cs @@ -1,122 +1,202 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsAttachment : ISourceModel -{ - int AttachmentID { get; } - string AttachmentName { get; } - string AttachmentExtension { get; } - int AttachmentSize { get; } - string AttachmentMimeType { get; } - byte[]? AttachmentBinary { get; } - int? AttachmentImageWidth { get; } - int? AttachmentImageHeight { get; } - int? AttachmentDocumentID { get; } - Guid AttachmentGUID { get; } - int AttachmentSiteID { get; } - DateTime AttachmentLastModified { get; } - bool? AttachmentIsUnsorted { get; } - int? AttachmentOrder { get; } - Guid? AttachmentGroupGUID { get; } - Guid? AttachmentFormGUID { get; } - string? AttachmentHash { get; } - string? AttachmentTitle { get; } - string? AttachmentDescription { get; } - string? AttachmentCustomData { get; } - string? AttachmentSearchContent { get; } - string? AttachmentVariantDefinitionIdentifier { get; } - int? AttachmentVariantParentID { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAttachmentK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsAttachmentK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsAttachmentK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAttachmentK11.IsAvailable(version), - { Major: 12 } => CmsAttachmentK12.IsAvailable(version), - { Major: 13 } => CmsAttachmentK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Attachment"; - static string ISourceModel.GuidColumnName => "AttachmentGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsAttachment ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsAttachmentK11.FromReader(reader, version), - { Major: 12 } => CmsAttachmentK12.FromReader(reader, version), - { Major: 13 } => CmsAttachmentK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsAttachmentK11(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; - public static string TableName => "CMS_Attachment"; - public static string GuidColumnName => "AttachmentGUID"; - static CmsAttachmentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAttachmentK11( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - } - public static CmsAttachmentK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAttachmentK11( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - } -}; -public partial record CmsAttachmentK12(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; - public static string TableName => "CMS_Attachment"; - public static string GuidColumnName => "AttachmentGUID"; - static CmsAttachmentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAttachmentK12( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - } - public static CmsAttachmentK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAttachmentK12( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - } -}; -public partial record CmsAttachmentK13(int AttachmentID, string AttachmentName, string AttachmentExtension, int AttachmentSize, string AttachmentMimeType, byte[]? AttachmentBinary, int? AttachmentImageWidth, int? AttachmentImageHeight, int? AttachmentDocumentID, Guid AttachmentGUID, int AttachmentSiteID, DateTime AttachmentLastModified, bool? AttachmentIsUnsorted, int? AttachmentOrder, Guid? AttachmentGroupGUID, Guid? AttachmentFormGUID, string? AttachmentHash, string? AttachmentTitle, string? AttachmentDescription, string? AttachmentCustomData, string? AttachmentSearchContent, string? AttachmentVariantDefinitionIdentifier, int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; - public static string TableName => "CMS_Attachment"; - public static string GuidColumnName => "AttachmentGUID"; - static CmsAttachmentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAttachmentK13( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - } - public static CmsAttachmentK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsAttachmentK13( - reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsAttachment : ISourceModel +{ + int AttachmentID { get; } + string AttachmentName { get; } + string AttachmentExtension { get; } + int AttachmentSize { get; } + string AttachmentMimeType { get; } + byte[]? AttachmentBinary { get; } + int? AttachmentImageWidth { get; } + int? AttachmentImageHeight { get; } + int? AttachmentDocumentID { get; } + Guid AttachmentGUID { get; } + int AttachmentSiteID { get; } + DateTime AttachmentLastModified { get; } + bool? AttachmentIsUnsorted { get; } + int? AttachmentOrder { get; } + Guid? AttachmentGroupGUID { get; } + Guid? AttachmentFormGUID { get; } + string? AttachmentHash { get; } + string? AttachmentTitle { get; } + string? AttachmentDescription { get; } + string? AttachmentCustomData { get; } + string? AttachmentSearchContent { get; } + string? AttachmentVariantDefinitionIdentifier { get; } + int? AttachmentVariantParentID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAttachmentK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsAttachmentK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsAttachmentK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsAttachmentK11.IsAvailable(version), + { Major: 12 } => CmsAttachmentK12.IsAvailable(version), + { Major: 13 } => CmsAttachmentK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Attachment"; + static string ISourceModel.GuidColumnName => "AttachmentGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsAttachment ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsAttachmentK11.FromReader(reader, version), + { Major: 12 } => CmsAttachmentK12.FromReader(reader, version), + { Major: 13 } => CmsAttachmentK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsAttachmentK11( + int AttachmentID, + string AttachmentName, + string AttachmentExtension, + int AttachmentSize, + string AttachmentMimeType, + byte[]? AttachmentBinary, + int? AttachmentImageWidth, + int? AttachmentImageHeight, + int? AttachmentDocumentID, + Guid AttachmentGUID, + int AttachmentSiteID, + DateTime AttachmentLastModified, + bool? AttachmentIsUnsorted, + int? AttachmentOrder, + Guid? AttachmentGroupGUID, + Guid? AttachmentFormGUID, + string? AttachmentHash, + string? AttachmentTitle, + string? AttachmentDescription, + string? AttachmentCustomData, + string? AttachmentSearchContent, + string? AttachmentVariantDefinitionIdentifier, + int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; + public static string TableName => "CMS_Attachment"; + public static string GuidColumnName => "AttachmentGUID"; + + static CmsAttachmentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), + reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), + reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), + reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), + reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); + + public static CmsAttachmentK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), + reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), + reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), + reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), + reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); +} + +public record CmsAttachmentK12( + int AttachmentID, + string AttachmentName, + string AttachmentExtension, + int AttachmentSize, + string AttachmentMimeType, + byte[]? AttachmentBinary, + int? AttachmentImageWidth, + int? AttachmentImageHeight, + int? AttachmentDocumentID, + Guid AttachmentGUID, + int AttachmentSiteID, + DateTime AttachmentLastModified, + bool? AttachmentIsUnsorted, + int? AttachmentOrder, + Guid? AttachmentGroupGUID, + Guid? AttachmentFormGUID, + string? AttachmentHash, + string? AttachmentTitle, + string? AttachmentDescription, + string? AttachmentCustomData, + string? AttachmentSearchContent, + string? AttachmentVariantDefinitionIdentifier, + int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; + public static string TableName => "CMS_Attachment"; + public static string GuidColumnName => "AttachmentGUID"; + + static CmsAttachmentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), + reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), + reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), + reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), + reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); + + public static CmsAttachmentK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), + reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), + reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), + reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), + reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); +} + +public record CmsAttachmentK13( + int AttachmentID, + string AttachmentName, + string AttachmentExtension, + int AttachmentSize, + string AttachmentMimeType, + byte[]? AttachmentBinary, + int? AttachmentImageWidth, + int? AttachmentImageHeight, + int? AttachmentDocumentID, + Guid AttachmentGUID, + int AttachmentSiteID, + DateTime AttachmentLastModified, + bool? AttachmentIsUnsorted, + int? AttachmentOrder, + Guid? AttachmentGroupGUID, + Guid? AttachmentFormGUID, + string? AttachmentHash, + string? AttachmentTitle, + string? AttachmentDescription, + string? AttachmentCustomData, + string? AttachmentSearchContent, + string? AttachmentVariantDefinitionIdentifier, + int? AttachmentVariantParentID) : ICmsAttachment, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "AttachmentID"; + public static string TableName => "CMS_Attachment"; + public static string GuidColumnName => "AttachmentGUID"; + + static CmsAttachmentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), + reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), + reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), + reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), + reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); + + public static CmsAttachmentK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("AttachmentID"), reader.Unbox("AttachmentName"), reader.Unbox("AttachmentExtension"), reader.Unbox("AttachmentSize"), reader.Unbox("AttachmentMimeType"), + reader.Unbox("AttachmentBinary"), reader.Unbox("AttachmentImageWidth"), reader.Unbox("AttachmentImageHeight"), reader.Unbox("AttachmentDocumentID"), reader.Unbox("AttachmentGUID"), + reader.Unbox("AttachmentSiteID"), reader.Unbox("AttachmentLastModified"), reader.Unbox("AttachmentIsUnsorted"), reader.Unbox("AttachmentOrder"), reader.Unbox("AttachmentGroupGUID"), + reader.Unbox("AttachmentFormGUID"), reader.Unbox("AttachmentHash"), reader.Unbox("AttachmentTitle"), reader.Unbox("AttachmentDescription"), reader.Unbox("AttachmentCustomData"), + reader.Unbox("AttachmentSearchContent"), reader.Unbox("AttachmentVariantDefinitionIdentifier"), reader.Unbox("AttachmentVariantParentID") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs b/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs index a7e848ef..152503e1 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsCategory.cs @@ -1,114 +1,158 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsCategory : ISourceModel -{ - int CategoryID { get; } - string CategoryDisplayName { get; } - string? CategoryName { get; } - string? CategoryDescription { get; } - int? CategoryCount { get; } - bool CategoryEnabled { get; } - int? CategoryUserID { get; } - Guid CategoryGUID { get; } - DateTime CategoryLastModified { get; } - int? CategorySiteID { get; } - int? CategoryParentID { get; } - string? CategoryIDPath { get; } - string? CategoryNamePath { get; } - int? CategoryLevel { get; } - int? CategoryOrder { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCategoryK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsCategoryK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsCategoryK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCategoryK11.IsAvailable(version), - { Major: 12 } => CmsCategoryK12.IsAvailable(version), - { Major: 13 } => CmsCategoryK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Category"; - static string ISourceModel.GuidColumnName => "CategoryGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsCategory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCategoryK11.FromReader(reader, version), - { Major: 12 } => CmsCategoryK12.FromReader(reader, version), - { Major: 13 } => CmsCategoryK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsCategoryK11(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_Category"; - public static string GuidColumnName => "CategoryGUID"; - static CmsCategoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCategoryK11( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - } - public static CmsCategoryK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCategoryK11( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - } -}; -public partial record CmsCategoryK12(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_Category"; - public static string GuidColumnName => "CategoryGUID"; - static CmsCategoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCategoryK12( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - } - public static CmsCategoryK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCategoryK12( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - } -}; -public partial record CmsCategoryK13(int CategoryID, string CategoryDisplayName, string? CategoryName, string? CategoryDescription, int? CategoryCount, bool CategoryEnabled, int? CategoryUserID, Guid CategoryGUID, DateTime CategoryLastModified, int? CategorySiteID, int? CategoryParentID, string? CategoryIDPath, string? CategoryNamePath, int? CategoryLevel, int? CategoryOrder) : ICmsCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_Category"; - public static string GuidColumnName => "CategoryGUID"; - static CmsCategoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCategoryK13( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - } - public static CmsCategoryK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCategoryK13( - reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsCategory : ISourceModel +{ + int CategoryID { get; } + string CategoryDisplayName { get; } + string? CategoryName { get; } + string? CategoryDescription { get; } + int? CategoryCount { get; } + bool CategoryEnabled { get; } + int? CategoryUserID { get; } + Guid CategoryGUID { get; } + DateTime CategoryLastModified { get; } + int? CategorySiteID { get; } + int? CategoryParentID { get; } + string? CategoryIDPath { get; } + string? CategoryNamePath { get; } + int? CategoryLevel { get; } + int? CategoryOrder { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCategoryK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsCategoryK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsCategoryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCategoryK11.IsAvailable(version), + { Major: 12 } => CmsCategoryK12.IsAvailable(version), + { Major: 13 } => CmsCategoryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Category"; + static string ISourceModel.GuidColumnName => "CategoryGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsCategory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsCategoryK11.FromReader(reader, version), + { Major: 12 } => CmsCategoryK12.FromReader(reader, version), + { Major: 13 } => CmsCategoryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsCategoryK11( + int CategoryID, + string CategoryDisplayName, + string? CategoryName, + string? CategoryDescription, + int? CategoryCount, + bool CategoryEnabled, + int? CategoryUserID, + Guid CategoryGUID, + DateTime CategoryLastModified, + int? CategorySiteID, + int? CategoryParentID, + string? CategoryIDPath, + string? CategoryNamePath, + int? CategoryLevel, + int? CategoryOrder) : ICmsCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_Category"; + public static string GuidColumnName => "CategoryGUID"; + + static CmsCategoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), + reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), + reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); + + public static CmsCategoryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), + reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), + reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); +} + +public record CmsCategoryK12( + int CategoryID, + string CategoryDisplayName, + string? CategoryName, + string? CategoryDescription, + int? CategoryCount, + bool CategoryEnabled, + int? CategoryUserID, + Guid CategoryGUID, + DateTime CategoryLastModified, + int? CategorySiteID, + int? CategoryParentID, + string? CategoryIDPath, + string? CategoryNamePath, + int? CategoryLevel, + int? CategoryOrder) : ICmsCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_Category"; + public static string GuidColumnName => "CategoryGUID"; + + static CmsCategoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), + reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), + reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); + + public static CmsCategoryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), + reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), + reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); +} + +public record CmsCategoryK13( + int CategoryID, + string CategoryDisplayName, + string? CategoryName, + string? CategoryDescription, + int? CategoryCount, + bool CategoryEnabled, + int? CategoryUserID, + Guid CategoryGUID, + DateTime CategoryLastModified, + int? CategorySiteID, + int? CategoryParentID, + string? CategoryIDPath, + string? CategoryNamePath, + int? CategoryLevel, + int? CategoryOrder) : ICmsCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_Category"; + public static string GuidColumnName => "CategoryGUID"; + + static CmsCategoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), + reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), + reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); + + public static CmsCategoryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CategoryID"), reader.Unbox("CategoryDisplayName"), reader.Unbox("CategoryName"), reader.Unbox("CategoryDescription"), reader.Unbox("CategoryCount"), reader.Unbox("CategoryEnabled"), + reader.Unbox("CategoryUserID"), reader.Unbox("CategoryGUID"), reader.Unbox("CategoryLastModified"), reader.Unbox("CategorySiteID"), reader.Unbox("CategoryParentID"), reader.Unbox("CategoryIDPath"), + reader.Unbox("CategoryNamePath"), reader.Unbox("CategoryLevel"), reader.Unbox("CategoryOrder") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsClass.cs b/KVA/Migration.Toolkit.Source/Model/CmsClass.cs index 0b9715eb..9b8f086a 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsClass.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsClass.cs @@ -1,145 +1,351 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsClass : ISourceModel -{ - int ClassID { get; } - string ClassDisplayName { get; } - string ClassName { get; } - bool ClassUsesVersioning { get; } - bool ClassIsDocumentType { get; } - bool ClassIsCoupledClass { get; } - string ClassXmlSchema { get; } - string ClassFormDefinition { get; } - string ClassNodeNameSource { get; } - string? ClassTableName { get; } - string? ClassFormLayout { get; } - bool? ClassShowAsSystemTable { get; } - bool? ClassUsePublishFromTo { get; } - bool? ClassShowTemplateSelection { get; } - string? ClassSKUMappings { get; } - bool? ClassIsMenuItemType { get; } - string? ClassNodeAliasSource { get; } - DateTime ClassLastModified { get; } - Guid ClassGUID { get; } - bool? ClassCreateSKU { get; } - bool? ClassIsProduct { get; } - bool ClassIsCustomTable { get; } - string? ClassShowColumns { get; } - string? ClassSearchTitleColumn { get; } - string? ClassSearchContentColumn { get; } - string? ClassSearchImageColumn { get; } - string? ClassSearchCreationDateColumn { get; } - string? ClassSearchSettings { get; } - int? ClassInheritsFromClassID { get; } - bool? ClassSearchEnabled { get; } - string? ClassSKUDefaultDepartmentName { get; } - int? ClassSKUDefaultDepartmentID { get; } - string? ClassContactMapping { get; } - bool? ClassContactOverwriteEnabled { get; } - string? ClassSKUDefaultProductType { get; } - string? ClassConnectionString { get; } - bool? ClassIsProductSection { get; } - string? ClassFormLayoutType { get; } - string? ClassVersionGUID { get; } - string? ClassDefaultObjectType { get; } - bool? ClassIsForm { get; } - int? ClassResourceID { get; } - string? ClassCustomizedColumns { get; } - string? ClassCodeGenerationSettings { get; } - string? ClassIconClass { get; } - string? ClassURLPattern { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsClassK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsClassK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsClassK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsClassK11.IsAvailable(version), - { Major: 12 } => CmsClassK12.IsAvailable(version), - { Major: 13 } => CmsClassK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Class"; - static string ISourceModel.GuidColumnName => "ClassGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsClass ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsClassK11.FromReader(reader, version), - { Major: 12 } => CmsClassK12.FromReader(reader, version), - { Major: 13 } => CmsClassK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsClassK11(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string? ClassEditingPageUrl, string? ClassListPageUrl, string ClassNodeNameSource, string? ClassTableName, string? ClassViewPageUrl, string? ClassPreviewPageUrl, string? ClassFormLayout, string? ClassNewPageUrl, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, int? ClassDefaultPageTemplateID, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, int? ClassPageTemplateCategoryID, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, bool? ClassIsContentOnly, string? ClassURLPattern) : ICmsClass, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_Class"; - public static string GuidColumnName => "ClassGUID"; - static CmsClassK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassK11( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") - ); - } - public static CmsClassK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassK11( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") - ); - } -}; -public partial record CmsClassK12(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string? ClassEditingPageUrl, string? ClassListPageUrl, string ClassNodeNameSource, string? ClassTableName, string? ClassViewPageUrl, string? ClassPreviewPageUrl, string? ClassFormLayout, string? ClassNewPageUrl, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, int? ClassDefaultPageTemplateID, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, int? ClassPageTemplateCategoryID, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, bool? ClassIsContentOnly, string? ClassURLPattern) : ICmsClass, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_Class"; - public static string GuidColumnName => "ClassGUID"; - static CmsClassK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassK12( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") - ); - } - public static CmsClassK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassK12( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") - ); - } -}; -public partial record CmsClassK13(int ClassID, string ClassDisplayName, string ClassName, bool ClassUsesVersioning, bool ClassIsDocumentType, bool ClassIsCoupledClass, string ClassXmlSchema, string ClassFormDefinition, string ClassNodeNameSource, string? ClassTableName, string? ClassFormLayout, bool? ClassShowAsSystemTable, bool? ClassUsePublishFromTo, bool? ClassShowTemplateSelection, string? ClassSKUMappings, bool? ClassIsMenuItemType, string? ClassNodeAliasSource, DateTime ClassLastModified, Guid ClassGUID, bool? ClassCreateSKU, bool? ClassIsProduct, bool ClassIsCustomTable, string? ClassShowColumns, string? ClassSearchTitleColumn, string? ClassSearchContentColumn, string? ClassSearchImageColumn, string? ClassSearchCreationDateColumn, string? ClassSearchSettings, int? ClassInheritsFromClassID, bool? ClassSearchEnabled, string? ClassSKUDefaultDepartmentName, int? ClassSKUDefaultDepartmentID, string? ClassContactMapping, bool? ClassContactOverwriteEnabled, string? ClassSKUDefaultProductType, string? ClassConnectionString, bool? ClassIsProductSection, string? ClassFormLayoutType, string? ClassVersionGUID, string? ClassDefaultObjectType, bool? ClassIsForm, int? ClassResourceID, string? ClassCustomizedColumns, string? ClassCodeGenerationSettings, string? ClassIconClass, string? ClassURLPattern, bool ClassUsesPageBuilder, bool ClassIsNavigationItem, bool ClassHasURL, bool ClassHasMetadata, int? ClassSearchIndexDataSource) : ICmsClass, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_Class"; - public static string GuidColumnName => "ClassGUID"; - static CmsClassK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassK13( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassURLPattern"), reader.Unbox("ClassUsesPageBuilder"), reader.Unbox("ClassIsNavigationItem"), reader.Unbox("ClassHasURL"), reader.Unbox("ClassHasMetadata"), reader.Unbox("ClassSearchIndexDataSource") - ); - } - public static CmsClassK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassK13( - reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassURLPattern"), reader.Unbox("ClassUsesPageBuilder"), reader.Unbox("ClassIsNavigationItem"), reader.Unbox("ClassHasURL"), reader.Unbox("ClassHasMetadata"), reader.Unbox("ClassSearchIndexDataSource") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsClass : ISourceModel +{ + int ClassID { get; } + string ClassDisplayName { get; } + string ClassName { get; } + bool ClassUsesVersioning { get; } + bool ClassIsDocumentType { get; } + bool ClassIsCoupledClass { get; } + string ClassXmlSchema { get; } + string ClassFormDefinition { get; } + string ClassNodeNameSource { get; } + string? ClassTableName { get; } + string? ClassFormLayout { get; } + bool? ClassShowAsSystemTable { get; } + bool? ClassUsePublishFromTo { get; } + bool? ClassShowTemplateSelection { get; } + string? ClassSKUMappings { get; } + bool? ClassIsMenuItemType { get; } + string? ClassNodeAliasSource { get; } + DateTime ClassLastModified { get; } + Guid ClassGUID { get; } + bool? ClassCreateSKU { get; } + bool? ClassIsProduct { get; } + bool ClassIsCustomTable { get; } + string? ClassShowColumns { get; } + string? ClassSearchTitleColumn { get; } + string? ClassSearchContentColumn { get; } + string? ClassSearchImageColumn { get; } + string? ClassSearchCreationDateColumn { get; } + string? ClassSearchSettings { get; } + int? ClassInheritsFromClassID { get; } + bool? ClassSearchEnabled { get; } + string? ClassSKUDefaultDepartmentName { get; } + int? ClassSKUDefaultDepartmentID { get; } + string? ClassContactMapping { get; } + bool? ClassContactOverwriteEnabled { get; } + string? ClassSKUDefaultProductType { get; } + string? ClassConnectionString { get; } + bool? ClassIsProductSection { get; } + string? ClassFormLayoutType { get; } + string? ClassVersionGUID { get; } + string? ClassDefaultObjectType { get; } + bool? ClassIsForm { get; } + int? ClassResourceID { get; } + string? ClassCustomizedColumns { get; } + string? ClassCodeGenerationSettings { get; } + string? ClassIconClass { get; } + string? ClassURLPattern { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsClassK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsClassK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassK11.IsAvailable(version), + { Major: 12 } => CmsClassK12.IsAvailable(version), + { Major: 13 } => CmsClassK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Class"; + static string ISourceModel.GuidColumnName => "ClassGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsClass ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassK11.FromReader(reader, version), + { Major: 12 } => CmsClassK12.FromReader(reader, version), + { Major: 13 } => CmsClassK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsClassK11( + int ClassID, + string ClassDisplayName, + string ClassName, + bool ClassUsesVersioning, + bool ClassIsDocumentType, + bool ClassIsCoupledClass, + string ClassXmlSchema, + string ClassFormDefinition, + string? ClassEditingPageUrl, + string? ClassListPageUrl, + string ClassNodeNameSource, + string? ClassTableName, + string? ClassViewPageUrl, + string? ClassPreviewPageUrl, + string? ClassFormLayout, + string? ClassNewPageUrl, + bool? ClassShowAsSystemTable, + bool? ClassUsePublishFromTo, + bool? ClassShowTemplateSelection, + string? ClassSKUMappings, + bool? ClassIsMenuItemType, + string? ClassNodeAliasSource, + int? ClassDefaultPageTemplateID, + DateTime ClassLastModified, + Guid ClassGUID, + bool? ClassCreateSKU, + bool? ClassIsProduct, + bool ClassIsCustomTable, + string? ClassShowColumns, + string? ClassSearchTitleColumn, + string? ClassSearchContentColumn, + string? ClassSearchImageColumn, + string? ClassSearchCreationDateColumn, + string? ClassSearchSettings, + int? ClassInheritsFromClassID, + bool? ClassSearchEnabled, + string? ClassSKUDefaultDepartmentName, + int? ClassSKUDefaultDepartmentID, + string? ClassContactMapping, + bool? ClassContactOverwriteEnabled, + string? ClassSKUDefaultProductType, + string? ClassConnectionString, + bool? ClassIsProductSection, + int? ClassPageTemplateCategoryID, + string? ClassFormLayoutType, + string? ClassVersionGUID, + string? ClassDefaultObjectType, + bool? ClassIsForm, + int? ClassResourceID, + string? ClassCustomizedColumns, + string? ClassCodeGenerationSettings, + string? ClassIconClass, + bool? ClassIsContentOnly, + string? ClassURLPattern) : ICmsClass, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_Class"; + public static string GuidColumnName => "ClassGUID"; + + static CmsClassK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), + reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), + reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), + reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), + reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), + reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), + reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), + reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), + reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), + reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), + reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") + ); + + public static CmsClassK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), + reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), + reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), + reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), + reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), + reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), + reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), + reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), + reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), + reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), + reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") + ); +} + +public record CmsClassK12( + int ClassID, + string ClassDisplayName, + string ClassName, + bool ClassUsesVersioning, + bool ClassIsDocumentType, + bool ClassIsCoupledClass, + string ClassXmlSchema, + string ClassFormDefinition, + string? ClassEditingPageUrl, + string? ClassListPageUrl, + string ClassNodeNameSource, + string? ClassTableName, + string? ClassViewPageUrl, + string? ClassPreviewPageUrl, + string? ClassFormLayout, + string? ClassNewPageUrl, + bool? ClassShowAsSystemTable, + bool? ClassUsePublishFromTo, + bool? ClassShowTemplateSelection, + string? ClassSKUMappings, + bool? ClassIsMenuItemType, + string? ClassNodeAliasSource, + int? ClassDefaultPageTemplateID, + DateTime ClassLastModified, + Guid ClassGUID, + bool? ClassCreateSKU, + bool? ClassIsProduct, + bool ClassIsCustomTable, + string? ClassShowColumns, + string? ClassSearchTitleColumn, + string? ClassSearchContentColumn, + string? ClassSearchImageColumn, + string? ClassSearchCreationDateColumn, + string? ClassSearchSettings, + int? ClassInheritsFromClassID, + bool? ClassSearchEnabled, + string? ClassSKUDefaultDepartmentName, + int? ClassSKUDefaultDepartmentID, + string? ClassContactMapping, + bool? ClassContactOverwriteEnabled, + string? ClassSKUDefaultProductType, + string? ClassConnectionString, + bool? ClassIsProductSection, + int? ClassPageTemplateCategoryID, + string? ClassFormLayoutType, + string? ClassVersionGUID, + string? ClassDefaultObjectType, + bool? ClassIsForm, + int? ClassResourceID, + string? ClassCustomizedColumns, + string? ClassCodeGenerationSettings, + string? ClassIconClass, + bool? ClassIsContentOnly, + string? ClassURLPattern) : ICmsClass, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_Class"; + public static string GuidColumnName => "ClassGUID"; + + static CmsClassK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), + reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), + reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), + reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), + reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), + reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), + reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), + reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), + reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), + reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), + reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") + ); + + public static CmsClassK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), + reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassEditingPageUrl"), reader.Unbox("ClassListPageUrl"), reader.Unbox("ClassNodeNameSource"), + reader.Unbox("ClassTableName"), reader.Unbox("ClassViewPageUrl"), reader.Unbox("ClassPreviewPageUrl"), reader.Unbox("ClassFormLayout"), reader.Unbox("ClassNewPageUrl"), + reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), + reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassDefaultPageTemplateID"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), + reader.Unbox("ClassIsProduct"), reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), + reader.Unbox("ClassSearchImageColumn"), reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), + reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), + reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassPageTemplateCategoryID"), + reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), + reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), reader.Unbox("ClassIconClass"), reader.Unbox("ClassIsContentOnly"), reader.Unbox("ClassURLPattern") + ); +} + +public record CmsClassK13( + int ClassID, + string ClassDisplayName, + string ClassName, + bool ClassUsesVersioning, + bool ClassIsDocumentType, + bool ClassIsCoupledClass, + string ClassXmlSchema, + string ClassFormDefinition, + string ClassNodeNameSource, + string? ClassTableName, + string? ClassFormLayout, + bool? ClassShowAsSystemTable, + bool? ClassUsePublishFromTo, + bool? ClassShowTemplateSelection, + string? ClassSKUMappings, + bool? ClassIsMenuItemType, + string? ClassNodeAliasSource, + DateTime ClassLastModified, + Guid ClassGUID, + bool? ClassCreateSKU, + bool? ClassIsProduct, + bool ClassIsCustomTable, + string? ClassShowColumns, + string? ClassSearchTitleColumn, + string? ClassSearchContentColumn, + string? ClassSearchImageColumn, + string? ClassSearchCreationDateColumn, + string? ClassSearchSettings, + int? ClassInheritsFromClassID, + bool? ClassSearchEnabled, + string? ClassSKUDefaultDepartmentName, + int? ClassSKUDefaultDepartmentID, + string? ClassContactMapping, + bool? ClassContactOverwriteEnabled, + string? ClassSKUDefaultProductType, + string? ClassConnectionString, + bool? ClassIsProductSection, + string? ClassFormLayoutType, + string? ClassVersionGUID, + string? ClassDefaultObjectType, + bool? ClassIsForm, + int? ClassResourceID, + string? ClassCustomizedColumns, + string? ClassCodeGenerationSettings, + string? ClassIconClass, + string? ClassURLPattern, + bool ClassUsesPageBuilder, + bool ClassIsNavigationItem, + bool ClassHasURL, + bool ClassHasMetadata, + int? ClassSearchIndexDataSource) : ICmsClass, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_Class"; + public static string GuidColumnName => "ClassGUID"; + + static CmsClassK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), + reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassFormLayout"), + reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), + reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), + reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), + reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), + reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), + reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), + reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), + reader.Unbox("ClassIconClass"), reader.Unbox("ClassURLPattern"), reader.Unbox("ClassUsesPageBuilder"), reader.Unbox("ClassIsNavigationItem"), reader.Unbox("ClassHasURL"), + reader.Unbox("ClassHasMetadata"), reader.Unbox("ClassSearchIndexDataSource") + ); + + public static CmsClassK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("ClassDisplayName"), reader.Unbox("ClassName"), reader.Unbox("ClassUsesVersioning"), reader.Unbox("ClassIsDocumentType"), reader.Unbox("ClassIsCoupledClass"), + reader.Unbox("ClassXmlSchema"), reader.Unbox("ClassFormDefinition"), reader.Unbox("ClassNodeNameSource"), reader.Unbox("ClassTableName"), reader.Unbox("ClassFormLayout"), + reader.Unbox("ClassShowAsSystemTable"), reader.Unbox("ClassUsePublishFromTo"), reader.Unbox("ClassShowTemplateSelection"), reader.Unbox("ClassSKUMappings"), reader.Unbox("ClassIsMenuItemType"), + reader.Unbox("ClassNodeAliasSource"), reader.Unbox("ClassLastModified"), reader.Unbox("ClassGUID"), reader.Unbox("ClassCreateSKU"), reader.Unbox("ClassIsProduct"), + reader.Unbox("ClassIsCustomTable"), reader.Unbox("ClassShowColumns"), reader.Unbox("ClassSearchTitleColumn"), reader.Unbox("ClassSearchContentColumn"), reader.Unbox("ClassSearchImageColumn"), + reader.Unbox("ClassSearchCreationDateColumn"), reader.Unbox("ClassSearchSettings"), reader.Unbox("ClassInheritsFromClassID"), reader.Unbox("ClassSearchEnabled"), + reader.Unbox("ClassSKUDefaultDepartmentName"), reader.Unbox("ClassSKUDefaultDepartmentID"), reader.Unbox("ClassContactMapping"), reader.Unbox("ClassContactOverwriteEnabled"), + reader.Unbox("ClassSKUDefaultProductType"), reader.Unbox("ClassConnectionString"), reader.Unbox("ClassIsProductSection"), reader.Unbox("ClassFormLayoutType"), reader.Unbox("ClassVersionGUID"), + reader.Unbox("ClassDefaultObjectType"), reader.Unbox("ClassIsForm"), reader.Unbox("ClassResourceID"), reader.Unbox("ClassCustomizedColumns"), reader.Unbox("ClassCodeGenerationSettings"), + reader.Unbox("ClassIconClass"), reader.Unbox("ClassURLPattern"), reader.Unbox("ClassUsesPageBuilder"), reader.Unbox("ClassIsNavigationItem"), reader.Unbox("ClassHasURL"), + reader.Unbox("ClassHasMetadata"), reader.Unbox("ClassSearchIndexDataSource") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs b/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs index c320449c..d46f8d05 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsClassSite.cs @@ -1,101 +1,88 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsClassSite : ISourceModel -{ - int ClassID { get; } - int SiteID { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsClassSiteK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsClassSiteK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsClassSiteK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsClassSiteK11.IsAvailable(version), - { Major: 12 } => CmsClassSiteK12.IsAvailable(version), - { Major: 13 } => CmsClassSiteK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_ClassSite"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsClassSite ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsClassSiteK11.FromReader(reader, version), - { Major: 12 } => CmsClassSiteK12.FromReader(reader, version), - { Major: 13 } => CmsClassSiteK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsClassSiteK11(int ClassID, int SiteID) : ICmsClassSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_ClassSite"; - public static string GuidColumnName => ""; - static CmsClassSiteK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassSiteK11( - reader.Unbox("ClassID"), reader.Unbox("SiteID") - ); - } - public static CmsClassSiteK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassSiteK11( - reader.Unbox("ClassID"), reader.Unbox("SiteID") - ); - } -}; -public partial record CmsClassSiteK12(int ClassID, int SiteID) : ICmsClassSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_ClassSite"; - public static string GuidColumnName => ""; - static CmsClassSiteK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassSiteK12( - reader.Unbox("ClassID"), reader.Unbox("SiteID") - ); - } - public static CmsClassSiteK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassSiteK12( - reader.Unbox("ClassID"), reader.Unbox("SiteID") - ); - } -}; -public partial record CmsClassSiteK13(int ClassID, int SiteID) : ICmsClassSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; - public static string TableName => "CMS_ClassSite"; - public static string GuidColumnName => ""; - static CmsClassSiteK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassSiteK13( - reader.Unbox("ClassID"), reader.Unbox("SiteID") - ); - } - public static CmsClassSiteK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsClassSiteK13( - reader.Unbox("ClassID"), reader.Unbox("SiteID") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsClassSite : ISourceModel +{ + int ClassID { get; } + int SiteID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassSiteK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsClassSiteK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsClassSiteK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassSiteK11.IsAvailable(version), + { Major: 12 } => CmsClassSiteK12.IsAvailable(version), + { Major: 13 } => CmsClassSiteK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_ClassSite"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsClassSite ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsClassSiteK11.FromReader(reader, version), + { Major: 12 } => CmsClassSiteK12.FromReader(reader, version), + { Major: 13 } => CmsClassSiteK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsClassSiteK11(int ClassID, int SiteID) : ICmsClassSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_ClassSite"; + public static string GuidColumnName => ""; + + static CmsClassSiteK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("SiteID") + ); + + public static CmsClassSiteK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("SiteID") + ); +} + +public record CmsClassSiteK12(int ClassID, int SiteID) : ICmsClassSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_ClassSite"; + public static string GuidColumnName => ""; + + static CmsClassSiteK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("SiteID") + ); + + public static CmsClassSiteK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("SiteID") + ); +} + +public record CmsClassSiteK13(int ClassID, int SiteID) : ICmsClassSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ClassID"; + public static string TableName => "CMS_ClassSite"; + public static string GuidColumnName => ""; + + static CmsClassSiteK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("SiteID") + ); + + public static CmsClassSiteK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ClassID"), reader.Unbox("SiteID") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs index 8a6814a9..c85a52d2 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsConsent.cs @@ -1,106 +1,99 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsConsent : ISourceModel -{ - int ConsentID { get; } - string ConsentDisplayName { get; } - string ConsentName { get; } - string ConsentContent { get; } - Guid ConsentGuid { get; } - DateTime ConsentLastModified { get; } - string ConsentHash { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsConsentK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsConsentK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentK11.IsAvailable(version), - { Major: 12 } => CmsConsentK12.IsAvailable(version), - { Major: 13 } => CmsConsentK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Consent"; - static string ISourceModel.GuidColumnName => "ConsentGuid"; //assumtion, class Guid column doesn't change between versions - static ICmsConsent ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentK11.FromReader(reader, version), - { Major: 12 } => CmsConsentK12.FromReader(reader, version), - { Major: 13 } => CmsConsentK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsConsentK11(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; - public static string TableName => "CMS_Consent"; - public static string GuidColumnName => "ConsentGuid"; - static CmsConsentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentK11( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - } - public static CmsConsentK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentK11( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - } -}; -public partial record CmsConsentK12(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; - public static string TableName => "CMS_Consent"; - public static string GuidColumnName => "ConsentGuid"; - static CmsConsentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentK12( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - } - public static CmsConsentK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentK12( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - } -}; -public partial record CmsConsentK13(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; - public static string TableName => "CMS_Consent"; - public static string GuidColumnName => "ConsentGuid"; - static CmsConsentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentK13( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - } - public static CmsConsentK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentK13( - reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), reader.Unbox("ConsentHash") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsConsent : ISourceModel +{ + int ConsentID { get; } + string ConsentDisplayName { get; } + string ConsentName { get; } + string ConsentContent { get; } + Guid ConsentGuid { get; } + DateTime ConsentLastModified { get; } + string ConsentHash { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsConsentK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsConsentK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentK11.IsAvailable(version), + { Major: 12 } => CmsConsentK12.IsAvailable(version), + { Major: 13 } => CmsConsentK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Consent"; + static string ISourceModel.GuidColumnName => "ConsentGuid"; //assumtion, class Guid column doesn't change between versions + + static ICmsConsent ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentK11.FromReader(reader, version), + { Major: 12 } => CmsConsentK12.FromReader(reader, version), + { Major: 13 } => CmsConsentK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsConsentK11(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; + public static string TableName => "CMS_Consent"; + public static string GuidColumnName => "ConsentGuid"; + + static CmsConsentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), + reader.Unbox("ConsentHash") + ); + + public static CmsConsentK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), + reader.Unbox("ConsentHash") + ); +} + +public record CmsConsentK12(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; + public static string TableName => "CMS_Consent"; + public static string GuidColumnName => "ConsentGuid"; + + static CmsConsentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), + reader.Unbox("ConsentHash") + ); + + public static CmsConsentK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), + reader.Unbox("ConsentHash") + ); +} + +public record CmsConsentK13(int ConsentID, string ConsentDisplayName, string ConsentName, string ConsentContent, Guid ConsentGuid, DateTime ConsentLastModified, string ConsentHash) : ICmsConsent, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentID"; + public static string TableName => "CMS_Consent"; + public static string GuidColumnName => "ConsentGuid"; + + static CmsConsentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), + reader.Unbox("ConsentHash") + ); + + public static CmsConsentK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentID"), reader.Unbox("ConsentDisplayName"), reader.Unbox("ConsentName"), reader.Unbox("ConsentContent"), reader.Unbox("ConsentGuid"), reader.Unbox("ConsentLastModified"), + reader.Unbox("ConsentHash") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs index c8c49113..b511c54c 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsConsentAgreement.cs @@ -1,106 +1,102 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsConsentAgreement : ISourceModel -{ - int ConsentAgreementID { get; } - Guid ConsentAgreementGuid { get; } - bool ConsentAgreementRevoked { get; } - int ConsentAgreementContactID { get; } - int ConsentAgreementConsentID { get; } - string? ConsentAgreementConsentHash { get; } - DateTime ConsentAgreementTime { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentAgreementK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsConsentAgreementK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsConsentAgreementK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentAgreementK11.IsAvailable(version), - { Major: 12 } => CmsConsentAgreementK12.IsAvailable(version), - { Major: 13 } => CmsConsentAgreementK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_ConsentAgreement"; - static string ISourceModel.GuidColumnName => "ConsentAgreementGuid"; //assumtion, class Guid column doesn't change between versions - static ICmsConsentAgreement ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentAgreementK11.FromReader(reader, version), - { Major: 12 } => CmsConsentAgreementK12.FromReader(reader, version), - { Major: 13 } => CmsConsentAgreementK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsConsentAgreementK11(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; - public static string TableName => "CMS_ConsentAgreement"; - public static string GuidColumnName => "ConsentAgreementGuid"; - static CmsConsentAgreementK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentAgreementK11( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - } - public static CmsConsentAgreementK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentAgreementK11( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - } -}; -public partial record CmsConsentAgreementK12(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; - public static string TableName => "CMS_ConsentAgreement"; - public static string GuidColumnName => "ConsentAgreementGuid"; - static CmsConsentAgreementK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentAgreementK12( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - } - public static CmsConsentAgreementK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentAgreementK12( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - } -}; -public partial record CmsConsentAgreementK13(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) : ICmsConsentAgreement, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; - public static string TableName => "CMS_ConsentAgreement"; - public static string GuidColumnName => "ConsentAgreementGuid"; - static CmsConsentAgreementK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentAgreementK13( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - } - public static CmsConsentAgreementK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentAgreementK13( - reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsConsentAgreement : ISourceModel +{ + int ConsentAgreementID { get; } + Guid ConsentAgreementGuid { get; } + bool ConsentAgreementRevoked { get; } + int ConsentAgreementContactID { get; } + int ConsentAgreementConsentID { get; } + string? ConsentAgreementConsentHash { get; } + DateTime ConsentAgreementTime { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentAgreementK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsConsentAgreementK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsConsentAgreementK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentAgreementK11.IsAvailable(version), + { Major: 12 } => CmsConsentAgreementK12.IsAvailable(version), + { Major: 13 } => CmsConsentAgreementK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_ConsentAgreement"; + static string ISourceModel.GuidColumnName => "ConsentAgreementGuid"; //assumtion, class Guid column doesn't change between versions + + static ICmsConsentAgreement ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentAgreementK11.FromReader(reader, version), + { Major: 12 } => CmsConsentAgreementK12.FromReader(reader, version), + { Major: 13 } => CmsConsentAgreementK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsConsentAgreementK11(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) + : ICmsConsentAgreement, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; + public static string TableName => "CMS_ConsentAgreement"; + public static string GuidColumnName => "ConsentAgreementGuid"; + + static CmsConsentAgreementK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), + reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); + + public static CmsConsentAgreementK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), + reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); +} + +public record CmsConsentAgreementK12(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) + : ICmsConsentAgreement, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; + public static string TableName => "CMS_ConsentAgreement"; + public static string GuidColumnName => "ConsentAgreementGuid"; + + static CmsConsentAgreementK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), + reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); + + public static CmsConsentAgreementK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), + reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); +} + +public record CmsConsentAgreementK13(int ConsentAgreementID, Guid ConsentAgreementGuid, bool ConsentAgreementRevoked, int ConsentAgreementContactID, int ConsentAgreementConsentID, string? ConsentAgreementConsentHash, DateTime ConsentAgreementTime) + : ICmsConsentAgreement, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentAgreementID"; + public static string TableName => "CMS_ConsentAgreement"; + public static string GuidColumnName => "ConsentAgreementGuid"; + + static CmsConsentAgreementK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), + reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); + + public static CmsConsentAgreementK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentAgreementID"), reader.Unbox("ConsentAgreementGuid"), reader.Unbox("ConsentAgreementRevoked"), reader.Unbox("ConsentAgreementContactID"), reader.Unbox("ConsentAgreementConsentID"), + reader.Unbox("ConsentAgreementConsentHash"), reader.Unbox("ConsentAgreementTime") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs b/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs index e016956b..042944bf 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsConsentArchive.cs @@ -1,105 +1,101 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsConsentArchive : ISourceModel -{ - int ConsentArchiveID { get; } - Guid ConsentArchiveGuid { get; } - DateTime ConsentArchiveLastModified { get; } - int ConsentArchiveConsentID { get; } - string ConsentArchiveHash { get; } - string ConsentArchiveContent { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentArchiveK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsConsentArchiveK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsConsentArchiveK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentArchiveK11.IsAvailable(version), - { Major: 12 } => CmsConsentArchiveK12.IsAvailable(version), - { Major: 13 } => CmsConsentArchiveK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_ConsentArchive"; - static string ISourceModel.GuidColumnName => "ConsentArchiveGuid"; //assumtion, class Guid column doesn't change between versions - static ICmsConsentArchive ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsConsentArchiveK11.FromReader(reader, version), - { Major: 12 } => CmsConsentArchiveK12.FromReader(reader, version), - { Major: 13 } => CmsConsentArchiveK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsConsentArchiveK11(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; - public static string TableName => "CMS_ConsentArchive"; - public static string GuidColumnName => "ConsentArchiveGuid"; - static CmsConsentArchiveK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentArchiveK11( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - } - public static CmsConsentArchiveK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentArchiveK11( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - } -}; -public partial record CmsConsentArchiveK12(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; - public static string TableName => "CMS_ConsentArchive"; - public static string GuidColumnName => "ConsentArchiveGuid"; - static CmsConsentArchiveK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentArchiveK12( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - } - public static CmsConsentArchiveK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentArchiveK12( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - } -}; -public partial record CmsConsentArchiveK13(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) : ICmsConsentArchive, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; - public static string TableName => "CMS_ConsentArchive"; - public static string GuidColumnName => "ConsentArchiveGuid"; - static CmsConsentArchiveK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentArchiveK13( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - } - public static CmsConsentArchiveK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsConsentArchiveK13( - reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), reader.Unbox("ConsentArchiveContent") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsConsentArchive : ISourceModel +{ + int ConsentArchiveID { get; } + Guid ConsentArchiveGuid { get; } + DateTime ConsentArchiveLastModified { get; } + int ConsentArchiveConsentID { get; } + string ConsentArchiveHash { get; } + string ConsentArchiveContent { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentArchiveK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsConsentArchiveK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsConsentArchiveK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentArchiveK11.IsAvailable(version), + { Major: 12 } => CmsConsentArchiveK12.IsAvailable(version), + { Major: 13 } => CmsConsentArchiveK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_ConsentArchive"; + static string ISourceModel.GuidColumnName => "ConsentArchiveGuid"; //assumtion, class Guid column doesn't change between versions + + static ICmsConsentArchive ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsConsentArchiveK11.FromReader(reader, version), + { Major: 12 } => CmsConsentArchiveK12.FromReader(reader, version), + { Major: 13 } => CmsConsentArchiveK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsConsentArchiveK11(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) + : ICmsConsentArchive, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; + public static string TableName => "CMS_ConsentArchive"; + public static string GuidColumnName => "ConsentArchiveGuid"; + + static CmsConsentArchiveK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), + reader.Unbox("ConsentArchiveContent") + ); + + public static CmsConsentArchiveK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), + reader.Unbox("ConsentArchiveContent") + ); +} + +public record CmsConsentArchiveK12(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) + : ICmsConsentArchive, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; + public static string TableName => "CMS_ConsentArchive"; + public static string GuidColumnName => "ConsentArchiveGuid"; + + static CmsConsentArchiveK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), + reader.Unbox("ConsentArchiveContent") + ); + + public static CmsConsentArchiveK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), + reader.Unbox("ConsentArchiveContent") + ); +} + +public record CmsConsentArchiveK13(int ConsentArchiveID, Guid ConsentArchiveGuid, DateTime ConsentArchiveLastModified, int ConsentArchiveConsentID, string ConsentArchiveHash, string ConsentArchiveContent) + : ICmsConsentArchive, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ConsentArchiveID"; + public static string TableName => "CMS_ConsentArchive"; + public static string GuidColumnName => "ConsentArchiveGuid"; + + static CmsConsentArchiveK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), + reader.Unbox("ConsentArchiveContent") + ); + + public static CmsConsentArchiveK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ConsentArchiveID"), reader.Unbox("ConsentArchiveGuid"), reader.Unbox("ConsentArchiveLastModified"), reader.Unbox("ConsentArchiveConsentID"), reader.Unbox("ConsentArchiveHash"), + reader.Unbox("ConsentArchiveContent") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs b/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs index e9b7b4f6..28ea12b0 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsCountry.cs @@ -1,106 +1,99 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsCountry : ISourceModel -{ - int CountryID { get; } - string CountryDisplayName { get; } - string CountryName { get; } - Guid CountryGUID { get; } - DateTime CountryLastModified { get; } - string? CountryTwoLetterCode { get; } - string? CountryThreeLetterCode { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCountryK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsCountryK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsCountryK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCountryK11.IsAvailable(version), - { Major: 12 } => CmsCountryK12.IsAvailable(version), - { Major: 13 } => CmsCountryK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Country"; - static string ISourceModel.GuidColumnName => "CountryGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsCountry ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCountryK11.FromReader(reader, version), - { Major: 12 } => CmsCountryK12.FromReader(reader, version), - { Major: 13 } => CmsCountryK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsCountryK11(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; - public static string TableName => "CMS_Country"; - public static string GuidColumnName => "CountryGUID"; - static CmsCountryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCountryK11( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - } - public static CmsCountryK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCountryK11( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - } -}; -public partial record CmsCountryK12(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; - public static string TableName => "CMS_Country"; - public static string GuidColumnName => "CountryGUID"; - static CmsCountryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCountryK12( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - } - public static CmsCountryK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCountryK12( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - } -}; -public partial record CmsCountryK13(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; - public static string TableName => "CMS_Country"; - public static string GuidColumnName => "CountryGUID"; - static CmsCountryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCountryK13( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - } - public static CmsCountryK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCountryK13( - reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), reader.Unbox("CountryThreeLetterCode") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsCountry : ISourceModel +{ + int CountryID { get; } + string CountryDisplayName { get; } + string CountryName { get; } + Guid CountryGUID { get; } + DateTime CountryLastModified { get; } + string? CountryTwoLetterCode { get; } + string? CountryThreeLetterCode { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCountryK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsCountryK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsCountryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCountryK11.IsAvailable(version), + { Major: 12 } => CmsCountryK12.IsAvailable(version), + { Major: 13 } => CmsCountryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Country"; + static string ISourceModel.GuidColumnName => "CountryGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsCountry ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsCountryK11.FromReader(reader, version), + { Major: 12 } => CmsCountryK12.FromReader(reader, version), + { Major: 13 } => CmsCountryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsCountryK11(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; + public static string TableName => "CMS_Country"; + public static string GuidColumnName => "CountryGUID"; + + static CmsCountryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), + reader.Unbox("CountryThreeLetterCode") + ); + + public static CmsCountryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), + reader.Unbox("CountryThreeLetterCode") + ); +} + +public record CmsCountryK12(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; + public static string TableName => "CMS_Country"; + public static string GuidColumnName => "CountryGUID"; + + static CmsCountryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), + reader.Unbox("CountryThreeLetterCode") + ); + + public static CmsCountryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), + reader.Unbox("CountryThreeLetterCode") + ); +} + +public record CmsCountryK13(int CountryID, string CountryDisplayName, string CountryName, Guid CountryGUID, DateTime CountryLastModified, string? CountryTwoLetterCode, string? CountryThreeLetterCode) : ICmsCountry, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CountryID"; + public static string TableName => "CMS_Country"; + public static string GuidColumnName => "CountryGUID"; + + static CmsCountryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), + reader.Unbox("CountryThreeLetterCode") + ); + + public static CmsCountryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CountryID"), reader.Unbox("CountryDisplayName"), reader.Unbox("CountryName"), reader.Unbox("CountryGUID"), reader.Unbox("CountryLastModified"), reader.Unbox("CountryTwoLetterCode"), + reader.Unbox("CountryThreeLetterCode") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs b/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs index 06ec8a19..71aa6546 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsCulture.cs @@ -1,107 +1,100 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsCulture : ISourceModel -{ - int CultureID { get; } - string CultureName { get; } - string CultureCode { get; } - string CultureShortName { get; } - Guid CultureGUID { get; } - DateTime CultureLastModified { get; } - string? CultureAlias { get; } - bool? CultureIsUICulture { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCultureK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsCultureK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsCultureK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCultureK11.IsAvailable(version), - { Major: 12 } => CmsCultureK12.IsAvailable(version), - { Major: 13 } => CmsCultureK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Culture"; - static string ISourceModel.GuidColumnName => "CultureGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsCulture ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsCultureK11.FromReader(reader, version), - { Major: 12 } => CmsCultureK12.FromReader(reader, version), - { Major: 13 } => CmsCultureK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsCultureK11(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_Culture"; - public static string GuidColumnName => "CultureGUID"; - static CmsCultureK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCultureK11( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - } - public static CmsCultureK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCultureK11( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - } -}; -public partial record CmsCultureK12(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_Culture"; - public static string GuidColumnName => "CultureGUID"; - static CmsCultureK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCultureK12( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - } - public static CmsCultureK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCultureK12( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - } -}; -public partial record CmsCultureK13(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_Culture"; - public static string GuidColumnName => "CultureGUID"; - static CmsCultureK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCultureK13( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - } - public static CmsCultureK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsCultureK13( - reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsCulture : ISourceModel +{ + int CultureID { get; } + string CultureName { get; } + string CultureCode { get; } + string CultureShortName { get; } + Guid CultureGUID { get; } + DateTime CultureLastModified { get; } + string? CultureAlias { get; } + bool? CultureIsUICulture { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCultureK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsCultureK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsCultureK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsCultureK11.IsAvailable(version), + { Major: 12 } => CmsCultureK12.IsAvailable(version), + { Major: 13 } => CmsCultureK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Culture"; + static string ISourceModel.GuidColumnName => "CultureGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsCulture ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsCultureK11.FromReader(reader, version), + { Major: 12 } => CmsCultureK12.FromReader(reader, version), + { Major: 13 } => CmsCultureK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsCultureK11(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_Culture"; + public static string GuidColumnName => "CultureGUID"; + + static CmsCultureK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), + reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); + + public static CmsCultureK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), + reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); +} + +public record CmsCultureK12(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_Culture"; + public static string GuidColumnName => "CultureGUID"; + + static CmsCultureK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), + reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); + + public static CmsCultureK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), + reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); +} + +public record CmsCultureK13(int CultureID, string CultureName, string CultureCode, string CultureShortName, Guid CultureGUID, DateTime CultureLastModified, string? CultureAlias, bool? CultureIsUICulture) : ICmsCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_Culture"; + public static string GuidColumnName => "CultureGUID"; + + static CmsCultureK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), + reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); + + public static CmsCultureK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("CultureID"), reader.Unbox("CultureName"), reader.Unbox("CultureCode"), reader.Unbox("CultureShortName"), reader.Unbox("CultureGUID"), reader.Unbox("CultureLastModified"), + reader.Unbox("CultureAlias"), reader.Unbox("CultureIsUICulture") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs b/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs index ccf5d39e..c62b9659 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsDocument.cs @@ -1,134 +1,389 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsDocument : ISourceModel -{ - int DocumentID { get; } - string DocumentName { get; } - DateTime? DocumentModifiedWhen { get; } - int? DocumentModifiedByUserID { get; } - int? DocumentForeignKeyValue { get; } - int? DocumentCreatedByUserID { get; } - DateTime? DocumentCreatedWhen { get; } - int? DocumentCheckedOutByUserID { get; } - DateTime? DocumentCheckedOutWhen { get; } - int? DocumentCheckedOutVersionHistoryID { get; } - int? DocumentPublishedVersionHistoryID { get; } - int? DocumentWorkflowStepID { get; } - DateTime? DocumentPublishFrom { get; } - DateTime? DocumentPublishTo { get; } - string DocumentCulture { get; } - int DocumentNodeID { get; } - string? DocumentPageTitle { get; } - string? DocumentPageKeyWords { get; } - string? DocumentPageDescription { get; } - string? DocumentContent { get; } - string? DocumentCustomData { get; } - string? DocumentTags { get; } - int? DocumentTagGroupID { get; } - DateTime? DocumentLastPublished { get; } - bool? DocumentSearchExcluded { get; } - string? DocumentLastVersionNumber { get; } - bool? DocumentIsArchived { get; } - Guid? DocumentGUID { get; } - Guid? DocumentWorkflowCycleGUID { get; } - bool? DocumentIsWaitingForTranslation { get; } - string? DocumentSKUName { get; } - string? DocumentSKUDescription { get; } - string? DocumentSKUShortDescription { get; } - string? DocumentWorkflowActionStatus { get; } - bool DocumentCanBePublished { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsDocumentK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsDocumentK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsDocumentK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsDocumentK11.IsAvailable(version), - { Major: 12 } => CmsDocumentK12.IsAvailable(version), - { Major: 13 } => CmsDocumentK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Document"; - static string ISourceModel.GuidColumnName => "DocumentGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsDocument ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsDocumentK11.FromReader(reader, version), - { Major: 12 } => CmsDocumentK12.FromReader(reader, version), - { Major: 13 } => CmsDocumentK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsDocumentK11(int DocumentID, string DocumentName, string? DocumentNamePath, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string? DocumentUrlPath, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, bool DocumentShowInSiteMap, bool DocumentMenuItemHideInNavigation, string? DocumentMenuCaption, string? DocumentMenuStyle, string? DocumentMenuItemImage, string? DocumentMenuItemLeftImage, string? DocumentMenuItemRightImage, int? DocumentPageTemplateID, string? DocumentMenuJavascript, string? DocumentMenuRedirectUrl, bool? DocumentUseNamePathForUrlPath, int? DocumentStylesheetID, string? DocumentContent, string? DocumentMenuClass, string? DocumentMenuStyleHighlighted, string? DocumentMenuClassHighlighted, string? DocumentMenuItemImageHighlighted, string? DocumentMenuItemLeftImageHighlighted, string? DocumentMenuItemRightImageHighlighted, bool? DocumentMenuItemInactive, string? DocumentCustomData, string? DocumentExtensions, string? DocumentTags, int? DocumentTagGroupID, string? DocumentWildcardRule, string? DocumentWebParts, double? DocumentRatingValue, int? DocumentRatings, int? DocumentPriority, string? DocumentType, DateTime? DocumentLastPublished, bool? DocumentUseCustomExtensions, string? DocumentGroupWebParts, bool? DocumentCheckedOutAutomatically, string? DocumentTrackConversionName, string? DocumentConversionValue, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, string? DocumentHash, bool? DocumentLogVisitActivity, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, string? DocumentSitemapSettings, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool? DocumentMenuRedirectToFirstChild, bool DocumentCanBePublished, bool DocumentInheritsStylesheet) : ICmsDocument, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; - public static string TableName => "CMS_Document"; - public static string GuidColumnName => "DocumentGUID"; - static CmsDocumentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentK11( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet") - ); - } - public static CmsDocumentK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentK11( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet") - ); - } -}; -public partial record CmsDocumentK12(int DocumentID, string DocumentName, string? DocumentNamePath, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string? DocumentUrlPath, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, bool DocumentShowInSiteMap, bool DocumentMenuItemHideInNavigation, string? DocumentMenuCaption, string? DocumentMenuStyle, string? DocumentMenuItemImage, string? DocumentMenuItemLeftImage, string? DocumentMenuItemRightImage, int? DocumentPageTemplateID, string? DocumentMenuJavascript, string? DocumentMenuRedirectUrl, bool? DocumentUseNamePathForUrlPath, int? DocumentStylesheetID, string? DocumentContent, string? DocumentMenuClass, string? DocumentMenuStyleHighlighted, string? DocumentMenuClassHighlighted, string? DocumentMenuItemImageHighlighted, string? DocumentMenuItemLeftImageHighlighted, string? DocumentMenuItemRightImageHighlighted, bool? DocumentMenuItemInactive, string? DocumentCustomData, string? DocumentExtensions, string? DocumentTags, int? DocumentTagGroupID, string? DocumentWildcardRule, string? DocumentWebParts, double? DocumentRatingValue, int? DocumentRatings, int? DocumentPriority, string? DocumentType, DateTime? DocumentLastPublished, bool? DocumentUseCustomExtensions, string? DocumentGroupWebParts, bool? DocumentCheckedOutAutomatically, string? DocumentTrackConversionName, string? DocumentConversionValue, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, string? DocumentHash, bool? DocumentLogVisitActivity, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, string? DocumentSitemapSettings, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool? DocumentMenuRedirectToFirstChild, bool DocumentCanBePublished, bool DocumentInheritsStylesheet, string? DocumentPageBuilderWidgets, string? DocumentPageTemplateConfiguration, string? DocumentABTestConfiguration) : ICmsDocument, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; - public static string TableName => "CMS_Document"; - public static string GuidColumnName => "DocumentGUID"; - static CmsDocumentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentK12( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration") - ); - } - public static CmsDocumentK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentK12( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentInheritsStylesheet"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration") - ); - } -}; -public partial record CmsDocumentK13(int DocumentID, string DocumentName, DateTime? DocumentModifiedWhen, int? DocumentModifiedByUserID, int? DocumentForeignKeyValue, int? DocumentCreatedByUserID, DateTime? DocumentCreatedWhen, int? DocumentCheckedOutByUserID, DateTime? DocumentCheckedOutWhen, int? DocumentCheckedOutVersionHistoryID, int? DocumentPublishedVersionHistoryID, int? DocumentWorkflowStepID, DateTime? DocumentPublishFrom, DateTime? DocumentPublishTo, string DocumentCulture, int DocumentNodeID, string? DocumentPageTitle, string? DocumentPageKeyWords, string? DocumentPageDescription, string? DocumentContent, string? DocumentCustomData, string? DocumentTags, int? DocumentTagGroupID, DateTime? DocumentLastPublished, bool? DocumentSearchExcluded, string? DocumentLastVersionNumber, bool? DocumentIsArchived, Guid? DocumentGUID, Guid? DocumentWorkflowCycleGUID, bool? DocumentIsWaitingForTranslation, string? DocumentSKUName, string? DocumentSKUDescription, string? DocumentSKUShortDescription, string? DocumentWorkflowActionStatus, bool DocumentCanBePublished, string? DocumentPageBuilderWidgets, string? DocumentPageTemplateConfiguration, string? DocumentABTestConfiguration, bool DocumentShowInMenu) : ICmsDocument, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; - public static string TableName => "CMS_Document"; - public static string GuidColumnName => "DocumentGUID"; - static CmsDocumentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentK13( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration"), reader.Unbox("DocumentShowInMenu") - ); - } - public static CmsDocumentK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentK13( - reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration"), reader.Unbox("DocumentShowInMenu") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsDocument : ISourceModel +{ + int DocumentID { get; } + string DocumentName { get; } + DateTime? DocumentModifiedWhen { get; } + int? DocumentModifiedByUserID { get; } + int? DocumentForeignKeyValue { get; } + int? DocumentCreatedByUserID { get; } + DateTime? DocumentCreatedWhen { get; } + int? DocumentCheckedOutByUserID { get; } + DateTime? DocumentCheckedOutWhen { get; } + int? DocumentCheckedOutVersionHistoryID { get; } + int? DocumentPublishedVersionHistoryID { get; } + int? DocumentWorkflowStepID { get; } + DateTime? DocumentPublishFrom { get; } + DateTime? DocumentPublishTo { get; } + string DocumentCulture { get; } + int DocumentNodeID { get; } + string? DocumentPageTitle { get; } + string? DocumentPageKeyWords { get; } + string? DocumentPageDescription { get; } + string? DocumentContent { get; } + string? DocumentCustomData { get; } + string? DocumentTags { get; } + int? DocumentTagGroupID { get; } + DateTime? DocumentLastPublished { get; } + bool? DocumentSearchExcluded { get; } + string? DocumentLastVersionNumber { get; } + bool? DocumentIsArchived { get; } + Guid? DocumentGUID { get; } + Guid? DocumentWorkflowCycleGUID { get; } + bool? DocumentIsWaitingForTranslation { get; } + string? DocumentSKUName { get; } + string? DocumentSKUDescription { get; } + string? DocumentSKUShortDescription { get; } + string? DocumentWorkflowActionStatus { get; } + bool DocumentCanBePublished { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsDocumentK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsDocumentK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentK11.IsAvailable(version), + { Major: 12 } => CmsDocumentK12.IsAvailable(version), + { Major: 13 } => CmsDocumentK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Document"; + static string ISourceModel.GuidColumnName => "DocumentGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsDocument ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentK11.FromReader(reader, version), + { Major: 12 } => CmsDocumentK12.FromReader(reader, version), + { Major: 13 } => CmsDocumentK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsDocumentK11( + int DocumentID, + string DocumentName, + string? DocumentNamePath, + DateTime? DocumentModifiedWhen, + int? DocumentModifiedByUserID, + int? DocumentForeignKeyValue, + int? DocumentCreatedByUserID, + DateTime? DocumentCreatedWhen, + int? DocumentCheckedOutByUserID, + DateTime? DocumentCheckedOutWhen, + int? DocumentCheckedOutVersionHistoryID, + int? DocumentPublishedVersionHistoryID, + int? DocumentWorkflowStepID, + DateTime? DocumentPublishFrom, + DateTime? DocumentPublishTo, + string? DocumentUrlPath, + string DocumentCulture, + int DocumentNodeID, + string? DocumentPageTitle, + string? DocumentPageKeyWords, + string? DocumentPageDescription, + bool DocumentShowInSiteMap, + bool DocumentMenuItemHideInNavigation, + string? DocumentMenuCaption, + string? DocumentMenuStyle, + string? DocumentMenuItemImage, + string? DocumentMenuItemLeftImage, + string? DocumentMenuItemRightImage, + int? DocumentPageTemplateID, + string? DocumentMenuJavascript, + string? DocumentMenuRedirectUrl, + bool? DocumentUseNamePathForUrlPath, + int? DocumentStylesheetID, + string? DocumentContent, + string? DocumentMenuClass, + string? DocumentMenuStyleHighlighted, + string? DocumentMenuClassHighlighted, + string? DocumentMenuItemImageHighlighted, + string? DocumentMenuItemLeftImageHighlighted, + string? DocumentMenuItemRightImageHighlighted, + bool? DocumentMenuItemInactive, + string? DocumentCustomData, + string? DocumentExtensions, + string? DocumentTags, + int? DocumentTagGroupID, + string? DocumentWildcardRule, + string? DocumentWebParts, + double? DocumentRatingValue, + int? DocumentRatings, + int? DocumentPriority, + string? DocumentType, + DateTime? DocumentLastPublished, + bool? DocumentUseCustomExtensions, + string? DocumentGroupWebParts, + bool? DocumentCheckedOutAutomatically, + string? DocumentTrackConversionName, + string? DocumentConversionValue, + bool? DocumentSearchExcluded, + string? DocumentLastVersionNumber, + bool? DocumentIsArchived, + string? DocumentHash, + bool? DocumentLogVisitActivity, + Guid? DocumentGUID, + Guid? DocumentWorkflowCycleGUID, + string? DocumentSitemapSettings, + bool? DocumentIsWaitingForTranslation, + string? DocumentSKUName, + string? DocumentSKUDescription, + string? DocumentSKUShortDescription, + string? DocumentWorkflowActionStatus, + bool? DocumentMenuRedirectToFirstChild, + bool DocumentCanBePublished, + bool DocumentInheritsStylesheet) : ICmsDocument, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; + public static string TableName => "CMS_Document"; + public static string GuidColumnName => "DocumentGUID"; + + static CmsDocumentK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), + reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), + reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), + reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), + reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), + reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), + reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), + reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), + reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), + reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), + reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), + reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), + reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), + reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), + reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), + reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), + reader.Unbox("DocumentInheritsStylesheet") + ); + + public static CmsDocumentK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), + reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), + reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), + reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), + reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), + reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), + reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), + reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), + reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), + reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), + reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), + reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), + reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), + reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), + reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), + reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), + reader.Unbox("DocumentInheritsStylesheet") + ); +} + +public record CmsDocumentK12( + int DocumentID, + string DocumentName, + string? DocumentNamePath, + DateTime? DocumentModifiedWhen, + int? DocumentModifiedByUserID, + int? DocumentForeignKeyValue, + int? DocumentCreatedByUserID, + DateTime? DocumentCreatedWhen, + int? DocumentCheckedOutByUserID, + DateTime? DocumentCheckedOutWhen, + int? DocumentCheckedOutVersionHistoryID, + int? DocumentPublishedVersionHistoryID, + int? DocumentWorkflowStepID, + DateTime? DocumentPublishFrom, + DateTime? DocumentPublishTo, + string? DocumentUrlPath, + string DocumentCulture, + int DocumentNodeID, + string? DocumentPageTitle, + string? DocumentPageKeyWords, + string? DocumentPageDescription, + bool DocumentShowInSiteMap, + bool DocumentMenuItemHideInNavigation, + string? DocumentMenuCaption, + string? DocumentMenuStyle, + string? DocumentMenuItemImage, + string? DocumentMenuItemLeftImage, + string? DocumentMenuItemRightImage, + int? DocumentPageTemplateID, + string? DocumentMenuJavascript, + string? DocumentMenuRedirectUrl, + bool? DocumentUseNamePathForUrlPath, + int? DocumentStylesheetID, + string? DocumentContent, + string? DocumentMenuClass, + string? DocumentMenuStyleHighlighted, + string? DocumentMenuClassHighlighted, + string? DocumentMenuItemImageHighlighted, + string? DocumentMenuItemLeftImageHighlighted, + string? DocumentMenuItemRightImageHighlighted, + bool? DocumentMenuItemInactive, + string? DocumentCustomData, + string? DocumentExtensions, + string? DocumentTags, + int? DocumentTagGroupID, + string? DocumentWildcardRule, + string? DocumentWebParts, + double? DocumentRatingValue, + int? DocumentRatings, + int? DocumentPriority, + string? DocumentType, + DateTime? DocumentLastPublished, + bool? DocumentUseCustomExtensions, + string? DocumentGroupWebParts, + bool? DocumentCheckedOutAutomatically, + string? DocumentTrackConversionName, + string? DocumentConversionValue, + bool? DocumentSearchExcluded, + string? DocumentLastVersionNumber, + bool? DocumentIsArchived, + string? DocumentHash, + bool? DocumentLogVisitActivity, + Guid? DocumentGUID, + Guid? DocumentWorkflowCycleGUID, + string? DocumentSitemapSettings, + bool? DocumentIsWaitingForTranslation, + string? DocumentSKUName, + string? DocumentSKUDescription, + string? DocumentSKUShortDescription, + string? DocumentWorkflowActionStatus, + bool? DocumentMenuRedirectToFirstChild, + bool DocumentCanBePublished, + bool DocumentInheritsStylesheet, + string? DocumentPageBuilderWidgets, + string? DocumentPageTemplateConfiguration, + string? DocumentABTestConfiguration) : ICmsDocument, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; + public static string TableName => "CMS_Document"; + public static string GuidColumnName => "DocumentGUID"; + + static CmsDocumentK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), + reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), + reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), + reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), + reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), + reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), + reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), + reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), + reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), + reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), + reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), + reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), + reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), + reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), + reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), + reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), + reader.Unbox("DocumentInheritsStylesheet"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration") + ); + + public static CmsDocumentK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentNamePath"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), + reader.Unbox("DocumentForeignKeyValue"), reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), + reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), + reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentUrlPath"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), + reader.Unbox("DocumentPageKeyWords"), reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentShowInSiteMap"), reader.Unbox("DocumentMenuItemHideInNavigation"), + reader.Unbox("DocumentMenuCaption"), reader.Unbox("DocumentMenuStyle"), reader.Unbox("DocumentMenuItemImage"), reader.Unbox("DocumentMenuItemLeftImage"), reader.Unbox("DocumentMenuItemRightImage"), + reader.Unbox("DocumentPageTemplateID"), reader.Unbox("DocumentMenuJavascript"), reader.Unbox("DocumentMenuRedirectUrl"), reader.Unbox("DocumentUseNamePathForUrlPath"), reader.Unbox("DocumentStylesheetID"), + reader.Unbox("DocumentContent"), reader.Unbox("DocumentMenuClass"), reader.Unbox("DocumentMenuStyleHighlighted"), reader.Unbox("DocumentMenuClassHighlighted"), + reader.Unbox("DocumentMenuItemImageHighlighted"), reader.Unbox("DocumentMenuItemLeftImageHighlighted"), reader.Unbox("DocumentMenuItemRightImageHighlighted"), reader.Unbox("DocumentMenuItemInactive"), + reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentExtensions"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), reader.Unbox("DocumentWildcardRule"), + reader.Unbox("DocumentWebParts"), reader.Unbox("DocumentRatingValue"), reader.Unbox("DocumentRatings"), reader.Unbox("DocumentPriority"), reader.Unbox("DocumentType"), + reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentUseCustomExtensions"), reader.Unbox("DocumentGroupWebParts"), reader.Unbox("DocumentCheckedOutAutomatically"), + reader.Unbox("DocumentTrackConversionName"), reader.Unbox("DocumentConversionValue"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), + reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentHash"), reader.Unbox("DocumentLogVisitActivity"), reader.Unbox("DocumentGUID"), reader.Unbox("DocumentWorkflowCycleGUID"), + reader.Unbox("DocumentSitemapSettings"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), + reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentMenuRedirectToFirstChild"), reader.Unbox("DocumentCanBePublished"), + reader.Unbox("DocumentInheritsStylesheet"), reader.Unbox("DocumentPageBuilderWidgets"), reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration") + ); +} + +public record CmsDocumentK13( + int DocumentID, + string DocumentName, + DateTime? DocumentModifiedWhen, + int? DocumentModifiedByUserID, + int? DocumentForeignKeyValue, + int? DocumentCreatedByUserID, + DateTime? DocumentCreatedWhen, + int? DocumentCheckedOutByUserID, + DateTime? DocumentCheckedOutWhen, + int? DocumentCheckedOutVersionHistoryID, + int? DocumentPublishedVersionHistoryID, + int? DocumentWorkflowStepID, + DateTime? DocumentPublishFrom, + DateTime? DocumentPublishTo, + string DocumentCulture, + int DocumentNodeID, + string? DocumentPageTitle, + string? DocumentPageKeyWords, + string? DocumentPageDescription, + string? DocumentContent, + string? DocumentCustomData, + string? DocumentTags, + int? DocumentTagGroupID, + DateTime? DocumentLastPublished, + bool? DocumentSearchExcluded, + string? DocumentLastVersionNumber, + bool? DocumentIsArchived, + Guid? DocumentGUID, + Guid? DocumentWorkflowCycleGUID, + bool? DocumentIsWaitingForTranslation, + string? DocumentSKUName, + string? DocumentSKUDescription, + string? DocumentSKUShortDescription, + string? DocumentWorkflowActionStatus, + bool DocumentCanBePublished, + string? DocumentPageBuilderWidgets, + string? DocumentPageTemplateConfiguration, + string? DocumentABTestConfiguration, + bool DocumentShowInMenu) : ICmsDocument, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "DocumentID"; + public static string TableName => "CMS_Document"; + public static string GuidColumnName => "DocumentGUID"; + + static CmsDocumentK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), + reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), + reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), + reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), + reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), + reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentGUID"), + reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), + reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentPageBuilderWidgets"), + reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration"), reader.Unbox("DocumentShowInMenu") + ); + + public static CmsDocumentK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("DocumentName"), reader.Unbox("DocumentModifiedWhen"), reader.Unbox("DocumentModifiedByUserID"), reader.Unbox("DocumentForeignKeyValue"), + reader.Unbox("DocumentCreatedByUserID"), reader.Unbox("DocumentCreatedWhen"), reader.Unbox("DocumentCheckedOutByUserID"), reader.Unbox("DocumentCheckedOutWhen"), + reader.Unbox("DocumentCheckedOutVersionHistoryID"), reader.Unbox("DocumentPublishedVersionHistoryID"), reader.Unbox("DocumentWorkflowStepID"), reader.Unbox("DocumentPublishFrom"), + reader.Unbox("DocumentPublishTo"), reader.Unbox("DocumentCulture"), reader.Unbox("DocumentNodeID"), reader.Unbox("DocumentPageTitle"), reader.Unbox("DocumentPageKeyWords"), + reader.Unbox("DocumentPageDescription"), reader.Unbox("DocumentContent"), reader.Unbox("DocumentCustomData"), reader.Unbox("DocumentTags"), reader.Unbox("DocumentTagGroupID"), + reader.Unbox("DocumentLastPublished"), reader.Unbox("DocumentSearchExcluded"), reader.Unbox("DocumentLastVersionNumber"), reader.Unbox("DocumentIsArchived"), reader.Unbox("DocumentGUID"), + reader.Unbox("DocumentWorkflowCycleGUID"), reader.Unbox("DocumentIsWaitingForTranslation"), reader.Unbox("DocumentSKUName"), reader.Unbox("DocumentSKUDescription"), + reader.Unbox("DocumentSKUShortDescription"), reader.Unbox("DocumentWorkflowActionStatus"), reader.Unbox("DocumentCanBePublished"), reader.Unbox("DocumentPageBuilderWidgets"), + reader.Unbox("DocumentPageTemplateConfiguration"), reader.Unbox("DocumentABTestConfiguration"), reader.Unbox("DocumentShowInMenu") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs b/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs index a52ece25..9ca50cb1 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsDocumentCategory.cs @@ -1,101 +1,88 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsDocumentCategory : ISourceModel -{ - int DocumentID { get; } - int CategoryID { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsDocumentCategoryK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsDocumentCategoryK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsDocumentCategoryK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsDocumentCategoryK11.IsAvailable(version), - { Major: 12 } => CmsDocumentCategoryK12.IsAvailable(version), - { Major: 13 } => CmsDocumentCategoryK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_DocumentCategory"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsDocumentCategory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsDocumentCategoryK11.FromReader(reader, version), - { Major: 12 } => CmsDocumentCategoryK12.FromReader(reader, version), - { Major: 13 } => CmsDocumentCategoryK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsDocumentCategoryK11(int DocumentID, int CategoryID) : ICmsDocumentCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_DocumentCategory"; - public static string GuidColumnName => ""; - static CmsDocumentCategoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentCategoryK11( - reader.Unbox("DocumentID"), reader.Unbox("CategoryID") - ); - } - public static CmsDocumentCategoryK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentCategoryK11( - reader.Unbox("DocumentID"), reader.Unbox("CategoryID") - ); - } -}; -public partial record CmsDocumentCategoryK12(int DocumentID, int CategoryID) : ICmsDocumentCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_DocumentCategory"; - public static string GuidColumnName => ""; - static CmsDocumentCategoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentCategoryK12( - reader.Unbox("DocumentID"), reader.Unbox("CategoryID") - ); - } - public static CmsDocumentCategoryK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentCategoryK12( - reader.Unbox("DocumentID"), reader.Unbox("CategoryID") - ); - } -}; -public partial record CmsDocumentCategoryK13(int DocumentID, int CategoryID) : ICmsDocumentCategory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; - public static string TableName => "CMS_DocumentCategory"; - public static string GuidColumnName => ""; - static CmsDocumentCategoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentCategoryK13( - reader.Unbox("DocumentID"), reader.Unbox("CategoryID") - ); - } - public static CmsDocumentCategoryK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsDocumentCategoryK13( - reader.Unbox("DocumentID"), reader.Unbox("CategoryID") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsDocumentCategory : ISourceModel +{ + int DocumentID { get; } + int CategoryID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentCategoryK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsDocumentCategoryK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsDocumentCategoryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentCategoryK11.IsAvailable(version), + { Major: 12 } => CmsDocumentCategoryK12.IsAvailable(version), + { Major: 13 } => CmsDocumentCategoryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_DocumentCategory"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsDocumentCategory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsDocumentCategoryK11.FromReader(reader, version), + { Major: 12 } => CmsDocumentCategoryK12.FromReader(reader, version), + { Major: 13 } => CmsDocumentCategoryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsDocumentCategoryK11(int DocumentID, int CategoryID) : ICmsDocumentCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_DocumentCategory"; + public static string GuidColumnName => ""; + + static CmsDocumentCategoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("CategoryID") + ); + + public static CmsDocumentCategoryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("CategoryID") + ); +} + +public record CmsDocumentCategoryK12(int DocumentID, int CategoryID) : ICmsDocumentCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_DocumentCategory"; + public static string GuidColumnName => ""; + + static CmsDocumentCategoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("CategoryID") + ); + + public static CmsDocumentCategoryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("CategoryID") + ); +} + +public record CmsDocumentCategoryK13(int DocumentID, int CategoryID) : ICmsDocumentCategory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CategoryID"; + public static string TableName => "CMS_DocumentCategory"; + public static string GuidColumnName => ""; + + static CmsDocumentCategoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("CategoryID") + ); + + public static CmsDocumentCategoryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("DocumentID"), reader.Unbox("CategoryID") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsForm.cs b/KVA/Migration.Toolkit.Source/Model/CmsForm.cs index 9d5d575c..2f26c6cc 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsForm.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsForm.cs @@ -1,123 +1,214 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsForm : ISourceModel -{ - int FormID { get; } - string FormDisplayName { get; } - string FormName { get; } - string? FormSendToEmail { get; } - string? FormSendFromEmail { get; } - string? FormEmailSubject { get; } - string? FormEmailTemplate { get; } - bool? FormEmailAttachUploadedDocs { get; } - int FormClassID { get; } - int FormItems { get; } - string? FormReportFields { get; } - string? FormRedirectToUrl { get; } - string? FormDisplayText { get; } - bool FormClearAfterSave { get; } - string? FormSubmitButtonText { get; } - int FormSiteID { get; } - string? FormConfirmationEmailField { get; } - string? FormConfirmationTemplate { get; } - string? FormConfirmationSendFromEmail { get; } - string? FormConfirmationEmailSubject { get; } - int? FormAccess { get; } - string? FormSubmitButtonImage { get; } - Guid FormGUID { get; } - DateTime FormLastModified { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsFormK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsFormK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsFormK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsFormK11.IsAvailable(version), - { Major: 12 } => CmsFormK12.IsAvailable(version), - { Major: 13 } => CmsFormK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Form"; - static string ISourceModel.GuidColumnName => "FormGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsForm ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsFormK11.FromReader(reader, version), - { Major: 12 } => CmsFormK12.FromReader(reader, version), - { Major: 13 } => CmsFormK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsFormK11(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool? FormLogActivity) : ICmsForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_Form"; - public static string GuidColumnName => "FormGUID"; - static CmsFormK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormK11( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity") - ); - } - public static CmsFormK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormK11( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity") - ); - } -}; -public partial record CmsFormK12(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool? FormLogActivity, int FormDevelopmentModel, string? FormBuilderLayout) : ICmsForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_Form"; - public static string GuidColumnName => "FormGUID"; - static CmsFormK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormK12( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormDevelopmentModel"), reader.Unbox("FormBuilderLayout") - ); - } - public static CmsFormK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormK12( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormDevelopmentModel"), reader.Unbox("FormBuilderLayout") - ); - } -}; -public partial record CmsFormK13(int FormID, string FormDisplayName, string FormName, string? FormSendToEmail, string? FormSendFromEmail, string? FormEmailSubject, string? FormEmailTemplate, bool? FormEmailAttachUploadedDocs, int FormClassID, int FormItems, string? FormReportFields, string? FormRedirectToUrl, string? FormDisplayText, bool FormClearAfterSave, string? FormSubmitButtonText, int FormSiteID, string? FormConfirmationEmailField, string? FormConfirmationTemplate, string? FormConfirmationSendFromEmail, string? FormConfirmationEmailSubject, int? FormAccess, string? FormSubmitButtonImage, Guid FormGUID, DateTime FormLastModified, bool FormLogActivity, string? FormBuilderLayout) : ICmsForm, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; - public static string TableName => "CMS_Form"; - public static string GuidColumnName => "FormGUID"; - static CmsFormK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormK13( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormBuilderLayout") - ); - } - public static CmsFormK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormK13( - reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormBuilderLayout") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsForm : ISourceModel +{ + int FormID { get; } + string FormDisplayName { get; } + string FormName { get; } + string? FormSendToEmail { get; } + string? FormSendFromEmail { get; } + string? FormEmailSubject { get; } + string? FormEmailTemplate { get; } + bool? FormEmailAttachUploadedDocs { get; } + int FormClassID { get; } + int FormItems { get; } + string? FormReportFields { get; } + string? FormRedirectToUrl { get; } + string? FormDisplayText { get; } + bool FormClearAfterSave { get; } + string? FormSubmitButtonText { get; } + int FormSiteID { get; } + string? FormConfirmationEmailField { get; } + string? FormConfirmationTemplate { get; } + string? FormConfirmationSendFromEmail { get; } + string? FormConfirmationEmailSubject { get; } + int? FormAccess { get; } + string? FormSubmitButtonImage { get; } + Guid FormGUID { get; } + DateTime FormLastModified { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsFormK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsFormK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormK11.IsAvailable(version), + { Major: 12 } => CmsFormK12.IsAvailable(version), + { Major: 13 } => CmsFormK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Form"; + static string ISourceModel.GuidColumnName => "FormGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsForm ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormK11.FromReader(reader, version), + { Major: 12 } => CmsFormK12.FromReader(reader, version), + { Major: 13 } => CmsFormK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsFormK11( + int FormID, + string FormDisplayName, + string FormName, + string? FormSendToEmail, + string? FormSendFromEmail, + string? FormEmailSubject, + string? FormEmailTemplate, + bool? FormEmailAttachUploadedDocs, + int FormClassID, + int FormItems, + string? FormReportFields, + string? FormRedirectToUrl, + string? FormDisplayText, + bool FormClearAfterSave, + string? FormSubmitButtonText, + int FormSiteID, + string? FormConfirmationEmailField, + string? FormConfirmationTemplate, + string? FormConfirmationSendFromEmail, + string? FormConfirmationEmailSubject, + int? FormAccess, + string? FormSubmitButtonImage, + Guid FormGUID, + DateTime FormLastModified, + bool? FormLogActivity) : ICmsForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_Form"; + public static string GuidColumnName => "FormGUID"; + + static CmsFormK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), + reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), + reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), + reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), + reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity") + ); + + public static CmsFormK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), + reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), + reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), + reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), + reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity") + ); +} + +public record CmsFormK12( + int FormID, + string FormDisplayName, + string FormName, + string? FormSendToEmail, + string? FormSendFromEmail, + string? FormEmailSubject, + string? FormEmailTemplate, + bool? FormEmailAttachUploadedDocs, + int FormClassID, + int FormItems, + string? FormReportFields, + string? FormRedirectToUrl, + string? FormDisplayText, + bool FormClearAfterSave, + string? FormSubmitButtonText, + int FormSiteID, + string? FormConfirmationEmailField, + string? FormConfirmationTemplate, + string? FormConfirmationSendFromEmail, + string? FormConfirmationEmailSubject, + int? FormAccess, + string? FormSubmitButtonImage, + Guid FormGUID, + DateTime FormLastModified, + bool? FormLogActivity, + int FormDevelopmentModel, + string? FormBuilderLayout) : ICmsForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_Form"; + public static string GuidColumnName => "FormGUID"; + + static CmsFormK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), + reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), + reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), + reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), + reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormDevelopmentModel"), + reader.Unbox("FormBuilderLayout") + ); + + public static CmsFormK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), + reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), + reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), + reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), + reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormDevelopmentModel"), + reader.Unbox("FormBuilderLayout") + ); +} + +public record CmsFormK13( + int FormID, + string FormDisplayName, + string FormName, + string? FormSendToEmail, + string? FormSendFromEmail, + string? FormEmailSubject, + string? FormEmailTemplate, + bool? FormEmailAttachUploadedDocs, + int FormClassID, + int FormItems, + string? FormReportFields, + string? FormRedirectToUrl, + string? FormDisplayText, + bool FormClearAfterSave, + string? FormSubmitButtonText, + int FormSiteID, + string? FormConfirmationEmailField, + string? FormConfirmationTemplate, + string? FormConfirmationSendFromEmail, + string? FormConfirmationEmailSubject, + int? FormAccess, + string? FormSubmitButtonImage, + Guid FormGUID, + DateTime FormLastModified, + bool FormLogActivity, + string? FormBuilderLayout) : ICmsForm, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FormID"; + public static string TableName => "CMS_Form"; + public static string GuidColumnName => "FormGUID"; + + static CmsFormK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), + reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), + reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), + reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), + reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormBuilderLayout") + ); + + public static CmsFormK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FormID"), reader.Unbox("FormDisplayName"), reader.Unbox("FormName"), reader.Unbox("FormSendToEmail"), reader.Unbox("FormSendFromEmail"), reader.Unbox("FormEmailSubject"), + reader.Unbox("FormEmailTemplate"), reader.Unbox("FormEmailAttachUploadedDocs"), reader.Unbox("FormClassID"), reader.Unbox("FormItems"), reader.Unbox("FormReportFields"), + reader.Unbox("FormRedirectToUrl"), reader.Unbox("FormDisplayText"), reader.Unbox("FormClearAfterSave"), reader.Unbox("FormSubmitButtonText"), reader.Unbox("FormSiteID"), + reader.Unbox("FormConfirmationEmailField"), reader.Unbox("FormConfirmationTemplate"), reader.Unbox("FormConfirmationSendFromEmail"), reader.Unbox("FormConfirmationEmailSubject"), + reader.Unbox("FormAccess"), reader.Unbox("FormSubmitButtonImage"), reader.Unbox("FormGUID"), reader.Unbox("FormLastModified"), reader.Unbox("FormLogActivity"), reader.Unbox("FormBuilderLayout") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs b/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs index 12be0d34..0a397719 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsFormUserControl.cs @@ -1,129 +1,258 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsFormUserControl : ISourceModel -{ - int UserControlID { get; } - string UserControlDisplayName { get; } - string UserControlCodeName { get; } - string UserControlFileName { get; } - bool UserControlForText { get; } - bool UserControlForLongText { get; } - bool UserControlForInteger { get; } - bool UserControlForDecimal { get; } - bool UserControlForDateTime { get; } - bool UserControlForBoolean { get; } - bool UserControlForFile { get; } - bool? UserControlShowInDocumentTypes { get; } - bool? UserControlShowInSystemTables { get; } - bool? UserControlShowInWebParts { get; } - bool? UserControlShowInReports { get; } - Guid UserControlGUID { get; } - DateTime UserControlLastModified { get; } - bool UserControlForGuid { get; } - bool? UserControlShowInCustomTables { get; } - string? UserControlParameters { get; } - bool UserControlForDocAttachments { get; } - int? UserControlResourceID { get; } - int? UserControlParentID { get; } - string? UserControlDescription { get; } - int? UserControlPriority { get; } - bool? UserControlIsSystem { get; } - bool UserControlForBinary { get; } - bool UserControlForDocRelationships { get; } - string? UserControlAssemblyName { get; } - string? UserControlClassName { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsFormUserControlK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsFormUserControlK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsFormUserControlK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsFormUserControlK11.IsAvailable(version), - { Major: 12 } => CmsFormUserControlK12.IsAvailable(version), - { Major: 13 } => CmsFormUserControlK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_FormUserControl"; - static string ISourceModel.GuidColumnName => "UserControlGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsFormUserControl ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsFormUserControlK11.FromReader(reader, version), - { Major: 12 } => CmsFormUserControlK12.FromReader(reader, version), - { Major: 13 } => CmsFormUserControlK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsFormUserControlK11(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool UserControlShowInBizForms, string UserControlDefaultDataType, int? UserControlDefaultDataTypeSize, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, bool UserControlForVisibility, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlType, int? UserControlParentID, string? UserControlDescription, Guid? UserControlThumbnailGUID, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; - public static string TableName => "CMS_FormUserControl"; - public static string GuidColumnName => "UserControlGUID"; - static CmsFormUserControlK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormUserControlK11( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - } - public static CmsFormUserControlK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormUserControlK11( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - } -}; -public partial record CmsFormUserControlK12(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool UserControlShowInBizForms, string UserControlDefaultDataType, int? UserControlDefaultDataTypeSize, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, bool UserControlForVisibility, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlType, int? UserControlParentID, string? UserControlDescription, Guid? UserControlThumbnailGUID, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; - public static string TableName => "CMS_FormUserControl"; - public static string GuidColumnName => "UserControlGUID"; - static CmsFormUserControlK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormUserControlK12( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - } - public static CmsFormUserControlK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormUserControlK12( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - } -}; -public partial record CmsFormUserControlK13(int UserControlID, string UserControlDisplayName, string UserControlCodeName, string UserControlFileName, bool UserControlForText, bool UserControlForLongText, bool UserControlForInteger, bool UserControlForDecimal, bool UserControlForDateTime, bool UserControlForBoolean, bool UserControlForFile, bool? UserControlShowInDocumentTypes, bool? UserControlShowInSystemTables, bool? UserControlShowInWebParts, bool? UserControlShowInReports, Guid UserControlGUID, DateTime UserControlLastModified, bool UserControlForGuid, bool? UserControlShowInCustomTables, string? UserControlParameters, bool UserControlForDocAttachments, int? UserControlResourceID, int? UserControlParentID, string? UserControlDescription, int? UserControlPriority, bool? UserControlIsSystem, bool UserControlForBinary, bool UserControlForDocRelationships, string? UserControlAssemblyName, string? UserControlClassName) : ICmsFormUserControl, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; - public static string TableName => "CMS_FormUserControl"; - public static string GuidColumnName => "UserControlGUID"; - static CmsFormUserControlK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormUserControlK13( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - } - public static CmsFormUserControlK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsFormUserControlK13( - reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsFormUserControl : ISourceModel +{ + int UserControlID { get; } + string UserControlDisplayName { get; } + string UserControlCodeName { get; } + string UserControlFileName { get; } + bool UserControlForText { get; } + bool UserControlForLongText { get; } + bool UserControlForInteger { get; } + bool UserControlForDecimal { get; } + bool UserControlForDateTime { get; } + bool UserControlForBoolean { get; } + bool UserControlForFile { get; } + bool? UserControlShowInDocumentTypes { get; } + bool? UserControlShowInSystemTables { get; } + bool? UserControlShowInWebParts { get; } + bool? UserControlShowInReports { get; } + Guid UserControlGUID { get; } + DateTime UserControlLastModified { get; } + bool UserControlForGuid { get; } + bool? UserControlShowInCustomTables { get; } + string? UserControlParameters { get; } + bool UserControlForDocAttachments { get; } + int? UserControlResourceID { get; } + int? UserControlParentID { get; } + string? UserControlDescription { get; } + int? UserControlPriority { get; } + bool? UserControlIsSystem { get; } + bool UserControlForBinary { get; } + bool UserControlForDocRelationships { get; } + string? UserControlAssemblyName { get; } + string? UserControlClassName { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormUserControlK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsFormUserControlK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsFormUserControlK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormUserControlK11.IsAvailable(version), + { Major: 12 } => CmsFormUserControlK12.IsAvailable(version), + { Major: 13 } => CmsFormUserControlK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_FormUserControl"; + static string ISourceModel.GuidColumnName => "UserControlGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsFormUserControl ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsFormUserControlK11.FromReader(reader, version), + { Major: 12 } => CmsFormUserControlK12.FromReader(reader, version), + { Major: 13 } => CmsFormUserControlK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsFormUserControlK11( + int UserControlID, + string UserControlDisplayName, + string UserControlCodeName, + string UserControlFileName, + bool UserControlForText, + bool UserControlForLongText, + bool UserControlForInteger, + bool UserControlForDecimal, + bool UserControlForDateTime, + bool UserControlForBoolean, + bool UserControlForFile, + bool UserControlShowInBizForms, + string UserControlDefaultDataType, + int? UserControlDefaultDataTypeSize, + bool? UserControlShowInDocumentTypes, + bool? UserControlShowInSystemTables, + bool? UserControlShowInWebParts, + bool? UserControlShowInReports, + Guid UserControlGUID, + DateTime UserControlLastModified, + bool UserControlForGuid, + bool? UserControlShowInCustomTables, + bool UserControlForVisibility, + string? UserControlParameters, + bool UserControlForDocAttachments, + int? UserControlResourceID, + int? UserControlType, + int? UserControlParentID, + string? UserControlDescription, + Guid? UserControlThumbnailGUID, + int? UserControlPriority, + bool? UserControlIsSystem, + bool UserControlForBinary, + bool UserControlForDocRelationships, + string? UserControlAssemblyName, + string? UserControlClassName) : ICmsFormUserControl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; + public static string TableName => "CMS_FormUserControl"; + public static string GuidColumnName => "UserControlGUID"; + + static CmsFormUserControlK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), + reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), + reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), + reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), + reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), + reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), + reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), + reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); + + public static CmsFormUserControlK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), + reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), + reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), + reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), + reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), + reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), + reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), + reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); +} + +public record CmsFormUserControlK12( + int UserControlID, + string UserControlDisplayName, + string UserControlCodeName, + string UserControlFileName, + bool UserControlForText, + bool UserControlForLongText, + bool UserControlForInteger, + bool UserControlForDecimal, + bool UserControlForDateTime, + bool UserControlForBoolean, + bool UserControlForFile, + bool UserControlShowInBizForms, + string UserControlDefaultDataType, + int? UserControlDefaultDataTypeSize, + bool? UserControlShowInDocumentTypes, + bool? UserControlShowInSystemTables, + bool? UserControlShowInWebParts, + bool? UserControlShowInReports, + Guid UserControlGUID, + DateTime UserControlLastModified, + bool UserControlForGuid, + bool? UserControlShowInCustomTables, + bool UserControlForVisibility, + string? UserControlParameters, + bool UserControlForDocAttachments, + int? UserControlResourceID, + int? UserControlType, + int? UserControlParentID, + string? UserControlDescription, + Guid? UserControlThumbnailGUID, + int? UserControlPriority, + bool? UserControlIsSystem, + bool UserControlForBinary, + bool UserControlForDocRelationships, + string? UserControlAssemblyName, + string? UserControlClassName) : ICmsFormUserControl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; + public static string TableName => "CMS_FormUserControl"; + public static string GuidColumnName => "UserControlGUID"; + + static CmsFormUserControlK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), + reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), + reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), + reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), + reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), + reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), + reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), + reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); + + public static CmsFormUserControlK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), + reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), + reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInBizForms"), reader.Unbox("UserControlDefaultDataType"), reader.Unbox("UserControlDefaultDataTypeSize"), + reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), reader.Unbox("UserControlShowInReports"), + reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), reader.Unbox("UserControlForVisibility"), + reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlType"), reader.Unbox("UserControlParentID"), + reader.Unbox("UserControlDescription"), reader.Unbox("UserControlThumbnailGUID"), reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), + reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), reader.Unbox("UserControlClassName") + ); +} + +public record CmsFormUserControlK13( + int UserControlID, + string UserControlDisplayName, + string UserControlCodeName, + string UserControlFileName, + bool UserControlForText, + bool UserControlForLongText, + bool UserControlForInteger, + bool UserControlForDecimal, + bool UserControlForDateTime, + bool UserControlForBoolean, + bool UserControlForFile, + bool? UserControlShowInDocumentTypes, + bool? UserControlShowInSystemTables, + bool? UserControlShowInWebParts, + bool? UserControlShowInReports, + Guid UserControlGUID, + DateTime UserControlLastModified, + bool UserControlForGuid, + bool? UserControlShowInCustomTables, + string? UserControlParameters, + bool UserControlForDocAttachments, + int? UserControlResourceID, + int? UserControlParentID, + string? UserControlDescription, + int? UserControlPriority, + bool? UserControlIsSystem, + bool UserControlForBinary, + bool UserControlForDocRelationships, + string? UserControlAssemblyName, + string? UserControlClassName) : ICmsFormUserControl, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserControlID"; + public static string TableName => "CMS_FormUserControl"; + public static string GuidColumnName => "UserControlGUID"; + + static CmsFormUserControlK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), + reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), + reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), + reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), + reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), + reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), + reader.Unbox("UserControlClassName") + ); + + public static CmsFormUserControlK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserControlID"), reader.Unbox("UserControlDisplayName"), reader.Unbox("UserControlCodeName"), reader.Unbox("UserControlFileName"), reader.Unbox("UserControlForText"), + reader.Unbox("UserControlForLongText"), reader.Unbox("UserControlForInteger"), reader.Unbox("UserControlForDecimal"), reader.Unbox("UserControlForDateTime"), reader.Unbox("UserControlForBoolean"), + reader.Unbox("UserControlForFile"), reader.Unbox("UserControlShowInDocumentTypes"), reader.Unbox("UserControlShowInSystemTables"), reader.Unbox("UserControlShowInWebParts"), + reader.Unbox("UserControlShowInReports"), reader.Unbox("UserControlGUID"), reader.Unbox("UserControlLastModified"), reader.Unbox("UserControlForGuid"), reader.Unbox("UserControlShowInCustomTables"), + reader.Unbox("UserControlParameters"), reader.Unbox("UserControlForDocAttachments"), reader.Unbox("UserControlResourceID"), reader.Unbox("UserControlParentID"), reader.Unbox("UserControlDescription"), + reader.Unbox("UserControlPriority"), reader.Unbox("UserControlIsSystem"), reader.Unbox("UserControlForBinary"), reader.Unbox("UserControlForDocRelationships"), reader.Unbox("UserControlAssemblyName"), + reader.Unbox("UserControlClassName") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs index 9c94d3a7..a14d5561 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsPageFormerUrlPath.cs @@ -1,100 +1,90 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsPageFormerUrlPath : ISourceModel -{ - - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageFormerUrlPathK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsPageFormerUrlPathK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsPageFormerUrlPathK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageFormerUrlPathK11.IsAvailable(version), - { Major: 12 } => CmsPageFormerUrlPathK12.IsAvailable(version), - { Major: 13 } => CmsPageFormerUrlPathK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_PageFormerUrlPath"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsPageFormerUrlPath ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageFormerUrlPathK11.FromReader(reader, version), - { Major: 12 } => CmsPageFormerUrlPathK12.FromReader(reader, version), - { Major: 13 } => CmsPageFormerUrlPathK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsPageFormerUrlPathK11() : ICmsPageFormerUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageFormerUrlPath"; - public static string GuidColumnName => ""; - static CmsPageFormerUrlPathK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageFormerUrlPathK11( - - ); - } - public static CmsPageFormerUrlPathK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageFormerUrlPathK11( - - ); - } -}; -public partial record CmsPageFormerUrlPathK12() : ICmsPageFormerUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageFormerUrlPath"; - public static string GuidColumnName => ""; - static CmsPageFormerUrlPathK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageFormerUrlPathK12( - - ); - } - public static CmsPageFormerUrlPathK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageFormerUrlPathK12( - - ); - } -}; -public partial record CmsPageFormerUrlPathK13(int PageFormerUrlPathID, string PageFormerUrlPathUrlPath, string PageFormerUrlPathUrlPathHash, string PageFormerUrlPathCulture, int PageFormerUrlPathNodeID, int PageFormerUrlPathSiteID, DateTime PageFormerUrlPathLastModified) : ICmsPageFormerUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "PageFormerUrlPathID"; - public static string TableName => "CMS_PageFormerUrlPath"; - public static string GuidColumnName => ""; - static CmsPageFormerUrlPathK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageFormerUrlPathK13( - reader.Unbox("PageFormerUrlPathID"), reader.Unbox("PageFormerUrlPathUrlPath"), reader.Unbox("PageFormerUrlPathUrlPathHash"), reader.Unbox("PageFormerUrlPathCulture"), reader.Unbox("PageFormerUrlPathNodeID"), reader.Unbox("PageFormerUrlPathSiteID"), reader.Unbox("PageFormerUrlPathLastModified") - ); - } - public static CmsPageFormerUrlPathK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageFormerUrlPathK13( - reader.Unbox("PageFormerUrlPathID"), reader.Unbox("PageFormerUrlPathUrlPath"), reader.Unbox("PageFormerUrlPathUrlPathHash"), reader.Unbox("PageFormerUrlPathCulture"), reader.Unbox("PageFormerUrlPathNodeID"), reader.Unbox("PageFormerUrlPathSiteID"), reader.Unbox("PageFormerUrlPathLastModified") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsPageFormerUrlPath : ISourceModel +{ + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageFormerUrlPathK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsPageFormerUrlPathK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsPageFormerUrlPathK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageFormerUrlPathK11.IsAvailable(version), + { Major: 12 } => CmsPageFormerUrlPathK12.IsAvailable(version), + { Major: 13 } => CmsPageFormerUrlPathK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_PageFormerUrlPath"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsPageFormerUrlPath ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageFormerUrlPathK11.FromReader(reader, version), + { Major: 12 } => CmsPageFormerUrlPathK12.FromReader(reader, version), + { Major: 13 } => CmsPageFormerUrlPathK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsPageFormerUrlPathK11 : ICmsPageFormerUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageFormerUrlPath"; + public static string GuidColumnName => ""; + + static CmsPageFormerUrlPathK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + ); + + public static CmsPageFormerUrlPathK11 FromReader(IDataReader reader, SemanticVersion version) => new( + ); +} + +public record CmsPageFormerUrlPathK12 : ICmsPageFormerUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageFormerUrlPath"; + public static string GuidColumnName => ""; + + static CmsPageFormerUrlPathK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + ); + + public static CmsPageFormerUrlPathK12 FromReader(IDataReader reader, SemanticVersion version) => new( + ); +} + +public record CmsPageFormerUrlPathK13( + int PageFormerUrlPathID, + string PageFormerUrlPathUrlPath, + string PageFormerUrlPathUrlPathHash, + string PageFormerUrlPathCulture, + int PageFormerUrlPathNodeID, + int PageFormerUrlPathSiteID, + DateTime PageFormerUrlPathLastModified) : ICmsPageFormerUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "PageFormerUrlPathID"; + public static string TableName => "CMS_PageFormerUrlPath"; + public static string GuidColumnName => ""; + + static CmsPageFormerUrlPathK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageFormerUrlPathID"), reader.Unbox("PageFormerUrlPathUrlPath"), reader.Unbox("PageFormerUrlPathUrlPathHash"), reader.Unbox("PageFormerUrlPathCulture"), reader.Unbox("PageFormerUrlPathNodeID"), + reader.Unbox("PageFormerUrlPathSiteID"), reader.Unbox("PageFormerUrlPathLastModified") + ); + + public static CmsPageFormerUrlPathK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageFormerUrlPathID"), reader.Unbox("PageFormerUrlPathUrlPath"), reader.Unbox("PageFormerUrlPathUrlPathHash"), reader.Unbox("PageFormerUrlPathCulture"), reader.Unbox("PageFormerUrlPathNodeID"), + reader.Unbox("PageFormerUrlPathSiteID"), reader.Unbox("PageFormerUrlPathLastModified") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs index 83e87292..3b7f8be4 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsPageTemplateConfiguration.cs @@ -1,100 +1,109 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsPageTemplateConfiguration : ISourceModel -{ - - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageTemplateConfigurationK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsPageTemplateConfigurationK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsPageTemplateConfigurationK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageTemplateConfigurationK11.IsAvailable(version), - { Major: 12 } => CmsPageTemplateConfigurationK12.IsAvailable(version), - { Major: 13 } => CmsPageTemplateConfigurationK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_PageTemplateConfiguration"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsPageTemplateConfiguration ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageTemplateConfigurationK11.FromReader(reader, version), - { Major: 12 } => CmsPageTemplateConfigurationK12.FromReader(reader, version), - { Major: 13 } => CmsPageTemplateConfigurationK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsPageTemplateConfigurationK11() : ICmsPageTemplateConfiguration, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageTemplateConfiguration"; - public static string GuidColumnName => ""; - static CmsPageTemplateConfigurationK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageTemplateConfigurationK11( - - ); - } - public static CmsPageTemplateConfigurationK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageTemplateConfigurationK11( - - ); - } -}; -public partial record CmsPageTemplateConfigurationK12(int PageTemplateConfigurationID, Guid PageTemplateConfigurationGUID, int PageTemplateConfigurationSiteID, DateTime PageTemplateConfigurationLastModified, string PageTemplateConfigurationName, string? PageTemplateConfigurationDescription, Guid? PageTemplateConfigurationThumbnailGUID, string PageTemplateConfigurationTemplate, string? PageTemplateConfigurationWidgets) : ICmsPageTemplateConfiguration, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "PageTemplateConfigurationID"; - public static string TableName => "CMS_PageTemplateConfiguration"; - public static string GuidColumnName => "PageTemplateConfigurationGUID"; - static CmsPageTemplateConfigurationK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageTemplateConfigurationK12( - reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") - ); - } - public static CmsPageTemplateConfigurationK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageTemplateConfigurationK12( - reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") - ); - } -}; -public partial record CmsPageTemplateConfigurationK13(int PageTemplateConfigurationID, Guid PageTemplateConfigurationGUID, int PageTemplateConfigurationSiteID, DateTime PageTemplateConfigurationLastModified, string PageTemplateConfigurationName, string? PageTemplateConfigurationDescription, Guid? PageTemplateConfigurationThumbnailGUID, string PageTemplateConfigurationTemplate, string? PageTemplateConfigurationWidgets) : ICmsPageTemplateConfiguration, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "PageTemplateConfigurationID"; - public static string TableName => "CMS_PageTemplateConfiguration"; - public static string GuidColumnName => "PageTemplateConfigurationGUID"; - static CmsPageTemplateConfigurationK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageTemplateConfigurationK13( - reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") - ); - } - public static CmsPageTemplateConfigurationK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageTemplateConfigurationK13( - reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), reader.Unbox("PageTemplateConfigurationWidgets") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsPageTemplateConfiguration : ISourceModel +{ + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageTemplateConfigurationK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsPageTemplateConfigurationK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsPageTemplateConfigurationK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageTemplateConfigurationK11.IsAvailable(version), + { Major: 12 } => CmsPageTemplateConfigurationK12.IsAvailable(version), + { Major: 13 } => CmsPageTemplateConfigurationK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_PageTemplateConfiguration"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsPageTemplateConfiguration ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageTemplateConfigurationK11.FromReader(reader, version), + { Major: 12 } => CmsPageTemplateConfigurationK12.FromReader(reader, version), + { Major: 13 } => CmsPageTemplateConfigurationK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsPageTemplateConfigurationK11 : ICmsPageTemplateConfiguration, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageTemplateConfiguration"; + public static string GuidColumnName => ""; + + static CmsPageTemplateConfigurationK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + ); + + public static CmsPageTemplateConfigurationK11 FromReader(IDataReader reader, SemanticVersion version) => new( + ); +} + +public partial record CmsPageTemplateConfigurationK12( + int PageTemplateConfigurationID, + Guid PageTemplateConfigurationGUID, + int PageTemplateConfigurationSiteID, + DateTime PageTemplateConfigurationLastModified, + string PageTemplateConfigurationName, + string? PageTemplateConfigurationDescription, + Guid? PageTemplateConfigurationThumbnailGUID, + string PageTemplateConfigurationTemplate, + string? PageTemplateConfigurationWidgets) : ICmsPageTemplateConfiguration, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "PageTemplateConfigurationID"; + public static string TableName => "CMS_PageTemplateConfiguration"; + public static string GuidColumnName => "PageTemplateConfigurationGUID"; + + static CmsPageTemplateConfigurationK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), + reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), + reader.Unbox("PageTemplateConfigurationWidgets") + ); + + public static CmsPageTemplateConfigurationK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), + reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), + reader.Unbox("PageTemplateConfigurationWidgets") + ); +} + +public partial record CmsPageTemplateConfigurationK13( + int PageTemplateConfigurationID, + Guid PageTemplateConfigurationGUID, + int PageTemplateConfigurationSiteID, + DateTime PageTemplateConfigurationLastModified, + string PageTemplateConfigurationName, + string? PageTemplateConfigurationDescription, + Guid? PageTemplateConfigurationThumbnailGUID, + string PageTemplateConfigurationTemplate, + string? PageTemplateConfigurationWidgets) : ICmsPageTemplateConfiguration, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "PageTemplateConfigurationID"; + public static string TableName => "CMS_PageTemplateConfiguration"; + public static string GuidColumnName => "PageTemplateConfigurationGUID"; + + static CmsPageTemplateConfigurationK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), + reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), + reader.Unbox("PageTemplateConfigurationWidgets") + ); + + public static CmsPageTemplateConfigurationK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageTemplateConfigurationID"), reader.Unbox("PageTemplateConfigurationGUID"), reader.Unbox("PageTemplateConfigurationSiteID"), reader.Unbox("PageTemplateConfigurationLastModified"), + reader.Unbox("PageTemplateConfigurationName"), reader.Unbox("PageTemplateConfigurationDescription"), reader.Unbox("PageTemplateConfigurationThumbnailGUID"), reader.Unbox("PageTemplateConfigurationTemplate"), + reader.Unbox("PageTemplateConfigurationWidgets") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs b/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs index 648da2f2..d3d6b0d9 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsPageUrlPath.cs @@ -1,100 +1,84 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsPageUrlPath : ISourceModel -{ - - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageUrlPathK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsPageUrlPathK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsPageUrlPathK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageUrlPathK11.IsAvailable(version), - { Major: 12 } => CmsPageUrlPathK12.IsAvailable(version), - { Major: 13 } => CmsPageUrlPathK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_PageUrlPath"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsPageUrlPath ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsPageUrlPathK11.FromReader(reader, version), - { Major: 12 } => CmsPageUrlPathK12.FromReader(reader, version), - { Major: 13 } => CmsPageUrlPathK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsPageUrlPathK11() : ICmsPageUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageUrlPath"; - public static string GuidColumnName => ""; - static CmsPageUrlPathK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageUrlPathK11( - - ); - } - public static CmsPageUrlPathK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageUrlPathK11( - - ); - } -}; -public partial record CmsPageUrlPathK12() : ICmsPageUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => false; - public static string GetPrimaryKeyName(SemanticVersion version) => ""; - public static string TableName => "CMS_PageUrlPath"; - public static string GuidColumnName => ""; - static CmsPageUrlPathK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageUrlPathK12( - - ); - } - public static CmsPageUrlPathK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageUrlPathK12( - - ); - } -}; -public partial record CmsPageUrlPathK13(int PageUrlPathID, Guid PageUrlPathGUID, string PageUrlPathCulture, int PageUrlPathNodeID, string PageUrlPathUrlPath, string PageUrlPathUrlPathHash, int PageUrlPathSiteID, DateTime PageUrlPathLastModified) : ICmsPageUrlPath, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "PageUrlPathID"; - public static string TableName => "CMS_PageUrlPath"; - public static string GuidColumnName => "PageUrlPathGUID"; - static CmsPageUrlPathK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageUrlPathK13( - reader.Unbox("PageUrlPathID"), reader.Unbox("PageUrlPathGUID"), reader.Unbox("PageUrlPathCulture"), reader.Unbox("PageUrlPathNodeID"), reader.Unbox("PageUrlPathUrlPath"), reader.Unbox("PageUrlPathUrlPathHash"), reader.Unbox("PageUrlPathSiteID"), reader.Unbox("PageUrlPathLastModified") - ); - } - public static CmsPageUrlPathK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsPageUrlPathK13( - reader.Unbox("PageUrlPathID"), reader.Unbox("PageUrlPathGUID"), reader.Unbox("PageUrlPathCulture"), reader.Unbox("PageUrlPathNodeID"), reader.Unbox("PageUrlPathUrlPath"), reader.Unbox("PageUrlPathUrlPathHash"), reader.Unbox("PageUrlPathSiteID"), reader.Unbox("PageUrlPathLastModified") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsPageUrlPath : ISourceModel +{ + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageUrlPathK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsPageUrlPathK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsPageUrlPathK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageUrlPathK11.IsAvailable(version), + { Major: 12 } => CmsPageUrlPathK12.IsAvailable(version), + { Major: 13 } => CmsPageUrlPathK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_PageUrlPath"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsPageUrlPath ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsPageUrlPathK11.FromReader(reader, version), + { Major: 12 } => CmsPageUrlPathK12.FromReader(reader, version), + { Major: 13 } => CmsPageUrlPathK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsPageUrlPathK11 : ICmsPageUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageUrlPath"; + public static string GuidColumnName => ""; + + static CmsPageUrlPathK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + ); + + public static CmsPageUrlPathK11 FromReader(IDataReader reader, SemanticVersion version) => new( + ); +} + +public record CmsPageUrlPathK12 : ICmsPageUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => false; + public static string GetPrimaryKeyName(SemanticVersion version) => ""; + public static string TableName => "CMS_PageUrlPath"; + public static string GuidColumnName => ""; + + static CmsPageUrlPathK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + ); + + public static CmsPageUrlPathK12 FromReader(IDataReader reader, SemanticVersion version) => new( + ); +} + +public record CmsPageUrlPathK13(int PageUrlPathID, Guid PageUrlPathGUID, string PageUrlPathCulture, int PageUrlPathNodeID, string PageUrlPathUrlPath, string PageUrlPathUrlPathHash, int PageUrlPathSiteID, DateTime PageUrlPathLastModified) + : ICmsPageUrlPath, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "PageUrlPathID"; + public static string TableName => "CMS_PageUrlPath"; + public static string GuidColumnName => "PageUrlPathGUID"; + + static CmsPageUrlPathK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageUrlPathID"), reader.Unbox("PageUrlPathGUID"), reader.Unbox("PageUrlPathCulture"), reader.Unbox("PageUrlPathNodeID"), reader.Unbox("PageUrlPathUrlPath"), + reader.Unbox("PageUrlPathUrlPathHash"), reader.Unbox("PageUrlPathSiteID"), reader.Unbox("PageUrlPathLastModified") + ); + + public static CmsPageUrlPathK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("PageUrlPathID"), reader.Unbox("PageUrlPathGUID"), reader.Unbox("PageUrlPathCulture"), reader.Unbox("PageUrlPathNodeID"), reader.Unbox("PageUrlPathUrlPath"), + reader.Unbox("PageUrlPathUrlPathHash"), reader.Unbox("PageUrlPathSiteID"), reader.Unbox("PageUrlPathLastModified") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs b/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs index 0372e18f..0ac7b851 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsRelationship.cs @@ -1,106 +1,99 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsRelationship : ISourceModel -{ - int RelationshipID { get; } - int LeftNodeID { get; } - int RightNodeID { get; } - int RelationshipNameID { get; } - string? RelationshipCustomData { get; } - int? RelationshipOrder { get; } - bool? RelationshipIsAdHoc { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsRelationshipK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsRelationshipK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsRelationshipK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsRelationshipK11.IsAvailable(version), - { Major: 12 } => CmsRelationshipK12.IsAvailable(version), - { Major: 13 } => CmsRelationshipK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Relationship"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsRelationship ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsRelationshipK11.FromReader(reader, version), - { Major: 12 } => CmsRelationshipK12.FromReader(reader, version), - { Major: 13 } => CmsRelationshipK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsRelationshipK11(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; - public static string TableName => "CMS_Relationship"; - public static string GuidColumnName => ""; - static CmsRelationshipK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRelationshipK11( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - } - public static CmsRelationshipK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRelationshipK11( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - } -}; -public partial record CmsRelationshipK12(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; - public static string TableName => "CMS_Relationship"; - public static string GuidColumnName => ""; - static CmsRelationshipK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRelationshipK12( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - } - public static CmsRelationshipK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRelationshipK12( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - } -}; -public partial record CmsRelationshipK13(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; - public static string TableName => "CMS_Relationship"; - public static string GuidColumnName => ""; - static CmsRelationshipK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRelationshipK13( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - } - public static CmsRelationshipK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRelationshipK13( - reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), reader.Unbox("RelationshipIsAdHoc") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsRelationship : ISourceModel +{ + int RelationshipID { get; } + int LeftNodeID { get; } + int RightNodeID { get; } + int RelationshipNameID { get; } + string? RelationshipCustomData { get; } + int? RelationshipOrder { get; } + bool? RelationshipIsAdHoc { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsRelationshipK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsRelationshipK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsRelationshipK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsRelationshipK11.IsAvailable(version), + { Major: 12 } => CmsRelationshipK12.IsAvailable(version), + { Major: 13 } => CmsRelationshipK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Relationship"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsRelationship ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsRelationshipK11.FromReader(reader, version), + { Major: 12 } => CmsRelationshipK12.FromReader(reader, version), + { Major: 13 } => CmsRelationshipK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsRelationshipK11(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; + public static string TableName => "CMS_Relationship"; + public static string GuidColumnName => ""; + + static CmsRelationshipK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), + reader.Unbox("RelationshipIsAdHoc") + ); + + public static CmsRelationshipK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), + reader.Unbox("RelationshipIsAdHoc") + ); +} + +public record CmsRelationshipK12(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; + public static string TableName => "CMS_Relationship"; + public static string GuidColumnName => ""; + + static CmsRelationshipK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), + reader.Unbox("RelationshipIsAdHoc") + ); + + public static CmsRelationshipK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), + reader.Unbox("RelationshipIsAdHoc") + ); +} + +public record CmsRelationshipK13(int RelationshipID, int LeftNodeID, int RightNodeID, int RelationshipNameID, string? RelationshipCustomData, int? RelationshipOrder, bool? RelationshipIsAdHoc) : ICmsRelationship, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RelationshipID"; + public static string TableName => "CMS_Relationship"; + public static string GuidColumnName => ""; + + static CmsRelationshipK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), + reader.Unbox("RelationshipIsAdHoc") + ); + + public static CmsRelationshipK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RelationshipID"), reader.Unbox("LeftNodeID"), reader.Unbox("RightNodeID"), reader.Unbox("RelationshipNameID"), reader.Unbox("RelationshipCustomData"), reader.Unbox("RelationshipOrder"), + reader.Unbox("RelationshipIsAdHoc") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsResource.cs b/KVA/Migration.Toolkit.Source/Model/CmsResource.cs index 836b67af..baa2c3ad 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsResource.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsResource.cs @@ -1,113 +1,154 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsResource : ISourceModel -{ - int ResourceID { get; } - string ResourceDisplayName { get; } - string ResourceName { get; } - string? ResourceDescription { get; } - bool? ShowInDevelopment { get; } - string? ResourceURL { get; } - Guid ResourceGUID { get; } - DateTime ResourceLastModified { get; } - bool? ResourceIsInDevelopment { get; } - bool? ResourceHasFiles { get; } - string? ResourceVersion { get; } - string? ResourceAuthor { get; } - string? ResourceInstallationState { get; } - string? ResourceInstalledVersion { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsResourceK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsResourceK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsResourceK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsResourceK11.IsAvailable(version), - { Major: 12 } => CmsResourceK12.IsAvailable(version), - { Major: 13 } => CmsResourceK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Resource"; - static string ISourceModel.GuidColumnName => "ResourceGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsResource ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsResourceK11.FromReader(reader, version), - { Major: 12 } => CmsResourceK12.FromReader(reader, version), - { Major: 13 } => CmsResourceK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsResourceK11(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; - public static string TableName => "CMS_Resource"; - public static string GuidColumnName => "ResourceGUID"; - static CmsResourceK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsResourceK11( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - } - public static CmsResourceK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsResourceK11( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - } -}; -public partial record CmsResourceK12(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; - public static string TableName => "CMS_Resource"; - public static string GuidColumnName => "ResourceGUID"; - static CmsResourceK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsResourceK12( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - } - public static CmsResourceK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsResourceK12( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - } -}; -public partial record CmsResourceK13(int ResourceID, string ResourceDisplayName, string ResourceName, string? ResourceDescription, bool? ShowInDevelopment, string? ResourceURL, Guid ResourceGUID, DateTime ResourceLastModified, bool? ResourceIsInDevelopment, bool? ResourceHasFiles, string? ResourceVersion, string? ResourceAuthor, string? ResourceInstallationState, string? ResourceInstalledVersion) : ICmsResource, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; - public static string TableName => "CMS_Resource"; - public static string GuidColumnName => "ResourceGUID"; - static CmsResourceK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsResourceK13( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - } - public static CmsResourceK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsResourceK13( - reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsResource : ISourceModel +{ + int ResourceID { get; } + string ResourceDisplayName { get; } + string ResourceName { get; } + string? ResourceDescription { get; } + bool? ShowInDevelopment { get; } + string? ResourceURL { get; } + Guid ResourceGUID { get; } + DateTime ResourceLastModified { get; } + bool? ResourceIsInDevelopment { get; } + bool? ResourceHasFiles { get; } + string? ResourceVersion { get; } + string? ResourceAuthor { get; } + string? ResourceInstallationState { get; } + string? ResourceInstalledVersion { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsResourceK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsResourceK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsResourceK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsResourceK11.IsAvailable(version), + { Major: 12 } => CmsResourceK12.IsAvailable(version), + { Major: 13 } => CmsResourceK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Resource"; + static string ISourceModel.GuidColumnName => "ResourceGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsResource ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsResourceK11.FromReader(reader, version), + { Major: 12 } => CmsResourceK12.FromReader(reader, version), + { Major: 13 } => CmsResourceK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsResourceK11( + int ResourceID, + string ResourceDisplayName, + string ResourceName, + string? ResourceDescription, + bool? ShowInDevelopment, + string? ResourceURL, + Guid ResourceGUID, + DateTime ResourceLastModified, + bool? ResourceIsInDevelopment, + bool? ResourceHasFiles, + string? ResourceVersion, + string? ResourceAuthor, + string? ResourceInstallationState, + string? ResourceInstalledVersion) : ICmsResource, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; + public static string TableName => "CMS_Resource"; + public static string GuidColumnName => "ResourceGUID"; + + static CmsResourceK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), + reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), + reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); + + public static CmsResourceK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), + reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), + reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); +} + +public record CmsResourceK12( + int ResourceID, + string ResourceDisplayName, + string ResourceName, + string? ResourceDescription, + bool? ShowInDevelopment, + string? ResourceURL, + Guid ResourceGUID, + DateTime ResourceLastModified, + bool? ResourceIsInDevelopment, + bool? ResourceHasFiles, + string? ResourceVersion, + string? ResourceAuthor, + string? ResourceInstallationState, + string? ResourceInstalledVersion) : ICmsResource, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; + public static string TableName => "CMS_Resource"; + public static string GuidColumnName => "ResourceGUID"; + + static CmsResourceK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), + reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), + reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); + + public static CmsResourceK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), + reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), + reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); +} + +public record CmsResourceK13( + int ResourceID, + string ResourceDisplayName, + string ResourceName, + string? ResourceDescription, + bool? ShowInDevelopment, + string? ResourceURL, + Guid ResourceGUID, + DateTime ResourceLastModified, + bool? ResourceIsInDevelopment, + bool? ResourceHasFiles, + string? ResourceVersion, + string? ResourceAuthor, + string? ResourceInstallationState, + string? ResourceInstalledVersion) : ICmsResource, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ResourceID"; + public static string TableName => "CMS_Resource"; + public static string GuidColumnName => "ResourceGUID"; + + static CmsResourceK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), + reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), + reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); + + public static CmsResourceK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ResourceID"), reader.Unbox("ResourceDisplayName"), reader.Unbox("ResourceName"), reader.Unbox("ResourceDescription"), reader.Unbox("ShowInDevelopment"), reader.Unbox("ResourceURL"), + reader.Unbox("ResourceGUID"), reader.Unbox("ResourceLastModified"), reader.Unbox("ResourceIsInDevelopment"), reader.Unbox("ResourceHasFiles"), reader.Unbox("ResourceVersion"), + reader.Unbox("ResourceAuthor"), reader.Unbox("ResourceInstallationState"), reader.Unbox("ResourceInstalledVersion") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsRole.cs b/KVA/Migration.Toolkit.Source/Model/CmsRole.cs index 3cacf2f0..c29ed36a 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsRole.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsRole.cs @@ -1,107 +1,102 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsRole : ISourceModel -{ - int RoleID { get; } - string RoleDisplayName { get; } - string RoleName { get; } - string? RoleDescription { get; } - int? SiteID { get; } - Guid RoleGUID { get; } - DateTime RoleLastModified { get; } - bool? RoleIsDomain { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsRoleK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsRoleK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsRoleK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsRoleK11.IsAvailable(version), - { Major: 12 } => CmsRoleK12.IsAvailable(version), - { Major: 13 } => CmsRoleK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Role"; - static string ISourceModel.GuidColumnName => "RoleGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsRole ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsRoleK11.FromReader(reader, version), - { Major: 12 } => CmsRoleK12.FromReader(reader, version), - { Major: 13 } => CmsRoleK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsRoleK11(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, int? RoleGroupID, bool? RoleIsGroupAdministrator, bool? RoleIsDomain) : ICmsRole, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; - public static string TableName => "CMS_Role"; - public static string GuidColumnName => "RoleGUID"; - static CmsRoleK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRoleK11( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") - ); - } - public static CmsRoleK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRoleK11( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") - ); - } -}; -public partial record CmsRoleK12(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, int? RoleGroupID, bool? RoleIsGroupAdministrator, bool? RoleIsDomain) : ICmsRole, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; - public static string TableName => "CMS_Role"; - public static string GuidColumnName => "RoleGUID"; - static CmsRoleK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRoleK12( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") - ); - } - public static CmsRoleK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRoleK12( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") - ); - } -}; -public partial record CmsRoleK13(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, bool? RoleIsDomain) : ICmsRole, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; - public static string TableName => "CMS_Role"; - public static string GuidColumnName => "RoleGUID"; - static CmsRoleK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRoleK13( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleIsDomain") - ); - } - public static CmsRoleK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsRoleK13( - reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), reader.Unbox("RoleLastModified"), reader.Unbox("RoleIsDomain") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsRole : ISourceModel +{ + int RoleID { get; } + string RoleDisplayName { get; } + string RoleName { get; } + string? RoleDescription { get; } + int? SiteID { get; } + Guid RoleGUID { get; } + DateTime RoleLastModified { get; } + bool? RoleIsDomain { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsRoleK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsRoleK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsRoleK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsRoleK11.IsAvailable(version), + { Major: 12 } => CmsRoleK12.IsAvailable(version), + { Major: 13 } => CmsRoleK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Role"; + static string ISourceModel.GuidColumnName => "RoleGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsRole ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsRoleK11.FromReader(reader, version), + { Major: 12 } => CmsRoleK12.FromReader(reader, version), + { Major: 13 } => CmsRoleK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsRoleK11(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, int? RoleGroupID, bool? RoleIsGroupAdministrator, bool? RoleIsDomain) + : ICmsRole, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; + public static string TableName => "CMS_Role"; + public static string GuidColumnName => "RoleGUID"; + + static CmsRoleK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), + reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") + ); + + public static CmsRoleK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), + reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") + ); +} + +public record CmsRoleK12(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, int? RoleGroupID, bool? RoleIsGroupAdministrator, bool? RoleIsDomain) + : ICmsRole, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; + public static string TableName => "CMS_Role"; + public static string GuidColumnName => "RoleGUID"; + + static CmsRoleK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), + reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") + ); + + public static CmsRoleK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), + reader.Unbox("RoleLastModified"), reader.Unbox("RoleGroupID"), reader.Unbox("RoleIsGroupAdministrator"), reader.Unbox("RoleIsDomain") + ); +} + +public record CmsRoleK13(int RoleID, string RoleDisplayName, string RoleName, string? RoleDescription, int? SiteID, Guid RoleGUID, DateTime RoleLastModified, bool? RoleIsDomain) : ICmsRole, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "RoleID"; + public static string TableName => "CMS_Role"; + public static string GuidColumnName => "RoleGUID"; + + static CmsRoleK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), + reader.Unbox("RoleLastModified"), reader.Unbox("RoleIsDomain") + ); + + public static CmsRoleK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("RoleID"), reader.Unbox("RoleDisplayName"), reader.Unbox("RoleName"), reader.Unbox("RoleDescription"), reader.Unbox("SiteID"), reader.Unbox("RoleGUID"), + reader.Unbox("RoleLastModified"), reader.Unbox("RoleIsDomain") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs b/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs index ae5ffbbb..b4d6a3c0 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsSettingsKey.cs @@ -1,118 +1,180 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsSettingsKey : ISourceModel -{ - int KeyID { get; } - string KeyName { get; } - string KeyDisplayName { get; } - string? KeyDescription { get; } - string? KeyValue { get; } - string KeyType { get; } - int? KeyCategoryID { get; } - int? SiteID { get; } - Guid KeyGUID { get; } - DateTime KeyLastModified { get; } - int? KeyOrder { get; } - string? KeyDefaultValue { get; } - string? KeyValidation { get; } - string? KeyEditingControlPath { get; } - bool? KeyIsGlobal { get; } - bool? KeyIsCustom { get; } - bool? KeyIsHidden { get; } - string? KeyFormControlSettings { get; } - string? KeyExplanationText { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSettingsKeyK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsSettingsKeyK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsSettingsKeyK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSettingsKeyK11.IsAvailable(version), - { Major: 12 } => CmsSettingsKeyK12.IsAvailable(version), - { Major: 13 } => CmsSettingsKeyK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_SettingsKey"; - static string ISourceModel.GuidColumnName => "KeyGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsSettingsKey ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSettingsKeyK11.FromReader(reader, version), - { Major: 12 } => CmsSettingsKeyK12.FromReader(reader, version), - { Major: 13 } => CmsSettingsKeyK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsSettingsKeyK11(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; - public static string TableName => "CMS_SettingsKey"; - public static string GuidColumnName => "KeyGUID"; - static CmsSettingsKeyK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSettingsKeyK11( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - } - public static CmsSettingsKeyK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSettingsKeyK11( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - } -}; -public partial record CmsSettingsKeyK12(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; - public static string TableName => "CMS_SettingsKey"; - public static string GuidColumnName => "KeyGUID"; - static CmsSettingsKeyK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSettingsKeyK12( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - } - public static CmsSettingsKeyK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSettingsKeyK12( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - } -}; -public partial record CmsSettingsKeyK13(int KeyID, string KeyName, string KeyDisplayName, string? KeyDescription, string? KeyValue, string KeyType, int? KeyCategoryID, int? SiteID, Guid KeyGUID, DateTime KeyLastModified, int? KeyOrder, string? KeyDefaultValue, string? KeyValidation, string? KeyEditingControlPath, bool? KeyIsGlobal, bool? KeyIsCustom, bool? KeyIsHidden, string? KeyFormControlSettings, string? KeyExplanationText) : ICmsSettingsKey, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; - public static string TableName => "CMS_SettingsKey"; - public static string GuidColumnName => "KeyGUID"; - static CmsSettingsKeyK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSettingsKeyK13( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - } - public static CmsSettingsKeyK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSettingsKeyK13( - reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsSettingsKey : ISourceModel +{ + int KeyID { get; } + string KeyName { get; } + string KeyDisplayName { get; } + string? KeyDescription { get; } + string? KeyValue { get; } + string KeyType { get; } + int? KeyCategoryID { get; } + int? SiteID { get; } + Guid KeyGUID { get; } + DateTime KeyLastModified { get; } + int? KeyOrder { get; } + string? KeyDefaultValue { get; } + string? KeyValidation { get; } + string? KeyEditingControlPath { get; } + bool? KeyIsGlobal { get; } + bool? KeyIsCustom { get; } + bool? KeyIsHidden { get; } + string? KeyFormControlSettings { get; } + string? KeyExplanationText { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSettingsKeyK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsSettingsKeyK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsSettingsKeyK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSettingsKeyK11.IsAvailable(version), + { Major: 12 } => CmsSettingsKeyK12.IsAvailable(version), + { Major: 13 } => CmsSettingsKeyK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_SettingsKey"; + static string ISourceModel.GuidColumnName => "KeyGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsSettingsKey ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsSettingsKeyK11.FromReader(reader, version), + { Major: 12 } => CmsSettingsKeyK12.FromReader(reader, version), + { Major: 13 } => CmsSettingsKeyK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsSettingsKeyK11( + int KeyID, + string KeyName, + string KeyDisplayName, + string? KeyDescription, + string? KeyValue, + string KeyType, + int? KeyCategoryID, + int? SiteID, + Guid KeyGUID, + DateTime KeyLastModified, + int? KeyOrder, + string? KeyDefaultValue, + string? KeyValidation, + string? KeyEditingControlPath, + bool? KeyIsGlobal, + bool? KeyIsCustom, + bool? KeyIsHidden, + string? KeyFormControlSettings, + string? KeyExplanationText) : ICmsSettingsKey, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; + public static string TableName => "CMS_SettingsKey"; + public static string GuidColumnName => "KeyGUID"; + + static CmsSettingsKeyK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), + reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), + reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), + reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); + + public static CmsSettingsKeyK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), + reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), + reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), + reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); +} + +public record CmsSettingsKeyK12( + int KeyID, + string KeyName, + string KeyDisplayName, + string? KeyDescription, + string? KeyValue, + string KeyType, + int? KeyCategoryID, + int? SiteID, + Guid KeyGUID, + DateTime KeyLastModified, + int? KeyOrder, + string? KeyDefaultValue, + string? KeyValidation, + string? KeyEditingControlPath, + bool? KeyIsGlobal, + bool? KeyIsCustom, + bool? KeyIsHidden, + string? KeyFormControlSettings, + string? KeyExplanationText) : ICmsSettingsKey, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; + public static string TableName => "CMS_SettingsKey"; + public static string GuidColumnName => "KeyGUID"; + + static CmsSettingsKeyK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), + reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), + reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), + reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); + + public static CmsSettingsKeyK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), + reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), + reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), + reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); +} + +public record CmsSettingsKeyK13( + int KeyID, + string KeyName, + string KeyDisplayName, + string? KeyDescription, + string? KeyValue, + string KeyType, + int? KeyCategoryID, + int? SiteID, + Guid KeyGUID, + DateTime KeyLastModified, + int? KeyOrder, + string? KeyDefaultValue, + string? KeyValidation, + string? KeyEditingControlPath, + bool? KeyIsGlobal, + bool? KeyIsCustom, + bool? KeyIsHidden, + string? KeyFormControlSettings, + string? KeyExplanationText) : ICmsSettingsKey, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "KeyID"; + public static string TableName => "CMS_SettingsKey"; + public static string GuidColumnName => "KeyGUID"; + + static CmsSettingsKeyK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), + reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), + reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), + reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); + + public static CmsSettingsKeyK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("KeyID"), reader.Unbox("KeyName"), reader.Unbox("KeyDisplayName"), reader.Unbox("KeyDescription"), reader.Unbox("KeyValue"), reader.Unbox("KeyType"), + reader.Unbox("KeyCategoryID"), reader.Unbox("SiteID"), reader.Unbox("KeyGUID"), reader.Unbox("KeyLastModified"), reader.Unbox("KeyOrder"), reader.Unbox("KeyDefaultValue"), + reader.Unbox("KeyValidation"), reader.Unbox("KeyEditingControlPath"), reader.Unbox("KeyIsGlobal"), reader.Unbox("KeyIsCustom"), reader.Unbox("KeyIsHidden"), + reader.Unbox("KeyFormControlSettings"), reader.Unbox("KeyExplanationText") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSite.cs b/KVA/Migration.Toolkit.Source/Model/CmsSite.cs index 673426bc..3ca2b2d6 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsSite.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsSite.cs @@ -1,108 +1,138 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsSite : ISourceModel -{ - int SiteID { get; } - string SiteName { get; } - string SiteDisplayName { get; } - string? SiteDescription { get; } - string SiteStatus { get; } - string SiteDomainName { get; } - string? SiteDefaultVisitorCulture { get; } - Guid SiteGUID { get; } - DateTime SiteLastModified { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSiteK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsSiteK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsSiteK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSiteK11.IsAvailable(version), - { Major: 12 } => CmsSiteK12.IsAvailable(version), - { Major: 13 } => CmsSiteK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Site"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsSite ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSiteK11.FromReader(reader, version), - { Major: 12 } => CmsSiteK12.FromReader(reader, version), - { Major: 13 } => CmsSiteK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsSiteK11(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, int? SiteDefaultStylesheetID, string? SiteDefaultVisitorCulture, int? SiteDefaultEditorStylesheet, Guid SiteGUID, DateTime SiteLastModified, bool? SiteIsOffline, string? SiteOfflineRedirectURL, string? SiteOfflineMessage, string? SitePresentationURL, bool? SiteIsContentOnly) : ICmsSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; - public static string TableName => "CMS_Site"; - public static string GuidColumnName => ""; - static CmsSiteK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteK11( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") - ); - } - public static CmsSiteK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteK11( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") - ); - } -}; -public partial record CmsSiteK12(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, int? SiteDefaultStylesheetID, string? SiteDefaultVisitorCulture, int? SiteDefaultEditorStylesheet, Guid SiteGUID, DateTime SiteLastModified, bool? SiteIsOffline, string? SiteOfflineRedirectURL, string? SiteOfflineMessage, string? SitePresentationURL, bool? SiteIsContentOnly) : ICmsSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; - public static string TableName => "CMS_Site"; - public static string GuidColumnName => ""; - static CmsSiteK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteK12( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") - ); - } - public static CmsSiteK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteK12( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") - ); - } -}; -public partial record CmsSiteK13(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, string? SiteDefaultVisitorCulture, Guid SiteGUID, DateTime SiteLastModified, string SitePresentationURL) : ICmsSite, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; - public static string TableName => "CMS_Site"; - public static string GuidColumnName => ""; - static CmsSiteK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteK13( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SitePresentationURL") - ); - } - public static CmsSiteK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteK13( - reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SitePresentationURL") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsSite : ISourceModel +{ + int SiteID { get; } + string SiteName { get; } + string SiteDisplayName { get; } + string? SiteDescription { get; } + string SiteStatus { get; } + string SiteDomainName { get; } + string? SiteDefaultVisitorCulture { get; } + Guid SiteGUID { get; } + DateTime SiteLastModified { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsSiteK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsSiteK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteK11.IsAvailable(version), + { Major: 12 } => CmsSiteK12.IsAvailable(version), + { Major: 13 } => CmsSiteK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Site"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsSite ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteK11.FromReader(reader, version), + { Major: 12 } => CmsSiteK12.FromReader(reader, version), + { Major: 13 } => CmsSiteK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsSiteK11( + int SiteID, + string SiteName, + string SiteDisplayName, + string? SiteDescription, + string SiteStatus, + string SiteDomainName, + int? SiteDefaultStylesheetID, + string? SiteDefaultVisitorCulture, + int? SiteDefaultEditorStylesheet, + Guid SiteGUID, + DateTime SiteLastModified, + bool? SiteIsOffline, + string? SiteOfflineRedirectURL, + string? SiteOfflineMessage, + string? SitePresentationURL, + bool? SiteIsContentOnly) : ICmsSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; + public static string TableName => "CMS_Site"; + public static string GuidColumnName => ""; + + static CmsSiteK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), + reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), + reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") + ); + + public static CmsSiteK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), + reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), + reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") + ); +} + +public record CmsSiteK12( + int SiteID, + string SiteName, + string SiteDisplayName, + string? SiteDescription, + string SiteStatus, + string SiteDomainName, + int? SiteDefaultStylesheetID, + string? SiteDefaultVisitorCulture, + int? SiteDefaultEditorStylesheet, + Guid SiteGUID, + DateTime SiteLastModified, + bool? SiteIsOffline, + string? SiteOfflineRedirectURL, + string? SiteOfflineMessage, + string? SitePresentationURL, + bool? SiteIsContentOnly) : ICmsSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; + public static string TableName => "CMS_Site"; + public static string GuidColumnName => ""; + + static CmsSiteK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), + reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), + reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") + ); + + public static CmsSiteK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), + reader.Unbox("SiteDefaultStylesheetID"), reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteDefaultEditorStylesheet"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), + reader.Unbox("SiteIsOffline"), reader.Unbox("SiteOfflineRedirectURL"), reader.Unbox("SiteOfflineMessage"), reader.Unbox("SitePresentationURL"), reader.Unbox("SiteIsContentOnly") + ); +} + +public record CmsSiteK13(int SiteID, string SiteName, string SiteDisplayName, string? SiteDescription, string SiteStatus, string SiteDomainName, string? SiteDefaultVisitorCulture, Guid SiteGUID, DateTime SiteLastModified, string SitePresentationURL) + : ICmsSite, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "SiteID"; + public static string TableName => "CMS_Site"; + public static string GuidColumnName => ""; + + static CmsSiteK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), + reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SitePresentationURL") + ); + + public static CmsSiteK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("SiteName"), reader.Unbox("SiteDisplayName"), reader.Unbox("SiteDescription"), reader.Unbox("SiteStatus"), reader.Unbox("SiteDomainName"), + reader.Unbox("SiteDefaultVisitorCulture"), reader.Unbox("SiteGUID"), reader.Unbox("SiteLastModified"), reader.Unbox("SitePresentationURL") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs b/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs index bc7a649e..799b8495 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsSiteCulture.cs @@ -1,101 +1,88 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsSiteCulture : ISourceModel -{ - int SiteID { get; } - int CultureID { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSiteCultureK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsSiteCultureK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsSiteCultureK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSiteCultureK11.IsAvailable(version), - { Major: 12 } => CmsSiteCultureK12.IsAvailable(version), - { Major: 13 } => CmsSiteCultureK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_SiteCulture"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsSiteCulture ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsSiteCultureK11.FromReader(reader, version), - { Major: 12 } => CmsSiteCultureK12.FromReader(reader, version), - { Major: 13 } => CmsSiteCultureK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsSiteCultureK11(int SiteID, int CultureID) : ICmsSiteCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_SiteCulture"; - public static string GuidColumnName => ""; - static CmsSiteCultureK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteCultureK11( - reader.Unbox("SiteID"), reader.Unbox("CultureID") - ); - } - public static CmsSiteCultureK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteCultureK11( - reader.Unbox("SiteID"), reader.Unbox("CultureID") - ); - } -}; -public partial record CmsSiteCultureK12(int SiteID, int CultureID) : ICmsSiteCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_SiteCulture"; - public static string GuidColumnName => ""; - static CmsSiteCultureK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteCultureK12( - reader.Unbox("SiteID"), reader.Unbox("CultureID") - ); - } - public static CmsSiteCultureK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteCultureK12( - reader.Unbox("SiteID"), reader.Unbox("CultureID") - ); - } -}; -public partial record CmsSiteCultureK13(int SiteID, int CultureID) : ICmsSiteCulture, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; - public static string TableName => "CMS_SiteCulture"; - public static string GuidColumnName => ""; - static CmsSiteCultureK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteCultureK13( - reader.Unbox("SiteID"), reader.Unbox("CultureID") - ); - } - public static CmsSiteCultureK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsSiteCultureK13( - reader.Unbox("SiteID"), reader.Unbox("CultureID") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsSiteCulture : ISourceModel +{ + int SiteID { get; } + int CultureID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteCultureK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsSiteCultureK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsSiteCultureK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteCultureK11.IsAvailable(version), + { Major: 12 } => CmsSiteCultureK12.IsAvailable(version), + { Major: 13 } => CmsSiteCultureK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_SiteCulture"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsSiteCulture ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsSiteCultureK11.FromReader(reader, version), + { Major: 12 } => CmsSiteCultureK12.FromReader(reader, version), + { Major: 13 } => CmsSiteCultureK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsSiteCultureK11(int SiteID, int CultureID) : ICmsSiteCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_SiteCulture"; + public static string GuidColumnName => ""; + + static CmsSiteCultureK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("CultureID") + ); + + public static CmsSiteCultureK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("CultureID") + ); +} + +public record CmsSiteCultureK12(int SiteID, int CultureID) : ICmsSiteCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_SiteCulture"; + public static string GuidColumnName => ""; + + static CmsSiteCultureK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("CultureID") + ); + + public static CmsSiteCultureK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("CultureID") + ); +} + +public record CmsSiteCultureK13(int SiteID, int CultureID) : ICmsSiteCulture, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "CultureID"; + public static string TableName => "CMS_SiteCulture"; + public static string GuidColumnName => ""; + + static CmsSiteCultureK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("CultureID") + ); + + public static CmsSiteCultureK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("SiteID"), reader.Unbox("CultureID") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsState.cs b/KVA/Migration.Toolkit.Source/Model/CmsState.cs index 2291c33d..e1a5032a 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsState.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsState.cs @@ -1,106 +1,99 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsState : ISourceModel -{ - int StateID { get; } - string StateDisplayName { get; } - string StateName { get; } - string? StateCode { get; } - int CountryID { get; } - Guid StateGUID { get; } - DateTime StateLastModified { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsStateK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsStateK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsStateK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsStateK11.IsAvailable(version), - { Major: 12 } => CmsStateK12.IsAvailable(version), - { Major: 13 } => CmsStateK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_State"; - static string ISourceModel.GuidColumnName => "StateGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsState ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsStateK11.FromReader(reader, version), - { Major: 12 } => CmsStateK12.FromReader(reader, version), - { Major: 13 } => CmsStateK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsStateK11(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; - public static string TableName => "CMS_State"; - public static string GuidColumnName => "StateGUID"; - static CmsStateK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsStateK11( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - } - public static CmsStateK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsStateK11( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - } -}; -public partial record CmsStateK12(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; - public static string TableName => "CMS_State"; - public static string GuidColumnName => "StateGUID"; - static CmsStateK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsStateK12( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - } - public static CmsStateK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsStateK12( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - } -}; -public partial record CmsStateK13(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; - public static string TableName => "CMS_State"; - public static string GuidColumnName => "StateGUID"; - static CmsStateK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsStateK13( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - } - public static CmsStateK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsStateK13( - reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), reader.Unbox("StateLastModified") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsState : ISourceModel +{ + int StateID { get; } + string StateDisplayName { get; } + string StateName { get; } + string? StateCode { get; } + int CountryID { get; } + Guid StateGUID { get; } + DateTime StateLastModified { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsStateK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsStateK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsStateK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsStateK11.IsAvailable(version), + { Major: 12 } => CmsStateK12.IsAvailable(version), + { Major: 13 } => CmsStateK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_State"; + static string ISourceModel.GuidColumnName => "StateGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsState ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsStateK11.FromReader(reader, version), + { Major: 12 } => CmsStateK12.FromReader(reader, version), + { Major: 13 } => CmsStateK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsStateK11(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; + public static string TableName => "CMS_State"; + public static string GuidColumnName => "StateGUID"; + + static CmsStateK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), + reader.Unbox("StateLastModified") + ); + + public static CmsStateK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), + reader.Unbox("StateLastModified") + ); +} + +public record CmsStateK12(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; + public static string TableName => "CMS_State"; + public static string GuidColumnName => "StateGUID"; + + static CmsStateK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), + reader.Unbox("StateLastModified") + ); + + public static CmsStateK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), + reader.Unbox("StateLastModified") + ); +} + +public record CmsStateK13(int StateID, string StateDisplayName, string StateName, string? StateCode, int CountryID, Guid StateGUID, DateTime StateLastModified) : ICmsState, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "StateID"; + public static string TableName => "CMS_State"; + public static string GuidColumnName => "StateGUID"; + + static CmsStateK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), + reader.Unbox("StateLastModified") + ); + + public static CmsStateK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("StateID"), reader.Unbox("StateDisplayName"), reader.Unbox("StateName"), reader.Unbox("StateCode"), reader.Unbox("CountryID"), reader.Unbox("StateGUID"), + reader.Unbox("StateLastModified") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsTree.cs b/KVA/Migration.Toolkit.Source/Model/CmsTree.cs index 202704b9..8ba31ccc 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsTree.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsTree.cs @@ -1,120 +1,222 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsTree : ISourceModel -{ - int NodeID { get; } - string NodeAliasPath { get; } - string NodeName { get; } - string NodeAlias { get; } - int NodeClassID { get; } - int? NodeParentID { get; } - int NodeLevel { get; } - int? NodeACLID { get; } - int NodeSiteID { get; } - Guid NodeGUID { get; } - int? NodeOrder { get; } - bool? IsSecuredNode { get; } - int? NodeSKUID { get; } - int? NodeLinkedNodeID { get; } - int? NodeOwner { get; } - string? NodeCustomData { get; } - int? NodeLinkedNodeSiteID { get; } - bool? NodeHasChildren { get; } - bool? NodeHasLinks { get; } - int? NodeOriginalNodeID { get; } - bool NodeIsACLOwner { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsTreeK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsTreeK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsTreeK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsTreeK11.IsAvailable(version), - { Major: 12 } => CmsTreeK12.IsAvailable(version), - { Major: 13 } => CmsTreeK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_Tree"; - static string ISourceModel.GuidColumnName => "NodeGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsTree ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsTreeK11.FromReader(reader, version), - { Major: 12 } => CmsTreeK12.FromReader(reader, version), - { Major: 13 } => CmsTreeK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsTreeK11(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeCacheMinutes, int? NodeSKUID, string? NodeDocType, string? NodeHeadTags, string? NodeBodyElementAttributes, string? NodeInheritPageLevels, int? RequiresSSL, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeGroupID, int? NodeLinkedNodeSiteID, int? NodeTemplateID, bool? NodeTemplateForAllCultures, bool? NodeInheritPageTemplate, bool? NodeAllowCacheInFileSystem, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsContentOnly, bool NodeIsACLOwner, string? NodeBodyScripts) : ICmsTree, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; - public static string TableName => "CMS_Tree"; - public static string GuidColumnName => "NodeGUID"; - static CmsTreeK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsTreeK11( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") - ); - } - public static CmsTreeK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsTreeK11( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") - ); - } -}; -public partial record CmsTreeK12(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeCacheMinutes, int? NodeSKUID, string? NodeDocType, string? NodeHeadTags, string? NodeBodyElementAttributes, string? NodeInheritPageLevels, int? RequiresSSL, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeGroupID, int? NodeLinkedNodeSiteID, int? NodeTemplateID, bool? NodeTemplateForAllCultures, bool? NodeInheritPageTemplate, bool? NodeAllowCacheInFileSystem, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsContentOnly, bool NodeIsACLOwner, string? NodeBodyScripts) : ICmsTree, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; - public static string TableName => "CMS_Tree"; - public static string GuidColumnName => "NodeGUID"; - static CmsTreeK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsTreeK12( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") - ); - } - public static CmsTreeK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsTreeK12( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") - ); - } -}; -public partial record CmsTreeK13(int NodeID, string NodeAliasPath, string NodeName, string NodeAlias, int NodeClassID, int? NodeParentID, int NodeLevel, int? NodeACLID, int NodeSiteID, Guid NodeGUID, int? NodeOrder, bool? IsSecuredNode, int? NodeSKUID, int? NodeLinkedNodeID, int? NodeOwner, string? NodeCustomData, int? NodeLinkedNodeSiteID, bool? NodeHasChildren, bool? NodeHasLinks, int? NodeOriginalNodeID, bool NodeIsACLOwner) : ICmsTree, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; - public static string TableName => "CMS_Tree"; - public static string GuidColumnName => "NodeGUID"; - static CmsTreeK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsTreeK13( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsACLOwner") - ); - } - public static CmsTreeK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsTreeK13( - reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsACLOwner") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsTree : ISourceModel +{ + int NodeID { get; } + string NodeAliasPath { get; } + string NodeName { get; } + string NodeAlias { get; } + int NodeClassID { get; } + int? NodeParentID { get; } + int NodeLevel { get; } + int? NodeACLID { get; } + int NodeSiteID { get; } + Guid NodeGUID { get; } + int? NodeOrder { get; } + bool? IsSecuredNode { get; } + int? NodeSKUID { get; } + int? NodeLinkedNodeID { get; } + int? NodeOwner { get; } + string? NodeCustomData { get; } + int? NodeLinkedNodeSiteID { get; } + bool? NodeHasChildren { get; } + bool? NodeHasLinks { get; } + int? NodeOriginalNodeID { get; } + bool NodeIsACLOwner { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsTreeK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsTreeK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsTreeK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsTreeK11.IsAvailable(version), + { Major: 12 } => CmsTreeK12.IsAvailable(version), + { Major: 13 } => CmsTreeK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_Tree"; + static string ISourceModel.GuidColumnName => "NodeGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsTree ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsTreeK11.FromReader(reader, version), + { Major: 12 } => CmsTreeK12.FromReader(reader, version), + { Major: 13 } => CmsTreeK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsTreeK11( + int NodeID, + string NodeAliasPath, + string NodeName, + string NodeAlias, + int NodeClassID, + int? NodeParentID, + int NodeLevel, + int? NodeACLID, + int NodeSiteID, + Guid NodeGUID, + int? NodeOrder, + bool? IsSecuredNode, + int? NodeCacheMinutes, + int? NodeSKUID, + string? NodeDocType, + string? NodeHeadTags, + string? NodeBodyElementAttributes, + string? NodeInheritPageLevels, + int? RequiresSSL, + int? NodeLinkedNodeID, + int? NodeOwner, + string? NodeCustomData, + int? NodeGroupID, + int? NodeLinkedNodeSiteID, + int? NodeTemplateID, + bool? NodeTemplateForAllCultures, + bool? NodeInheritPageTemplate, + bool? NodeAllowCacheInFileSystem, + bool? NodeHasChildren, + bool? NodeHasLinks, + int? NodeOriginalNodeID, + bool NodeIsContentOnly, + bool NodeIsACLOwner, + string? NodeBodyScripts) : ICmsTree, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; + public static string TableName => "CMS_Tree"; + public static string GuidColumnName => "NodeGUID"; + + static CmsTreeK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), + reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), + reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), + reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), + reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), + reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") + ); + + public static CmsTreeK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), + reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), + reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), + reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), + reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), + reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") + ); +} + +public record CmsTreeK12( + int NodeID, + string NodeAliasPath, + string NodeName, + string NodeAlias, + int NodeClassID, + int? NodeParentID, + int NodeLevel, + int? NodeACLID, + int NodeSiteID, + Guid NodeGUID, + int? NodeOrder, + bool? IsSecuredNode, + int? NodeCacheMinutes, + int? NodeSKUID, + string? NodeDocType, + string? NodeHeadTags, + string? NodeBodyElementAttributes, + string? NodeInheritPageLevels, + int? RequiresSSL, + int? NodeLinkedNodeID, + int? NodeOwner, + string? NodeCustomData, + int? NodeGroupID, + int? NodeLinkedNodeSiteID, + int? NodeTemplateID, + bool? NodeTemplateForAllCultures, + bool? NodeInheritPageTemplate, + bool? NodeAllowCacheInFileSystem, + bool? NodeHasChildren, + bool? NodeHasLinks, + int? NodeOriginalNodeID, + bool NodeIsContentOnly, + bool NodeIsACLOwner, + string? NodeBodyScripts) : ICmsTree, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; + public static string TableName => "CMS_Tree"; + public static string GuidColumnName => "NodeGUID"; + + static CmsTreeK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), + reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), + reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), + reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), + reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), + reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") + ); + + public static CmsTreeK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), + reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeCacheMinutes"), reader.Unbox("NodeSKUID"), + reader.Unbox("NodeDocType"), reader.Unbox("NodeHeadTags"), reader.Unbox("NodeBodyElementAttributes"), reader.Unbox("NodeInheritPageLevels"), reader.Unbox("RequiresSSL"), + reader.Unbox("NodeLinkedNodeID"), reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeGroupID"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeTemplateID"), + reader.Unbox("NodeTemplateForAllCultures"), reader.Unbox("NodeInheritPageTemplate"), reader.Unbox("NodeAllowCacheInFileSystem"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), + reader.Unbox("NodeOriginalNodeID"), reader.Unbox("NodeIsContentOnly"), reader.Unbox("NodeIsACLOwner"), reader.Unbox("NodeBodyScripts") + ); +} + +public record CmsTreeK13( + int NodeID, + string NodeAliasPath, + string NodeName, + string NodeAlias, + int NodeClassID, + int? NodeParentID, + int NodeLevel, + int? NodeACLID, + int NodeSiteID, + Guid NodeGUID, + int? NodeOrder, + bool? IsSecuredNode, + int? NodeSKUID, + int? NodeLinkedNodeID, + int? NodeOwner, + string? NodeCustomData, + int? NodeLinkedNodeSiteID, + bool? NodeHasChildren, + bool? NodeHasLinks, + int? NodeOriginalNodeID, + bool NodeIsACLOwner) : ICmsTree, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "NodeID"; + public static string TableName => "CMS_Tree"; + public static string GuidColumnName => "NodeGUID"; + + static CmsTreeK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), + reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeLinkedNodeID"), + reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), + reader.Unbox("NodeIsACLOwner") + ); + + public static CmsTreeK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("NodeID"), reader.Unbox("NodeAliasPath"), reader.Unbox("NodeName"), reader.Unbox("NodeAlias"), reader.Unbox("NodeClassID"), reader.Unbox("NodeParentID"), reader.Unbox("NodeLevel"), + reader.Unbox("NodeACLID"), reader.Unbox("NodeSiteID"), reader.Unbox("NodeGUID"), reader.Unbox("NodeOrder"), reader.Unbox("IsSecuredNode"), reader.Unbox("NodeSKUID"), reader.Unbox("NodeLinkedNodeID"), + reader.Unbox("NodeOwner"), reader.Unbox("NodeCustomData"), reader.Unbox("NodeLinkedNodeSiteID"), reader.Unbox("NodeHasChildren"), reader.Unbox("NodeHasLinks"), reader.Unbox("NodeOriginalNodeID"), + reader.Unbox("NodeIsACLOwner") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsUser.cs b/KVA/Migration.Toolkit.Source/Model/CmsUser.cs index d197b1ed..6607cb70 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsUser.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsUser.cs @@ -1,126 +1,224 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsUser : ISourceModel -{ - int UserID { get; } - string UserName { get; } - string? FirstName { get; } - string? MiddleName { get; } - string? LastName { get; } - string? FullName { get; } - string? Email { get; } - string UserPassword { get; } - string? PreferredCultureCode { get; } - string? PreferredUICultureCode { get; } - bool UserEnabled { get; } - bool? UserIsExternal { get; } - string? UserPasswordFormat { get; } - DateTime? UserCreated { get; } - DateTime? LastLogon { get; } - string? UserStartingAliasPath { get; } - Guid UserGUID { get; } - DateTime UserLastModified { get; } - string? UserLastLogonInfo { get; } - bool? UserIsHidden { get; } - bool? UserIsDomain { get; } - bool? UserHasAllowedCultures { get; } - bool? UserMFRequired { get; } - int UserPrivilegeLevel { get; } - string? UserSecurityStamp { get; } - byte[]? UserMFSecret { get; } - long? UserMFTimestep { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsUserK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsUserK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsUserK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsUserK11.IsAvailable(version), - { Major: 12 } => CmsUserK12.IsAvailable(version), - { Major: 13 } => CmsUserK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_User"; - static string ISourceModel.GuidColumnName => "UserGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsUser ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsUserK11.FromReader(reader, version), - { Major: 12 } => CmsUserK12.FromReader(reader, version), - { Major: 13 } => CmsUserK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsUserK11(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, string? UserVisibility, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep) : ICmsUser, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; - public static string TableName => "CMS_User"; - public static string GuidColumnName => "UserGUID"; - static CmsUserK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserK11( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); - } - public static CmsUserK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserK11( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); - } -}; -public partial record CmsUserK12(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, string? UserVisibility, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep) : ICmsUser, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; - public static string TableName => "CMS_User"; - public static string GuidColumnName => "UserGUID"; - static CmsUserK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserK12( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); - } - public static CmsUserK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserK12( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); - } -}; -public partial record CmsUserK13(int UserID, string UserName, string? FirstName, string? MiddleName, string? LastName, string? FullName, string? Email, string UserPassword, string? PreferredCultureCode, string? PreferredUICultureCode, bool UserEnabled, bool? UserIsExternal, string? UserPasswordFormat, DateTime? UserCreated, DateTime? LastLogon, string? UserStartingAliasPath, Guid UserGUID, DateTime UserLastModified, string? UserLastLogonInfo, bool? UserIsHidden, bool? UserIsDomain, bool? UserHasAllowedCultures, bool? UserMFRequired, int UserPrivilegeLevel, string? UserSecurityStamp, byte[]? UserMFSecret, long? UserMFTimestep) : ICmsUser, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; - public static string TableName => "CMS_User"; - public static string GuidColumnName => "UserGUID"; - static CmsUserK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserK13( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); - } - public static CmsUserK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserK13( - reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsUser : ISourceModel +{ + int UserID { get; } + string UserName { get; } + string? FirstName { get; } + string? MiddleName { get; } + string? LastName { get; } + string? FullName { get; } + string? Email { get; } + string UserPassword { get; } + string? PreferredCultureCode { get; } + string? PreferredUICultureCode { get; } + bool UserEnabled { get; } + bool? UserIsExternal { get; } + string? UserPasswordFormat { get; } + DateTime? UserCreated { get; } + DateTime? LastLogon { get; } + string? UserStartingAliasPath { get; } + Guid UserGUID { get; } + DateTime UserLastModified { get; } + string? UserLastLogonInfo { get; } + bool? UserIsHidden { get; } + bool? UserIsDomain { get; } + bool? UserHasAllowedCultures { get; } + bool? UserMFRequired { get; } + int UserPrivilegeLevel { get; } + string? UserSecurityStamp { get; } + byte[]? UserMFSecret { get; } + long? UserMFTimestep { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsUserK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsUserK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserK11.IsAvailable(version), + { Major: 12 } => CmsUserK12.IsAvailable(version), + { Major: 13 } => CmsUserK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_User"; + static string ISourceModel.GuidColumnName => "UserGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsUser ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserK11.FromReader(reader, version), + { Major: 12 } => CmsUserK12.FromReader(reader, version), + { Major: 13 } => CmsUserK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsUserK11( + int UserID, + string UserName, + string? FirstName, + string? MiddleName, + string? LastName, + string? FullName, + string? Email, + string UserPassword, + string? PreferredCultureCode, + string? PreferredUICultureCode, + bool UserEnabled, + bool? UserIsExternal, + string? UserPasswordFormat, + DateTime? UserCreated, + DateTime? LastLogon, + string? UserStartingAliasPath, + Guid UserGUID, + DateTime UserLastModified, + string? UserLastLogonInfo, + bool? UserIsHidden, + string? UserVisibility, + bool? UserIsDomain, + bool? UserHasAllowedCultures, + bool? UserMFRequired, + int UserPrivilegeLevel, + string? UserSecurityStamp, + byte[]? UserMFSecret, + long? UserMFTimestep) : ICmsUser, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; + public static string TableName => "CMS_User"; + public static string GuidColumnName => "UserGUID"; + + static CmsUserK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), + reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), + reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), + reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), + reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), + reader.Unbox("UserMFTimestep") + ); + + public static CmsUserK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), + reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), + reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), + reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), + reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), + reader.Unbox("UserMFTimestep") + ); +} + +public record CmsUserK12( + int UserID, + string UserName, + string? FirstName, + string? MiddleName, + string? LastName, + string? FullName, + string? Email, + string UserPassword, + string? PreferredCultureCode, + string? PreferredUICultureCode, + bool UserEnabled, + bool? UserIsExternal, + string? UserPasswordFormat, + DateTime? UserCreated, + DateTime? LastLogon, + string? UserStartingAliasPath, + Guid UserGUID, + DateTime UserLastModified, + string? UserLastLogonInfo, + bool? UserIsHidden, + string? UserVisibility, + bool? UserIsDomain, + bool? UserHasAllowedCultures, + bool? UserMFRequired, + int UserPrivilegeLevel, + string? UserSecurityStamp, + byte[]? UserMFSecret, + long? UserMFTimestep) : ICmsUser, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; + public static string TableName => "CMS_User"; + public static string GuidColumnName => "UserGUID"; + + static CmsUserK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), + reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), + reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), + reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), + reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), + reader.Unbox("UserMFTimestep") + ); + + public static CmsUserK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), + reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), + reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), + reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserVisibility"), reader.Unbox("UserIsDomain"), + reader.Unbox("UserHasAllowedCultures"), reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), + reader.Unbox("UserMFTimestep") + ); +} + +public record CmsUserK13( + int UserID, + string UserName, + string? FirstName, + string? MiddleName, + string? LastName, + string? FullName, + string? Email, + string UserPassword, + string? PreferredCultureCode, + string? PreferredUICultureCode, + bool UserEnabled, + bool? UserIsExternal, + string? UserPasswordFormat, + DateTime? UserCreated, + DateTime? LastLogon, + string? UserStartingAliasPath, + Guid UserGUID, + DateTime UserLastModified, + string? UserLastLogonInfo, + bool? UserIsHidden, + bool? UserIsDomain, + bool? UserHasAllowedCultures, + bool? UserMFRequired, + int UserPrivilegeLevel, + string? UserSecurityStamp, + byte[]? UserMFSecret, + long? UserMFTimestep) : ICmsUser, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserID"; + public static string TableName => "CMS_User"; + public static string GuidColumnName => "UserGUID"; + + static CmsUserK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), + reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), + reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), + reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), + reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") + ); + + public static CmsUserK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserID"), reader.Unbox("UserName"), reader.Unbox("FirstName"), reader.Unbox("MiddleName"), reader.Unbox("LastName"), reader.Unbox("FullName"), reader.Unbox("Email"), + reader.Unbox("UserPassword"), reader.Unbox("PreferredCultureCode"), reader.Unbox("PreferredUICultureCode"), reader.Unbox("UserEnabled"), reader.Unbox("UserIsExternal"), + reader.Unbox("UserPasswordFormat"), reader.Unbox("UserCreated"), reader.Unbox("LastLogon"), reader.Unbox("UserStartingAliasPath"), reader.Unbox("UserGUID"), + reader.Unbox("UserLastModified"), reader.Unbox("UserLastLogonInfo"), reader.Unbox("UserIsHidden"), reader.Unbox("UserIsDomain"), reader.Unbox("UserHasAllowedCultures"), + reader.Unbox("UserMFRequired"), reader.Unbox("UserPrivilegeLevel"), reader.Unbox("UserSecurityStamp"), reader.Unbox("UserMFSecret"), reader.Unbox("UserMFTimestep") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs b/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs index 5d3f60a7..60e08c5b 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsUserSetting.cs @@ -1,131 +1,288 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsUserSetting : ISourceModel -{ - int UserSettingsID { get; } - string? UserNickName { get; } - string? UserSignature { get; } - string? UserURLReferrer { get; } - string? UserCampaign { get; } - string? UserCustomData { get; } - string? UserRegistrationInfo { get; } - DateTime? UserActivationDate { get; } - int? UserActivatedByUserID { get; } - int? UserTimeZoneID { get; } - int? UserAvatarID { get; } - int? UserGender { get; } - DateTime? UserDateOfBirth { get; } - Guid UserSettingsUserGUID { get; } - int UserSettingsUserID { get; } - bool? UserWaitingForApproval { get; } - string? UserDialogsConfiguration { get; } - string? UserDescription { get; } - Guid? UserAuthenticationGUID { get; } - string? UserSkype { get; } - string? UserIM { get; } - string? UserPhone { get; } - string? UserPosition { get; } - bool? UserLogActivities { get; } - string? UserPasswordRequestHash { get; } - int? UserInvalidLogOnAttempts { get; } - string? UserInvalidLogOnAttemptsHash { get; } - int? UserAccountLockReason { get; } - DateTime? UserPasswordLastChanged { get; } - bool? UserShowIntroductionTile { get; } - string? UserDashboardApplications { get; } - string? UserDismissedSmartTips { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsUserSettingK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsUserSettingK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsUserSettingK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsUserSettingK11.IsAvailable(version), - { Major: 12 } => CmsUserSettingK12.IsAvailable(version), - { Major: 13 } => CmsUserSettingK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_UserSettings"; - static string ISourceModel.GuidColumnName => "UserSettingsUserGUID"; //assumtion, class Guid column doesn't change between versions - static ICmsUserSetting ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsUserSettingK11.FromReader(reader, version), - { Major: 12 } => CmsUserSettingK12.FromReader(reader, version), - { Major: 13 } => CmsUserSettingK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsUserSettingK11(int UserSettingsID, string? UserNickName, string? UserPicture, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserMessagingNotificationEmail, string? UserCustomData, string? UserRegistrationInfo, string? UserPreferences, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserBadgeID, int? UserActivityPoints, int? UserForumPosts, int? UserBlogComments, int? UserGender, DateTime? UserDateOfBirth, int? UserMessageBoardPosts, Guid UserSettingsUserGUID, int UserSettingsUserID, string? WindowsLiveID, int? UserBlogPosts, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, string? UserUsedWebParts, string? UserUsedWidgets, string? UserFacebookID, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, string? UserLinkedInID, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, string? UserAvatarType, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips) : ICmsUserSetting, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; - public static string TableName => "CMS_UserSettings"; - public static string GuidColumnName => "UserSettingsUserGUID"; - static CmsUserSettingK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserSettingK11( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserMessagingNotificationEmail"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") - ); - } - public static CmsUserSettingK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserSettingK11( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserMessagingNotificationEmail"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") - ); - } -}; -public partial record CmsUserSettingK12(int UserSettingsID, string? UserNickName, string? UserPicture, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserCustomData, string? UserRegistrationInfo, string? UserPreferences, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserBadgeID, int? UserActivityPoints, int? UserForumPosts, int? UserBlogComments, int? UserGender, DateTime? UserDateOfBirth, int? UserMessageBoardPosts, Guid UserSettingsUserGUID, int UserSettingsUserID, string? WindowsLiveID, int? UserBlogPosts, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, string? UserUsedWebParts, string? UserUsedWidgets, string? UserFacebookID, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, string? UserLinkedInID, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, string? UserAvatarType, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips) : ICmsUserSetting, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; - public static string TableName => "CMS_UserSettings"; - public static string GuidColumnName => "UserSettingsUserGUID"; - static CmsUserSettingK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserSettingK12( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") - ); - } - public static CmsUserSettingK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserSettingK12( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") - ); - } -}; -public partial record CmsUserSettingK13(int UserSettingsID, string? UserNickName, string? UserSignature, string? UserURLReferrer, string? UserCampaign, string? UserCustomData, string? UserRegistrationInfo, DateTime? UserActivationDate, int? UserActivatedByUserID, int? UserTimeZoneID, int? UserAvatarID, int? UserGender, DateTime? UserDateOfBirth, Guid UserSettingsUserGUID, int UserSettingsUserID, bool? UserWaitingForApproval, string? UserDialogsConfiguration, string? UserDescription, Guid? UserAuthenticationGUID, string? UserSkype, string? UserIM, string? UserPhone, string? UserPosition, bool? UserLogActivities, string? UserPasswordRequestHash, int? UserInvalidLogOnAttempts, string? UserInvalidLogOnAttemptsHash, int? UserAccountLockReason, DateTime? UserPasswordLastChanged, bool? UserShowIntroductionTile, string? UserDashboardApplications, string? UserDismissedSmartTips, string? SuperSettingsCustomizedKey) : ICmsUserSetting, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; - public static string TableName => "CMS_UserSettings"; - public static string GuidColumnName => "UserSettingsUserGUID"; - static CmsUserSettingK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserSettingK13( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("SuperSettingsCustomizedKey") - ); - } - public static CmsUserSettingK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsUserSettingK13( - reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("SuperSettingsCustomizedKey") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsUserSetting : ISourceModel +{ + int UserSettingsID { get; } + string? UserNickName { get; } + string? UserSignature { get; } + string? UserURLReferrer { get; } + string? UserCampaign { get; } + string? UserCustomData { get; } + string? UserRegistrationInfo { get; } + DateTime? UserActivationDate { get; } + int? UserActivatedByUserID { get; } + int? UserTimeZoneID { get; } + int? UserAvatarID { get; } + int? UserGender { get; } + DateTime? UserDateOfBirth { get; } + Guid UserSettingsUserGUID { get; } + int UserSettingsUserID { get; } + bool? UserWaitingForApproval { get; } + string? UserDialogsConfiguration { get; } + string? UserDescription { get; } + Guid? UserAuthenticationGUID { get; } + string? UserSkype { get; } + string? UserIM { get; } + string? UserPhone { get; } + string? UserPosition { get; } + bool? UserLogActivities { get; } + string? UserPasswordRequestHash { get; } + int? UserInvalidLogOnAttempts { get; } + string? UserInvalidLogOnAttemptsHash { get; } + int? UserAccountLockReason { get; } + DateTime? UserPasswordLastChanged { get; } + bool? UserShowIntroductionTile { get; } + string? UserDashboardApplications { get; } + string? UserDismissedSmartTips { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserSettingK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsUserSettingK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsUserSettingK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserSettingK11.IsAvailable(version), + { Major: 12 } => CmsUserSettingK12.IsAvailable(version), + { Major: 13 } => CmsUserSettingK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_UserSettings"; + static string ISourceModel.GuidColumnName => "UserSettingsUserGUID"; //assumtion, class Guid column doesn't change between versions + + static ICmsUserSetting ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsUserSettingK11.FromReader(reader, version), + { Major: 12 } => CmsUserSettingK12.FromReader(reader, version), + { Major: 13 } => CmsUserSettingK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsUserSettingK11( + int UserSettingsID, + string? UserNickName, + string? UserPicture, + string? UserSignature, + string? UserURLReferrer, + string? UserCampaign, + string? UserMessagingNotificationEmail, + string? UserCustomData, + string? UserRegistrationInfo, + string? UserPreferences, + DateTime? UserActivationDate, + int? UserActivatedByUserID, + int? UserTimeZoneID, + int? UserAvatarID, + int? UserBadgeID, + int? UserActivityPoints, + int? UserForumPosts, + int? UserBlogComments, + int? UserGender, + DateTime? UserDateOfBirth, + int? UserMessageBoardPosts, + Guid UserSettingsUserGUID, + int UserSettingsUserID, + string? WindowsLiveID, + int? UserBlogPosts, + bool? UserWaitingForApproval, + string? UserDialogsConfiguration, + string? UserDescription, + string? UserUsedWebParts, + string? UserUsedWidgets, + string? UserFacebookID, + Guid? UserAuthenticationGUID, + string? UserSkype, + string? UserIM, + string? UserPhone, + string? UserPosition, + string? UserLinkedInID, + bool? UserLogActivities, + string? UserPasswordRequestHash, + int? UserInvalidLogOnAttempts, + string? UserInvalidLogOnAttemptsHash, + string? UserAvatarType, + int? UserAccountLockReason, + DateTime? UserPasswordLastChanged, + bool? UserShowIntroductionTile, + string? UserDashboardApplications, + string? UserDismissedSmartTips) : ICmsUserSetting, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; + public static string TableName => "CMS_UserSettings"; + public static string GuidColumnName => "UserSettingsUserGUID"; + + static CmsUserSettingK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), + reader.Unbox("UserMessagingNotificationEmail"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), + reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), + reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), + reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), + reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), + reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), + reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), + reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") + ); + + public static CmsUserSettingK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), + reader.Unbox("UserMessagingNotificationEmail"), reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), + reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), + reader.Unbox("UserBlogComments"), reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), + reader.Unbox("UserSettingsUserID"), reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), + reader.Unbox("UserDescription"), reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), + reader.Unbox("UserSkype"), reader.Unbox("UserIM"), reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), + reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), + reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") + ); +} + +public record CmsUserSettingK12( + int UserSettingsID, + string? UserNickName, + string? UserPicture, + string? UserSignature, + string? UserURLReferrer, + string? UserCampaign, + string? UserCustomData, + string? UserRegistrationInfo, + string? UserPreferences, + DateTime? UserActivationDate, + int? UserActivatedByUserID, + int? UserTimeZoneID, + int? UserAvatarID, + int? UserBadgeID, + int? UserActivityPoints, + int? UserForumPosts, + int? UserBlogComments, + int? UserGender, + DateTime? UserDateOfBirth, + int? UserMessageBoardPosts, + Guid UserSettingsUserGUID, + int UserSettingsUserID, + string? WindowsLiveID, + int? UserBlogPosts, + bool? UserWaitingForApproval, + string? UserDialogsConfiguration, + string? UserDescription, + string? UserUsedWebParts, + string? UserUsedWidgets, + string? UserFacebookID, + Guid? UserAuthenticationGUID, + string? UserSkype, + string? UserIM, + string? UserPhone, + string? UserPosition, + string? UserLinkedInID, + bool? UserLogActivities, + string? UserPasswordRequestHash, + int? UserInvalidLogOnAttempts, + string? UserInvalidLogOnAttemptsHash, + string? UserAvatarType, + int? UserAccountLockReason, + DateTime? UserPasswordLastChanged, + bool? UserShowIntroductionTile, + string? UserDashboardApplications, + string? UserDismissedSmartTips) : ICmsUserSetting, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; + public static string TableName => "CMS_UserSettings"; + public static string GuidColumnName => "UserSettingsUserGUID"; + + static CmsUserSettingK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), + reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), + reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), + reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), + reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), + reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), + reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), + reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), + reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") + ); + + public static CmsUserSettingK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserPicture"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), + reader.Unbox("UserCustomData"), reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserPreferences"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), + reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), reader.Unbox("UserBadgeID"), reader.Unbox("UserActivityPoints"), reader.Unbox("UserForumPosts"), reader.Unbox("UserBlogComments"), + reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserMessageBoardPosts"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), + reader.Unbox("WindowsLiveID"), reader.Unbox("UserBlogPosts"), reader.Unbox("UserWaitingForApproval"), reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), + reader.Unbox("UserUsedWebParts"), reader.Unbox("UserUsedWidgets"), reader.Unbox("UserFacebookID"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), + reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLinkedInID"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), + reader.Unbox("UserInvalidLogOnAttempts"), reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAvatarType"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), + reader.Unbox("UserShowIntroductionTile"), reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips") + ); +} + +public record CmsUserSettingK13( + int UserSettingsID, + string? UserNickName, + string? UserSignature, + string? UserURLReferrer, + string? UserCampaign, + string? UserCustomData, + string? UserRegistrationInfo, + DateTime? UserActivationDate, + int? UserActivatedByUserID, + int? UserTimeZoneID, + int? UserAvatarID, + int? UserGender, + DateTime? UserDateOfBirth, + Guid UserSettingsUserGUID, + int UserSettingsUserID, + bool? UserWaitingForApproval, + string? UserDialogsConfiguration, + string? UserDescription, + Guid? UserAuthenticationGUID, + string? UserSkype, + string? UserIM, + string? UserPhone, + string? UserPosition, + bool? UserLogActivities, + string? UserPasswordRequestHash, + int? UserInvalidLogOnAttempts, + string? UserInvalidLogOnAttemptsHash, + int? UserAccountLockReason, + DateTime? UserPasswordLastChanged, + bool? UserShowIntroductionTile, + string? UserDashboardApplications, + string? UserDismissedSmartTips, + string? SuperSettingsCustomizedKey) : ICmsUserSetting, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "UserSettingsID"; + public static string TableName => "CMS_UserSettings"; + public static string GuidColumnName => "UserSettingsUserGUID"; + + static CmsUserSettingK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), + reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), + reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("UserWaitingForApproval"), + reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), + reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), + reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), + reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("SuperSettingsCustomizedKey") + ); + + public static CmsUserSettingK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("UserSettingsID"), reader.Unbox("UserNickName"), reader.Unbox("UserSignature"), reader.Unbox("UserURLReferrer"), reader.Unbox("UserCampaign"), reader.Unbox("UserCustomData"), + reader.Unbox("UserRegistrationInfo"), reader.Unbox("UserActivationDate"), reader.Unbox("UserActivatedByUserID"), reader.Unbox("UserTimeZoneID"), reader.Unbox("UserAvatarID"), + reader.Unbox("UserGender"), reader.Unbox("UserDateOfBirth"), reader.Unbox("UserSettingsUserGUID"), reader.Unbox("UserSettingsUserID"), reader.Unbox("UserWaitingForApproval"), + reader.Unbox("UserDialogsConfiguration"), reader.Unbox("UserDescription"), reader.Unbox("UserAuthenticationGUID"), reader.Unbox("UserSkype"), reader.Unbox("UserIM"), + reader.Unbox("UserPhone"), reader.Unbox("UserPosition"), reader.Unbox("UserLogActivities"), reader.Unbox("UserPasswordRequestHash"), reader.Unbox("UserInvalidLogOnAttempts"), + reader.Unbox("UserInvalidLogOnAttemptsHash"), reader.Unbox("UserAccountLockReason"), reader.Unbox("UserPasswordLastChanged"), reader.Unbox("UserShowIntroductionTile"), + reader.Unbox("UserDashboardApplications"), reader.Unbox("UserDismissedSmartTips"), reader.Unbox("SuperSettingsCustomizedKey") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs b/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs index df1a24aa..276f381f 100644 --- a/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs +++ b/KVA/Migration.Toolkit.Source/Model/CmsVersionHistory.cs @@ -1,119 +1,194 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface ICmsVersionHistory : ISourceModel -{ - int VersionHistoryID { get; } - int NodeSiteID { get; } - int? DocumentID { get; } - string NodeXML { get; } - int? ModifiedByUserID { get; } - DateTime ModifiedWhen { get; } - string? VersionNumber { get; } - string? VersionComment { get; } - bool ToBePublished { get; } - DateTime? PublishFrom { get; } - DateTime? PublishTo { get; } - DateTime? WasPublishedFrom { get; } - DateTime? WasPublishedTo { get; } - string? VersionDocumentName { get; } - int? VersionClassID { get; } - int? VersionWorkflowID { get; } - int? VersionWorkflowStepID { get; } - string? VersionNodeAliasPath { get; } - int? VersionDeletedByUserID { get; } - DateTime? VersionDeletedWhen { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsVersionHistoryK11.GetPrimaryKeyName(version), - { Major: 12 } => CmsVersionHistoryK12.GetPrimaryKeyName(version), - { Major: 13 } => CmsVersionHistoryK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsVersionHistoryK11.IsAvailable(version), - { Major: 12 } => CmsVersionHistoryK12.IsAvailable(version), - { Major: 13 } => CmsVersionHistoryK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "CMS_VersionHistory"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static ICmsVersionHistory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => CmsVersionHistoryK11.FromReader(reader, version), - { Major: 12 } => CmsVersionHistoryK12.FromReader(reader, version), - { Major: 13 } => CmsVersionHistoryK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record CmsVersionHistoryK11(int VersionHistoryID, int NodeSiteID, int? DocumentID, string DocumentNamePath, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, string? VersionDocumentType, int? VersionClassID, string? VersionMenuRedirectUrl, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; - public static string TableName => "CMS_VersionHistory"; - public static string GuidColumnName => ""; - static CmsVersionHistoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsVersionHistoryK11( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - } - public static CmsVersionHistoryK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsVersionHistoryK11( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - } -}; -public partial record CmsVersionHistoryK12(int VersionHistoryID, int NodeSiteID, int? DocumentID, string DocumentNamePath, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, string? VersionDocumentType, int? VersionClassID, string? VersionMenuRedirectUrl, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; - public static string TableName => "CMS_VersionHistory"; - public static string GuidColumnName => ""; - static CmsVersionHistoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsVersionHistoryK12( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - } - public static CmsVersionHistoryK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsVersionHistoryK12( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - } -}; -public partial record CmsVersionHistoryK13(int VersionHistoryID, int NodeSiteID, int? DocumentID, string NodeXML, int? ModifiedByUserID, DateTime ModifiedWhen, string? VersionNumber, string? VersionComment, bool ToBePublished, DateTime? PublishFrom, DateTime? PublishTo, DateTime? WasPublishedFrom, DateTime? WasPublishedTo, string? VersionDocumentName, int? VersionClassID, int? VersionWorkflowID, int? VersionWorkflowStepID, string? VersionNodeAliasPath, int? VersionDeletedByUserID, DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; - public static string TableName => "CMS_VersionHistory"; - public static string GuidColumnName => ""; - static CmsVersionHistoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsVersionHistoryK13( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionClassID"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - } - public static CmsVersionHistoryK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new CmsVersionHistoryK13( - reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionClassID"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface ICmsVersionHistory : ISourceModel +{ + int VersionHistoryID { get; } + int NodeSiteID { get; } + int? DocumentID { get; } + string NodeXML { get; } + int? ModifiedByUserID { get; } + DateTime ModifiedWhen { get; } + string? VersionNumber { get; } + string? VersionComment { get; } + bool ToBePublished { get; } + DateTime? PublishFrom { get; } + DateTime? PublishTo { get; } + DateTime? WasPublishedFrom { get; } + DateTime? WasPublishedTo { get; } + string? VersionDocumentName { get; } + int? VersionClassID { get; } + int? VersionWorkflowID { get; } + int? VersionWorkflowStepID { get; } + string? VersionNodeAliasPath { get; } + int? VersionDeletedByUserID { get; } + DateTime? VersionDeletedWhen { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => CmsVersionHistoryK11.GetPrimaryKeyName(version), + { Major: 12 } => CmsVersionHistoryK12.GetPrimaryKeyName(version), + { Major: 13 } => CmsVersionHistoryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => CmsVersionHistoryK11.IsAvailable(version), + { Major: 12 } => CmsVersionHistoryK12.IsAvailable(version), + { Major: 13 } => CmsVersionHistoryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "CMS_VersionHistory"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static ICmsVersionHistory ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => CmsVersionHistoryK11.FromReader(reader, version), + { Major: 12 } => CmsVersionHistoryK12.FromReader(reader, version), + { Major: 13 } => CmsVersionHistoryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record CmsVersionHistoryK11( + int VersionHistoryID, + int NodeSiteID, + int? DocumentID, + string DocumentNamePath, + string NodeXML, + int? ModifiedByUserID, + DateTime ModifiedWhen, + string? VersionNumber, + string? VersionComment, + bool ToBePublished, + DateTime? PublishFrom, + DateTime? PublishTo, + DateTime? WasPublishedFrom, + DateTime? WasPublishedTo, + string? VersionDocumentName, + string? VersionDocumentType, + int? VersionClassID, + string? VersionMenuRedirectUrl, + int? VersionWorkflowID, + int? VersionWorkflowStepID, + string? VersionNodeAliasPath, + int? VersionDeletedByUserID, + DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; + public static string TableName => "CMS_VersionHistory"; + public static string GuidColumnName => ""; + + static CmsVersionHistoryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), + reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), + reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), + reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), + reader.Unbox("VersionDeletedWhen") + ); + + public static CmsVersionHistoryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), + reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), + reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), + reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), + reader.Unbox("VersionDeletedWhen") + ); +} + +public record CmsVersionHistoryK12( + int VersionHistoryID, + int NodeSiteID, + int? DocumentID, + string DocumentNamePath, + string NodeXML, + int? ModifiedByUserID, + DateTime ModifiedWhen, + string? VersionNumber, + string? VersionComment, + bool ToBePublished, + DateTime? PublishFrom, + DateTime? PublishTo, + DateTime? WasPublishedFrom, + DateTime? WasPublishedTo, + string? VersionDocumentName, + string? VersionDocumentType, + int? VersionClassID, + string? VersionMenuRedirectUrl, + int? VersionWorkflowID, + int? VersionWorkflowStepID, + string? VersionNodeAliasPath, + int? VersionDeletedByUserID, + DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; + public static string TableName => "CMS_VersionHistory"; + public static string GuidColumnName => ""; + + static CmsVersionHistoryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), + reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), + reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), + reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), + reader.Unbox("VersionDeletedWhen") + ); + + public static CmsVersionHistoryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("DocumentNamePath"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), + reader.Unbox("ModifiedWhen"), reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), + reader.Unbox("WasPublishedFrom"), reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionDocumentType"), reader.Unbox("VersionClassID"), + reader.Unbox("VersionMenuRedirectUrl"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), + reader.Unbox("VersionDeletedWhen") + ); +} + +public record CmsVersionHistoryK13( + int VersionHistoryID, + int NodeSiteID, + int? DocumentID, + string NodeXML, + int? ModifiedByUserID, + DateTime ModifiedWhen, + string? VersionNumber, + string? VersionComment, + bool ToBePublished, + DateTime? PublishFrom, + DateTime? PublishTo, + DateTime? WasPublishedFrom, + DateTime? WasPublishedTo, + string? VersionDocumentName, + int? VersionClassID, + int? VersionWorkflowID, + int? VersionWorkflowStepID, + string? VersionNodeAliasPath, + int? VersionDeletedByUserID, + DateTime? VersionDeletedWhen) : ICmsVersionHistory, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "VersionHistoryID"; + public static string TableName => "CMS_VersionHistory"; + public static string GuidColumnName => ""; + + static CmsVersionHistoryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), + reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), + reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionClassID"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), + reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") + ); + + public static CmsVersionHistoryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("VersionHistoryID"), reader.Unbox("NodeSiteID"), reader.Unbox("DocumentID"), reader.Unbox("NodeXML"), reader.Unbox("ModifiedByUserID"), reader.Unbox("ModifiedWhen"), + reader.Unbox("VersionNumber"), reader.Unbox("VersionComment"), reader.Unbox("ToBePublished"), reader.Unbox("PublishFrom"), reader.Unbox("PublishTo"), reader.Unbox("WasPublishedFrom"), + reader.Unbox("WasPublishedTo"), reader.Unbox("VersionDocumentName"), reader.Unbox("VersionClassID"), reader.Unbox("VersionWorkflowID"), reader.Unbox("VersionWorkflowStepID"), + reader.Unbox("VersionNodeAliasPath"), reader.Unbox("VersionDeletedByUserID"), reader.Unbox("VersionDeletedWhen") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/MediaFile.cs b/KVA/Migration.Toolkit.Source/Model/MediaFile.cs new file mode 100644 index 00000000..4073e999 --- /dev/null +++ b/KVA/Migration.Toolkit.Source/Model/MediaFile.cs @@ -0,0 +1,176 @@ +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface IMediaFile : ISourceModel +{ + int FileID { get; } + string FileName { get; } + string FileTitle { get; } + string FileDescription { get; } + string FileExtension { get; } + string FileMimeType { get; } + string FilePath { get; } + long FileSize { get; } + int? FileImageWidth { get; } + int? FileImageHeight { get; } + Guid FileGUID { get; } + int FileLibraryID { get; } + int FileSiteID { get; } + int? FileCreatedByUserID { get; } + DateTime FileCreatedWhen { get; } + int? FileModifiedByUserID { get; } + DateTime FileModifiedWhen { get; } + string? FileCustomData { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => MediaFileK11.GetPrimaryKeyName(version), + { Major: 12 } => MediaFileK12.GetPrimaryKeyName(version), + { Major: 13 } => MediaFileK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => MediaFileK11.IsAvailable(version), + { Major: 12 } => MediaFileK12.IsAvailable(version), + { Major: 13 } => MediaFileK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "Media_File"; + static string ISourceModel.GuidColumnName => "FileGUID"; //assumtion, class Guid column doesn't change between versions + + static IMediaFile ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => MediaFileK11.FromReader(reader, version), + { Major: 12 } => MediaFileK12.FromReader(reader, version), + { Major: 13 } => MediaFileK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record MediaFileK11( + int FileID, + string FileName, + string FileTitle, + string FileDescription, + string FileExtension, + string FileMimeType, + string FilePath, + long FileSize, + int? FileImageWidth, + int? FileImageHeight, + Guid FileGUID, + int FileLibraryID, + int FileSiteID, + int? FileCreatedByUserID, + DateTime FileCreatedWhen, + int? FileModifiedByUserID, + DateTime FileModifiedWhen, + string? FileCustomData) : IMediaFile, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; + public static string TableName => "Media_File"; + public static string GuidColumnName => "FileGUID"; + + static MediaFileK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), + reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), + reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), + reader.Unbox("FileCustomData") + ); + + public static MediaFileK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), + reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), + reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), + reader.Unbox("FileCustomData") + ); +} + +public record MediaFileK12( + int FileID, + string FileName, + string FileTitle, + string FileDescription, + string FileExtension, + string FileMimeType, + string FilePath, + long FileSize, + int? FileImageWidth, + int? FileImageHeight, + Guid FileGUID, + int FileLibraryID, + int FileSiteID, + int? FileCreatedByUserID, + DateTime FileCreatedWhen, + int? FileModifiedByUserID, + DateTime FileModifiedWhen, + string? FileCustomData) : IMediaFile, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; + public static string TableName => "Media_File"; + public static string GuidColumnName => "FileGUID"; + + static MediaFileK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), + reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), + reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), + reader.Unbox("FileCustomData") + ); + + public static MediaFileK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), + reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), + reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), + reader.Unbox("FileCustomData") + ); +} + +public record MediaFileK13( + int FileID, + string FileName, + string FileTitle, + string FileDescription, + string FileExtension, + string FileMimeType, + string FilePath, + long FileSize, + int? FileImageWidth, + int? FileImageHeight, + Guid FileGUID, + int FileLibraryID, + int FileSiteID, + int? FileCreatedByUserID, + DateTime FileCreatedWhen, + int? FileModifiedByUserID, + DateTime FileModifiedWhen, + string? FileCustomData) : IMediaFile, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "FileID"; + public static string TableName => "Media_File"; + public static string GuidColumnName => "FileGUID"; + + static MediaFileK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), + reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), + reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), + reader.Unbox("FileCustomData") + ); + + public static MediaFileK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("FileID"), reader.Unbox("FileName"), reader.Unbox("FileTitle"), reader.Unbox("FileDescription"), reader.Unbox("FileExtension"), reader.Unbox("FileMimeType"), + reader.Unbox("FilePath"), reader.Unbox("FileSize"), reader.Unbox("FileImageWidth"), reader.Unbox("FileImageHeight"), reader.Unbox("FileGUID"), reader.Unbox("FileLibraryID"), + reader.Unbox("FileSiteID"), reader.Unbox("FileCreatedByUserID"), reader.Unbox("FileCreatedWhen"), reader.Unbox("FileModifiedByUserID"), reader.Unbox("FileModifiedWhen"), + reader.Unbox("FileCustomData") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/MediaLibrary.cs b/KVA/Migration.Toolkit.Source/Model/MediaLibrary.cs new file mode 100644 index 00000000..826dddb5 --- /dev/null +++ b/KVA/Migration.Toolkit.Source/Model/MediaLibrary.cs @@ -0,0 +1,141 @@ +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface IMediaLibrary : ISourceModel +{ + int LibraryID { get; } + string LibraryName { get; } + string LibraryDisplayName { get; } + string? LibraryDescription { get; } + string LibraryFolder { get; } + int? LibraryAccess { get; } + int LibrarySiteID { get; } + Guid? LibraryGUID { get; } + DateTime? LibraryLastModified { get; } + string? LibraryTeaserPath { get; } + Guid? LibraryTeaserGUID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => MediaLibraryK11.GetPrimaryKeyName(version), + { Major: 12 } => MediaLibraryK12.GetPrimaryKeyName(version), + { Major: 13 } => MediaLibraryK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => MediaLibraryK11.IsAvailable(version), + { Major: 12 } => MediaLibraryK12.IsAvailable(version), + { Major: 13 } => MediaLibraryK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "Media_Library"; + static string ISourceModel.GuidColumnName => "LibraryGUID"; //assumtion, class Guid column doesn't change between versions + + static IMediaLibrary ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => MediaLibraryK11.FromReader(reader, version), + { Major: 12 } => MediaLibraryK12.FromReader(reader, version), + { Major: 13 } => MediaLibraryK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record MediaLibraryK11( + int LibraryID, + string LibraryName, + string LibraryDisplayName, + string? LibraryDescription, + string LibraryFolder, + int? LibraryAccess, + int? LibraryGroupID, + int LibrarySiteID, + Guid? LibraryGUID, + DateTime? LibraryLastModified, + string? LibraryTeaserPath, + Guid? LibraryTeaserGUID) : IMediaLibrary, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; + public static string TableName => "Media_Library"; + public static string GuidColumnName => "LibraryTeaserGUID"; + + static MediaLibraryK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), + reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") + ); + + public static MediaLibraryK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), + reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") + ); +} + +public record MediaLibraryK12( + int LibraryID, + string LibraryName, + string LibraryDisplayName, + string? LibraryDescription, + string LibraryFolder, + int? LibraryAccess, + int? LibraryGroupID, + int LibrarySiteID, + Guid? LibraryGUID, + DateTime? LibraryLastModified, + string? LibraryTeaserPath, + Guid? LibraryTeaserGUID) : IMediaLibrary, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; + public static string TableName => "Media_Library"; + public static string GuidColumnName => "LibraryTeaserGUID"; + + static MediaLibraryK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), + reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") + ); + + public static MediaLibraryK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), + reader.Unbox("LibraryGroupID"), reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID") + ); +} + +public record MediaLibraryK13( + int LibraryID, + string LibraryName, + string LibraryDisplayName, + string? LibraryDescription, + string LibraryFolder, + int? LibraryAccess, + int LibrarySiteID, + Guid? LibraryGUID, + DateTime? LibraryLastModified, + string? LibraryTeaserPath, + Guid? LibraryTeaserGUID, + bool? LibraryUseDirectPathForContent) : IMediaLibrary, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "LibraryID"; + public static string TableName => "Media_Library"; + public static string GuidColumnName => "LibraryTeaserGUID"; + + static MediaLibraryK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), + reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID"), + reader.Unbox("LibraryUseDirectPathForContent") + ); + + public static MediaLibraryK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("LibraryID"), reader.Unbox("LibraryName"), reader.Unbox("LibraryDisplayName"), reader.Unbox("LibraryDescription"), reader.Unbox("LibraryFolder"), reader.Unbox("LibraryAccess"), + reader.Unbox("LibrarySiteID"), reader.Unbox("LibraryGUID"), reader.Unbox("LibraryLastModified"), reader.Unbox("LibraryTeaserPath"), reader.Unbox("LibraryTeaserGUID"), + reader.Unbox("LibraryUseDirectPathForContent") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/OmActivity.cs b/KVA/Migration.Toolkit.Source/Model/OmActivity.cs index 26c65c32..e7d4b3a6 100644 --- a/KVA/Migration.Toolkit.Source/Model/OmActivity.cs +++ b/KVA/Migration.Toolkit.Source/Model/OmActivity.cs @@ -1,118 +1,182 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface IOmActivity : ISourceModel -{ - int ActivityID { get; } - int ActivityContactID { get; } - DateTime? ActivityCreated { get; } - string ActivityType { get; } - int? ActivityItemID { get; } - int? ActivityItemDetailID { get; } - string? ActivityValue { get; } - string? ActivityURL { get; } - string? ActivityTitle { get; } - int ActivitySiteID { get; } - string? ActivityComment { get; } - string? ActivityCampaign { get; } - string? ActivityURLReferrer { get; } - string? ActivityCulture { get; } - int? ActivityNodeID { get; } - string? ActivityUTMSource { get; } - string? ActivityABVariantName { get; } - long ActivityURLHash { get; } - string? ActivityUTMContent { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmActivityK11.GetPrimaryKeyName(version), - { Major: 12 } => OmActivityK12.GetPrimaryKeyName(version), - { Major: 13 } => OmActivityK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmActivityK11.IsAvailable(version), - { Major: 12 } => OmActivityK12.IsAvailable(version), - { Major: 13 } => OmActivityK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "OM_Activity"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static IOmActivity ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmActivityK11.FromReader(reader, version), - { Major: 12 } => OmActivityK12.FromReader(reader, version), - { Major: 13 } => OmActivityK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record OmActivityK11(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, string? ActivityMVTCombinationName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; - public static string TableName => "OM_Activity"; - public static string GuidColumnName => ""; - static OmActivityK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmActivityK11( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - } - public static OmActivityK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmActivityK11( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - } -}; -public partial record OmActivityK12(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, string? ActivityMVTCombinationName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; - public static string TableName => "OM_Activity"; - public static string GuidColumnName => ""; - static OmActivityK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmActivityK12( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - } - public static OmActivityK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmActivityK12( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - } -}; -public partial record OmActivityK13(int ActivityID, int ActivityContactID, DateTime? ActivityCreated, string ActivityType, int? ActivityItemID, int? ActivityItemDetailID, string? ActivityValue, string? ActivityURL, string? ActivityTitle, int ActivitySiteID, string? ActivityComment, string? ActivityCampaign, string? ActivityURLReferrer, string? ActivityCulture, int? ActivityNodeID, string? ActivityUTMSource, string? ActivityABVariantName, long ActivityURLHash, string? ActivityUTMContent) : IOmActivity, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; - public static string TableName => "OM_Activity"; - public static string GuidColumnName => ""; - static OmActivityK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmActivityK13( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - } - public static OmActivityK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmActivityK13( - reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface IOmActivity : ISourceModel +{ + int ActivityID { get; } + int ActivityContactID { get; } + DateTime? ActivityCreated { get; } + string ActivityType { get; } + int? ActivityItemID { get; } + int? ActivityItemDetailID { get; } + string? ActivityValue { get; } + string? ActivityURL { get; } + string? ActivityTitle { get; } + int ActivitySiteID { get; } + string? ActivityComment { get; } + string? ActivityCampaign { get; } + string? ActivityURLReferrer { get; } + string? ActivityCulture { get; } + int? ActivityNodeID { get; } + string? ActivityUTMSource { get; } + string? ActivityABVariantName { get; } + long ActivityURLHash { get; } + string? ActivityUTMContent { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => OmActivityK11.GetPrimaryKeyName(version), + { Major: 12 } => OmActivityK12.GetPrimaryKeyName(version), + { Major: 13 } => OmActivityK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => OmActivityK11.IsAvailable(version), + { Major: 12 } => OmActivityK12.IsAvailable(version), + { Major: 13 } => OmActivityK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "OM_Activity"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static IOmActivity ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => OmActivityK11.FromReader(reader, version), + { Major: 12 } => OmActivityK12.FromReader(reader, version), + { Major: 13 } => OmActivityK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record OmActivityK11( + int ActivityID, + int ActivityContactID, + DateTime? ActivityCreated, + string ActivityType, + int? ActivityItemID, + int? ActivityItemDetailID, + string? ActivityValue, + string? ActivityURL, + string? ActivityTitle, + int ActivitySiteID, + string? ActivityComment, + string? ActivityCampaign, + string? ActivityURLReferrer, + string? ActivityCulture, + int? ActivityNodeID, + string? ActivityUTMSource, + string? ActivityABVariantName, + string? ActivityMVTCombinationName, + long ActivityURLHash, + string? ActivityUTMContent) : IOmActivity, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; + public static string TableName => "OM_Activity"; + public static string GuidColumnName => ""; + + static OmActivityK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), + reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), + reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), + reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); + + public static OmActivityK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), + reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), + reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), + reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); +} + +public record OmActivityK12( + int ActivityID, + int ActivityContactID, + DateTime? ActivityCreated, + string ActivityType, + int? ActivityItemID, + int? ActivityItemDetailID, + string? ActivityValue, + string? ActivityURL, + string? ActivityTitle, + int ActivitySiteID, + string? ActivityComment, + string? ActivityCampaign, + string? ActivityURLReferrer, + string? ActivityCulture, + int? ActivityNodeID, + string? ActivityUTMSource, + string? ActivityABVariantName, + string? ActivityMVTCombinationName, + long ActivityURLHash, + string? ActivityUTMContent) : IOmActivity, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; + public static string TableName => "OM_Activity"; + public static string GuidColumnName => ""; + + static OmActivityK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), + reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), + reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), + reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); + + public static OmActivityK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), + reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), + reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), + reader.Unbox("ActivityMVTCombinationName"), reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); +} + +public record OmActivityK13( + int ActivityID, + int ActivityContactID, + DateTime? ActivityCreated, + string ActivityType, + int? ActivityItemID, + int? ActivityItemDetailID, + string? ActivityValue, + string? ActivityURL, + string? ActivityTitle, + int ActivitySiteID, + string? ActivityComment, + string? ActivityCampaign, + string? ActivityURLReferrer, + string? ActivityCulture, + int? ActivityNodeID, + string? ActivityUTMSource, + string? ActivityABVariantName, + long ActivityURLHash, + string? ActivityUTMContent) : IOmActivity, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ActivityID"; + public static string TableName => "OM_Activity"; + public static string GuidColumnName => ""; + + static OmActivityK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), + reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), + reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), + reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); + + public static OmActivityK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ActivityID"), reader.Unbox("ActivityContactID"), reader.Unbox("ActivityCreated"), reader.Unbox("ActivityType"), reader.Unbox("ActivityItemID"), reader.Unbox("ActivityItemDetailID"), + reader.Unbox("ActivityValue"), reader.Unbox("ActivityURL"), reader.Unbox("ActivityTitle"), reader.Unbox("ActivitySiteID"), reader.Unbox("ActivityComment"), reader.Unbox("ActivityCampaign"), + reader.Unbox("ActivityURLReferrer"), reader.Unbox("ActivityCulture"), reader.Unbox("ActivityNodeID"), reader.Unbox("ActivityUTMSource"), reader.Unbox("ActivityABVariantName"), + reader.Unbox("ActivityURLHash"), reader.Unbox("ActivityUTMContent") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/OmContact.cs b/KVA/Migration.Toolkit.Source/Model/OmContact.cs index f1dbb7bb..675a3c9d 100644 --- a/KVA/Migration.Toolkit.Source/Model/OmContact.cs +++ b/KVA/Migration.Toolkit.Source/Model/OmContact.cs @@ -1,130 +1,295 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface IOmContact : ISourceModel -{ - int ContactID { get; } - string? ContactFirstName { get; } - string? ContactMiddleName { get; } - string? ContactLastName { get; } - string? ContactJobTitle { get; } - string? ContactAddress1 { get; } - string? ContactCity { get; } - string? ContactZIP { get; } - int? ContactStateID { get; } - int? ContactCountryID { get; } - string? ContactMobilePhone { get; } - string? ContactBusinessPhone { get; } - string? ContactEmail { get; } - DateTime? ContactBirthday { get; } - int? ContactGender { get; } - int? ContactStatusID { get; } - string? ContactNotes { get; } - int? ContactOwnerUserID { get; } - bool? ContactMonitored { get; } - Guid ContactGUID { get; } - DateTime ContactLastModified { get; } - DateTime ContactCreated { get; } - int? ContactBounces { get; } - string? ContactCampaign { get; } - string? ContactSalesForceLeadID { get; } - bool? ContactSalesForceLeadReplicationDisabled { get; } - DateTime? ContactSalesForceLeadReplicationDateTime { get; } - DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; } - string? ContactCompanyName { get; } - bool? ContactSalesForceLeadReplicationRequired { get; } - int? ContactPersonaID { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmContactK11.GetPrimaryKeyName(version), - { Major: 12 } => OmContactK12.GetPrimaryKeyName(version), - { Major: 13 } => OmContactK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmContactK11.IsAvailable(version), - { Major: 12 } => OmContactK12.IsAvailable(version), - { Major: 13 } => OmContactK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "OM_Contact"; - static string ISourceModel.GuidColumnName => "ContactGUID"; //assumtion, class Guid column doesn't change between versions - static IOmContact ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmContactK11.FromReader(reader, version), - { Major: 12 } => OmContactK12.FromReader(reader, version), - { Major: 13 } => OmContactK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record OmContactK11(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID) : IOmContact, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; - public static string TableName => "OM_Contact"; - public static string GuidColumnName => "ContactGUID"; - static OmContactK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactK11( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") - ); - } - public static OmContactK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactK11( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") - ); - } -}; -public partial record OmContactK12(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID, string? FirstUserAgent, string? FirstIPAddress, string? FirstRequestUrl, string? KenticoUrlReferrer, string? KenticoContactRegionName, string? KenticoContactRegionCode, string? KenticoContactPostalCode, string? KenticoContactCampaignSource, string? KenticoContactCampaignContent, bool? NeedRecalculation, int? ProfileScore, int? EngagementScore, int? TotalScore, int? Zone, Guid? DynamicsLeadGuid, Guid? DynamicsContactGuid, string? DynamicsAccountType, string? DynamicsAccountStatus, bool? LegitimateInterest, string? DynamicsActivePartnerships, DateTime? DynamicsDateOfSync, bool? PairedWithDynamicsCrm, DateTime? FirstPairDate, int? PairedBy, bool? IsArchived, DateTime? ArchivationDate, bool? HasFreeEmail, int? SameDomainContacts, string? AreYouLookingForCMS, string? Role, string? KenticoContactBusinessType, string? MarketingAutomationVariant, string? KontentIntercomUserID, string? KontentGoogleAnalyticsUserID, string? KontentAmplitudeUserID) : IOmContact, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; - public static string TableName => "OM_Contact"; - public static string GuidColumnName => "ContactGUID"; - static OmContactK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactK12( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID"), reader.Unbox("FirstUserAgent"), reader.Unbox("FirstIPAddress"), reader.Unbox("FirstRequestUrl"), reader.Unbox("KenticoUrlReferrer"), reader.Unbox("KenticoContactRegionName"), reader.Unbox("KenticoContactRegionCode"), reader.Unbox("KenticoContactPostalCode"), reader.Unbox("KenticoContactCampaignSource"), reader.Unbox("KenticoContactCampaignContent"), reader.Unbox("NeedRecalculation"), reader.Unbox("ProfileScore"), reader.Unbox("EngagementScore"), reader.Unbox("TotalScore"), reader.Unbox("Zone"), reader.Unbox("DynamicsLeadGuid"), reader.Unbox("DynamicsContactGuid"), reader.Unbox("DynamicsAccountType"), reader.Unbox("DynamicsAccountStatus"), reader.Unbox("LegitimateInterest"), reader.Unbox("DynamicsActivePartnerships"), reader.Unbox("DynamicsDateOfSync"), reader.Unbox("PairedWithDynamicsCrm"), reader.Unbox("FirstPairDate"), reader.Unbox("PairedBy"), reader.Unbox("IsArchived"), reader.Unbox("ArchivationDate"), reader.Unbox("HasFreeEmail"), reader.Unbox("SameDomainContacts"), reader.Unbox("AreYouLookingForCMS"), reader.Unbox("Role"), reader.Unbox("KenticoContactBusinessType"), reader.Unbox("MarketingAutomationVariant"), reader.Unbox("KontentIntercomUserID"), reader.Unbox("KontentGoogleAnalyticsUserID"), reader.Unbox("KontentAmplitudeUserID") - ); - } - public static OmContactK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactK12( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID"), reader.Unbox("FirstUserAgent"), reader.Unbox("FirstIPAddress"), reader.Unbox("FirstRequestUrl"), reader.Unbox("KenticoUrlReferrer"), reader.Unbox("KenticoContactRegionName"), reader.Unbox("KenticoContactRegionCode"), reader.Unbox("KenticoContactPostalCode"), reader.Unbox("KenticoContactCampaignSource"), reader.Unbox("KenticoContactCampaignContent"), reader.Unbox("NeedRecalculation"), reader.Unbox("ProfileScore"), reader.Unbox("EngagementScore"), reader.Unbox("TotalScore"), reader.Unbox("Zone"), reader.Unbox("DynamicsLeadGuid"), reader.Unbox("DynamicsContactGuid"), reader.Unbox("DynamicsAccountType"), reader.Unbox("DynamicsAccountStatus"), reader.Unbox("LegitimateInterest"), reader.Unbox("DynamicsActivePartnerships"), reader.Unbox("DynamicsDateOfSync"), reader.Unbox("PairedWithDynamicsCrm"), reader.Unbox("FirstPairDate"), reader.Unbox("PairedBy"), reader.Unbox("IsArchived"), reader.Unbox("ArchivationDate"), reader.Unbox("HasFreeEmail"), reader.Unbox("SameDomainContacts"), reader.Unbox("AreYouLookingForCMS"), reader.Unbox("Role"), reader.Unbox("KenticoContactBusinessType"), reader.Unbox("MarketingAutomationVariant"), reader.Unbox("KontentIntercomUserID"), reader.Unbox("KontentGoogleAnalyticsUserID"), reader.Unbox("KontentAmplitudeUserID") - ); - } -}; -public partial record OmContactK13(int ContactID, string? ContactFirstName, string? ContactMiddleName, string? ContactLastName, string? ContactJobTitle, string? ContactAddress1, string? ContactCity, string? ContactZIP, int? ContactStateID, int? ContactCountryID, string? ContactMobilePhone, string? ContactBusinessPhone, string? ContactEmail, DateTime? ContactBirthday, int? ContactGender, int? ContactStatusID, string? ContactNotes, int? ContactOwnerUserID, bool? ContactMonitored, Guid ContactGUID, DateTime ContactLastModified, DateTime ContactCreated, int? ContactBounces, string? ContactCampaign, string? ContactSalesForceLeadID, bool? ContactSalesForceLeadReplicationDisabled, DateTime? ContactSalesForceLeadReplicationDateTime, DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, string? ContactCompanyName, bool? ContactSalesForceLeadReplicationRequired, int? ContactPersonaID) : IOmContact, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; - public static string TableName => "OM_Contact"; - public static string GuidColumnName => "ContactGUID"; - static OmContactK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactK13( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") - ); - } - public static OmContactK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactK13( - reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface IOmContact : ISourceModel +{ + int ContactID { get; } + string? ContactFirstName { get; } + string? ContactMiddleName { get; } + string? ContactLastName { get; } + string? ContactJobTitle { get; } + string? ContactAddress1 { get; } + string? ContactCity { get; } + string? ContactZIP { get; } + int? ContactStateID { get; } + int? ContactCountryID { get; } + string? ContactMobilePhone { get; } + string? ContactBusinessPhone { get; } + string? ContactEmail { get; } + DateTime? ContactBirthday { get; } + int? ContactGender { get; } + int? ContactStatusID { get; } + string? ContactNotes { get; } + int? ContactOwnerUserID { get; } + bool? ContactMonitored { get; } + Guid ContactGUID { get; } + DateTime ContactLastModified { get; } + DateTime ContactCreated { get; } + int? ContactBounces { get; } + string? ContactCampaign { get; } + string? ContactSalesForceLeadID { get; } + bool? ContactSalesForceLeadReplicationDisabled { get; } + DateTime? ContactSalesForceLeadReplicationDateTime { get; } + DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; } + string? ContactCompanyName { get; } + bool? ContactSalesForceLeadReplicationRequired { get; } + int? ContactPersonaID { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => OmContactK11.GetPrimaryKeyName(version), + { Major: 12 } => OmContactK12.GetPrimaryKeyName(version), + { Major: 13 } => OmContactK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => OmContactK11.IsAvailable(version), + { Major: 12 } => OmContactK12.IsAvailable(version), + { Major: 13 } => OmContactK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "OM_Contact"; + static string ISourceModel.GuidColumnName => "ContactGUID"; //assumtion, class Guid column doesn't change between versions + + static IOmContact ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => OmContactK11.FromReader(reader, version), + { Major: 12 } => OmContactK12.FromReader(reader, version), + { Major: 13 } => OmContactK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record OmContactK11( + int ContactID, + string? ContactFirstName, + string? ContactMiddleName, + string? ContactLastName, + string? ContactJobTitle, + string? ContactAddress1, + string? ContactCity, + string? ContactZIP, + int? ContactStateID, + int? ContactCountryID, + string? ContactMobilePhone, + string? ContactBusinessPhone, + string? ContactEmail, + DateTime? ContactBirthday, + int? ContactGender, + int? ContactStatusID, + string? ContactNotes, + int? ContactOwnerUserID, + bool? ContactMonitored, + Guid ContactGUID, + DateTime ContactLastModified, + DateTime ContactCreated, + int? ContactBounces, + string? ContactCampaign, + string? ContactSalesForceLeadID, + bool? ContactSalesForceLeadReplicationDisabled, + DateTime? ContactSalesForceLeadReplicationDateTime, + DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, + string? ContactCompanyName, + bool? ContactSalesForceLeadReplicationRequired, + int? ContactPersonaID) : IOmContact, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; + public static string TableName => "OM_Contact"; + public static string GuidColumnName => "ContactGUID"; + + static OmContactK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), + reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), + reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), + reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), + reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), + reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), + reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") + ); + + public static OmContactK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), + reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), + reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), + reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), + reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), + reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), + reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") + ); +} + +public record OmContactK12( + int ContactID, + string? ContactFirstName, + string? ContactMiddleName, + string? ContactLastName, + string? ContactJobTitle, + string? ContactAddress1, + string? ContactCity, + string? ContactZIP, + int? ContactStateID, + int? ContactCountryID, + string? ContactMobilePhone, + string? ContactBusinessPhone, + string? ContactEmail, + DateTime? ContactBirthday, + int? ContactGender, + int? ContactStatusID, + string? ContactNotes, + int? ContactOwnerUserID, + bool? ContactMonitored, + Guid ContactGUID, + DateTime ContactLastModified, + DateTime ContactCreated, + int? ContactBounces, + string? ContactCampaign, + string? ContactSalesForceLeadID, + bool? ContactSalesForceLeadReplicationDisabled, + DateTime? ContactSalesForceLeadReplicationDateTime, + DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, + string? ContactCompanyName, + bool? ContactSalesForceLeadReplicationRequired, + int? ContactPersonaID, + string? FirstUserAgent, + string? FirstIPAddress, + string? FirstRequestUrl, + string? KenticoUrlReferrer, + string? KenticoContactRegionName, + string? KenticoContactRegionCode, + string? KenticoContactPostalCode, + string? KenticoContactCampaignSource, + string? KenticoContactCampaignContent, + bool? NeedRecalculation, + int? ProfileScore, + int? EngagementScore, + int? TotalScore, + int? Zone, + Guid? DynamicsLeadGuid, + Guid? DynamicsContactGuid, + string? DynamicsAccountType, + string? DynamicsAccountStatus, + bool? LegitimateInterest, + string? DynamicsActivePartnerships, + DateTime? DynamicsDateOfSync, + bool? PairedWithDynamicsCrm, + DateTime? FirstPairDate, + int? PairedBy, + bool? IsArchived, + DateTime? ArchivationDate, + bool? HasFreeEmail, + int? SameDomainContacts, + string? AreYouLookingForCMS, + string? Role, + string? KenticoContactBusinessType, + string? MarketingAutomationVariant, + string? KontentIntercomUserID, + string? KontentGoogleAnalyticsUserID, + string? KontentAmplitudeUserID) : IOmContact, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; + public static string TableName => "OM_Contact"; + public static string GuidColumnName => "ContactGUID"; + + static OmContactK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), + reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), + reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), + reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), + reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), + reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), + reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID"), reader.Unbox("FirstUserAgent"), reader.Unbox("FirstIPAddress"), reader.Unbox("FirstRequestUrl"), + reader.Unbox("KenticoUrlReferrer"), reader.Unbox("KenticoContactRegionName"), reader.Unbox("KenticoContactRegionCode"), reader.Unbox("KenticoContactPostalCode"), + reader.Unbox("KenticoContactCampaignSource"), reader.Unbox("KenticoContactCampaignContent"), reader.Unbox("NeedRecalculation"), reader.Unbox("ProfileScore"), reader.Unbox("EngagementScore"), + reader.Unbox("TotalScore"), reader.Unbox("Zone"), reader.Unbox("DynamicsLeadGuid"), reader.Unbox("DynamicsContactGuid"), reader.Unbox("DynamicsAccountType"), reader.Unbox("DynamicsAccountStatus"), + reader.Unbox("LegitimateInterest"), reader.Unbox("DynamicsActivePartnerships"), reader.Unbox("DynamicsDateOfSync"), reader.Unbox("PairedWithDynamicsCrm"), reader.Unbox("FirstPairDate"), + reader.Unbox("PairedBy"), reader.Unbox("IsArchived"), reader.Unbox("ArchivationDate"), reader.Unbox("HasFreeEmail"), reader.Unbox("SameDomainContacts"), reader.Unbox("AreYouLookingForCMS"), + reader.Unbox("Role"), reader.Unbox("KenticoContactBusinessType"), reader.Unbox("MarketingAutomationVariant"), reader.Unbox("KontentIntercomUserID"), reader.Unbox("KontentGoogleAnalyticsUserID"), + reader.Unbox("KontentAmplitudeUserID") + ); + + public static OmContactK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), + reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), + reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), + reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), + reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), + reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), + reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID"), reader.Unbox("FirstUserAgent"), reader.Unbox("FirstIPAddress"), reader.Unbox("FirstRequestUrl"), + reader.Unbox("KenticoUrlReferrer"), reader.Unbox("KenticoContactRegionName"), reader.Unbox("KenticoContactRegionCode"), reader.Unbox("KenticoContactPostalCode"), + reader.Unbox("KenticoContactCampaignSource"), reader.Unbox("KenticoContactCampaignContent"), reader.Unbox("NeedRecalculation"), reader.Unbox("ProfileScore"), reader.Unbox("EngagementScore"), + reader.Unbox("TotalScore"), reader.Unbox("Zone"), reader.Unbox("DynamicsLeadGuid"), reader.Unbox("DynamicsContactGuid"), reader.Unbox("DynamicsAccountType"), reader.Unbox("DynamicsAccountStatus"), + reader.Unbox("LegitimateInterest"), reader.Unbox("DynamicsActivePartnerships"), reader.Unbox("DynamicsDateOfSync"), reader.Unbox("PairedWithDynamicsCrm"), reader.Unbox("FirstPairDate"), + reader.Unbox("PairedBy"), reader.Unbox("IsArchived"), reader.Unbox("ArchivationDate"), reader.Unbox("HasFreeEmail"), reader.Unbox("SameDomainContacts"), reader.Unbox("AreYouLookingForCMS"), + reader.Unbox("Role"), reader.Unbox("KenticoContactBusinessType"), reader.Unbox("MarketingAutomationVariant"), reader.Unbox("KontentIntercomUserID"), reader.Unbox("KontentGoogleAnalyticsUserID"), + reader.Unbox("KontentAmplitudeUserID") + ); +} + +public record OmContactK13( + int ContactID, + string? ContactFirstName, + string? ContactMiddleName, + string? ContactLastName, + string? ContactJobTitle, + string? ContactAddress1, + string? ContactCity, + string? ContactZIP, + int? ContactStateID, + int? ContactCountryID, + string? ContactMobilePhone, + string? ContactBusinessPhone, + string? ContactEmail, + DateTime? ContactBirthday, + int? ContactGender, + int? ContactStatusID, + string? ContactNotes, + int? ContactOwnerUserID, + bool? ContactMonitored, + Guid ContactGUID, + DateTime ContactLastModified, + DateTime ContactCreated, + int? ContactBounces, + string? ContactCampaign, + string? ContactSalesForceLeadID, + bool? ContactSalesForceLeadReplicationDisabled, + DateTime? ContactSalesForceLeadReplicationDateTime, + DateTime? ContactSalesForceLeadReplicationSuspensionDateTime, + string? ContactCompanyName, + bool? ContactSalesForceLeadReplicationRequired, + int? ContactPersonaID) : IOmContact, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactID"; + public static string TableName => "OM_Contact"; + public static string GuidColumnName => "ContactGUID"; + + static OmContactK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), + reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), + reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), + reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), + reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), + reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), + reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") + ); + + public static OmContactK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactID"), reader.Unbox("ContactFirstName"), reader.Unbox("ContactMiddleName"), reader.Unbox("ContactLastName"), reader.Unbox("ContactJobTitle"), + reader.Unbox("ContactAddress1"), reader.Unbox("ContactCity"), reader.Unbox("ContactZIP"), reader.Unbox("ContactStateID"), reader.Unbox("ContactCountryID"), reader.Unbox("ContactMobilePhone"), + reader.Unbox("ContactBusinessPhone"), reader.Unbox("ContactEmail"), reader.Unbox("ContactBirthday"), reader.Unbox("ContactGender"), reader.Unbox("ContactStatusID"), + reader.Unbox("ContactNotes"), reader.Unbox("ContactOwnerUserID"), reader.Unbox("ContactMonitored"), reader.Unbox("ContactGUID"), reader.Unbox("ContactLastModified"), + reader.Unbox("ContactCreated"), reader.Unbox("ContactBounces"), reader.Unbox("ContactCampaign"), reader.Unbox("ContactSalesForceLeadID"), reader.Unbox("ContactSalesForceLeadReplicationDisabled"), + reader.Unbox("ContactSalesForceLeadReplicationDateTime"), reader.Unbox("ContactSalesForceLeadReplicationSuspensionDateTime"), reader.Unbox("ContactCompanyName"), + reader.Unbox("ContactSalesForceLeadReplicationRequired"), reader.Unbox("ContactPersonaID") + ); +} diff --git a/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs b/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs index 8a3a66ec..9070ffb9 100644 --- a/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs +++ b/KVA/Migration.Toolkit.Source/Model/OmContactStatus.cs @@ -1,103 +1,90 @@ -namespace Migration.Toolkit.Source.Model; -// ReSharper disable InconsistentNaming - -using System.Data; -using Migration.Toolkit.Common; - -public interface IOmContactStatus : ISourceModel -{ - int ContactStatusID { get; } - string ContactStatusName { get; } - string ContactStatusDisplayName { get; } - string? ContactStatusDescription { get; } - - static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmContactStatusK11.GetPrimaryKeyName(version), - { Major: 12 } => OmContactStatusK12.GetPrimaryKeyName(version), - { Major: 13 } => OmContactStatusK13.GetPrimaryKeyName(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static bool ISourceModel.IsAvailable(SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmContactStatusK11.IsAvailable(version), - { Major: 12 } => OmContactStatusK12.IsAvailable(version), - { Major: 13 } => OmContactStatusK13.IsAvailable(version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } - static string ISourceModel.TableName => "OM_ContactStatus"; - static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions - static IOmContactStatus ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return version switch - { - { Major: 11 } => OmContactStatusK11.FromReader(reader, version), - { Major: 12 } => OmContactStatusK12.FromReader(reader, version), - { Major: 13 } => OmContactStatusK13.FromReader(reader, version), - _ => throw new InvalidCastException($"Invalid version {version}") - }; - } -} -public partial record OmContactStatusK11(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; - public static string TableName => "OM_ContactStatus"; - public static string GuidColumnName => ""; - static OmContactStatusK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactStatusK11( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - } - public static OmContactStatusK11 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactStatusK11( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - } -}; -public partial record OmContactStatusK12(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; - public static string TableName => "OM_ContactStatus"; - public static string GuidColumnName => ""; - static OmContactStatusK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactStatusK12( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - } - public static OmContactStatusK12 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactStatusK12( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - } -}; -public partial record OmContactStatusK13(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel -{ - public static bool IsAvailable(SemanticVersion version) => true; - public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; - public static string TableName => "OM_ContactStatus"; - public static string GuidColumnName => ""; - static OmContactStatusK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactStatusK13( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - } - public static OmContactStatusK13 FromReader(IDataReader reader, SemanticVersion version) - { - return new OmContactStatusK13( - reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") - ); - } -}; \ No newline at end of file +// ReSharper disable InconsistentNaming + +using System.Data; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source.Model; + +public interface IOmContactStatus : ISourceModel +{ + int ContactStatusID { get; } + string ContactStatusName { get; } + string ContactStatusDisplayName { get; } + string? ContactStatusDescription { get; } + + static string ISourceModel.GetPrimaryKeyName(SemanticVersion version) => version switch + { + { Major: 11 } => OmContactStatusK11.GetPrimaryKeyName(version), + { Major: 12 } => OmContactStatusK12.GetPrimaryKeyName(version), + { Major: 13 } => OmContactStatusK13.GetPrimaryKeyName(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static bool ISourceModel.IsAvailable(SemanticVersion version) => version switch + { + { Major: 11 } => OmContactStatusK11.IsAvailable(version), + { Major: 12 } => OmContactStatusK12.IsAvailable(version), + { Major: 13 } => OmContactStatusK13.IsAvailable(version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; + + static string ISourceModel.TableName => "OM_ContactStatus"; + static string ISourceModel.GuidColumnName => ""; //assumtion, class Guid column doesn't change between versions + + static IOmContactStatus ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => version switch + { + { Major: 11 } => OmContactStatusK11.FromReader(reader, version), + { Major: 12 } => OmContactStatusK12.FromReader(reader, version), + { Major: 13 } => OmContactStatusK13.FromReader(reader, version), + _ => throw new InvalidCastException($"Invalid version {version}") + }; +} + +public record OmContactStatusK11(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; + public static string TableName => "OM_ContactStatus"; + public static string GuidColumnName => ""; + + static OmContactStatusK11 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); + + public static OmContactStatusK11 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); +} + +public record OmContactStatusK12(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; + public static string TableName => "OM_ContactStatus"; + public static string GuidColumnName => ""; + + static OmContactStatusK12 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); + + public static OmContactStatusK12 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); +} + +public record OmContactStatusK13(int ContactStatusID, string ContactStatusName, string ContactStatusDisplayName, string? ContactStatusDescription) : IOmContactStatus, ISourceModel +{ + public static bool IsAvailable(SemanticVersion version) => true; + public static string GetPrimaryKeyName(SemanticVersion version) => "ContactStatusID"; + public static string TableName => "OM_ContactStatus"; + public static string GuidColumnName => ""; + + static OmContactStatusK13 ISourceModel.FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); + + public static OmContactStatusK13 FromReader(IDataReader reader, SemanticVersion version) => new( + reader.Unbox("ContactStatusID"), reader.Unbox("ContactStatusName"), reader.Unbox("ContactStatusDisplayName"), reader.Unbox("ContactStatusDescription") + ); +} diff --git a/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs b/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs index 4f8591b9..51d39c77 100644 --- a/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs +++ b/KVA/Migration.Toolkit.Source/ModelExtensions/ICmsPageTemplateConfiguration.cs @@ -1,18 +1,18 @@ -namespace Migration.Toolkit.Source.Model; - -public interface ICmsPageTemplateConfigurationK12K13 -{ - int PageTemplateConfigurationID { get; } - Guid PageTemplateConfigurationGUID { get; } - int PageTemplateConfigurationSiteID { get; } - DateTime PageTemplateConfigurationLastModified { get; } - string PageTemplateConfigurationName { get; } - string? PageTemplateConfigurationDescription { get; } - Guid? PageTemplateConfigurationThumbnailGUID { get; } - string PageTemplateConfigurationTemplate { get; } - string? PageTemplateConfigurationWidgets { get; } -} - -public partial record CmsPageTemplateConfigurationK12 : ICmsPageTemplateConfigurationK12K13; - -public partial record CmsPageTemplateConfigurationK13 : ICmsPageTemplateConfigurationK12K13; \ No newline at end of file +namespace Migration.Toolkit.Source.Model; + +public interface ICmsPageTemplateConfigurationK12K13 +{ + int PageTemplateConfigurationID { get; } + Guid PageTemplateConfigurationGUID { get; } + int PageTemplateConfigurationSiteID { get; } + DateTime PageTemplateConfigurationLastModified { get; } + string PageTemplateConfigurationName { get; } + string? PageTemplateConfigurationDescription { get; } + Guid? PageTemplateConfigurationThumbnailGUID { get; } + string PageTemplateConfigurationTemplate { get; } + string? PageTemplateConfigurationWidgets { get; } +} + +public partial record CmsPageTemplateConfigurationK12 : ICmsPageTemplateConfigurationK12K13; + +public partial record CmsPageTemplateConfigurationK13 : ICmsPageTemplateConfigurationK12K13; diff --git a/KVA/Migration.Toolkit.Source/ModelFacade.cs b/KVA/Migration.Toolkit.Source/ModelFacade.cs index 92310f43..4cccfa49 100644 --- a/KVA/Migration.Toolkit.Source/ModelFacade.cs +++ b/KVA/Migration.Toolkit.Source/ModelFacade.cs @@ -1,195 +1,201 @@ -namespace Migration.Toolkit.Source; - -using System.Runtime.CompilerServices; -using CMS.DataEngine; -using Microsoft.Data.SqlClient; -using Migration.Toolkit.Common; - -public class ModelFacade(ToolkitConfiguration configuration) -{ - private SemanticVersion? _version; - - public async IAsyncEnumerable SelectAllAsync([EnumeratorCancellation] CancellationToken cancellationToken) where T : ISourceModel - { - _version ??= SelectVersion(); - - await using var conn = GetConnection(); - await conn.OpenAsync(cancellationToken); - var cmd = conn.CreateCommand(); - cmd.CommandText = $"SELECT * FROM {T.TableName}"; - await using var reader = await cmd.ExecuteReaderAsync(cancellationToken); - while (await reader.ReadAsync(cancellationToken)) - { - yield return T.FromReader(reader, _version); - } - } - - public IEnumerable SelectAll() where T : ISourceModel - { - _version ??= SelectVersion(); - using var conn = GetConnection(); - conn.Open(); - var cmd = conn.CreateCommand(); - cmd.CommandText = $"SELECT * FROM {T.TableName}"; - using var reader = cmd.ExecuteReader(); - while (reader.Read()) - { - yield return T.FromReader(reader, _version); - } - } - - public IEnumerable SelectWhere(string where, params SqlParameter[] parameters) where T : ISourceModel - { - _version ??= SelectVersion(); - using var conn = GetConnection(); - conn.Open(); - var cmd = conn.CreateCommand(); - cmd.CommandText = $"SELECT * FROM {T.TableName} WHERE {where}"; - cmd.Parameters.AddRange(parameters); - using var reader = cmd.ExecuteReader(); - while (reader.Read()) - { - yield return T.FromReader(reader, _version); - } - } - - public bool IsAvailable() where T : ISourceModel - { - _version ??= SelectVersion(); - return T.IsAvailable(_version); - } - - public IEnumerable Select(string where, string orderBy, params SqlParameter[] parameters) where T : ISourceModel - { - _version ??= SelectVersion(); - using var conn = GetConnection(); - conn.Open(); - var cmd = conn.CreateCommand(); - cmd.CommandText = $"SELECT * FROM {T.TableName} WHERE {where} ORDER BY {orderBy}"; - cmd.Parameters.AddRange(parameters); - using var reader = cmd.ExecuteReader(); - while (reader.Read()) - { - yield return T.FromReader(reader, _version); - } - } - - public IEnumerable Select(string query, Func convertor, params SqlParameter[] parameters) - { - _version ??= SelectVersion(); - using var conn = GetConnection(); - conn.Open(); - var cmd = conn.CreateCommand(); - cmd.CommandText = query; - cmd.Parameters.AddRange(parameters); - using var reader = cmd.ExecuteReader(); - while (reader.Read()) - { - yield return convertor(reader, _version); - } - } - - public T? SelectById(int? id) where T : ISourceModel - { - if (!id.HasValue) return default; - _version ??= SelectVersion(); - using var conn = GetConnection(); - conn.Open(); - var cmd = conn.CreateCommand(); - cmd.CommandText = $"SELECT * FROM {T.TableName} WHERE {T.GetPrimaryKeyName(_version)}={id}"; - using var reader = cmd.ExecuteReader(); - reader.Read(); - var result = T.FromReader(reader, _version); - if (reader.Read()) - { - throw new InvalidOperationException("Multiple items were found by ID"); - } - - return result; - } - - public bool TrySelectGuid(int? id, out Guid? objectGuid) where T : ISourceModel - { - if (!id.HasValue) - { - Unsafe.SkipInit(out objectGuid); - return false; - } - - _version ??= SelectVersion(); - using var conn = GetConnection(); - conn.Open(); - var cmd = conn.CreateCommand(); - cmd.CommandText = $"SELECT {T.GuidColumnName} FROM {T.TableName} WHERE {T.GetPrimaryKeyName(_version)}={id}"; - var ret = cmd.ExecuteScalar(); - if (ret is Guid guid) - { - objectGuid = guid; - return true; - } - else if (ret is DBNull) - { - objectGuid = null; - return true; - } - else - { - throw new InvalidOperationException($"Unexpected return value: '{ret}'"); - } - } - - public SemanticVersion SelectVersion() - { - using var conn = GetConnection(); - conn.Open(); - - var cmd = conn.CreateCommand(); - cmd.CommandText = "SELECT KeyValue FROM CMS_SettingsKey WHERE KeyName LIKE 'CMSDataVersion'"; - - var cmsVersion = ""; - if (cmd.ExecuteScalar() is string cmsDbVersion) - { - cmsVersion += cmsDbVersion; - } - else - { - throw new InvalidOperationException("Unable to determine source instance version"); - } - - cmd = conn.CreateCommand(); - cmd.CommandText = "SELECT KeyValue FROM CMS_SettingsKey WHERE KeyName LIKE 'CMSHotfixVersion'"; - if (cmd.ExecuteScalar() is string cmsHotfixVersion) - { - cmsVersion += $".{cmsHotfixVersion}"; - } - else - { - throw new InvalidOperationException("Unable to determine source instance hotfix"); - } - - return SemanticVersion.TryParse(cmsVersion, out var version) - ? version - : throw new InvalidOperationException("Unable to determine source instance version"); - } - - private SqlConnection GetConnection() - { - return new SqlConnection(configuration.KxConnectionString); - } - - public string HashPath(string path) - { - _version ??= SelectVersion(); - using var conn = GetConnection(); - conn.Open(); - var cmd = conn.CreateCommand(); - cmd.CommandText = $"SELECT CONVERT(VARCHAR(64), HASHBYTES('SHA2_256', LOWER(@path)), 2)"; - cmd.Parameters.AddWithValue("path", path); - if (cmd.ExecuteScalar() is string s) - { - return s; - } - - throw new InvalidOperationException($"Unable to hash path '{path}'"); - } -} \ No newline at end of file +using System.Runtime.CompilerServices; + +using Microsoft.Data.SqlClient; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.Source; + +public class ModelFacade(ToolkitConfiguration configuration) +{ + private SemanticVersion? semanticVersion; + + public async IAsyncEnumerable SelectAllAsync([EnumeratorCancellation] CancellationToken cancellationToken) where T : ISourceModel + { + semanticVersion ??= SelectVersion(); + + await using var conn = GetConnection(); + await conn.OpenAsync(cancellationToken); + var cmd = conn.CreateCommand(); + cmd.CommandText = $"SELECT * FROM {T.TableName}"; + await using var reader = await cmd.ExecuteReaderAsync(cancellationToken); + while (await reader.ReadAsync(cancellationToken)) + { + yield return T.FromReader(reader, semanticVersion); + } + } + + public IEnumerable SelectAll(string? orderBy = null) where T : ISourceModel + { + semanticVersion ??= SelectVersion(); + using var conn = GetConnection(); + conn.Open(); + var cmd = conn.CreateCommand(); + cmd.CommandText = $"SELECT * FROM {T.TableName}"; + if (!string.IsNullOrWhiteSpace(orderBy)) + { + cmd.CommandText += orderBy; + } + + using var reader = cmd.ExecuteReader(); + while (reader.Read()) + { + yield return T.FromReader(reader, semanticVersion); + } + } + + public IEnumerable SelectWhere(string where, params SqlParameter[] parameters) where T : ISourceModel + { + semanticVersion ??= SelectVersion(); + using var conn = GetConnection(); + conn.Open(); + var cmd = conn.CreateCommand(); + cmd.CommandText = $"SELECT * FROM {T.TableName} WHERE {where}"; + cmd.Parameters.AddRange(parameters); + using var reader = cmd.ExecuteReader(); + while (reader.Read()) + { + yield return T.FromReader(reader, semanticVersion); + } + } + + public bool IsAvailable() where T : ISourceModel + { + semanticVersion ??= SelectVersion(); + return T.IsAvailable(semanticVersion); + } + + public IEnumerable Select(string where, string orderBy, params SqlParameter[] parameters) where T : ISourceModel + { + semanticVersion ??= SelectVersion(); + using var conn = GetConnection(); + conn.Open(); + var cmd = conn.CreateCommand(); + cmd.CommandText = $"SELECT * FROM {T.TableName} WHERE {where} ORDER BY {orderBy}"; + cmd.Parameters.AddRange(parameters); + using var reader = cmd.ExecuteReader(); + while (reader.Read()) + { + yield return T.FromReader(reader, semanticVersion); + } + } + + public IEnumerable Select(string query, Func convertor, params SqlParameter[] parameters) + { + semanticVersion ??= SelectVersion(); + using var conn = GetConnection(); + conn.Open(); + var cmd = conn.CreateCommand(); + cmd.CommandText = query; + cmd.Parameters.AddRange(parameters); + using var reader = cmd.ExecuteReader(); + while (reader.Read()) + { + yield return convertor(reader, semanticVersion); + } + } + + public T? SelectById(int? id) where T : ISourceModel + { + if (!id.HasValue) + { + return default; + } + + semanticVersion ??= SelectVersion(); + using var conn = GetConnection(); + conn.Open(); + var cmd = conn.CreateCommand(); + cmd.CommandText = $"SELECT * FROM {T.TableName} WHERE {T.GetPrimaryKeyName(semanticVersion)}={id}"; + using var reader = cmd.ExecuteReader(); + reader.Read(); + var result = T.FromReader(reader, semanticVersion); + if (reader.Read()) + { + throw new InvalidOperationException("Multiple items were found by ID"); + } + + return result; + } + + public bool TrySelectGuid(int? id, out Guid? objectGuid) where T : ISourceModel + { + if (!id.HasValue) + { + Unsafe.SkipInit(out objectGuid); + return false; + } + + semanticVersion ??= SelectVersion(); + using var conn = GetConnection(); + conn.Open(); + var cmd = conn.CreateCommand(); + cmd.CommandText = $"SELECT {T.GuidColumnName} FROM {T.TableName} WHERE {T.GetPrimaryKeyName(semanticVersion)}={id}"; + object ret = cmd.ExecuteScalar(); + if (ret is Guid guid) + { + objectGuid = guid; + return true; + } + + if (ret is DBNull) + { + objectGuid = null; + return true; + } + + throw new InvalidOperationException($"Unexpected return value: '{ret}'"); + } + + public SemanticVersion SelectVersion() + { + using var conn = GetConnection(); + conn.Open(); + + var cmd = conn.CreateCommand(); + cmd.CommandText = "SELECT KeyValue FROM CMS_SettingsKey WHERE KeyName LIKE 'CMSDataVersion'"; + + string cmsVersion = ""; + if (cmd.ExecuteScalar() is string cmsDbVersion) + { + cmsVersion += cmsDbVersion; + } + else + { + throw new InvalidOperationException("Unable to determine source instance version"); + } + + cmd = conn.CreateCommand(); + cmd.CommandText = "SELECT KeyValue FROM CMS_SettingsKey WHERE KeyName LIKE 'CMSHotfixVersion'"; + if (cmd.ExecuteScalar() is string cmsHotfixVersion) + { + cmsVersion += $".{cmsHotfixVersion}"; + } + else + { + throw new InvalidOperationException("Unable to determine source instance hotfix"); + } + + return SemanticVersion.TryParse(cmsVersion, out var version) + ? version + : throw new InvalidOperationException("Unable to determine source instance version"); + } + + private SqlConnection GetConnection() => new(configuration.KxConnectionString); + + public string HashPath(string path) + { + semanticVersion ??= SelectVersion(); + using var conn = GetConnection(); + conn.Open(); + var cmd = conn.CreateCommand(); + cmd.CommandText = "SELECT CONVERT(VARCHAR(64), HASHBYTES('SHA2_256', LOWER(@path)), 2)"; + cmd.Parameters.AddWithValue("path", path); + if (cmd.ExecuteScalar() is string s) + { + return s; + } + + throw new InvalidOperationException($"Unable to hash path '{path}'"); + } +} diff --git a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs index a67593e9..8dd1bc87 100644 --- a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs +++ b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameProvider.cs @@ -1,47 +1,42 @@ -namespace Migration.Toolkit.Source.Providers; - -using System; -using System.Threading.Tasks; -using CMS.Base; -using CMS.ContentEngine.Internal; -using CMS.Helpers; - -internal class ContentItemNameProvider -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) - { - this.codeNameValidator = codeNameValidator; - } - - public Task Get(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); - } - - async Task Get(string name) - { - var codeName = ValidationHelper.GetCodeName(name, useUnicode: false); - - var isCodeNameValid = ValidationHelper.IsCodeName(codeName); - - if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) - { - codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); - } - - var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); - - return await uniqueCodeNameProvider.GetUniqueValue(codeName); - } - - return Get(name); - } -} \ No newline at end of file +using CMS.Base; +using CMS.ContentEngine.Internal; +using CMS.Helpers; + +namespace Migration.Toolkit.Source.Providers; + +internal class ContentItemNameProvider +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; + + public Task Get(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); + } + + async Task Get(string name) + { + string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); + + bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); + + if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) + { + codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); + } + + var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); + + return await uniqueCodeNameProvider.GetUniqueValue(codeName); + } + + return Get(name); + } +} diff --git a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs index 7c76bc72..e8200cb0 100644 --- a/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs +++ b/KVA/Migration.Toolkit.Source/Providers/ContentItemNameValidator.cs @@ -1,25 +1,18 @@ -namespace Migration.Toolkit.Source.Providers; - -using CMS.ContentEngine.Internal; - -internal class ContentItemNameValidator : IContentItemNameValidator -{ - /// - public bool IsUnique(string name) - { - return IsUnique(0, name); - } - - - /// - public bool IsUnique(int id, string name) - { - var contentItemInfo = new ContentItemInfo() - { - ContentItemID = id, - ContentItemName = name, - }; - - return contentItemInfo.CheckUniqueCodeName(); - } -} \ No newline at end of file +using CMS.ContentEngine.Internal; + +namespace Migration.Toolkit.Source.Providers; + +internal class ContentItemNameValidator : IContentItemNameValidator +{ + /// + public bool IsUnique(string name) => IsUnique(0, name); + + + /// + public bool IsUnique(int id, string name) + { + var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; + + return contentItemInfo.CheckUniqueCodeName(); + } +} diff --git a/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs b/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs index cfb0e000..24e0dd5c 100644 --- a/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs +++ b/KVA/Migration.Toolkit.Source/Providers/UniqueContentItemNameProvider.cs @@ -1,48 +1,38 @@ -namespace Migration.Toolkit.Source.Providers; - -using System.Threading.Tasks; -using CMS.Base; -using CMS.ContentEngine.Internal; - -internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) - : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) - { - this.codeNameValidator = codeNameValidator; - } - - public override Task GetUniqueValue(string inputValue) - { - return base.GetUniqueValue(AddSuffix(inputValue)); - } - - - private string AddSuffix(string codeName) - { - var randomSuffix = GetRandomSuffix(); - var codeNameWithSuffix = codeName += randomSuffix; - - if (codeNameWithSuffix.Length > MaxLength) - { - var availableLength = MaxLength - randomSuffix.Length; - - codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; - } - - return codeNameWithSuffix; - } - - - /// - protected override Task IsValueUnique(string value) - { - return Task.FromResult(codeNameValidator.IsUnique(value)); - } -} \ No newline at end of file +using CMS.Base; +using CMS.ContentEngine.Internal; + +namespace Migration.Toolkit.Source.Providers; + +internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) + : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; + + public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); + + + private string AddSuffix(string codeName) + { + string randomSuffix = GetRandomSuffix(); + string codeNameWithSuffix = codeName += randomSuffix; + + if (codeNameWithSuffix.Length > MaxLength) + { + int availableLength = MaxLength - randomSuffix.Length; + + codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; + } + + return codeNameWithSuffix; + } + + + /// + protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); +} diff --git a/KVA/Migration.Toolkit.Source/Services/AttachmentMigrator.cs b/KVA/Migration.Toolkit.Source/Services/AttachmentMigrator.cs index b77520db..2143382a 100644 --- a/KVA/Migration.Toolkit.Source/Services/AttachmentMigrator.cs +++ b/KVA/Migration.Toolkit.Source/Services/AttachmentMigrator.cs @@ -1,257 +1,262 @@ -namespace Migration.Toolkit.Source.Services; - -using System.Collections.Concurrent; -using System.Diagnostics; -using System.Text.RegularExpressions; -using CMS.Base; -using CMS.Helpers; -using CMS.MediaLibrary; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.Source.Mappers; -using Migration.Toolkit.Source.Model; - -public class AttachmentMigrator( - ILogger logger, - KxpMediaFileFacade mediaFileFacade, - IDbContextFactory kxpContextFactory, - IEntityMapper attachmentMapper, - IProtocol protocol, - ModelFacade modelFacade -) -{ - public record MigrateAttachmentResult( - bool Success, - bool CanContinue, - MediaFileInfo? MediaFileInfo = null, - MediaLibraryInfo? MediaLibraryInfo = null); - - public MigrateAttachmentResult TryMigrateAttachmentByPath(string documentPath, string additionalPath) - { - if (string.IsNullOrWhiteSpace(documentPath)) return new MigrateAttachmentResult(false, false); - documentPath = $"/{documentPath.Trim('/')}"; - - var attachments = - modelFacade.SelectWhere( - """ - EXISTS ( - SELECT T.NodeAliasPath - FROM CMS_Document [D] JOIN - CMS_Tree [T] ON D.DocumentNodeID = T.NodeID - WHERE D.DocumentID = AttachmentDocumentID AND T.NodeAliasPath = @nodeAliasPath - ) - """, new SqlParameter("nodeAliasPath", documentPath)).ToList() - ; - - Debug.Assert(attachments.Count == 1, "attachments.Count == 1"); - var attachment = attachments.FirstOrDefault(); - - return attachment != null - ? MigrateAttachment(attachment, additionalPath) - : new MigrateAttachmentResult(false, false); - } - - public IEnumerable MigrateGroupedAttachments(int documentId, Guid attachmentGroupGuid, string fieldName) - { - var groupedAttachment = modelFacade.SelectWhere( - """ - AttachmentGroupGuid = @attachmentGroupGuid AND - AttachmentDocumentId = @attachmentDocumentId - """, - new SqlParameter("attachmentGroupGuid", attachmentGroupGuid), - new SqlParameter("attachmentDocumentId", documentId) - ); - - foreach (var cmsAttachment in groupedAttachment) - { - yield return MigrateAttachment(cmsAttachment, $"__{fieldName}"); - } - } - - public MigrateAttachmentResult MigrateAttachment(Guid ksAttachmentGuid, string additionalPath) - { - var attachment = modelFacade - .SelectWhere("AttachmentGuid = @attachmentGuid", new SqlParameter("attachmentGuid", ksAttachmentGuid)) - .SingleOrDefault(); - - if (attachment == null) - { - logger.LogWarning("Attachment '{AttachmentGuid}' not found! => skipping", ksAttachmentGuid); - protocol.Append(HandbookReferences.TemporaryAttachmentMigrationIsNotSupported.WithData(new { AttachmentGuid = ksAttachmentGuid, })); - return new MigrateAttachmentResult(false, true); - } - - return MigrateAttachment(attachment, additionalPath); - } - - public MigrateAttachmentResult MigrateAttachment(ICmsAttachment ksAttachment, string? additionalMediaPath = null) - { - // TODO tomas.krch: 2022-08-18 directory validation only -_ replace! - protocol.FetchedSource(ksAttachment); - - if (ksAttachment.AttachmentFormGUID != null) - { - logger.LogWarning("Attachment '{AttachmentGuid}' is temporary => skipping", ksAttachment.AttachmentGUID); - protocol.Append(HandbookReferences.TemporaryAttachmentMigrationIsNotSupported.WithData(new - { - ksAttachment.AttachmentID, - ksAttachment.AttachmentGUID, - ksAttachment.AttachmentName, - ksAttachment.AttachmentSiteID - })); - return new(false, true); - } - - var ksAttachmentDocument = ksAttachment.AttachmentDocumentID is { } attachmentDocumentId - ? modelFacade.SelectById(attachmentDocumentId) - : null; - - var ksNode = ksAttachmentDocument?.DocumentNodeID is { } documentNodeId - ? modelFacade.SelectById(documentNodeId) - : null; - - var site = modelFacade.SelectById(ksAttachment.AttachmentSiteID) ?? throw new InvalidOperationException("Site not exists!"); - if (!TryEnsureTargetLibraryExists(ksAttachment.AttachmentSiteID, site.SiteName, out var targetMediaLibraryId)) - { - return new(false, false); - } - - var uploadedFile = CreateUploadFileFromAttachment(ksAttachment); - if (uploadedFile == null) - { - protocol.Append(HandbookReferences - .FailedToCreateTargetInstance() - .WithIdentityPrint(ksAttachment) - .WithMessage("Failed to create dummy upload file containing data") - ); - return new(false, true); - } - - var mediaFile = mediaFileFacade.GetMediaFile(ksAttachment.AttachmentGUID); - - protocol.FetchedTarget(mediaFile); - - var librarySubFolder = ""; - - if (ksNode != null) - { - librarySubFolder = ksNode.NodeAliasPath; - } - - if (!string.IsNullOrWhiteSpace(additionalMediaPath) && (ksAttachment.AttachmentIsUnsorted != true || ksAttachment.AttachmentGroupGUID != null)) - { - librarySubFolder = System.IO.Path.Combine(librarySubFolder, additionalMediaPath); - } - - var mapped = attachmentMapper.Map(new CmsAttachmentMapperSource(ksAttachment, targetMediaLibraryId, uploadedFile, librarySubFolder, ksNode), mediaFile); - protocol.MappedTarget(mapped); - - if (mapped is (var mediaFileInfo, var newInstance) { Success: true }) - { - Debug.Assert(mediaFileInfo != null, nameof(mediaFileInfo) + " != null"); - - try - { - if (newInstance) - { - mediaFileFacade.EnsureMediaFilePathExistsInLibrary(mediaFileInfo, targetMediaLibraryId); - } - - mediaFileFacade.SetMediaFile(mediaFileInfo, newInstance); - - protocol.Success(ksAttachmentDocument, mediaFileInfo, mapped); - logger.LogEntitySetAction(newInstance, mediaFileInfo); - - return new(true, true, mediaFileInfo, MediaLibraryInfoProvider.ProviderObject.Get(targetMediaLibraryId)); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, mediaFileInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(mediaFileInfo) - .WithData(new - { - mediaFileInfo.FileGUID, - mediaFileInfo.FileName - }) - ); - } - } - - return new(false, true); - } - - private IUploadedFile? CreateUploadFileFromAttachment(ICmsAttachment attachment) - { - if (attachment.AttachmentBinary != null) - { - var ms = new MemoryStream(attachment.AttachmentBinary); - return DummyUploadedFile.FromStream(ms, attachment.AttachmentMimeType, attachment.AttachmentSize, attachment.AttachmentName); - } - else - { - return null; - } - } - - - private readonly ConcurrentDictionary<(string libraryName, int siteId), int> _mediaLibraryIdCache = new(); - - private bool TryEnsureTargetLibraryExists(int targetSiteId, string targetSiteName, out int targetLibraryId) - { - var targetLibraryCodeName = $"AttachmentsForSite{targetSiteName}"; - var targetLibraryDisplayName = $"Attachments for site {targetSiteName}"; - using var dbContext = kxpContextFactory.CreateDbContext(); - try - { - targetLibraryId = _mediaLibraryIdCache.GetOrAdd((targetLibraryCodeName, targetSiteId), static (arg, context) => MediaLibraryFactory(arg, context), - new MediaLibraryFactoryContext(mediaFileFacade, targetLibraryCodeName, targetLibraryDisplayName, dbContext)); - - return true; - } - catch (Exception exception) - { - logger.LogError(exception, "creating target media library failed"); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithData(new { TargetLibraryCodeName = targetLibraryCodeName, targetSiteId, }) - ); - } - - targetLibraryId = 0; - return false; - } - - private record MediaLibraryFactoryContext(KxpMediaFileFacade MediaFileFacade, string TargetLibraryCodeName, string TargetLibraryDisplayName, KxpContext DbContext); - - private static readonly Regex SanitizationRegex = - RegexHelper.GetRegex("[^-_a-z0-9]", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.CultureInvariant); - - private static readonly Regex LibraryPathValidationRegex = - RegexHelper.GetRegex("^[-_a-z0-9]+$", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.CultureInvariant); - - private static int MediaLibraryFactory((string libraryName, int siteId) arg, MediaLibraryFactoryContext context) - { - var (libraryName, siteId) = arg; - - // TODO tomas.krch: 2023-11-02 libraries now globalized, where do i put conflicting directories? - var tml = context.DbContext.MediaLibraries.SingleOrDefault(ml => ml.LibraryName == libraryName); - - var libraryDirectory = context.TargetLibraryCodeName; - if (!LibraryPathValidationRegex.IsMatch(libraryDirectory)) - { - libraryDirectory = SanitizationRegex.Replace(libraryDirectory, "_"); - } - - return tml?.LibraryId ?? context.MediaFileFacade - .CreateMediaLibrary(siteId, libraryDirectory, "Created by Xperience Migration.Toolkit", context.TargetLibraryCodeName, context.TargetLibraryDisplayName).LibraryID; - } -} \ No newline at end of file +using System.Collections.Concurrent; +using System.Diagnostics; +using System.Text.RegularExpressions; + +using CMS.Base; +using CMS.Helpers; +using CMS.MediaLibrary; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.Source.Mappers; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Services; + +public class AttachmentMigrator( + ILogger logger, + KxpMediaFileFacade mediaFileFacade, + IDbContextFactory kxpContextFactory, + IEntityMapper attachmentMapper, + IProtocol protocol, + ModelFacade modelFacade +) +{ + private static readonly Regex sanitizationRegex = + RegexHelper.GetRegex("[^-_a-z0-9]", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.CultureInvariant); + + private static readonly Regex libraryPathValidationRegex = + RegexHelper.GetRegex("^[-_a-z0-9]+$", RegexOptions.IgnoreCase | RegexOptions.Compiled | RegexOptions.Singleline | RegexOptions.CultureInvariant); + + + private readonly ConcurrentDictionary<(string libraryName, int siteId), int> mediaLibraryIdCache = new(); + + public MigrateAttachmentResult TryMigrateAttachmentByPath(string documentPath, string additionalPath) + { + if (string.IsNullOrWhiteSpace(documentPath)) + { + return new MigrateAttachmentResult(false, false); + } + + documentPath = $"/{documentPath.Trim('/')}"; + + var attachments = + modelFacade.SelectWhere( + """ + EXISTS ( + SELECT T.NodeAliasPath + FROM CMS_Document [D] JOIN + CMS_Tree [T] ON D.DocumentNodeID = T.NodeID + WHERE D.DocumentID = AttachmentDocumentID AND T.NodeAliasPath = @nodeAliasPath + ) + """, new SqlParameter("nodeAliasPath", documentPath)).ToList() + ; + + Debug.Assert(attachments.Count == 1, "attachments.Count == 1"); + var attachment = attachments.FirstOrDefault(); + + return attachment != null + ? MigrateAttachment(attachment, additionalPath) + : new MigrateAttachmentResult(false, false); + } + + public IEnumerable MigrateGroupedAttachments(int documentId, Guid attachmentGroupGuid, string fieldName) + { + var groupedAttachment = modelFacade.SelectWhere( + """ + AttachmentGroupGuid = @attachmentGroupGuid AND + AttachmentDocumentId = @attachmentDocumentId + """, + new SqlParameter("attachmentGroupGuid", attachmentGroupGuid), + new SqlParameter("attachmentDocumentId", documentId) + ); + + foreach (var cmsAttachment in groupedAttachment) + { + yield return MigrateAttachment(cmsAttachment, $"__{fieldName}"); + } + } + + public MigrateAttachmentResult MigrateAttachment(Guid ksAttachmentGuid, string additionalPath) + { + var attachments = modelFacade + .SelectWhere("AttachmentGuid = @attachmentGuid", new SqlParameter("attachmentGuid", ksAttachmentGuid)) + .ToList(); + + switch (attachments) + { + case { Count: 0 }: + { + logger.LogWarning("Attachment '{AttachmentGuid}' not found! => skipping", ksAttachmentGuid); + protocol.Append(HandbookReferences.TemporaryAttachmentMigrationIsNotSupported.WithData(new { AttachmentGuid = ksAttachmentGuid })); + return new MigrateAttachmentResult(false, true); + } + case [var attachment]: + { + return MigrateAttachment(attachment, additionalPath); + } + default: + { + logger.LogWarning("Attachment '{AttachmentGuid}' found multiple times! => skipping", ksAttachmentGuid); + protocol.Append(HandbookReferences.NonUniqueEntityGuid.WithData(new { AttachmentGuid = ksAttachmentGuid, AttachmentIds = attachments.Select(a => a.AttachmentID) })); + return new MigrateAttachmentResult(false, true); + } + } + } + + public MigrateAttachmentResult MigrateAttachment(ICmsAttachment ksAttachment, string? additionalMediaPath = null) + { + protocol.FetchedSource(ksAttachment); + + if (ksAttachment.AttachmentFormGUID != null) + { + logger.LogWarning("Attachment '{AttachmentGuid}' is temporary => skipping", ksAttachment.AttachmentGUID); + protocol.Append(HandbookReferences.TemporaryAttachmentMigrationIsNotSupported.WithData(new { ksAttachment.AttachmentID, ksAttachment.AttachmentGUID, ksAttachment.AttachmentName, ksAttachment.AttachmentSiteID })); + return new MigrateAttachmentResult(false, true); + } + + var ksAttachmentDocument = ksAttachment.AttachmentDocumentID is { } attachmentDocumentId + ? modelFacade.SelectById(attachmentDocumentId) + : null; + + var ksNode = ksAttachmentDocument?.DocumentNodeID is { } documentNodeId + ? modelFacade.SelectById(documentNodeId) + : null; + + var site = modelFacade.SelectById(ksAttachment.AttachmentSiteID) ?? throw new InvalidOperationException("Site not exists!"); + if (!TryEnsureTargetLibraryExists(ksAttachment.AttachmentSiteID, site.SiteName, out int targetMediaLibraryId)) + { + return new MigrateAttachmentResult(false, false); + } + + var uploadedFile = CreateUploadFileFromAttachment(ksAttachment); + if (uploadedFile == null) + { + protocol.Append(HandbookReferences + .FailedToCreateTargetInstance() + .WithIdentityPrint(ksAttachment) + .WithMessage("Failed to create dummy upload file containing data") + ); + return new MigrateAttachmentResult(false, true); + } + + var mediaFile = mediaFileFacade.GetMediaFile(ksAttachment.AttachmentGUID); + + protocol.FetchedTarget(mediaFile); + + string librarySubFolder = ""; + + if (ksNode != null) + { + librarySubFolder = ksNode.NodeAliasPath; + } + + if (!string.IsNullOrWhiteSpace(additionalMediaPath) && (ksAttachment.AttachmentIsUnsorted != true || ksAttachment.AttachmentGroupGUID != null)) + { + librarySubFolder = Path.Combine(librarySubFolder, additionalMediaPath); + } + + var mapped = attachmentMapper.Map(new CmsAttachmentMapperSource(ksAttachment, targetMediaLibraryId, uploadedFile, librarySubFolder, ksNode), mediaFile); + protocol.MappedTarget(mapped); + + if (mapped is (var mediaFileInfo, var newInstance) { Success: true }) + { + Debug.Assert(mediaFileInfo != null, nameof(mediaFileInfo) + " != null"); + + try + { + if (newInstance) + { + mediaFileFacade.EnsureMediaFilePathExistsInLibrary(mediaFileInfo, targetMediaLibraryId); + } + + mediaFileFacade.SetMediaFile(mediaFileInfo, newInstance); + + protocol.Success(ksAttachmentDocument, mediaFileInfo, mapped); + logger.LogEntitySetAction(newInstance, mediaFileInfo); + + return new MigrateAttachmentResult(true, true, mediaFileInfo, MediaLibraryInfoProvider.ProviderObject.Get(targetMediaLibraryId)); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, mediaFileInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(mediaFileInfo) + .WithData(new { mediaFileInfo.FileGUID, mediaFileInfo.FileName }) + ); + } + } + + return new MigrateAttachmentResult(false, true); + } + + private IUploadedFile? CreateUploadFileFromAttachment(ICmsAttachment attachment) + { + if (attachment.AttachmentBinary != null) + { + var ms = new MemoryStream(attachment.AttachmentBinary); + return DummyUploadedFile.FromStream(ms, attachment.AttachmentMimeType, attachment.AttachmentSize, attachment.AttachmentName); + } + + return null; + } + + private bool TryEnsureTargetLibraryExists(int targetSiteId, string targetSiteName, out int targetLibraryId) + { + string targetLibraryCodeName = $"AttachmentsForSite{targetSiteName}"; + string targetLibraryDisplayName = $"Attachments for site {targetSiteName}"; + using var dbContext = kxpContextFactory.CreateDbContext(); + try + { + targetLibraryId = mediaLibraryIdCache.GetOrAdd((targetLibraryCodeName, targetSiteId), static (arg, context) => MediaLibraryFactory(arg, context), + new MediaLibraryFactoryContext(mediaFileFacade, targetLibraryCodeName, targetLibraryDisplayName, dbContext)); + + return true; + } + catch (Exception exception) + { + logger.LogError(exception, "creating target media library failed"); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithData(new { TargetLibraryCodeName = targetLibraryCodeName, targetSiteId }) + ); + } + + targetLibraryId = 0; + return false; + } + + private static int MediaLibraryFactory((string libraryName, int siteId) arg, MediaLibraryFactoryContext context) + { + (string libraryName, int siteId) = arg; + + // TODO tomas.krch: 2023-11-02 libraries now globalized, where do i put conflicting directories? + var tml = context.DbContext.MediaLibraries.SingleOrDefault(ml => ml.LibraryName == libraryName); + + string libraryDirectory = context.TargetLibraryCodeName; + if (!libraryPathValidationRegex.IsMatch(libraryDirectory)) + { + libraryDirectory = sanitizationRegex.Replace(libraryDirectory, "_"); + } + + return tml?.LibraryId ?? context.MediaFileFacade + .CreateMediaLibrary(siteId, libraryDirectory, "Created by Xperience Migration.Toolkit", context.TargetLibraryCodeName, context.TargetLibraryDisplayName).LibraryID; + } + + public record MigrateAttachmentResult( + bool Success, + bool CanContinue, + MediaFileInfo? MediaFileInfo = null, + MediaLibraryInfo? MediaLibraryInfo = null); + + private record MediaLibraryFactoryContext(KxpMediaFileFacade MediaFileFacade, string TargetLibraryCodeName, string TargetLibraryDisplayName, KxpContext DbContext); +} diff --git a/KVA/Migration.Toolkit.Source/Services/ClassService.cs b/KVA/Migration.Toolkit.Source/Services/ClassService.cs index b238f912..7e4bcc3f 100644 --- a/KVA/Migration.Toolkit.Source/Services/ClassService.cs +++ b/KVA/Migration.Toolkit.Source/Services/ClassService.cs @@ -1,32 +1,32 @@ -namespace Migration.Toolkit.Source.Services; - -using System.Collections.Concurrent; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Source.Model; - -public class ClassService(ILogger logger, ModelFacade modelFacade) -{ - private readonly ConcurrentDictionary _userControlsCache = new(StringComparer.InvariantCultureIgnoreCase); - public ICmsFormUserControl? GetFormControlDefinition(string userControlCodeName) - { - return _userControlsCache.GetOrAdd(userControlCodeName, s => - { - try - { - var cmsFormUserControl = modelFacade.SelectWhere( - "UserControlCodeName = @userControlCodeName", - new SqlParameter("userControlCodeName", userControlCodeName) - ).SingleOrDefault(); - - return cmsFormUserControl; - } - catch (Exception ex) - { - logger.LogError("Error while retrieving FormUserControl with codename {CodeName}", s); - } - - return null; - }); - } -} \ No newline at end of file +using System.Collections.Concurrent; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Services; + +public class ClassService(ILogger logger, ModelFacade modelFacade) +{ + private readonly ConcurrentDictionary userControlsCache = new(StringComparer.InvariantCultureIgnoreCase); + + public ICmsFormUserControl? GetFormControlDefinition(string userControlCodeName) => userControlsCache.GetOrAdd(userControlCodeName, s => + { + try + { + var cmsFormUserControl = modelFacade.SelectWhere( + "UserControlCodeName = @userControlCodeName", + new SqlParameter("userControlCodeName", userControlCodeName) + ).SingleOrDefault(); + + return cmsFormUserControl; + } + catch (Exception ex) + { + logger.LogError("Error while retrieving FormUserControl with codename {CodeName}", s); + } + + return null; + }); +} diff --git a/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs b/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs index 5a445389..21e8de7c 100644 --- a/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs +++ b/KVA/Migration.Toolkit.Source/Services/CmsRelationshipService.cs @@ -1,31 +1,32 @@ -namespace Migration.Toolkit.Source.Services; - -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Source.Model; - -public class CmsRelationshipService( - ModelFacade modelFacade) -{ - public record NodeRelationShipResult(ICmsRelationship Relationship, ICmsTree? RightNode); - public IEnumerable GetNodeRelationships(int nodeId, string className, Guid fieldGuid) - { - var relationshipName = $"{className}_{fieldGuid}"; - var relationships = modelFacade.SelectWhere(""" - LeftNodeId = @nodeId AND - EXISTS( - SELECT 1 FROM CMS_RelationshipName - WHERE CMS_Relationship.RelationshipNameID = CMS_RelationshipName.RelationshipNameID AND - RelationshipName = @relationshipName - ) - """, - new SqlParameter("nodeId", nodeId), - new SqlParameter("relationshipName", relationshipName) - ); - - foreach (var cmsRelationship in relationships) - { - yield return new(cmsRelationship, modelFacade.SelectById(cmsRelationship.RightNodeID)); - } - } -} \ No newline at end of file +using Microsoft.Data.SqlClient; + +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Services; + +public class CmsRelationshipService( + ModelFacade modelFacade) +{ + public IEnumerable GetNodeRelationships(int nodeId, string className, Guid fieldGuid) + { + string relationshipName = $"{className}_{fieldGuid}"; + var relationships = modelFacade.SelectWhere(""" + LeftNodeId = @nodeId AND + EXISTS( + SELECT 1 FROM CMS_RelationshipName + WHERE CMS_Relationship.RelationshipNameID = CMS_RelationshipName.RelationshipNameID AND + RelationshipName = @relationshipName + ) + """, + new SqlParameter("nodeId", nodeId), + new SqlParameter("relationshipName", relationshipName) + ); + + foreach (var cmsRelationship in relationships) + { + yield return new NodeRelationShipResult(cmsRelationship, modelFacade.SelectById(cmsRelationship.RightNodeID)); + } + } + + public record NodeRelationShipResult(ICmsRelationship Relationship, ICmsTree? RightNode); +} diff --git a/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs b/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs index 062e447a..281bf51c 100644 --- a/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs +++ b/KVA/Migration.Toolkit.Source/Services/DeferredPathService.cs @@ -1,18 +1,12 @@ -namespace Migration.Toolkit.Source.Services; - -public class DeferredPathService -{ - public record DeferredWidgetPatch(Guid UniqueId, string ClassName, int WebSiteChannelId); - private readonly List _deferredWidgetPatch = new(); - - - public IEnumerable GetWidgetsToPatch() - { - return _deferredWidgetPatch.ToList(); - } - - public void AddPatch(Guid uniqueId, string className, int webSiteChannelId) - { - _deferredWidgetPatch.Add(new(uniqueId, className, webSiteChannelId)); - } -} \ No newline at end of file +namespace Migration.Toolkit.Source.Services; + +public class DeferredPathService +{ + private readonly List deferredWidgetPatch = []; + + public IEnumerable GetWidgetsToPatch() => deferredWidgetPatch.ToList(); + + public void AddPatch(Guid uniqueId, string className, int webSiteChannelId) => deferredWidgetPatch.Add(new DeferredWidgetPatch(uniqueId, className, webSiteChannelId)); + + public record DeferredWidgetPatch(Guid UniqueId, string ClassName, int WebSiteChannelId); +} diff --git a/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs b/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs index d0b0d363..b48944a2 100644 --- a/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs +++ b/KVA/Migration.Toolkit.Source/Services/IPrimaryKeyLocatorService.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Source.Services; - -using System.Linq.Expressions; - -public record SourceTargetKeyMapping(int SourceId, int TargetId); - -public interface IPrimaryKeyLocatorService -{ - bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); - IEnumerable SelectAll(Expression> keyNameSelector); -} \ No newline at end of file +using System.Linq.Expressions; + +namespace Migration.Toolkit.Source.Services; + +public record SourceTargetKeyMapping(int SourceId, int TargetId); + +public interface IPrimaryKeyLocatorService +{ + bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); + IEnumerable SelectAll(Expression> keyNameSelector); +} diff --git a/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs b/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs index d97e8b56..3951a5d9 100644 --- a/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs +++ b/KVA/Migration.Toolkit.Source/Services/Model/AttachmentSelectorItem.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Source.Services.Model; - -using Newtonsoft.Json; - -/// Represents an item for the attachment selector. -public class AttachmentSelectorItem -{ - /// Attachment GUID. - [JsonProperty("fileGuid")] - public Guid FileGuid { get; set; } -} \ No newline at end of file +using Newtonsoft.Json; + +namespace Migration.Toolkit.Source.Services.Model; + +/// Represents an item for the attachment selector. +public class AttachmentSelectorItem +{ + /// Attachment GUID. + [JsonProperty("fileGuid")] + public Guid FileGuid { get; set; } +} diff --git a/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs b/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs index 038a232a..0f789398 100644 --- a/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs +++ b/KVA/Migration.Toolkit.Source/Services/Model/EditableAreasConfiguration.cs @@ -1,186 +1,192 @@ -namespace Migration.Toolkit.Source.Services.Model; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -#region Copied from Kentico assembly - -[DataContract(Name = "Configuration", Namespace = "")] -public sealed class EditableAreasConfiguration -{ - /// Editable areas within the page. - [DataMember] - [JsonProperty("editableAreas")] - public List EditableAreas { get; private set; } - - /// - /// Creates an instance of class. - /// - public EditableAreasConfiguration() => this.EditableAreas = new List(); -} - -/// -/// Represents configuration of editable area within the instance. -/// -[DataContract(Name = "EditableArea", Namespace = "")] -public sealed class EditableAreaConfiguration -{ - /// Identifier of the editable area. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// Sections within editable area. - [DataMember] - [JsonProperty("sections")] - public List Sections { get; private set; } - - /// - /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. - /// - public bool AllowWidgetOutputCache { get; set; } - - /// - /// An absolute expiration date for the cached output of the individual widgets. - /// - public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } - - /// - /// The length of time from the first request to cache the output of the individual widgets. - /// - public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } - - /// - /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. - /// - public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } - - /// - /// Creates an instance of class. - /// - public EditableAreaConfiguration() => this.Sections = new List(); -} - -/// -/// Represents configuration of section within the instance. -/// -[DataContract(Name = "Section", Namespace = "")] -public sealed class SectionConfiguration -{ - /// Identifier of the section. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type section identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Section properties. - [DataMember] - [JsonProperty("properties")] - // public ISectionProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Zones within the section. - [DataMember] - [JsonProperty("zones")] - public List Zones { get; private set; } - - /// - /// Creates an instance of class. - /// - public SectionConfiguration() => this.Zones = new List(); -} - -/// -/// Represents the zone within the configuration class. -/// -[DataContract(Name = "Zone", Namespace = "")] -public sealed class ZoneConfiguration -{ - /// Identifier of the widget zone. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Name of the widget zone. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// List of widgets within the zone. - [DataMember] - [JsonProperty("widgets")] - public List Widgets { get; private set; } - - /// - /// Creates an instance of class. - /// - public ZoneConfiguration() => this.Widgets = new List(); -} - -/// -/// Represents the configuration of a widget within the list. -/// -[DataContract(Name = "Widget", Namespace = "")] -public sealed class WidgetConfiguration -{ - /// Identifier of the widget instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type widget identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Personalization condition type identifier. - [DataMember] - [JsonProperty("conditionType")] - public string PersonalizationConditionTypeIdentifier { get; set; } - - /// List of widget variants. - [DataMember] - [JsonProperty("variants")] - public List Variants { get; set; } - - /// - /// Creates an instance of class. - /// - public WidgetConfiguration() => this.Variants = new List(); -} - -/// -/// Represents the configuration variant of a widget within the list. -/// -[DataContract(Name = "Variant", Namespace = "")] -public sealed class WidgetVariantConfiguration -{ - /// Identifier of the variant instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Widget variant name. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// Widget variant properties. - [DataMember] - [JsonProperty("properties")] - // public IWidgetProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Widget variant personalization condition type. - /// Only personalization condition type parameters are serialized to JSON. - [DataMember] - [JsonProperty("conditionTypeParameters")] - public JObject PersonalizationConditionType { get; set; } -} - -#endregion \ No newline at end of file +using System.Runtime.Serialization; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Migration.Toolkit.Source.Services.Model; + +#region Copied from Kentico assembly + +[DataContract(Name = "Configuration", Namespace = "")] +public sealed class EditableAreasConfiguration +{ + /// + /// Creates an instance of class. + /// + public EditableAreasConfiguration() => EditableAreas = []; + + /// Editable areas within the page. + [DataMember] + [JsonProperty("editableAreas")] + public List EditableAreas { get; private set; } +} + +/// +/// Represents configuration of editable area within the instance. +/// +[DataContract(Name = "EditableArea", Namespace = "")] +public sealed class EditableAreaConfiguration +{ + /// + /// Creates an instance of class. + /// + public EditableAreaConfiguration() => Sections = []; + + /// Identifier of the editable area. + [DataMember] + [JsonProperty("identifier")] + public string Identifier { get; set; } + + /// Sections within editable area. + [DataMember] + [JsonProperty("sections")] + public List Sections { get; private set; } + + /// + /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default + /// value is false. + /// + public bool AllowWidgetOutputCache { get; set; } + + /// + /// An absolute expiration date for the cached output of the individual widgets. + /// + public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } + + /// + /// The length of time from the first request to cache the output of the individual widgets. + /// + public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } + + /// + /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. + /// + public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } +} + +/// +/// Represents configuration of section within the +/// instance. +/// +[DataContract(Name = "Section", Namespace = "")] +public sealed class SectionConfiguration +{ + /// + /// Creates an instance of class. + /// + public SectionConfiguration() => Zones = []; + + /// Identifier of the section. + [DataMember] + [JsonProperty("identifier")] + public Guid Identifier { get; set; } + + /// Type section identifier. + [DataMember] + [JsonProperty("type")] + public string TypeIdentifier { get; set; } + + /// Section properties. + [DataMember] + [JsonProperty("properties")] + // public ISectionProperties Properties { get; set; } + public JObject Properties { get; set; } + + /// Zones within the section. + [DataMember] + [JsonProperty("zones")] + public List Zones { get; private set; } +} + +/// +/// Represents the zone within the +/// configuration class. +/// +[DataContract(Name = "Zone", Namespace = "")] +public sealed class ZoneConfiguration +{ + /// + /// Creates an instance of class. + /// + public ZoneConfiguration() => Widgets = []; + + /// Identifier of the widget zone. + [DataMember] + [JsonProperty("identifier")] + public Guid Identifier { get; set; } + + /// Name of the widget zone. + [DataMember] + [JsonProperty("name")] + public string Name { get; set; } + + /// List of widgets within the zone. + [DataMember] + [JsonProperty("widgets")] + public List Widgets { get; private set; } +} + +/// +/// Represents the configuration of a widget within the +/// list. +/// +[DataContract(Name = "Widget", Namespace = "")] +public sealed class WidgetConfiguration +{ + /// + /// Creates an instance of class. + /// + public WidgetConfiguration() => Variants = []; + + /// Identifier of the widget instance. + [DataMember] + [JsonProperty("identifier")] + public Guid Identifier { get; set; } + + /// Type widget identifier. + [DataMember] + [JsonProperty("type")] + public string TypeIdentifier { get; set; } + + /// Personalization condition type identifier. + [DataMember] + [JsonProperty("conditionType")] + public string PersonalizationConditionTypeIdentifier { get; set; } + + /// List of widget variants. + [DataMember] + [JsonProperty("variants")] + public List Variants { get; set; } +} + +/// +/// Represents the configuration variant of a widget within the +/// list. +/// +[DataContract(Name = "Variant", Namespace = "")] +public sealed class WidgetVariantConfiguration +{ + /// Identifier of the variant instance. + [DataMember] + [JsonProperty("identifier")] + public Guid Identifier { get; set; } + + /// Widget variant name. + [DataMember] + [JsonProperty("name")] + public string Name { get; set; } + + /// Widget variant properties. + [DataMember] + [JsonProperty("properties")] + // public IWidgetProperties Properties { get; set; } + public JObject Properties { get; set; } + + /// Widget variant personalization condition type. + /// Only personalization condition type parameters are serialized to JSON. + [DataMember] + [JsonProperty("conditionTypeParameters")] + public JObject PersonalizationConditionType { get; set; } +} + +#endregion diff --git a/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs b/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs index 47846270..25c44f01 100644 --- a/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs +++ b/KVA/Migration.Toolkit.Source/Services/Model/PageSelectorItem.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Source.Services.Model; - -using Newtonsoft.Json; - -/// Represents an item for a page selector. -public class PageSelectorItem -{ - /// Node Guid of a page. - [JsonProperty("nodeGuid")] - public Guid NodeGuid { get; set; } -} \ No newline at end of file +using Newtonsoft.Json; + +namespace Migration.Toolkit.Source.Services.Model; + +/// Represents an item for a page selector. +public class PageSelectorItem +{ + /// Node Guid of a page. + [JsonProperty("nodeGuid")] + public Guid NodeGuid { get; set; } +} diff --git a/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs b/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs index c44216ca..0ab5cc46 100644 --- a/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs +++ b/KVA/Migration.Toolkit.Source/Services/Model/PageTemplateConfiguration.cs @@ -1,29 +1,30 @@ -namespace Migration.Toolkit.Source.Services.Model; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -/// -/// Page template configuration for the instance. -/// -[DataContract(Name = "PageTemplate", Namespace = "")] -public class PageTemplateConfiguration -{ - /// Identifier of the page template. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// - /// Identifier of the page template configuration based on which the page was created. - /// - [DataMember] - [JsonProperty("configurationIdentifier")] - public Guid ConfigurationIdentifier { get; set; } - - /// Page template properties. - [DataMember] - [JsonProperty("properties")] - public JObject Properties { get; set; } -} \ No newline at end of file +using System.Runtime.Serialization; + +using Newtonsoft.Json; +using Newtonsoft.Json.Linq; + +namespace Migration.Toolkit.Source.Services.Model; + +/// +/// Page template configuration for the instance. +/// +[DataContract(Name = "PageTemplate", Namespace = "")] +public class PageTemplateConfiguration +{ + /// Identifier of the page template. + [DataMember] + [JsonProperty("identifier")] + public string Identifier { get; set; } + + /// + /// Identifier of the page template configuration based on which the page was created. + /// + [DataMember] + [JsonProperty("configurationIdentifier")] + public Guid ConfigurationIdentifier { get; set; } + + /// Page template properties. + [DataMember] + [JsonProperty("properties")] + public JObject Properties { get; set; } +} diff --git a/KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs b/KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs index 3154b4b6..73bdd520 100644 --- a/KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs +++ b/KVA/Migration.Toolkit.Source/Services/ModuleLoader.cs @@ -1,35 +1,35 @@ -namespace Migration.Toolkit.Source.Services; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.Source.Contexts; - -public class ModuleLoader( - IpcService ipc, - SourceInstanceContext sourceInstanceContext, - ILogger logger -) - : IModuleLoader -{ - public async Task LoadAsync() - { - try - { - if (sourceInstanceContext.IsQuerySourceInstanceEnabled()) - { - var ipcConfigured = await ipc.IsConfiguredAsync(); - if (ipcConfigured) - { - await sourceInstanceContext.RequestSourceInstanceInfo(); - } - } - } - catch (Exception ex) - { - logger.LogCritical(ex, "Check if opt-in feature 'QuerySourceInstanceApi' is configured correctly and all connections configured are reachable and hosted on localhost"); - throw; - } - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Services.Ipc; +using Migration.Toolkit.Source.Contexts; + +namespace Migration.Toolkit.Source.Services; + +public class ModuleLoader( + IpcService ipc, + SourceInstanceContext sourceInstanceContext, + ILogger logger +) + : IModuleLoader +{ + public async Task LoadAsync() + { + try + { + if (sourceInstanceContext.IsQuerySourceInstanceEnabled()) + { + bool ipcConfigured = await ipc.IsConfiguredAsync(); + if (ipcConfigured) + { + await sourceInstanceContext.RequestSourceInstanceInfo(); + } + } + } + catch (Exception ex) + { + logger.LogCritical(ex, "Check if opt-in feature 'QuerySourceInstanceApi' is configured correctly and all connections configured are reachable and hosted on localhost"); + throw; + } + } +} diff --git a/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs b/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs index cb6e4332..6a9e1791 100644 --- a/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs +++ b/KVA/Migration.Toolkit.Source/Services/PageTemplateMigrator.cs @@ -1,54 +1,50 @@ -namespace Migration.Toolkit.Source.Services; - -using CMS.DataEngine; -using CMS.Websites; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Source.Model; - -public class PageTemplateMigrator( - ILogger logger, - IEntityMapper pageTemplateConfigurationMapper, - IProtocol protocol) -{ - public Task MigratePageTemplateConfigurationAsync(ICmsPageTemplateConfiguration ksPageTemplateConfiguration) - { - if (ksPageTemplateConfiguration is ICmsPageTemplateConfigurationK12K13 pageTemplateConfiguration) - { - var kxpProvider = Provider.Instance; - var kxpPageTemplateConfiguration = kxpProvider.Get().WhereEquals("PageTemplateConfigurationGUID", pageTemplateConfiguration.PageTemplateConfigurationGUID).FirstOrDefault(); - - var mapped = pageTemplateConfigurationMapper.Map(ksPageTemplateConfiguration, kxpPageTemplateConfiguration); - - if (mapped is { Success: true, Item: { } result }) - { - try - { - kxpProvider.Set(result); - - protocol.Success(ksPageTemplateConfiguration, result, null); - } - catch (Exception exception) - { - logger.LogError(exception, "Failed to create target instance of PageTemplateConfiguration"); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithData(new - { - exception, - SourcePageTemplateConfigurationGuid = pageTemplateConfiguration.PageTemplateConfigurationGUID, - SourcePageTemplateConfigurationName = pageTemplateConfiguration.PageTemplateConfigurationName - }) - ); - } - } - return Task.CompletedTask; - } - else - { - return Task.CompletedTask; - } - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.Websites; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Services; + +public class PageTemplateMigrator( + ILogger logger, + IEntityMapper pageTemplateConfigurationMapper, + IProtocol protocol) +{ + public Task MigratePageTemplateConfigurationAsync(ICmsPageTemplateConfiguration ksPageTemplateConfiguration) + { + if (ksPageTemplateConfiguration is ICmsPageTemplateConfigurationK12K13 pageTemplateConfiguration) + { + var kxpProvider = Provider.Instance; + var kxpPageTemplateConfiguration = kxpProvider.Get().WhereEquals("PageTemplateConfigurationGUID", pageTemplateConfiguration.PageTemplateConfigurationGUID).FirstOrDefault(); + + var mapped = pageTemplateConfigurationMapper.Map(ksPageTemplateConfiguration, kxpPageTemplateConfiguration); + + if (mapped is { Success: true, Item: { } result }) + { + try + { + kxpProvider.Set(result); + + protocol.Success(ksPageTemplateConfiguration, result, null); + } + catch (Exception exception) + { + logger.LogError(exception, "Failed to create target instance of PageTemplateConfiguration"); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithData(new { exception, SourcePageTemplateConfigurationGuid = pageTemplateConfiguration.PageTemplateConfigurationGUID, SourcePageTemplateConfigurationName = pageTemplateConfiguration.PageTemplateConfigurationName }) + ); + } + } + + return Task.CompletedTask; + } + + return Task.CompletedTask; + } +} diff --git a/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs b/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs index 44afce0b..99102890 100644 --- a/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs +++ b/KVA/Migration.Toolkit.Source/Services/PrimaryKeyLocatorService.cs @@ -1,249 +1,217 @@ -namespace Migration.Toolkit.Source.Services; - -using System.Linq.Expressions; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.Source.Model; - -public class PrimaryKeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - ModelFacade modelFacade - ) : IPrimaryKeyLocatorService -{ - private class KeyEqualityComparerWithLambda : IEqualityComparer - { - private readonly Func _equalityComparer; - - public KeyEqualityComparerWithLambda(Func equalityComparer) - { - _equalityComparer = equalityComparer; - } - - public bool Equals(T? x, T? y) => _equalityComparer.Invoke(x, y); - - public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; - } - - private record CmsUserKey(Guid UserGuid, string UserName); - - public IEnumerable SelectAll(Expression> keyNameSelector) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - var memberName = keyNameSelector.GetMemberName(); - - logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); - - if (sourceType == typeof(ICmsUser) && memberName == nameof(ICmsUser.UserID)) - { - var sourceUsers = modelFacade.SelectAll().ToList(); - var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); - - var result = sourceUsers.Join(targetUsers, - a => new CmsUserKey(a.UserGUID, a.UserName), - b => new CmsUserKey(b.UserGuid, b.UserName), - (a, b) => new SourceTargetKeyMapping(a.UserID, b.UserId), - new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(IOmContact) && memberName == nameof(IOmContact.ContactID)) - { - var source = modelFacade.SelectAll() - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactID, x.ContactGUID }).ToList(); - var target = kxpContext.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - - var result = source.Join(target, - a => a.ContactGUID, - b => b.ContactGuid, - (a, b) => new SourceTargetKeyMapping(a.ContactID, b.ContactId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(ICmsTree) && memberName == nameof(ICmsTree.NodeID)) - { - var source = modelFacade.SelectAll().Select(x => new { x.NodeID, x.NodeGUID }).ToList(); - var target = kxpContext.CmsChannels.Select(x => new { x.ChannelId, x.ChannelGuid }).ToList(); - - var result = source.Join(target, - a => a.NodeGUID, - b => b.ChannelGuid, - (a, b) => new SourceTargetKeyMapping(a.NodeID, b.ChannelId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(ICmsState) && memberName == nameof(ICmsState.StateID)) - { - var source = modelFacade.SelectAll().Select(x => new { x.StateID, x.StateName }).ToList(); - var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - - var result = source.Join(target, - a => a.StateName, - b => b.StateName, - (a, b) => new SourceTargetKeyMapping(a.StateID, b.StateId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(ICmsCountry) && memberName == nameof(ICmsCountry.CountryID)) - { - var source = modelFacade.SelectAll().Select(x => new { x.CountryID, x.CountryName }).ToList(); - var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - - var result = source.Join(target, - a => a.CountryName, - b => b.CountryName, - (a, b) => new SourceTargetKeyMapping(a.CountryID, b.CountryId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - - - throw new NotImplementedException(); - } - - public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - targetId = -1; - try - { - if (sourceType == typeof(ICmsResource)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.ResourceGUID; - targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == sourceGuid).Select(x => x.ResourceId).Single(); - return true; - } - - if (sourceType == typeof(ICmsClass)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.ClassGUID; - targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == sourceGuid).Select(x => x.ClassId).Single(); - return true; - } - - if (sourceType == typeof(ICmsUser)) - { - var source = modelFacade.SelectById(sourceId); - targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == source.UserGUID || x.UserName == source.UserName).Select(x => x.UserId).Single(); - return true; - } - - if (sourceType == typeof(ICmsRole)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.RoleGUID; - targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == sourceGuid).Select(x => x.RoleId).Single(); - return true; - } - - if (sourceType == typeof(ICmsSite)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.SiteGUID; - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == sourceGuid).Select(x => x.ChannelId).Single(); - return true; - } - - if (sourceType == typeof(ICmsState)) - { - var sourceName = modelFacade.SelectById(sourceId)?.StateName; - targetId = kxpContext.CmsStates.Where(x => x.StateName == sourceName).Select(x => x.StateId).Single(); - return true; - } - - if (sourceType == typeof(ICmsCountry)) - { - var sourceName = modelFacade.SelectById(sourceId)?.CountryName; - targetId = kxpContext.CmsCountries.Where(x => x.CountryName == sourceName).Select(x => x.CountryId).Single(); - return true; - } - - if (sourceType == typeof(IOmContactStatus)) - { - var sourceName = modelFacade.SelectById(sourceId)?.ContactStatusName; - targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == sourceName).Select(x => x.ContactStatusId).Single(); - return true; - } - - if (sourceType == typeof(IOmContact)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.ContactGUID; - targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == sourceGuid).Select(x => x.ContactId).Single(); - return true; - } - - if (sourceType == typeof(ICmsTree)) - { - var sourceGuid = modelFacade.SelectById(sourceId)?.NodeGUID; - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == sourceGuid).Select(x => x.ChannelId).Single(); - return true; - } - } - catch (InvalidOperationException ioex) - { - if (ioex.Message.StartsWith("Sequence contains no elements")) - { - logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - else - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - return false; - } - finally - { - if (targetId != -1) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); - } - } - - logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); - targetId = -1; - return false; - } -} \ No newline at end of file +using System.Linq.Expressions; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Services; + +public class PrimaryKeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + ModelFacade modelFacade +) : IPrimaryKeyLocatorService +{ + public IEnumerable SelectAll(Expression> keyNameSelector) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + string memberName = keyNameSelector.GetMemberName(); + + logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); + + if (sourceType == typeof(ICmsUser) && memberName == nameof(ICmsUser.UserID)) + { + var sourceUsers = modelFacade.SelectAll().ToList(); + var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); + + var result = sourceUsers.Join(targetUsers, + a => new CmsUserKey(a.UserGUID, a.UserName), + b => new CmsUserKey(b.UserGuid, b.UserName), + (a, b) => new SourceTargetKeyMapping(a.UserID, b.UserId), + new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(IOmContact) && memberName == nameof(IOmContact.ContactID)) + { + var source = modelFacade.SelectAll() + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactID, x.ContactGUID }).ToList(); + var target = kxpContext.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + + var result = source.Join(target, + a => a.ContactGUID, + b => b.ContactGuid, + (a, b) => new SourceTargetKeyMapping(a.ContactID, b.ContactId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(ICmsState) && memberName == nameof(ICmsState.StateID)) + { + var source = modelFacade.SelectAll().Select(x => new { x.StateID, x.StateName }).ToList(); + var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + + var result = source.Join(target, + a => a.StateName, + b => b.StateName, + (a, b) => new SourceTargetKeyMapping(a.StateID, b.StateId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(ICmsCountry) && memberName == nameof(ICmsCountry.CountryID)) + { + var source = modelFacade.SelectAll().Select(x => new { x.CountryID, x.CountryName }).ToList(); + var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + + var result = source.Join(target, + a => a.CountryName, + b => b.CountryName, + (a, b) => new SourceTargetKeyMapping(a.CountryID, b.CountryId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + + throw new NotImplementedException(); + } + + public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + targetId = -1; + try + { + if (sourceType == typeof(ICmsResource)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.ResourceGUID; + targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == sourceGuid).Select(x => x.ResourceId).Single(); + return true; + } + + if (sourceType == typeof(ICmsClass)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.ClassGUID; + targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == sourceGuid).Select(x => x.ClassId).Single(); + return true; + } + + if (sourceType == typeof(ICmsUser)) + { + var source = modelFacade.SelectById(sourceId); + targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == source.UserGUID || x.UserName == source.UserName).Select(x => x.UserId).Single(); + return true; + } + + if (sourceType == typeof(ICmsRole)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.RoleGUID; + targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == sourceGuid).Select(x => x.RoleId).Single(); + return true; + } + + if (sourceType == typeof(ICmsSite)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.SiteGUID; + targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == sourceGuid).Select(x => x.ChannelId).Single(); + return true; + } + + if (sourceType == typeof(ICmsState)) + { + string? sourceName = modelFacade.SelectById(sourceId)?.StateName; + targetId = kxpContext.CmsStates.Where(x => x.StateName == sourceName).Select(x => x.StateId).Single(); + return true; + } + + if (sourceType == typeof(ICmsCountry)) + { + string? sourceName = modelFacade.SelectById(sourceId)?.CountryName; + targetId = kxpContext.CmsCountries.Where(x => x.CountryName == sourceName).Select(x => x.CountryId).Single(); + return true; + } + + if (sourceType == typeof(IOmContactStatus)) + { + string? sourceName = modelFacade.SelectById(sourceId)?.ContactStatusName; + targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == sourceName).Select(x => x.ContactStatusId).Single(); + return true; + } + + if (sourceType == typeof(IOmContact)) + { + var sourceGuid = modelFacade.SelectById(sourceId)?.ContactGUID; + targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == sourceGuid).Select(x => x.ContactId).Single(); + return true; + } + } + catch (InvalidOperationException ioex) + { + if (ioex.Message.StartsWith("Sequence contains no elements")) + { + logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + else + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + + return false; + } + finally + { + if (targetId != -1) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); + } + } + + logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); + targetId = -1; + return false; + } + + private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer + { + public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); + + public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; + } + + private record CmsUserKey(Guid UserGuid, string UserName); +} diff --git a/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs b/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs index e2cdf445..384d5f92 100644 --- a/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs +++ b/KVA/Migration.Toolkit.Source/Services/ReusableSchemaService.cs @@ -1,135 +1,130 @@ -namespace Migration.Toolkit.Source.Services; - -using CMS.ContentEngine.Internal; -using CMS.Core; -using CMS.DataEngine; -using CMS.FormEngine; -using Kentico.Xperience.Admin.Base.UIPages; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Helpers; - -public class ReusableSchemaService(ILogger logger, ToolkitConfiguration configuration) -{ - private readonly IReusableFieldSchemaManager _reusableFieldSchemaManager = Service.Resolve(); - - public bool IsConversionToReusableFieldSchemaRequested(string className) - { - return configuration.ClassNamesCreateReusableSchema.Contains(className); - } - - public DataClassInfo ConvertToReusableSchema(DataClassInfo kxoDataClass) - { - var reusableSchemaGuid = GuidHelper.CreateReusableSchemaGuid($"{kxoDataClass.ClassName}|{kxoDataClass.ClassGUID}"); - var schema = _reusableFieldSchemaManager.Get(reusableSchemaGuid); - if (schema == null) - { - _reusableFieldSchemaManager.CreateSchema(new CreateReusableFieldSchemaParameters(kxoDataClass.ClassName, kxoDataClass.ClassDisplayName) { Guid = reusableSchemaGuid }); - } - - var formInfo = new FormInfo(kxoDataClass.ClassFormDefinition); - var fieldsForRem = new List(); - foreach (var formFieldInfo in formInfo.GetFields(true, true)) - { - if (formFieldInfo is { PrimaryKey: false, System: false }) - { - var success = false; - try - { - try - { - formFieldInfo.Name = GetUniqueFieldName(kxoDataClass.ClassName, formFieldInfo.Name); - _reusableFieldSchemaManager.AddField(kxoDataClass.ClassName, formFieldInfo); - success = true; - } - catch (InvalidOperationException ioex) when (ioex.Message.Contains("already exist on reusable field schema")) - { - // exists - we do not support update of reusable field schema - // _reusableFieldSchemaManager.UpdateField(kxoDataClass.ClassName, formFieldInfo.Name, formFieldInfo); - success = true; - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to convert field {Name} for reusable schema: {FormFieldInfo}", formFieldInfo.Name, formFieldInfo.ToString()); - } - - if (success) - { - fieldsForRem.Add(formFieldInfo); - } - } - } - - foreach (var formFieldInfo in fieldsForRem) - { - formInfo.RemoveFormField(formFieldInfo.Name); - } - - formInfo.AddFormItem(new FormSchemaInfo { Name = kxoDataClass.ClassName, Guid = reusableSchemaGuid }); - kxoDataClass.ClassFormDefinition = formInfo.GetXmlDefinition(); - return kxoDataClass; - } - - public bool HasClassReusableSchema(DataClassInfo dataClassInfo, Guid reusableFieldSchemaGuid) - { - var formInfo = new FormInfo(dataClassInfo.ClassFormDefinition); - return formInfo - .GetFields() - .Any(x => x.Guid.Equals(reusableFieldSchemaGuid)); - } - - public void AddReusableSchemaToDataClass(DataClassInfo dataClassInfo, Guid reusableFieldSchemaGuid) - { - var formInfo = new FormInfo(dataClassInfo.ClassFormDefinition); - formInfo.AddFormItem(new FormSchemaInfo { Name = dataClassInfo.ClassName, Guid = reusableFieldSchemaGuid }); - dataClassInfo.ClassFormDefinition = formInfo.GetXmlDefinition(); - } - - public Guid EnsureReusableFieldSchema(string name, string displayName, string description, params FormFieldInfo[] fields) - { - var reusableSchemaGuid = GuidHelper.CreateReusableSchemaGuid($"{name}|{displayName}"); - var schema = _reusableFieldSchemaManager.Get(reusableSchemaGuid); - if (schema == null) - { - _reusableFieldSchemaManager.CreateSchema(new CreateReusableFieldSchemaParameters(name, displayName, description) { Guid = reusableSchemaGuid }); - } - - foreach (var formFieldInfo in fields) - { - if (formFieldInfo is { PrimaryKey: false, System: false }) - { - try - { - try - { - _reusableFieldSchemaManager.AddField(name, formFieldInfo); - } - catch (InvalidOperationException ioex) when (ioex.Message.Contains("already exist on reusable field schema")) - { - // exists - we do not support update of reusable field schema - // _reusableFieldSchemaManager.UpdateField(kxoDataClass.ClassName, formFieldInfo.Name, formFieldInfo); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to convert field {Name} for reusable schema: {FormFieldInfo}", formFieldInfo.Name, formFieldInfo.ToString()); - } - } - else - { - throw new InvalidOperationException("Unable to add field to reusable schema, field is primary key or system"); - } - } - - return reusableSchemaGuid; - } - - public static string GetUniqueFieldName(string className, string fieldName) - { - return $"{className}__{fieldName}".Replace(".", "_"); - } - - public static string RemoveClassPrefix(string className, string schemaFieldName) - => schemaFieldName.Replace($"{className}__".Replace(".", "_"), ""); -} \ No newline at end of file +using CMS.ContentEngine.Internal; +using CMS.Core; +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Helpers; + +namespace Migration.Toolkit.Source.Services; + +public class ReusableSchemaService(ILogger logger, ToolkitConfiguration configuration) +{ + private readonly IReusableFieldSchemaManager reusableFieldSchemaManager = Service.Resolve(); + + public bool IsConversionToReusableFieldSchemaRequested(string className) => configuration.ClassNamesCreateReusableSchema.Contains(className); + + public DataClassInfo ConvertToReusableSchema(DataClassInfo kxoDataClass) + { + var reusableSchemaGuid = GuidHelper.CreateReusableSchemaGuid($"{kxoDataClass.ClassName}|{kxoDataClass.ClassGUID}"); + var schema = reusableFieldSchemaManager.Get(reusableSchemaGuid); + if (schema == null) + { + reusableFieldSchemaManager.CreateSchema(new CreateReusableFieldSchemaParameters(kxoDataClass.ClassName, kxoDataClass.ClassDisplayName) { Guid = reusableSchemaGuid }); + } + + var formInfo = new FormInfo(kxoDataClass.ClassFormDefinition); + var fieldsForRem = new List(); + foreach (var formFieldInfo in formInfo.GetFields(true, true)) + { + if (formFieldInfo is { PrimaryKey: false, System: false }) + { + bool success = false; + try + { + try + { + formFieldInfo.Name = GetUniqueFieldName(kxoDataClass.ClassName, formFieldInfo.Name); + reusableFieldSchemaManager.AddField(kxoDataClass.ClassName, formFieldInfo); + success = true; + } + catch (InvalidOperationException ioex) when (ioex.Message.Contains("already exist on reusable field schema")) + { + // exists - we do not support update of reusable field schema + // _reusableFieldSchemaManager.UpdateField(kxoDataClass.ClassName, formFieldInfo.Name, formFieldInfo); + success = true; + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to convert field {Name} for reusable schema: {FormFieldInfo}", formFieldInfo.Name, formFieldInfo.ToString()); + } + + if (success) + { + fieldsForRem.Add(formFieldInfo); + } + } + } + + foreach (var formFieldInfo in fieldsForRem) + { + formInfo.RemoveFormField(formFieldInfo.Name); + } + + formInfo.AddFormItem(new FormSchemaInfo { Name = kxoDataClass.ClassName, Guid = reusableSchemaGuid }); + kxoDataClass.ClassFormDefinition = formInfo.GetXmlDefinition(); + return kxoDataClass; + } + + public bool HasClassReusableSchema(DataClassInfo dataClassInfo, Guid reusableFieldSchemaGuid) + { + var formInfo = new FormInfo(dataClassInfo.ClassFormDefinition); + return formInfo + .GetFields() + .Any(x => x.Guid.Equals(reusableFieldSchemaGuid)); + } + + public void AddReusableSchemaToDataClass(DataClassInfo dataClassInfo, Guid reusableFieldSchemaGuid) + { + var formInfo = new FormInfo(dataClassInfo.ClassFormDefinition); + formInfo.AddFormItem(new FormSchemaInfo { Name = dataClassInfo.ClassName, Guid = reusableFieldSchemaGuid }); + dataClassInfo.ClassFormDefinition = formInfo.GetXmlDefinition(); + } + + public Guid EnsureReusableFieldSchema(string name, string displayName, string description, params FormFieldInfo[] fields) + { + var reusableSchemaGuid = GuidHelper.CreateReusableSchemaGuid($"{name}|{displayName}"); + var schema = reusableFieldSchemaManager.Get(reusableSchemaGuid); + if (schema == null) + { + reusableFieldSchemaManager.CreateSchema(new CreateReusableFieldSchemaParameters(name, displayName, description) { Guid = reusableSchemaGuid }); + } + + foreach (var formFieldInfo in fields) + { + if (formFieldInfo is { PrimaryKey: false, System: false }) + { + try + { + try + { + reusableFieldSchemaManager.AddField(name, formFieldInfo); + } + catch (InvalidOperationException ioex) when (ioex.Message.Contains("already exist on reusable field schema")) + { + // exists - we do not support update of reusable field schema + // _reusableFieldSchemaManager.UpdateField(kxoDataClass.ClassName, formFieldInfo.Name, formFieldInfo); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to convert field {Name} for reusable schema: {FormFieldInfo}", formFieldInfo.Name, formFieldInfo.ToString()); + } + } + else + { + throw new InvalidOperationException("Unable to add field to reusable schema, field is primary key or system"); + } + } + + return reusableSchemaGuid; + } + + public static string GetUniqueFieldName(string className, string fieldName) => $"{className}__{fieldName}".Replace(".", "_"); + + public static string RemoveClassPrefix(string className, string schemaFieldName) + => schemaFieldName.Replace($"{className}__".Replace(".", "_"), ""); +} diff --git a/KVA/Migration.Toolkit.Source/Services/SpoiledGuidContext.cs b/KVA/Migration.Toolkit.Source/Services/SpoiledGuidContext.cs new file mode 100644 index 00000000..bef4de56 --- /dev/null +++ b/KVA/Migration.Toolkit.Source/Services/SpoiledGuidContext.cs @@ -0,0 +1,131 @@ +using System.Collections.Frozen; +using System.Collections.Immutable; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Source.Model; + +namespace Migration.Toolkit.Source.Services; + +/// +/// in cases where consumer exported site with documents and created new site with that particular export, GUID +/// conflicts will probably happen. This class aims to query and solve those conflicts +/// +/// +/// +public class SpoiledGuidContext(ModelFacade modelFacade, ILogger logger) : ISpoiledGuidContext +{ + private IDictionary>? spoiledDocumentGuids; + private IDictionary>? spoiledNodeGuids; + + internal IDictionary> SpoiledDocumentGuids => + spoiledDocumentGuids ??= modelFacade.Select(""" + SELECT DocumentGUID, STRING_AGG(CONCAT(NodeSiteID, '-', NodeID), '|') [SiteID-NodeID] + FROM View_CMS_Tree_Joined TJ + GROUP BY DocumentGUID + HAVING COUNT(DocumentID) > 1 + """, + (reader, version) => new { DocumentGUID = reader.Unbox("DocumentGuid"), Info = reader.Unbox("SiteID-NodeID") }) + .ToFrozenDictionary( + x => x.DocumentGUID, + x => x.Info.Split('|').Select(i => + { + string[] spl = i.Split('-'); + + return new SpoiledDocumentGuidInfo(int.Parse(spl[0]), int.Parse(spl[1])); + }).ToImmutableList() + ); + + internal IDictionary> SpoiledNodeGuids => + spoiledNodeGuids ??= modelFacade.Select(""" + SELECT NodeGUID, STRING_AGG(NodeSiteID, '|') [SiteID] + FROM View_CMS_Tree_Joined TJ + GROUP BY NodeGUID + HAVING COUNT(NodeGUID) > 1 + """, + (reader, version) => new { DocumentGUID = reader.Unbox("NodeGUID"), Info = reader.Unbox("SiteID") }) + .ToFrozenDictionary( + x => x.DocumentGUID, + x => x.Info.Split('|').Select(i => + { + string[] spl = i.Split('-'); + + return new SpoiledNodeGuidInfo(int.Parse(spl[0])); + }).ToImmutableList() + ); + + public Guid EnsureDocumentGuid(Guid documentGuid, int siteId, int nodeId, int documentId) + { + if (!SpoiledDocumentGuids.TryGetValue(documentGuid, out _)) + { + return documentGuid; + } + + var newGuid = GuidHelper.CreateDocumentGuid($"{documentId}|{nodeId}|{siteId}"); + logger.LogTrace("Spoiled document guid encountered '{OriginalGuid}', replaced by {NewGuid} {Details}", documentGuid, newGuid, new { siteId, nodeId, documentId }); + return newGuid; + } + + public Guid EnsureNodeGuid(Guid nodeGuid, int siteId, int nodeId) + { + if (!SpoiledNodeGuids.TryGetValue(nodeGuid, out _)) + { + return nodeGuid; + } + + var newGuid = GuidHelper.CreateNodeGuid($"{nodeId}|{siteId}"); + logger.LogTrace("Spoiled node guid encountered '{OriginalGuid}', replaced by {NewGuid} {Details}", nodeGuid, newGuid, new { siteId, nodeId }); + return newGuid; + } + + public Guid EnsureNodeGuid(Guid nodeGuid, int siteId) + { + if (!SpoiledNodeGuids.TryGetValue(nodeGuid, out _)) + { + return nodeGuid; + } + + int nodeId = modelFacade.Select(""" + SELECT NodeID FROM CMS_Tree WHERE NodeSiteID = @siteId AND NodeGUID = @nodeGuid + """, (reader, version) => reader.Unbox("NodeID"), + new SqlParameter("siteId", siteId), new SqlParameter("nodeGuid", nodeGuid) + ).Single(); + + var newGuid = GuidHelper.CreateNodeGuid($"{nodeId}|{siteId}"); + logger.LogTrace("Spoiled node guid encountered '{OriginalGuid}', replaced by {NewGuid} {Details}", nodeGuid, newGuid, new { siteId, nodeId }); + return newGuid; + } + + public Guid? GetNodeGuid(int nodeId, int siteId) + { + var nodeGuid = modelFacade.Select(""" + SELECT NodeGUID FROM CMS_Tree WHERE NodeSiteID = @siteId AND NodeId = @nodeId + """, (reader, version) => reader.Unbox("NodeGUID"), + new SqlParameter("siteId", siteId), new SqlParameter("nodeId", nodeId) + ).FirstOrDefault(); + + if (nodeGuid is not { } sNodeGuid) + { + return null; + } + + if (!SpoiledNodeGuids.TryGetValue(sNodeGuid, out _)) + { + return sNodeGuid; + } + + var newGuid = GuidHelper.CreateNodeGuid($"{nodeId}|{siteId}"); + logger.LogTrace("Spoiled node guid encountered '{OriginalGuid}', replaced by {NewGuid} {Details}", nodeGuid, newGuid, new { siteId, nodeId }); + return newGuid; + } + + public Guid EnsureNodeGuid(ICmsTree node) => EnsureNodeGuid(node.NodeGUID, node.NodeSiteID, node.NodeID); + + internal record SpoiledDocumentGuidInfo(int SiteId, int NodeId); + + internal record SpoiledNodeGuidInfo(int SiteId); +} diff --git a/Migration.Toolkit.CLI/ConfigurationValidator.cs b/Migration.Toolkit.CLI/ConfigurationValidator.cs index e439370e..69a3821c 100644 --- a/Migration.Toolkit.CLI/ConfigurationValidator.cs +++ b/Migration.Toolkit.CLI/ConfigurationValidator.cs @@ -1,191 +1,171 @@ -using System.Diagnostics.Contracts; -using Microsoft.Extensions.Configuration; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Helpers; - -namespace Migration.Toolkit.CLI; - -using Migration.Toolkit.Core.KX13.Helpers; - -public enum ValidationMessageType -{ - Error, - Warning, -} - -public record ValidationMessage(ValidationMessageType Type, string Message, string? RecommendedFix = null); - -public static class ConfigurationValidator -{ - [Pure] - public static IEnumerable GetValidationErrors(IConfigurationRoot root) - { - var settings = root.GetSection(ConfigurationNames.Settings); - - if (settings is null) - { - yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_Settings_IsRequired); - } - - if ( - CheckCfgValue(settings?.GetValue(ConfigurationNames.SourceConnectionString)) && - CheckCfgValue(settings?.GetValue(ConfigurationNames.KxConnectionString)) - ) - { - yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_SourceConnectionString_IsRequired); - } - - if ( - CheckCfgValue(settings?.GetValue(ConfigurationNames.SourceCmsDirPath)) && - CheckCfgValue(settings?.GetValue(ConfigurationNames.KxCmsDirPath)) - ) - { - yield return new ValidationMessage(ValidationMessageType.Warning, - Resources.ConfigurationValidator_GetValidationErrors_SourceCmsDirPath_IsRecommended); - } - - if ( - CheckCfgValue(settings?.GetValue(ConfigurationNames.TargetConnectionString)) && - CheckCfgValue(settings?.GetValue(ConfigurationNames.XbKConnectionString)) - ) - { - yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_TargetConnectionString_IsRequired); - } - - if ( - CheckCfgValue(settings?.GetValue(ConfigurationNames.TargetCmsDirPath)) && - CheckCfgValue(settings?.GetValue(ConfigurationNames.XbKDirPath)) - ) - { - yield return new ValidationMessage(ValidationMessageType.Error, - Resources.ConfigurationValidator_GetValidationErrors_TargetCmsDirPath_IsRequired); - } - - var targetKxpApiSettings = - settings?.GetSection(ConfigurationNames.XbKApiSettings) ?? - settings?.GetSection(ConfigurationNames.TargetKxpApiSettings) - ; - - if (targetKxpApiSettings is null) - { - yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_TargetKxpApiSettings_IsRequired); - } - - var connectionStrings = targetKxpApiSettings?.GetSection(ConfigurationNames.ConnectionStrings); - if (connectionStrings is null) - { - yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_ConnectionStrings_IsRequired); - } - - if (CheckCfgValue(connectionStrings?.GetValue(ConfigurationNames.CmsConnectionString))) - { - yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_CmsConnectionString_IsRequired); - } - - if (!StringIsNullOrFitsOneOf(connectionStrings?.GetValue(ConfigurationNames.UseOmActivityNodeRelationAutofix))) - { - yield return new ValidationMessage(ValidationMessageType.Error, string.Format(Resources.ConfigurationValidator_GetValidationErrors_UseOmActivityNodeRelationAutofix_MustFit, Printer.PrintEnumValues(", "))); - } - - if (!StringIsNullOrFitsOneOf(connectionStrings?.GetValue(ConfigurationNames.UseOmActivitySiteRelationAutofix))) - { - yield return new ValidationMessage(ValidationMessageType.Error, string.Format(Resources.ConfigurationValidator_GetValidationErrors_UseOmActivitySiteRelationAutofix_MustFit, Printer.PrintEnumValues(", "))); - } - - #region Opt-in features validation - - var optInFeatures = settings?.GetSection(ConfigurationNames.OptInFeatures); - if (optInFeatures is not null) - { - var querySourceInstanceApi = optInFeatures?.GetSection(ConfigurationNames.QuerySourceInstanceApi); - if (querySourceInstanceApi is not null) - { - var qsiEnabled = querySourceInstanceApi.GetValue(ConfigurationNames.Enabled); - if (qsiEnabled is true) - { - var connections = querySourceInstanceApi.GetSection(ConfigurationNames.Connections).GetChildren(); - foreach (var connection in connections) - { - var siteUri = connection.GetValue(ConfigurationNames.SourceInstanceUri); - var secret = connection.GetValue(ConfigurationNames.Secret); - - if (Uri.TryCreate(siteUri, UriKind.Absolute, out var sourceSiteUri)) - { - if (!sourceSiteUri.IsLoopback) - { - yield return new ValidationMessage(ValidationMessageType.Error, - "Source instance Uri invalid format, following formats are supported: http://localhost:5531, https://localhost/MySite"); - } - - // OK - } - else - { - yield return new ValidationMessage(ValidationMessageType.Error, - "Source instance Uri invalid format, following formats are supported: http://localhost:5531, https://localhost/MySite"); - } - - if (string.IsNullOrWhiteSpace(secret)) - { - yield return new ValidationMessage(ValidationMessageType.Error, - "Source instance secret cannot be null or whitespace, set it to random hardly guessed string."); - } - } - } - } - - var customMigrationModel = optInFeatures?.GetValue(ConfigurationNames.CustomMigration); - if (customMigrationModel is { FieldMigrations.Length: > 0 }) - { - ValidationMessage Required(int item, string fieldName) - { - return new ValidationMessage( - ValidationMessageType.Error, - $"Custom DataType migration at index [{item}] is missing value '{fieldName}', supply value or remove whole DataType migration." - ); - } - - var fieldMigrations = customMigrationModel.FieldMigrations; - - for (var i = 0; i < fieldMigrations.Length; i++) - { - var current = fieldMigrations[i]; - if (string.IsNullOrWhiteSpace(current.SourceDataType)) - { - yield return Required(i, nameof(ConfigurationNames.SourceDataType)); - } - if (string.IsNullOrWhiteSpace(current.TargetDataType)) - { - yield return Required(i, nameof(ConfigurationNames.TargetDataType)); - } - if (string.IsNullOrWhiteSpace(current.SourceFormControl)) - { - yield return Required(i, nameof(ConfigurationNames.SourceFormControl)); - } - if (string.IsNullOrWhiteSpace(current.TargetFormComponent)) - { - yield return Required(i, nameof(ConfigurationNames.TargetFormComponent)); - } - } - } - } - - #endregion - } - - #region "Helper methods" - - [Pure] - private static bool StringIsNullOrFitsOneOf(string? s) where TEnum : Enum - { - return s is null || Enum.TryParse(ReflectionHelper.CurrentType, s, out var _); - } - - [Pure] - private static bool CheckCfgValue(string? s) - { - return string.IsNullOrWhiteSpace(s) || s == ConfigurationNames.TodoPlaceholder; - } - - #endregion -} \ No newline at end of file +using System.Diagnostics.Contracts; + +using Microsoft.Extensions.Configuration; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Core.KX13.Helpers; + +namespace Migration.Toolkit.CLI; + +public enum ValidationMessageType +{ + Error, + Warning +} + +public record ValidationMessage(ValidationMessageType Type, string Message, string? RecommendedFix = null); + +public static class ConfigurationValidator +{ + [Pure] + public static IEnumerable GetValidationErrors(IConfigurationRoot root) + { + var settings = root.GetSection(ConfigurationNames.Settings); + + if (settings is null) + { + yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_Settings_IsRequired); + } + + if (CheckCfgValue(settings?.GetValue(ConfigurationNames.KxConnectionString))) + { + yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_SourceConnectionString_IsRequired); + } + + if (CheckCfgValue(settings?.GetValue(ConfigurationNames.KxCmsDirPath))) + { + yield return new ValidationMessage(ValidationMessageType.Warning, Resources.ConfigurationValidator_GetValidationErrors_SourceCmsDirPath_IsRecommended); + } + + if (settings?.GetValue(ConfigurationNames.XbKConnectionString) is not null) + { + yield return new ValidationMessage(ValidationMessageType.Warning, $"Configuration key '{ConfigurationNames.XbKConnectionString}' is deprecated, use 'Settings:ConnectionStrings:CMSConnectionString' instead"); + } + + if (CheckCfgValue(settings?.GetValue(ConfigurationNames.XbKDirPath))) + { + yield return new ValidationMessage(ValidationMessageType.Error, + Resources.ConfigurationValidator_GetValidationErrors_TargetCmsDirPath_IsRequired); + } + + var targetKxpApiSettings = settings?.GetSection(ConfigurationNames.XbKApiSettings); + if (targetKxpApiSettings is null) + { + yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_TargetKxpApiSettings_IsRequired); + } + + var connectionStrings = targetKxpApiSettings?.GetSection(ConfigurationNames.ConnectionStrings); + if (connectionStrings is null) + { + yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_ConnectionStrings_IsRequired); + } + + if (CheckCfgValue(connectionStrings?.GetValue(ConfigurationNames.CmsConnectionString))) + { + yield return new ValidationMessage(ValidationMessageType.Error, Resources.ConfigurationValidator_GetValidationErrors_CmsConnectionString_IsRequired); + } + + if (!StringIsNullOrFitsOneOf(connectionStrings?.GetValue(ConfigurationNames.UseOmActivityNodeRelationAutofix))) + { + yield return new ValidationMessage(ValidationMessageType.Error, string.Format(Resources.ConfigurationValidator_GetValidationErrors_UseOmActivityNodeRelationAutofix_MustFit, Printer.PrintEnumValues(", "))); + } + + if (!StringIsNullOrFitsOneOf(connectionStrings?.GetValue(ConfigurationNames.UseOmActivitySiteRelationAutofix))) + { + yield return new ValidationMessage(ValidationMessageType.Error, string.Format(Resources.ConfigurationValidator_GetValidationErrors_UseOmActivitySiteRelationAutofix_MustFit, Printer.PrintEnumValues(", "))); + } + + #region Opt-in features validation + + var optInFeatures = settings?.GetSection(ConfigurationNames.OptInFeatures); + if (optInFeatures is not null) + { + var querySourceInstanceApi = optInFeatures?.GetSection(ConfigurationNames.QuerySourceInstanceApi); + if (querySourceInstanceApi is not null) + { + bool? qsiEnabled = querySourceInstanceApi.GetValue(ConfigurationNames.Enabled); + if (qsiEnabled is true) + { + var connections = querySourceInstanceApi.GetSection(ConfigurationNames.Connections).GetChildren(); + foreach (var connection in connections) + { +#warning EXTEND SITENAME + // var siteName = connection.GetValue(ConfigurationNames.SiteName); + string? siteUri = connection.GetValue(ConfigurationNames.SourceInstanceUri); + string? secret = connection.GetValue(ConfigurationNames.Secret); + + if (Uri.TryCreate(siteUri, UriKind.Absolute, out var sourceSiteUri)) + { + if (!sourceSiteUri.IsLoopback) + { + yield return new ValidationMessage(ValidationMessageType.Error, + "Source instance Uri invalid format, following formats are supported: http://localhost:5531, https://localhost/MySite"); + } + + // OK + } + else + { + yield return new ValidationMessage(ValidationMessageType.Error, + "Source instance Uri invalid format, following formats are supported: http://localhost:5531, https://localhost/MySite"); + } + + if (string.IsNullOrWhiteSpace(secret)) + { + yield return new ValidationMessage(ValidationMessageType.Error, + "Source instance secret cannot be null or whitespace, set it to random hardly guessed string."); + } + } + } + } + + var customMigrationModel = optInFeatures?.GetValue(ConfigurationNames.CustomMigration); + if (customMigrationModel is { FieldMigrations.Length: > 0 }) + { + static ValidationMessage Required(int item, string fieldName) => new( + ValidationMessageType.Error, + $"Custom DataType migration at index [{item}] is missing value '{fieldName}', supply value or remove whole DataType migration." + ); + + var fieldMigrations = customMigrationModel.FieldMigrations; + + for (int i = 0; i < fieldMigrations.Length; i++) + { + var current = fieldMigrations[i]; + if (string.IsNullOrWhiteSpace(current.SourceDataType)) + { + yield return Required(i, nameof(ConfigurationNames.SourceDataType)); + } + + if (string.IsNullOrWhiteSpace(current.TargetDataType)) + { + yield return Required(i, nameof(ConfigurationNames.TargetDataType)); + } + + if (string.IsNullOrWhiteSpace(current.SourceFormControl)) + { + yield return Required(i, nameof(ConfigurationNames.SourceFormControl)); + } + + if (string.IsNullOrWhiteSpace(current.TargetFormComponent)) + { + yield return Required(i, nameof(ConfigurationNames.TargetFormComponent)); + } + } + } + } + + #endregion + } + + #region "Helper methods" + + [Pure] + private static bool StringIsNullOrFitsOneOf(string? s) where TEnum : Enum => s is null || Enum.TryParse(ReflectionHelper.CurrentType, s, out object? _); + + [Pure] + private static bool CheckCfgValue(string? s) => string.IsNullOrWhiteSpace(s) || s == ConfigurationNames.TodoPlaceholder; + + #endregion +} diff --git a/Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md b/Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md index f17b77f3..16802d2a 100644 --- a/Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md +++ b/Migration.Toolkit.CLI/MIGRATION_PROTOCOL_REFERENCE.md @@ -1,43 +1,45 @@ ## Migration Protocol Reference -Running the `Migration.Toolkit.CLI.exe migrate` command (see [`Migration.Toolkit.CLI/README.md`](/Migration.Toolkit.CLI/README.md)) generates a **migration protocol file**. The protocol provides information about the result of the migration, lists required manual steps, etc. - -You can find the protocol file in the location specified by the `Settings.MigrationProtocolPath` [configuration option](/Migration.Toolkit.CLI/README.md#Configuration). +Running the `Migration.Toolkit.CLI.exe migrate` command ( +see [`Migration.Toolkit.CLI/README.md`](/Migration.Toolkit.CLI/README.md)) generates a **migration protocol file**. The +protocol provides information about the result of the migration, lists required manual steps, etc. +You can find the protocol file in the location specified by +the `Settings.MigrationProtocolPath` [configuration option](/Migration.Toolkit.CLI/README.md#Configuration). ## Common Migration Protocol Warnings & Errors -| Message ReferenceName | Severity | Description | -| ------------------------------------------------------------|--------------------------|----------------------------- | -| BulkCopyColumnMismatch | Error | For performance optimization, the migration transfers certain objects using bulk SQL queries. The columns in the related database tables must match on the source and target. The migration attempts to discard data from extra columns on the source.

**Fix**: Review the tables for customizations on the source instance and revert/update the schema to match the default Kentico Xperience 13 state. | -| CmsClass_CmsRootClassTypeSkip | Information | 'CMS.Root' is a special system page type and is not supported for migration.

**Fix**: No actions required. Xperience by Kentico contains a root page type by default. | -| CmsTree_TreeIsLinkFromDifferentSite | Warning | The content tree contains a page that is linked from a different site. Linked pages from other sites are not supported for migration (Xperience by Kentico currently does not allow multiple sites).

**Fix**: Remove the linked page on the source instance or create a copy that is not linked from a different site. | -| CmsUser_SkipAdminUser | Warning | Migration of the 'administrator' user was not processed.

**Fix**: Remove the 'administrator' user on the target instances. | -| CmsUser_SkipPublicUser | Warning | Migration of the system 'public' user was not processed.

**Fix**: No actions required. All bindings (e.g. the site binding) for the 'public' user account will be mapped automatically. | -| CustomFormComponent | Warning | Logged when Page Builder content on the source instance contains a property using a custom form component (one that doesn't exist in the default installation). You need to manually create a corresponding component suitable for Xperience by Kentico on the target instance. | -| DataMustNotExistInTargetInstanceTable | Warning | Occurs when data is present for objects migrated using bulk SQL queries (for performance optimization, for example the Contact management migration).

**Fix**: You always need to delete all objects of the given types before running repeated migrations. | -| DbConstraintBroken | Error | General error message indicating that the target database cannot hold migrated data, due to duplicate values in unique columns (e.g., primary keys) or due to a missing dependency.

**Fix**: Manually migrate the object (specified object by the ID in the message), or check if dependencies required by the object were successfully migrated. | -| EntityExplicitlyExcludedByCodeName | Warning | The object is excluded via the `Settings.EntityConfigurations..ExcludeCodeNames` configuration option.

**Fix**: If you wish to migrate the object, remove the given code name from the configuration. | -| ErrorSavingTargetInstance | Error | A general error that prevents data from being saved in the target Xperience by Kentico database. For example, can be caused by a database timeout or temporary outage. | -| FailedToCreateTargetInstance | Error | General error when the creation of the target entity failed. Can be caused by a problem with the source data or by an error in the Migration toolkit.

**Fix**: Check if the related source data is compatible with the target or report a Migration toolkit issue. | -| FailedToUpdateTargetInstance / FailedToUpdateTargetInstance | Error | General error when updating / inserting an object on the target instance.

**Fix**: Depends on the details in the error message. Can have various causes, such as an interrupted database connection or malformed/incorrect data. | -| FormComponentNotSupportedInLegacyMode | Warning | Logged when Page Builder content on the source instance contains a property using a form component that is not supported by the Page Builder legacy mode in Xperience by Kentico. | -| InvalidSourceData | Warning | The source instance is missing required data or data is malformed.

**Fix**: Review the message details and try to look for differences between the source and target database schema. | -| LinkedDataAlreadyMaterializedInTargetInstance | Warning | A linked page already exists in the target instance and an update is not possible.

**Fix**: No actions required. The update is probably not required. | -| MediaFileIsMissingOnSourceFilesystem | Error | Occurs when a media file is missing from the source project's file system and the `Settings.MigrateOnlyMediaFileInfo` configuration option is `false`.

**Fix**: Manually migrate the source media file to the target instance's file system. | | -| MissingConfiguration | Error | The migrate command is missing required configuration.

**Fix**: Add required configuration according to the error message. See [`Migration.Toolkit.CLI/README.md`](/Migration.Toolkit.CLI/README.md). | -| MissingRequiredDependency | Error | An object from the source is missing a dependency required on the target instance.

**Fix**: Add the missing dependency on the source instance or delete the object completely. | -| NotCurrentlySupportedSkip | Warning | Xperience by Kentico currently does not support all types of objects from Kentico Xperience 13, so they cannot be migrated via the toolkit. Support may be added in future versions of Xperience by Kentico and the Migration toolkit.

**Fix**: Implement custom migration. | -| NotSupportedSkip | Information | Occurs for data that is not supported in Xperience by Kentico. Migration is not supported, and is not planned for upcoming versions.

**Fix**: Implement custom migration. | -| SourceEntityIsNull | Error | Probably an error while loading source data. Can be caused by malformed source data or by an error in the Migration toolkit.**Fix**: Check the related source data. If everything looks correct, report a Migration toolkit issue. | -| SourcePageIsNotPublished | Warning | Only published pages are included in the migration. This warning occurs when a page on the source is not published.

**Fix**: Publish all pages that you wish to migrate in the source instance. | -| SourceValueIsRequired | Error | A source object instance has a missing value in a required field.

**Fix**: Review the message and fill in the missing value on the source instance. | -| TemporaryAttachmentMigrationIsNotSupported | Warning | Temporary page attachments are created when a file upload is not finished correctly. The migration does not include temporary attachments.

**Fix**: No actions required. If you wish to migrate the file, re-upload the attachment on the source instance to create a standard attachment. | -| ValueTruncationSkip | Error | Occurs when a target database field has a lower allowed size than the source database field.

**Fix**: Truncate the value to the required size on the source instance, or omit the value completely. | - +| Message ReferenceName | Severity | Description | +|-------------------------------------------------------------|-------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| BulkCopyColumnMismatch | Error | For performance optimization, the migration transfers certain objects using bulk SQL queries. The columns in the related database tables must match on the source and target. The migration attempts to discard data from extra columns on the source.

**Fix**: Review the tables for customizations on the source instance and revert/update the schema to match the default Kentico Xperience 13 state. | +| CmsClass_CmsRootClassTypeSkip | Information | 'CMS.Root' is a special system page type and is not supported for migration.

**Fix**: No actions required. Xperience by Kentico contains a root page type by default. | +| CmsTree_TreeIsLinkFromDifferentSite | Warning | The content tree contains a page that is linked from a different site. Linked pages from other sites are not supported for migration (Xperience by Kentico currently does not allow multiple sites).

**Fix**: Remove the linked page on the source instance or create a copy that is not linked from a different site. | +| CmsUser_SkipAdminUser | Warning | Migration of the 'administrator' user was not processed.

**Fix**: Remove the 'administrator' user on the target instances. | +| CmsUser_SkipPublicUser | Warning | Migration of the system 'public' user was not processed.

**Fix**: No actions required. All bindings (e.g. the site binding) for the 'public' user account will be mapped automatically. | +| CustomFormComponent | Warning | Logged when Page Builder content on the source instance contains a property using a custom form component (one that doesn't exist in the default installation). You need to manually create a corresponding component suitable for Xperience by Kentico on the target instance. | +| DataMustNotExistInTargetInstanceTable | Warning | Occurs when data is present for objects migrated using bulk SQL queries (for performance optimization, for example the Contact management migration).

**Fix**: You always need to delete all objects of the given types before running repeated migrations. | +| DbConstraintBroken | Error | General error message indicating that the target database cannot hold migrated data, due to duplicate values in unique columns (e.g., primary keys) or due to a missing dependency.

**Fix**: Manually migrate the object (specified object by the ID in the message), or check if dependencies required by the object were successfully migrated. | +| EntityExplicitlyExcludedByCodeName | Warning | The object is excluded via the `Settings.EntityConfigurations..ExcludeCodeNames` configuration option.

**Fix**: If you wish to migrate the object, remove the given code name from the configuration. | +| ErrorSavingTargetInstance | Error | A general error that prevents data from being saved in the target Xperience by Kentico database. For example, can be caused by a database timeout or temporary outage. | +| FailedToCreateTargetInstance | Error | General error when the creation of the target entity failed. Can be caused by a problem with the source data or by an error in the Migration toolkit.

**Fix**: Check if the related source data is compatible with the target or report a Migration toolkit issue. | +| FailedToUpdateTargetInstance / FailedToUpdateTargetInstance | Error | General error when updating / inserting an object on the target instance.

**Fix**: Depends on the details in the error message. Can have various causes, such as an interrupted database connection or malformed/incorrect data. | +| FormComponentNotSupportedInLegacyMode | Warning | Logged when Page Builder content on the source instance contains a property using a form component that is not supported by the Page Builder legacy mode in Xperience by Kentico. | +| InvalidSourceData | Warning | The source instance is missing required data or data is malformed.

**Fix**: Review the message details and try to look for differences between the source and target database schema. | +| LinkedDataAlreadyMaterializedInTargetInstance | Warning | A linked page already exists in the target instance and an update is not possible.

**Fix**: No actions required. The update is probably not required. | +| MediaFileIsMissingOnSourceFilesystem | Error | Occurs when a media file is missing from the source project's file system and the `Settings.MigrateOnlyMediaFileInfo` configuration option is `false`.

**Fix**: Manually migrate the source media file to the target instance's file system. | | +| MissingConfiguration | Error | The migrate command is missing required configuration.

**Fix**: Add required configuration according to the error message. See [`Migration.Toolkit.CLI/README.md`](/Migration.Toolkit.CLI/README.md). | +| MissingRequiredDependency | Error | An object from the source is missing a dependency required on the target instance.

**Fix**: Add the missing dependency on the source instance or delete the object completely. | +| NotCurrentlySupportedSkip | Warning | Xperience by Kentico currently does not support all types of objects from Kentico Xperience 13, so they cannot be migrated via the toolkit. Support may be added in future versions of Xperience by Kentico and the Migration toolkit.

**Fix**: Implement custom migration. | +| NotSupportedSkip | Information | Occurs for data that is not supported in Xperience by Kentico. Migration is not supported, and is not planned for upcoming versions.

**Fix**: Implement custom migration. | +| SourceEntityIsNull | Error | Probably an error while loading source data. Can be caused by malformed source data or by an error in the Migration toolkit.**Fix**: Check the related source data. If everything looks correct, report a Migration toolkit issue. | +| SourcePageIsNotPublished | Warning | Only published pages are included in the migration. This warning occurs when a page on the source is not published.

**Fix**: Publish all pages that you wish to migrate in the source instance. | +| SourceValueIsRequired | Error | A source object instance has a missing value in a required field.

**Fix**: Review the message and fill in the missing value on the source instance. | +| TemporaryAttachmentMigrationIsNotSupported | Warning | Temporary page attachments are created when a file upload is not finished correctly. The migration does not include temporary attachments.

**Fix**: No actions required. If you wish to migrate the file, re-upload the attachment on the source instance to create a standard attachment. | +| ValueTruncationSkip | Error | Occurs when a target database field has a lower allowed size than the source database field.

**Fix**: Truncate the value to the required size on the source instance, or omit the value completely. | ## Submit issues See [`CONTRIBUTING.md`](/CONTRIBUTING.md). -When submitting issues, please provide all available information about the problem or error. If possible, include the command line output log file and migration protocol generated for your `Migration.Toolkit.CLI.exe migrate` command. +When submitting issues, please provide all available information about the problem or error. If possible, include the +command line output log file and migration protocol generated for your `Migration.Toolkit.CLI.exe migrate` command. diff --git a/Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj b/Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj index c208bbb2..97269af2 100644 --- a/Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj +++ b/Migration.Toolkit.CLI/Migration.Toolkit.CLI.csproj @@ -5,37 +5,36 @@ - - - - - - - - - - + + + + + + + + + + - - - - - - + + + + + - - Always - - - Always - - - Always - + + Always + + + Always + + + Always + diff --git a/Migration.Toolkit.CLI/Program.cs b/Migration.Toolkit.CLI/Program.cs index 4b210530..5898a86f 100644 --- a/Migration.Toolkit.CLI/Program.cs +++ b/Migration.Toolkit.CLI/Program.cs @@ -1,221 +1,223 @@ -using System.Reflection; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.CLI; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Core; -using Migration.Toolkit.Core.K11; -using Migration.Toolkit.KX12; -using Migration.Toolkit.KX13; -using Migration.Toolkit.KXP; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.Core.KX12; -using Migration.Toolkit.Core.KX13; -using Migration.Toolkit.K11; -using Migration.Toolkit.Source; -using static Migration.Toolkit.Common.Helpers.ConsoleHelper; - -EnableVirtualTerminalProcessing(); - -// https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration - -var config = new ConfigurationBuilder() - .SetBasePath(Environment.CurrentDirectory) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: false) - .AddJsonFile("appsettings.local.json", optional: true, reloadOnChange: false) - .Build() - ; - -var validationErrors = ConfigurationValidator.GetValidationErrors(config); -var anyValidationErrors = false; -foreach (var (validationMessageType, message, recommendedFix) in validationErrors) -{ - switch (validationMessageType) - { - case ValidationMessageType.Error: - if (!string.IsNullOrWhiteSpace(message)) - { - Console.Write(Resources.ConfigurationError, RED, RESET, message); - if (!string.IsNullOrWhiteSpace(recommendedFix)) - { - Console.Write(Resources.ConfigurationRecommendedFix, YELLOW, RESET, recommendedFix); - } - - anyValidationErrors = true; - Console.WriteLine(); - } - - break; - case ValidationMessageType.Warning: - if (!string.IsNullOrWhiteSpace(message)) - { - Console.Write(Resources.ConfigurationWarning, YELLOW, RESET, message); - if (!string.IsNullOrWhiteSpace(recommendedFix)) - { - Console.Write(Resources.ConfigurationRecommendedFix, YELLOW, RESET, recommendedFix); - } - - Console.WriteLine(); - } - - break; - } -} - -if (anyValidationErrors) -{ - Console.WriteLine(Resources.ProgramAwaitingExitMessage); - if (!args.Contains("--nowait")) - { - Console.ReadKey(); - } - return; -} - -var settingsSection = config.GetRequiredSection(ConfigurationNames.Settings); -var settings = settingsSection.Get(); -settings.EntityConfigurations ??= new EntityConfigurations(); - -var services = new ServiceCollection(); - -services - .AddLogging(builder => - { - builder.AddConfiguration(config.GetSection(ConfigurationNames.Logging)); - builder.AddSimpleConsole(options => - { - options.IncludeScopes = true; - options.SingleLine = true; - options.TimestampFormat = "hh:mm:ss.fff "; - }); - builder.AddFile(config.GetSection($"{ConfigurationNames.Logging}:File")); - }); - - -services.UseKsToolkitCore(); -await using var conn = new SqlConnection(settings.KxConnectionString); -try -{ - await conn.OpenAsync(); - switch (VersionHelper.GetInstanceVersion(conn)) - { - case { Major: 11 }: - { - services.UseK11DbContext(settings); - services.UseK11ToolkitCore(); - Console.WriteLine($@"Source instance {Green($"version 11")} detected."); - break; - } - case { Major: 12 }: - { - services.UseKx12DbContext(settings); - services.UseKx12ToolkitCore(); - Console.WriteLine($@"Source instance {Green($"version 12")} detected"); - break; - } - case { Major: 13 }: - { - services.UseKx13DbContext(settings); - services.UseKx13ToolkitCore(); - Console.WriteLine($@"Source instance {Green("version 13")} detected"); - break; - } - case { Major: { } version }: - { - Console.WriteLine($@"Source instance {Green($"version {version}")} detected. This instance is not supported"); - break; - } - default: - { - Console.WriteLine( - $@"{Red("Parsing of source instance version failed")}, please check connection string and if source instance settings key with key name 'CMSDBVersion' is correctly filled."); - return; - } - } -} -catch (Exception ex) -{ - Console.WriteLine($@"Startup failed with error: {ex}"); - return; -} - - -services.UseKxpDbContext(settings); - -var kxpApiSettings = - settingsSection.GetSection(ConfigurationNames.XbKApiSettings) ?? -#pragma warning disable CS0618 // usage of obsolete symbol is related to backwards compatibility maintenance - settingsSection.GetSection(ConfigurationNames.TargetKxpApiSettings) ?? - settingsSection.GetSection(ConfigurationNames.TargetKxoApiSettings); -#pragma warning restore CS0618 - -services.UseKxpApi(kxpApiSettings, settings.XbKDirPath); -services.AddSingleton(settings); -services.AddSingleton(); -services.UseToolkitCommon(); - -await using var serviceProvider = services.BuildServiceProvider(); -using var scope = serviceProvider.CreateScope(); - -var loader = scope.ServiceProvider.GetRequiredService(); -await loader.LoadAsync(); - -var commandParser = scope.ServiceProvider.GetRequiredService(); -var mediatr = scope.ServiceProvider.GetRequiredService(); -var kxpContext = scope.ServiceProvider.GetRequiredService>().CreateDbContext(); - -var argsQ = new Queue(args); -var bypassDependencyCheck = false; -var commands = commandParser.Parse(argsQ, ref bypassDependencyCheck); - -kxpContext.Dispose(); - -// sort commands -commands = commands.OrderBy(x => x.Rank).ToList(); - -var satisfiedDependencies = new HashSet(); -var dependenciesSatisfied = true; -if (!bypassDependencyCheck) -{ - foreach (var command in commands) - { - var commandType = command.GetType(); - satisfiedDependencies.Add(commandType); - foreach (var commandDependency in command.Dependencies) - { - if (!satisfiedDependencies.Contains(commandDependency)) - { - var cmdMoniker = commandType.GetProperty("Moniker", BindingFlags.Static | BindingFlags.Public)?.GetValue(null); - var cmdMonikerNeeded = commandDependency.GetProperty("Moniker", BindingFlags.Static | BindingFlags.Public)?.GetValue(null); - - dependenciesSatisfied = false; - - Console.WriteLine($@"Migration {Yellow($"--{cmdMoniker}")} needs to run migration {Red($"--{cmdMonikerNeeded}")} before."); - } - } - } -} - -if (!dependenciesSatisfied) -{ - return; -} - -foreach (var command in commands) -{ - await mediatr.Send(command); -} - -if (!args.Contains("--nowait")) -{ - Console.WriteLine(Resources.ProgramAwaitingExitMessage); - Console.ReadKey(); -} \ No newline at end of file +using System.Reflection; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.CLI; +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Core.K11; +using Migration.Toolkit.Core.KX12; +using Migration.Toolkit.Core.KX13; +using Migration.Toolkit.K11; +using Migration.Toolkit.KX12; +using Migration.Toolkit.KX13; +using Migration.Toolkit.KXP; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.Source; + +using static Migration.Toolkit.Common.Helpers.ConsoleHelper; + +EnableVirtualTerminalProcessing(); + +// https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration + +var config = new ConfigurationBuilder() + .SetBasePath(Environment.CurrentDirectory) + .AddJsonFile("appsettings.json", false, false) + .AddJsonFile("appsettings.local.json", true, false) + .Build() + ; + +var validationErrors = ConfigurationValidator.GetValidationErrors(config); +bool anyValidationErrors = false; +foreach ((var validationMessageType, string message, string? recommendedFix) in validationErrors) +{ + switch (validationMessageType) + { + case ValidationMessageType.Error: + if (!string.IsNullOrWhiteSpace(message)) + { + Console.Write(Resources.ConfigurationError, RED, RESET, message); + if (!string.IsNullOrWhiteSpace(recommendedFix)) + { + Console.Write(Resources.ConfigurationRecommendedFix, YELLOW, RESET, recommendedFix); + } + + anyValidationErrors = true; + Console.WriteLine(); + } + + break; + case ValidationMessageType.Warning: + if (!string.IsNullOrWhiteSpace(message)) + { + Console.Write(Resources.ConfigurationWarning, YELLOW, RESET, message); + if (!string.IsNullOrWhiteSpace(recommendedFix)) + { + Console.Write(Resources.ConfigurationRecommendedFix, YELLOW, RESET, recommendedFix); + } + + Console.WriteLine(); + } + + break; + default: + break; + } +} + +if (anyValidationErrors) +{ + Console.WriteLine(Resources.ProgramAwaitingExitMessage); + if (!args.Contains("--nowait")) + { + Console.ReadKey(); + } + + return; +} + +var settingsSection = config.GetRequiredSection(ConfigurationNames.Settings); +var settings = settingsSection.Get() ?? new ToolkitConfiguration(); +var kxpApiSettings = settingsSection.GetSection(ConfigurationNames.XbKApiSettings); +settings.SetXbKConnectionStringIfNotEmpty(kxpApiSettings["ConnectionStrings:CMSConnectionString"]); + +var services = new ServiceCollection(); + +services + .AddLogging(builder => + { + builder.AddConfiguration(config.GetSection(ConfigurationNames.Logging)); + builder.AddSimpleConsole(options => + { + options.IncludeScopes = true; + options.SingleLine = true; + options.TimestampFormat = "hh:mm:ss.fff "; + }); + builder.AddFile(config.GetSection($"{ConfigurationNames.Logging}:File")); + }); + + +services.UseKsToolkitCore(); +await using var conn = new SqlConnection(settings.KxConnectionString); +try +{ + await conn.OpenAsync(); + switch (VersionHelper.GetInstanceVersion(conn)) + { + case { Major: 11 }: + { + services.UseK11DbContext(settings); + services.UseK11ToolkitCore(); + Console.WriteLine($@"Source instance {Green("version 11")} detected."); + break; + } + case { Major: 12 }: + { + services.UseKx12DbContext(settings); + services.UseKx12ToolkitCore(); + Console.WriteLine($@"Source instance {Green("version 12")} detected"); + break; + } + case { Major: 13 }: + { + services.UseKx13DbContext(settings); + services.UseKx13ToolkitCore(); + Console.WriteLine($@"Source instance {Green("version 13")} detected"); + break; + } + case { Major: { } version }: + { + Console.WriteLine($@"Source instance {Green($"version {version}")} detected. This instance is not supported"); + break; + } + default: + { + Console.WriteLine( + $@"{Red("Parsing of source instance version failed")}, please check connection string and if source instance settings key with key name 'CMSDBVersion' is correctly filled."); + return; + } + } +} +catch (Exception ex) +{ + Console.WriteLine($@"Startup failed with error: {ex}"); + return; +} + + +services.UseKxpDbContext(settings); + + +services.UseKxpApi(kxpApiSettings, settings.XbKDirPath); +services.AddSingleton(settings); +services.AddSingleton(); +services.UseToolkitCommon(); + +await using var serviceProvider = services.BuildServiceProvider(); +KsCoreDiExtensions.InitServiceProvider(serviceProvider); +using var scope = serviceProvider.CreateScope(); + +var loader = scope.ServiceProvider.GetRequiredService(); +await loader.LoadAsync(); + +var commandParser = scope.ServiceProvider.GetRequiredService(); +var mediatr = scope.ServiceProvider.GetRequiredService(); +var kxpContext = scope.ServiceProvider.GetRequiredService>().CreateDbContext(); + +var argsQ = new Queue(args); +bool bypassDependencyCheck = false; +var commands = commandParser.Parse(argsQ, ref bypassDependencyCheck); + +kxpContext.Dispose(); + +// sort commands +commands = commands.OrderBy(x => x.Rank).ToList(); + +var satisfiedDependencies = new HashSet(); +bool dependenciesSatisfied = true; +if (!bypassDependencyCheck) +{ + foreach (var command in commands) + { + var commandType = command.GetType(); + satisfiedDependencies.Add(commandType); + foreach (var commandDependency in command.Dependencies) + { + if (!satisfiedDependencies.Contains(commandDependency)) + { + object? cmdMoniker = commandType.GetProperty("Moniker", BindingFlags.Static | BindingFlags.Public)?.GetValue(null); + object? cmdMonikerNeeded = commandDependency.GetProperty("Moniker", BindingFlags.Static | BindingFlags.Public)?.GetValue(null); + + dependenciesSatisfied = false; + + Console.WriteLine($@"Migration {Yellow($"--{cmdMoniker}")} needs to run migration {Red($"--{cmdMonikerNeeded}")} before."); + } + } + } +} + +if (!dependenciesSatisfied) +{ + return; +} + +foreach (var command in commands) +{ + await mediatr.Send(command); +} + +if (!args.Contains("--nowait")) +{ + Console.WriteLine(Resources.ProgramAwaitingExitMessage); + Console.ReadKey(); +} diff --git a/Migration.Toolkit.CLI/README.md b/Migration.Toolkit.CLI/README.md index 1c1caf42..5cb0097c 100644 --- a/Migration.Toolkit.CLI/README.md +++ b/Migration.Toolkit.CLI/README.md @@ -1,6 +1,7 @@ # Migration CLI -The [Xperience by Kentico: Kentico Migration Tool](/README.md) transfers content and other data from **Kentico Xperience 13**, **Kentico 12** or **Kentico 11** to **Xperience by Kentico**. +The [Xperience by Kentico: Kentico Migration Tool](/README.md) transfers content and other data from **Kentico Xperience +13**, **Kentico 12** or **Kentico 11** to **Xperience by Kentico**. The migration is performed by running a command for the .NET CLI. @@ -11,25 +12,28 @@ The target of the migration must be an Xperience by Kentico instance that fulfil * The instance's database and file system must be accessible from the environment where you run the migration. * The target application *must not be running* when you start the migration. * The target instance must be empty except for data from the source instance created by previous runs of this tool. -* For performance optimization, the migration transfers certain objects using bulk SQL queries. As a result, you always need to delete all objects of the following types before running repeated migrations: - * **Contacts**, including their **Activities** (when using the `migrate --contact-management` parameter) - * **Consent agreements** (when using the `migrate --data-protection` parameter) - * **Form submissions** (when using the `migrate --forms` parameter) - * **Custom module class data** (when using the `--custom-modules` parameter) +* For performance optimization, the migration transfers certain objects using bulk SQL queries. As a result, you always + need to delete all objects of the following types before running repeated migrations: + * **Contacts**, including their **Activities** (when using the `migrate --contact-management` parameter) + * **Consent agreements** (when using the `migrate --data-protection` parameter) + * **Form submissions** (when using the `migrate --forms` parameter) + * **Custom module class data** (when using the `--custom-modules` parameter) -To create a suitable target instance, [install a new Xperience by Kentico project](https://docs.xperience.io/x/DQKQC) using the **Boilerplate** project template. +To create a suitable target instance, [install a new Xperience by Kentico project](https://docs.xperience.io/x/DQKQC) +using the **Boilerplate** project template. ## Migrate data To perform the migration: - 1. Make sure the [target instance is set up correctly](#set-up-the-target-instance). - 2. [Configure](#configuration) the options in the `Migration.Toolkit.CLI` project's `appsettings.json` file. - 3. Compile the `Migration.Toolkit.CLI` project. - 4. Open the command line prompt. - 5. Navigate to the project's output directory. - 6. Run the `Migration.Toolkit.CLI.exe migrate` command with parameters according to your requirements. - 7. Observe the command line output and review the [migration protocol](./MIGRATION_PROTOCOL_REFERENCE.md), which provides information about the result of the migration, lists required manual steps, etc. +1. Make sure the [target instance is set up correctly](#set-up-the-target-instance). +2. [Configure](#configuration) the options in the `Migration.Toolkit.CLI` project's `appsettings.json` file. +3. Compile the `Migration.Toolkit.CLI` project. +4. Open the command line prompt. +5. Navigate to the project's output directory. +6. Run the `Migration.Toolkit.CLI.exe migrate` command with parameters according to your requirements. +7. Observe the command line output and review the [migration protocol](./MIGRATION_PROTOCOL_REFERENCE.md), which + provides information about the result of the migration, lists required manual steps, etc. ### Migrate command parameters @@ -39,33 +43,36 @@ Command usage: Migration.Toolkit.CLI.exe migrate --sites --custom-modules --users --members --forms --media-libraries --attachments --page-types --pages --settings-keys --contact-management --data-protection ``` -| Parameter | Description | Dependencies | -|-----------------------------|----------------------------------------------------------|---------------------------------------| -| `--sites` | Enables migration of sites to [website channels](https://docs.xperience.io/x/34HFC). The site's basic properties and settings are transferred to the target instance.| | -| `--custom-modules` | Enables migration of custom modules, [custom module classes and their data](https://docs.xperience.io/x/AKDWCQ), and [custom fields in supported system classes](https://docs.xperience.io/x/V6rWCQ).

See: [Migration details for specific object types - Custom modules and classes](#custom-modules-and-classes) | `--sites` | -| `--custom-tables` | Enables migration of [custom tables](https://docs.kentico.com/x/eQ2RBg).

See: [Migration details for specific object types - Custom tables](#custom-tables) | | -| `--users` | Enables migration of [users](https://docs.xperience.io/x/8ILWCQ) and [roles](https://docs.xperience.io/x/7IVwCg).

See: [Migration details for specific object types - Users](#users) | `--sites`, `--custom-modules` | -| `--members` | Enables migration of live site user accounts to [members](https://docs.xperience.io/x/BIsuCw).

See: [Migration details for specific object types - Members](#members) | `--sites`, `--custom-modules` | -| `--settings-keys` | Enables migration of values for [settings](https://docs.xperience.io/x/7YjFC) that are available in Xperience by Kentico. | `--sites` | -| `--page-types` | Enables migration of [content types](https://docs.xperience.io/x/gYHWCQ) (originally *page types* in Kentico Xperience 13) and [preset page templates](https://docs.xperience.io/x/KZnWCQ) (originally *custom page templates*). Required to migrate Pages.

See: [Migration details for specific object types - Content types](#content-types) | `--sites` | -| `--pages` | Enables migration of [pages](https://docs.xperience.io/x/bxzfBw).

The target instance must not contain pages other than those created by previous runs of the Kentico Migration Tool.

See: [Migration details for specific object types - Pages](#pages) | `--sites`, `--users`, `--page-types` | +| Parameter | Description | Dependencies | +|-----------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|------------------------------------------------| +| `--sites` | Enables migration of sites to [website channels](https://docs.xperience.io/x/34HFC). The site's basic properties and settings are transferred to the target instance. | | +| `--custom-modules` | Enables migration of custom modules, [custom module classes and their data](https://docs.xperience.io/x/AKDWCQ), and [custom fields in supported system classes](https://docs.xperience.io/x/V6rWCQ).

See: [Migration details for specific object types - Custom modules and classes](#custom-modules-and-classes) | `--sites` | +| `--custom-tables` | Enables migration of [custom tables](https://docs.kentico.com/x/eQ2RBg).

See: [Migration details for specific object types - Custom tables](#custom-tables) | | +| `--users` | Enables migration of [users](https://docs.xperience.io/x/8ILWCQ) and [roles](https://docs.xperience.io/x/7IVwCg).

See: [Migration details for specific object types - Users](#users) | `--sites`, `--custom-modules` | +| `--members` | Enables migration of live site user accounts to [members](https://docs.xperience.io/x/BIsuCw).

See: [Migration details for specific object types - Members](#members) | `--sites`, `--custom-modules` | +| `--settings-keys` | Enables migration of values for [settings](https://docs.xperience.io/x/7YjFC) that are available in Xperience by Kentico. | `--sites` | +| `--page-types` | Enables migration of [content types](https://docs.xperience.io/x/gYHWCQ) (originally *page types* in Kentico Xperience 13) and [preset page templates](https://docs.xperience.io/x/KZnWCQ) (originally *custom page templates*). Required to migrate Pages.

See: [Migration details for specific object types - Content types](#content-types) | `--sites` | +| `--pages` | Enables migration of [pages](https://docs.xperience.io/x/bxzfBw).

The target instance must not contain pages other than those created by previous runs of the Kentico Migration Tool.

See: [Migration details for specific object types - Pages](#pages) | `--sites`, `--users`, `--page-types` | | `--categories` | Enables migration of categories to taxonomies. Xperience by Kentico uses a different approach to categorization. Categories are migrated to [taxonomies](https://docs.kentico.com/x/taxonomies_xp) and selected categories for each page are assigned to pages in the target instance via a [reusable field schema](https://docs.kentico.com/x/D4_OD). See [`Categories`](#categories). | `--sites`, `--users`, `--pagetypes`, `--pages` | -| `--attachments` | Enables migration of page attachments to [media libraries](https://docs.xperience.io/x/agKiCQ) (page attachments are not supported in Xperience by Kentico).

See: [Migration details for specific object types - Attachments](#attachments) | `--sites`, `--custom-modules` | -| `--contact-management` | Enables migration of [contacts](https://docs.xperience.io/x/nYPWCQ) and [activities](https://docs.xperience.io/x/oYPWCQ). The target instance must not contain any contacts or activities. May run for a long time depending on the number of contacts in the source database. | `--users`, `--custom-modules` | -| `--data-protection` | Enables migration of [consents](https://docs.xperience.io/x/zoB1CQ) and consent agreements. | `--sites`, `--users`, `--contact management` | -| `--forms` | Enables migration of [forms](https://docs.xperience.io/x/WAKiCQ) and submitted form data.

See: [Migration details for specific object types - Forms](#forms) | `--sites`, `--custom-modules`, `--users` | -| `--media-libraries` | Enables migration of [media libraries](https://docs.xperience.io/x/agKiCQ) and contained media files. The actual binary files are only migrated between file systems if the `MigrateOnlyMediaFileInfo` [configuration option](#configuration) is set to *false*. | `--sites`, `--custom-modules`, `--users` | -| `--countries` | Enables migration of countries and states. Xperience by Kentico currently uses countries and states to fill selectors when editing contacts and contact group conditions. | | -| `--bypass-dependency-check` | Skips the migrate command's dependency check. Use for repeated runs of the migration if you know that dependencies were already migrated successfully (for example `--page types` when migrating pages). | | +| `--attachments` | Enables migration of page attachments to [media libraries](https://docs.xperience.io/x/agKiCQ) (page attachments are not supported in Xperience by Kentico).

See: [Migration details for specific object types - Attachments](#attachments) | `--sites`, `--custom-modules` | +| `--contact-management` | Enables migration of [contacts](https://docs.xperience.io/x/nYPWCQ) and [activities](https://docs.xperience.io/x/oYPWCQ). The target instance must not contain any contacts or activities. May run for a long time depending on the number of contacts in the source database. | `--users`, `--custom-modules` | +| `--data-protection` | Enables migration of [consents](https://docs.xperience.io/x/zoB1CQ) and consent agreements. | `--sites`, `--users`, `--contact management` | +| `--forms` | Enables migration of [forms](https://docs.xperience.io/x/WAKiCQ) and submitted form data.

See: [Migration details for specific object types - Forms](#forms) | `--sites`, `--custom-modules`, `--users` | +| `--media-libraries` | Enables migration of [media libraries](https://docs.xperience.io/x/agKiCQ) and contained media files. The actual binary files are only migrated between file systems if the `MigrateOnlyMediaFileInfo` [configuration option](#configuration) is set to *false*. | `--sites`, `--custom-modules`, `--users` | +| `--countries` | Enables migration of countries and states. Xperience by Kentico currently uses countries and states to fill selectors when editing contacts and contact group conditions. | | +| `--bypass-dependency-check` | Skips the migrate command's dependency check. Use for repeated runs of the migration if you know that dependencies were already migrated successfully (for example `--page types` when migrating pages). | | ### Examples * `Migration.Toolkit.CLI.exe migrate --sites --custom-modules --users --settings-keys --media-libraries --page-types --pages` - * First migration that includes the site object, custom modules and classes, users, setting key values, media libraries, page types and pages + * First migration that includes the site object, custom modules and classes, users, setting key values, media + libraries, page types and pages * `Migration.Toolkit.CLI.exe migrate --page-types --pages --bypass-dependency-check` - * Repeated migration only for page types and pages, if you know that sites and users were already migrated successfully. + * Repeated migration only for page types and pages, if you know that sites and users were already migrated + successfully. * `Migration.Toolkit.CLI.exe migrate --pages --bypass-dependency-check` - * Repeated migration only for pages, if you know that page types, sites, and users were already migrated successfully. + * Repeated migration only for pages, if you know that page types, sites, and users were already migrated + successfully. ### Migration details for specific object types @@ -75,59 +82,75 @@ Content types are named **Page types** in earlier Kentico products. Xperience by Kentico currently does not support: -* Macro expressions in page type field default values or other settings. Content type fields containing macros will not work correctly after the migration. +* Macro expressions in page type field default values or other settings. Content type fields containing macros will not + work correctly after the migration. * Page type inheritance. You cannot migrate page types that inherit fields from other types. * Categories for page type fields. Field categories are not migrated with page types. -The Kentico Migration Tool attempts to map the *Data type* and *Form control* of page type fields to an appropriate equivalent in Xperience by Kentico. This is not always possible, and cannot be done for custom data types or form controls. We recommend that you check your content type fields after the migration and adjust them if necessary. - -The following table describes how the Kentico Migration Tool maps the data types and form controls/components of page type fields: - -| KX13/12/11 Data type | XbK Data type | KX13/12/11 Form control | XbK Form component | -| ------------------------- | ------------------------ | ----------------------------- | --------------------- | -| Text | Text | Text box | Text input | -| Text | Text | Drop-down list | Dropdown selector | -| Text | Text | Radio buttons | Radio button group | -| Text | Text | Text area | Text area | -| Text | Text | *other* | Text input | -| Long text | Long text | Rich text editor | Rich text editor | -| Long text | Long text | Text box | Text input | -| Long text | Long text | Drop-down list | Dropdown selector | -| Long text | Long text | Text area | Text area | -| Long text | Long text | *other* | Rich text editor | -| Integer number | Integer number | *any* | Number input | -| Long integer number | Long integer number | *any* | Number input | -| Floating-point number | Floating-point number | *any* | Number input | -| Decimal number | Decimal number | *any* | Decimal number input | -| Date and time | Date and time | *any* | Datetime input | -| Date | Date | *any* | Date input | -| Time interval | Time interval | *any* | None (not supported) | -| Boolean (Yes/No) | Boolean (Yes/No) | *any* | Checkbox | -| Attachments | Media files | *any* (Attachments) | Media file selector
(the [attachments](#attachments) are converted to media files) | -| File | Media files | *any* (Direct uploader) | Media file selector
(the [attachments](#attachments) are converted to media files) | -| Unique identifier (Guid) | Unique identifier (Guid) | *any* | None (not supported) | -| Pages | Pages | *any* (Pages) | Page selector | - -Additionally, you can enable the Conversion of text fields with media links (*Media selection* form control) to media library files by setting the `OptInFeatures.CustomMigration.FieldMigrations` [configuration option](#convert-text-fields-with-media-links-to-media-libraries). - -Some [Form components](https://docs.xperience.io/x/5ASiCQ) used by content type fields in Xperience by Kentico store data differently than their equivalent Form control in Xperience 13. To ensure that content is displayed correctly on pages, you must manually adjust your website's implementation to match the new data format. See [Editing components in Xperience by Kentico](https://docs.xperience.io/x/wIfWCQ) to learn more about some of the most common components and selectors. +The Kentico Migration Tool attempts to map the *Data type* and *Form control* of page type fields to an appropriate +equivalent in Xperience by Kentico. This is not always possible, and cannot be done for custom data types or form +controls. We recommend that you check your content type fields after the migration and adjust them if necessary. + +The following table describes how the Kentico Migration Tool maps the data types and form controls/components of page +type fields: + +| KX13/12/11 Data type | XbK Data type | KX13/12/11 Form control | XbK Form component | +|--------------------------|--------------------------|-------------------------|-----------------------------------------------------------------------------------------| +| Text | Text | Text box | Text input | +| Text | Text | Drop-down list | Dropdown selector | +| Text | Text | Radio buttons | Radio button group | +| Text | Text | Text area | Text area | +| Text | Text | *other* | Text input | +| Long text | Long text | Rich text editor | Rich text editor | +| Long text | Long text | Text box | Text input | +| Long text | Long text | Drop-down list | Dropdown selector | +| Long text | Long text | Text area | Text area | +| Long text | Long text | *other* | Rich text editor | +| Integer number | Integer number | *any* | Number input | +| Long integer number | Long integer number | *any* | Number input | +| Floating-point number | Floating-point number | *any* | Number input | +| Decimal number | Decimal number | *any* | Decimal number input | +| Date and time | Date and time | *any* | Datetime input | +| Date | Date | *any* | Date input | +| Time interval | Time interval | *any* | None (not supported) | +| Boolean (Yes/No) | Boolean (Yes/No) | *any* | Checkbox | +| Attachments | Media files | *any* (Attachments) | Media file selector
(the [attachments](#attachments) are converted to media files) | +| File | Media files | *any* (Direct uploader) | Media file selector
(the [attachments](#attachments) are converted to media files) | +| Unique identifier (Guid) | Unique identifier (Guid) | *any* | None (not supported) | +| Pages | Pages | *any* (Pages) | Page selector | + +Additionally, you can enable the Conversion of text fields with media links (*Media selection* form control) to media +library files by setting +the `OptInFeatures.CustomMigration.FieldMigrations` [configuration option](#convert-text-fields-with-media-links-to-media-libraries). + +Some [Form components](https://docs.xperience.io/x/5ASiCQ) used by content type fields in Xperience by Kentico store +data differently than their equivalent Form control in Xperience 13. To ensure that content is displayed correctly on +pages, you must manually adjust your website's implementation to match the new data format. +See [Editing components in Xperience by Kentico](https://docs.xperience.io/x/wIfWCQ) to learn more about some of the +most common components and selectors. #### Reusable field schemas -You can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from page types from which other page types inherit, by setting the `Settings.CreateReusableFieldSchemaForClasses` [configuration option](#convert-page-types-to-reusable-field-schemas). +You can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from page types from which other page types +inherit, by setting +the `Settings.CreateReusableFieldSchemaForClasses` [configuration option](#convert-page-types-to-reusable-field-schemas). #### Pages * The migration includes the following versions of pages: - * _Published_ - * _Latest draft version_ - for published pages, the version is migrated to the _Draft_ [workflow step](https://docs.xperience.io/x/JwKQC#Pages-Pageworkflow); for pages that do not have a published version, the version is migrated to the _Draft (initial)_ workflow step. - * _Archived_ + * _Published_ + * _Latest draft version_ - for published pages, the version is migrated to the + _Draft_ [workflow step](https://docs.xperience.io/x/JwKQC#Pages-Pageworkflow); for pages that do not have a + published version, the version is migrated to the _Draft (initial)_ workflow step. + * _Archived_ * URLs are migrated depending on the source instance version: - * For Kentico Xperience 13, the migration: - * includes the URL paths of pages and Former URLs - * does not include Alternative URLs - * For Kentico 12 and Kentico 11, URL paths are not migrated. Instead, a default URL path is created from the `DocumentUrlPath` or `NodeAliasPath`. -* Linked pages are currently not supported in Xperience by Kentico. The migration creates standard page copies for any linked pages on the source instance. + * For Kentico Xperience 13, the migration: + * includes the URL paths of pages and Former URLs + * does not include Alternative URLs + * For Kentico 12 and Kentico 11, URL paths are not migrated. Instead, a default URL path is created from + the `DocumentUrlPath` or `NodeAliasPath`. +* Linked pages are currently not supported in Xperience by Kentico. The migration creates standard page copies for any + linked pages on the source instance. * Page permissions (ACLs) are currently not supported in Xperience by Kentico and are not migrated. * Migration of Page Builder content is only available for Kentico Xperience 13. @@ -135,66 +158,104 @@ You can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from p > :warning: Page Builder content migration is only available when migrating from Kentico Xperience 13. -By default, JSON data storing the Page Builder content of pages and custom page templates is migrated directly without modifications. On the target Xperience by Kentico instance, the migrated data can work in the Page Builder's legacy compatibility mode. However, we strongly recommend updating your codebase to the new Xperience by Kentico components. +By default, JSON data storing the Page Builder content of pages and custom page templates is migrated directly without +modifications. On the target Xperience by Kentico instance, the migrated data can work in the Page Builder's legacy +compatibility mode. However, we strongly recommend updating your codebase to the new Xperience by Kentico components. -The Kentico Migration Tool provides an advanced migration mode for Page Builder content that utilizes API discovery on the source instance. To learn more details and how to configure this feature, see [Source instance API discovery](#source-instance-api-discovery). +The Kentico Migration Tool provides an advanced migration mode for Page Builder content that utilizes API discovery on +the source instance. To learn more details and how to configure this feature, +see [Source instance API discovery](#source-instance-api-discovery). #### Categories -Xperience by Kentico uses a different approach to categorization than older Kentico versions. [Categories](https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-categories) were replaced by [taxonomies](https://docs.kentico.com/developers-and-admins/configuration/taxonomies) and selected categories for each page are assigned to pages in the target instance via a [reusable field schema](https://docs.kentico.com/x/D4_OD). The key differences are: - -* Categories in older versions can be added to any page via the *Properties -> Categories* tab. Taxonomies can only be used for content items (pages, emails...) that have a field with the *Taxonomy* data type. -* Categories can be global or site-specific. Taxonomies are always global, as there are no sites in Xperience by Kentico. -* Categories are assigned to pages regardless of their workflow step. Taxonomies are stored as a field and are covered by workflow. As a result, assigned tags can be different in each workflow step. -* [Categories stored as a field](https://docs.kentico.com/x/wA_RBg) and [personal categories](https://docs.kentico.com/x/IgqRBg) are not supported by the migration. +Xperience by Kentico uses a different approach to categorization than older Kentico +versions. [Categories](https://docs.kentico.com/13/configuring-xperience/configuring-the-environment-for-content-editors/configuring-categories) +were replaced by [taxonomies](https://docs.kentico.com/developers-and-admins/configuration/taxonomies) and selected +categories for each page are assigned to pages in the target instance via +a [reusable field schema](https://docs.kentico.com/x/D4_OD). The key differences are: + +* Categories in older versions can be added to any page via the *Properties -> Categories* tab. Taxonomies can only be + used for content items (pages, emails...) that have a field with the *Taxonomy* data type. +* Categories can be global or site-specific. Taxonomies are always global, as there are no sites in Xperience by + Kentico. +* Categories are assigned to pages regardless of their workflow step. Taxonomies are stored as a field and are covered + by workflow. As a result, assigned tags can be different in each workflow step. +* [Categories stored as a field](https://docs.kentico.com/x/wA_RBg) + and [personal categories](https://docs.kentico.com/x/IgqRBg) are not supported by the migration. The migration process for categories performs the following steps: -1. A new [taxonomy](https://docs.kentico.com/developers-and-admins/configuration/taxonomies) named **Categories** (code name `categories`) is created to house all categories from the source instance. -2. A new [reusable field schema](https://docs.kentico.com/x/D4_OD) named **Categories container** (code name `categories_container`) is created to allow linking tags to pages. - * The schema contains one field, **Categories_Legacy** (data type **Taxonomy**, configured to enable selection from the *Categories* taxonomy). -3. On the target instance, the *Categories container* reusable field schema is added to all content types where at least one page had a category assigned in the source instance. -4. Supported categories from the source instance are migrated as tags to the *Categories* taxonomy in the target instance. The category hierarchy from the source instance is maintained in the target instance. +1. A new [taxonomy](https://docs.kentico.com/developers-and-admins/configuration/taxonomies) named **Categories** (code + name `categories`) is created to house all categories from the source instance. +2. A new [reusable field schema](https://docs.kentico.com/x/D4_OD) named **Categories container** (code + name `categories_container`) is created to allow linking tags to pages. + +* The schema contains one field, **Categories_Legacy** (data type **Taxonomy**, configured to enable selection from the + *Categories* taxonomy). + +3. On the target instance, the *Categories container* reusable field schema is added to all content types where at least + one page had a category assigned in the source instance. +4. Supported categories from the source instance are migrated as tags to the *Categories* taxonomy in the target + instance. The category hierarchy from the source instance is maintained in the target instance. 5. On the target instance, tags are assigned to pages according to the source instance. - * Each [language variant](https://docs.kentico.com/business-users/website-content/translate-pages) of a page is treated individually and receives its corresponding group of tags based on the source instance. - * Tags from the source page are added to all available [workflow steps](https://docs.kentico.com/developers-and-admins/configuration/workflows) of the target page. + +* Each [language variant](https://docs.kentico.com/business-users/website-content/translate-pages) of a page is treated + individually and receives its corresponding group of tags based on the source instance. +* Tags from the source page are added to all + available [workflow steps](https://docs.kentico.com/developers-and-admins/configuration/workflows) of the target page. #### Custom modules and classes The migration includes the following: * Custom modules - * Note: The `CMS.` prefix/namespace is reserved for system modules and not allowed in custom module code names. If present, this code name prefix is removed during the migration. + * Note: The `CMS.` prefix/namespace is reserved for system modules and not allowed in custom module code names. If + present, this code name prefix is removed during the migration. * All classes belonging under custom modules * All data stored within custom module classes * The following customizable system classes and their custom fields: - * *Membership > User* - * *Media libraries > Media file* - * *Contact management > Contact management - Account* (however, accounts are currently not supported in Xperience by Kentico) - * *Contact management > Contact management - Contact* + * *Membership > User* + * *Media libraries > Media file* + * *Contact management > Contact management - Account* (however, accounts are currently not supported in Xperience by + Kentico) + * *Contact management > Contact management - Contact* Module and class migration does NOT include: -* UI elements and all related user interface settings. The administration of Xperience by Kentico uses a different technology stack than Kentico Xperience 13 and is incompatible. To learn how to build the administration UI, see [Extend the administration interface](https://docs.xperience.io/x/GwKQC) and [Example - Offices management application](https://docs.xperience.io/x/hIFwCg). -* Alternative forms under classes and UI-related configuration of class fields (field labels, Form controls, etc.). You need to manually create appropriate [UI forms](https://docs.xperience.io/x/V6rWCQ) in Xperience by Kentico after the migration. +* UI elements and all related user interface settings. The administration of Xperience by Kentico uses a different + technology stack than Kentico Xperience 13 and is incompatible. To learn how to build the administration UI, + see [Extend the administration interface](https://docs.xperience.io/x/GwKQC) + and [Example - Offices management application](https://docs.xperience.io/x/hIFwCg). +* Alternative forms under classes and UI-related configuration of class fields (field labels, Form controls, etc.). You + need to manually create appropriate [UI forms](https://docs.xperience.io/x/V6rWCQ) in Xperience by Kentico after the + migration. * Custom settings under modules, which are currently not supported in Xperience by Kentico -* Module permissions (permissions work differently in Xperience by Kentico, see [Role management](https://docs.xperience.io/x/7IVwCg) and [UI page permission checks](https://docs.xperience.io/x/8IKyCg)) +* Module permissions (permissions work differently in Xperience by Kentico, + see [Role management](https://docs.xperience.io/x/7IVwCg) + and [UI page permission checks](https://docs.xperience.io/x/8IKyCg)) -As with all object types, the Kentico Migration Tool does not transfer code files to the target project. You need to manually move all code files generated for your custom classes (*Info*, *InfoProvider*, etc.). +As with all object types, the Kentico Migration Tool does not transfer code files to the target project. You need to +manually move all code files generated for your custom classes (*Info*, *InfoProvider*, etc.). -To learn more about custom modules and classes in Xperience by Kentico, see the [Object types](https://docs.xperience.io/x/AKDWCQ) documentation. +To learn more about custom modules and classes in Xperience by Kentico, see +the [Object types](https://docs.xperience.io/x/AKDWCQ) documentation. #### Custom tables The migration includes the following: -* Basic information about custom tables (from the `CMS_Class` table) is migrated to the custom module table (`CMS_Resource`) as a special `customtables` resource. +* Basic information about custom tables (from the `CMS_Class` table) is migrated to the custom module + table (`CMS_Resource`) as a special `customtables` resource. * Content of individual custom tables is migrated as module classes. Custom table migration does NOT include: * Any other data related to custom tables (queries, alternative forms) are discarded by the migration. -* UI elements related to custom tables such as listings and filters are not migrated and need to be implemented. The administration of Xperience by Kentico uses a different technology stack than Kentico Xperience 13 and is incompatible. To learn how to build the administration UI, see [Extend the administration interface](https://docs.xperience.io/x/GwKQC) and [Example - Offices management application](https://docs.xperience.io/x/hIFwCg). +* UI elements related to custom tables such as listings and filters are not migrated and need to be implemented. The + administration of Xperience by Kentico uses a different technology stack than Kentico Xperience 13 and is + incompatible. To learn how to build the administration UI, + see [Extend the administration interface](https://docs.xperience.io/x/GwKQC) + and [Example - Offices management application](https://docs.xperience.io/x/hIFwCg). #### Media libraries @@ -204,64 +265,89 @@ Custom table migration does NOT include: #### Attachments -Page attachments are not supported in Xperience by Kentico. Attachment files are instead migrated into [media libraries](https://docs.xperience.io/x/agKiCQ). +Page attachments are not supported in Xperience by Kentico. Attachment files are instead migrated +into [media libraries](https://docs.xperience.io/x/agKiCQ). * Page attachments are migrated into a media library named: *"Attachments for site \"* -* The media library contains folders matching the content tree structure for all pages with attachments (including empty folders for parent pages without attachments). The folders are named after the *node alias* of the source pages. - * Each page's folder directly contains all unsorted attachments (files added on the *Attachments* tab in the source's *Pages* application). - * Attachments stored in specific page fields are placed into subfolders, named in format: *"__fieldname"*. These subfolders can include multiple files for fields of the *Attachments* type, or a single file for *File* type fields. +* The media library contains folders matching the content tree structure for all pages with attachments (including empty + folders for parent pages without attachments). The folders are named after the *node alias* of the source pages. + * Each page's folder directly contains all unsorted attachments (files added on the *Attachments* tab in the + source's *Pages* application). + * Attachments stored in specific page fields are placed into subfolders, named in format: *"__fieldname"*. These + subfolders can include multiple files for fields of the *Attachments* type, or a single file for *File* type + fields. * Any "floating" attachments without an associated page are migrated into the media library root folder. -* The migration does not include temporary attachments (created when a file upload is not finished correctly). If any are present on the source instance, a warning is logged in the [migration protocol](./MIGRATION_PROTOCOL_REFERENCE.md). +* The migration does not include temporary attachments (created when a file upload is not finished correctly). If any + are present on the source instance, a warning is logged in + the [migration protocol](./MIGRATION_PROTOCOL_REFERENCE.md). The following is an example of a media library created by the Kentico Migration Tool for page attachments: #### Media library "Attachments for site DancingGoat" * **Articles** (empty parent folder) - * **Coffee-processing-techniques** (contains any unsorted attachments of the '/Articles/Coffee-processing-techniques' page) - * **__Teaser** (contains attachments stored in the page's 'Teaser' field) - * **Which-brewing-fits-you** - * **__Teaser** - * ... + * **Coffee-processing-techniques** (contains any unsorted attachments of the ' + /Articles/Coffee-processing-techniques' page) + * **__Teaser** (contains attachments stored in the page's 'Teaser' field) + * **Which-brewing-fits-you** + * **__Teaser** + * ... -Additionally, any attachments placed into the content of migrated pages **will no longer work** in Xperience by Kentico. This includes images and file download links that use **/getattachment** and **/getimage** URLs. +Additionally, any attachments placed into the content of migrated pages **will no longer work** in Xperience by Kentico. +This includes images and file download links that use **/getattachment** and **/getimage** URLs. -If you wish to continue using these legacy attachment URLs from earlier Kentico versions, you need to add a custom handler to your Xperience by Kentico project. See [`Migration.Toolkit.KXP.Extensions/README.MD`](/Migration.Toolkit.KXP.Extensions/README.MD) for instructions. +If you wish to continue using these legacy attachment URLs from earlier Kentico versions, you need to add a custom +handler to your Xperience by Kentico project. +See [`Migration.Toolkit.KXP.Extensions/README.MD`](/Migration.Toolkit.KXP.Extensions/README.MD) for instructions. #### Forms The migration does not include the content of form autoresponder and notification emails. -You can migrate form autoresponders to Xperience by Kentico manually by copying your HTML code and content into Email templates and Emails. See [Emails](https://docs.xperience.io/x/IaDWCQ). +You can migrate form autoresponders to Xperience by Kentico manually by copying your HTML code and content into Email +templates and Emails. See [Emails](https://docs.xperience.io/x/IaDWCQ). #### Users -**Note**: Xperience by Kentico uses separate entities for users with access to the administration interface (*CMS_User* table) and live site visitor accounts (*CMS_Member* table). Consequently, only users whose *Privilege level* is set to *Editor* and above are migrated (*Users* -> edit a user -> *General* tab) via the `--users` command. To migrate live site accounts as well, use [`--members`](#migrate-command-parameters). +**Note**: Xperience by Kentico uses separate entities for users with access to the administration interface (*CMS_User* +table) and live site visitor accounts (*CMS_Member* table). Consequently, only users whose *Privilege level* is set to +*Editor* and above are migrated (*Users* -> edit a user -> *General* tab) via the `--users` command. To migrate live +site accounts as well, use [`--members`](#migrate-command-parameters). The command migrates all users with access to the administration interface. Note the following expected behavior: * The 'administrator' user account is only transferred from the source if it does not exist on the target instance. -* The 'public' system user is updated, and all bindings (e.g., the site binding) are mapped automatically on the target instance. +* The 'public' system user is updated, and all bindings (e.g., the site binding) are mapped automatically on the target + instance. * Site bindings are updated automatically for all migrated users. -* Users in Xperience by Kentico must have an email address. Migration is only supported for users with a **unique** email address on the source instance. - * If you encounter issues related to email validation, you can change the default validation behavior via the `CMSEmailValidationRegex` [application key](https://docs.xperience.io/x/yA6RBg). +* Users in Xperience by Kentico must have an email address. Migration is only supported for users with a **unique** + email address on the source instance. + * If you encounter issues related to email validation, you can change the default validation behavior via + the `CMSEmailValidationRegex` [application key](https://docs.xperience.io/x/yA6RBg). * Custom user fields can be migrated together with *module classes*. -Additionally, the command migrates all roles and user-role bindings for users whose *Privilege level* is *Editor* or higher. +Additionally, the command migrates all roles and user-role bindings for users whose *Privilege level* is *Editor* or +higher. -Because Xperience by Kentico uses a different [permission model](https://docs.xperience.io/x/7IVwCg), no existing role permissions or UI personalization settings are migrated. After the migration, the permissions for each role must be configured again. +Because Xperience by Kentico uses a different [permission model](https://docs.xperience.io/x/7IVwCg), no existing role +permissions or UI personalization settings are migrated. After the migration, the permissions for each role must be +configured again. #### Members -In Xperience by Kentico, live site users are represented using a separate **Member** entity and stored in the *CMS_Member* table. +In Xperience by Kentico, live site users are represented using a separate **Member** entity and stored in the +*CMS_Member* table. -The migration identifies live site users as those without access to the administration interface. That is, only those accounts whose *Privilege level* is set to *None* (Users -> edit a user -> General tab) are migrated. +The migration identifies live site users as those without access to the administration interface. That is, only those +accounts whose *Privilege level* is set to *None* (Users -> edit a user -> General tab) are migrated. The migration includes: -* All system fields from the *CMS_User* and *CMS_UserSettings* tables. You can customize which fields are migrated via the `MemberIncludeUserSystemFields` configuration option. See [configuration](#configuration). +* All system fields from the *CMS_User* and *CMS_UserSettings* tables. You can customize which fields are migrated via + the `MemberIncludeUserSystemFields` configuration option. See [configuration](#configuration). * All custom fields added to the *CMS_User* and *CMS_UserSettings* tables are migrated under `CMS_Member`. - > If you are migrating custom fields, the `--custom-modules` migration command must be run before the `--members` command. For example: + > If you are migrating custom fields, the `--custom-modules` migration command must be run before the `--members` + command. For example: ```powershell Migration.Toolkit.CLI.exe migrate --sites --custom-modules --users --members @@ -272,9 +358,12 @@ The migration ***DOES NOT*** include: * External login information associated with each account (e.g., Google or Facebook logins). * User password hashes from the `CMS_User.UserPassword` column. - After the migration, the corresponding `CMS_Member.MemberPassword` in the target Xperience by Kentico instance is `NULL`. This means that the migrated accounts **CANNOT** be used to sign in to the system under any circumstances. The account owners must first reset their password via ASP.NET Identity. + After the migration, the corresponding `CMS_Member.MemberPassword` in the target Xperience by Kentico instance + is `NULL`. This means that the migrated accounts **CANNOT** be used to sign in to the system under any circumstances. + The account owners must first reset their password via ASP.NET Identity. - See [Forms authentication](https://docs.xperience.io/x/t4ouCw) for a sample password reset process that can be adapted for this scenario. The general flow consists of these steps: + See [Forms authentication](https://docs.xperience.io/x/t4ouCw) for a sample password reset process that can be adapted + for this scenario. The general flow consists of these steps: 1. Select the migrated member accounts. @@ -304,7 +393,9 @@ The migration ***DOES NOT*** include: #### Contacts * Custom contact fields can be migrated together with *module classes*. -* For performance reasons, contacts and related objects are migrated using bulk SQL queries. As a result, you always need to delete all Contacts, Activities and Consent agreements before running the migration (when using the `migrate --contact-management` parameter). +* For performance reasons, contacts and related objects are migrated using bulk SQL queries. As a result, you always + need to delete all Contacts, Activities and Consent agreements before running the migration (when using + the `migrate --contact-management` parameter). ## Configuration @@ -312,24 +403,23 @@ Before you run the migration, configure options in the `Migration.Toolkit.CLI/ap Add the options under the `Settings` section in the configuration file. -| Configuration | Description | -|----------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------| -| KxConnectionString | The connection string to the source Kentico Xperience 13 database. | -| KxCmsDirPath | The absolute file system path of the **CMS** folder in the source Kentico Xperience 13 administration project. Required to migrate media library files. | -| XbKConnectionString | The connection string to the target Xperience by Kentico database. | -| XbKDirPath | The absolute file system path of the root of the target Xperience by Kentico project. Required to migrate media library and page attachment files. | -| XbKApiSettings | Configuration options set for the API when creating migrated objects in the target application.

The `ConnectionStrings.CMSConnectionString`option is required - set the connection string to the target Xperience by Kentico database (the same value as `XbKConnectionString`). | -| MigrationProtocolPath | The absolute file system path of the location where the [migration protocol file](./MIGRATION_PROTOCOL_REFERENCE.md) is generated.

For example: `"C:\\Logs\\Migration.Toolkit.Protocol.log"` | -| MigrateOnlyMediaFileInfo | If set to `true`, only the database representations of media files are migrated, without the files in the media folder in the project's file system. For example, enable this option if your media library files are mapped to a shared directory or Cloud storage.

If `false`, media files are migrated based on the `KxCmsDirPath` location. | -| MemberIncludeUserSystemFields | Determines which system fields from the *CMS_User* and *CMS_UserSettings* tables are migrated to *CMS_Member* in Xperience by Kentico. Fields that do not exist in *CMS_Member* are automatically created.

The sample `appsettings.json` file included with the tool by default includes all user fields that can be migrated from Kentico Xperience 13. Exclude specific fields from the migration by removing them from this configuration option. | -| UseOmActivityNodeRelationAutofix | Determines how the migration handles references from Contact management activities to non-existing pages.

Possible options:
`DiscardData` - faulty references are removed,
`AttemptFix` - references are updated to the IDs of corresponding pages created by the migration,
`Error` - an error is reported and the reference can be translated or otherwise handled manually | -| UseOmActivitySiteRelationAutofix | Determines how the migration handles site references from Contact management activities.

Possible options: `DiscardData`,`AttemptFix`,`Error` | -| EntityConfigurations | Contains options that allow you to fine-tune the migration of specific object types. | -| EntityConfigurations.*<object table name>*.ExcludeCodeNames | Excludes objects with the specified code names from the migration. | -| CreateReusableFieldSchemaForClasses | Specifies which page types are also converted to [reusable field schemas](#convert-page-types-to-reusable-field-schemas). | -| OptInFeatures.QuerySourceInstanceApi.Enabled | If `true`, [source instance API discovery](#source-instance-api-discovery) is enabled to allow advanced migration of Page Builder content for pages and page templates. | -| OptInFeatures.QuerySourceInstanceApi.Connections | To use [source instance API discovery](#source-instance-api-discovery), you need to add a connection JSON object containing the following values:
`SourceInstanceUri` - the base URI where the source instance's live site application is running.
`Secret` - the secret that you set in the *ToolkitApiController.cs* file on the source instance. | -| OptInFeatures.CustomMigration.FieldMigrations | Enables conversion of media selection text fields to media library files. See [Convert text fields with media links to media libraries](#convert-text-fields-with-media-links-to-media-libraries) for more information.| +| Configuration | Description | +|-------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| KxConnectionString | The connection string to the source Kentico Xperience 13 database. | +| KxCmsDirPath | The absolute file system path of the **CMS** folder in the source Kentico Xperience 13 administration project. Required to migrate media library files. | +| XbKDirPath | The absolute file system path of the root of the target Xperience by Kentico project. Required to migrate media library and page attachment files. | +| XbKApiSettings | Configuration options set for the API when creating migrated objects in the target application.

The `ConnectionStrings.CMSConnectionString`option is required - set the connection string to the target Xperience by Kentico database (the same value as `XbKConnectionString`). | +| MigrationProtocolPath | The absolute file system path of the location where the [migration protocol file](./MIGRATION_PROTOCOL_REFERENCE.md) is generated.

For example: `"C:\\Logs\\Migration.Toolkit.Protocol.log"` | +| MigrateOnlyMediaFileInfo | If set to `true`, only the database representations of media files are migrated, without the files in the media folder in the project's file system. For example, enable this option if your media library files are mapped to a shared directory or Cloud storage.

If `false`, media files are migrated based on the `KxCmsDirPath` location. | +| MemberIncludeUserSystemFields | Determines which system fields from the *CMS_User* and *CMS_UserSettings* tables are migrated to *CMS_Member* in Xperience by Kentico. Fields that do not exist in *CMS_Member* are automatically created.

The sample `appsettings.json` file included with the tool by default includes all user fields that can be migrated from Kentico Xperience 13. Exclude specific fields from the migration by removing them from this configuration option. | +| UseOmActivityNodeRelationAutofix | Determines how the migration handles references from Contact management activities to non-existing pages.

Possible options:
`DiscardData` - faulty references are removed,
`AttemptFix` - references are updated to the IDs of corresponding pages created by the migration,
`Error` - an error is reported and the reference can be translated or otherwise handled manually | +| UseOmActivitySiteRelationAutofix | Determines how the migration handles site references from Contact management activities.

Possible options: `DiscardData`,`AttemptFix`,`Error` | +| EntityConfigurations | Contains options that allow you to fine-tune the migration of specific object types. | +| EntityConfigurations.*<object table name>*.ExcludeCodeNames | Excludes objects with the specified code names from the migration. | +| CreateReusableFieldSchemaForClasses | Specifies which page types are also converted to [reusable field schemas](#convert-page-types-to-reusable-field-schemas). | +| OptInFeatures.QuerySourceInstanceApi.Enabled | If `true`, [source instance API discovery](#source-instance-api-discovery) is enabled to allow advanced migration of Page Builder content for pages and page templates. | +| OptInFeatures.QuerySourceInstanceApi.Connections | To use [source instance API discovery](#source-instance-api-discovery), you need to add a connection JSON object containing the following values:
`SourceInstanceUri` - the base URI where the source instance's live site application is running.
`Secret` - the secret that you set in the *ToolkitApiController.cs* file on the source instance. | +| OptInFeatures.CustomMigration.FieldMigrations | Enables conversion of media selection text fields to media library files. See [Convert text fields with media links to media libraries](#convert-text-fields-with-media-links-to-media-libraries) for more information. | ### Example @@ -351,7 +441,6 @@ Add the options under the `Settings` section in the configuration file. "Settings": { "KxConnectionString": "Data Source=myserver;Initial Catalog=Xperience13;Integrated Security=True;Persist Security Info=False;Connect Timeout=120;Encrypt=False;Current Language=English;", "KxCmsDirPath": "C:\\inetpub\\wwwroot\\Xperience13\\CMS", - "XbKConnectionString": "Data Source=myserver;Initial Catalog=XperienceByKentico;Integrated Security=True;Persist Security Info=False;Connect Timeout=120;Encrypt=False;Current Language=English;", "XbKDirPath": "C:\\inetpub\\wwwroot\\XP_Target", "XbKApiSettings": { "ConnectionStrings": { @@ -411,20 +500,34 @@ Add the options under the `Settings` section in the configuration file. > :warning: **Warning** – source instance API discovery is only available when migrating from Kentico Xperience 13. -By default, JSON data storing the Page Builder content of pages and custom page templates is migrated directly without modifications. Within this content, Page Builder components (widgets, sections, etc.) with properties have their configuration based on Kentico Xperience 13 form components, which are assigned to the properties on the source instance. On the target Xperience by Kentico instance, the migrated data can work in the Page Builder's legacy compatibility mode. +By default, JSON data storing the Page Builder content of pages and custom page templates is migrated directly without +modifications. Within this content, Page Builder components (widgets, sections, etc.) with properties have their +configuration based on Kentico Xperience 13 form components, which are assigned to the properties on the source +instance. On the target Xperience by Kentico instance, the migrated data can work in the Page Builder's legacy +compatibility mode. -However, we strongly recommend updating your codebase to the new Xperience by Kentico components. See [Editing components in Xperience by Kentico](https://docs.xperience.io/x/wIfWCQ) to learn more. +However, we strongly recommend updating your codebase to the new Xperience by Kentico components. +See [Editing components in Xperience by Kentico](https://docs.xperience.io/x/wIfWCQ) to learn more. -To convert Page Builder data to a format suitable for the Xperience by Kentico components, the Kentico Migration Tool provides an advanced migration mode that utilizes API discovery on the source instance. The advanced mode currently provides the following data conversion: +To convert Page Builder data to a format suitable for the Xperience by Kentico components, the Kentico Migration Tool +provides an advanced migration mode that utilizes API discovery on the source instance. The advanced mode currently +provides the following data conversion: -* **Attachment selector** properties - converted to a format suitable for the Xperience by Kentico **Media selector** component, with `IEnumerable` values. -* **Page selector** properties - converted to a format suitable for the Xperience by Kentico Page selector component, with `IEnumerable` values. +* **Attachment selector** properties - converted to a format suitable for the Xperience by Kentico **Media selector** + component, with `IEnumerable` values. +* **Page selector** properties - converted to a format suitable for the Xperience by Kentico Page selector component, + with `IEnumerable` values. ### Prerequisites and Limitations -* To use source instance API discovery, the live site application of your source instance must be running and available during the migration. -* Using the advanced Page Builder data migration **prevents the data from being used in the Page Builder's legacy compatibility mode**. With this approach, you need to update all Page Builder component code files to the [Xperience by Kentico format](https://docs.xperience.io/x/wIfWCQ). -* The source instance API discovery feature only processes component properties defined using `[EditingComponent]` attribute notation. Other implementations, such as properties edited via custom view components in the Razer view, are not supported. +* To use source instance API discovery, the live site application of your source instance must be running and available + during the migration. +* Using the advanced Page Builder data migration **prevents the data from being used in the Page Builder's legacy + compatibility mode**. With this approach, you need to update all Page Builder component code files to + the [Xperience by Kentico format](https://docs.xperience.io/x/wIfWCQ). +* The source instance API discovery feature only processes component properties defined using `[EditingComponent]` + attribute notation. Other implementations, such as properties edited via custom view components in the Razer view, are + not supported. ```csharp public class MyWidgetProperties : IWidgetProperties @@ -440,7 +543,8 @@ public class MyWidgetProperties : IWidgetProperties ### API discovery setup -1. Copy the `ToolkitApiController.cs` file to the `Controllers` folder in the **live site project** of your Kentico Xperience 13 source instance. Get the file from the following location in the Kentico Migration Tool repository: +1. Copy the `ToolkitApiController.cs` file to the `Controllers` folder in the **live site project** of your Kentico + Xperience 13 source instance. Get the file from the following location in the Kentico Migration Tool repository: * For .NET Core projects: `KX13.Extensions\ToolkitApiController.cs` * For MVC 5 (.NET Framework 4.8) projects: `KX13.NET48.Extensions\ToolkitApiController.NET48.cs` @@ -465,7 +569,8 @@ public class MyWidgetProperties : IWidgetProperties }); ``` - * For MVC 5 projects, map the routes in your application's `RouteCollection` (e.g., in the `/App_Start/RouteConfig.cs` file): + * For MVC 5 projects, map the routes in your application's `RouteCollection` (e.g., in + the `/App_Start/RouteConfig.cs` file): ```csharp public static void RegisterRoutes(RouteCollection routes) @@ -493,7 +598,8 @@ public class MyWidgetProperties : IWidgetProperties private const string Secret = "__your secret string__"; ``` -4. Configure the `Settings.OptInFeatures.QuerySourceInstanceApi` [configuration options](#configuration) for the Migration Tool: +4. Configure the `Settings.OptInFeatures.QuerySourceInstanceApi` [configuration options](#configuration) for the + Migration Tool: ```json "OptInFeatures":{ @@ -506,13 +612,19 @@ public class MyWidgetProperties : IWidgetProperties }, ``` -You can test the source instance API discovery by making a POST request to `/ToolkitApi/Test` with `{ "secret":"__your secret string__" }` in the body. If your setup is correct, the response should be: `{ "pong": true }` +You can test the source instance API discovery by making a POST request +to `/ToolkitApi/Test` with `{ "secret":"__your secret string__" }` in the body. If your +setup is correct, the response should be: `{ "pong": true }` -When you now [migrate data](#migrate-data), the tool performs API discovery of Page Builder component code on the source instance and advanced migration of Page Builder data. +When you now [migrate data](#migrate-data), the tool performs API discovery of Page Builder component code on the source +instance and advanced migration of Page Builder data. ## Convert page types to reusable field schemas -It is not possible to migrate any page types that inherit fields from other page types. However, to make the manual migration of such page types easier, you can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from specified parent page types. Specify a list of page types to be converted to reusable field schemas (separated with either `;` or `,`) in the `Settings.CreateReusableFieldSchemaForClasses` [configuration option](#configuration). +It is not possible to migrate any page types that inherit fields from other page types. However, to make the manual +migration of such page types easier, you can create [reusable field schemas](https://docs.kentico.com/x/D4_OD) from +specified parent page types. Specify a list of page types to be converted to reusable field schemas (separated with +either `;` or `,`) in the `Settings.CreateReusableFieldSchemaForClasses` [configuration option](#configuration). The following example specifies two page types from which reusable schemas are created: @@ -526,22 +638,36 @@ The following example specifies two page types from which reusable schemas are c > :warning: **Notes** > -> * Conversion of page types to reusable field schemas works best when all field names of page types are unique (i.e., prefixed with the page type name). If multiple page types converted to reusable field schemas have fields with the same code name, the code name is prefixed with the content type name in the converted reusable field schemas. +> * Conversion of page types to reusable field schemas works best when all field names of page types are unique (i.e., + prefixed with the page type name). If multiple page types converted to reusable field schemas have fields with the + same code name, the code name is prefixed with the content type name in the converted reusable field schemas. > * Page types specified by this configuration option are also migrated as content types into to the target instance. ## Convert text fields with media links to media libraries -By default, page type and module class fields with the _Text_ data type and the _Media selection_ [form control](https://docs.xperience.io/x/0A_RBg) from the source instance are converted to plain _Text_ fields in the target instance. You can instead configure the Kentico Migration Tool to convert these fields to the _Media files_ data type and use the _Media file selector_ form component. +By default, page type and module class fields with the _Text_ data type and the _Media +selection_ [form control](https://docs.xperience.io/x/0A_RBg) from the source instance are converted to plain _Text_ +fields in the target instance. You can instead configure the Kentico Migration Tool to convert these fields to the +_Media files_ data type and use the _Media file selector_ form component. -* Attachment links (containing a `getattachment` handler) are migrated as [attachments](#attachments) and changed to the _Media files_ data type. -* Media file links (containing a `getmedia` handler) are changed to the _Media files_ data type. It is expected that the media library containing the targeted file has been migrated. +* Attachment links (containing a `getattachment` handler) are migrated as [attachments](#attachments) and changed to the + _Media files_ data type. +* Media file links (containing a `getmedia` handler) are changed to the _Media files_ data type. It is expected that the + media library containing the targeted file has been migrated. > :warning: **Notes** > -> * Only media libraries using the **Permanent** [file URL format](https://docs.xperience.io/x/xQ_RBg) are supported. Content from media libraries with enabled **Use direct path for files in content** setting will not be converted. -> * If you enable this feature, you also need to change retrieval and handling of affected files in your code, as the structure of the stored data changes from a text path (e.g.,`~/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100`) to a _Media files_ data type (internally stored as e.g., `[{"Identifier":"CCEAD0F0-E2BF-459B-814A-36699E5C773E","Some file":"somefile.jpeg","Size":11803,"Dimensions":{"Width":300,"Height":100}}]`). The value of the field now needs to be [retrieved as a media library file](https://docs.xperience.io/x/LA2RBg). - -To enable this feature, configure the `OptInFeatures.CustomMigration.FieldMigrations` [options](#configuration) for this tool. Use the values in the code snippet below: +> * Only media libraries using the **Permanent** [file URL format](https://docs.xperience.io/x/xQ_RBg) are supported. + Content from media libraries with enabled **Use direct path for files in content** setting will not be converted. +> * If you enable this feature, you also need to change retrieval and handling of affected files in your code, as the + structure of the stored data changes from a text path ( + e.g.,`~/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100`) to a _Media files_ data + type (internally stored as + e.g., `[{"Identifier":"CCEAD0F0-E2BF-459B-814A-36699E5C773E","Some file":"somefile.jpeg","Size":11803,"Dimensions":{"Width":300,"Height":100}}]`). + The value of the field now needs to be [retrieved as a media library file](https://docs.xperience.io/x/LA2RBg). + +To enable this feature, configure the `OptInFeatures.CustomMigration.FieldMigrations` [options](#configuration) for this +tool. Use the values in the code snippet below: ```json "OptInFeatures":{ @@ -560,4 +686,5 @@ To enable this feature, configure the `OptInFeatures.CustomMigration.FieldMigrat } ``` -`FieldNameRegex` - a regular expression used to filter what fields are converted. Only fields with field names that match the regular expressions are converted. Use `.*` to match all fields. +`FieldNameRegex` - a regular expression used to filter what fields are converted. Only fields with field names that +match the regular expressions are converted. Use `.*` to match all fields. diff --git a/Migration.Toolkit.CLI/appsettings.json b/Migration.Toolkit.CLI/appsettings.json index 44faee4a..d9da159d 100644 --- a/Migration.Toolkit.CLI/appsettings.json +++ b/Migration.Toolkit.CLI/appsettings.json @@ -18,7 +18,6 @@ "Settings": { "KxConnectionString": "[TODO]", "KxCmsDirPath": "[TODO]", - "XbKConnectionString": "[TODO]", "XbKDirPath": "[TODO]", "MigrateOnlyMediaFileInfo": false, "XbKApiSettings": { @@ -27,11 +26,14 @@ } }, "CreateReusableFieldSchemaForClasses": "", - "OptInFeatures":{ + "OptInFeatures": { "QuerySourceInstanceApi": { "Enabled": false, "Connections": [ - { "SourceInstanceUri": "[TODO]", "Secret": "[TODO]" } + { + "SourceInstanceUri": "[TODO]", + "Secret": "[TODO]" + } ] } }, @@ -39,10 +41,12 @@ "UseOmActivitySiteRelationAutofix": "AttemptFix", "EntityConfigurations": { "CMS_Class": { - "ExcludeCodeNames": [ "dd" ] + "ExcludeCodeNames": [ + "dd" + ] }, "CMS_SettingsKey": { - "ExcludeCodeNames": [ ] + "ExcludeCodeNames": [] } }, "MemberIncludeUserSystemFields": "FirstName|MiddleName|LastName|FullName|UserPassword|PreferredCultureCode|PreferredUICultureCode|UserPrivilegeLevel|UserIsExternal|UserPasswordFormat|LastLogon|UserStartingAliasPath|UserLastModified|UserLastLogonInfo|UserIsHidden|UserIsDomain|UserHasAllowedCultures|UserMFRequired|UserMFSecret|UserMFTimestep|UserNickName|UserSignature|UserURLReferrer|UserCampaign|UserCustomData|UserRegistrationInfo|UserActivationDate|UserActivatedByUserID|UserTimeZoneID|UserAvatarID|UserGender|UserDateOfBirth|UserSettingsUserGUID|UserSettingsUserID|UserWaitingForApproval|UserDialogsConfiguration|UserDescription|UserAuthenticationGUID|UserSkype|UserIM|UserPhone|UserPosition|UserLogActivities|UserPasswordRequestHash|UserInvalidLogOnAttempts|UserInvalidLogOnAttemptsHash|UserPasswordLastChanged|UserAccountLockReason|UserShowIntroductionTile|UserDashboardApplications|UserDismissedSmartTips" diff --git a/Migration.Toolkit.Common/Abstractions/Command.cs b/Migration.Toolkit.Common/Abstractions/Command.cs index eb2c8ff4..58e19401 100644 --- a/Migration.Toolkit.Common/Abstractions/Command.cs +++ b/Migration.Toolkit.Common/Abstractions/Command.cs @@ -1,18 +1,18 @@ -namespace Migration.Toolkit.Common.Abstractions; - -using System.Reflection; - -public interface ICommand -{ - Type[] Dependencies { get; } - - int Rank => (int)(GetType().GetField("Rank", BindingFlags.Static | BindingFlags.Public)?.GetValue(null) ?? 999); - - static virtual string Moniker { get; } = ""; - static virtual string MonikerFriendly { get; } = ""; -} - -public interface ICultureReliantCommand -{ - string CultureCode { get; } -} \ No newline at end of file +using System.Reflection; + +namespace Migration.Toolkit.Common.Abstractions; + +public interface ICommand +{ + Type[] Dependencies { get; } + + int Rank => (int)(GetType().GetField("Rank", BindingFlags.Static | BindingFlags.Public)?.GetValue(null) ?? 999); + + static virtual string Moniker { get; } = ""; + static virtual string MonikerFriendly { get; } = ""; +} + +public interface ICultureReliantCommand +{ + string CultureCode { get; } +} diff --git a/Migration.Toolkit.Common/Abstractions/CommandResult.cs b/Migration.Toolkit.Common/Abstractions/CommandResult.cs index 77e184b7..6b491e5e 100644 --- a/Migration.Toolkit.Common/Abstractions/CommandResult.cs +++ b/Migration.Toolkit.Common/Abstractions/CommandResult.cs @@ -1,7 +1,9 @@ -namespace Migration.Toolkit.Common.Abstractions; - -public abstract record CommandResult(); - -public record GenericCommandResult() : CommandResult; -public record CommandFailureResult() : CommandResult; -public record CommandCheckFailedResult(bool CanContinue) : CommandResult; \ No newline at end of file +namespace Migration.Toolkit.Common.Abstractions; + +public abstract record CommandResult; + +public record GenericCommandResult : CommandResult; + +public record CommandFailureResult : CommandResult; + +public record CommandCheckFailedResult(bool CanContinue) : CommandResult; diff --git a/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs b/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs index 04b11296..b3dd38d5 100644 --- a/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs +++ b/Migration.Toolkit.Common/Abstractions/EntityMapperBase.cs @@ -1,184 +1,168 @@ -namespace Migration.Toolkit.Common.Abstractions; - -using System.Linq.Expressions; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.MigrationProtocol; - -public abstract class EntityMapperBase : IEntityMapper -{ - private readonly ILogger _logger; - private readonly IPrimaryKeyMappingContext _pkContext; - protected readonly IProtocol Protocol; - - protected EntityMapperBase(ILogger logger, IPrimaryKeyMappingContext pkContext, IProtocol protocol) - { - _logger = logger; - _pkContext = pkContext; - Protocol = protocol; - } - - public virtual IModelMappingResult Map(TSourceEntity? source, TTargetEntity? target) - { - var failures = new List>(); - var mappingHelper = new MappingHelper(_pkContext, failures.Add); - - if (source is null) - { - _logger.LogTrace("Source entity is not defined"); - return HandbookReferences.SourceEntityIsNull().AsFailure().Log(_logger, Protocol); - } - - var newInstance = false; - if (target is null) - { - _logger.LogTrace("Null target supplied, creating new instance"); - target = CreateNewInstance(source, mappingHelper, failures.Add); - if (target == null || object.Equals(target, default) || failures.Count > 0) - { - return new AggregatedResult(failures).Log(_logger, Protocol); - } - - newInstance = true; - } - - var mappedResult = MapInternal(source, target, newInstance, mappingHelper, failures.Add); - - return failures.Count > 0 - ? new AggregatedResult(failures).Log(_logger, Protocol) - : new MapperResultSuccess(mappedResult, newInstance).Log(_logger, Protocol); - } - - protected abstract TTargetEntity? CreateNewInstance(TSourceEntity source, MappingHelper mappingHelper, AddFailure addFailure); - protected abstract TTargetEntity MapInternal(TSourceEntity source, TTargetEntity target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure); - - protected delegate void AddFailure(MapperResultFailure failure); - - protected class MappingHelper - { - private readonly IPrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly Action> _addFailure; - - public MappingHelper(IPrimaryKeyMappingContext primaryKeyMappingContext, Action> addFailure) - { - _primaryKeyMappingContext = primaryKeyMappingContext; - _addFailure = addFailure; - } - - public Guid Require(Guid? value, string valueName) - { - if (value is { } v && v != Guid.Empty) - { - return v; - } - - var failure = HandbookReferences - .SourceValueIsRequired(valueName) - .AsFailure() - ; - - _addFailure(failure); - return Guid.Empty; - } - - public int Require(int? value, string valueName) - { - if (value is { } v) - { - return v; - } - - var failure = HandbookReferences - .SourceValueIsRequired(valueName) - .AsFailure() - ; - - _addFailure(failure); - return -1; - } - - public bool Require(bool? value, string valueName) - { - if (value is { } v) - { - return v; - } - - var failure = HandbookReferences - .SourceValueIsRequired(valueName) - .AsFailure() - ; - - _addFailure(failure); - return false; - } - - public DateTime Require(DateTime? value, string valueName) - { - if (value is { } v) - { - return v; - } - - var failure = HandbookReferences - .SourceValueIsRequired(valueName) - .AsFailure() - ; - - _addFailure(failure); - return DateTime.MinValue; - } - - public bool TranslateIdAllowNulls(Expression> keyNameSelector, int? sourceId, out int? translatedId) - { - if (sourceId == null) - { - translatedId = null; - return true; - } - - translatedId = _primaryKeyMappingContext.MapFromSourceOrNull(keyNameSelector, sourceId); - if (!translatedId.HasValue) - { - var memberName = keyNameSelector.GetMemberName(); - var failure = HandbookReferences - .MissingRequiredDependency(memberName, sourceId) - .NeedsManualAction() - .AsFailure() - ; - - _addFailure(failure); - return false; - } - - return true; - } - - public bool TryTranslateId(Expression> keyNameSelector, int? sourceId, out int? translatedId) - { - translatedId = _primaryKeyMappingContext.MapFromSourceOrNull(keyNameSelector, sourceId); - if (sourceId.HasValue && !translatedId.HasValue) - { - return false; - } - - return true; - } - - public bool TranslateRequiredId(Expression> keyNameSelector, int? sourceId, out int translatedId) - { - if (_primaryKeyMappingContext.TryRequireMapFromSource(keyNameSelector, sourceId, out translatedId)) - { - return true; - } - - var memberName = keyNameSelector.GetMemberName(); - var failure = HandbookReferences - .MissingRequiredDependency(memberName, sourceId) - .NeedsManualAction() - .AsFailure() - ; - _addFailure(failure); - return false; - } - } -} \ No newline at end of file +using System.Linq.Expressions; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.MigrationProtocol; + +namespace Migration.Toolkit.Common.Abstractions; + +public abstract class EntityMapperBase(ILogger logger, IPrimaryKeyMappingContext pkContext, IProtocol protocol) : IEntityMapper +{ + protected readonly IProtocol Protocol = protocol; + + public virtual IModelMappingResult Map(TSourceEntity? source, TTargetEntity? target) + { + var failures = new List>(); + var mappingHelper = new MappingHelper(pkContext, failures.Add); + + if (source is null) + { + logger.LogTrace("Source entity is not defined"); + return HandbookReferences.SourceEntityIsNull().AsFailure().Log(logger, Protocol); + } + + bool newInstance = false; + if (target is null) + { + logger.LogTrace("Null target supplied, creating new instance"); + target = CreateNewInstance(source, mappingHelper, failures.Add); + if (target == null || Equals(target, default) || failures.Count > 0) + { + return new AggregatedResult(failures).Log(logger, Protocol); + } + + newInstance = true; + } + + var mappedResult = MapInternal(source, target, newInstance, mappingHelper, failures.Add); + + return failures.Count > 0 + ? new AggregatedResult(failures).Log(logger, Protocol) + : new MapperResultSuccess(mappedResult, newInstance).Log(logger, Protocol); + } + + protected abstract TTargetEntity? CreateNewInstance(TSourceEntity source, MappingHelper mappingHelper, AddFailure addFailure); + protected abstract TTargetEntity MapInternal(TSourceEntity source, TTargetEntity target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure); + + protected delegate void AddFailure(MapperResultFailure failure); + + protected class MappingHelper(IPrimaryKeyMappingContext primaryKeyMappingContext, Action> addFailure) + { + public Guid Require(Guid? value, string valueName) + { + if (value is { } v && v != Guid.Empty) + { + return v; + } + + var failure = HandbookReferences + .SourceValueIsRequired(valueName) + .AsFailure() + ; + + addFailure(failure); + return Guid.Empty; + } + + public int Require(int? value, string valueName) + { + if (value is { } v) + { + return v; + } + + var failure = HandbookReferences + .SourceValueIsRequired(valueName) + .AsFailure() + ; + + addFailure(failure); + return -1; + } + + public bool Require(bool? value, string valueName) + { + if (value is { } v) + { + return v; + } + + var failure = HandbookReferences + .SourceValueIsRequired(valueName) + .AsFailure() + ; + + addFailure(failure); + return false; + } + + public DateTime Require(DateTime? value, string valueName) + { + if (value is { } v) + { + return v; + } + + var failure = HandbookReferences + .SourceValueIsRequired(valueName) + .AsFailure() + ; + + addFailure(failure); + return DateTime.MinValue; + } + + public bool TranslateIdAllowNulls(Expression> keyNameSelector, int? sourceId, out int? translatedId) + { + if (sourceId == null) + { + translatedId = null; + return true; + } + + translatedId = primaryKeyMappingContext.MapFromSourceOrNull(keyNameSelector, sourceId); + if (!translatedId.HasValue) + { + string memberName = keyNameSelector.GetMemberName(); + var failure = HandbookReferences + .MissingRequiredDependency(memberName, sourceId) + .NeedsManualAction() + .AsFailure() + ; + + addFailure(failure); + return false; + } + + return true; + } + + public bool TryTranslateId(Expression> keyNameSelector, int? sourceId, out int? translatedId) + { + translatedId = primaryKeyMappingContext.MapFromSourceOrNull(keyNameSelector, sourceId); + if (sourceId.HasValue && !translatedId.HasValue) + { + return false; + } + + return true; + } + + public bool TranslateRequiredId(Expression> keyNameSelector, int? sourceId, out int translatedId) + { + if (primaryKeyMappingContext.TryRequireMapFromSource(keyNameSelector, sourceId, out translatedId)) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + var failure = HandbookReferences + .MissingRequiredDependency(memberName, sourceId) + .NeedsManualAction() + .AsFailure() + ; + addFailure(failure); + return false; + } + } +} diff --git a/Migration.Toolkit.Common/Abstractions/IEntityMapper.cs b/Migration.Toolkit.Common/Abstractions/IEntityMapper.cs index 535efd2a..dea3c5ce 100644 --- a/Migration.Toolkit.Common/Abstractions/IEntityMapper.cs +++ b/Migration.Toolkit.Common/Abstractions/IEntityMapper.cs @@ -1,13 +1,13 @@ -namespace Migration.Toolkit.Common.Abstractions; - -using Kentico.Xperience.UMT.Model; - -public interface IEntityMapper -{ - IModelMappingResult Map(TSourceEntity? source, TTargetEntity? target); -} - -public interface IUmtMapper -{ - IEnumerable Map(TSourceEntity source); -} \ No newline at end of file +using Kentico.Xperience.UMT.Model; + +namespace Migration.Toolkit.Common.Abstractions; + +public interface IEntityMapper +{ + IModelMappingResult Map(TSourceEntity? source, TTargetEntity? target); +} + +public interface IUmtMapper +{ + IEnumerable Map(TSourceEntity source); +} diff --git a/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs b/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs index 8bc0abe6..18870f9b 100644 --- a/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs +++ b/Migration.Toolkit.Common/Abstractions/IModuleLoader.cs @@ -1,6 +1,6 @@ -namespace Migration.Toolkit.Common.Abstractions; - -public interface IModuleLoader -{ - Task LoadAsync(); -} \ No newline at end of file +namespace Migration.Toolkit.Common.Abstractions; + +public interface IModuleLoader +{ + Task LoadAsync(); +} diff --git a/Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs b/Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs index e34c1d18..dc3e5b09 100644 --- a/Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs +++ b/Migration.Toolkit.Common/Abstractions/ModelMappingResult.cs @@ -1,45 +1,45 @@ -namespace Migration.Toolkit.Common.Abstractions; - -using Migration.Toolkit.Common.MigrationProtocol; - -public interface IModelMappingResult -{ - bool Success { get; } -} - -public interface IModelMappingResult : IModelMappingResult -{ - TResult? Item { get; } - bool NewInstance { get; } - HandbookReference? HandbookReference { get; } - - void Deconstruct(out TResult? item, out bool newInstance) - { - item = this.Item; - newInstance = this.NewInstance; - } - void Deconstruct(out HandbookReference? handbookReference) - { - handbookReference = this.HandbookReference; - } -} - -public record AggregatedResult(IEnumerable> Results) : IModelMappingResult -{ - public TResult? Item => default; - - public bool NewInstance => false; - - public HandbookReference? HandbookReference => throw new NotImplementedException(); - - public bool Success => this.Results.All(x => x.Success); -} - -public record MapperResult(TResult? Item, bool NewInstance, bool Success, HandbookReference? HandbookReference) : IModelMappingResult; -public record MapperResultSuccess(TResult? Item, bool NewInstance) : MapperResult(Item, NewInstance, true, null); -public record MapperResultFailure(HandbookReference HandbookReference) : MapperResult(default, false, false, HandbookReference); - -public static class Extensions -{ - public static MapperResultFailure AsFailure(this HandbookReference reference) => new MapperResultFailure(reference); -} \ No newline at end of file +using Migration.Toolkit.Common.MigrationProtocol; + +namespace Migration.Toolkit.Common.Abstractions; + +public interface IModelMappingResult +{ + bool Success { get; } +} + +public interface IModelMappingResult : IModelMappingResult +{ + TResult? Item { get; } + bool NewInstance { get; } + HandbookReference? HandbookReference { get; } + + void Deconstruct(out TResult? item, out bool newInstance) + { + item = Item; + newInstance = NewInstance; + } + + void Deconstruct(out HandbookReference? handbookReference) => handbookReference = HandbookReference; +} + +public record AggregatedResult(IEnumerable> Results) : IModelMappingResult +{ + public TResult? Item => default; + + public bool NewInstance => false; + + public HandbookReference? HandbookReference => throw new NotImplementedException(); + + public bool Success => Results.All(x => x.Success); +} + +public record MapperResult(TResult? Item, bool NewInstance, bool Success, HandbookReference? HandbookReference) : IModelMappingResult; + +public record MapperResultSuccess(TResult? Item, bool NewInstance) : MapperResult(Item, NewInstance, true, null); + +public record MapperResultFailure(HandbookReference HandbookReference) : MapperResult(default, false, false, HandbookReference); + +public static class Extensions +{ + public static MapperResultFailure AsFailure(this HandbookReference reference) => new(reference); +} diff --git a/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs b/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs index bce19608..6483555b 100644 --- a/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs +++ b/Migration.Toolkit.Common/Abstractions/UmtMapperBase.cs @@ -1,13 +1,10 @@ -namespace Migration.Toolkit.Common.Abstractions; - -using Kentico.Xperience.UMT.Model; - -public abstract class UmtMapperBase : IUmtMapper -{ - public IEnumerable Map(TSourceEntity source) - { - return MapInternal(source); - } - - protected abstract IEnumerable MapInternal(TSourceEntity source); -} \ No newline at end of file +using Kentico.Xperience.UMT.Model; + +namespace Migration.Toolkit.Common.Abstractions; + +public abstract class UmtMapperBase : IUmtMapper +{ + public IEnumerable Map(TSourceEntity source) => MapInternal(source); + + protected abstract IEnumerable MapInternal(TSourceEntity source); +} diff --git a/Migration.Toolkit.Common/Commands.cs b/Migration.Toolkit.Common/Commands.cs index bb8f571a..461e9bb0 100644 --- a/Migration.Toolkit.Common/Commands.cs +++ b/Migration.Toolkit.Common/Commands.cs @@ -1,145 +1,145 @@ -namespace Migration.Toolkit.Common; - -using MediatR; -using Migration.Toolkit.Common.Abstractions; - -public record MigrateSitesCommand : IRequest, ICommand -{ - public static readonly int Rank = 1; - - public static string Moniker => "sites"; - public static string MonikerFriendly => "Sites"; - - public Type[] Dependencies => []; -} - -public record MigrateUsersCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateCustomModulesCommand.Rank; - - public static string Moniker => "users"; - public static string MonikerFriendly => "Users"; - - public Type[] Dependencies => [typeof(MigrateCustomModulesCommand)]; -} - -public record MigrateMembersCommand : IRequest, ICommand -{ - public static readonly int Rank = 2 + MigrateSitesCommand.Rank + MigrateCustomModulesCommand.Rank; - - public static string Moniker => "members"; - public static string MonikerFriendly => "Members"; - - public Type[] Dependencies => [typeof(MigrateCustomModulesCommand)]; -} - -public record MigrateContactManagementCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateUsersCommand.Rank + MigrateCustomModulesCommand.Rank; - - public static string Moniker => "contact-management"; - public static string MonikerFriendly => "Contact management"; - - public Type[] Dependencies => [typeof(MigrateUsersCommand), typeof(MigrateCustomModulesCommand)]; -} - -public record MigrateDataProtectionCommand : IRequest, ICommand -{ - public static readonly int Rank = 5 + +MigrateSitesCommand.Rank + MigrateContactManagementCommand.Rank; - - public static string Moniker => "data-protection"; - public static string MonikerFriendly => "Data protection"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateContactManagementCommand)]; -} - -public record MigrateFormsCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateCustomModulesCommand.Rank + MigrateUsersCommand.Rank; - - public static string Moniker => "forms"; - public static string MonikerFriendly => "Forms"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateCustomModulesCommand), typeof(MigrateUsersCommand)]; -} - -public record MigrateMediaLibrariesCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateUsersCommand.Rank + MigrateCustomModulesCommand.Rank; - - public static string Moniker => "media-libraries"; - public static string MonikerFriendly => "Media libraries"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateUsersCommand), typeof(MigrateCustomModulesCommand)]; -} - -public record MigratePageTypesCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank; - - public static string Moniker => "page-types"; - public static string MonikerFriendly => "Page types"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand)]; -} - -public record MigratePagesCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateUsersCommand.Rank + MigratePageTypesCommand.Rank; - - public static string Moniker => "pages"; - public static string MonikerFriendly => "Pages"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateUsersCommand), typeof(MigratePageTypesCommand)]; -} - -public record MigrateCategoriesCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateUsersCommand.Rank + MigratePageTypesCommand.Rank + MigratePagesCommand.Rank; - - public static string Moniker => "categories"; - public static string MonikerFriendly => "Categories"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateUsersCommand), typeof(MigratePageTypesCommand), typeof(MigratePagesCommand)]; -} - -public record MigrateSettingKeysCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank; - - public static string Moniker => "settings-keys"; - public static string MonikerFriendly => "Settings keys"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand)]; -} - -public record MigrateAttachmentsCommand(string CultureCode) : IRequest, ICommand, ICultureReliantCommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateCustomModulesCommand.Rank; - - public static string Moniker => "attachments"; - public static string MonikerFriendly => "Attachments"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateCustomModulesCommand)]; -} - -public record MigrateCustomModulesCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank; - - public static string Moniker => "custom-modules"; - public static string MonikerFriendly => "Custom modules"; - - public Type[] Dependencies => [typeof(MigrateSitesCommand)]; -} - - -public record MigrateCustomTablesCommand : IRequest, ICommand -{ - public static readonly int Rank = 1 + MigrateSitesCommand.Rank; - - public static string Moniker => "custom-tables"; - public static string MonikerFriendly => "Custom tables"; - - public Type[] Dependencies => []; -} \ No newline at end of file +using MediatR; + +using Migration.Toolkit.Common.Abstractions; + +namespace Migration.Toolkit.Common; + +public record MigrateSitesCommand : IRequest, ICommand +{ + public static readonly int Rank = 1; + + public static string Moniker => "sites"; + public static string MonikerFriendly => "Sites"; + + public Type[] Dependencies => []; +} + +public record MigrateUsersCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateCustomModulesCommand.Rank; + + public static string Moniker => "users"; + public static string MonikerFriendly => "Users"; + + public Type[] Dependencies => [typeof(MigrateCustomModulesCommand)]; +} + +public record MigrateMembersCommand : IRequest, ICommand +{ + public static readonly int Rank = 2 + MigrateSitesCommand.Rank + MigrateCustomModulesCommand.Rank; + + public static string Moniker => "members"; + public static string MonikerFriendly => "Members"; + + public Type[] Dependencies => [typeof(MigrateCustomModulesCommand)]; +} + +public record MigrateContactManagementCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateUsersCommand.Rank + MigrateCustomModulesCommand.Rank; + + public static string Moniker => "contact-management"; + public static string MonikerFriendly => "Contact management"; + + public Type[] Dependencies => [typeof(MigrateUsersCommand), typeof(MigrateCustomModulesCommand)]; +} + +public record MigrateDataProtectionCommand : IRequest, ICommand +{ + public static readonly int Rank = 5 + +MigrateSitesCommand.Rank + MigrateContactManagementCommand.Rank; + + public static string Moniker => "data-protection"; + public static string MonikerFriendly => "Data protection"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateContactManagementCommand)]; +} + +public record MigrateFormsCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateCustomModulesCommand.Rank + MigrateUsersCommand.Rank; + + public static string Moniker => "forms"; + public static string MonikerFriendly => "Forms"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateCustomModulesCommand), typeof(MigrateUsersCommand)]; +} + +public record MigrateMediaLibrariesCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateUsersCommand.Rank + MigrateCustomModulesCommand.Rank; + + public static string Moniker => "media-libraries"; + public static string MonikerFriendly => "Media libraries"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateUsersCommand), typeof(MigrateCustomModulesCommand)]; +} + +public record MigratePageTypesCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank; + + public static string Moniker => "page-types"; + public static string MonikerFriendly => "Page types"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand)]; +} + +public record MigratePagesCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateUsersCommand.Rank + MigratePageTypesCommand.Rank; + + public static string Moniker => "pages"; + public static string MonikerFriendly => "Pages"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateUsersCommand), typeof(MigratePageTypesCommand)]; +} + +public record MigrateCategoriesCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateUsersCommand.Rank + MigratePageTypesCommand.Rank + MigratePagesCommand.Rank; + + public static string Moniker => "categories"; + public static string MonikerFriendly => "Categories"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateUsersCommand), typeof(MigratePageTypesCommand), typeof(MigratePagesCommand)]; +} + +public record MigrateSettingKeysCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank; + + public static string Moniker => "settings-keys"; + public static string MonikerFriendly => "Settings keys"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand)]; +} + +public record MigrateAttachmentsCommand(string CultureCode) : IRequest, ICommand, ICultureReliantCommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank + MigrateCustomModulesCommand.Rank; + + public static string Moniker => "attachments"; + public static string MonikerFriendly => "Attachments"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand), typeof(MigrateCustomModulesCommand)]; +} + +public record MigrateCustomModulesCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank; + + public static string Moniker => "custom-modules"; + public static string MonikerFriendly => "Custom modules"; + + public Type[] Dependencies => [typeof(MigrateSitesCommand)]; +} + +public record MigrateCustomTablesCommand : IRequest, ICommand +{ + public static readonly int Rank = 1 + MigrateSitesCommand.Rank; + + public static string Moniker => "custom-tables"; + public static string MonikerFriendly => "Custom tables"; + + public Type[] Dependencies => []; +} diff --git a/Migration.Toolkit.Common/CommonDiExtensions.cs b/Migration.Toolkit.Common/CommonDiExtensions.cs index 36380844..0e5676eb 100644 --- a/Migration.Toolkit.Common/CommonDiExtensions.cs +++ b/Migration.Toolkit.Common/CommonDiExtensions.cs @@ -1,15 +1,16 @@ -namespace Migration.Toolkit.Common; - -using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common.MigrationProtocol; - -public static class CommonDiExtensions -{ - public static IServiceCollection UseToolkitCommon(this IServiceCollection services) - { - services.AddSingleton(); - services.AddSingleton(); - services.AddSingleton(); - return services; - } -} \ No newline at end of file +using Microsoft.Extensions.DependencyInjection; + +using Migration.Toolkit.Common.MigrationProtocol; + +namespace Migration.Toolkit.Common; + +public static class CommonDiExtensions +{ + public static IServiceCollection UseToolkitCommon(this IServiceCollection services) + { + services.AddSingleton(); + services.AddSingleton(); + services.AddSingleton(); + return services; + } +} diff --git a/Migration.Toolkit.Common/ConfigurationNames.cs b/Migration.Toolkit.Common/ConfigurationNames.cs index 4964e290..05b360ee 100644 --- a/Migration.Toolkit.Common/ConfigurationNames.cs +++ b/Migration.Toolkit.Common/ConfigurationNames.cs @@ -1,65 +1,56 @@ -namespace Migration.Toolkit.Common; - -public class ConfigurationNames -{ - [Obsolete("Use 'XbKConnectionString' instead.")] - public const string SourceConnectionString = "SourceConnectionString"; - public const string KxConnectionString = "KxConnectionString"; - [Obsolete("Use 'XbKConnectionString' instead.")] - public const string SourceCmsDirPath = "SourceCmsDirPath"; - public const string KxCmsDirPath = "KxCmsDirPath"; - - [Obsolete("Use 'XbKConnectionString' instead.")] - public const string TargetConnectionString = "TargetConnectionString"; - public const string XbKConnectionString = "XbKConnectionString"; - [Obsolete("Use 'XbKDirPath' instead.")] - public const string TargetCmsDirPath = "TargetCmsDirPath"; - public const string XbKDirPath = "XbKDirPath"; - public const string MigrateOnlyMediaFileInfo = "MigrateOnlyMediaFileInfo"; - public const string UseOmActivityNodeRelationAutofix = "UseOmActivityNodeRelationAutofix"; - public const string UseOmActivitySiteRelationAutofix = "UseOmActivitySiteRelationAutofix"; - public const string MigrationProtocolPath = "MigrationProtocolPath"; - public const string Enabled = "Enabled"; - public const string Connections = "Connections"; - - public const string MemberIncludeUserSystemFields = "MemberIncludeUserSystemFields"; - - public const string ExcludeCodeNames = "ExcludeCodeNames"; - public const string ExplicitPrimaryKeyMapping = "ExplicitPrimaryKeyMapping"; - - public const string SourceInstanceUri = "SourceInstanceUri"; - public const string Secret = "Secret"; - - public const string CreateReusableFieldSchemaForClasses = "CreateReusableFieldSchemaForClasses"; - - #region "Section names" - - public const string CmsConnectionString = "CMSConnectionString"; - public const string ConnectionStrings = "ConnectionStrings"; - public const string Settings = "Settings"; - public const string Logging = "Logging"; - public const string File = "File"; - public const string EntityConfigurations = "EntityConfigurations"; - - public const string OptInFeatures = "OptInFeatures"; - public const string QuerySourceInstanceApi = "QuerySourceInstanceApi"; - - public const string CustomMigration = "CustomMigration"; - - public const string SourceDataType = "SourceDataType"; - public const string TargetDataType = "TargetDataType"; - public const string SourceFormControl = "SourceFormControl"; - public const string TargetFormComponent = "TargetFormComponent"; - public const string Actions = "Actions"; - public const string FieldNameRegex = "FieldNameRegex"; - - [Obsolete("Use TargetKxpApiSettings const instead")] - public const string TargetKxoApiSettings = "TargetKxoApiSettings"; - [Obsolete("Use XbKApiSettings const instead")] - public const string TargetKxpApiSettings = "TargetKxpApiSettings"; - public const string XbKApiSettings = "XbKApiSettings"; - - #endregion - - public const string TodoPlaceholder = "[TODO]"; -} \ No newline at end of file +namespace Migration.Toolkit.Common; + +public class ConfigurationNames +{ + public const string KxConnectionString = "KxConnectionString"; + public const string KxCmsDirPath = "KxCmsDirPath"; + + [Obsolete("not needed anymore, connection string from Kentico config section is used")] + public const string XbKConnectionString = "XbKConnectionString"; + + public const string XbKDirPath = "XbKDirPath"; + public const string MigrateOnlyMediaFileInfo = "MigrateOnlyMediaFileInfo"; + public const string UseOmActivityNodeRelationAutofix = "UseOmActivityNodeRelationAutofix"; + public const string UseOmActivitySiteRelationAutofix = "UseOmActivitySiteRelationAutofix"; + public const string MigrationProtocolPath = "MigrationProtocolPath"; + public const string Enabled = "Enabled"; + public const string Connections = "Connections"; + + public const string MemberIncludeUserSystemFields = "MemberIncludeUserSystemFields"; + + public const string ExcludeCodeNames = "ExcludeCodeNames"; + public const string ExplicitPrimaryKeyMapping = "ExplicitPrimaryKeyMapping"; + + public const string SiteName = "SiteName"; + public const string SourceInstanceUri = "SourceInstanceUri"; + public const string Secret = "Secret"; + + public const string CreateReusableFieldSchemaForClasses = "CreateReusableFieldSchemaForClasses"; + + public const string TodoPlaceholder = "[TODO]"; + + #region "Section names" + + public const string CmsConnectionString = "CMSConnectionString"; + public const string ConnectionStrings = "ConnectionStrings"; + public const string Settings = "Settings"; + public const string Logging = "Logging"; + public const string File = "File"; + public const string EntityConfigurations = "EntityConfigurations"; + + public const string OptInFeatures = "OptInFeatures"; + public const string QuerySourceInstanceApi = "QuerySourceInstanceApi"; + + public const string CustomMigration = "CustomMigration"; + + public const string SourceDataType = "SourceDataType"; + public const string TargetDataType = "TargetDataType"; + public const string SourceFormControl = "SourceFormControl"; + public const string TargetFormComponent = "TargetFormComponent"; + public const string Actions = "Actions"; + public const string FieldNameRegex = "FieldNameRegex"; + + public const string XbKApiSettings = "XbKApiSettings"; + + #endregion +} diff --git a/Migration.Toolkit.Common/EntityConfiguration.cs b/Migration.Toolkit.Common/EntityConfiguration.cs index 3fa1359b..0e080f5f 100644 --- a/Migration.Toolkit.Common/EntityConfiguration.cs +++ b/Migration.Toolkit.Common/EntityConfiguration.cs @@ -1,51 +1,51 @@ -using System.ComponentModel.DataAnnotations.Schema; -using System.Text.Json.Serialization; -using Migration.Toolkit.Common.Helpers; - -namespace Migration.Toolkit.Common; - -public class EntityConfigurations : Dictionary -{ - public EntityConfigurations() : base(StringComparer.OrdinalIgnoreCase) - { - - } - - public EntityConfiguration GetEntityConfiguration(string? tableName) - { - if (this.TryGetValue(tableName ?? "*", out var result)) - { - return result; - } - - return this.TryGetValue("*", out var @default) ? @default : new EntityConfiguration(); - } - - public EntityConfiguration GetEntityConfiguration() - { - var tableName = ReflectionHelper.GetFirstAttributeOrNull()?.Name; - return GetEntityConfiguration(tableName); - } - - public void SetEntityConfiguration(EntityConfiguration config) - { - var tableName = ReflectionHelper.GetFirstAttributeOrNull()?.Name; - if (this.ContainsKey(tableName ?? throw new InvalidOperationException("Table name not found for entity, possibly class is not decorated with [TableAttribute]?"))) - { - this[tableName] = config; - } - else - { - this.Add(tableName, config); - } - } -} - -public class EntityConfiguration -{ - [JsonPropertyName(ConfigurationNames.ExcludeCodeNames)] - public string[] ExcludeCodeNames { get; set; } = Array.Empty(); - - [JsonPropertyName(ConfigurationNames.ExplicitPrimaryKeyMapping)] - public Dictionary> ExplicitPrimaryKeyMapping { get; set; } = new(StringComparer.OrdinalIgnoreCase); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations.Schema; +using System.Text.Json.Serialization; + +using Migration.Toolkit.Common.Helpers; + +namespace Migration.Toolkit.Common; + +public class EntityConfigurations : Dictionary +{ + public EntityConfigurations() : base(StringComparer.OrdinalIgnoreCase) + { + } + + public EntityConfiguration GetEntityConfiguration(string? tableName) + { + if (TryGetValue(tableName ?? "*", out var result)) + { + return result; + } + + return TryGetValue("*", out var @default) ? @default : new EntityConfiguration(); + } + + public EntityConfiguration GetEntityConfiguration() + { + string? tableName = ReflectionHelper.GetFirstAttributeOrNull()?.Name; + return GetEntityConfiguration(tableName); + } + + public void SetEntityConfiguration(EntityConfiguration config) + { + string? tableName = ReflectionHelper.GetFirstAttributeOrNull()?.Name; + if (ContainsKey(tableName ?? throw new InvalidOperationException("Table name not found for entity, possibly class is not decorated with [TableAttribute]?"))) + { + this[tableName] = config; + } + else + { + Add(tableName, config); + } + } +} + +public class EntityConfiguration +{ + [JsonPropertyName(ConfigurationNames.ExcludeCodeNames)] + public string[] ExcludeCodeNames { get; set; } = Array.Empty(); + + [JsonPropertyName(ConfigurationNames.ExplicitPrimaryKeyMapping)] + public Dictionary> ExplicitPrimaryKeyMapping { get; set; } = new(StringComparer.OrdinalIgnoreCase); +} diff --git a/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs b/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs index c33d9cf7..389deb82 100644 --- a/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs +++ b/Migration.Toolkit.Common/Enumerations/K12SystemClass.cs @@ -1,479 +1,482 @@ -// ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Enumerations; - -public class K12SystemClass -{ - public const string CMS_Root = "CMS.Root"; - public const string Chat_Transformations = "Chat.Transformations"; - public const string cms_culture = "cms.culture"; - public const string cms_site = "cms.site"; - public const string cms_Role = "cms.Role"; - public const string cms_UserRole = "cms.UserRole"; - public const string cms_emailtemplate = "cms.emailtemplate"; - public const string cms_permission = "cms.permission"; - public const string cms_resource = "cms.resource"; - public const string CMS_EventLog = "CMS.EventLog"; - public const string cms_tree = "cms.tree"; - public const string cms_document = "cms.document"; - public const string cms_class = "cms.class"; - public const string cms_pagetemplate = "cms.pagetemplate"; - public const string cms_query = "cms.query"; - public const string cms_transformation = "cms.transformation"; - public const string cms_workflow = "cms.workflow"; - public const string cms_workflowstep = "cms.workflowstep"; - public const string cms_workflowscope = "cms.workflowscope"; - public const string cms_versionhistory = "cms.versionhistory"; - public const string cms_acl = "cms.acl"; - public const string cms_workflowhistory = "cms.workflowhistory"; - public const string cms_pagetemplatecategory = "cms.pagetemplatecategory"; - public const string cms_layout = "cms.layout"; - public const string cms_webpartcategory = "cms.webpartcategory"; - public const string cms_webpart = "cms.webpart"; - public const string cms_webtemplate = "cms.webtemplate"; - public const string cms_attachment = "cms.attachment"; - public const string cms_attachmenthistory = "cms.attachmenthistory"; - public const string cms_relationshipname = "cms.relationshipname"; - public const string CMS_RelationshipNameSite = "CMS.RelationshipNameSite"; - public const string CMS_Relationship = "CMS.Relationship"; - public const string cms_cssstylesheet = "cms.cssstylesheet"; - public const string cms_sitedomainalias = "cms.sitedomainalias"; - public const string cms_formusercontrol = "cms.formusercontrol"; - public const string cms_form = "cms.form"; - public const string newsletter_emailtemplate = "newsletter.emailtemplate"; - public const string newsletter_issue = "newsletter.issue"; - public const string cms_ScheduledTask = "cms.ScheduledTask"; - public const string Newsletter_SubscriberNewsletter = "Newsletter.SubscriberNewsletter"; - public const string newsletter_newsletter = "newsletter.newsletter"; - public const string newsletter_emails = "newsletter.emails"; - public const string cms_WebPartContainer = "cms.WebPartContainer"; - public const string cms_LicenseKey = "cms.LicenseKey"; - public const string cms_WebFarmServer = "cms.WebFarmServer"; - public const string cms_WebFarmTask = "cms.WebFarmTask"; - public const string Forums_ForumGroup = "Forums.ForumGroup"; - public const string Forums_Forum = "Forums.Forum"; - public const string Forums_ForumPost = "Forums.ForumPost"; - public const string Forums_ForumSubscription = "Forums.ForumSubscription"; - public const string cms_country = "cms.country"; - public const string cms_state = "cms.state"; - public const string staging_synchronization = "staging.synchronization"; - public const string staging_server = "staging.server"; - public const string staging_task = "staging.task"; - public const string ecommerce_currency = "ecommerce.currency"; - public const string ecommerce_publicstatus = "ecommerce.publicstatus"; - public const string ecommerce_orderstatus = "ecommerce.orderstatus"; - public const string ecommerce_internalstatus = "ecommerce.internalstatus"; - public const string ecommerce_department = "ecommerce.department"; - public const string ecommerce_exchangetable = "ecommerce.exchangetable"; - public const string ecommerce_taxclass = "ecommerce.taxclass"; - public const string Ecommerce_TaxClassCountry = "Ecommerce.TaxClassCountry"; - public const string ecommerce_OrderStatusUser = "ecommerce.OrderStatusUser"; - public const string ecommerce_exchangerate = "ecommerce.exchangerate"; - public const string polls_poll = "polls.poll"; - public const string polls_pollanswer = "polls.pollanswer"; - public const string Reporting_Report = "Reporting.Report"; - public const string Reporting_ReportGraph = "Reporting.ReportGraph"; - public const string Reporting_ReportTable = "Reporting.ReportTable"; - public const string Reporting_ReportValue = "Reporting.ReportValue"; - public const string Reporting_SavedGraph = "Reporting.SavedGraph"; - public const string Reporting_SavedReport = "Reporting.SavedReport"; - public const string blog_comment = "blog.comment"; - public const string analytics_statistics = "analytics.statistics"; - public const string analytics_hitshour = "analytics.hitshour"; - public const string analytics_hitsday = "analytics.hitsday"; - public const string analytics_hitsmonth = "analytics.hitsmonth"; - public const string analytics_hitsweek = "analytics.hitsweek"; - public const string analytics_hitsyear = "analytics.hitsyear"; - public const string Reporting_ReportCategory = "Reporting.ReportCategory"; - public const string ecommerce_taxclassstate = "ecommerce.taxclassstate"; - public const string cms_EventAttendee = "cms.EventAttendee"; - public const string cms_WebPartLayout = "cms.WebPartLayout"; - public const string Ecommerce_CreditEvent = "Ecommerce.CreditEvent"; - public const string cms_metafile = "cms.metafile"; - public const string CMS_SettingsKey = "CMS.SettingsKey"; - public const string export_history = "export.history"; - public const string Export_Task = "Export.Task"; - public const string CMS_CSSStylesheetSite = "CMS.CSSStylesheetSite"; - public const string CMS_PageTemplateSite = "CMS.PageTemplateSite"; - public const string CMS_ResourceSite = "CMS.ResourceSite"; - public const string CMS_CultureSite = "CMS.CultureSite"; - public const string CMS_UserSite = "CMS.UserSite"; - public const string CMS_WorkflowStepRole = "CMS.WorkflowStepRole"; - public const string CMS_ClassSite = "CMS.ClassSite"; - public const string cms_FormRole = "cms.FormRole"; - public const string CMS_AllowedChildClass = "CMS.AllowedChildClass"; - public const string Ecommerce_SKUOptionCategory = "Ecommerce.SKUOptionCategory"; - public const string Forums_ForumRole = "Forums.ForumRole"; - public const string Polls_PollRole = "Polls.PollRole"; - public const string Polls_PollSite = "Polls.PollSite"; - public const string cms_rolepermission = "cms.rolepermission"; - public const string cms_settingscategory = "cms.settingscategory"; - public const string CMS_ResourceString = "CMS.ResourceString"; - public const string CMS_ResourceTranslation = "CMS.ResourceTranslation"; - public const string CMS_VersionAttachment = "CMS.VersionAttachment"; - public const string Forums_ForumModerator = "Forums.ForumModerator"; - public const string CMS_WebPartContainerSite = "CMS.WebPartContainerSite"; - public const string CMS_DocumentAlias = "CMS.DocumentAlias"; - public const string cms_category = "cms.category"; - public const string cms_documentcategory = "cms.documentcategory"; - public const string CMS_TagGroup = "CMS.TagGroup"; - public const string cms_documenttag = "cms.documenttag"; - public const string cms_tag = "cms.tag"; - public const string cms_BannedIP = "cms.BannedIP"; - public const string cms_AlternativeForm = "cms.AlternativeForm"; - public const string cms_timezone = "cms.timezone"; - public const string Community_GroupMember = "Community.GroupMember"; - public const string cms_avatar = "cms.avatar"; - public const string badwords_word = "badwords.word"; - public const string CMS_Badge = "CMS.Badge"; - public const string board_board = "board.board"; - public const string cms_EmailAttachment = "cms.EmailAttachment"; - public const string board_message = "board.message"; - public const string board_boardrole = "board.boardrole"; - public const string badwords_wordculture = "badwords.wordculture"; - public const string board_moderator = "board.moderator"; - public const string notification_gateway = "notification.gateway"; - public const string cms_email = "cms.email"; - public const string cms_attachmentforemail = "cms.attachmentforemail"; - public const string notification_template = "notification.template"; - public const string notification_templatetext = "notification.templatetext"; - public const string notification_subscription = "notification.subscription"; - public const string cms_personalization = "cms.personalization"; - public const string board_subscription = "board.subscription"; - public const string CMS_AbuseReport = "CMS.AbuseReport"; - public const string Forums_ForumAttachment = "Forums.ForumAttachment"; - public const string Forums_ForumUserFavorites = "Forums.ForumUserFavorites"; - public const string CMS_EmailUser = "CMS.EmailUser"; - public const string media_library = "media.library"; - public const string media_libraryrolepermission = "media.libraryrolepermission"; - public const string Community_Invitation = "Community.Invitation"; - public const string Community_GroupRolePermission = "Community.GroupRolePermission"; - public const string blog_postsubscription = "blog.postsubscription"; - public const string cms_SearchIndex = "cms.SearchIndex"; - public const string cms_SearchIndexSite = "cms.SearchIndexSite"; - public const string cms_SearchIndexCulture = "cms.SearchIndexCulture"; - public const string CMS_SearchTask = "CMS.SearchTask"; - public const string cms_userculture = "cms.userculture"; - public const string CMS_UIElement = "CMS.UIElement"; - public const string CMS_RoleUIElement = "CMS.RoleUIElement"; - public const string cms_Widget = "cms.Widget"; - public const string CMS_WidgetCategory = "CMS.WidgetCategory"; - public const string CMS_WidgetRole = "CMS.WidgetRole"; - public const string cms_pagetemplatescope = "cms.pagetemplatescope"; - public const string cms_OpenIDUser = "cms.OpenIDUser"; - public const string Temp_File = "Temp.File"; - public const string newsletter_openedemail = "newsletter.openedemail"; - public const string Ecommerce_ShippingCost = "Ecommerce.ShippingCost"; - public const string OM_ABTest = "OM.ABTest"; - public const string OM_ABVariant = "OM.ABVariant"; - public const string newsletter_link = "newsletter.link"; - public const string CMS_Membership = "CMS.Membership"; - public const string CMS_SMTPServer = "CMS.SMTPServer"; - public const string CMS_SMTPServerSite = "CMS.SMTPServerSite"; - public const string OM_MVTest = "OM.MVTest"; - public const string OM_MVTVariant = "OM.MVTVariant"; - public const string OM_MVTCombination = "OM.MVTCombination"; - public const string OM_MVTCombinationVariation = "OM.MVTCombinationVariation"; - public const string CMS_MembershipRole = "CMS.MembershipRole"; - public const string CMS_MembershipUser = "CMS.MembershipUser"; - public const string Ecommerce_Wishlist = "Ecommerce.Wishlist"; - public const string CMS_ObjectVersionHistory = "CMS.ObjectVersionHistory"; - public const string OM_AccountStatus = "OM.AccountStatus"; - public const string OM_ContactStatus = "OM.ContactStatus"; - public const string OM_ContactRole = "OM.ContactRole"; - public const string OM_AccountContact = "OM.AccountContact"; - public const string OM_ContactGroup = "OM.ContactGroup"; - public const string OM_ContactGroupMember = "OM.ContactGroupMember"; - public const string OM_Membership = "OM.Membership"; - public const string OM_Activity = "OM.Activity"; - public const string OM_ActivityType = "OM.ActivityType"; - public const string CMS_SearchEngine = "CMS.SearchEngine"; - public const string Integration_Connector = "Integration.Connector"; - public const string Integration_Task = "Integration.Task"; - public const string Integration_SyncLog = "Integration.SyncLog"; - public const string Integration_Synchronization = "Integration.Synchronization"; - public const string Analytics_Conversion = "Analytics.Conversion"; - public const string Analytics_Campaign = "Analytics.Campaign"; - public const string ecommerce_skufile = "ecommerce.skufile"; - public const string ecommerce_orderitemskufile = "ecommerce.orderitemskufile"; - public const string ecommerce_bundle = "ecommerce.bundle"; - public const string OM_Rule = "OM.Rule"; - public const string OM_PersonalizationVariant = "OM.PersonalizationVariant"; - public const string OM_Score = "OM.Score"; - public const string CMS_WorkflowTransition = "CMS.WorkflowTransition"; - public const string Newsletter_EmailTemplateNewsletter = "Newsletter.EmailTemplateNewsletter"; - public const string CMS_MacroRule = "CMS.MacroRule"; - public const string newsletter_abtest = "newsletter.abtest"; - public const string CMS_WorkflowStepUser = "CMS.WorkflowStepUser"; - public const string CMS_WorkflowUser = "CMS.WorkflowUser"; - public const string cms_aclitem = "cms.aclitem"; - public const string ecommerce_variantoption = "ecommerce.variantoption"; - public const string Ecommerce_SKUAllowedOption = "Ecommerce.SKUAllowedOption"; - public const string CMS_TranslationService = "CMS.TranslationService"; - public const string CMS_TranslationSubmission = "CMS.TranslationSubmission"; - public const string CMS_TranslationSubmissionItem = "CMS.TranslationSubmissionItem"; - public const string cms_workflowaction = "cms.workflowaction"; - public const string CMS_Banner = "CMS.Banner"; - public const string CMS_BannerCategory = "CMS.BannerCategory"; - public const string Reporting_ReportSubscription = "Reporting.ReportSubscription"; - public const string Chat_Message = "Chat.Message"; - public const string Chat_Notification = "Chat.Notification"; - public const string Chat_OnlineSupport = "Chat.OnlineSupport"; - public const string Chat_OnlineUser = "Chat.OnlineUser"; - public const string Chat_PopupWindowSettings = "Chat.PopupWindowSettings"; - public const string Chat_Room = "Chat.Room"; - public const string Chat_RoomUser = "Chat.RoomUser"; - public const string Chat_SupportCannedResponse = "Chat.SupportCannedResponse"; - public const string Chat_SupportTakenRoom = "Chat.SupportTakenRoom"; - public const string Chat_User = "Chat.User"; - public const string CMS_DeviceProfile = "CMS.DeviceProfile"; - public const string CMS_ObjectSettings = "CMS.ObjectSettings"; - public const string Chat_InitiatedChatRequest = "Chat.InitiatedChatRequest"; - public const string CMS_TemplateDeviceLayout = "CMS.TemplateDeviceLayout"; - public const string CMS_AutomationHistory = "CMS.AutomationHistory"; - public const string CMS_ObjectWorkflowTrigger = "CMS.ObjectWorkflowTrigger"; - public const string CMS_AutomationState = "CMS.AutomationState"; - public const string CMS_DeviceProfileLayout = "CMS.DeviceProfileLayout"; - public const string cms_webfarmservertask = "cms.webfarmservertask"; - public const string cms_onlineuser = "cms.onlineuser"; - public const string OM_ScoreContactRule = "OM.ScoreContactRule"; - public const string CMS_DocumentTypeScope = "CMS.DocumentTypeScope"; - public const string CMS_DocumentTypeScopeClass = "CMS.DocumentTypeScopeClass"; - public const string SM_FacebookApplication = "SM.FacebookApplication"; - public const string SM_FacebookAccount = "SM.FacebookAccount"; - public const string SM_TwitterApplication = "SM.TwitterApplication"; - public const string SM_TwitterAccount = "SM.TwitterAccount"; - public const string SM_FacebookPost = "SM.FacebookPost"; - public const string SM_TwitterPost = "SM.TwitterPost"; - public const string ecommerce_couponcode = "ecommerce.couponcode"; - public const string analytics_exitpage = "analytics.exitpage"; - public const string SM_Insight = "SM.Insight"; - public const string SM_InsightHit_Day = "SM.InsightHit_Day"; - public const string SM_InsightHit_Week = "SM.InsightHit_Week"; - public const string SM_InsightHit_Month = "SM.InsightHit_Month"; - public const string SM_InsightHit_Year = "SM.InsightHit_Year"; - public const string Personas_Persona = "Personas.Persona"; - public const string Personas_PersonaNode = "Personas.PersonaNode"; - public const string CMS_HelpTopic = "CMS.HelpTopic"; - public const string CMS_RoleApplication = "CMS.RoleApplication"; - public const string Ecommerce_MultiBuyDiscountSKU = "Ecommerce.MultiBuyDiscountSKU"; - public const string Ecommerce_MultiBuyDiscountDepartment = "Ecommerce.MultiBuyDiscountDepartment"; - public const string Ecommerce_MultiBuyCouponCode = "Ecommerce.MultiBuyCouponCode"; - public const string SM_LinkedInApplication = "SM.LinkedInApplication"; - public const string SM_LinkedInAccount = "SM.LinkedInAccount"; - public const string SM_LinkedInPost = "SM.LinkedInPost"; - public const string CMS_ResourceLibrary = "CMS.ResourceLibrary"; - public const string Ecommerce_Carrier = "Ecommerce.Carrier"; - public const string SharePoint_SharePointLibrary = "SharePoint.SharePointLibrary"; - public const string SharePoint_SharePointFile = "SharePoint.SharePointFile"; - public const string newsletter_unsubscription = "newsletter.unsubscription"; - public const string CMS_WebFarmServerMonitoring = "CMS.WebFarmServerMonitoring"; - public const string CI_FileMetadata = "CI.FileMetadata"; - public const string CMS_WebFarmServerLog = "CMS.WebFarmServerLog"; - public const string Newsletter_ClickedLink = "Newsletter.ClickedLink"; - public const string Analytics_CampaignAsset = "Analytics.CampaignAsset"; - public const string Staging_TaskUser = "Staging.TaskUser"; - public const string staging_TaskGroup = "staging.TaskGroup"; - public const string staging_TaskGroupTask = "staging.TaskGroupTask"; - public const string staging_TaskGroupUser = "staging.TaskGroupUser"; - public const string OM_ActivityRecalculationQueue = "OM.ActivityRecalculationQueue"; - public const string CMS_ExternalLogin = "CMS.ExternalLogin"; - public const string OM_ContactChangeRecalculationQueue = "OM.ContactChangeRecalculationQueue"; - public const string Analytics_CampaignAssetUrl = "Analytics.CampaignAssetUrl"; - public const string Analytics_CampaignConversion = "Analytics.CampaignConversion"; - public const string Analytics_CampaignConversionHits = "Analytics.CampaignConversionHits"; - public const string OM_VisitorToContact = "OM.VisitorToContact"; - public const string CMS_ModuleLicenseKey = "CMS.ModuleLicenseKey"; - public const string newsletter_issuecontactgroup = "newsletter.issuecontactgroup"; - public const string Analytics_CampaignObjective = "Analytics.CampaignObjective"; - public const string CMS_ModuleUsageCounter = "CMS.ModuleUsageCounter"; - public const string CMS_MacroIdentity = "CMS.MacroIdentity"; - public const string CMS_UserMacroIdentity = "CMS.UserMacroIdentity"; - public const string Newsletter_EmailWidget = "Newsletter.EmailWidget"; - public const string CMS_SearchTaskAzure = "CMS.SearchTaskAzure"; - public const string Newsletter_EmailWidgetTemplate = "Newsletter.EmailWidgetTemplate"; - public const string Personas_PersonaContactHistory = "Personas.PersonaContactHistory"; - public const string CMS_Consent = "CMS.Consent"; - public const string CMS_ConsentAgreement = "CMS.ConsentAgreement"; - public const string CMS_ConsentArchive = "CMS.ConsentArchive"; - public const string Ecommerce_GiftCardCouponCode = "Ecommerce.GiftCardCouponCode"; - public const string Ecommerce_MultiBuyDiscountBrand = "Ecommerce.MultiBuyDiscountBrand"; - public const string Ecommerce_MultiBuyDiscountCollection = "Ecommerce.MultiBuyDiscountCollection"; - public const string Ecommerce_MultiBuyDiscountTree = "Ecommerce.MultiBuyDiscountTree"; - public const string Temp_PageBuilderWidgets = "Temp.PageBuilderWidgets"; - public const string CMS_AlternativeUrl = "CMS.AlternativeUrl"; - public const string CMS_PageTemplateConfiguration = "CMS.PageTemplateConfiguration"; - public const string OM_ABVariantData = "OM.ABVariantData"; - public const string CMS_File = "CMS.File"; - public const string cms_user = "cms.user"; - public const string newsletter_subscriber = "newsletter.subscriber"; - public const string ecommerce_supplier = "ecommerce.supplier"; - public const string ecommerce_manufacturer = "ecommerce.manufacturer"; - public const string ecommerce_paymentoption = "ecommerce.paymentoption"; - public const string Ecommerce_ShippingOption = "Ecommerce.ShippingOption"; - public const string Ecommerce_Address = "Ecommerce.Address"; - public const string ecommerce_customer = "ecommerce.customer"; - public const string ecommerce_order = "ecommerce.order"; - public const string ecommerce_sku = "ecommerce.sku"; - public const string ecommerce_orderitem = "ecommerce.orderitem"; - public const string ecommerce_shoppingcart = "ecommerce.shoppingcart"; - public const string ecommerce_volumediscount = "ecommerce.volumediscount"; - public const string ecommerce_optioncategory = "ecommerce.optioncategory"; - public const string ecommerce_shoppingcartitem = "ecommerce.shoppingcartitem"; - public const string Community_Group = "Community.Group"; - public const string cms_usersettings = "cms.usersettings"; - public const string media_file = "media.file"; - public const string OM_Account = "OM.Account"; - public const string OM_Contact = "OM.Contact"; - public const string ecommerce_discount = "ecommerce.discount"; - public const string ecommerce_orderaddress = "ecommerce.orderaddress"; - public const string SharePoint_SharePointConnection = "SharePoint.SharePointConnection"; - public const string Ecommerce_MultiBuyDiscount = "Ecommerce.MultiBuyDiscount"; - public const string ecommerce_brand = "ecommerce.brand"; - public const string Ecommerce_Collection = "Ecommerce.Collection"; - public const string Ecommerce_GiftCard = "Ecommerce.GiftCard"; - public const string Ecommerce_ShoppingCartCouponCode = "Ecommerce.ShoppingCartCouponCode"; - - public static readonly HashSet All = [ - CMS_AbuseReport, - cms_acl, - cms_aclitem, - CMS_AllowedChildClass, - cms_AlternativeForm, - CMS_AlternativeUrl, - cms_attachment, - cms_attachmentforemail, - cms_attachmenthistory, - CMS_AutomationHistory, - CMS_AutomationState, - cms_avatar, - CMS_Badge, - cms_BannedIP, - CMS_Banner, - CMS_BannerCategory, - cms_category, - cms_class, - CMS_ClassSite, - CMS_Consent, - CMS_ConsentAgreement, - CMS_ConsentArchive, - cms_country, - cms_cssstylesheet, - CMS_CSSStylesheetSite, - cms_culture, - CMS_CultureSite, - CMS_DeviceProfile, - CMS_DeviceProfileLayout, - cms_document, - CMS_DocumentAlias, - cms_documentcategory, - cms_documenttag, - CMS_DocumentTypeScope, - CMS_DocumentTypeScopeClass, - cms_email, - cms_EmailAttachment, - cms_emailtemplate, - CMS_EmailUser, - cms_EventAttendee, - CMS_EventLog, - CMS_ExternalLogin, - CMS_File, - cms_form, - cms_FormRole, - cms_formusercontrol, - CMS_HelpTopic, - cms_layout, - cms_LicenseKey, - CMS_MacroIdentity, - CMS_MacroRule, - CMS_Membership, - CMS_MembershipRole, - CMS_MembershipUser, - cms_metafile, - CMS_ModuleLicenseKey, - CMS_ModuleUsageCounter, - CMS_ObjectSettings, - CMS_ObjectVersionHistory, - CMS_ObjectWorkflowTrigger, - cms_onlineuser, - cms_OpenIDUser, - cms_pagetemplate, - cms_pagetemplatecategory, - CMS_PageTemplateConfiguration, - cms_pagetemplatescope, - CMS_PageTemplateSite, - cms_permission, - cms_personalization, - cms_query, - CMS_Relationship, - cms_relationshipname, - CMS_RelationshipNameSite, - cms_resource, - CMS_ResourceLibrary, - CMS_ResourceSite, - CMS_ResourceString, - CMS_ResourceTranslation, - cms_Role, - CMS_RoleApplication, - cms_rolepermission, - CMS_RoleUIElement, - CMS_Root, - cms_ScheduledTask, - CMS_SearchEngine, - cms_SearchIndex, - cms_SearchIndexCulture, - cms_SearchIndexSite, - CMS_SearchTask, - CMS_SearchTaskAzure, - cms_settingscategory, - CMS_SettingsKey, - cms_site, - cms_sitedomainalias, - CMS_SMTPServer, - CMS_SMTPServerSite, - cms_state, - cms_tag, - CMS_TagGroup, - CMS_TemplateDeviceLayout, - cms_timezone, - cms_transformation, - CMS_TranslationService, - CMS_TranslationSubmission, - CMS_TranslationSubmissionItem, - cms_tree, - CMS_UIElement, - cms_user, - cms_userculture, - CMS_UserMacroIdentity, - cms_UserRole, - cms_usersettings, - CMS_UserSite, - CMS_VersionAttachment, - cms_versionhistory, - cms_WebFarmServer, - CMS_WebFarmServerLog, - CMS_WebFarmServerMonitoring, - cms_webfarmservertask, - cms_WebFarmTask, - cms_webpart, - cms_webpartcategory, - cms_WebPartContainer, - CMS_WebPartContainerSite, - cms_WebPartLayout, - cms_webtemplate, - cms_Widget, - CMS_WidgetCategory, - CMS_WidgetRole, - cms_workflow, - cms_workflowaction, - cms_workflowhistory, - cms_workflowscope, - cms_workflowstep, - CMS_WorkflowStepRole, - CMS_WorkflowStepUser, - CMS_WorkflowTransition, - CMS_WorkflowUser - ]; - - public static HashSet Customizable = new(new[] { cms_user, media_file, OM_Account, OM_Contact }, StringComparer.InvariantCultureIgnoreCase); - public static HashSet NoLongerSupported = new(new[] { cms_usersettings }, StringComparer.InvariantCultureIgnoreCase); -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.Common.Enumerations; +#pragma warning disable IDE1006 +public class K12SystemClass +{ + public const string CMS_Root = "CMS.Root"; + public const string Chat_Transformations = "Chat.Transformations"; + public const string cms_culture = "cms.culture"; + public const string cms_site = "cms.site"; + public const string cms_Role = "cms.Role"; + public const string cms_UserRole = "cms.UserRole"; + public const string cms_emailtemplate = "cms.emailtemplate"; + public const string cms_permission = "cms.permission"; + public const string cms_resource = "cms.resource"; + public const string CMS_EventLog = "CMS.EventLog"; + public const string cms_tree = "cms.tree"; + public const string cms_document = "cms.document"; + public const string cms_class = "cms.class"; + public const string cms_pagetemplate = "cms.pagetemplate"; + public const string cms_query = "cms.query"; + public const string cms_transformation = "cms.transformation"; + public const string cms_workflow = "cms.workflow"; + public const string cms_workflowstep = "cms.workflowstep"; + public const string cms_workflowscope = "cms.workflowscope"; + public const string cms_versionhistory = "cms.versionhistory"; + public const string cms_acl = "cms.acl"; + public const string cms_workflowhistory = "cms.workflowhistory"; + public const string cms_pagetemplatecategory = "cms.pagetemplatecategory"; + public const string cms_layout = "cms.layout"; + public const string cms_webpartcategory = "cms.webpartcategory"; + public const string cms_webpart = "cms.webpart"; + public const string cms_webtemplate = "cms.webtemplate"; + public const string cms_attachment = "cms.attachment"; + public const string cms_attachmenthistory = "cms.attachmenthistory"; + public const string cms_relationshipname = "cms.relationshipname"; + public const string CMS_RelationshipNameSite = "CMS.RelationshipNameSite"; + public const string CMS_Relationship = "CMS.Relationship"; + public const string cms_cssstylesheet = "cms.cssstylesheet"; + public const string cms_sitedomainalias = "cms.sitedomainalias"; + public const string cms_formusercontrol = "cms.formusercontrol"; + public const string cms_form = "cms.form"; + public const string newsletter_emailtemplate = "newsletter.emailtemplate"; + public const string newsletter_issue = "newsletter.issue"; + public const string cms_ScheduledTask = "cms.ScheduledTask"; + public const string Newsletter_SubscriberNewsletter = "Newsletter.SubscriberNewsletter"; + public const string newsletter_newsletter = "newsletter.newsletter"; + public const string newsletter_emails = "newsletter.emails"; + public const string cms_WebPartContainer = "cms.WebPartContainer"; + public const string cms_LicenseKey = "cms.LicenseKey"; + public const string cms_WebFarmServer = "cms.WebFarmServer"; + public const string cms_WebFarmTask = "cms.WebFarmTask"; + public const string Forums_ForumGroup = "Forums.ForumGroup"; + public const string Forums_Forum = "Forums.Forum"; + public const string Forums_ForumPost = "Forums.ForumPost"; + public const string Forums_ForumSubscription = "Forums.ForumSubscription"; + public const string cms_country = "cms.country"; + public const string cms_state = "cms.state"; + public const string staging_synchronization = "staging.synchronization"; + public const string staging_server = "staging.server"; + public const string staging_task = "staging.task"; + public const string ecommerce_currency = "ecommerce.currency"; + public const string ecommerce_publicstatus = "ecommerce.publicstatus"; + public const string ecommerce_orderstatus = "ecommerce.orderstatus"; + public const string ecommerce_internalstatus = "ecommerce.internalstatus"; + public const string ecommerce_department = "ecommerce.department"; + public const string ecommerce_exchangetable = "ecommerce.exchangetable"; + public const string ecommerce_taxclass = "ecommerce.taxclass"; + public const string Ecommerce_TaxClassCountry = "Ecommerce.TaxClassCountry"; + public const string ecommerce_OrderStatusUser = "ecommerce.OrderStatusUser"; + public const string ecommerce_exchangerate = "ecommerce.exchangerate"; + public const string polls_poll = "polls.poll"; + public const string polls_pollanswer = "polls.pollanswer"; + public const string Reporting_Report = "Reporting.Report"; + public const string Reporting_ReportGraph = "Reporting.ReportGraph"; + public const string Reporting_ReportTable = "Reporting.ReportTable"; + public const string Reporting_ReportValue = "Reporting.ReportValue"; + public const string Reporting_SavedGraph = "Reporting.SavedGraph"; + public const string Reporting_SavedReport = "Reporting.SavedReport"; + public const string blog_comment = "blog.comment"; + public const string analytics_statistics = "analytics.statistics"; + public const string analytics_hitshour = "analytics.hitshour"; + public const string analytics_hitsday = "analytics.hitsday"; + public const string analytics_hitsmonth = "analytics.hitsmonth"; + public const string analytics_hitsweek = "analytics.hitsweek"; + public const string analytics_hitsyear = "analytics.hitsyear"; + public const string Reporting_ReportCategory = "Reporting.ReportCategory"; + public const string ecommerce_taxclassstate = "ecommerce.taxclassstate"; + public const string cms_EventAttendee = "cms.EventAttendee"; + public const string cms_WebPartLayout = "cms.WebPartLayout"; + public const string Ecommerce_CreditEvent = "Ecommerce.CreditEvent"; + public const string cms_metafile = "cms.metafile"; + public const string CMS_SettingsKey = "CMS.SettingsKey"; + public const string export_history = "export.history"; + public const string Export_Task = "Export.Task"; + public const string CMS_CSSStylesheetSite = "CMS.CSSStylesheetSite"; + public const string CMS_PageTemplateSite = "CMS.PageTemplateSite"; + public const string CMS_ResourceSite = "CMS.ResourceSite"; + public const string CMS_CultureSite = "CMS.CultureSite"; + public const string CMS_UserSite = "CMS.UserSite"; + public const string CMS_WorkflowStepRole = "CMS.WorkflowStepRole"; + public const string CMS_ClassSite = "CMS.ClassSite"; + public const string cms_FormRole = "cms.FormRole"; + public const string CMS_AllowedChildClass = "CMS.AllowedChildClass"; + public const string Ecommerce_SKUOptionCategory = "Ecommerce.SKUOptionCategory"; + public const string Forums_ForumRole = "Forums.ForumRole"; + public const string Polls_PollRole = "Polls.PollRole"; + public const string Polls_PollSite = "Polls.PollSite"; + public const string cms_rolepermission = "cms.rolepermission"; + public const string cms_settingscategory = "cms.settingscategory"; + public const string CMS_ResourceString = "CMS.ResourceString"; + public const string CMS_ResourceTranslation = "CMS.ResourceTranslation"; + public const string CMS_VersionAttachment = "CMS.VersionAttachment"; + public const string Forums_ForumModerator = "Forums.ForumModerator"; + public const string CMS_WebPartContainerSite = "CMS.WebPartContainerSite"; + public const string CMS_DocumentAlias = "CMS.DocumentAlias"; + public const string cms_category = "cms.category"; + public const string cms_documentcategory = "cms.documentcategory"; + public const string CMS_TagGroup = "CMS.TagGroup"; + public const string cms_documenttag = "cms.documenttag"; + public const string cms_tag = "cms.tag"; + public const string cms_BannedIP = "cms.BannedIP"; + public const string cms_AlternativeForm = "cms.AlternativeForm"; + public const string cms_timezone = "cms.timezone"; + public const string Community_GroupMember = "Community.GroupMember"; + public const string cms_avatar = "cms.avatar"; + public const string badwords_word = "badwords.word"; + public const string CMS_Badge = "CMS.Badge"; + public const string board_board = "board.board"; + public const string cms_EmailAttachment = "cms.EmailAttachment"; + public const string board_message = "board.message"; + public const string board_boardrole = "board.boardrole"; + public const string badwords_wordculture = "badwords.wordculture"; + public const string board_moderator = "board.moderator"; + public const string notification_gateway = "notification.gateway"; + public const string cms_email = "cms.email"; + public const string cms_attachmentforemail = "cms.attachmentforemail"; + public const string notification_template = "notification.template"; + public const string notification_templatetext = "notification.templatetext"; + public const string notification_subscription = "notification.subscription"; + public const string cms_personalization = "cms.personalization"; + public const string board_subscription = "board.subscription"; + public const string CMS_AbuseReport = "CMS.AbuseReport"; + public const string Forums_ForumAttachment = "Forums.ForumAttachment"; + public const string Forums_ForumUserFavorites = "Forums.ForumUserFavorites"; + public const string CMS_EmailUser = "CMS.EmailUser"; + public const string media_library = "media.library"; + public const string media_libraryrolepermission = "media.libraryrolepermission"; + public const string Community_Invitation = "Community.Invitation"; + public const string Community_GroupRolePermission = "Community.GroupRolePermission"; + public const string blog_postsubscription = "blog.postsubscription"; + public const string cms_SearchIndex = "cms.SearchIndex"; + public const string cms_SearchIndexSite = "cms.SearchIndexSite"; + public const string cms_SearchIndexCulture = "cms.SearchIndexCulture"; + public const string CMS_SearchTask = "CMS.SearchTask"; + public const string cms_userculture = "cms.userculture"; + public const string CMS_UIElement = "CMS.UIElement"; + public const string CMS_RoleUIElement = "CMS.RoleUIElement"; + public const string cms_Widget = "cms.Widget"; + public const string CMS_WidgetCategory = "CMS.WidgetCategory"; + public const string CMS_WidgetRole = "CMS.WidgetRole"; + public const string cms_pagetemplatescope = "cms.pagetemplatescope"; + public const string cms_OpenIDUser = "cms.OpenIDUser"; + public const string Temp_File = "Temp.File"; + public const string newsletter_openedemail = "newsletter.openedemail"; + public const string Ecommerce_ShippingCost = "Ecommerce.ShippingCost"; + public const string OM_ABTest = "OM.ABTest"; + public const string OM_ABVariant = "OM.ABVariant"; + public const string newsletter_link = "newsletter.link"; + public const string CMS_Membership = "CMS.Membership"; + public const string CMS_SMTPServer = "CMS.SMTPServer"; + public const string CMS_SMTPServerSite = "CMS.SMTPServerSite"; + public const string OM_MVTest = "OM.MVTest"; + public const string OM_MVTVariant = "OM.MVTVariant"; + public const string OM_MVTCombination = "OM.MVTCombination"; + public const string OM_MVTCombinationVariation = "OM.MVTCombinationVariation"; + public const string CMS_MembershipRole = "CMS.MembershipRole"; + public const string CMS_MembershipUser = "CMS.MembershipUser"; + public const string Ecommerce_Wishlist = "Ecommerce.Wishlist"; + public const string CMS_ObjectVersionHistory = "CMS.ObjectVersionHistory"; + public const string OM_AccountStatus = "OM.AccountStatus"; + public const string OM_ContactStatus = "OM.ContactStatus"; + public const string OM_ContactRole = "OM.ContactRole"; + public const string OM_AccountContact = "OM.AccountContact"; + public const string OM_ContactGroup = "OM.ContactGroup"; + public const string OM_ContactGroupMember = "OM.ContactGroupMember"; + public const string OM_Membership = "OM.Membership"; + public const string OM_Activity = "OM.Activity"; + public const string OM_ActivityType = "OM.ActivityType"; + public const string CMS_SearchEngine = "CMS.SearchEngine"; + public const string Integration_Connector = "Integration.Connector"; + public const string Integration_Task = "Integration.Task"; + public const string Integration_SyncLog = "Integration.SyncLog"; + public const string Integration_Synchronization = "Integration.Synchronization"; + public const string Analytics_Conversion = "Analytics.Conversion"; + public const string Analytics_Campaign = "Analytics.Campaign"; + public const string ecommerce_skufile = "ecommerce.skufile"; + public const string ecommerce_orderitemskufile = "ecommerce.orderitemskufile"; + public const string ecommerce_bundle = "ecommerce.bundle"; + public const string OM_Rule = "OM.Rule"; + public const string OM_PersonalizationVariant = "OM.PersonalizationVariant"; + public const string OM_Score = "OM.Score"; + public const string CMS_WorkflowTransition = "CMS.WorkflowTransition"; + public const string Newsletter_EmailTemplateNewsletter = "Newsletter.EmailTemplateNewsletter"; + public const string CMS_MacroRule = "CMS.MacroRule"; + public const string newsletter_abtest = "newsletter.abtest"; + public const string CMS_WorkflowStepUser = "CMS.WorkflowStepUser"; + public const string CMS_WorkflowUser = "CMS.WorkflowUser"; + public const string cms_aclitem = "cms.aclitem"; + public const string ecommerce_variantoption = "ecommerce.variantoption"; + public const string Ecommerce_SKUAllowedOption = "Ecommerce.SKUAllowedOption"; + public const string CMS_TranslationService = "CMS.TranslationService"; + public const string CMS_TranslationSubmission = "CMS.TranslationSubmission"; + public const string CMS_TranslationSubmissionItem = "CMS.TranslationSubmissionItem"; + public const string cms_workflowaction = "cms.workflowaction"; + public const string CMS_Banner = "CMS.Banner"; + public const string CMS_BannerCategory = "CMS.BannerCategory"; + public const string Reporting_ReportSubscription = "Reporting.ReportSubscription"; + public const string Chat_Message = "Chat.Message"; + public const string Chat_Notification = "Chat.Notification"; + public const string Chat_OnlineSupport = "Chat.OnlineSupport"; + public const string Chat_OnlineUser = "Chat.OnlineUser"; + public const string Chat_PopupWindowSettings = "Chat.PopupWindowSettings"; + public const string Chat_Room = "Chat.Room"; + public const string Chat_RoomUser = "Chat.RoomUser"; + public const string Chat_SupportCannedResponse = "Chat.SupportCannedResponse"; + public const string Chat_SupportTakenRoom = "Chat.SupportTakenRoom"; + public const string Chat_User = "Chat.User"; + public const string CMS_DeviceProfile = "CMS.DeviceProfile"; + public const string CMS_ObjectSettings = "CMS.ObjectSettings"; + public const string Chat_InitiatedChatRequest = "Chat.InitiatedChatRequest"; + public const string CMS_TemplateDeviceLayout = "CMS.TemplateDeviceLayout"; + public const string CMS_AutomationHistory = "CMS.AutomationHistory"; + public const string CMS_ObjectWorkflowTrigger = "CMS.ObjectWorkflowTrigger"; + public const string CMS_AutomationState = "CMS.AutomationState"; + public const string CMS_DeviceProfileLayout = "CMS.DeviceProfileLayout"; + public const string cms_webfarmservertask = "cms.webfarmservertask"; + public const string cms_onlineuser = "cms.onlineuser"; + public const string OM_ScoreContactRule = "OM.ScoreContactRule"; + public const string CMS_DocumentTypeScope = "CMS.DocumentTypeScope"; + public const string CMS_DocumentTypeScopeClass = "CMS.DocumentTypeScopeClass"; + public const string SM_FacebookApplication = "SM.FacebookApplication"; + public const string SM_FacebookAccount = "SM.FacebookAccount"; + public const string SM_TwitterApplication = "SM.TwitterApplication"; + public const string SM_TwitterAccount = "SM.TwitterAccount"; + public const string SM_FacebookPost = "SM.FacebookPost"; + public const string SM_TwitterPost = "SM.TwitterPost"; + public const string ecommerce_couponcode = "ecommerce.couponcode"; + public const string analytics_exitpage = "analytics.exitpage"; + public const string SM_Insight = "SM.Insight"; + public const string SM_InsightHit_Day = "SM.InsightHit_Day"; + public const string SM_InsightHit_Week = "SM.InsightHit_Week"; + public const string SM_InsightHit_Month = "SM.InsightHit_Month"; + public const string SM_InsightHit_Year = "SM.InsightHit_Year"; + public const string Personas_Persona = "Personas.Persona"; + public const string Personas_PersonaNode = "Personas.PersonaNode"; + public const string CMS_HelpTopic = "CMS.HelpTopic"; + public const string CMS_RoleApplication = "CMS.RoleApplication"; + public const string Ecommerce_MultiBuyDiscountSKU = "Ecommerce.MultiBuyDiscountSKU"; + public const string Ecommerce_MultiBuyDiscountDepartment = "Ecommerce.MultiBuyDiscountDepartment"; + public const string Ecommerce_MultiBuyCouponCode = "Ecommerce.MultiBuyCouponCode"; + public const string SM_LinkedInApplication = "SM.LinkedInApplication"; + public const string SM_LinkedInAccount = "SM.LinkedInAccount"; + public const string SM_LinkedInPost = "SM.LinkedInPost"; + public const string CMS_ResourceLibrary = "CMS.ResourceLibrary"; + public const string Ecommerce_Carrier = "Ecommerce.Carrier"; + public const string SharePoint_SharePointLibrary = "SharePoint.SharePointLibrary"; + public const string SharePoint_SharePointFile = "SharePoint.SharePointFile"; + public const string newsletter_unsubscription = "newsletter.unsubscription"; + public const string CMS_WebFarmServerMonitoring = "CMS.WebFarmServerMonitoring"; + public const string CI_FileMetadata = "CI.FileMetadata"; + public const string CMS_WebFarmServerLog = "CMS.WebFarmServerLog"; + public const string Newsletter_ClickedLink = "Newsletter.ClickedLink"; + public const string Analytics_CampaignAsset = "Analytics.CampaignAsset"; + public const string Staging_TaskUser = "Staging.TaskUser"; + public const string staging_TaskGroup = "staging.TaskGroup"; + public const string staging_TaskGroupTask = "staging.TaskGroupTask"; + public const string staging_TaskGroupUser = "staging.TaskGroupUser"; + public const string OM_ActivityRecalculationQueue = "OM.ActivityRecalculationQueue"; + public const string CMS_ExternalLogin = "CMS.ExternalLogin"; + public const string OM_ContactChangeRecalculationQueue = "OM.ContactChangeRecalculationQueue"; + public const string Analytics_CampaignAssetUrl = "Analytics.CampaignAssetUrl"; + public const string Analytics_CampaignConversion = "Analytics.CampaignConversion"; + public const string Analytics_CampaignConversionHits = "Analytics.CampaignConversionHits"; + public const string OM_VisitorToContact = "OM.VisitorToContact"; + public const string CMS_ModuleLicenseKey = "CMS.ModuleLicenseKey"; + public const string newsletter_issuecontactgroup = "newsletter.issuecontactgroup"; + public const string Analytics_CampaignObjective = "Analytics.CampaignObjective"; + public const string CMS_ModuleUsageCounter = "CMS.ModuleUsageCounter"; + public const string CMS_MacroIdentity = "CMS.MacroIdentity"; + public const string CMS_UserMacroIdentity = "CMS.UserMacroIdentity"; + public const string Newsletter_EmailWidget = "Newsletter.EmailWidget"; + public const string CMS_SearchTaskAzure = "CMS.SearchTaskAzure"; + public const string Newsletter_EmailWidgetTemplate = "Newsletter.EmailWidgetTemplate"; + public const string Personas_PersonaContactHistory = "Personas.PersonaContactHistory"; + public const string CMS_Consent = "CMS.Consent"; + public const string CMS_ConsentAgreement = "CMS.ConsentAgreement"; + public const string CMS_ConsentArchive = "CMS.ConsentArchive"; + public const string Ecommerce_GiftCardCouponCode = "Ecommerce.GiftCardCouponCode"; + public const string Ecommerce_MultiBuyDiscountBrand = "Ecommerce.MultiBuyDiscountBrand"; + public const string Ecommerce_MultiBuyDiscountCollection = "Ecommerce.MultiBuyDiscountCollection"; + public const string Ecommerce_MultiBuyDiscountTree = "Ecommerce.MultiBuyDiscountTree"; + public const string Temp_PageBuilderWidgets = "Temp.PageBuilderWidgets"; + public const string CMS_AlternativeUrl = "CMS.AlternativeUrl"; + public const string CMS_PageTemplateConfiguration = "CMS.PageTemplateConfiguration"; + public const string OM_ABVariantData = "OM.ABVariantData"; + public const string CMS_File = "CMS.File"; + public const string cms_user = "cms.user"; + public const string newsletter_subscriber = "newsletter.subscriber"; + public const string ecommerce_supplier = "ecommerce.supplier"; + public const string ecommerce_manufacturer = "ecommerce.manufacturer"; + public const string ecommerce_paymentoption = "ecommerce.paymentoption"; + public const string Ecommerce_ShippingOption = "Ecommerce.ShippingOption"; + public const string Ecommerce_Address = "Ecommerce.Address"; + public const string ecommerce_customer = "ecommerce.customer"; + public const string ecommerce_order = "ecommerce.order"; + public const string ecommerce_sku = "ecommerce.sku"; + public const string ecommerce_orderitem = "ecommerce.orderitem"; + public const string ecommerce_shoppingcart = "ecommerce.shoppingcart"; + public const string ecommerce_volumediscount = "ecommerce.volumediscount"; + public const string ecommerce_optioncategory = "ecommerce.optioncategory"; + public const string ecommerce_shoppingcartitem = "ecommerce.shoppingcartitem"; + public const string Community_Group = "Community.Group"; + public const string cms_usersettings = "cms.usersettings"; + public const string media_file = "media.file"; + public const string OM_Account = "OM.Account"; + public const string OM_Contact = "OM.Contact"; + public const string ecommerce_discount = "ecommerce.discount"; + public const string ecommerce_orderaddress = "ecommerce.orderaddress"; + public const string SharePoint_SharePointConnection = "SharePoint.SharePointConnection"; + public const string Ecommerce_MultiBuyDiscount = "Ecommerce.MultiBuyDiscount"; + public const string ecommerce_brand = "ecommerce.brand"; + public const string Ecommerce_Collection = "Ecommerce.Collection"; + public const string Ecommerce_GiftCard = "Ecommerce.GiftCard"; + public const string Ecommerce_ShoppingCartCouponCode = "Ecommerce.ShoppingCartCouponCode"; + + public static readonly HashSet All = + [ + CMS_AbuseReport, + cms_acl, + cms_aclitem, + CMS_AllowedChildClass, + cms_AlternativeForm, + CMS_AlternativeUrl, + cms_attachment, + cms_attachmentforemail, + cms_attachmenthistory, + CMS_AutomationHistory, + CMS_AutomationState, + cms_avatar, + CMS_Badge, + cms_BannedIP, + CMS_Banner, + CMS_BannerCategory, + cms_category, + cms_class, + CMS_ClassSite, + CMS_Consent, + CMS_ConsentAgreement, + CMS_ConsentArchive, + cms_country, + cms_cssstylesheet, + CMS_CSSStylesheetSite, + cms_culture, + CMS_CultureSite, + CMS_DeviceProfile, + CMS_DeviceProfileLayout, + cms_document, + CMS_DocumentAlias, + cms_documentcategory, + cms_documenttag, + CMS_DocumentTypeScope, + CMS_DocumentTypeScopeClass, + cms_email, + cms_EmailAttachment, + cms_emailtemplate, + CMS_EmailUser, + cms_EventAttendee, + CMS_EventLog, + CMS_ExternalLogin, + CMS_File, + cms_form, + cms_FormRole, + cms_formusercontrol, + CMS_HelpTopic, + cms_layout, + cms_LicenseKey, + CMS_MacroIdentity, + CMS_MacroRule, + CMS_Membership, + CMS_MembershipRole, + CMS_MembershipUser, + cms_metafile, + CMS_ModuleLicenseKey, + CMS_ModuleUsageCounter, + CMS_ObjectSettings, + CMS_ObjectVersionHistory, + CMS_ObjectWorkflowTrigger, + cms_onlineuser, + cms_OpenIDUser, + cms_pagetemplate, + cms_pagetemplatecategory, + CMS_PageTemplateConfiguration, + cms_pagetemplatescope, + CMS_PageTemplateSite, + cms_permission, + cms_personalization, + cms_query, + CMS_Relationship, + cms_relationshipname, + CMS_RelationshipNameSite, + cms_resource, + CMS_ResourceLibrary, + CMS_ResourceSite, + CMS_ResourceString, + CMS_ResourceTranslation, + cms_Role, + CMS_RoleApplication, + cms_rolepermission, + CMS_RoleUIElement, + CMS_Root, + cms_ScheduledTask, + CMS_SearchEngine, + cms_SearchIndex, + cms_SearchIndexCulture, + cms_SearchIndexSite, + CMS_SearchTask, + CMS_SearchTaskAzure, + cms_settingscategory, + CMS_SettingsKey, + cms_site, + cms_sitedomainalias, + CMS_SMTPServer, + CMS_SMTPServerSite, + cms_state, + cms_tag, + CMS_TagGroup, + CMS_TemplateDeviceLayout, + cms_timezone, + cms_transformation, + CMS_TranslationService, + CMS_TranslationSubmission, + CMS_TranslationSubmissionItem, + cms_tree, + CMS_UIElement, + cms_user, + cms_userculture, + CMS_UserMacroIdentity, + cms_UserRole, + cms_usersettings, + CMS_UserSite, + CMS_VersionAttachment, + cms_versionhistory, + cms_WebFarmServer, + CMS_WebFarmServerLog, + CMS_WebFarmServerMonitoring, + cms_webfarmservertask, + cms_WebFarmTask, + cms_webpart, + cms_webpartcategory, + cms_WebPartContainer, + CMS_WebPartContainerSite, + cms_WebPartLayout, + cms_webtemplate, + cms_Widget, + CMS_WidgetCategory, + CMS_WidgetRole, + cms_workflow, + cms_workflowaction, + cms_workflowhistory, + cms_workflowscope, + cms_workflowstep, + CMS_WorkflowStepRole, + CMS_WorkflowStepUser, + CMS_WorkflowTransition, + CMS_WorkflowUser + ]; + + public static HashSet Customizable = new(new[] { cms_user, media_file, OM_Account, OM_Contact }, StringComparer.InvariantCultureIgnoreCase); + public static HashSet NoLongerSupported = new(new[] { cms_usersettings }, StringComparer.InvariantCultureIgnoreCase); +} +#pragma warning enable IDE1006 diff --git a/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs b/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs index 1fa89417..9aec23ed 100644 --- a/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs +++ b/Migration.Toolkit.Common/Enumerations/K12SystemResource.cs @@ -1,157 +1,158 @@ -// ReSharper disable InconsistentNaming - -namespace Migration.Toolkit.Common.Enumerations; - -public class K12SystemResource -{ - public const string CMS = "CMS"; - public const string CMS_ABTest = "CMS.ABTest"; - public const string CMS_AbuseReport = "CMS.AbuseReport"; - public const string CMS_Activities = "CMS.Activities"; - public const string CMS_Badges = "CMS.Badges"; - public const string CMS_Badwords = "CMS.Badwords"; - public const string CMS_BannedIP = "CMS.BannedIP"; - public const string CMS_BannerManagement = "CMS.BannerManagement"; - public const string CMS_Blog = "CMS.Blog"; - public const string CMS_Categories = "CMS.Categories"; - public const string CMS_Chat = "CMS.Chat"; - public const string CMS_Community = "CMS.Community"; - public const string CMS_ContactManagement = "CMS.ContactManagement"; - public const string CMS_Content = "CMS.Content"; - public const string CMS_ContentPersonalization = "CMS.ContentPersonalization"; - public const string CMS_ContinuousIntegration = "CMS.ContinuousIntegration"; - public const string cms_customsystemmodule = "cms.customsystemmodule"; - public const string CMS_CustomTables = "CMS.CustomTables"; - public const string CMS_DancingGoat_Samples = "CMS.DancingGoat.Samples"; - public const string CMS_DataProtection = "CMS.DataProtection"; - public const string CMS_Design = "CMS.Design"; - public const string CMS_DeviceProfiles = "CMS.DeviceProfiles"; - public const string CMS_DocumentEngine = "CMS.DocumentEngine"; - public const string CMS_Ecommerce = "CMS.Ecommerce"; - public const string CMS_EmailEngine = "CMS.EmailEngine"; - public const string CMS_EmailTemplates = "CMS.EmailTemplates"; - public const string CMS_EventLog = "CMS.EventLog"; - public const string CMS_EventManager = "CMS.EventManager"; - public const string CMS_Form = "CMS.Form"; - public const string CMS_Forums = "CMS.Forums"; - public const string CMS_Globalization = "CMS.Globalization"; - public const string CMS_GlobalPermissions = "CMS.GlobalPermissions"; - public const string CMS_Groups = "CMS.Groups"; - public const string CMS_Localization = "CMS.Localization"; - public const string CMS_MacroEngine = "CMS.MacroEngine"; - public const string CMS_MediaDialog = "CMS.MediaDialog"; - public const string CMS_MediaLibrary = "CMS.MediaLibrary"; - public const string CMS_Membership = "CMS.Membership"; - public const string CMS_MessageBoards = "CMS.MessageBoards"; - public const string CMS_ModuleLicenses = "CMS.ModuleLicenses"; - public const string CMS_ModuleUsageTracking = "CMS.ModuleUsageTracking"; - public const string CMS_MVTest = "CMS.MVTest"; - public const string CMS_Newsletter = "CMS.Newsletter"; - public const string CMS_Notifications = "CMS.Notifications"; - public const string CMS_OnlineMarketing = "CMS.OnlineMarketing"; - public const string CMS_OnSiteEdit = "CMS.OnSiteEdit"; - public const string CMS_Permissions = "CMS.Permissions"; - public const string CMS_Personas = "CMS.Personas"; - public const string CMS_Polls = "CMS.Polls"; - public const string CMS_Relationships = "CMS.Relationships"; - public const string CMS_Reporting = "CMS.Reporting"; - public const string CMS_Roles = "CMS.Roles"; - public const string CMS_ScheduledTasks = "CMS.ScheduledTasks"; - public const string CMS_Scoring = "CMS.Scoring"; - public const string CMS_Search = "CMS.Search"; - public const string CMS_Search_Azure = "CMS.Search.Azure"; - public const string CMS_SharePoint = "CMS.SharePoint"; - public const string CMS_SocialMarketing = "CMS.SocialMarketing"; - public const string CMS_Staging = "CMS.Staging"; - public const string CMS_StrandsRecommender = "CMS.StrandsRecommender"; - public const string CMS_Synchronization = "CMS.Synchronization"; - public const string CMS_Taxonomy = "CMS.Taxonomy"; - public const string CMS_TranslationServices = "CMS.TranslationServices"; - public const string CMS_UIPersonalization = "CMS.UIPersonalization"; - public const string CMS_Users = "CMS.Users"; - public const string CMS_WebAnalytics = "CMS.WebAnalytics"; - public const string CMS_WebFarm = "CMS.WebFarm"; - public const string CMS_Widgets = "CMS.Widgets"; - public const string CMS_WIFIntegration = "CMS.WIFIntegration"; - public const string CMS_WorkflowEngine = "CMS.WorkflowEngine"; - public const string CMS_WYSIWYGEditor = "CMS.WYSIWYGEditor"; - public const string Licenses = "Licenses"; - - public static readonly HashSet All = - [ - CMS, - CMS_ABTest, - CMS_AbuseReport, - CMS_Activities, - CMS_Badges, - CMS_Badwords, - CMS_BannedIP, - CMS_BannerManagement, - CMS_Blog, - CMS_Categories, - CMS_Chat, - CMS_Community, - CMS_ContactManagement, - CMS_Content, - CMS_ContentPersonalization, - CMS_ContinuousIntegration, - cms_customsystemmodule, - CMS_CustomTables, - CMS_DancingGoat_Samples, - CMS_DataProtection, - CMS_Design, - CMS_DeviceProfiles, - CMS_DocumentEngine, - CMS_Ecommerce, - CMS_EmailEngine, - CMS_EmailTemplates, - CMS_EventLog, - CMS_EventManager, - CMS_Form, - CMS_Forums, - CMS_Globalization, - CMS_GlobalPermissions, - CMS_Groups, - CMS_Localization, - CMS_MacroEngine, - CMS_MediaDialog, - CMS_MediaLibrary, - CMS_Membership, - CMS_MessageBoards, - CMS_ModuleLicenses, - CMS_ModuleUsageTracking, - CMS_MVTest, - CMS_Newsletter, - CMS_Notifications, - CMS_OnlineMarketing, - CMS_OnSiteEdit, - CMS_Permissions, - CMS_Personas, - CMS_Polls, - CMS_Relationships, - CMS_Reporting, - CMS_Roles, - CMS_ScheduledTasks, - CMS_Scoring, - CMS_Search, - CMS_Search_Azure, - CMS_SharePoint, - CMS_SocialMarketing, - CMS_Staging, - CMS_StrandsRecommender, - CMS_Synchronization, - CMS_Taxonomy, - CMS_TranslationServices, - CMS_UIPersonalization, - CMS_Users, - CMS_WebAnalytics, - CMS_WebFarm, - CMS_Widgets, - CMS_WIFIntegration, - CMS_WorkflowEngine, - CMS_WYSIWYGEditor, - Licenses - ]; - - public static HashSet ConvertToNonSysResource = new(new[] { cms_customsystemmodule }, StringComparer.CurrentCultureIgnoreCase); -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.Common.Enumerations; +#pragma warning disable IDE1006 +public class K12SystemResource +{ + public const string CMS = "CMS"; + public const string CMS_ABTest = "CMS.ABTest"; + public const string CMS_AbuseReport = "CMS.AbuseReport"; + public const string CMS_Activities = "CMS.Activities"; + public const string CMS_Badges = "CMS.Badges"; + public const string CMS_Badwords = "CMS.Badwords"; + public const string CMS_BannedIP = "CMS.BannedIP"; + public const string CMS_BannerManagement = "CMS.BannerManagement"; + public const string CMS_Blog = "CMS.Blog"; + public const string CMS_Categories = "CMS.Categories"; + public const string CMS_Chat = "CMS.Chat"; + public const string CMS_Community = "CMS.Community"; + public const string CMS_ContactManagement = "CMS.ContactManagement"; + public const string CMS_Content = "CMS.Content"; + public const string CMS_ContentPersonalization = "CMS.ContentPersonalization"; + public const string CMS_ContinuousIntegration = "CMS.ContinuousIntegration"; + public const string cms_customsystemmodule = "cms.customsystemmodule"; + public const string CMS_CustomTables = "CMS.CustomTables"; + public const string CMS_DancingGoat_Samples = "CMS.DancingGoat.Samples"; + public const string CMS_DataProtection = "CMS.DataProtection"; + public const string CMS_Design = "CMS.Design"; + public const string CMS_DeviceProfiles = "CMS.DeviceProfiles"; + public const string CMS_DocumentEngine = "CMS.DocumentEngine"; + public const string CMS_Ecommerce = "CMS.Ecommerce"; + public const string CMS_EmailEngine = "CMS.EmailEngine"; + public const string CMS_EmailTemplates = "CMS.EmailTemplates"; + public const string CMS_EventLog = "CMS.EventLog"; + public const string CMS_EventManager = "CMS.EventManager"; + public const string CMS_Form = "CMS.Form"; + public const string CMS_Forums = "CMS.Forums"; + public const string CMS_Globalization = "CMS.Globalization"; + public const string CMS_GlobalPermissions = "CMS.GlobalPermissions"; + public const string CMS_Groups = "CMS.Groups"; + public const string CMS_Localization = "CMS.Localization"; + public const string CMS_MacroEngine = "CMS.MacroEngine"; + public const string CMS_MediaDialog = "CMS.MediaDialog"; + public const string CMS_MediaLibrary = "CMS.MediaLibrary"; + public const string CMS_Membership = "CMS.Membership"; + public const string CMS_MessageBoards = "CMS.MessageBoards"; + public const string CMS_ModuleLicenses = "CMS.ModuleLicenses"; + public const string CMS_ModuleUsageTracking = "CMS.ModuleUsageTracking"; + public const string CMS_MVTest = "CMS.MVTest"; + public const string CMS_Newsletter = "CMS.Newsletter"; + public const string CMS_Notifications = "CMS.Notifications"; + public const string CMS_OnlineMarketing = "CMS.OnlineMarketing"; + public const string CMS_OnSiteEdit = "CMS.OnSiteEdit"; + public const string CMS_Permissions = "CMS.Permissions"; + public const string CMS_Personas = "CMS.Personas"; + public const string CMS_Polls = "CMS.Polls"; + public const string CMS_Relationships = "CMS.Relationships"; + public const string CMS_Reporting = "CMS.Reporting"; + public const string CMS_Roles = "CMS.Roles"; + public const string CMS_ScheduledTasks = "CMS.ScheduledTasks"; + public const string CMS_Scoring = "CMS.Scoring"; + public const string CMS_Search = "CMS.Search"; + public const string CMS_Search_Azure = "CMS.Search.Azure"; + public const string CMS_SharePoint = "CMS.SharePoint"; + public const string CMS_SocialMarketing = "CMS.SocialMarketing"; + public const string CMS_Staging = "CMS.Staging"; + public const string CMS_StrandsRecommender = "CMS.StrandsRecommender"; + public const string CMS_Synchronization = "CMS.Synchronization"; + public const string CMS_Taxonomy = "CMS.Taxonomy"; + public const string CMS_TranslationServices = "CMS.TranslationServices"; + public const string CMS_UIPersonalization = "CMS.UIPersonalization"; + public const string CMS_Users = "CMS.Users"; + public const string CMS_WebAnalytics = "CMS.WebAnalytics"; + public const string CMS_WebFarm = "CMS.WebFarm"; + public const string CMS_Widgets = "CMS.Widgets"; + public const string CMS_WIFIntegration = "CMS.WIFIntegration"; + public const string CMS_WorkflowEngine = "CMS.WorkflowEngine"; + public const string CMS_WYSIWYGEditor = "CMS.WYSIWYGEditor"; + public const string Licenses = "Licenses"; + + public static readonly HashSet All = + [ + CMS, + CMS_ABTest, + CMS_AbuseReport, + CMS_Activities, + CMS_Badges, + CMS_Badwords, + CMS_BannedIP, + CMS_BannerManagement, + CMS_Blog, + CMS_Categories, + CMS_Chat, + CMS_Community, + CMS_ContactManagement, + CMS_Content, + CMS_ContentPersonalization, + CMS_ContinuousIntegration, + cms_customsystemmodule, + CMS_CustomTables, + CMS_DancingGoat_Samples, + CMS_DataProtection, + CMS_Design, + CMS_DeviceProfiles, + CMS_DocumentEngine, + CMS_Ecommerce, + CMS_EmailEngine, + CMS_EmailTemplates, + CMS_EventLog, + CMS_EventManager, + CMS_Form, + CMS_Forums, + CMS_Globalization, + CMS_GlobalPermissions, + CMS_Groups, + CMS_Localization, + CMS_MacroEngine, + CMS_MediaDialog, + CMS_MediaLibrary, + CMS_Membership, + CMS_MessageBoards, + CMS_ModuleLicenses, + CMS_ModuleUsageTracking, + CMS_MVTest, + CMS_Newsletter, + CMS_Notifications, + CMS_OnlineMarketing, + CMS_OnSiteEdit, + CMS_Permissions, + CMS_Personas, + CMS_Polls, + CMS_Relationships, + CMS_Reporting, + CMS_Roles, + CMS_ScheduledTasks, + CMS_Scoring, + CMS_Search, + CMS_Search_Azure, + CMS_SharePoint, + CMS_SocialMarketing, + CMS_Staging, + CMS_StrandsRecommender, + CMS_Synchronization, + CMS_Taxonomy, + CMS_TranslationServices, + CMS_UIPersonalization, + CMS_Users, + CMS_WebAnalytics, + CMS_WebFarm, + CMS_Widgets, + CMS_WIFIntegration, + CMS_WorkflowEngine, + CMS_WYSIWYGEditor, + Licenses + ]; + + public static HashSet ConvertToNonSysResource = new(new[] { cms_customsystemmodule }, StringComparer.CurrentCultureIgnoreCase); +} +#pragma warning enable IDE1006 diff --git a/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs b/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs index 6d21ea65..dfc2b765 100644 --- a/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs +++ b/Migration.Toolkit.Common/Enumerations/KsFieldDataType.cs @@ -1,50 +1,67 @@ -namespace Migration.Toolkit.Common.Enumerations; - -/// -/// field data types are same in major versions 11 / 12 / 13 -/// -public static partial class KsFieldDataType -{ - /// All datatypes. - public const string ALL = "all"; - /// Unknown data type - public const string Unknown = ""; - /// Text. - public const string Text = "text"; - /// Long text. - public const string LongText = "longtext"; - /// Integer. - public const string Integer = "integer"; - /// Long integer. - public const string LongInteger = "longinteger"; - /// Double. - public const string Double = "double"; - /// Date and time. - public const string DateTime = "datetime"; - /// Boolean. - public const string Boolean = "boolean"; - /// File. - public const string File = "file"; - /// Document attachments. - public const string DocAttachments = "docattachments"; - /// GUID. - public const string Guid = "guid"; - /// Binary. - public const string Binary = "binary"; - /// XML - public const string Xml = "xml"; - /// Decimal - public const string Decimal = "decimal"; - /// Time span - public const string TimeSpan = "timespan"; - /// Date - public const string Date = "date"; - /// Document relationships - public const string DocRelationships = "docrelationships"; -} - -// manual updates, non-obvious types, exotic types -public static partial class KsFieldDataType -{ - public const string BizFormFile = "bizformfile"; -} \ No newline at end of file +namespace Migration.Toolkit.Common.Enumerations; + +/// +/// field data types are same in major versions 11 / 12 / 13 +/// +public static partial class KsFieldDataType +{ + /// All datatypes. + public const string ALL = "all"; + + /// Unknown data type + public const string Unknown = ""; + + /// Text. + public const string Text = "text"; + + /// Long text. + public const string LongText = "longtext"; + + /// Integer. + public const string Integer = "integer"; + + /// Long integer. + public const string LongInteger = "longinteger"; + + /// Double. + public const string Double = "double"; + + /// Date and time. + public const string DateTime = "datetime"; + + /// Boolean. + public const string Boolean = "boolean"; + + /// File. + public const string File = "file"; + + /// Document attachments. + public const string DocAttachments = "docattachments"; + + /// GUID. + public const string Guid = "guid"; + + /// Binary. + public const string Binary = "binary"; + + /// XML + public const string Xml = "xml"; + + /// Decimal + public const string Decimal = "decimal"; + + /// Time span + public const string TimeSpan = "timespan"; + + /// Date + public const string Date = "date"; + + /// Document relationships + public const string DocRelationships = "docrelationships"; +} + +// manual updates, non-obvious types, exotic types +public static partial class KsFieldDataType +{ + public const string BizFormFile = "bizformfile"; +} diff --git a/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs b/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs index 8704b9b2..434f8551 100644 --- a/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs +++ b/Migration.Toolkit.Common/Enumerations/Kx13FormControls.cs @@ -1,265 +1,267 @@ -// ReSharper disable InconsistentNaming -namespace Migration.Toolkit.Common.Enumerations; - -public class Kx13FormControls -{ - public class UserControlForText - { - public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; - public const string ActivityTypeSelector = "ActivityTypeSelector"; - public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; - public const string Selectalternativeform = "selectalternativeform"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string AssemblyClassSelector = "AssemblyClassSelector"; - public const string Fieldselector = "fieldselector"; - public const string BizFormSelector = "BizFormSelector"; - public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; - public const string CampaignSelector = "CampaignSelector"; - public const string CategorySelector = "CategorySelector"; - public const string ClassFieldSelector = "ClassFieldSelector"; - public const string ClassFields = "Class_fields"; - public const string CodeName = "CodeName"; - public const string CodeNameWithPrefix = "CodeNameWithPrefix"; - public const string Selectcolor = "selectcolor"; - public const string Columns = "Columns"; - public const string ConnectionStringSelector = "Connection_string_selector"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CountrySelector = "countrySelector"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectculture = "selectculture"; - public const string CultureSelectorForSettings = "CultureSelectorForSettings"; - public const string CurrencySelector = "currencySelector"; - public const string CustomTableItemSelector = "CustomTableItemSelector"; - public const string CustomTableSelector = "CustomTableSelector"; - public const string Selectcolumns = "selectcolumns"; - public const string DepartmentSelector = "DepartmentSelector"; - public const string DropDownListControl = "DropDownListControl"; - public const string DueDateSelector = "Due_date_selector"; - public const string Emailinput = "emailinput"; - public const string EmailTemplateSelector = "Email_template_selector"; - public const string EmailTemplateTypeSelector = "Email_template_type_selector"; - public const string EncodingTextBox = "EncodingTextBox"; - public const string EncryptedPassword = "EncryptedPassword"; - public const string EnumSelector = "EnumSelector"; - public const string EventLogTypeSelector = "EventLogTypeSelector"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string FontIconSelector = "FontIconSelector"; - public const string FormFieldSelector = "FormFieldSelector"; - public const string FormPassword = "FormPassword"; - public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; - public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; - public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; - public const string GoToExternalUrl = "Go_to_external_URL"; - public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; - public const string Html5Input = "HTML5Input"; - public const string IconSelector = "IconSelector"; - public const string InternalStatusSelector = "InternalStatusSelector"; - public const string Internationalphone = "internationalphone"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LicenseSelector = "LicenseSelector"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string ListBoxControl = "ListBoxControl"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; - public const string MacroAnyAllSelector = "MacroAnyAllSelector"; - public const string MacroDateOperator = "Macro_date_operator"; - public const string MacroEditor = "MacroEditor"; - public const string MacroEqualityOperator = "MacroEqualityOperator"; - public const string MacroNegationOperator = "MacroNegationOperator"; - public const string MacroNumericOperator = "Macro_numeric_operator"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MacroTextOperator = "Macro_text_operator"; - public const string MacroType = "MacroType"; - public const string ManufacturerSelector = "ManufacturerSelector"; - public const string MediaLibrarySelector = "MediaLibrarySelector"; - public const string MediaSelectionControl = "MediaSelectionControl"; - public const string MembershipSelector = "MembershipSelector"; - public const string MetafileUploaderControl = "MetafileUploaderControl"; - public const string ModuleSelector = "ModuleSelector"; - public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; - public const string MultipleChoiceControl = "MultipleChoiceControl"; - public const string RoleCheckboxSelector = "RoleCheckboxSelector"; - public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; - public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; - public const string MultipleUserSelector = "MultipleUserSelector"; - public const string NewsletterSelector = "NewsletterSelector"; - public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; - public const string NumericUpDown = "NumericUpDown"; - public const string ObjectColumnSelector = "ObjectColumnSelector"; - public const string ObjectSelector = "ObjectSelector"; - public const string ObjectTransformation = "ObjectTransformation"; - public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; - public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; - public const string OrderBy = "OrderBy"; - public const string OrderStatusSelector = "OrderStatusSelector"; - public const string DocumentCultureFilter = "DocumentCultureFilter"; - public const string PageLayoutCode = "Page_layout_code"; - public const string Selectdocument = "selectdocument"; - public const string PageTemplateLevels = "PageTemplateLevels"; - public const string Selectpagetemplate = "selectpagetemplate"; - public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; - public const string Selectclassnames = "selectclassnames"; - public const string Password = "Password"; - public const string PasswordStrength = "PasswordStrength"; - public const string PasswordConfirmator = "PasswordConfirmator"; - public const string Selectpath = "selectpath"; - public const string PaymentSelector = "paymentSelector"; - public const string ProductImageSelector = "ProductImageSelector"; - public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string ProductTypeSelector = "ProductTypeSelector"; - public const string PublicStatusSelector = "PublicStatusSelector"; - public const string Selectquery = "selectquery"; - public const string RadioButtonsControl = "RadioButtonsControl"; - public const string AgeRangeSelector = "AgeRangeSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string Relationshipconfiguration = "relationshipconfiguration"; - public const string SelectRelationshipName = "SelectRelationshipName"; - public const string ReportSelectorDropDown = "ReportSelectorDropDown"; - public const string RoleSelector = "RoleSelector"; - public const string SearchClassNameSelector = "SearchClassNameSelector"; - public const string SearchIndexSelector = "SearchIndexSelector"; - public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; - public const string SelectCmsVersion = "SelectCMSVersion"; - public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointListSelector = "SharePointListSelector"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string ShippingSelector = "shippingSelector"; - public const string ShippingServiceSelector = "ShippingServiceSelector"; - public const string Selectsinglepath = "selectsinglepath"; - public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; - public const string SiteContentCulture = "SiteContentCulture"; - public const string SiteCultureSelector = "SiteCultureSelector"; - public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; - public const string Selectsite = "selectsite"; - public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; - public const string SkuSelector = "SKUSelector"; - public const string StopWordsSelector = "StopWordsSelector"; - public const string SupplierSelector = "SupplierSelector"; - public const string SupportedCultureSelector = "SupportedCultureSelector"; - public const string TableConversionSettings = "TableConversionSettings"; - public const string TagGroupSelector = "TagGroupSelector"; - public const string TagSelector = "TagSelector"; - public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; - public const string TextboxDoubleValidator = "Textbox_double_validator"; - public const string TimeZoneSelector = "TimeZoneSelector"; - public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; - public const string ToggleButton = "ToggleButton"; - public const string Selecttransformation = "selecttransformation"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string Usphone = "usphone"; - public const string Uszipcode = "uszipcode"; - public const string UiCultureSelector = "UICultureSelector"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string UrlChecker = "UrlChecker"; - public const string UrlSelector = "URLSelector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string UserName = "UserName"; - public const string UserNameSelector = "UserNameSelector"; - public const string UserSelector = "UserSelector"; - public const string ValiditySelector = "ValiditySelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; - } - - public class UserControlForLongText - { - public const string AbTestConversionSelector = "ABTestConversionSelector"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string BbEditorControl = "BBEditorControl"; - public const string CacheDependencies = "CacheDependencies"; - public const string ClassFields = "Class_fields"; - public const string Columns = "Columns"; - public const string ConditionBuilder = "ConditionBuilder"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectcolumns = "selectcolumns"; - public const string DropDownListControl = "DropDownListControl"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string Html5Input = "HTML5Input"; - public const string AutoResizeConfiguration = "AutoResizeConfiguration"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroEditor = "MacroEditor"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionsSelector = "OptionsSelector"; - public const string OrderBy = "OrderBy"; - public const string PageLayoutCode = "Page_layout_code"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string ReportGraphSelector = "ReportGraphSelector"; - public const string ReportTableSelector = "ReportTableSelector"; - public const string ReportValueSelector = "ReportValueSelector"; - public const string HtmlAreaControl = "HtmlAreaControl"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string TagSelector = "TagSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - } -} - -public class Kx13FormComponents -{ - public const string Kentico_BoolFieldValueTypeSelector = "Kentico.BoolFieldValueTypeSelector"; - public const string Kentico_CheckBox = "Kentico.CheckBox"; - public const string Kentico_CompareToFieldSelector = "Kentico.CompareToFieldSelector"; - public const string Kentico_ConsentAgreement = "Kentico.ConsentAgreement"; - public const string Kentico_ConsentSelector = "Kentico.ConsentSelector"; - public const string Kentico_DropDown = "Kentico.DropDown"; - public const string Kentico_EmailInput = "Kentico.EmailInput"; - public const string Kentico_FileUploader = "Kentico.FileUploader"; - public const string Kentico_HiddenGuidInput = "Kentico.HiddenGuidInput"; - public const string Kentico_IntInput = "Kentico.IntInput"; - public const string Kentico_MultipleChoice = "Kentico.MultipleChoice"; - public const string Kentico_Name = "Kentico.Name"; - public const string Kentico_NumericFieldComparisonTypeSelector = "Kentico.NumericFieldComparisonTypeSelector"; - public const string Kentico_RadioButtons = "Kentico.RadioButtons"; - public const string Kentico_Recaptcha = "Kentico.Recaptcha"; - public const string Kentico_StringFieldComparisonTypeSelector = "Kentico.StringFieldComparisonTypeSelector"; - public const string Kentico_TextArea = "Kentico.TextArea"; - public const string Kentico_TextInput = "Kentico.TextInput"; - public const string Kentico_USPhone = "Kentico.USPhone"; - public const string Kentico_Invalid = "Kentico.Invalid"; - public const string Kentico_RichText = "Kentico.RichText"; - public const string Kentico_AttachmentSelector = "Kentico.AttachmentSelector"; - public const string Kentico_MediaFilesSelector = "Kentico.MediaFilesSelector"; - public const string Kentico_GeneralSelector = "Kentico.GeneralSelector"; - public const string Kentico_ObjectSelector = "Kentico.ObjectSelector"; - public const string Kentico_PageSelector = "Kentico.PageSelector"; - public const string Kentico_PathSelector = "Kentico.PathSelector"; - public const string Kentico_UrlSelector = "Kentico.UrlSelector"; -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.Common.Enumerations; +#pragma warning disable IDE1006 +public class Kx13FormControls +{ + public class UserControlForText + { + public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; + public const string ActivityTypeSelector = "ActivityTypeSelector"; + public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; + public const string Selectalternativeform = "selectalternativeform"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string AssemblyClassSelector = "AssemblyClassSelector"; + public const string Fieldselector = "fieldselector"; + public const string BizFormSelector = "BizFormSelector"; + public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; + public const string CampaignSelector = "CampaignSelector"; + public const string CategorySelector = "CategorySelector"; + public const string ClassFieldSelector = "ClassFieldSelector"; + public const string ClassFields = "Class_fields"; + public const string CodeName = "CodeName"; + public const string CodeNameWithPrefix = "CodeNameWithPrefix"; + public const string Selectcolor = "selectcolor"; + public const string Columns = "Columns"; + public const string ConnectionStringSelector = "Connection_string_selector"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CountrySelector = "countrySelector"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectculture = "selectculture"; + public const string CultureSelectorForSettings = "CultureSelectorForSettings"; + public const string CurrencySelector = "currencySelector"; + public const string CustomTableItemSelector = "CustomTableItemSelector"; + public const string CustomTableSelector = "CustomTableSelector"; + public const string Selectcolumns = "selectcolumns"; + public const string DepartmentSelector = "DepartmentSelector"; + public const string DropDownListControl = "DropDownListControl"; + public const string DueDateSelector = "Due_date_selector"; + public const string Emailinput = "emailinput"; + public const string EmailTemplateSelector = "Email_template_selector"; + public const string EmailTemplateTypeSelector = "Email_template_type_selector"; + public const string EncodingTextBox = "EncodingTextBox"; + public const string EncryptedPassword = "EncryptedPassword"; + public const string EnumSelector = "EnumSelector"; + public const string EventLogTypeSelector = "EventLogTypeSelector"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string FontIconSelector = "FontIconSelector"; + public const string FormFieldSelector = "FormFieldSelector"; + public const string FormPassword = "FormPassword"; + public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; + public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; + public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; + public const string GoToExternalUrl = "Go_to_external_URL"; + public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; + public const string Html5Input = "HTML5Input"; + public const string IconSelector = "IconSelector"; + public const string InternalStatusSelector = "InternalStatusSelector"; + public const string Internationalphone = "internationalphone"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LicenseSelector = "LicenseSelector"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string ListBoxControl = "ListBoxControl"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; + public const string MacroAnyAllSelector = "MacroAnyAllSelector"; + public const string MacroDateOperator = "Macro_date_operator"; + public const string MacroEditor = "MacroEditor"; + public const string MacroEqualityOperator = "MacroEqualityOperator"; + public const string MacroNegationOperator = "MacroNegationOperator"; + public const string MacroNumericOperator = "Macro_numeric_operator"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MacroTextOperator = "Macro_text_operator"; + public const string MacroType = "MacroType"; + public const string ManufacturerSelector = "ManufacturerSelector"; + public const string MediaLibrarySelector = "MediaLibrarySelector"; + public const string MediaSelectionControl = "MediaSelectionControl"; + public const string MembershipSelector = "MembershipSelector"; + public const string MetafileUploaderControl = "MetafileUploaderControl"; + public const string ModuleSelector = "ModuleSelector"; + public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; + public const string MultipleChoiceControl = "MultipleChoiceControl"; + public const string RoleCheckboxSelector = "RoleCheckboxSelector"; + public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; + public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; + public const string MultipleUserSelector = "MultipleUserSelector"; + public const string NewsletterSelector = "NewsletterSelector"; + public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; + public const string NumericUpDown = "NumericUpDown"; + public const string ObjectColumnSelector = "ObjectColumnSelector"; + public const string ObjectSelector = "ObjectSelector"; + public const string ObjectTransformation = "ObjectTransformation"; + public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; + public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; + public const string OrderBy = "OrderBy"; + public const string OrderStatusSelector = "OrderStatusSelector"; + public const string DocumentCultureFilter = "DocumentCultureFilter"; + public const string PageLayoutCode = "Page_layout_code"; + public const string Selectdocument = "selectdocument"; + public const string PageTemplateLevels = "PageTemplateLevels"; + public const string Selectpagetemplate = "selectpagetemplate"; + public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; + public const string Selectclassnames = "selectclassnames"; + public const string Password = "Password"; + public const string PasswordStrength = "PasswordStrength"; + public const string PasswordConfirmator = "PasswordConfirmator"; + public const string Selectpath = "selectpath"; + public const string PaymentSelector = "paymentSelector"; + public const string ProductImageSelector = "ProductImageSelector"; + public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string ProductTypeSelector = "ProductTypeSelector"; + public const string PublicStatusSelector = "PublicStatusSelector"; + public const string Selectquery = "selectquery"; + public const string RadioButtonsControl = "RadioButtonsControl"; + public const string AgeRangeSelector = "AgeRangeSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string Relationshipconfiguration = "relationshipconfiguration"; + public const string SelectRelationshipName = "SelectRelationshipName"; + public const string ReportSelectorDropDown = "ReportSelectorDropDown"; + public const string RoleSelector = "RoleSelector"; + public const string SearchClassNameSelector = "SearchClassNameSelector"; + public const string SearchIndexSelector = "SearchIndexSelector"; + public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; + public const string SelectCmsVersion = "SelectCMSVersion"; + public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointListSelector = "SharePointListSelector"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string ShippingSelector = "shippingSelector"; + public const string ShippingServiceSelector = "ShippingServiceSelector"; + public const string Selectsinglepath = "selectsinglepath"; + public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; + public const string SiteContentCulture = "SiteContentCulture"; + public const string SiteCultureSelector = "SiteCultureSelector"; + public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; + public const string Selectsite = "selectsite"; + public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; + public const string SkuSelector = "SKUSelector"; + public const string StopWordsSelector = "StopWordsSelector"; + public const string SupplierSelector = "SupplierSelector"; + public const string SupportedCultureSelector = "SupportedCultureSelector"; + public const string TableConversionSettings = "TableConversionSettings"; + public const string TagGroupSelector = "TagGroupSelector"; + public const string TagSelector = "TagSelector"; + public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; + public const string TextboxDoubleValidator = "Textbox_double_validator"; + public const string TimeZoneSelector = "TimeZoneSelector"; + public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; + public const string ToggleButton = "ToggleButton"; + public const string Selecttransformation = "selecttransformation"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string Usphone = "usphone"; + public const string Uszipcode = "uszipcode"; + public const string UiCultureSelector = "UICultureSelector"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string UrlChecker = "UrlChecker"; + public const string UrlSelector = "URLSelector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string UserName = "UserName"; + public const string UserNameSelector = "UserNameSelector"; + public const string UserSelector = "UserSelector"; + public const string ValiditySelector = "ValiditySelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; + } + + public class UserControlForLongText + { + public const string AbTestConversionSelector = "ABTestConversionSelector"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string BbEditorControl = "BBEditorControl"; + public const string CacheDependencies = "CacheDependencies"; + public const string ClassFields = "Class_fields"; + public const string Columns = "Columns"; + public const string ConditionBuilder = "ConditionBuilder"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectcolumns = "selectcolumns"; + public const string DropDownListControl = "DropDownListControl"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string Html5Input = "HTML5Input"; + public const string AutoResizeConfiguration = "AutoResizeConfiguration"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroEditor = "MacroEditor"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionsSelector = "OptionsSelector"; + public const string OrderBy = "OrderBy"; + public const string PageLayoutCode = "Page_layout_code"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string ReportGraphSelector = "ReportGraphSelector"; + public const string ReportTableSelector = "ReportTableSelector"; + public const string ReportValueSelector = "ReportValueSelector"; + public const string HtmlAreaControl = "HtmlAreaControl"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string TagSelector = "TagSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + } +} + +public class Kx13FormComponents +{ + public const string Kentico_BoolFieldValueTypeSelector = "Kentico.BoolFieldValueTypeSelector"; + public const string Kentico_CheckBox = "Kentico.CheckBox"; + public const string Kentico_CompareToFieldSelector = "Kentico.CompareToFieldSelector"; + public const string Kentico_ConsentAgreement = "Kentico.ConsentAgreement"; + public const string Kentico_ConsentSelector = "Kentico.ConsentSelector"; + public const string Kentico_DropDown = "Kentico.DropDown"; + public const string Kentico_EmailInput = "Kentico.EmailInput"; + public const string Kentico_FileUploader = "Kentico.FileUploader"; + public const string Kentico_HiddenGuidInput = "Kentico.HiddenGuidInput"; + public const string Kentico_IntInput = "Kentico.IntInput"; + public const string Kentico_MultipleChoice = "Kentico.MultipleChoice"; + public const string Kentico_Name = "Kentico.Name"; + public const string Kentico_NumericFieldComparisonTypeSelector = "Kentico.NumericFieldComparisonTypeSelector"; + public const string Kentico_RadioButtons = "Kentico.RadioButtons"; + public const string Kentico_Recaptcha = "Kentico.Recaptcha"; + public const string Kentico_StringFieldComparisonTypeSelector = "Kentico.StringFieldComparisonTypeSelector"; + public const string Kentico_TextArea = "Kentico.TextArea"; + public const string Kentico_TextInput = "Kentico.TextInput"; + public const string Kentico_USPhone = "Kentico.USPhone"; + public const string Kentico_Invalid = "Kentico.Invalid"; + public const string Kentico_RichText = "Kentico.RichText"; + public const string Kentico_AttachmentSelector = "Kentico.AttachmentSelector"; + public const string Kentico_MediaFilesSelector = "Kentico.MediaFilesSelector"; + public const string Kentico_GeneralSelector = "Kentico.GeneralSelector"; + public const string Kentico_ObjectSelector = "Kentico.ObjectSelector"; + public const string Kentico_PageSelector = "Kentico.PageSelector"; + public const string Kentico_PathSelector = "Kentico.PathSelector"; + public const string Kentico_UrlSelector = "Kentico.UrlSelector"; +} +#pragma warning enable IDE1006 diff --git a/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs b/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs index 18a147fa..23e2074e 100644 --- a/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs +++ b/Migration.Toolkit.Common/Enumerations/Kx13SystemClasses.cs @@ -1,178 +1,177 @@ -// ReSharper disable InconsistentNaming - -namespace Migration.Toolkit.Common.Enumerations; - -public static class Kx13SystemClass -{ - public const string cms_culture = "cms.culture"; - public const string cms_site = "cms.site"; - public const string cms_Role = "cms.Role"; - public const string cms_user = "cms.user"; - public const string cms_UserRole = "cms.UserRole"; - public const string cms_emailtemplate = "cms.emailtemplate"; - public const string cms_permission = "cms.permission"; - public const string cms_resource = "cms.resource"; - public const string CMS_EventLog = "CMS.EventLog"; - public const string cms_tree = "cms.tree"; - public const string cms_document = "cms.document"; - public const string cms_class = "cms.class"; - public const string cms_pagetemplate = "cms.pagetemplate"; - public const string cms_query = "cms.query"; - public const string cms_transformation = "cms.transformation"; - public const string cms_workflow = "cms.workflow"; - public const string cms_workflowstep = "cms.workflowstep"; - public const string cms_workflowscope = "cms.workflowscope"; - public const string cms_versionhistory = "cms.versionhistory"; - public const string cms_acl = "cms.acl"; - public const string cms_pagetemplatecategory = "cms.pagetemplatecategory"; - public const string cms_layout = "cms.layout"; - public const string cms_webpartcategory = "cms.webpartcategory"; - public const string cms_webpart = "cms.webpart"; - public const string cms_attachment = "cms.attachment"; - public const string cms_attachmenthistory = "cms.attachmenthistory"; - public const string cms_relationshipname = "cms.relationshipname"; - public const string CMS_RelationshipNameSite = "CMS.RelationshipNameSite"; - public const string CMS_Relationship = "CMS.Relationship"; - public const string cms_sitedomainalias = "cms.sitedomainalias"; - public const string cms_form = "cms.form"; - public const string newsletter_emailtemplate = "newsletter.emailtemplate"; - public const string newsletter_subscriber = "newsletter.subscriber"; - public const string Newsletter_SubscriberNewsletter = "Newsletter.SubscriberNewsletter"; - public const string newsletter_newsletter = "newsletter.newsletter"; - public const string cms_WebPartContainer = "cms.WebPartContainer"; - public const string cms_LicenseKey = "cms.LicenseKey"; - public const string cms_WebFarmServer = "cms.WebFarmServer"; - public const string cms_country = "cms.country"; - public const string cms_state = "cms.state"; - public const string staging_synchronization = "staging.synchronization"; - public const string staging_server = "staging.server"; - public const string Reporting_Report = "Reporting.Report"; - public const string analytics_statistics = "analytics.statistics"; - public const string analytics_hitsweek = "analytics.hitsweek"; - public const string Reporting_ReportCategory = "Reporting.ReportCategory"; - public const string cms_WebPartLayout = "cms.WebPartLayout"; - public const string CMS_SettingsKey = "CMS.SettingsKey"; - public const string export_history = "export.history"; - public const string CMS_ResourceSite = "CMS.ResourceSite"; - public const string CMS_CultureSite = "CMS.CultureSite"; - public const string CMS_UserSite = "CMS.UserSite"; - public const string CMS_WorkflowStepRole = "CMS.WorkflowStepRole"; - public const string CMS_ClassSite = "CMS.ClassSite"; - public const string cms_FormRole = "cms.FormRole"; - public const string CMS_AllowedChildClass = "CMS.AllowedChildClass"; - public const string cms_rolepermission = "cms.rolepermission"; - public const string cms_settingscategory = "cms.settingscategory"; - public const string CMS_VersionAttachment = "CMS.VersionAttachment"; - public const string CMS_WebPartContainerSite = "CMS.WebPartContainerSite"; - public const string cms_category = "cms.category"; - public const string cms_documentcategory = "cms.documentcategory"; - public const string cms_AlternativeForm = "cms.AlternativeForm"; - public const string cms_timezone = "cms.timezone"; - public const string cms_avatar = "cms.avatar"; - public const string cms_usersettings = "cms.usersettings"; - public const string cms_email = "cms.email"; - public const string cms_attachmentforemail = "cms.attachmentforemail"; - public const string CMS_EmailUser = "CMS.EmailUser"; - public const string media_library = "media.library"; - public const string media_file = "media.file"; - public const string media_libraryrolepermission = "media.libraryrolepermission"; - public const string cms_SearchIndex = "cms.SearchIndex"; - public const string cms_SearchIndexSite = "cms.SearchIndexSite"; - public const string cms_SearchIndexCulture = "cms.SearchIndexCulture"; - public const string CMS_SearchTask = "CMS.SearchTask"; - public const string cms_userculture = "cms.userculture"; - public const string CMS_UIElement = "CMS.UIElement"; - public const string CMS_RoleUIElement = "CMS.RoleUIElement"; - public const string cms_Widget = "cms.Widget"; - public const string CMS_WidgetCategory = "CMS.WidgetCategory"; - public const string CMS_WidgetRole = "CMS.WidgetRole"; - public const string newsletter_openedemail = "newsletter.openedemail"; - public const string OM_ABTest = "OM.ABTest"; - public const string CMS_Membership = "CMS.Membership"; - public const string CMS_SMTPServer = "CMS.SMTPServer"; - public const string CMS_SMTPServerSite = "CMS.SMTPServerSite"; - public const string CMS_MembershipRole = "CMS.MembershipRole"; - public const string CMS_MembershipUser = "CMS.MembershipUser"; - public const string OM_Account = "OM.Account"; - public const string OM_AccountStatus = "OM.AccountStatus"; - public const string OM_Contact = "OM.Contact"; - public const string OM_ContactStatus = "OM.ContactStatus"; - public const string OM_ContactRole = "OM.ContactRole"; - public const string OM_AccountContact = "OM.AccountContact"; - public const string OM_ContactGroup = "OM.ContactGroup"; - public const string OM_ContactGroupMember = "OM.ContactGroupMember"; - public const string OM_Activity = "OM.Activity"; - public const string OM_ActivityType = "OM.ActivityType"; - public const string Integration_Connector = "Integration.Connector"; - public const string Integration_Synchronization = "Integration.Synchronization"; - public const string Analytics_Campaign = "Analytics.Campaign"; - public const string OM_Rule = "OM.Rule"; - public const string OM_Score = "OM.Score"; - public const string CMS_WorkflowTransition = "CMS.WorkflowTransition"; - public const string Newsletter_EmailTemplateNewsletter = "Newsletter.EmailTemplateNewsletter"; - public const string CMS_MacroRule = "CMS.MacroRule"; - public const string CMS_WorkflowStepUser = "CMS.WorkflowStepUser"; - public const string CMS_WorkflowUser = "CMS.WorkflowUser"; - public const string cms_aclitem = "cms.aclitem"; - public const string CMS_TranslationService = "CMS.TranslationService"; - public const string CMS_TranslationSubmission = "CMS.TranslationSubmission"; - public const string cms_workflowaction = "cms.workflowaction"; - public const string cms_webfarmservertask = "cms.webfarmservertask"; - public const string OM_ScoreContactRule = "OM.ScoreContactRule"; - public const string CMS_DocumentTypeScope = "CMS.DocumentTypeScope"; - public const string CMS_DocumentTypeScopeClass = "CMS.DocumentTypeScopeClass"; - public const string SM_FacebookApplication = "SM.FacebookApplication"; - public const string SM_FacebookAccount = "SM.FacebookAccount"; - public const string SM_TwitterApplication = "SM.TwitterApplication"; - public const string SM_TwitterAccount = "SM.TwitterAccount"; - public const string SM_FacebookPost = "SM.FacebookPost"; - public const string SM_TwitterPost = "SM.TwitterPost"; - public const string analytics_exitpage = "analytics.exitpage"; - public const string SM_Insight = "SM.Insight"; - public const string SM_InsightHit_Day = "SM.InsightHit_Day"; - public const string SM_InsightHit_Week = "SM.InsightHit_Week"; - public const string SM_InsightHit_Month = "SM.InsightHit_Month"; - public const string SM_InsightHit_Year = "SM.InsightHit_Year"; - public const string Personas_Persona = "Personas.Persona"; - public const string Analytics_CampaignConversion = "Analytics.CampaignConversion"; - public const string Analytics_CampaignConversionHits = "Analytics.CampaignConversionHits"; - public const string OM_VisitorToContact = "OM.VisitorToContact"; - public const string CMS_ModuleLicenseKey = "CMS.ModuleLicenseKey"; - public const string newsletter_issuecontactgroup = "newsletter.issuecontactgroup"; - public const string Analytics_CampaignObjective = "Analytics.CampaignObjective"; - public const string CMS_ModuleUsageCounter = "CMS.ModuleUsageCounter"; - public const string CMS_MacroIdentity = "CMS.MacroIdentity"; - public const string CMS_UserMacroIdentity = "CMS.UserMacroIdentity"; - public const string Newsletter_EmailWidget = "Newsletter.EmailWidget"; - public const string CMS_SearchTaskAzure = "CMS.SearchTaskAzure"; - public const string Newsletter_EmailWidgetTemplate = "Newsletter.EmailWidgetTemplate"; - public const string Personas_PersonaContactHistory = "Personas.PersonaContactHistory"; - public const string CMS_Consent = "CMS.Consent"; - public const string CMS_ConsentAgreement = "CMS.ConsentAgreement"; - public const string CMS_ConsentArchive = "CMS.ConsentArchive"; - public const string Temp_PageBuilderWidgets = "Temp.PageBuilderWidgets"; - public const string CMS_AlternativeUrl = "CMS.AlternativeUrl"; - public const string CMS_PageTemplateConfiguration = "CMS.PageTemplateConfiguration"; - public const string OM_ABVariantData = "OM.ABVariantData"; - public const string CMS_AutomationTemplate = "CMS.AutomationTemplate"; - public const string CMS_PageUrlPath = "CMS.PageUrlPath"; - public const string CMS_PageFormerUrlPath = "CMS.PageFormerUrlPath"; - - public static HashSet All = new( - new[] - { - cms_culture, cms_site, cms_Role, cms_user, cms_UserRole, cms_emailtemplate, cms_permission, cms_resource, CMS_EventLog, cms_tree, cms_document, cms_class, cms_pagetemplate, cms_query, - cms_transformation, cms_workflow, cms_workflowstep, cms_workflowscope, cms_versionhistory, cms_acl, cms_pagetemplatecategory, cms_layout, cms_webpartcategory, cms_webpart, - cms_attachment, cms_attachmenthistory, cms_relationshipname, CMS_RelationshipNameSite, CMS_Relationship, cms_sitedomainalias, cms_form, cms_WebPartContainer, cms_LicenseKey, - cms_WebFarmServer, cms_country, cms_state, cms_WebPartLayout, CMS_SettingsKey, CMS_ResourceSite, CMS_CultureSite, CMS_UserSite, CMS_WorkflowStepRole, CMS_ClassSite, cms_FormRole, - CMS_AllowedChildClass, cms_rolepermission, cms_settingscategory, CMS_VersionAttachment, CMS_WebPartContainerSite, cms_category, cms_documentcategory, cms_AlternativeForm, cms_timezone, - cms_avatar, cms_usersettings, cms_email, cms_attachmentforemail, CMS_EmailUser, cms_SearchIndex, cms_SearchIndexSite, cms_SearchIndexCulture, CMS_SearchTask, cms_userculture, - CMS_UIElement, CMS_RoleUIElement, cms_Widget, CMS_WidgetCategory, CMS_WidgetRole, CMS_Membership, CMS_SMTPServer, CMS_SMTPServerSite, CMS_MembershipRole, CMS_MembershipUser, - CMS_WorkflowTransition, CMS_MacroRule, CMS_WorkflowStepUser, CMS_WorkflowUser, cms_aclitem, CMS_TranslationService, CMS_TranslationSubmission, cms_workflowaction, - cms_webfarmservertask, CMS_DocumentTypeScope, CMS_DocumentTypeScopeClass, CMS_ModuleLicenseKey, CMS_ModuleUsageCounter, CMS_MacroIdentity, CMS_UserMacroIdentity, CMS_SearchTaskAzure, - CMS_Consent, CMS_ConsentAgreement, CMS_ConsentArchive, CMS_AlternativeUrl, CMS_PageTemplateConfiguration, CMS_AutomationTemplate, CMS_PageUrlPath, CMS_PageFormerUrlPath, - }, StringComparer.InvariantCultureIgnoreCase); - - public static HashSet Customizable = new(new[] { cms_user, cms_usersettings, media_file, OM_Account, OM_Contact }, StringComparer.InvariantCultureIgnoreCase); - public static HashSet NoLongerSupported = new(new[] { cms_usersettings }, StringComparer.InvariantCultureIgnoreCase); -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.Common.Enumerations; +#pragma warning disable IDE1006 +public static class Kx13SystemClass +{ + public const string cms_culture = "cms.culture"; + public const string cms_site = "cms.site"; + public const string cms_Role = "cms.Role"; + public const string cms_user = "cms.user"; + public const string cms_UserRole = "cms.UserRole"; + public const string cms_emailtemplate = "cms.emailtemplate"; + public const string cms_permission = "cms.permission"; + public const string cms_resource = "cms.resource"; + public const string CMS_EventLog = "CMS.EventLog"; + public const string cms_tree = "cms.tree"; + public const string cms_document = "cms.document"; + public const string cms_class = "cms.class"; + public const string cms_pagetemplate = "cms.pagetemplate"; + public const string cms_query = "cms.query"; + public const string cms_transformation = "cms.transformation"; + public const string cms_workflow = "cms.workflow"; + public const string cms_workflowstep = "cms.workflowstep"; + public const string cms_workflowscope = "cms.workflowscope"; + public const string cms_versionhistory = "cms.versionhistory"; + public const string cms_acl = "cms.acl"; + public const string cms_pagetemplatecategory = "cms.pagetemplatecategory"; + public const string cms_layout = "cms.layout"; + public const string cms_webpartcategory = "cms.webpartcategory"; + public const string cms_webpart = "cms.webpart"; + public const string cms_attachment = "cms.attachment"; + public const string cms_attachmenthistory = "cms.attachmenthistory"; + public const string cms_relationshipname = "cms.relationshipname"; + public const string CMS_RelationshipNameSite = "CMS.RelationshipNameSite"; + public const string CMS_Relationship = "CMS.Relationship"; + public const string cms_sitedomainalias = "cms.sitedomainalias"; + public const string cms_form = "cms.form"; + public const string newsletter_emailtemplate = "newsletter.emailtemplate"; + public const string newsletter_subscriber = "newsletter.subscriber"; + public const string Newsletter_SubscriberNewsletter = "Newsletter.SubscriberNewsletter"; + public const string newsletter_newsletter = "newsletter.newsletter"; + public const string cms_WebPartContainer = "cms.WebPartContainer"; + public const string cms_LicenseKey = "cms.LicenseKey"; + public const string cms_WebFarmServer = "cms.WebFarmServer"; + public const string cms_country = "cms.country"; + public const string cms_state = "cms.state"; + public const string staging_synchronization = "staging.synchronization"; + public const string staging_server = "staging.server"; + public const string Reporting_Report = "Reporting.Report"; + public const string analytics_statistics = "analytics.statistics"; + public const string analytics_hitsweek = "analytics.hitsweek"; + public const string Reporting_ReportCategory = "Reporting.ReportCategory"; + public const string cms_WebPartLayout = "cms.WebPartLayout"; + public const string CMS_SettingsKey = "CMS.SettingsKey"; + public const string export_history = "export.history"; + public const string CMS_ResourceSite = "CMS.ResourceSite"; + public const string CMS_CultureSite = "CMS.CultureSite"; + public const string CMS_UserSite = "CMS.UserSite"; + public const string CMS_WorkflowStepRole = "CMS.WorkflowStepRole"; + public const string CMS_ClassSite = "CMS.ClassSite"; + public const string cms_FormRole = "cms.FormRole"; + public const string CMS_AllowedChildClass = "CMS.AllowedChildClass"; + public const string cms_rolepermission = "cms.rolepermission"; + public const string cms_settingscategory = "cms.settingscategory"; + public const string CMS_VersionAttachment = "CMS.VersionAttachment"; + public const string CMS_WebPartContainerSite = "CMS.WebPartContainerSite"; + public const string cms_category = "cms.category"; + public const string cms_documentcategory = "cms.documentcategory"; + public const string cms_AlternativeForm = "cms.AlternativeForm"; + public const string cms_timezone = "cms.timezone"; + public const string cms_avatar = "cms.avatar"; + public const string cms_usersettings = "cms.usersettings"; + public const string cms_email = "cms.email"; + public const string cms_attachmentforemail = "cms.attachmentforemail"; + public const string CMS_EmailUser = "CMS.EmailUser"; + public const string media_library = "media.library"; + public const string media_file = "media.file"; + public const string media_libraryrolepermission = "media.libraryrolepermission"; + public const string cms_SearchIndex = "cms.SearchIndex"; + public const string cms_SearchIndexSite = "cms.SearchIndexSite"; + public const string cms_SearchIndexCulture = "cms.SearchIndexCulture"; + public const string CMS_SearchTask = "CMS.SearchTask"; + public const string cms_userculture = "cms.userculture"; + public const string CMS_UIElement = "CMS.UIElement"; + public const string CMS_RoleUIElement = "CMS.RoleUIElement"; + public const string cms_Widget = "cms.Widget"; + public const string CMS_WidgetCategory = "CMS.WidgetCategory"; + public const string CMS_WidgetRole = "CMS.WidgetRole"; + public const string newsletter_openedemail = "newsletter.openedemail"; + public const string OM_ABTest = "OM.ABTest"; + public const string CMS_Membership = "CMS.Membership"; + public const string CMS_SMTPServer = "CMS.SMTPServer"; + public const string CMS_SMTPServerSite = "CMS.SMTPServerSite"; + public const string CMS_MembershipRole = "CMS.MembershipRole"; + public const string CMS_MembershipUser = "CMS.MembershipUser"; + public const string OM_Account = "OM.Account"; + public const string OM_AccountStatus = "OM.AccountStatus"; + public const string OM_Contact = "OM.Contact"; + public const string OM_ContactStatus = "OM.ContactStatus"; + public const string OM_ContactRole = "OM.ContactRole"; + public const string OM_AccountContact = "OM.AccountContact"; + public const string OM_ContactGroup = "OM.ContactGroup"; + public const string OM_ContactGroupMember = "OM.ContactGroupMember"; + public const string OM_Activity = "OM.Activity"; + public const string OM_ActivityType = "OM.ActivityType"; + public const string Integration_Connector = "Integration.Connector"; + public const string Integration_Synchronization = "Integration.Synchronization"; + public const string Analytics_Campaign = "Analytics.Campaign"; + public const string OM_Rule = "OM.Rule"; + public const string OM_Score = "OM.Score"; + public const string CMS_WorkflowTransition = "CMS.WorkflowTransition"; + public const string Newsletter_EmailTemplateNewsletter = "Newsletter.EmailTemplateNewsletter"; + public const string CMS_MacroRule = "CMS.MacroRule"; + public const string CMS_WorkflowStepUser = "CMS.WorkflowStepUser"; + public const string CMS_WorkflowUser = "CMS.WorkflowUser"; + public const string cms_aclitem = "cms.aclitem"; + public const string CMS_TranslationService = "CMS.TranslationService"; + public const string CMS_TranslationSubmission = "CMS.TranslationSubmission"; + public const string cms_workflowaction = "cms.workflowaction"; + public const string cms_webfarmservertask = "cms.webfarmservertask"; + public const string OM_ScoreContactRule = "OM.ScoreContactRule"; + public const string CMS_DocumentTypeScope = "CMS.DocumentTypeScope"; + public const string CMS_DocumentTypeScopeClass = "CMS.DocumentTypeScopeClass"; + public const string SM_FacebookApplication = "SM.FacebookApplication"; + public const string SM_FacebookAccount = "SM.FacebookAccount"; + public const string SM_TwitterApplication = "SM.TwitterApplication"; + public const string SM_TwitterAccount = "SM.TwitterAccount"; + public const string SM_FacebookPost = "SM.FacebookPost"; + public const string SM_TwitterPost = "SM.TwitterPost"; + public const string analytics_exitpage = "analytics.exitpage"; + public const string SM_Insight = "SM.Insight"; + public const string SM_InsightHit_Day = "SM.InsightHit_Day"; + public const string SM_InsightHit_Week = "SM.InsightHit_Week"; + public const string SM_InsightHit_Month = "SM.InsightHit_Month"; + public const string SM_InsightHit_Year = "SM.InsightHit_Year"; + public const string Personas_Persona = "Personas.Persona"; + public const string Analytics_CampaignConversion = "Analytics.CampaignConversion"; + public const string Analytics_CampaignConversionHits = "Analytics.CampaignConversionHits"; + public const string OM_VisitorToContact = "OM.VisitorToContact"; + public const string CMS_ModuleLicenseKey = "CMS.ModuleLicenseKey"; + public const string newsletter_issuecontactgroup = "newsletter.issuecontactgroup"; + public const string Analytics_CampaignObjective = "Analytics.CampaignObjective"; + public const string CMS_ModuleUsageCounter = "CMS.ModuleUsageCounter"; + public const string CMS_MacroIdentity = "CMS.MacroIdentity"; + public const string CMS_UserMacroIdentity = "CMS.UserMacroIdentity"; + public const string Newsletter_EmailWidget = "Newsletter.EmailWidget"; + public const string CMS_SearchTaskAzure = "CMS.SearchTaskAzure"; + public const string Newsletter_EmailWidgetTemplate = "Newsletter.EmailWidgetTemplate"; + public const string Personas_PersonaContactHistory = "Personas.PersonaContactHistory"; + public const string CMS_Consent = "CMS.Consent"; + public const string CMS_ConsentAgreement = "CMS.ConsentAgreement"; + public const string CMS_ConsentArchive = "CMS.ConsentArchive"; + public const string Temp_PageBuilderWidgets = "Temp.PageBuilderWidgets"; + public const string CMS_AlternativeUrl = "CMS.AlternativeUrl"; + public const string CMS_PageTemplateConfiguration = "CMS.PageTemplateConfiguration"; + public const string OM_ABVariantData = "OM.ABVariantData"; + public const string CMS_AutomationTemplate = "CMS.AutomationTemplate"; + public const string CMS_PageUrlPath = "CMS.PageUrlPath"; + public const string CMS_PageFormerUrlPath = "CMS.PageFormerUrlPath"; + + public static HashSet All = new( + new[] + { + cms_culture, cms_site, cms_Role, cms_user, cms_UserRole, cms_emailtemplate, cms_permission, cms_resource, CMS_EventLog, cms_tree, cms_document, cms_class, cms_pagetemplate, cms_query, cms_transformation, cms_workflow, + cms_workflowstep, cms_workflowscope, cms_versionhistory, cms_acl, cms_pagetemplatecategory, cms_layout, cms_webpartcategory, cms_webpart, cms_attachment, cms_attachmenthistory, cms_relationshipname, CMS_RelationshipNameSite, + CMS_Relationship, cms_sitedomainalias, cms_form, cms_WebPartContainer, cms_LicenseKey, cms_WebFarmServer, cms_country, cms_state, cms_WebPartLayout, CMS_SettingsKey, CMS_ResourceSite, CMS_CultureSite, CMS_UserSite, + CMS_WorkflowStepRole, CMS_ClassSite, cms_FormRole, CMS_AllowedChildClass, cms_rolepermission, cms_settingscategory, CMS_VersionAttachment, CMS_WebPartContainerSite, cms_category, cms_documentcategory, cms_AlternativeForm, + cms_timezone, cms_avatar, cms_usersettings, cms_email, cms_attachmentforemail, CMS_EmailUser, cms_SearchIndex, cms_SearchIndexSite, cms_SearchIndexCulture, CMS_SearchTask, cms_userculture, CMS_UIElement, CMS_RoleUIElement, cms_Widget, + CMS_WidgetCategory, CMS_WidgetRole, CMS_Membership, CMS_SMTPServer, CMS_SMTPServerSite, CMS_MembershipRole, CMS_MembershipUser, CMS_WorkflowTransition, CMS_MacroRule, CMS_WorkflowStepUser, CMS_WorkflowUser, cms_aclitem, + CMS_TranslationService, CMS_TranslationSubmission, cms_workflowaction, cms_webfarmservertask, CMS_DocumentTypeScope, CMS_DocumentTypeScopeClass, CMS_ModuleLicenseKey, CMS_ModuleUsageCounter, CMS_MacroIdentity, CMS_UserMacroIdentity, + CMS_SearchTaskAzure, CMS_Consent, CMS_ConsentAgreement, CMS_ConsentArchive, CMS_AlternativeUrl, CMS_PageTemplateConfiguration, CMS_AutomationTemplate, CMS_PageUrlPath, CMS_PageFormerUrlPath + }, StringComparer.InvariantCultureIgnoreCase); + + public static HashSet Customizable = new(new[] { cms_user, cms_usersettings, media_file, OM_Account, OM_Contact }, StringComparer.InvariantCultureIgnoreCase); + public static HashSet NoLongerSupported = new(new[] { cms_usersettings }, StringComparer.InvariantCultureIgnoreCase); +} +#pragma warning enable IDE1006 diff --git a/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs b/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs index 95c3840f..a2243557 100644 --- a/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs +++ b/Migration.Toolkit.Common/Enumerations/Kx13SystemResource.cs @@ -1,72 +1,74 @@ -// ReSharper disable InconsistentNaming - -namespace Migration.Toolkit.Common.Enumerations; - -public static class Kx13SystemResource -{ - public const string CMS = "CMS"; - public const string CMS_ABTest = "CMS.ABTest"; - public const string CMS_Activities = "CMS.Activities"; - public const string CMS_Badges = "CMS.Badges"; - public const string CMS_Categories = "CMS.Categories"; - public const string CMS_ContactManagement = "CMS.ContactManagement"; - public const string CMS_Content = "CMS.Content"; - public const string CMS_ContinuousIntegration = "CMS.ContinuousIntegration"; - public const string cms_customsystemmodule = "cms.customsystemmodule"; - public const string CMS_CustomTables = "CMS.CustomTables"; - public const string CMS_DataProtection = "CMS.DataProtection"; - public const string CMS_Design = "CMS.Design"; - public const string CMS_DocumentEngine = "CMS.DocumentEngine"; - public const string CMS_Ecommerce = "CMS.Ecommerce"; - public const string CMS_EmailEngine = "CMS.EmailEngine"; - public const string CMS_EmailTemplates = "CMS.EmailTemplates"; - public const string CMS_EventLog = "CMS.EventLog"; - public const string CMS_Form = "CMS.Form"; - public const string CMS_Globalization = "CMS.Globalization"; - public const string CMS_GlobalPermissions = "CMS.GlobalPermissions"; - public const string CMS_Localization = "CMS.Localization"; - public const string CMS_MacroEngine = "CMS.MacroEngine"; - public const string CMS_MediaDialog = "CMS.MediaDialog"; - public const string CMS_MediaLibrary = "CMS.MediaLibrary"; - public const string CMS_Membership = "CMS.Membership"; - public const string CMS_ModuleLicenses = "CMS.ModuleLicenses"; - public const string CMS_ModuleUsageTracking = "CMS.ModuleUsageTracking"; - public const string CMS_Newsletter = "CMS.Newsletter"; - public const string CMS_OnlineMarketing = "CMS.OnlineMarketing"; - public const string CMS_Permissions = "CMS.Permissions"; - public const string CMS_Personas = "CMS.Personas"; - public const string CMS_Relationships = "CMS.Relationships"; - public const string CMS_Reporting = "CMS.Reporting"; - public const string CMS_Roles = "CMS.Roles"; - public const string CMS_ScheduledTasks = "CMS.ScheduledTasks"; - public const string CMS_Scoring = "CMS.Scoring"; - public const string CMS_Search = "CMS.Search"; - public const string CMS_Search_Azure = "CMS.Search.Azure"; - public const string CMS_SharePoint = "CMS.SharePoint"; - public const string CMS_SocialMarketing = "CMS.SocialMarketing"; - public const string CMS_Staging = "CMS.Staging"; - public const string CMS_Synchronization = "CMS.Synchronization"; - public const string CMS_Taxonomy = "CMS.Taxonomy"; - public const string CMS_TranslationServices = "CMS.TranslationServices"; - public const string CMS_UIPersonalization = "CMS.UIPersonalization"; - public const string CMS_Users = "CMS.Users"; - public const string CMS_WebAnalytics = "CMS.WebAnalytics"; - public const string CMS_WebFarm = "CMS.WebFarm"; - public const string CMS_Widgets = "CMS.Widgets"; - public const string CMS_WIFIntegration = "CMS.WIFIntegration"; - public const string CMS_WorkflowEngine = "CMS.WorkflowEngine"; - public const string CMS_WYSIWYGEditor = "CMS.WYSIWYGEditor"; - public const string Licenses = "Licenses"; - - public static HashSet All = new(new[] - { - CMS, CMS_ABTest, CMS_Activities, CMS_Badges, CMS_Categories, CMS_ContactManagement, CMS_Content, CMS_ContinuousIntegration, cms_customsystemmodule, CMS_CustomTables, CMS_DataProtection, - CMS_Design, CMS_DocumentEngine, CMS_Ecommerce, CMS_EmailEngine, CMS_EmailTemplates, CMS_EventLog, CMS_Form, CMS_Globalization, CMS_GlobalPermissions, CMS_Localization, CMS_MacroEngine, - CMS_MediaDialog, CMS_MediaLibrary, CMS_Membership, CMS_ModuleLicenses, CMS_ModuleUsageTracking, CMS_Newsletter, CMS_OnlineMarketing, CMS_Permissions, - CMS_Personas, CMS_Relationships, CMS_Reporting, CMS_Roles, CMS_ScheduledTasks, CMS_Scoring, CMS_Search, CMS_Search_Azure, CMS_SharePoint, CMS_SocialMarketing, CMS_Staging, - CMS_Synchronization, CMS_Taxonomy, CMS_TranslationServices, CMS_UIPersonalization, CMS_Users, CMS_WebAnalytics, CMS_WebFarm, CMS_Widgets, CMS_WIFIntegration, CMS_WorkflowEngine, - CMS_WYSIWYGEditor, Licenses, - }, StringComparer.InvariantCultureIgnoreCase); - - public static HashSet ConvertToNonSysResource = new(new[] { cms_customsystemmodule }, StringComparer.CurrentCultureIgnoreCase); -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.Common.Enumerations; +#pragma warning disable IDE1006 +public static class Kx13SystemResource +{ + public const string CMS = "CMS"; + public const string CMS_ABTest = "CMS.ABTest"; + public const string CMS_Activities = "CMS.Activities"; + public const string CMS_Badges = "CMS.Badges"; + public const string CMS_Categories = "CMS.Categories"; + public const string CMS_ContactManagement = "CMS.ContactManagement"; + public const string CMS_Content = "CMS.Content"; + public const string CMS_ContinuousIntegration = "CMS.ContinuousIntegration"; + public const string cms_customsystemmodule = "cms.customsystemmodule"; + public const string CMS_CustomTables = "CMS.CustomTables"; + public const string CMS_DataProtection = "CMS.DataProtection"; + public const string CMS_Design = "CMS.Design"; + public const string CMS_DocumentEngine = "CMS.DocumentEngine"; + public const string CMS_Ecommerce = "CMS.Ecommerce"; + public const string CMS_EmailEngine = "CMS.EmailEngine"; + public const string CMS_EmailTemplates = "CMS.EmailTemplates"; + public const string CMS_EventLog = "CMS.EventLog"; + public const string CMS_Form = "CMS.Form"; + public const string CMS_Globalization = "CMS.Globalization"; + public const string CMS_GlobalPermissions = "CMS.GlobalPermissions"; + public const string CMS_Localization = "CMS.Localization"; + public const string CMS_MacroEngine = "CMS.MacroEngine"; + public const string CMS_MediaDialog = "CMS.MediaDialog"; + public const string CMS_MediaLibrary = "CMS.MediaLibrary"; + public const string CMS_Membership = "CMS.Membership"; + public const string CMS_ModuleLicenses = "CMS.ModuleLicenses"; + public const string CMS_ModuleUsageTracking = "CMS.ModuleUsageTracking"; + public const string CMS_Newsletter = "CMS.Newsletter"; + public const string CMS_OnlineMarketing = "CMS.OnlineMarketing"; + public const string CMS_Permissions = "CMS.Permissions"; + public const string CMS_Personas = "CMS.Personas"; + public const string CMS_Relationships = "CMS.Relationships"; + public const string CMS_Reporting = "CMS.Reporting"; + public const string CMS_Roles = "CMS.Roles"; + public const string CMS_ScheduledTasks = "CMS.ScheduledTasks"; + public const string CMS_Scoring = "CMS.Scoring"; + public const string CMS_Search = "CMS.Search"; + public const string CMS_Search_Azure = "CMS.Search.Azure"; + public const string CMS_SharePoint = "CMS.SharePoint"; + public const string CMS_SocialMarketing = "CMS.SocialMarketing"; + public const string CMS_Staging = "CMS.Staging"; + public const string CMS_Synchronization = "CMS.Synchronization"; + public const string CMS_Taxonomy = "CMS.Taxonomy"; + public const string CMS_TranslationServices = "CMS.TranslationServices"; + public const string CMS_UIPersonalization = "CMS.UIPersonalization"; + public const string CMS_Users = "CMS.Users"; + public const string CMS_WebAnalytics = "CMS.WebAnalytics"; + public const string CMS_WebFarm = "CMS.WebFarm"; + public const string CMS_Widgets = "CMS.Widgets"; + public const string CMS_WIFIntegration = "CMS.WIFIntegration"; + public const string CMS_WorkflowEngine = "CMS.WorkflowEngine"; + public const string CMS_WYSIWYGEditor = "CMS.WYSIWYGEditor"; + public const string Licenses = "Licenses"; + + public static HashSet All = + new( + new[] + { + CMS, CMS_ABTest, CMS_Activities, CMS_Badges, CMS_Categories, CMS_ContactManagement, CMS_Content, CMS_ContinuousIntegration, cms_customsystemmodule, CMS_CustomTables, CMS_DataProtection, CMS_Design, CMS_DocumentEngine, + CMS_Ecommerce, CMS_EmailEngine, CMS_EmailTemplates, CMS_EventLog, CMS_Form, CMS_Globalization, CMS_GlobalPermissions, CMS_Localization, CMS_MacroEngine, CMS_MediaDialog, CMS_MediaLibrary, CMS_Membership, CMS_ModuleLicenses, + CMS_ModuleUsageTracking, CMS_Newsletter, CMS_OnlineMarketing, CMS_Permissions, CMS_Personas, CMS_Relationships, CMS_Reporting, CMS_Roles, CMS_ScheduledTasks, CMS_Scoring, CMS_Search, CMS_Search_Azure, CMS_SharePoint, + CMS_SocialMarketing, CMS_Staging, CMS_Synchronization, CMS_Taxonomy, CMS_TranslationServices, CMS_UIPersonalization, CMS_Users, CMS_WebAnalytics, CMS_WebFarm, CMS_Widgets, CMS_WIFIntegration, CMS_WorkflowEngine, CMS_WYSIWYGEditor, + Licenses + }, StringComparer.InvariantCultureIgnoreCase); + + public static HashSet ConvertToNonSysResource = new(new[] { cms_customsystemmodule }, StringComparer.CurrentCultureIgnoreCase); +} +#pragma warning enable IDE1006 diff --git a/Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs b/Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs index bf43fa7b..9e51c0a4 100644 --- a/Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs +++ b/Migration.Toolkit.Common/Enumerations/NodeXmlColumns.cs @@ -1,42 +1,42 @@ -namespace Migration.Toolkit.Common.Enumerations; - -public class NodeXmlColumns -{ - public const string NODE_ID = "NodeID"; - public const string NODE_ALIAS_PATH = "NodeAliasPath"; - public const string NODE_NAME = "NodeName"; - public const string NODE_ALIAS = "NodeAlias"; - public const string NODE_CLASS_ID = "NodeClassID"; - public const string NODE_PARENT_ID = "NodeParentID"; - public const string NODE_LEVEL = "NodeLevel"; - public const string NODE_SITE_ID = "NodeSiteID"; - public const string NODE_GUID = "NodeGUID"; - public const string NODE_ORDER = "NodeOrder"; - public const string NODE_OWNER = "NodeOwner"; - public const string NODE_HAS_CHILDREN = "NodeHasChildren"; - public const string NODE_HAS_LINKS = "NodeHasLinks"; - public const string NODE_ORIGINAL_NODE_ID = "NodeOriginalNodeID"; - public const string NODE_IS_PAGE = "NodeIsPage"; - public const string NODE_IS_SECURED = "NodeIsSecured"; - public const string DOCUMENT_ID = "DocumentID"; - public const string DOCUMENT_NAME = "DocumentName"; - public const string DOCUMENT_MODIFIED_WHEN = "DocumentModifiedWhen"; - public const string DOCUMENT_MODIFIED_BY_USER_ID = "DocumentModifiedByUserID"; - public const string DOCUMENT_CREATED_BY_USER_ID = "DocumentCreatedByUserID"; - public const string DOCUMENT_CREATED_WHEN = "DocumentCreatedWhen"; - public const string DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID = "DocumentCheckedOutVersionHistoryID"; - public const string DOCUMENT_PUBLISHED_VERSION_HISTORY_ID = "DocumentPublishedVersionHistoryID"; - public const string DOCUMENT_WORKFLOW_STEP_ID = "DocumentWorkflowStepID"; - public const string DOCUMENT_CULTURE = "DocumentCulture"; - public const string DOCUMENT_NODE_ID = "DocumentNodeID"; - public const string DOCUMENT_CONTENT = "DocumentContent"; - public const string DOCUMENT_LAST_VERSION_NUMBER = "DocumentLastVersionNumber"; - public const string DOCUMENT_IS_ARCHIVED = "DocumentIsArchived"; - public const string DOCUMENT_GUID = "DocumentGUID"; - public const string DOCUMENT_WORKFLOW_CYCLE_GUID = "DocumentWorkflowCycleGUID"; - public const string DOCUMENT_CAN_BE_PUBLISHED = "DocumentCanBePublished"; - public const string DOCUMENT_PAGE_BUILDER_WIDGETS = "DocumentPageBuilderWidgets"; - public const string CLASS_NAME = "ClassName"; - - public const string DOCUMENT_PAGE_TEMPLATE_CONFIGURATION = "DocumentPageTemplateConfiguration"; -} \ No newline at end of file +namespace Migration.Toolkit.Common.Enumerations; + +public class NodeXmlColumns +{ + public const string NODE_ID = "NodeID"; + public const string NODE_ALIAS_PATH = "NodeAliasPath"; + public const string NODE_NAME = "NodeName"; + public const string NODE_ALIAS = "NodeAlias"; + public const string NODE_CLASS_ID = "NodeClassID"; + public const string NODE_PARENT_ID = "NodeParentID"; + public const string NODE_LEVEL = "NodeLevel"; + public const string NODE_SITE_ID = "NodeSiteID"; + public const string NODE_GUID = "NodeGUID"; + public const string NODE_ORDER = "NodeOrder"; + public const string NODE_OWNER = "NodeOwner"; + public const string NODE_HAS_CHILDREN = "NodeHasChildren"; + public const string NODE_HAS_LINKS = "NodeHasLinks"; + public const string NODE_ORIGINAL_NODE_ID = "NodeOriginalNodeID"; + public const string NODE_IS_PAGE = "NodeIsPage"; + public const string NODE_IS_SECURED = "NodeIsSecured"; + public const string DOCUMENT_ID = "DocumentID"; + public const string DOCUMENT_NAME = "DocumentName"; + public const string DOCUMENT_MODIFIED_WHEN = "DocumentModifiedWhen"; + public const string DOCUMENT_MODIFIED_BY_USER_ID = "DocumentModifiedByUserID"; + public const string DOCUMENT_CREATED_BY_USER_ID = "DocumentCreatedByUserID"; + public const string DOCUMENT_CREATED_WHEN = "DocumentCreatedWhen"; + public const string DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID = "DocumentCheckedOutVersionHistoryID"; + public const string DOCUMENT_PUBLISHED_VERSION_HISTORY_ID = "DocumentPublishedVersionHistoryID"; + public const string DOCUMENT_WORKFLOW_STEP_ID = "DocumentWorkflowStepID"; + public const string DOCUMENT_CULTURE = "DocumentCulture"; + public const string DOCUMENT_NODE_ID = "DocumentNodeID"; + public const string DOCUMENT_CONTENT = "DocumentContent"; + public const string DOCUMENT_LAST_VERSION_NUMBER = "DocumentLastVersionNumber"; + public const string DOCUMENT_IS_ARCHIVED = "DocumentIsArchived"; + public const string DOCUMENT_GUID = "DocumentGUID"; + public const string DOCUMENT_WORKFLOW_CYCLE_GUID = "DocumentWorkflowCycleGUID"; + public const string DOCUMENT_CAN_BE_PUBLISHED = "DocumentCanBePublished"; + public const string DOCUMENT_PAGE_BUILDER_WIDGETS = "DocumentPageBuilderWidgets"; + public const string CLASS_NAME = "ClassName"; + + public const string DOCUMENT_PAGE_TEMPLATE_CONFIGURATION = "DocumentPageTemplateConfiguration"; +} diff --git a/Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs b/Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs index c851f820..aa7e2edc 100644 --- a/Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs +++ b/Migration.Toolkit.Common/Enumerations/XbKSystemClasses.cs @@ -1,111 +1,111 @@ -// ReSharper disable InconsistentNaming - -namespace Migration.Toolkit.Common.Enumerations; - -public class XbKSystemClasses -{ - public const string cms_culture = "cms.culture"; - public const string cms_site = "cms.site"; - public const string cms_Role = "cms.Role"; - public const string cms_user = "cms.user"; - public const string cms_UserRole = "cms.UserRole"; - public const string cms_emailtemplate = "cms.emailtemplate"; - public const string cms_permission = "cms.permission"; - public const string cms_resource = "cms.resource"; - public const string CMS_EventLog = "CMS.EventLog"; - public const string cms_tree = "cms.tree"; - public const string cms_document = "cms.document"; - public const string cms_class = "cms.class"; - public const string cms_query = "cms.query"; - public const string cms_transformation = "cms.transformation"; - public const string cms_workflow = "cms.workflow"; - public const string cms_workflowstep = "cms.workflowstep"; - public const string cms_workflowscope = "cms.workflowscope"; - public const string cms_versionhistory = "cms.versionhistory"; - public const string cms_sitedomainalias = "cms.sitedomainalias"; - public const string cms_form = "cms.form"; - public const string cms_LicenseKey = "cms.LicenseKey"; - public const string cms_WebFarmServer = "cms.WebFarmServer"; - public const string cms_country = "cms.country"; - public const string cms_state = "cms.state"; - public const string staging_synchronization = "staging.synchronization"; - public const string staging_server = "staging.server"; - public const string CMS_SettingsKey = "CMS.SettingsKey"; - public const string export_history = "export.history"; - public const string CMS_ResourceSite = "CMS.ResourceSite"; - public const string CMS_CultureSite = "CMS.CultureSite"; - public const string CMS_UserSite = "CMS.UserSite"; - public const string CMS_WorkflowStepRole = "CMS.WorkflowStepRole"; - public const string CMS_ClassSite = "CMS.ClassSite"; - public const string cms_FormRole = "cms.FormRole"; - public const string cms_rolepermission = "cms.rolepermission"; - public const string cms_settingscategory = "cms.settingscategory"; - public const string cms_AlternativeForm = "cms.AlternativeForm"; - public const string cms_timezone = "cms.timezone"; - public const string cms_email = "cms.email"; - public const string cms_attachmentforemail = "cms.attachmentforemail"; - public const string media_library = "media.library"; - public const string media_file = "media.file"; - public const string media_libraryrolepermission = "media.libraryrolepermission"; - public const string cms_SearchIndex = "cms.SearchIndex"; - public const string cms_SearchIndexSite = "cms.SearchIndexSite"; - public const string cms_SearchIndexCulture = "cms.SearchIndexCulture"; - public const string CMS_SearchTask = "CMS.SearchTask"; - public const string cms_userculture = "cms.userculture"; - public const string OM_ABTest = "OM.ABTest"; - public const string CMS_Membership = "CMS.Membership"; - public const string CMS_MembershipRole = "CMS.MembershipRole"; - public const string CMS_MembershipUser = "CMS.MembershipUser"; - public const string OM_Account = "OM.Account"; - public const string OM_AccountStatus = "OM.AccountStatus"; - public const string OM_Contact = "OM.Contact"; - public const string OM_ContactStatus = "OM.ContactStatus"; - public const string OM_ContactRole = "OM.ContactRole"; - public const string OM_AccountContact = "OM.AccountContact"; - public const string OM_ContactGroup = "OM.ContactGroup"; - public const string OM_ContactGroupMember = "OM.ContactGroupMember"; - public const string OM_Activity = "OM.Activity"; - public const string OM_ActivityType = "OM.ActivityType"; - public const string Integration_Connector = "Integration.Connector"; - public const string Integration_Synchronization = "Integration.Synchronization"; - public const string CMS_WorkflowTransition = "CMS.WorkflowTransition"; - public const string CMS_MacroRule = "CMS.MacroRule"; - public const string CMS_WorkflowStepUser = "CMS.WorkflowStepUser"; - public const string CMS_WorkflowUser = "CMS.WorkflowUser"; - public const string cms_workflowaction = "cms.workflowaction"; - public const string cms_webfarmservertask = "cms.webfarmservertask"; - public const string OM_VisitorToContact = "OM.VisitorToContact"; - public const string CMS_MacroIdentity = "CMS.MacroIdentity"; - public const string CMS_UserMacroIdentity = "CMS.UserMacroIdentity"; - public const string CMS_SearchTaskAzure = "CMS.SearchTaskAzure"; - public const string CMS_Consent = "CMS.Consent"; - public const string CMS_ConsentAgreement = "CMS.ConsentAgreement"; - public const string CMS_ConsentArchive = "CMS.ConsentArchive"; - public const string Temp_PageBuilderWidgets = "Temp.PageBuilderWidgets"; - public const string CMS_AlternativeUrl = "CMS.AlternativeUrl"; - public const string CMS_PageTemplateConfiguration = "CMS.PageTemplateConfiguration"; - public const string OM_ABVariantData = "OM.ABVariantData"; - public const string CMS_AutomationTemplate = "CMS.AutomationTemplate"; - public const string CMS_PageUrlPath = "CMS.PageUrlPath"; - public const string CMS_PageFormerUrlPath = "CMS.PageFormerUrlPath"; - public const string CMS_FormFeaturedField = "CMS.FormFeaturedField"; - public const string CMS_MacroRuleCategory = "CMS.MacroRuleCategory"; - public const string CMS_MacroRuleMacroRuleCategory = "CMS.MacroRuleMacroRuleCategory"; - public const string OM_TrackedWebsite = "OM.TrackedWebsite"; - public const string EmailLibrary_EmailConfiguration = "EmailLibrary.EmailConfiguration"; - public const string EmailLibrary_EmailTemplate = "EmailLibrary.EmailTemplate"; - public const string cms_contentrelationship = "cms.contentrelationship"; - public const string cms_contentrelationshipitem = "cms.contentrelationshipitem"; - - public static HashSet All = new( - new[] - { - cms_culture, cms_site, cms_Role, cms_user, cms_UserRole, cms_emailtemplate, cms_permission, cms_resource, CMS_EventLog, cms_tree, cms_document, cms_class, cms_query, - cms_transformation, cms_workflow, cms_workflowstep, cms_workflowscope, cms_versionhistory, cms_sitedomainalias, cms_form, cms_LicenseKey, cms_WebFarmServer, cms_country, cms_state, - CMS_SettingsKey, CMS_ResourceSite, CMS_CultureSite, CMS_UserSite, CMS_WorkflowStepRole, CMS_ClassSite, cms_FormRole, cms_rolepermission, cms_settingscategory, cms_AlternativeForm, - cms_timezone, cms_email, cms_attachmentforemail, cms_SearchIndex, cms_SearchIndexSite, cms_SearchIndexCulture, CMS_SearchTask, cms_userculture, CMS_Membership, CMS_MembershipRole, - CMS_MembershipUser, CMS_WorkflowTransition, CMS_MacroRule, CMS_WorkflowStepUser, CMS_WorkflowUser, cms_workflowaction, cms_webfarmservertask, CMS_MacroIdentity, CMS_UserMacroIdentity, - CMS_SearchTaskAzure, CMS_Consent, CMS_ConsentAgreement, CMS_ConsentArchive, CMS_AlternativeUrl, CMS_PageTemplateConfiguration, CMS_AutomationTemplate, CMS_PageUrlPath, - CMS_PageFormerUrlPath, CMS_FormFeaturedField, CMS_MacroRuleCategory, CMS_MacroRuleMacroRuleCategory, cms_contentrelationship, cms_contentrelationshipitem, - }, StringComparer.InvariantCultureIgnoreCase); -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.Common.Enumerations; +#pragma warning disable IDE1006 +public class XbKSystemClasses +{ + public const string cms_culture = "cms.culture"; + public const string cms_site = "cms.site"; + public const string cms_Role = "cms.Role"; + public const string cms_user = "cms.user"; + public const string cms_UserRole = "cms.UserRole"; + public const string cms_emailtemplate = "cms.emailtemplate"; + public const string cms_permission = "cms.permission"; + public const string cms_resource = "cms.resource"; + public const string CMS_EventLog = "CMS.EventLog"; + public const string cms_tree = "cms.tree"; + public const string cms_document = "cms.document"; + public const string cms_class = "cms.class"; + public const string cms_query = "cms.query"; + public const string cms_transformation = "cms.transformation"; + public const string cms_workflow = "cms.workflow"; + public const string cms_workflowstep = "cms.workflowstep"; + public const string cms_workflowscope = "cms.workflowscope"; + public const string cms_versionhistory = "cms.versionhistory"; + public const string cms_sitedomainalias = "cms.sitedomainalias"; + public const string cms_form = "cms.form"; + public const string cms_LicenseKey = "cms.LicenseKey"; + public const string cms_WebFarmServer = "cms.WebFarmServer"; + public const string cms_country = "cms.country"; + public const string cms_state = "cms.state"; + public const string staging_synchronization = "staging.synchronization"; + public const string staging_server = "staging.server"; + public const string CMS_SettingsKey = "CMS.SettingsKey"; + public const string export_history = "export.history"; + public const string CMS_ResourceSite = "CMS.ResourceSite"; + public const string CMS_CultureSite = "CMS.CultureSite"; + public const string CMS_UserSite = "CMS.UserSite"; + public const string CMS_WorkflowStepRole = "CMS.WorkflowStepRole"; + public const string CMS_ClassSite = "CMS.ClassSite"; + public const string cms_FormRole = "cms.FormRole"; + public const string cms_rolepermission = "cms.rolepermission"; + public const string cms_settingscategory = "cms.settingscategory"; + public const string cms_AlternativeForm = "cms.AlternativeForm"; + public const string cms_timezone = "cms.timezone"; + public const string cms_email = "cms.email"; + public const string cms_attachmentforemail = "cms.attachmentforemail"; + public const string media_library = "media.library"; + public const string media_file = "media.file"; + public const string media_libraryrolepermission = "media.libraryrolepermission"; + public const string cms_SearchIndex = "cms.SearchIndex"; + public const string cms_SearchIndexSite = "cms.SearchIndexSite"; + public const string cms_SearchIndexCulture = "cms.SearchIndexCulture"; + public const string CMS_SearchTask = "CMS.SearchTask"; + public const string cms_userculture = "cms.userculture"; + public const string OM_ABTest = "OM.ABTest"; + public const string CMS_Membership = "CMS.Membership"; + public const string CMS_MembershipRole = "CMS.MembershipRole"; + public const string CMS_MembershipUser = "CMS.MembershipUser"; + public const string OM_Account = "OM.Account"; + public const string OM_AccountStatus = "OM.AccountStatus"; + public const string OM_Contact = "OM.Contact"; + public const string OM_ContactStatus = "OM.ContactStatus"; + public const string OM_ContactRole = "OM.ContactRole"; + public const string OM_AccountContact = "OM.AccountContact"; + public const string OM_ContactGroup = "OM.ContactGroup"; + public const string OM_ContactGroupMember = "OM.ContactGroupMember"; + public const string OM_Activity = "OM.Activity"; + public const string OM_ActivityType = "OM.ActivityType"; + public const string Integration_Connector = "Integration.Connector"; + public const string Integration_Synchronization = "Integration.Synchronization"; + public const string CMS_WorkflowTransition = "CMS.WorkflowTransition"; + public const string CMS_MacroRule = "CMS.MacroRule"; + public const string CMS_WorkflowStepUser = "CMS.WorkflowStepUser"; + public const string CMS_WorkflowUser = "CMS.WorkflowUser"; + public const string cms_workflowaction = "cms.workflowaction"; + public const string cms_webfarmservertask = "cms.webfarmservertask"; + public const string OM_VisitorToContact = "OM.VisitorToContact"; + public const string CMS_MacroIdentity = "CMS.MacroIdentity"; + public const string CMS_UserMacroIdentity = "CMS.UserMacroIdentity"; + public const string CMS_SearchTaskAzure = "CMS.SearchTaskAzure"; + public const string CMS_Consent = "CMS.Consent"; + public const string CMS_ConsentAgreement = "CMS.ConsentAgreement"; + public const string CMS_ConsentArchive = "CMS.ConsentArchive"; + public const string Temp_PageBuilderWidgets = "Temp.PageBuilderWidgets"; + public const string CMS_AlternativeUrl = "CMS.AlternativeUrl"; + public const string CMS_PageTemplateConfiguration = "CMS.PageTemplateConfiguration"; + public const string OM_ABVariantData = "OM.ABVariantData"; + public const string CMS_AutomationTemplate = "CMS.AutomationTemplate"; + public const string CMS_PageUrlPath = "CMS.PageUrlPath"; + public const string CMS_PageFormerUrlPath = "CMS.PageFormerUrlPath"; + public const string CMS_FormFeaturedField = "CMS.FormFeaturedField"; + public const string CMS_MacroRuleCategory = "CMS.MacroRuleCategory"; + public const string CMS_MacroRuleMacroRuleCategory = "CMS.MacroRuleMacroRuleCategory"; + public const string OM_TrackedWebsite = "OM.TrackedWebsite"; + public const string EmailLibrary_EmailConfiguration = "EmailLibrary.EmailConfiguration"; + public const string EmailLibrary_EmailTemplate = "EmailLibrary.EmailTemplate"; + public const string cms_contentrelationship = "cms.contentrelationship"; + public const string cms_contentrelationshipitem = "cms.contentrelationshipitem"; + + public static HashSet All = new( + new[] + { + cms_culture, cms_site, cms_Role, cms_user, cms_UserRole, cms_emailtemplate, cms_permission, cms_resource, CMS_EventLog, cms_tree, cms_document, cms_class, cms_query, cms_transformation, cms_workflow, cms_workflowstep, + cms_workflowscope, cms_versionhistory, cms_sitedomainalias, cms_form, cms_LicenseKey, cms_WebFarmServer, cms_country, cms_state, CMS_SettingsKey, CMS_ResourceSite, CMS_CultureSite, CMS_UserSite, CMS_WorkflowStepRole, CMS_ClassSite, + cms_FormRole, cms_rolepermission, cms_settingscategory, cms_AlternativeForm, cms_timezone, cms_email, cms_attachmentforemail, cms_SearchIndex, cms_SearchIndexSite, cms_SearchIndexCulture, CMS_SearchTask, cms_userculture, + CMS_Membership, CMS_MembershipRole, CMS_MembershipUser, CMS_WorkflowTransition, CMS_MacroRule, CMS_WorkflowStepUser, CMS_WorkflowUser, cms_workflowaction, cms_webfarmservertask, CMS_MacroIdentity, CMS_UserMacroIdentity, + CMS_SearchTaskAzure, CMS_Consent, CMS_ConsentAgreement, CMS_ConsentArchive, CMS_AlternativeUrl, CMS_PageTemplateConfiguration, CMS_AutomationTemplate, CMS_PageUrlPath, CMS_PageFormerUrlPath, CMS_FormFeaturedField, + CMS_MacroRuleCategory, CMS_MacroRuleMacroRuleCategory, cms_contentrelationship, cms_contentrelationshipitem + }, StringComparer.InvariantCultureIgnoreCase); +} +#pragma warning enable IDE1006 diff --git a/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs b/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs index 669aaa6f..386f22c1 100644 --- a/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs +++ b/Migration.Toolkit.Common/Enumerations/XbkSystemResource.cs @@ -1,53 +1,54 @@ -// ReSharper disable InconsistentNaming - -namespace Migration.Toolkit.Common.Enumerations; - -public static class XbkSystemResource -{ - public const string CMS = "CMS"; - public const string CMS_ABTest = "CMS.ABTest"; - public const string CMS_Activities = "CMS.Activities"; - public const string CMS_ContactManagement = "CMS.ContactManagement"; - public const string CMS_Content = "CMS.Content"; - public const string CMS_ContinuousIntegration = "CMS.ContinuousIntegration"; - public const string CMS_CrossSiteTracking = "CMS.CrossSiteTracking"; - public const string CMS_CustomTables = "CMS.CustomTables"; - public const string CMS_DataProtection = "CMS.DataProtection"; - public const string CMS_Design = "CMS.Design"; - public const string CMS_DocumentEngine = "CMS.DocumentEngine"; - public const string CMS_EmailEngine = "CMS.EmailEngine"; - public const string CMS_EmailLibrary = "CMS.EmailLibrary"; - public const string CMS_EmailTemplates = "CMS.EmailTemplates"; - public const string CMS_EventLog = "CMS.EventLog"; - public const string CMS_Form = "CMS.Form"; - public const string CMS_Globalization = "CMS.Globalization"; - public const string CMS_GlobalPermissions = "CMS.GlobalPermissions"; - public const string CMS_Licenses = "CMS.Licenses"; - public const string CMS_Localization = "CMS.Localization"; - public const string CMS_MacroEngine = "CMS.MacroEngine"; - public const string CMS_MediaDialog = "CMS.MediaDialog"; - public const string CMS_MediaLibrary = "CMS.MediaLibrary"; - public const string CMS_Membership = "CMS.Membership"; - public const string CMS_ModuleLicenses = "CMS.ModuleLicenses"; - public const string CMS_OnlineMarketing = "CMS.OnlineMarketing"; - public const string CMS_Permissions = "CMS.Permissions"; - public const string CMS_Roles = "CMS.Roles"; - public const string CMS_ScheduledTasks = "CMS.ScheduledTasks"; - public const string CMS_Search = "CMS.Search"; - public const string CMS_Search_Azure = "CMS.Search.Azure"; - public const string CMS_Staging = "CMS.Staging"; - public const string CMS_Synchronization = "CMS.Synchronization"; - public const string CMS_UIPersonalization = "CMS.UIPersonalization"; - public const string CMS_Users = "CMS.Users"; - public const string CMS_WebFarm = "CMS.WebFarm"; - public const string CMS_WorkflowEngine = "CMS.WorkflowEngine"; - public const string CMS_WYSIWYGEditor = "CMS.WYSIWYGEditor"; - - public static HashSet All = new(new[] - { - CMS, CMS_ABTest, CMS_Activities, CMS_ContactManagement, CMS_Content, CMS_ContinuousIntegration, CMS_CrossSiteTracking, CMS_CustomTables, CMS_DataProtection, CMS_Design, CMS_DocumentEngine, - CMS_EmailEngine, CMS_EmailLibrary, CMS_EmailTemplates, CMS_EventLog, CMS_Form, CMS_Globalization, CMS_GlobalPermissions, CMS_Licenses, CMS_Localization, CMS_MacroEngine, CMS_MediaDialog, - CMS_MediaLibrary, CMS_Membership, CMS_ModuleLicenses, CMS_OnlineMarketing, CMS_Permissions, CMS_Roles, CMS_ScheduledTasks, CMS_Search, CMS_Search_Azure, CMS_Staging, CMS_Synchronization, - CMS_UIPersonalization, CMS_Users, CMS_WebFarm, CMS_WorkflowEngine, CMS_WYSIWYGEditor, - }, StringComparer.InvariantCultureIgnoreCase); -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.Common.Enumerations; + +public static class XbkSystemResource +{ + public const string CMS = "CMS"; + public const string CMS_ABTest = "CMS.ABTest"; + public const string CMS_Activities = "CMS.Activities"; + public const string CMS_ContactManagement = "CMS.ContactManagement"; + public const string CMS_Content = "CMS.Content"; + public const string CMS_ContinuousIntegration = "CMS.ContinuousIntegration"; + public const string CMS_CrossSiteTracking = "CMS.CrossSiteTracking"; + public const string CMS_CustomTables = "CMS.CustomTables"; + public const string CMS_DataProtection = "CMS.DataProtection"; + public const string CMS_Design = "CMS.Design"; + public const string CMS_DocumentEngine = "CMS.DocumentEngine"; + public const string CMS_EmailEngine = "CMS.EmailEngine"; + public const string CMS_EmailLibrary = "CMS.EmailLibrary"; + public const string CMS_EmailTemplates = "CMS.EmailTemplates"; + public const string CMS_EventLog = "CMS.EventLog"; + public const string CMS_Form = "CMS.Form"; + public const string CMS_Globalization = "CMS.Globalization"; + public const string CMS_GlobalPermissions = "CMS.GlobalPermissions"; + public const string CMS_Licenses = "CMS.Licenses"; + public const string CMS_Localization = "CMS.Localization"; + public const string CMS_MacroEngine = "CMS.MacroEngine"; + public const string CMS_MediaDialog = "CMS.MediaDialog"; + public const string CMS_MediaLibrary = "CMS.MediaLibrary"; + public const string CMS_Membership = "CMS.Membership"; + public const string CMS_ModuleLicenses = "CMS.ModuleLicenses"; + public const string CMS_OnlineMarketing = "CMS.OnlineMarketing"; + public const string CMS_Permissions = "CMS.Permissions"; + public const string CMS_Roles = "CMS.Roles"; + public const string CMS_ScheduledTasks = "CMS.ScheduledTasks"; + public const string CMS_Search = "CMS.Search"; + public const string CMS_Search_Azure = "CMS.Search.Azure"; + public const string CMS_Staging = "CMS.Staging"; + public const string CMS_Synchronization = "CMS.Synchronization"; + public const string CMS_UIPersonalization = "CMS.UIPersonalization"; + public const string CMS_Users = "CMS.Users"; + public const string CMS_WebFarm = "CMS.WebFarm"; + public const string CMS_WorkflowEngine = "CMS.WorkflowEngine"; + public const string CMS_WYSIWYGEditor = "CMS.WYSIWYGEditor"; + + public static HashSet All = + new( + new[] + { + CMS, CMS_ABTest, CMS_Activities, CMS_ContactManagement, CMS_Content, CMS_ContinuousIntegration, CMS_CrossSiteTracking, CMS_CustomTables, CMS_DataProtection, CMS_Design, CMS_DocumentEngine, CMS_EmailEngine, CMS_EmailLibrary, + CMS_EmailTemplates, CMS_EventLog, CMS_Form, CMS_Globalization, CMS_GlobalPermissions, CMS_Licenses, CMS_Localization, CMS_MacroEngine, CMS_MediaDialog, CMS_MediaLibrary, CMS_Membership, CMS_ModuleLicenses, CMS_OnlineMarketing, + CMS_Permissions, CMS_Roles, CMS_ScheduledTasks, CMS_Search, CMS_Search_Azure, CMS_Staging, CMS_Synchronization, CMS_UIPersonalization, CMS_Users, CMS_WebFarm, CMS_WorkflowEngine, CMS_WYSIWYGEditor + }, StringComparer.InvariantCultureIgnoreCase); +} diff --git a/Migration.Toolkit.Common/Extensions.cs b/Migration.Toolkit.Common/Extensions.cs index a313ab16..5051847f 100644 --- a/Migration.Toolkit.Common/Extensions.cs +++ b/Migration.Toolkit.Common/Extensions.cs @@ -1,144 +1,210 @@ -using System.Linq.Expressions; - -namespace Migration.Toolkit.Common; - -using System.Data; -using System.Data.Common; -using System.Xml.Linq; -using CMS.Base; -using CMS.Helpers; -using Newtonsoft.Json; - -public static class Extensions -{ - public static T Unbox(this IDataReader reader, string propertyName) - { - if (reader.GetOrdinal(propertyName) < 0) - { - throw new InvalidOperationException($"Property '{propertyName}' not exists"); - } - - return reader[propertyName] switch - { - T r => r, - DBNull => default!, - _ => throw new InvalidCastException($"Unboxing property '{propertyName}' of type '{reader[propertyName].GetType().FullName}' to type '{typeof(T).FullName}' failed") - }; - } - - public static bool IsIn(this T value, params T[] values) => values.Contains(value); - - public static string GetMemberName(this Expression> expr) - { - var stack = new Stack(); - - var me = expr.Body.NodeType switch - { - ExpressionType.Convert => (expr.Body is UnaryExpression ue ? ue.Operand : null) as MemberExpression, - ExpressionType.ConvertChecked => (expr.Body is UnaryExpression ue ? ue.Operand : null) as MemberExpression, - _ => expr.Body as MemberExpression - }; - - while (me != null) - { - stack.Push(me.Member.Name); - me = me.Expression as MemberExpression; - } - - return string.Join(".", stack.ToArray()); - } - - public static bool UseKenticoDefault(this bool? value) => value ?? false; - public static int UseKenticoDefault(this int? value) => value ?? 0; - - public static TEnum AsEnum(this int? value) where TEnum : Enum - => (TEnum)Enum.ToObject(typeof(TEnum), value ?? 0); - - public static TEnum AsEnum(this string? value) where TEnum : struct, Enum - => Enum.TryParse(value, out var val) ? val : default(TEnum); - - public static int? NullIfZero(this int? value) => value == 0 ? null : value; - public static int? NullIfZero(this int value) => value == 0 ? null : value; - - public static string? NullIf(this string? s, string value) => s == value ? null : s; - - public static void SetValueAsJson(this ISimpleDataContainer container, string column, TValue value) - { - container.SetValue(column, !value?.Equals(default) ?? false ? JsonConvert.SerializeObject(value) : null); - } - - public static void SetValueAsJson(this ISimpleDataContainer container, string column, IEnumerable values) - { - container.SetValue(column, values.Any() ? JsonConvert.SerializeObject(values) : null); - } - - public static void SetValueAsJson(this Dictionary container, string column, TValue value) - { - container[column] = value?.Equals(default) ?? true ? null : JsonConvert.SerializeObject(value); - } - - public static void SetValueAsJson(this Dictionary container, string column, IEnumerable values) - { - container[column] = values.Any() ? JsonConvert.SerializeObject(values) : null; - } - - #region System.Xml.Linq extensions - - /// - /// - /// - /// - /// - /// - /// Returns ensured XElement - public static XElement EnsureElement(this XElement element, XName name, Action? elementUpdate = null) - { - if (element.Element(name) is { } result) - { - elementUpdate?.Invoke(result); - return result; - } - else - { - var newElement = new XElement(name); - elementUpdate?.Invoke(newElement); - element.Add(newElement); - return newElement; - } - } - - #endregion - - public static T Unbox(this DbDataReader reader, string propertyName) - { - if (reader.GetOrdinal(propertyName) < 0) - { - throw new InvalidOperationException($"Property '{propertyName}' not exists"); - } - - return reader[propertyName] switch - { - T r => r, - DBNull => default, - _ => throw new InvalidCastException($"Unboxing property '{propertyName}' of type '{reader[propertyName].GetType().FullName}' to type '{typeof(T).FullName}' failed") - }; - } - - public static T Value(this XElement element) - { - return element?.Value == default - ? default - : ValidationHelper.GetValue(element.Value); - } - - - public static bool? ValueAsBool(this XElement element) - { - - if (element != null && bool.TryParse(element.Value, out var value)) - { - return value; - } - else return default; - } -} \ No newline at end of file +using System.Data; +using System.Data.Common; +using System.Linq.Expressions; +using System.Xml.Linq; + +using CMS.Base; +using CMS.Helpers; + +using Newtonsoft.Json; + +namespace Migration.Toolkit.Common; + +public static class Extensions +{ + public static T Unbox(this IDataReader reader, string propertyName) + { + if (reader.GetOrdinal(propertyName) < 0) + { + throw new InvalidOperationException($"Property '{propertyName}' not exists"); + } + + return reader[propertyName] switch + { + T r => r, + DBNull => default!, + _ => throw new InvalidCastException($"Unboxing property '{propertyName}' of type '{reader[propertyName].GetType().FullName}' to type '{typeof(T).FullName}' failed") + }; + } + + public static bool IsIn(this T value, params T[] values) => values.Contains(value); + + public static string GetMemberName(this Expression> expr) + { + var stack = new Stack(); + + var me = expr.Body.NodeType switch + { + ExpressionType.Convert => (expr.Body is UnaryExpression ue ? ue.Operand : null) as MemberExpression, + ExpressionType.ConvertChecked => (expr.Body is UnaryExpression ue ? ue.Operand : null) as MemberExpression, + ExpressionType.Add => throw new NotImplementedException(), + ExpressionType.AddChecked => throw new NotImplementedException(), + ExpressionType.And => throw new NotImplementedException(), + ExpressionType.AndAlso => throw new NotImplementedException(), + ExpressionType.ArrayLength => throw new NotImplementedException(), + ExpressionType.ArrayIndex => throw new NotImplementedException(), + ExpressionType.Call => throw new NotImplementedException(), + ExpressionType.Coalesce => throw new NotImplementedException(), + ExpressionType.Conditional => throw new NotImplementedException(), + ExpressionType.Constant => throw new NotImplementedException(), + ExpressionType.Divide => throw new NotImplementedException(), + ExpressionType.Equal => throw new NotImplementedException(), + ExpressionType.ExclusiveOr => throw new NotImplementedException(), + ExpressionType.GreaterThan => throw new NotImplementedException(), + ExpressionType.GreaterThanOrEqual => throw new NotImplementedException(), + ExpressionType.Invoke => throw new NotImplementedException(), + ExpressionType.Lambda => throw new NotImplementedException(), + ExpressionType.LeftShift => throw new NotImplementedException(), + ExpressionType.LessThan => throw new NotImplementedException(), + ExpressionType.LessThanOrEqual => throw new NotImplementedException(), + ExpressionType.ListInit => throw new NotImplementedException(), + ExpressionType.MemberAccess => throw new NotImplementedException(), + ExpressionType.MemberInit => throw new NotImplementedException(), + ExpressionType.Modulo => throw new NotImplementedException(), + ExpressionType.Multiply => throw new NotImplementedException(), + ExpressionType.MultiplyChecked => throw new NotImplementedException(), + ExpressionType.Negate => throw new NotImplementedException(), + ExpressionType.UnaryPlus => throw new NotImplementedException(), + ExpressionType.NegateChecked => throw new NotImplementedException(), + ExpressionType.New => throw new NotImplementedException(), + ExpressionType.NewArrayInit => throw new NotImplementedException(), + ExpressionType.NewArrayBounds => throw new NotImplementedException(), + ExpressionType.Not => throw new NotImplementedException(), + ExpressionType.NotEqual => throw new NotImplementedException(), + ExpressionType.Or => throw new NotImplementedException(), + ExpressionType.OrElse => throw new NotImplementedException(), + ExpressionType.Parameter => throw new NotImplementedException(), + ExpressionType.Power => throw new NotImplementedException(), + ExpressionType.Quote => throw new NotImplementedException(), + ExpressionType.RightShift => throw new NotImplementedException(), + ExpressionType.Subtract => throw new NotImplementedException(), + ExpressionType.SubtractChecked => throw new NotImplementedException(), + ExpressionType.TypeAs => throw new NotImplementedException(), + ExpressionType.TypeIs => throw new NotImplementedException(), + ExpressionType.Assign => throw new NotImplementedException(), + ExpressionType.Block => throw new NotImplementedException(), + ExpressionType.DebugInfo => throw new NotImplementedException(), + ExpressionType.Decrement => throw new NotImplementedException(), + ExpressionType.Dynamic => throw new NotImplementedException(), + ExpressionType.Default => throw new NotImplementedException(), + ExpressionType.Extension => throw new NotImplementedException(), + ExpressionType.Goto => throw new NotImplementedException(), + ExpressionType.Increment => throw new NotImplementedException(), + ExpressionType.Index => throw new NotImplementedException(), + ExpressionType.Label => throw new NotImplementedException(), + ExpressionType.RuntimeVariables => throw new NotImplementedException(), + ExpressionType.Loop => throw new NotImplementedException(), + ExpressionType.Switch => throw new NotImplementedException(), + ExpressionType.Throw => throw new NotImplementedException(), + ExpressionType.Try => throw new NotImplementedException(), + ExpressionType.Unbox => throw new NotImplementedException(), + ExpressionType.AddAssign => throw new NotImplementedException(), + ExpressionType.AndAssign => throw new NotImplementedException(), + ExpressionType.DivideAssign => throw new NotImplementedException(), + ExpressionType.ExclusiveOrAssign => throw new NotImplementedException(), + ExpressionType.LeftShiftAssign => throw new NotImplementedException(), + ExpressionType.ModuloAssign => throw new NotImplementedException(), + ExpressionType.MultiplyAssign => throw new NotImplementedException(), + ExpressionType.OrAssign => throw new NotImplementedException(), + ExpressionType.PowerAssign => throw new NotImplementedException(), + ExpressionType.RightShiftAssign => throw new NotImplementedException(), + ExpressionType.SubtractAssign => throw new NotImplementedException(), + ExpressionType.AddAssignChecked => throw new NotImplementedException(), + ExpressionType.MultiplyAssignChecked => throw new NotImplementedException(), + ExpressionType.SubtractAssignChecked => throw new NotImplementedException(), + ExpressionType.PreIncrementAssign => throw new NotImplementedException(), + ExpressionType.PreDecrementAssign => throw new NotImplementedException(), + ExpressionType.PostIncrementAssign => throw new NotImplementedException(), + ExpressionType.PostDecrementAssign => throw new NotImplementedException(), + ExpressionType.TypeEqual => throw new NotImplementedException(), + ExpressionType.OnesComplement => throw new NotImplementedException(), + ExpressionType.IsTrue => throw new NotImplementedException(), + ExpressionType.IsFalse => throw new NotImplementedException(), + _ => expr.Body as MemberExpression + }; + + while (me != null) + { + stack.Push(me.Member.Name); + me = me.Expression as MemberExpression; + } + + return string.Join(".", stack.ToArray()); + } + + public static bool UseKenticoDefault(this bool? value) => value ?? false; + public static int UseKenticoDefault(this int? value) => value ?? 0; + + public static TEnum AsEnum(this int? value) where TEnum : Enum + => (TEnum)Enum.ToObject(typeof(TEnum), value ?? 0); + + public static TEnum AsEnum(this string? value) where TEnum : struct, Enum + => Enum.TryParse(value, out var val) ? val : default; + + public static int? NullIfZero(this int? value) => value == 0 ? null : value; + public static int? NullIfZero(this int value) => value == 0 ? null : value; + + public static string? NullIf(this string? s, string value) => s == value ? null : s; + + public static void SetValueAsJson(this ISimpleDataContainer container, string column, TValue value) => container.SetValue(column, !value?.Equals(default) ?? false ? JsonConvert.SerializeObject(value) : null); + + public static void SetValueAsJson(this ISimpleDataContainer container, string column, IEnumerable values) => container.SetValue(column, values.Any() ? JsonConvert.SerializeObject(values) : null); + + public static void SetValueAsJson(this Dictionary container, string column, TValue value) => container[column] = value?.Equals(default) ?? true ? null : JsonConvert.SerializeObject(value); + + public static void SetValueAsJson(this Dictionary container, string column, IEnumerable values) => container[column] = values.Any() ? JsonConvert.SerializeObject(values) : null; + + #region System.Xml.Linq extensions + + /// + /// + /// + /// + /// + /// Returns ensured XElement + public static XElement EnsureElement(this XElement element, XName name, Action? elementUpdate = null) + { + if (element.Element(name) is { } result) + { + elementUpdate?.Invoke(result); + return result; + } + + var newElement = new XElement(name); + elementUpdate?.Invoke(newElement); + element.Add(newElement); + return newElement; + } + + #endregion + + public static T Unbox(this DbDataReader reader, string propertyName) + { + if (reader.GetOrdinal(propertyName) < 0) + { + throw new InvalidOperationException($"Property '{propertyName}' not exists"); + } + + return reader[propertyName] switch + { + T r => r, + DBNull => default, + _ => throw new InvalidCastException($"Unboxing property '{propertyName}' of type '{reader[propertyName].GetType().FullName}' to type '{typeof(T).FullName}' failed") + }; + } + + public static T Value(this XElement element) => element?.Value == default + ? default + : ValidationHelper.GetValue(element.Value); + + + public static bool? ValueAsBool(this XElement element) + { + if (element != null && bool.TryParse(element.Value, out bool value)) + { + return value; + } + + return default; + } +} diff --git a/Migration.Toolkit.Common/Helpers/AlignResult.cs b/Migration.Toolkit.Common/Helpers/AlignResult.cs index 67ef37ca..1c500076 100644 --- a/Migration.Toolkit.Common/Helpers/AlignResult.cs +++ b/Migration.Toolkit.Common/Helpers/AlignResult.cs @@ -1,9 +1,13 @@ -namespace Migration.Toolkit.Common.Helpers; - -public abstract record SimpleAlignResult(TLeft? A, TRight? B, TKey? Key); - -public record SimpleAlignResultMatch(TLeft A, TRight B, TKey Key) : SimpleAlignResult(A, B, Key); -public record SimpleAlignResultOnlyA(TLeft A, TKey Key) : SimpleAlignResult(A, default, Key); -public record SimpleAlignResultOnlyB(TRight B, TKey Key) : SimpleAlignResult(default, B, Key); -public record SimpleAlignFatalNoMatch(TLeft A, TRight B, TKey Key, string ErrorDescription) : SimpleAlignResult(A, B, Key); -public record AlignDefault() : SimpleAlignResult(default, default, default); \ No newline at end of file +namespace Migration.Toolkit.Common.Helpers; + +public abstract record SimpleAlignResult(TLeft? A, TRight? B, TKey? Key); + +public record SimpleAlignResultMatch(TLeft A, TRight B, TKey Key) : SimpleAlignResult(A, B, Key); + +public record SimpleAlignResultOnlyA(TLeft A, TKey Key) : SimpleAlignResult(A, default, Key); + +public record SimpleAlignResultOnlyB(TRight B, TKey Key) : SimpleAlignResult(default, B, Key); + +public record SimpleAlignFatalNoMatch(TLeft A, TRight B, TKey Key, string ErrorDescription) : SimpleAlignResult(A, B, Key); + +public record AlignDefault() : SimpleAlignResult(default, default, default); diff --git a/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs b/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs index d0104626..3f2e3325 100644 --- a/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs +++ b/Migration.Toolkit.Common/Helpers/ConsoleHelper.cs @@ -1,37 +1,35 @@ -namespace Migration.Toolkit.Common.Helpers; - -using System.Runtime.InteropServices; - -public static class ConsoleHelper -{ - const int STD_OUTPUT_HANDLE = -11; - const uint ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4; - - [DllImport("kernel32.dll", SetLastError = true)] - static extern IntPtr GetStdHandle(int nStdHandle); - - [DllImport("kernel32.dll")] - static extern bool GetConsoleMode(IntPtr hConsoleHandle, out uint lpMode); - - [DllImport("kernel32.dll")] - static extern bool SetConsoleMode(IntPtr hConsoleHandle, uint dwMode); - - public static void EnableVirtualTerminalProcessing() - { - var handle = GetStdHandle(STD_OUTPUT_HANDLE); - uint mode; - GetConsoleMode(handle, out mode); - mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; - SetConsoleMode(handle, mode); - } - - public const string RED = "\x1b[31m"; - public const string YELLOW = "\x1b[33m"; - public const string GREEN = "\x1b[32m"; - public const string RESET = "\x1b[0m"; - - public static string Yellow(string ctext) => $"{YELLOW}{ctext}{RESET}"; - public static string Green(string ctext) => $"{GREEN}{ctext}{RESET}"; - public static string Red(string ctext) => $"{RED}{ctext}{RESET}"; - -} \ No newline at end of file +using System.Runtime.InteropServices; + +namespace Migration.Toolkit.Common.Helpers; + +public static class ConsoleHelper +{ + private const int STD_OUTPUT_HANDLE = -11; + private const uint ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4; + + public const string RED = "\x1b[31m"; + public const string YELLOW = "\x1b[33m"; + public const string GREEN = "\x1b[32m"; + public const string RESET = "\x1b[0m"; + + [DllImport("kernel32.dll", SetLastError = true)] + private static extern IntPtr GetStdHandle(int nStdHandle); + + [DllImport("kernel32.dll")] + private static extern bool GetConsoleMode(IntPtr hConsoleHandle, out uint lpMode); + + [DllImport("kernel32.dll")] + private static extern bool SetConsoleMode(IntPtr hConsoleHandle, uint dwMode); + + public static void EnableVirtualTerminalProcessing() + { + nint handle = GetStdHandle(STD_OUTPUT_HANDLE); + GetConsoleMode(handle, out uint mode); + mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; + SetConsoleMode(handle, mode); + } + + public static string Yellow(string ctext) => $"{YELLOW}{ctext}{RESET}"; + public static string Green(string ctext) => $"{GREEN}{ctext}{RESET}"; + public static string Red(string ctext) => $"{RED}{ctext}{RESET}"; +} diff --git a/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs b/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs index 0033a28f..0084847f 100644 --- a/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs +++ b/Migration.Toolkit.Common/Helpers/DeferrableItemEnumerableWrapper.cs @@ -1,51 +1,42 @@ -using System.Runtime.CompilerServices; - -namespace Migration.Toolkit.Common.Helpers; - -public class DeferrableItemEnumerableWrapper(IEnumerable innerEnumerable, int maxRecurrenceLimit = 5) : IDisposable -{ - private readonly IEnumerator _innerEnumerator = innerEnumerable.GetEnumerator(); - - public record DeferrableItem(int Recurrence, T Item); - - private readonly Queue _deferredItems = new(); - - public bool GetNext(out DeferrableItem item) - { - if (_innerEnumerator.MoveNext()) - { - item = new DeferrableItem(0, _innerEnumerator.Current); - return true; - } - - if (_deferredItems.TryDequeue(out var deferred)) - { - item = deferred with - { - Recurrence = deferred.Recurrence + 1 - }; - return true; - } - - Unsafe.SkipInit(out item); - return false; - } - - public bool TryDeferItem(DeferrableItem item) - { - if (item.Recurrence < maxRecurrenceLimit) - { - _deferredItems.Enqueue(item); - return true; - } - else - { - return false; - } - } - - public void Dispose() - { - _innerEnumerator.Dispose(); - } -} \ No newline at end of file +using System.Runtime.CompilerServices; + +namespace Migration.Toolkit.Common.Helpers; + +public class DeferrableItemEnumerableWrapper(IEnumerable innerEnumerable, int maxRecurrenceLimit = 5) : IDisposable +{ + private readonly Queue deferredItems = new(); + private readonly IEnumerator innerEnumerator = innerEnumerable.GetEnumerator(); + + public void Dispose() => innerEnumerator.Dispose(); + + public bool GetNext(out DeferrableItem item) + { + if (innerEnumerator.MoveNext()) + { + item = new DeferrableItem(0, innerEnumerator.Current); + return true; + } + + if (deferredItems.TryDequeue(out var deferred)) + { + item = deferred with { Recurrence = deferred.Recurrence + 1 }; + return true; + } + + Unsafe.SkipInit(out item); + return false; + } + + public bool TryDeferItem(DeferrableItem item) + { + if (item.Recurrence < maxRecurrenceLimit) + { + deferredItems.Enqueue(item); + return true; + } + + return false; + } + + public record DeferrableItem(int Recurrence, T Item); +} diff --git a/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs b/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs index 7dd31b51..a0377dbd 100644 --- a/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs +++ b/Migration.Toolkit.Common/Helpers/EnumerableHelper.cs @@ -1,13 +1,10 @@ -namespace Migration.Toolkit.Common.Helpers; - -public class EnumerableHelper -{ - public static SimpleAligner CreateAligner(IEnumerable eA, IEnumerable eB, IEnumerable eK, - SimpleAligner.SelectKey selectKeyA, SimpleAligner.SelectKey selectKeyB, bool disposeEnumerators) - where TLeft : class where TRight : class => SimpleAligner.Create(eA.GetEnumerator(), eB.GetEnumerator(), eK.GetEnumerator(), selectKeyA, selectKeyB, disposeEnumerators); - - public static DeferrableItemEnumerableWrapper CreateDeferrableItemWrapper(IEnumerable innerEnumerable, int maxRecurrenceLimit = 5) - { - return new DeferrableItemEnumerableWrapper(innerEnumerable, maxRecurrenceLimit); - } -} \ No newline at end of file +namespace Migration.Toolkit.Common.Helpers; + +public class EnumerableHelper +{ + public static SimpleAligner CreateAligner(IEnumerable eA, IEnumerable eB, IEnumerable eK, SimpleAligner.SelectKey selectKeyA, + SimpleAligner.SelectKey selectKeyB, bool disposeEnumerators) + where TLeft : class where TRight : class => SimpleAligner.Create(eA.GetEnumerator(), eB.GetEnumerator(), eK.GetEnumerator(), selectKeyA, selectKeyB, disposeEnumerators); + + public static DeferrableItemEnumerableWrapper CreateDeferrableItemWrapper(IEnumerable innerEnumerable, int maxRecurrenceLimit = 5) => new(innerEnumerable, maxRecurrenceLimit); +} diff --git a/Migration.Toolkit.Common/Helpers/GuidHelper.cs b/Migration.Toolkit.Common/Helpers/GuidHelper.cs index 3aa35823..8dd83da8 100644 --- a/Migration.Toolkit.Common/Helpers/GuidHelper.cs +++ b/Migration.Toolkit.Common/Helpers/GuidHelper.cs @@ -1,16 +1,18 @@ -namespace Migration.Toolkit.Common.Helpers; - -public static class GuidHelper -{ - public static readonly Guid GuidNsWebPageUrlPathInfo = new Guid("436E024E-BA61-435F-96A7-EC7E34160DCE"); - public static readonly Guid GuidNsReusableSchema = new("2702A9E7-D859-49F0-B620-FE4268A92596"); - public static readonly Guid GuidNsDocument = new("DCBADED0-54FC-4EEC-BB50-D6E7110E499D"); - public static readonly Guid GuidNsTaxonomy = new("7F23EF23-F9AE-4DB8-914B-96964E6E78E6"); - public static readonly Guid GuidNsDocumentNameField = new("8935FCE5-1BDC-4677-A4CA-6DFD32F65A0F"); - - public static Guid CreateWebPageUrlPathGuid(string hash) => GuidV5.NewNameBased(GuidNsWebPageUrlPathInfo, hash); - public static Guid CreateReusableSchemaGuid(string name) => GuidV5.NewNameBased(GuidNsReusableSchema, name); - public static Guid CreateDocumentGuid(string name) => GuidV5.NewNameBased(GuidNsDocument, name); - public static Guid CreateTaxonomyGuid(string name) => GuidV5.NewNameBased(GuidNsTaxonomy, name); - public static Guid CreateDocumentNameFieldGuid(string name) => GuidV5.NewNameBased(GuidNsDocumentNameField, name); -} \ No newline at end of file +namespace Migration.Toolkit.Common.Helpers; + +public static class GuidHelper +{ + public static readonly Guid GuidNsWebPageUrlPathInfo = new("436E024E-BA61-435F-96A7-EC7E34160DCE"); + public static readonly Guid GuidNsReusableSchema = new("2702A9E7-D859-49F0-B620-FE4268A92596"); + public static readonly Guid GuidNsDocument = new("DCBADED0-54FC-4EEC-BB50-D6E7110E499D"); + public static readonly Guid GuidNsNode = new("8691FEE4-FFFF-4642-8605-1B20B9D05360"); + public static readonly Guid GuidNsTaxonomy = new("7F23EF23-F9AE-4DB8-914B-96964E6E78E6"); + public static readonly Guid GuidNsDocumentNameField = new("8935FCE5-1BDC-4677-A4CA-6DFD32F65A0F"); + + public static Guid CreateWebPageUrlPathGuid(string hash) => GuidV5.NewNameBased(GuidNsWebPageUrlPathInfo, hash); + public static Guid CreateReusableSchemaGuid(string name) => GuidV5.NewNameBased(GuidNsReusableSchema, name); + public static Guid CreateDocumentGuid(string name) => GuidV5.NewNameBased(GuidNsDocument, name); + public static Guid CreateNodeGuid(string name) => GuidV5.NewNameBased(GuidNsNode, name); + public static Guid CreateTaxonomyGuid(string name) => GuidV5.NewNameBased(GuidNsTaxonomy, name); + public static Guid CreateDocumentNameFieldGuid(string name) => GuidV5.NewNameBased(GuidNsDocumentNameField, name); +} diff --git a/Migration.Toolkit.Common/Helpers/GuidV5.cs b/Migration.Toolkit.Common/Helpers/GuidV5.cs index a889f4c1..c045c756 100644 --- a/Migration.Toolkit.Common/Helpers/GuidV5.cs +++ b/Migration.Toolkit.Common/Helpers/GuidV5.cs @@ -1,76 +1,73 @@ -namespace Migration.Toolkit.Common.Helpers; - -using System.Security.Cryptography; -using System.Text; - -public static class GuidV5 -{ - private static readonly UuidV5Generator V5Generator = new(); - public static Guid NewNameBased(Guid namespaceId, string name) => V5Generator.New(namespaceId, name); -} - -internal class UuidV5Generator -{ - public static bool TryWriteBytes(Guid guid, Span bytes, bool bigEndian, out int bytesWritten) - { - if (bytes.Length < 16 || !guid.TryWriteBytes(bytes)) - { - bytesWritten = 0; - return false; - } - - if (bigEndian) - { - Permut(bytes, 0, 3); - Permut(bytes, 1, 2); - Permut(bytes, 5, 4); - Permut(bytes, 6, 7); - } - - bytesWritten = 16; - return true; - } - - - private static void Permut(Span array, int indexSource, int indexDest) - { - (array[indexSource], array[indexDest]) = (array[indexDest], array[indexSource]); - } - - - public Guid New(Guid namespaceId, string name) - { - var utf8NameByteCount = Encoding.UTF8.GetByteCount(name.Normalize(NormalizationForm.FormD)); - var utf8NameBytes = utf8NameByteCount > 256 ? new byte[utf8NameByteCount] : stackalloc byte[utf8NameByteCount]; - Encoding.UTF8.GetBytes(name, utf8NameBytes); - Span namespaceBytes = stackalloc byte[16]; - TryWriteBytes(namespaceId, namespaceBytes, bigEndian: true, out _); - var bytesToHashCount = namespaceBytes.Length + utf8NameBytes.Length; - var bytesToHash = utf8NameByteCount > 256 ? new byte[bytesToHashCount] : stackalloc byte[bytesToHashCount]; - namespaceBytes.CopyTo(bytesToHash); - utf8NameBytes.CopyTo(bytesToHash[namespaceBytes.Length..]); - - var hashAlgorithm = HashAlgorithm.Value!; - Span hash = stackalloc byte[hashAlgorithm.HashSize / 8]; - hashAlgorithm.TryComputeHash(bytesToHash, hash, out var _); - - var bigEndianBytes = hash[..16]; - const int VERSION_BYTE = 6; - bigEndianBytes[VERSION_BYTE] &= 0b0000_1111; - bigEndianBytes[VERSION_BYTE] |= (byte)(5 << 4); - const int VARIANT_BYTE = 8; - bigEndianBytes[VARIANT_BYTE] &= 0b0011_1111; - bigEndianBytes[VARIANT_BYTE] |= 0b1000_0000; - - Span localBytes = stackalloc byte[bigEndianBytes.Length]; - bigEndianBytes.CopyTo(localBytes); - Permut(localBytes, 0, 3); - Permut(localBytes, 1, 2); - Permut(localBytes, 5, 4); - Permut(localBytes, 6, 7); - - return new Guid(localBytes); - } - - private ThreadLocal HashAlgorithm { get; } = new(SHA1.Create); -} \ No newline at end of file +using System.Security.Cryptography; +using System.Text; + +namespace Migration.Toolkit.Common.Helpers; + +public static class GuidV5 +{ + private static readonly UuidV5Generator v5Generator = new(); + public static Guid NewNameBased(Guid namespaceId, string name) => v5Generator.New(namespaceId, name); +} + +internal class UuidV5Generator +{ + private ThreadLocal HashAlgorithm { get; } = new(SHA1.Create); + + public static bool TryWriteBytes(Guid guid, Span bytes, bool bigEndian, out int bytesWritten) + { + if (bytes.Length < 16 || !guid.TryWriteBytes(bytes)) + { + bytesWritten = 0; + return false; + } + + if (bigEndian) + { + Permut(bytes, 0, 3); + Permut(bytes, 1, 2); + Permut(bytes, 5, 4); + Permut(bytes, 6, 7); + } + + bytesWritten = 16; + return true; + } + + + private static void Permut(Span array, int indexSource, int indexDest) => (array[indexSource], array[indexDest]) = (array[indexDest], array[indexSource]); + + + public Guid New(Guid namespaceId, string name) + { + int utf8NameByteCount = Encoding.UTF8.GetByteCount(name.Normalize(NormalizationForm.FormD)); + var utf8NameBytes = utf8NameByteCount > 256 ? new byte[utf8NameByteCount] : stackalloc byte[utf8NameByteCount]; + Encoding.UTF8.GetBytes(name, utf8NameBytes); + Span namespaceBytes = stackalloc byte[16]; + TryWriteBytes(namespaceId, namespaceBytes, true, out _); + int bytesToHashCount = namespaceBytes.Length + utf8NameBytes.Length; + var bytesToHash = utf8NameByteCount > 256 ? new byte[bytesToHashCount] : stackalloc byte[bytesToHashCount]; + namespaceBytes.CopyTo(bytesToHash); + utf8NameBytes.CopyTo(bytesToHash[namespaceBytes.Length..]); + + var hashAlgorithm = HashAlgorithm.Value!; + Span hash = stackalloc byte[hashAlgorithm.HashSize / 8]; + hashAlgorithm.TryComputeHash(bytesToHash, hash, out int _); + + var bigEndianBytes = hash[..16]; + const int versionByte = 6; + bigEndianBytes[versionByte] &= 0b0000_1111; + bigEndianBytes[versionByte] |= 5 << 4; + const int variantByte = 8; + bigEndianBytes[variantByte] &= 0b0011_1111; + bigEndianBytes[variantByte] |= 0b1000_0000; + + Span localBytes = stackalloc byte[bigEndianBytes.Length]; + bigEndianBytes.CopyTo(localBytes); + Permut(localBytes, 0, 3); + Permut(localBytes, 1, 2); + Permut(localBytes, 5, 4); + Permut(localBytes, 6, 7); + + return new Guid(localBytes); + } +} diff --git a/Migration.Toolkit.Common/Helpers/MediaHelper.cs b/Migration.Toolkit.Common/Helpers/MediaHelper.cs index 3857f466..06627146 100644 --- a/Migration.Toolkit.Common/Helpers/MediaHelper.cs +++ b/Migration.Toolkit.Common/Helpers/MediaHelper.cs @@ -1,112 +1,115 @@ -namespace Migration.Toolkit.Common.Helpers; - -public enum MediaKind -{ - None, - Attachment, - MediaFile, -} - -public enum MediaLinkKind -{ - None, - Path, - DirectMediaPath, - Guid -} - -public class MediaHelper -{ - public record MatchMediaLinkResult(bool Success, MediaLinkKind LinkKind, MediaKind MediaKind, string? Path, Guid? MediaGuid) - { - public static readonly MatchMediaLinkResult None = new(false, MediaLinkKind.None, MediaKind.None, null, null); - }; - - public static MatchMediaLinkResult MatchMediaLink(string? linkStr) - { - if (linkStr == null) return MatchMediaLinkResult.None; - - var link = linkStr.TrimStart(new[] { '~' }); - - - Guid? mediaId = null; - var mediaLinkKind = MediaLinkKind.None; - var mediaKind = MediaKind.None; - var mediaPathResult = new List(); - var copyPath = false; - var inspectNext = false; - - var path = ""; - if (Uri.IsWellFormedUriString(link, UriKind.Absolute)) - { - path = new Uri(link, UriKind.Absolute).LocalPath; - } - - if (Uri.IsWellFormedUriString(link, UriKind.Relative)) - { - try - { - path = new Uri(new Uri("http://mock.local/", UriKind.Absolute), new Uri(link, UriKind.Relative)).LocalPath; - } - catch - { - path = link; - } - } - - var spl = path.Split('/', StringSplitOptions.RemoveEmptyEntries); - - for (var i = 0; i < spl.Length; i++) - { - var cs = spl[i]; - if (cs.Equals("getattachment", StringComparison.InvariantCultureIgnoreCase)) - { - mediaKind = MediaKind.Attachment; - inspectNext = true; - } - - if (cs.Equals("getimage", StringComparison.InvariantCultureIgnoreCase)) - { - mediaKind = MediaKind.MediaFile; - inspectNext = true; - } - else if (cs.Equals("getmedia", StringComparison.InvariantCultureIgnoreCase)) - { - mediaKind = MediaKind.MediaFile; - inspectNext = true; - } - else if (copyPath) - { - mediaPathResult.Add(cs); - mediaLinkKind = MediaLinkKind.Path; - } - - if (inspectNext) - { - inspectNext = false; - // now lets look forward - var nsi = i + 1; - if (nsi < spl.Length) - { - var nextSegment = spl[nsi]; - if (Guid.TryParse(nextSegment, out var mid)) - { - mediaId = mid; - mediaLinkKind = MediaLinkKind.Guid; - } - else - { - copyPath = true; - } - } - } - } - - if (mediaLinkKind == MediaLinkKind.None || mediaKind == MediaKind.None) - { - return MatchMediaLinkResult.None; - } - - return new MatchMediaLinkResult(true, mediaLinkKind, mediaKind, copyPath ? $"/{string.Join("/", mediaPathResult)}" : null, mediaId); - } -} \ No newline at end of file +namespace Migration.Toolkit.Common.Helpers; + +public enum MediaKind +{ + None, + Attachment, + MediaFile +} + +public enum MediaLinkKind +{ + None, + Path, + DirectMediaPath, + Guid +} + +public class MediaHelper +{ + public static MatchMediaLinkResult MatchMediaLink(string? linkStr) + { + if (linkStr == null) + { + return MatchMediaLinkResult.None; + } + + string link = linkStr.TrimStart(new[] { '~' }); + + + Guid? mediaId = null; + var mediaLinkKind = MediaLinkKind.None; + var mediaKind = MediaKind.None; + var mediaPathResult = new List(); + bool copyPath = false; + bool inspectNext = false; + + string path = ""; + if (Uri.IsWellFormedUriString(link, UriKind.Absolute)) + { + path = new Uri(link, UriKind.Absolute).LocalPath; + } + + if (Uri.IsWellFormedUriString(link, UriKind.Relative)) + { + try + { + path = new Uri(new Uri("http://mock.local/", UriKind.Absolute), new Uri(link, UriKind.Relative)).LocalPath; + } + catch + { + path = link; + } + } + + string[] spl = path.Split('/', StringSplitOptions.RemoveEmptyEntries); + + for (int i = 0; i < spl.Length; i++) + { + string cs = spl[i]; + if (cs.Equals("getattachment", StringComparison.InvariantCultureIgnoreCase)) + { + mediaKind = MediaKind.Attachment; + inspectNext = true; + } + + if (cs.Equals("getimage", StringComparison.InvariantCultureIgnoreCase)) + { + mediaKind = MediaKind.MediaFile; + inspectNext = true; + } + else if (cs.Equals("getmedia", StringComparison.InvariantCultureIgnoreCase)) + { + mediaKind = MediaKind.MediaFile; + inspectNext = true; + } + else if (copyPath) + { + mediaPathResult.Add(cs); + mediaLinkKind = MediaLinkKind.Path; + } + + if (inspectNext) + { + inspectNext = false; + // now lets look forward + int nsi = i + 1; + if (nsi < spl.Length) + { + string nextSegment = spl[nsi]; + if (Guid.TryParse(nextSegment, out var mid)) + { + mediaId = mid; + mediaLinkKind = MediaLinkKind.Guid; + } + else + { + copyPath = true; + } + } + } + } + + if (mediaLinkKind == MediaLinkKind.None || mediaKind == MediaKind.None) + { + return MatchMediaLinkResult.None; + } + + return new MatchMediaLinkResult(true, mediaLinkKind, mediaKind, copyPath ? $"/{string.Join("/", mediaPathResult)}" : null, mediaId); + } + + public record MatchMediaLinkResult(bool Success, MediaLinkKind LinkKind, MediaKind MediaKind, string? Path, Guid? MediaGuid) + { + public static readonly MatchMediaLinkResult None = new(false, MediaLinkKind.None, MediaKind.None, null, null); + } +} diff --git a/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs b/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs index fd38bac4..5f225c87 100644 --- a/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs +++ b/Migration.Toolkit.Common/Helpers/ReflectionHelper.cs @@ -1,136 +1,122 @@ -using System.Diagnostics; -using System.Reflection; - -namespace Migration.Toolkit.Common.Helpers; - -public static class ReflectionHelper -{ - public static Type CurrentType { get; } = typeof(T); - - static ReflectionHelper() - { - var i = 0; - PropertyGetterMaps = new Dictionary(); - foreach (var propertyInfo in CurrentType.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly)) - { - if (PropertyGetterMaps.ContainsKey(propertyInfo.Name)) - { - Debugger.Break(); - } - - PropertyGetterMaps.Add(propertyInfo.Name, new ObjectPropertyGetterMap - { - PropertyName = propertyInfo.Name, - PropertyGetMethod = propertyInfo.GetMethod, - PropertyIndex = i++, - }); - } - - StaticPropertyGetterMaps = new Dictionary(); - foreach (var propertyInfo in CurrentType.GetProperties(BindingFlags.Public | BindingFlags.Static)) - { - if (StaticPropertyGetterMaps.ContainsKey(propertyInfo.Name)) - { - Debugger.Break(); - } - - StaticPropertyGetterMaps.Add(propertyInfo.Name, new ObjectPropertyGetterMap - { - PropertyName = propertyInfo.Name, - PropertyGetMethod = propertyInfo.GetMethod, - PropertyIndex = i++, - }); - } - } - - public static Dictionary StaticPropertyGetterMaps { get; private set; } - public static Dictionary PropertyGetterMaps { get; private set; } - - public static List GetAttributes() where TAttribute : Attribute => Attribute - .GetCustomAttributes(typeof(T)).Aggregate(new List(), (list, attribute) => - { - if (attribute is TAttribute targetAttribute) - { - list.Add(targetAttribute); - } - - return list; - }); - - public static TAttribute? GetFirstAttributeOrNull() where TAttribute : Attribute => GetAttributes().FirstOrDefault(); - - public static IEnumerable GetPropertyGetterMaps() => PropertyGetterMaps.Values; - - public static object? GetPropertyValue(T obj, string propertyName) - { - if (!PropertyGetterMaps.ContainsKey(propertyName)) - { - throw new InvalidOperationException($"Property '{propertyName}' doesn't exist on object of type '{CurrentType.FullName}'"); - } - - if (obj == null) - { - throw new NullReferenceException($"Null reference, ReflectionHelper.GetPropertyValue needs obj argument reference"); - } - - return PropertyGetterMaps[propertyName].PropertyGetMethod!.Invoke(obj, Array.Empty()); - } - - public static bool TryGetPropertyValue(T obj, string propertyName, StringComparison propNameComparison, out object? value) - { - var propName = PropertyGetterMaps.Keys.FirstOrDefault(x => x.Equals(propertyName, propNameComparison)); - if (propName == null || !PropertyGetterMaps.ContainsKey(propName)) - { - value = null; - return false; - } - - if (obj == null) - { - throw new NullReferenceException($"Null reference, ReflectionHelper.GetPropertyValue needs obj argument reference"); - } - - value = PropertyGetterMaps[propName].PropertyGetMethod!.Invoke(obj, Array.Empty()); - return true; - } - - public static object? GetStaticPropertyValue(string propertyName) - { - if (!StaticPropertyGetterMaps.ContainsKey(propertyName)) - { - throw new InvalidOperationException($"Property '{propertyName}' doesn't exist on object of type '{CurrentType.FullName}'"); - } - - return StaticPropertyGetterMaps[propertyName].PropertyGetMethod!.Invoke(null, Array.Empty()); - } -} - -public class ObjectPropertyGetterMap -{ - public string? PropertyName { get; set; } - public MethodInfo? PropertyGetMethod { get; set; } - public int PropertyIndex { get; set; } -} - -public class ReflectionHelper -{ - public Type CurrentType { get; } - - public ReflectionHelper(Type type) - { - CurrentType = type; - } - - public List GetAttributes() where TAttribute : Attribute => Attribute - .GetCustomAttributes(CurrentType).Aggregate(new List(), (list, attribute) => - { - if (attribute is TAttribute targetAttribute) - { - list.Add(targetAttribute); - } - - return list; - }); - - public TAttribute? GetFirstAttributeOrNull() where TAttribute : Attribute => GetAttributes().FirstOrDefault(); -} \ No newline at end of file +using System.Diagnostics; +using System.Reflection; + +namespace Migration.Toolkit.Common.Helpers; + +public static class ReflectionHelper +{ + static ReflectionHelper() + { + int i = 0; + PropertyGetterMaps = []; + foreach (var propertyInfo in CurrentType.GetProperties(BindingFlags.Instance | BindingFlags.Public | BindingFlags.DeclaredOnly)) + { + if (PropertyGetterMaps.ContainsKey(propertyInfo.Name)) + { + Debugger.Break(); + } + + PropertyGetterMaps.Add(propertyInfo.Name, new ObjectPropertyGetterMap { PropertyName = propertyInfo.Name, PropertyGetMethod = propertyInfo.GetMethod, PropertyIndex = i++ }); + } + + StaticPropertyGetterMaps = []; + foreach (var propertyInfo in CurrentType.GetProperties(BindingFlags.Public | BindingFlags.Static)) + { + if (StaticPropertyGetterMaps.ContainsKey(propertyInfo.Name)) + { + Debugger.Break(); + } + + StaticPropertyGetterMaps.Add(propertyInfo.Name, new ObjectPropertyGetterMap { PropertyName = propertyInfo.Name, PropertyGetMethod = propertyInfo.GetMethod, PropertyIndex = i++ }); + } + } + + public static Type CurrentType { get; } = typeof(T); + + public static Dictionary StaticPropertyGetterMaps { get; } + public static Dictionary PropertyGetterMaps { get; } + + public static List GetAttributes() where TAttribute : Attribute => Attribute + .GetCustomAttributes(typeof(T)).Aggregate(new List(), (list, attribute) => + { + if (attribute is TAttribute targetAttribute) + { + list.Add(targetAttribute); + } + + return list; + }); + + public static TAttribute? GetFirstAttributeOrNull() where TAttribute : Attribute => GetAttributes().FirstOrDefault(); + + public static IEnumerable GetPropertyGetterMaps() => PropertyGetterMaps.Values; + + public static object? GetPropertyValue(T obj, string propertyName) + { + if (!PropertyGetterMaps.ContainsKey(propertyName)) + { + throw new InvalidOperationException($"Property '{propertyName}' doesn't exist on object of type '{CurrentType.FullName}'"); + } + + if (obj == null) + { + throw new NullReferenceException("Null reference, ReflectionHelper.GetPropertyValue needs obj argument reference"); + } + + return PropertyGetterMaps[propertyName].PropertyGetMethod!.Invoke(obj, Array.Empty()); + } + + public static bool TryGetPropertyValue(T obj, string propertyName, StringComparison propNameComparison, out object? value) + { + string? propName = PropertyGetterMaps.Keys.FirstOrDefault(x => x.Equals(propertyName, propNameComparison)); + if (propName == null || !PropertyGetterMaps.ContainsKey(propName)) + { + value = null; + return false; + } + + if (obj == null) + { + throw new NullReferenceException("Null reference, ReflectionHelper.GetPropertyValue needs obj argument reference"); + } + + value = PropertyGetterMaps[propName].PropertyGetMethod!.Invoke(obj, Array.Empty()); + return true; + } + + public static object? GetStaticPropertyValue(string propertyName) + { + if (!StaticPropertyGetterMaps.ContainsKey(propertyName)) + { + throw new InvalidOperationException($"Property '{propertyName}' doesn't exist on object of type '{CurrentType.FullName}'"); + } + + return StaticPropertyGetterMaps[propertyName].PropertyGetMethod!.Invoke(null, Array.Empty()); + } +} + +public class ObjectPropertyGetterMap +{ + public string? PropertyName { get; set; } + public MethodInfo? PropertyGetMethod { get; set; } + public int PropertyIndex { get; set; } +} + +public class ReflectionHelper +{ + public ReflectionHelper(Type type) => CurrentType = type; + public Type CurrentType { get; } + + public List GetAttributes() where TAttribute : Attribute => Attribute + .GetCustomAttributes(CurrentType).Aggregate(new List(), (list, attribute) => + { + if (attribute is TAttribute targetAttribute) + { + list.Add(targetAttribute); + } + + return list; + }); + + public TAttribute? GetFirstAttributeOrNull() where TAttribute : Attribute => GetAttributes().FirstOrDefault(); +} diff --git a/Migration.Toolkit.Common/Helpers/SerializationHelper.cs b/Migration.Toolkit.Common/Helpers/SerializationHelper.cs index 6a58ab07..1c538d76 100644 --- a/Migration.Toolkit.Common/Helpers/SerializationHelper.cs +++ b/Migration.Toolkit.Common/Helpers/SerializationHelper.cs @@ -1,33 +1,25 @@ -namespace Migration.Toolkit.Common.Helpers; - -using System.Collections; -using System.Reflection; -using Newtonsoft.Json; -using Newtonsoft.Json.Serialization; - -public class SerializationHelper -{ - public class ShouldSerializeContractResolver : DefaultContractResolver - { - public static readonly ShouldSerializeContractResolver Instance = new(); - - protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) - { - var property = base.CreateProperty(member, memberSerialization); - property.ShouldSerialize = o => (!property.PropertyType.IsClass && !property.PropertyType.IsArray && !typeof(IEnumerable).IsAssignableFrom(property.PropertyType)) || property.PropertyType == typeof(string); - return property; - } - } - - public static string SerializeOnlyNonComplexProperties(T obj) - { - return JsonConvert.SerializeObject(obj, Formatting.Indented, - new JsonSerializerSettings - { - ContractResolver = new ShouldSerializeContractResolver(), - ReferenceLoopHandling = ReferenceLoopHandling.Ignore, - DefaultValueHandling = DefaultValueHandling.Ignore, - MaxDepth = 1 - }); - } -} \ No newline at end of file +using System.Collections; +using System.Reflection; + +using Newtonsoft.Json; +using Newtonsoft.Json.Serialization; + +namespace Migration.Toolkit.Common.Helpers; + +public class SerializationHelper +{ + public static string SerializeOnlyNonComplexProperties(T obj) => JsonConvert.SerializeObject(obj, Formatting.Indented, + new JsonSerializerSettings { ContractResolver = new ShouldSerializeContractResolver(), ReferenceLoopHandling = ReferenceLoopHandling.Ignore, DefaultValueHandling = DefaultValueHandling.Ignore, MaxDepth = 1 }); + + public class ShouldSerializeContractResolver : DefaultContractResolver + { + public static readonly ShouldSerializeContractResolver Instance = new(); + + protected override JsonProperty CreateProperty(MemberInfo member, MemberSerialization memberSerialization) + { + var property = base.CreateProperty(member, memberSerialization); + property.ShouldSerialize = o => (!property.PropertyType.IsClass && !property.PropertyType.IsArray && !typeof(IEnumerable).IsAssignableFrom(property.PropertyType)) || property.PropertyType == typeof(string); + return property; + } + } +} diff --git a/Migration.Toolkit.Common/Helpers/SimpleAligner.cs b/Migration.Toolkit.Common/Helpers/SimpleAligner.cs index 89ac2b41..fae26b28 100644 --- a/Migration.Toolkit.Common/Helpers/SimpleAligner.cs +++ b/Migration.Toolkit.Common/Helpers/SimpleAligner.cs @@ -1,131 +1,136 @@ -namespace Migration.Toolkit.Common.Helpers; - -using System.Collections; - -public class SimpleAligner : IEnumerator> where TLeft : class where TRight : class -{ - public delegate TKey? SelectKey(T? current); - - private readonly SelectKey _selectKeyA; - private readonly SelectKey _selectKeyB; - private readonly bool _disposeEnumerators; - private readonly IEnumerator _eA; - private readonly IEnumerator _eB; - private readonly IEnumerator _eK; - - public int Ordinal { get; private set; } - - private SimpleAligner( - IEnumerator eA, - IEnumerator eB, - IEnumerator eK, - SelectKey selectKeyA, - SelectKey selectKeyB, - bool disposeEnumerators - ) - { - _selectKeyA = selectKeyA; - _selectKeyB = selectKeyB; - _disposeEnumerators = disposeEnumerators; - _eA = eA; - _eB = eB; - _eK = eK; - Current = new AlignDefault(); - } - - public static SimpleAligner Create( - IEnumerator eA, - IEnumerator eB, - IEnumerator eK, - SelectKey selectKeyA, - SelectKey selectKeyB, - bool disposeEnumerators - ) - { - return new SimpleAligner(eA, eB, eK, selectKeyA, selectKeyB, disposeEnumerators); - } - - private bool _hasA; - private bool _hasB; - private bool _hasK = true; - - private bool _firstMove = true; - - public bool MoveNext() - { - if (_firstMove) - { - _hasA = _eA.MoveNext(); - _hasB = _eB.MoveNext(); - _firstMove = false; - } - - _hasK = _eK.MoveNext(); - if (!_hasK) return false; - - do - { - var keyA = _selectKeyA(_eA.Current); - var keyB = _selectKeyB(_eB.Current); - - var matchA = _eA.Current != default && Equals(keyA, _eK.Current); - var matchB = _eB.Current != default && Equals(keyB, _eK.Current); - if (matchA && matchB) - { - Current = new SimpleAlignResultMatch(_eA.Current, _eB.Current, _eK.Current); - - _hasA = _hasA && _eA.MoveNext(); - _hasB = _hasB && _eB.MoveNext(); - Ordinal++; - return _hasK; - } - - if (matchA) - { - Current = new SimpleAlignResultOnlyA(_eA.Current, _eK.Current); - - _hasA = _hasA && _eA.MoveNext(); - Ordinal++; - return _hasK; - } - - if (matchB) - { - Current = new SimpleAlignResultOnlyB(_eB.Current, _eK.Current); - - _hasB = _hasB && _eB.MoveNext(); - Ordinal++; - return _hasK; - } - - if (!matchA && !matchB) - { - Current = new SimpleAlignFatalNoMatch(_eA.Current, _eB.Current, _eK.Current, "AB.NOMATCH: possibly error / wrongly sorted, selected source enumerators."); - - Ordinal++; - return _hasK; - } - } while (_hasA || _hasB); - - return false; - } - - public void Reset() - { - _eA.Reset(); - _eB.Reset(); - _eK.Reset(); - } - - public SimpleAlignResult Current { get; private set; } - - object IEnumerator.Current => Current; - - public void Dispose() - { - if (!_disposeEnumerators) return; - _eA.Dispose(); - _eB.Dispose(); - _eK.Dispose(); - } -} \ No newline at end of file +using System.Collections; + +namespace Migration.Toolkit.Common.Helpers; + +public class SimpleAligner : IEnumerator> where TLeft : class where TRight : class +{ + public delegate TKey? SelectKey(T? current); + + private readonly bool disposeEnumerators; + private readonly IEnumerator eA; + private readonly IEnumerator eB; + private readonly IEnumerator eK; + + private readonly SelectKey selectKeyA; + private readonly SelectKey selectKeyB; + + private bool firstMove = true; + + private bool hasA; + private bool hasB; + private bool hasK = true; + + private SimpleAligner( + IEnumerator eA, + IEnumerator eB, + IEnumerator eK, + SelectKey selectKeyA, + SelectKey selectKeyB, + bool disposeEnumerators + ) + { + this.selectKeyA = selectKeyA; + this.selectKeyB = selectKeyB; + this.disposeEnumerators = disposeEnumerators; + this.eA = eA; + this.eB = eB; + this.eK = eK; + Current = new AlignDefault()!; + } + + public int Ordinal { get; private set; } + + public bool MoveNext() + { + if (firstMove) + { + hasA = eA.MoveNext(); + hasB = eB.MoveNext(); + firstMove = false; + } + + hasK = eK.MoveNext(); + if (!hasK) + { + return false; + } + + do + { + var keyA = selectKeyA(eA.Current); + var keyB = selectKeyB(eB.Current); + + bool matchA = eA.Current != default && Equals(keyA, eK.Current); + bool matchB = eB.Current != default && Equals(keyB, eK.Current); + if (matchA && matchB) + { + Current = new SimpleAlignResultMatch(eA.Current, eB.Current, eK.Current); + + hasA = hasA && eA.MoveNext(); + hasB = hasB && eB.MoveNext(); + Ordinal++; + return hasK; + } + + if (matchA) + { + Current = new SimpleAlignResultOnlyA(eA.Current, eK.Current); + + hasA = hasA && eA.MoveNext(); + Ordinal++; + return hasK; + } + + if (matchB) + { + Current = new SimpleAlignResultOnlyB(eB.Current, eK.Current); + + hasB = hasB && eB.MoveNext(); + Ordinal++; + return hasK; + } + + if (!matchA && !matchB) + { + Current = new SimpleAlignFatalNoMatch(eA.Current, eB.Current, eK.Current, "AB.NOMATCH: possibly error / wrongly sorted, selected source enumerators."); + + Ordinal++; + return hasK; + } + } while (hasA || hasB); + + return false; + } + + public void Reset() + { + eA.Reset(); + eB.Reset(); + eK.Reset(); + } + + public SimpleAlignResult Current { get; private set; } + + object IEnumerator.Current => Current; + + public void Dispose() + { + if (!disposeEnumerators) + { + return; + } + + eA.Dispose(); + eB.Dispose(); + eK.Dispose(); + } + + public static SimpleAligner Create( + IEnumerator eA, + IEnumerator eB, + IEnumerator eK, + SelectKey selectKeyA, + SelectKey selectKeyB, + bool disposeEnumerators + ) => new(eA, eB, eK, selectKeyA, selectKeyB, disposeEnumerators); +} diff --git a/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs b/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs index 4573a384..b0cae6bb 100644 --- a/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs +++ b/Migration.Toolkit.Common/Helpers/TreePathConvertor.cs @@ -1,67 +1,65 @@ -namespace Migration.Toolkit.Common.Helpers; - -using CMS.ContentEngine.Internal; -using CMS.Core; -using CMS.Websites.Internal; - -public class TreePathConvertor(int webSiteChannel) -{ - private static readonly IDictionary SiteToConverter = new Dictionary(); - - public static TreePathConvertor GetSiteConverter(int webSiteId) - { - if (SiteToConverter.TryGetValue(webSiteId, out var converter)) - { - return converter; - } - - converter = new TreePathConvertor(webSiteId); - SiteToConverter.Add(webSiteId, converter); - return converter; - } - - public static readonly StringComparer TreePathComparer = StringComparer.InvariantCultureIgnoreCase; - - private readonly IDictionary _nodeAliasPathToTreePath = new Dictionary(TreePathComparer); - - public string GetConvertedOrUnchangedAssumingChannel(string nodeAliasPath) - { - return _nodeAliasPathToTreePath.TryGetValue(nodeAliasPath, out var converted) - ? converted - : nodeAliasPath; - } - - public record TreePathConversionResult(bool AnythingChanged, string Result); - public async Task ConvertAndEnsureUniqueness(string nodeAliasPath) - { - TreePathConversionResult result; - switch (nodeAliasPath) - { - case null: - { - result = new TreePathConversionResult(false, null); - break; - } - case "/": - case "#": - { - result = new TreePathConversionResult(false, nodeAliasPath); - _nodeAliasPathToTreePath.Add(nodeAliasPath, nodeAliasPath); - break; - } - default: - { - var napSpl = nodeAliasPath.Split('/').Select(nodeAlias => TreePathUtils.NormalizePathSegment(nodeAlias)); - var normalized = string.Join("/", napSpl); - var treePathValidator = Service.Resolve(); - var uniqueTreePath = await new UniqueTreePathProvider(webSiteChannel, treePathValidator).GetUniqueValue(normalized); - var anythingChanged = !TreePathComparer.Equals(nodeAliasPath, uniqueTreePath); - result = new TreePathConversionResult(anythingChanged, uniqueTreePath); - _nodeAliasPathToTreePath.Add(nodeAliasPath, uniqueTreePath); - break; - } - } - - return result; - } -} \ No newline at end of file +using CMS.ContentEngine.Internal; +using CMS.Core; +using CMS.Websites.Internal; + +namespace Migration.Toolkit.Common.Helpers; + +public class TreePathConvertor(int webSiteChannel) +{ + private static readonly IDictionary siteToConverter = new Dictionary(); + + public static readonly StringComparer TreePathComparer = StringComparer.InvariantCultureIgnoreCase; + + private readonly IDictionary nodeAliasPathToTreePath = new Dictionary(TreePathComparer); + + public static TreePathConvertor GetSiteConverter(int webSiteId) + { + if (siteToConverter.TryGetValue(webSiteId, out var converter)) + { + return converter; + } + + converter = new TreePathConvertor(webSiteId); + siteToConverter.Add(webSiteId, converter); + return converter; + } + + public string GetConvertedOrUnchangedAssumingChannel(string nodeAliasPath) => nodeAliasPathToTreePath.TryGetValue(nodeAliasPath, out string? converted) + ? converted + : nodeAliasPath; + + public async Task ConvertAndEnsureUniqueness(string nodeAliasPath) + { + TreePathConversionResult result; + switch (nodeAliasPath) + { + case null: + { + result = new TreePathConversionResult(false, null); + break; + } + case "/": + case "#": + { + result = new TreePathConversionResult(false, nodeAliasPath); + nodeAliasPathToTreePath.Add(nodeAliasPath, nodeAliasPath); + break; + } + default: + { + var napSpl = nodeAliasPath.Split('/').Select(nodeAlias => TreePathUtils.NormalizePathSegment(nodeAlias)); + string normalized = string.Join("/", napSpl); + var treePathValidator = Service.Resolve(); + string uniqueTreePath = await new UniqueTreePathProvider(webSiteChannel, treePathValidator).GetUniqueValue(normalized); + bool anythingChanged = !TreePathComparer.Equals(nodeAliasPath, uniqueTreePath); + result = new TreePathConversionResult(anythingChanged, uniqueTreePath); + nodeAliasPathToTreePath.Add(nodeAliasPath, uniqueTreePath); + break; + } + } + + return result; + } + + public record TreePathConversionResult(bool AnythingChanged, string Result); +} diff --git a/Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs b/Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs index 0d953423..814f2c51 100644 --- a/Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs +++ b/Migration.Toolkit.Common/Helpers/UniqueTreePathProvider.cs @@ -1,78 +1,78 @@ -namespace Migration.Toolkit.Common.Helpers; - -using CMS.ContentEngine.Internal; -using CMS.Websites.Internal; - -/// -/// Provides unique tree path. -/// -internal class UniqueTreePathProvider : UniqueStringValueProviderBase -{ - private readonly int websiteChannelId; - private readonly ITreePathValidator treePathValidator; - private readonly int maxTreePathSegmentLength; - - - /// - /// Creates a new instance of . - /// - /// Website channel ID. - /// Tree path validator. - /// Maximum length of whole tree path. Default to . - /// Maximum length of a tree path segment without '/'. Defaults to . - public UniqueTreePathProvider(int websiteChannelId, ITreePathValidator treePathValidator, int maxTreePathLength = TreePathConstants.MAX_PATH_LENGTH, - int maxTreePathSegmentLength = TreePathConstants.MAX_SLUG_LENGTH) - : base(maxTreePathLength) - { - this.websiteChannelId = websiteChannelId; - this.treePathValidator = treePathValidator; - this.maxTreePathSegmentLength = maxTreePathSegmentLength; - } - - - /// - protected override Task IsValueUnique(string value) - { - return treePathValidator.IsUnique(websiteChannelId, value); - } - - - /// - protected override string AddRandomSuffix(string source, string randomSuffix) - { - var lastSegment = TreePathUtils.GetLastPathSegment(source); - var lastSegmentWithSuffix = $"{lastSegment}{randomSuffix}"; - - var modifiedPath = $"{source}{randomSuffix}"; - - if (lastSegmentWithSuffix.Length > maxTreePathSegmentLength) - { - var pathWithoutLastSegment = TreePathUtils.RemoveLastPathSegment(source); - - var availableLastSegmentLength = maxTreePathSegmentLength - randomSuffix.Length; - - if (availableLastSegmentLength <= 0) - { - modifiedPath = $"{pathWithoutLastSegment}/{randomSuffix[1..maxTreePathSegmentLength]}"; - } - else - { - var modifiedLastSegment = (lastSegment.Length > availableLastSegmentLength) ? lastSegment[..availableLastSegmentLength] : lastSegment; - - modifiedPath = $"{pathWithoutLastSegment}/{modifiedLastSegment}{randomSuffix}"; - } - } - - return EnsureMaxTreePathLength(modifiedPath); - } - - - /// - /// Ensures path with random suffix does not exceeds tree path length limit. - /// - /// Path. - private string EnsureMaxTreePathLength(string path) - { - return path.Length > MaxLength ? path[..MaxLength] : path; - } -} \ No newline at end of file +using CMS.ContentEngine.Internal; +using CMS.Websites.Internal; + +namespace Migration.Toolkit.Common.Helpers; + +/// +/// Provides unique tree path. +/// +internal class UniqueTreePathProvider : UniqueStringValueProviderBase +{ + private readonly int maxTreePathSegmentLength; + private readonly ITreePathValidator treePathValidator; + private readonly int websiteChannelId; + + + /// + /// Creates a new instance of . + /// + /// Website channel ID. + /// Tree path validator. + /// + /// Maximum length of whole tree path. Default to + /// . + /// + /// + /// Maximum length of a tree path segment without '/'. Defaults to + /// . + /// + public UniqueTreePathProvider(int websiteChannelId, ITreePathValidator treePathValidator, int maxTreePathLength = TreePathConstants.MAX_PATH_LENGTH, + int maxTreePathSegmentLength = TreePathConstants.MAX_SLUG_LENGTH) + : base(maxTreePathLength) + { + this.websiteChannelId = websiteChannelId; + this.treePathValidator = treePathValidator; + this.maxTreePathSegmentLength = maxTreePathSegmentLength; + } + + + /// + protected override Task IsValueUnique(string value) => treePathValidator.IsUnique(websiteChannelId, value); + + + /// + protected override string AddRandomSuffix(string source, string randomSuffix) + { + string lastSegment = TreePathUtils.GetLastPathSegment(source); + string lastSegmentWithSuffix = $"{lastSegment}{randomSuffix}"; + + string modifiedPath = $"{source}{randomSuffix}"; + + if (lastSegmentWithSuffix.Length > maxTreePathSegmentLength) + { + string pathWithoutLastSegment = TreePathUtils.RemoveLastPathSegment(source); + + int availableLastSegmentLength = maxTreePathSegmentLength - randomSuffix.Length; + + if (availableLastSegmentLength <= 0) + { + modifiedPath = $"{pathWithoutLastSegment}/{randomSuffix[1..maxTreePathSegmentLength]}"; + } + else + { + string modifiedLastSegment = lastSegment.Length > availableLastSegmentLength ? lastSegment[..availableLastSegmentLength] : lastSegment; + + modifiedPath = $"{pathWithoutLastSegment}/{modifiedLastSegment}{randomSuffix}"; + } + } + + return EnsureMaxTreePathLength(modifiedPath); + } + + + /// + /// Ensures path with random suffix does not exceeds tree path length limit. + /// + /// Path. + private string EnsureMaxTreePathLength(string path) => path.Length > MaxLength ? path[..MaxLength] : path; +} diff --git a/Migration.Toolkit.Common/Helpers/UriHelperXbyk.cs b/Migration.Toolkit.Common/Helpers/UriHelperXbyk.cs index 15305e96..20a09258 100644 --- a/Migration.Toolkit.Common/Helpers/UriHelperXbyk.cs +++ b/Migration.Toolkit.Common/Helpers/UriHelperXbyk.cs @@ -1,71 +1,67 @@ -namespace Migration.Toolkit.Common.Helpers; - -using System.Text; - -public static class UriHelperXbyk -{ - public static string BuildXbyKDomainString(Uri uri, int expectedSize) - { - var sb = new StringBuilder(expectedSize); - sb.Append(uri.Host); - if (!uri.IsDefaultPort) - { - sb.Append($":{uri.Port}"); - } - - if (uri.AbsolutePath != "/") - { - sb.Append(uri.AbsolutePath); - } - - return sb.ToString(); - } - - public record struct UniqueDomainResult(bool Success, bool Changed, string Result, string? Fallback); - - public static UniqueDomainResult GetUniqueDomainCandidate(string input, ref int startPort, Func checkIsUnique, int maxAttempts = 100) - { - bool useFallback = false; - var initial = input; - if (string.IsNullOrWhiteSpace(input)) - { - initial = "https://localhost"; - useFallback = true; - } - - if (!initial.Contains("//")) - { - initial = $"https://{initial}"; - } - - if (!Uri.TryCreate(initial, UriKind.Absolute, out var uriTmp)) - { - initial = "https://localhost"; - useFallback = true; - } - - var uri = uriTmp ?? new Uri("https://localhost"); - - var changed = false; - var candidate = BuildXbyKDomainString(uri, initial.Length + 20); - while (!checkIsUnique(candidate) && --maxAttempts > 0) - { - var builder = new UriBuilder(uri) - { - Port = ++startPort, - Scheme = "https" - }; - candidate = BuildXbyKDomainString(builder.Uri, initial.Length + 20); - changed = true; - } - - if (maxAttempts <= 0) - { - return new UniqueDomainResult(false, changed, input, null); - } - - return useFallback - ? new UniqueDomainResult(!useFallback, changed, input, candidate) - : new UniqueDomainResult(!useFallback, changed, candidate, null); - } -} \ No newline at end of file +using System.Text; + +namespace Migration.Toolkit.Common.Helpers; + +public static class UriHelperXbyk +{ + public static string BuildXbyKDomainString(Uri uri, int expectedSize) + { + var sb = new StringBuilder(expectedSize); + sb.Append(uri.Host); + if (!uri.IsDefaultPort) + { + sb.Append($":{uri.Port}"); + } + + if (uri.AbsolutePath != "/") + { + sb.Append(uri.AbsolutePath); + } + + return sb.ToString(); + } + + public static UniqueDomainResult GetUniqueDomainCandidate(string input, ref int startPort, Func checkIsUnique, int maxAttempts = 100) + { + bool useFallback = false; + string initial = input; + if (string.IsNullOrWhiteSpace(input)) + { + initial = "https://localhost"; + useFallback = true; + } + + if (!initial.Contains("//")) + { + initial = $"https://{initial}"; + } + + if (!Uri.TryCreate(initial, UriKind.Absolute, out var uriTmp)) + { + initial = "https://localhost"; + useFallback = true; + } + + var uri = uriTmp ?? new Uri("https://localhost"); + + bool changed = false; + string candidate = BuildXbyKDomainString(uri, initial.Length + 20); + while (!checkIsUnique(candidate) && --maxAttempts > 0) + { + var builder = new UriBuilder(uri) { Port = ++startPort, Scheme = "https" }; + candidate = BuildXbyKDomainString(builder.Uri, initial.Length + 20); + changed = true; + } + + if (maxAttempts <= 0) + { + return new UniqueDomainResult(false, changed, input, null); + } + + return useFallback + ? new UniqueDomainResult(!useFallback, changed, input, candidate) + : new UniqueDomainResult(!useFallback, changed, candidate, null); + } + + public record struct UniqueDomainResult(bool Success, bool Changed, string Result, string? Fallback); +} diff --git a/Migration.Toolkit.Common/Helpers/VersionHelper.cs b/Migration.Toolkit.Common/Helpers/VersionHelper.cs index 2d1f519e..ccb126e2 100644 --- a/Migration.Toolkit.Common/Helpers/VersionHelper.cs +++ b/Migration.Toolkit.Common/Helpers/VersionHelper.cs @@ -1,17 +1,17 @@ -namespace Migration.Toolkit.Common.Helpers; - -using Microsoft.Data.SqlClient; - -public static class VersionHelper -{ - public static SemanticVersion? GetInstanceVersion(SqlConnection connection) - { - using var cmd = connection.CreateCommand(); - cmd.CommandText = "SELECT KeyValue FROM CMS_SettingsKey WHERE KeyName = N'CMSDBVersion'"; - var result = cmd.ExecuteScalar() as string; - - return SemanticVersion.TryParse(result, out var semanticVersion) - ? semanticVersion - : null; - } -} \ No newline at end of file +using Microsoft.Data.SqlClient; + +namespace Migration.Toolkit.Common.Helpers; + +public static class VersionHelper +{ + public static SemanticVersion? GetInstanceVersion(SqlConnection connection) + { + using var cmd = connection.CreateCommand(); + cmd.CommandText = "SELECT KeyValue FROM CMS_SettingsKey WHERE KeyName = N'CMSDBVersion'"; + string? result = cmd.ExecuteScalar() as string; + + return SemanticVersion.TryParse(result, out var semanticVersion) + ? semanticVersion + : null; + } +} diff --git a/Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs b/Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs index 6c7c0c85..69038e5a 100644 --- a/Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs +++ b/Migration.Toolkit.Common/IPrimaryKeyMappingContext.cs @@ -1,18 +1,18 @@ -namespace Migration.Toolkit.Common; - -using System.Linq.Expressions; - -public record MapSourceIdResult(bool Success, int? MappedId); - -public interface IPrimaryKeyMappingContext -{ - void SetMapping(Type type, string keyName, int sourceId, int targetId); - void SetMapping(Expression> keyNameSelector, int sourceId, int targetId); - int RequireMapFromSource(Expression> keyNameSelector, int sourceId); - bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult); - int? MapFromSource(Expression> keyNameSelector, int? sourceId); - int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId); - MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true); - void PreloadDependencies(Expression> keyNameSelector); - bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true); -} \ No newline at end of file +using System.Linq.Expressions; + +namespace Migration.Toolkit.Common; + +public record MapSourceIdResult(bool Success, int? MappedId); + +public interface IPrimaryKeyMappingContext +{ + void SetMapping(Type type, string keyName, int sourceId, int targetId); + void SetMapping(Expression> keyNameSelector, int sourceId, int targetId); + int RequireMapFromSource(Expression> keyNameSelector, int sourceId); + bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult); + int? MapFromSource(Expression> keyNameSelector, int? sourceId); + int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId); + MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true); + void PreloadDependencies(Expression> keyNameSelector); + bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true); +} diff --git a/Migration.Toolkit.Common/IPrinter.cs b/Migration.Toolkit.Common/IPrinter.cs index 522a6f59..29a3f7f9 100644 --- a/Migration.Toolkit.Common/IPrinter.cs +++ b/Migration.Toolkit.Common/IPrinter.cs @@ -1,9 +1,9 @@ -namespace Migration.Toolkit.Common; - -// public interface IPrinter -// { -// static abstract string PrintKxpModelInfo(T model); -// static abstract string GetEntityIdentityPrint(T model, bool printType = true); -// static abstract string GetEntityIdentityPrints(IEnumerable models, string separator = "|"); -// static abstract string PrintEnumValues(string separator) where TEnum : struct, Enum; -// } \ No newline at end of file +namespace Migration.Toolkit.Common; + +// public interface IPrinter +// { +// static abstract string PrintKxpModelInfo(T model); +// static abstract string GetEntityIdentityPrint(T model, bool printType = true); +// static abstract string GetEntityIdentityPrints(IEnumerable models, string separator = "|"); +// static abstract string PrintEnumValues(string separator) where TEnum : struct, Enum; +// } diff --git a/Migration.Toolkit.Common/LogExtensions.cs b/Migration.Toolkit.Common/LogExtensions.cs index 3c87b0b8..c729d9ef 100644 --- a/Migration.Toolkit.Common/LogExtensions.cs +++ b/Migration.Toolkit.Common/LogExtensions.cs @@ -1,76 +1,77 @@ -namespace Migration.Toolkit.Common; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; - -public static class LogExtensions -{ - public static IPrintService PrintService = default; - - public static IModelMappingResult Log(this IModelMappingResult mappingResult, ILogger logger, IMigrationProtocol protocol) - { - switch (mappingResult) - { - case { Success: false } result: - { - if (result is AggregatedResult aggregatedResult) - { - foreach (var r in aggregatedResult.Results) - { - protocol.Append(r.HandbookReference); - logger.LogError(r.HandbookReference?.ToString()); - } - } - else - { - protocol.Append(result.HandbookReference); - logger.LogError(result.HandbookReference?.ToString()); - } - - break; - } - case { Success: true } result: - { - logger.LogTrace("Success - {model}", PrintService.PrintKxpModelInfo(result.Item)); - break; - } - default: - { - throw new ArgumentOutOfRangeException(nameof(mappingResult)); - } - } - - return mappingResult; - } - - public static ILogger LogEntitySetAction(this ILogger logger, bool newInstance, TEntity entity) - { - var entityIdentityPrint = PrintService.GetEntityIdentityPrint(entity); - logger.LogDebug("Command {Command}: {Action} {EntityIdentityPrint}", ReflectionHelper.CurrentType.Name, newInstance ? "inserted" : "updated", entityIdentityPrint); - return logger; - } - - public static ILogger LogEntitySetError(this ILogger logger, Exception exception, bool newInstance, TEntity entity) - { - var entityIdentityPrint = PrintService.GetEntityIdentityPrint(entity); - logger.LogError(exception, "Command {Command}: failed during {Action}, {EntityIdentityPrint}", ReflectionHelper.CurrentType.Name, newInstance ? "insert" : "update", entityIdentityPrint); - return logger; - } - - public static ILogger LogEntitiesSetError(this ILogger logger, Exception exception, bool newInstance, IEnumerable entities) - { - var entityIdentityPrint = PrintService.GetEntityIdentityPrints(entities); - logger.LogError(exception, "Command {Command}: failed during {Action}, {EntityIdentityPrint}", ReflectionHelper.CurrentType.Name, newInstance ? "insert" : "update", entityIdentityPrint); - return logger; - } - - public static ILogger LogErrorMissingDependency(this ILogger logger, TEntity entity, string dependencyName, object dependencyValue, Type dependencyType) - { - var entityIdentityPrint = PrintService.GetEntityIdentityPrint(entity); - logger.LogError("Command {Command}: {EntityIdentityPrint} is missing dependency {FieldName}={Value} of type {DependencyType}", ReflectionHelper.CurrentType.Name, entityIdentityPrint, dependencyName, dependencyValue, dependencyType.Name); - return logger; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services; + +namespace Migration.Toolkit.Common; + +public static class LogExtensions +{ + public static IPrintService PrintService = default; + + public static IModelMappingResult Log(this IModelMappingResult mappingResult, ILogger logger, IMigrationProtocol protocol) + { + switch (mappingResult) + { + case { Success: false } result: + { + if (result is AggregatedResult aggregatedResult) + { + foreach (var r in aggregatedResult.Results) + { + protocol.Append(r.HandbookReference); + logger.LogError(r.HandbookReference?.ToString()); + } + } + else + { + protocol.Append(result.HandbookReference); + logger.LogError(result.HandbookReference?.ToString()); + } + + break; + } + case { Success: true } result: + { + logger.LogTrace("Success - {model}", PrintService.PrintKxpModelInfo(result.Item)); + break; + } + default: + { + throw new ArgumentOutOfRangeException(nameof(mappingResult)); + } + } + + return mappingResult; + } + + public static ILogger LogEntitySetAction(this ILogger logger, bool newInstance, TEntity entity) + { + string entityIdentityPrint = PrintService.GetEntityIdentityPrint(entity); + logger.LogDebug("Command {Command}: {Action} {EntityIdentityPrint}", ReflectionHelper.CurrentType.Name, newInstance ? "inserted" : "updated", entityIdentityPrint); + return logger; + } + + public static ILogger LogEntitySetError(this ILogger logger, Exception exception, bool newInstance, TEntity entity) + { + string entityIdentityPrint = PrintService.GetEntityIdentityPrint(entity); + logger.LogError(exception, "Command {Command}: failed during {Action}, {EntityIdentityPrint}", ReflectionHelper.CurrentType.Name, newInstance ? "insert" : "update", entityIdentityPrint); + return logger; + } + + public static ILogger LogEntitiesSetError(this ILogger logger, Exception exception, bool newInstance, IEnumerable entities) + { + string entityIdentityPrint = PrintService.GetEntityIdentityPrints(entities); + logger.LogError(exception, "Command {Command}: failed during {Action}, {EntityIdentityPrint}", ReflectionHelper.CurrentType.Name, newInstance ? "insert" : "update", entityIdentityPrint); + return logger; + } + + public static ILogger LogErrorMissingDependency(this ILogger logger, TEntity entity, string dependencyName, object dependencyValue, Type dependencyType) + { + string entityIdentityPrint = PrintService.GetEntityIdentityPrint(entity); + logger.LogError("Command {Command}: {EntityIdentityPrint} is missing dependency {FieldName}={Value} of type {DependencyType}", ReflectionHelper.CurrentType.Name, entityIdentityPrint, dependencyName, dependencyValue, dependencyType.Name); + return logger; + } +} diff --git a/Migration.Toolkit.Common/Migration.Toolkit.Common.csproj b/Migration.Toolkit.Common/Migration.Toolkit.Common.csproj index 27bf85c1..e1a0c091 100644 --- a/Migration.Toolkit.Common/Migration.Toolkit.Common.csproj +++ b/Migration.Toolkit.Common/Migration.Toolkit.Common.csproj @@ -16,10 +16,10 @@ - - - - + + + + diff --git a/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs index 002b2137..60dc6f9f 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/DebugMigrationProtocol.cs @@ -1,60 +1,34 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; - -public class DebugMigrationProtocol : IMigrationProtocol -{ - private readonly ILogger _logger; - - public DebugMigrationProtocol(ILogger logger) - { - _logger = logger; - } - - public void MappedTarget(IModelMappingResult mapped) - { - - } - - public void FetchedTarget(TTarget? target) - { - _logger.LogDebug("FetchedTarget: {Type}: {Source}", typeof(TTarget).FullName, target); - } - - public void FetchedSource(TSource? source) - { - _logger.LogDebug("FetchedSource: {Type}: {Source}", typeof(TSource).FullName, source); - } - - public void Success(TSource source, TTarget target, IModelMappingResult? mapped) - { - - } - - public void Warning(HandbookReference handbookRef, T? entity) - { - - } - - public void CommandRequest(TRequest request) where TRequest : IRequest - { - _logger.LogDebug("CommandRequest {Request}", request); - } - - public void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult - { - _logger.LogDebug("CommandFinished {Request} => {Response}", request, response); - } - - public void CommandError(Exception exception, TRequest request) where TRequest : IRequest - { - _logger.LogDebug("CommandError {Request} => {Exception}", request, exception); - } - - public void Append(HandbookReference? handbookReference) - { - _logger.LogDebug(handbookReference?.ToString()); - } -} \ No newline at end of file +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; + +namespace Migration.Toolkit.Common.MigrationProtocol; + +public class DebugMigrationProtocol(ILogger logger) : IMigrationProtocol +{ + public void MappedTarget(IModelMappingResult mapped) + { + } + + public void FetchedTarget(TTarget? target) => logger.LogDebug("FetchedTarget: {Type}: {Source}", typeof(TTarget).FullName, target); + + public void FetchedSource(TSource? source) => logger.LogDebug("FetchedSource: {Type}: {Source}", typeof(TSource).FullName, source); + + public void Success(TSource source, TTarget target, IModelMappingResult? mapped) + { + } + + public void Warning(HandbookReference handbookRef, T? entity) + { + } + + public void CommandRequest(TRequest request) where TRequest : IRequest => logger.LogDebug("CommandRequest {Request}", request); + + public void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult => logger.LogDebug("CommandFinished {Request} => {Response}", request, response); + + public void CommandError(Exception exception, TRequest request) where TRequest : IRequest => logger.LogDebug("CommandError {Request} => {Exception}", request, exception); + + public void Append(HandbookReference? handbookReference) => logger.LogDebug(handbookReference?.ToString()); +} diff --git a/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs b/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs index a37d0b5b..40c9cdf0 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/HandbookReference.cs @@ -1,151 +1,169 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -using System.Reflection; -using System.Text; -using Migration.Toolkit.Common.Services; - -public class HandbookReference -{ - public static IPrintService PrintService = default; - - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append($"NeedManualAction: {NeedManualAction}, ReferenceName: {ReferenceName}, AdditionalInfo: {AdditionalInfo}"); - if (this.Data == null) return sb.ToString(); - - var arr = this.Data.ToArray(); - for (var i = 0; i < arr.Length; i++) - { - var (key, value) = arr[i]; - sb.Append($"{key}: {value}"); - - if (i < arr.Length - 1) - { - sb.Append(", "); - } - } - - return sb.ToString(); - } - - public bool NeedManualAction { get; private set; } = false; - public string ReferenceName { get; } - public string? AdditionalInfo { get; } - public Dictionary? Data { get; private set; } = null; - - /// - /// Use class to store factory methods, don't create instances directly in code. - /// - /// Use common identifier characters to describe handbook reference (consider usage in HTML, JSON, DB, C#, href attribute in HTML) - public HandbookReference(string referenceName, string? additionalInfo = null) - { - this.ReferenceName = referenceName; - this.AdditionalInfo = additionalInfo; - } - - /// - /// Related ID of data, specify if possible - /// - public HandbookReference WithId(string idName, object idValue) - { - this.WithData(idName, idValue); - return this; - } - - /// - /// Appends message for user to see, use it for describing issue and propose fix if possible - /// - public HandbookReference WithMessage(string message) - { - this.Data ??= new(); - - var msgNum = 0; - string msgKey; - do - { - msgKey = $"Message#{msgNum++}"; - } while (this.Data.ContainsKey(msgKey)); - - this.WithData(msgKey, message); - - return this; - } - - /// - /// Appends data to dictionary for user to see - /// - public HandbookReference WithData(string key, object value) - { - this.Data ??= new(); - this.Data.Add(key, value); - - return this; - } - - /// - /// Appends data to dictionary for user to see - /// - public HandbookReference WithData(Dictionary data) - { - this.Data ??= new(); - foreach (var (key, value) in data) - { - this.Data.Add(key, value); - } - - return this; - } - - /// - /// Appends data to dictionary for user to see - /// - /// All public instance properties of object are written to dictionary for user to see. Anonymous object can be used - public HandbookReference WithData(object data) - { - this.Data ??= new(); - var dataUpdate = data.GetType() - .GetProperties(BindingFlags.Public | BindingFlags.Instance) - .ToDictionary(p => p.Name, p => p.GetMethod.Invoke(data, Array.Empty()) - ); - foreach (var (key, value) in dataUpdate) - { - this.Data.Add(key, value); - } - - return this; - } - - /// - /// Prints entity information. Type must be supported for print in method 'GetEntityIdentityPrint' in class - /// - /// Models to print - /// Type of model to print - type must be supported for print in method 'GetEntityIdentityPrint' in class - public HandbookReference WithIdentityPrint(T model) - { - this.Data ??= new(); - this.Data.Add("Entity", PrintService.GetEntityIdentityPrint(model)); - return this; - } - - /// - /// Prints entity information. Type must be supported for print in method 'GetEntityIdentityPrint' in class - /// - /// Models to print - /// Type of model to print - type must be supported for print in method 'GetEntityIdentityPrint' in class - public HandbookReference WithIdentityPrints(IEnumerable models) - { - this.Data ??= new(); - this.Data.Add("Entity", PrintService.GetEntityIdentityPrint(models)); - return this; - } - - /// - /// Marks reference as higher priority with serious consequences to migration of data to target instance - /// - public HandbookReference NeedsManualAction() - { - this.NeedManualAction = true; - return this; - } -} \ No newline at end of file +using System.Reflection; +using System.Text; + +using Migration.Toolkit.Common.Services; + +namespace Migration.Toolkit.Common.MigrationProtocol; + +public class HandbookReference +{ + public static IPrintService PrintService = default; + + /// + /// Use class to store factory methods, don't create instances directly in code. + /// + /// + /// Use common identifier characters to describe handbook reference (consider usage in HTML, + /// JSON, DB, C#, href attribute in HTML) + /// + public HandbookReference(string referenceName, string? additionalInfo = null) + { + ReferenceName = referenceName; + AdditionalInfo = additionalInfo; + } + + public bool NeedManualAction { get; private set; } + public string ReferenceName { get; } + public string? AdditionalInfo { get; } + public Dictionary? Data { get; private set; } + + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append($"NeedManualAction: {NeedManualAction}, ReferenceName: {ReferenceName}, AdditionalInfo: {AdditionalInfo}"); + if (Data == null) + { + return sb.ToString(); + } + + var arr = Data.ToArray(); + for (int i = 0; i < arr.Length; i++) + { + (string key, object? value) = arr[i]; + sb.Append($"{key}: {value}"); + + if (i < arr.Length - 1) + { + sb.Append(", "); + } + } + + return sb.ToString(); + } + + /// + /// Related ID of data, specify if possible + /// + public HandbookReference WithId(string idName, object idValue) + { + WithData(idName, idValue); + return this; + } + + /// + /// Appends message for user to see, use it for describing issue and propose fix if possible + /// + public HandbookReference WithMessage(string message) + { + Data ??= []; + + int msgNum = 0; + string msgKey; + do + { + msgKey = $"Message#{msgNum++}"; + } while (Data.ContainsKey(msgKey)); + + WithData(msgKey, message); + + return this; + } + + /// + /// Appends data to dictionary for user to see + /// + public HandbookReference WithData(string key, object value) + { + Data ??= []; + Data.Add(key, value); + + return this; + } + + /// + /// Appends data to dictionary for user to see + /// + public HandbookReference WithData(Dictionary data) + { + Data ??= []; + foreach ((string key, var value) in data) + { + Data.Add(key, value); + } + + return this; + } + + /// + /// Appends data to dictionary for user to see + /// + /// + /// All public instance properties of object are written to dictionary for user to see. Anonymous object + /// can be used + /// + public HandbookReference WithData(object data) + { + Data ??= []; + var dataUpdate = data.GetType() + .GetProperties(BindingFlags.Public | BindingFlags.Instance) + .ToDictionary(p => p.Name, p => p.GetMethod.Invoke(data, Array.Empty()) + ); + foreach ((string key, object? value) in dataUpdate) + { + Data.Add(key, value); + } + + return this; + } + + /// + /// Prints entity information. Type must be supported for print in method 'GetEntityIdentityPrint' in class + /// + /// + /// Models to print + /// + /// Type of model to print - type must be supported for print in method 'GetEntityIdentityPrint' in + /// class + /// + public HandbookReference WithIdentityPrint(T model) + { + Data ??= []; + Data.Add("Entity", PrintService.GetEntityIdentityPrint(model)); + return this; + } + + /// + /// Prints entity information. Type must be supported for print in method 'GetEntityIdentityPrint' in class + /// + /// + /// Models to print + /// + /// Type of model to print - type must be supported for print in method 'GetEntityIdentityPrint' in + /// class + /// + public HandbookReference WithIdentityPrints(IEnumerable models) + { + Data ??= []; + Data.Add("Entity", PrintService.GetEntityIdentityPrint(models)); + return this; + } + + /// + /// Marks reference as higher priority with serious consequences to migration of data to target instance + /// + public HandbookReference NeedsManualAction() + { + NeedManualAction = true; + return this; + } +} diff --git a/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs b/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs index b81502ed..3c230d1f 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/HandbookReferences.cs @@ -1,131 +1,133 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -using Microsoft.Data.SqlClient; -using Migration.Toolkit.Common.Helpers; - -public static class HandbookReferences -{ - #region "Warnings - nothing needs to be done" - - public static HandbookReference EntityExplicitlyExcludedByCodeName(string codeName, string entityName) => - new("EntityExplicitlyExcludedByCodeName", $"CodeName={codeName}, EntityName={entityName}"); - - public static HandbookReference CmsClassCmsRootClassTypeSkip => new("CmsClass_CmsRootClassTypeSkip"); - public static HandbookReference CmsUserAdminUserSkip => new("CmsUser_SkipAdminUser"); - public static HandbookReference CmsUserPublicUserSkip => new("CmsUser_SkipPublicUser"); - public static HandbookReference CmsTreeTreeRootSkip => new("CmsTree_TreeRootSkipped"); - public static HandbookReference CmsSettingsKeyExclusionListSkip => new("CmsSettingsKey_SkipExclusionList"); // TODO tk: 2022-07-19 generalize - - public static HandbookReference SourcePageIsNotPublished(Guid sourcePageGuid) => new("SourcePageIsNotPublished", $"PageGuid={sourcePageGuid}"); - - public static HandbookReference CmsTreeTreeIsLinkFromDifferentSite => new("CmsTree_TreeIsLinkFromDifferentSite"); - - public static HandbookReference TemporaryAttachmentMigrationIsNotSupported => new("TemporaryAttachmentMigrationIsNotSupported"); - - public static HandbookReference LinkedDataAlreadyMaterializedInTargetInstance => - new HandbookReference("LinkedDataAlreadyMaterializedInTargetInstance"); - - public static HandbookReference DataAlreadyExistsInTargetInstance => - new HandbookReference("DataAlreadyExistsInTargetInstance"); - - #endregion - - - #region "Errors - something need to be done" - - public static HandbookReference InvalidSourceCmsVersion() => new HandbookReference("InvalidSourceCmsVersion") - .NeedsManualAction(); - - public static HandbookReference CommandConstraintBroken(string constraintName) => new HandbookReference("CommandConstraintBroken") - .WithMessage($"Command constraint '{constraintName}' broken.") - .NeedsManualAction(); - - public static HandbookReference MediaFileIsMissingOnSourceFilesystem => new("MediaFileIsMissingOnSourceFilesystem"); - - public static HandbookReference MissingRequiredDependency(string fieldName, object? sourceValue) => - new HandbookReference("MissingRequiredDependency") - .WithData(new { DependencyType = typeof(TSourceDependency).Name, FieldName = fieldName, SourceValue = sourceValue }); - - public static HandbookReference MissingRequiredDependency() => - new HandbookReference("MissingRequiredDependency") - .WithData(new { DependencyType = typeof(TSourceDependency).Name, }); - - public static HandbookReference SourceEntityIsNull() => - new HandbookReference("SourceEntityIsNull") - .WithData(new { SourceEntityType = typeof(TSource).FullName, }); - - public static HandbookReference SourceValueIsRequired(string valueName) => - new HandbookReference("SourceValueIsRequired") - .NeedsManualAction() - .WithData(new { SourceEntityType = typeof(TSource).FullName, ValueName = valueName }); - - public static HandbookReference FailedToCreateTargetInstance() => - new HandbookReference("FailedToCreateTargetInstance") - .NeedsManualAction() - .WithData(new { TargetEntityType = typeof(TTarget).FullName, }); - - public static HandbookReference ErrorCreatingTargetInstance(Exception exception) => - new HandbookReference("FailedToCreateTargetInstance") - .NeedsManualAction() - .WithData(new { TargetEntityType = typeof(TTarget).FullName, Exception = exception.ToString(), }); - - public static HandbookReference ErrorUpdatingTargetInstance(Exception exception) => - new HandbookReference("FailedToUpdateTargetInstance") - .NeedsManualAction() - .WithData(new { TargetEntityType = typeof(TTarget).FullName, Exception = exception.ToString(), }); - - public static HandbookReference ErrorSavingTargetInstance(Exception exception) => - new HandbookReference("ErrorSavingTargetInstance") - .NeedsManualAction() - .WithData(new { TargetEntityType = typeof(TTarget).FullName, Exception = exception.ToString(), }); - - public static HandbookReference MissingConfiguration(string configurationName) => - new HandbookReference("MissingConfiguration") - .NeedsManualAction() - .WithData(new { Command = typeof(TCommand).FullName, ConfigurationName = configurationName }); - - public static HandbookReference DbConstraintBroken(SqlException ex, TEntity entity) - => new HandbookReference("DbConstraintBroken") - .NeedsManualAction() - .WithIdentityPrint(entity) - .WithMessage(ex.Message); - - public static HandbookReference BulkCopyColumnMismatch(string tableName) => new("BulkCopyColumnMismatch", $"TableName={tableName}"); - - public static HandbookReference DataMustNotExistInTargetInstanceTable(string tableName) => - new HandbookReference("DataMustNotExistInTargetInstanceTable") - .WithData(new { tableName }); - - public static HandbookReference ValueTruncationSkip(string tableName) => - new HandbookReference("ValueTruncationSkip").NeedsManualAction().WithData(new { tableName }); - - public static HandbookReference NotCurrentlySupportedSkip() => - new HandbookReference("NotCurrentlySupportedSkip").WithData(new { Type = ReflectionHelper.CurrentType.Name }); - - public static HandbookReference NotSupportedSkip() => - new HandbookReference("NotSupportedSkip").WithData(new { Type = ReflectionHelper.CurrentType.Name }); - - public static HandbookReference NotCurrentlySupportedSkip() => - new HandbookReference("NotCurrentlySupportedSkip"); - - public static HandbookReference InvalidSourceData() => new HandbookReference("InvalidSourceData") - .NeedsManualAction() - .WithData(new { SourceEntityType = typeof(TSource).Name, }); - - #endregion - - #region Form components - - public static HandbookReference FormComponentNotSupportedInLegacyMode(string componentIdentifier, string recommendedNewFormComponent) => - new HandbookReference("FormComponentNotSupportedInLegacyMode") - .NeedsManualAction() - .WithMessage($"Component is no longer supported in target instance, use NewRecommendedComponentIdentifier - data will be migrated to fit") - .WithData(new { ComponentIdentifier = componentIdentifier, NewRecommendedComponentIdentifier = recommendedNewFormComponent, }); - - public static HandbookReference FormComponentCustom(string componentIdentifier) => new HandbookReference("CustomFormComponent") - .NeedsManualAction() - .WithMessage($"Custom form component used - don't forget to migrate code") - .WithData(new { ComponentIdentifier = componentIdentifier, }); - - #endregion -} \ No newline at end of file +using Microsoft.Data.SqlClient; + +using Migration.Toolkit.Common.Helpers; + +namespace Migration.Toolkit.Common.MigrationProtocol; + +public static class HandbookReferences +{ + #region "Warnings - nothing needs to be done" + + public static HandbookReference EntityExplicitlyExcludedByCodeName(string codeName, string entityName) => + new("EntityExplicitlyExcludedByCodeName", $"CodeName={codeName}, EntityName={entityName}"); + + public static HandbookReference CmsClassCmsRootClassTypeSkip => new("CmsClass_CmsRootClassTypeSkip"); + public static HandbookReference CmsUserAdminUserSkip => new("CmsUser_SkipAdminUser"); + public static HandbookReference CmsUserPublicUserSkip => new("CmsUser_SkipPublicUser"); + public static HandbookReference CmsTreeTreeRootSkip => new("CmsTree_TreeRootSkipped"); + public static HandbookReference CmsSettingsKeyExclusionListSkip => new("CmsSettingsKey_SkipExclusionList"); // TODO tk: 2022-07-19 generalize + + public static HandbookReference SourcePageIsNotPublished(Guid sourcePageGuid) => new("SourcePageIsNotPublished", $"PageGuid={sourcePageGuid}"); + + public static HandbookReference CmsTreeTreeIsLinkFromDifferentSite => new("CmsTree_TreeIsLinkFromDifferentSite"); + + public static HandbookReference TemporaryAttachmentMigrationIsNotSupported => new("TemporaryAttachmentMigrationIsNotSupported"); + public static HandbookReference NonUniqueEntityGuid => new("NonUniqueEntityGuid"); + + public static HandbookReference LinkedDataAlreadyMaterializedInTargetInstance => + new("LinkedDataAlreadyMaterializedInTargetInstance"); + + public static HandbookReference DataAlreadyExistsInTargetInstance => + new("DataAlreadyExistsInTargetInstance"); + + #endregion + + + #region "Errors - something need to be done" + + public static HandbookReference InvalidSourceCmsVersion() => new HandbookReference("InvalidSourceCmsVersion") + .NeedsManualAction(); + + public static HandbookReference CommandConstraintBroken(string constraintName) => new HandbookReference("CommandConstraintBroken") + .WithMessage($"Command constraint '{constraintName}' broken.") + .NeedsManualAction(); + + public static HandbookReference MediaFileIsMissingOnSourceFilesystem => new("MediaFileIsMissingOnSourceFilesystem"); + + public static HandbookReference MissingRequiredDependency(string fieldName, object? sourceValue) => + new HandbookReference("MissingRequiredDependency") + .WithData(new { DependencyType = typeof(TSourceDependency).Name, FieldName = fieldName, SourceValue = sourceValue }); + + public static HandbookReference MissingRequiredDependency() => + new HandbookReference("MissingRequiredDependency") + .WithData(new { DependencyType = typeof(TSourceDependency).Name }); + + public static HandbookReference SourceEntityIsNull() => + new HandbookReference("SourceEntityIsNull") + .WithData(new { SourceEntityType = typeof(TSource).FullName }); + + public static HandbookReference SourceValueIsRequired(string valueName) => + new HandbookReference("SourceValueIsRequired") + .NeedsManualAction() + .WithData(new { SourceEntityType = typeof(TSource).FullName, ValueName = valueName }); + + public static HandbookReference FailedToCreateTargetInstance() => + new HandbookReference("FailedToCreateTargetInstance") + .NeedsManualAction() + .WithData(new { TargetEntityType = typeof(TTarget).FullName }); + + public static HandbookReference ErrorCreatingTargetInstance(Exception exception) => + new HandbookReference("FailedToCreateTargetInstance") + .NeedsManualAction() + .WithData(new { TargetEntityType = typeof(TTarget).FullName, Exception = exception.ToString() }); + + public static HandbookReference ErrorUpdatingTargetInstance(Exception exception) => + new HandbookReference("FailedToUpdateTargetInstance") + .NeedsManualAction() + .WithData(new { TargetEntityType = typeof(TTarget).FullName, Exception = exception.ToString() }); + + public static HandbookReference ErrorSavingTargetInstance(Exception exception) => + new HandbookReference("ErrorSavingTargetInstance") + .NeedsManualAction() + .WithData(new { TargetEntityType = typeof(TTarget).FullName, Exception = exception.ToString() }); + + public static HandbookReference MissingConfiguration(string configurationName) => + new HandbookReference("MissingConfiguration") + .NeedsManualAction() + .WithData(new { Command = typeof(TCommand).FullName, ConfigurationName = configurationName }); + + public static HandbookReference DbConstraintBroken(SqlException ex, TEntity entity) + => new HandbookReference("DbConstraintBroken") + .NeedsManualAction() + .WithIdentityPrint(entity) + .WithMessage(ex.Message); + + public static HandbookReference BulkCopyColumnMismatch(string tableName) => new("BulkCopyColumnMismatch", $"TableName={tableName}"); + + public static HandbookReference DataMustNotExistInTargetInstanceTable(string tableName) => + new HandbookReference("DataMustNotExistInTargetInstanceTable") + .WithData(new { tableName }); + + public static HandbookReference ValueTruncationSkip(string tableName) => + new HandbookReference("ValueTruncationSkip").NeedsManualAction().WithData(new { tableName }); + + public static HandbookReference NotCurrentlySupportedSkip() => + new HandbookReference("NotCurrentlySupportedSkip").WithData(new { Type = ReflectionHelper.CurrentType.Name }); + + public static HandbookReference NotSupportedSkip() => + new HandbookReference("NotSupportedSkip").WithData(new { Type = ReflectionHelper.CurrentType.Name }); + + public static HandbookReference NotCurrentlySupportedSkip() => + new("NotCurrentlySupportedSkip"); + + public static HandbookReference InvalidSourceData() => new HandbookReference("InvalidSourceData") + .NeedsManualAction() + .WithData(new { SourceEntityType = typeof(TSource).Name }); + + #endregion + + #region Form components + + public static HandbookReference FormComponentNotSupportedInLegacyMode(string componentIdentifier, string recommendedNewFormComponent) => + new HandbookReference("FormComponentNotSupportedInLegacyMode") + .NeedsManualAction() + .WithMessage("Component is no longer supported in target instance, use NewRecommendedComponentIdentifier - data will be migrated to fit") + .WithData(new { ComponentIdentifier = componentIdentifier, NewRecommendedComponentIdentifier = recommendedNewFormComponent }); + + public static HandbookReference FormComponentCustom(string componentIdentifier) => new HandbookReference("CustomFormComponent") + .NeedsManualAction() + .WithMessage("Custom form component used - don't forget to migrate code") + .WithData(new { ComponentIdentifier = componentIdentifier }); + + #endregion +} diff --git a/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs index 3930e80a..c1eb9bc8 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/IMigrationProtocol.cs @@ -1,19 +1,20 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -using MediatR; -using Migration.Toolkit.Common.Abstractions; - -public interface IMigrationProtocol -{ - void MappedTarget(IModelMappingResult mapped); - void FetchedTarget(TTarget? target); - void FetchedSource(TSource? source); - void Success(TSource source, TTarget target, IModelMappingResult? mapped); - void Warning(HandbookReference handbookRef, T? entity); - - void CommandRequest(TRequest request) where TRequest : IRequest; - void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult; - void CommandError(Exception exception, TRequest request) where TRequest : IRequest; - - void Append(HandbookReference? handbookReference); -} \ No newline at end of file +using MediatR; + +using Migration.Toolkit.Common.Abstractions; + +namespace Migration.Toolkit.Common.MigrationProtocol; + +public interface IMigrationProtocol +{ + void MappedTarget(IModelMappingResult mapped); + void FetchedTarget(TTarget? target); + void FetchedSource(TSource? source); + void Success(TSource source, TTarget target, IModelMappingResult? mapped); + void Warning(HandbookReference handbookRef, T? entity); + + void CommandRequest(TRequest request) where TRequest : IRequest; + void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult; + void CommandError(Exception exception, TRequest request) where TRequest : IRequest; + + void Append(HandbookReference? handbookReference); +} diff --git a/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs index 20bd6c8b..97181710 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/IProtocol.cs @@ -1,6 +1,5 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -public interface IProtocol : IMigrationProtocol -{ - -} \ No newline at end of file +namespace Migration.Toolkit.Common.MigrationProtocol; + +public interface IProtocol : IMigrationProtocol +{ +} diff --git a/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs index bae3e6df..6fd8fb57 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/NullMigrationProtocol.cs @@ -1,47 +1,44 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -using MediatR; -using Migration.Toolkit.Common.Abstractions; - -public class NullMigrationProtocol : IMigrationProtocol -{ - public void Warning(HandbookReference handbookRef, T? entity) - { - } - - public void CommandRequest(TRequest request) where TRequest : IRequest - { - - } - - public void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult - { - - } - - public void CommandError(Exception exception, TRequest request) where TRequest : IRequest - { - - } - - public void Append(HandbookReference? handbookReference) - { - - } - - public void MappedTarget(IModelMappingResult mapped) - { - } - - public void FetchedTarget(TTarget? target) - { - } - - public void FetchedSource(TSource? source) - { - } - - public void Success(TSource source, TTarget target, IModelMappingResult? mapped) - { - } -} \ No newline at end of file +using MediatR; + +using Migration.Toolkit.Common.Abstractions; + +namespace Migration.Toolkit.Common.MigrationProtocol; + +public class NullMigrationProtocol : IMigrationProtocol +{ + public void Warning(HandbookReference handbookRef, T? entity) + { + } + + public void CommandRequest(TRequest request) where TRequest : IRequest + { + } + + public void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult + { + } + + public void CommandError(Exception exception, TRequest request) where TRequest : IRequest + { + } + + public void Append(HandbookReference? handbookReference) + { + } + + public void MappedTarget(IModelMappingResult mapped) + { + } + + public void FetchedTarget(TTarget? target) + { + } + + public void FetchedSource(TSource? source) + { + } + + public void Success(TSource source, TTarget target, IModelMappingResult? mapped) + { + } +} diff --git a/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs b/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs index 999dfcdd..88baf2f0 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/Protocol.cs @@ -1,86 +1,80 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -using MediatR; -using Migration.Toolkit.Common.Abstractions; - -public class Protocol : IProtocol -{ - private readonly IEnumerable _protocols; - - public Protocol(IEnumerable protocols) - { - _protocols = protocols; - } - - public void MappedTarget(IModelMappingResult mapped) - { - foreach (var protocol in _protocols) - { - protocol.MappedTarget(mapped); - } - } - - public void FetchedTarget(TTarget? target) - { - foreach (var protocol in _protocols) - { - protocol.FetchedTarget(target); - } - } - - public void FetchedSource(TSource? source) - { - foreach (var protocol in _protocols) - { - protocol.FetchedSource(source); - } - } - - public void Success(TSource source, TTarget target, IModelMappingResult? mapped) - { - foreach (var protocol in _protocols) - { - protocol.Success(source, target, mapped); - } - } - - public void Warning(HandbookReference handbookRef, T? entity) - { - foreach (var protocol in _protocols) - { - protocol.Warning(handbookRef, entity); - } - } - - public void CommandRequest(TRequest request) where TRequest : IRequest - { - foreach (var protocol in _protocols) - { - protocol.CommandRequest(request); - } - } - - public void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult - { - foreach (var protocol in _protocols) - { - protocol.CommandFinished(request, response); - } - } - - public void CommandError(Exception exception, TRequest request) where TRequest : IRequest - { - foreach (var protocol in _protocols) - { - protocol.CommandError(exception, request); - } - } - - public void Append(HandbookReference? handbookReference) - { - foreach (var protocol in _protocols) - { - protocol.Append(handbookReference); - } - } -} \ No newline at end of file +using MediatR; + +using Migration.Toolkit.Common.Abstractions; + +namespace Migration.Toolkit.Common.MigrationProtocol; + +public class Protocol(IEnumerable protocols) : IProtocol +{ + public void MappedTarget(IModelMappingResult mapped) + { + foreach (var protocol in protocols) + { + protocol.MappedTarget(mapped); + } + } + + public void FetchedTarget(TTarget? target) + { + foreach (var protocol in protocols) + { + protocol.FetchedTarget(target); + } + } + + public void FetchedSource(TSource? source) + { + foreach (var protocol in protocols) + { + protocol.FetchedSource(source); + } + } + + public void Success(TSource source, TTarget target, IModelMappingResult? mapped) + { + foreach (var protocol in protocols) + { + protocol.Success(source, target, mapped); + } + } + + public void Warning(HandbookReference handbookRef, T? entity) + { + foreach (var protocol in protocols) + { + protocol.Warning(handbookRef, entity); + } + } + + public void CommandRequest(TRequest request) where TRequest : IRequest + { + foreach (var protocol in protocols) + { + protocol.CommandRequest(request); + } + } + + public void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult + { + foreach (var protocol in protocols) + { + protocol.CommandFinished(request, response); + } + } + + public void CommandError(Exception exception, TRequest request) where TRequest : IRequest + { + foreach (var protocol in protocols) + { + protocol.CommandError(exception, request); + } + } + + public void Append(HandbookReference? handbookReference) + { + foreach (var protocol in protocols) + { + protocol.Append(handbookReference); + } + } +} diff --git a/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs b/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs index a175aac9..6ebbd28a 100644 --- a/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs +++ b/Migration.Toolkit.Common/MigrationProtocol/TextMigrationProtocol.cs @@ -1,106 +1,75 @@ -namespace Migration.Toolkit.Common.MigrationProtocol; - -using System.Diagnostics; -using MediatR; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Services; - -public class TextMigrationProtocol : IMigrationProtocol, IDisposable -{ - private readonly ToolkitConfiguration _configuration; - private readonly IPrintService _printService; - private readonly StreamWriter _streamWriter; - - public TextMigrationProtocol(ToolkitConfiguration configuration, IPrintService printService) - { - _configuration = configuration; - _printService = printService; - - var nowStartDate = DateTime.Now; - if (string.IsNullOrWhiteSpace(configuration.MigrationProtocolPath) && Process.GetCurrentProcess().MainModule?.FileName is { } programPath) - { - var processDir = Path.GetDirectoryName(programPath); - if (processDir != null) - _streamWriter = new StreamWriter(Path.Combine(processDir, $"MigrationProtocol_{nowStartDate:yyyyMMdd_hhmm}.html")); - } - else - { - var directoryName = Path.GetDirectoryName(configuration.MigrationProtocolPath); - if (directoryName != null) - { - Directory.CreateDirectory(directoryName); - var nameWithoutExtension = Path.GetFileNameWithoutExtension(configuration.MigrationProtocolPath); - var extension = Path.GetExtension(configuration.MigrationProtocolPath); - _streamWriter = new StreamWriter(Path.Combine(directoryName, $"{nameWithoutExtension}{nowStartDate:yyyyMMdd_hhmm}{extension}")); - } - } - - if (_streamWriter == null) - { - throw new InvalidOperationException("Unable to get path for migration protocol initialization - configure settings in path 'Settings.MigrationProtocolPath'"); - } - - _streamWriter.AutoFlush = true; - } - - private void WriteLine(string line) - { - _streamWriter.WriteLine($"{DateTime.Now:yyyyMMdd_hhmmss}: {line}"); - } - - public void MappedTarget(IModelMappingResult mapped) - { - - } - - public void FetchedTarget(TTarget? target) - { - - } - - public void FetchedSource(TSource? source) - { - - } - - public void Success(TSource source, TTarget target, IModelMappingResult? mapped) - { - WriteLine($"Success: {_printService.GetEntityIdentityPrint(target)}"); - } - - public void Warning(HandbookReference handbookRef, T? entity) - { - WriteLine($"{handbookRef}"); - } - - public void Warning(HandbookReference handbookRef, TSource? source, TTarget? target) - { - WriteLine($"{handbookRef}"); - } - - public void CommandRequest(TRequest request) where TRequest : IRequest - { - WriteLine($"Command {request} requested"); - } - - public void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult - { - WriteLine($"Command {request} successfully finished"); - } - - public void CommandError(Exception exception, TRequest request) where TRequest : IRequest - { - WriteLine($"Command {request} error: {exception}"); - } - - public void Append(HandbookReference? handbookReference) - { - WriteLine($"{handbookReference}"); - } - - public void Dispose() - { - _streamWriter.Dispose(); - } -} \ No newline at end of file +using System.Diagnostics; + +using MediatR; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Services; + +namespace Migration.Toolkit.Common.MigrationProtocol; + +public class TextMigrationProtocol : IMigrationProtocol, IDisposable +{ + private readonly IPrintService printService; + private readonly StreamWriter streamWriter; + + public TextMigrationProtocol(ToolkitConfiguration configuration, IPrintService printService) + { + this.printService = printService; + + var nowStartDate = DateTime.Now; + if (string.IsNullOrWhiteSpace(configuration.MigrationProtocolPath) && Process.GetCurrentProcess().MainModule?.FileName is { } programPath) + { + string? processDir = Path.GetDirectoryName(programPath); + if (processDir != null) + { + streamWriter = new StreamWriter(Path.Combine(processDir, $"MigrationProtocol_{nowStartDate:yyyyMMdd_hhmm}.html")); + } + } + else + { + string? directoryName = Path.GetDirectoryName(configuration.MigrationProtocolPath); + if (directoryName != null) + { + Directory.CreateDirectory(directoryName); + string? nameWithoutExtension = Path.GetFileNameWithoutExtension(configuration.MigrationProtocolPath); + string? extension = Path.GetExtension(configuration.MigrationProtocolPath); + streamWriter = new StreamWriter(Path.Combine(directoryName, $"{nameWithoutExtension}{nowStartDate:yyyyMMdd_hhmm}{extension}")); + } + } + + if (streamWriter == null) + { + throw new InvalidOperationException("Unable to get path for migration protocol initialization - configure settings in path 'Settings.MigrationProtocolPath'"); + } + + streamWriter.AutoFlush = true; + } + + public void Dispose() => streamWriter.Dispose(); + + public void MappedTarget(IModelMappingResult mapped) + { + } + + public void FetchedTarget(TTarget? target) + { + } + + public void FetchedSource(TSource? source) + { + } + + public void Success(TSource source, TTarget target, IModelMappingResult? mapped) => WriteLine($"Success: {printService.GetEntityIdentityPrint(target)}"); + + public void Warning(HandbookReference handbookRef, T? entity) => WriteLine($"{handbookRef}"); + + public void CommandRequest(TRequest request) where TRequest : IRequest => WriteLine($"Command {request} requested"); + + public void CommandFinished(TRequest request, TResponse response) where TRequest : IRequest where TResponse : CommandResult => WriteLine($"Command {request} successfully finished"); + + public void CommandError(Exception exception, TRequest request) where TRequest : IRequest => WriteLine($"Command {request} error: {exception}"); + + public void Append(HandbookReference? handbookReference) => WriteLine($"{handbookReference}"); + + private void WriteLine(string line) => streamWriter.WriteLine($"{DateTime.Now:yyyyMMdd_hhmmss}: {line}"); +} diff --git a/Migration.Toolkit.Common/OptInFeatures.cs b/Migration.Toolkit.Common/OptInFeatures.cs index 881ad941..3050c298 100644 --- a/Migration.Toolkit.Common/OptInFeatures.cs +++ b/Migration.Toolkit.Common/OptInFeatures.cs @@ -1,57 +1,61 @@ -namespace Migration.Toolkit.Common; - -using System.Text.Json.Serialization; -using Microsoft.Extensions.Configuration; - -// ReSharper disable once ClassNeverInstantiated.Global -public class OptInFeatures -{ - [ConfigurationKeyName(ConfigurationNames.QuerySourceInstanceApi)] - public AdvancedFeatureQuerySourceInstanceApi? QuerySourceInstanceApi { get; set; } - - [ConfigurationKeyName(ConfigurationNames.CustomMigration)] - public CustomMigrationModel? CustomMigration { get; set; } -} - -// ReSharper disable once ClassNeverInstantiated.Global -public class AdvancedFeatureQuerySourceInstanceApi -{ - [ConfigurationKeyName(ConfigurationNames.Enabled)] - public bool Enabled { get; set; } = false; - - [ConfigurationKeyName(ConfigurationNames.Connections)] - public List Connections { get; set; } = new(); -} - -// ReSharper disable once ClassNeverInstantiated.Global -public class SourceInstanceInfo -{ - [ConfigurationKeyName(ConfigurationNames.SourceInstanceUri)] - public Uri? SourceInstanceUri { get; set; } = null!; - - [ConfigurationKeyName(ConfigurationNames.Secret)] - public string Secret { get; set; } = null!; -} - -// ReSharper disable once ClassNeverInstantiated.Global -public class FieldMigrationSerializable -{ - [ConfigurationKeyName(ConfigurationNames.SourceDataType)] - public string? SourceDataType { get; set; } - [ConfigurationKeyName(ConfigurationNames.TargetDataType)] - public string? TargetDataType { get; set; } - [ConfigurationKeyName(ConfigurationNames.SourceFormControl)] - public string? SourceFormControl { get; set; } - [ConfigurationKeyName(ConfigurationNames.TargetFormComponent)] - public string? TargetFormComponent { get; set; } - [ConfigurationKeyName(ConfigurationNames.Actions)] - public string[]? Actions { get; set; } - [ConfigurationKeyName(ConfigurationNames.FieldNameRegex)] - public string? FieldNameRegex { get; set; } -} - -// ReSharper disable once ClassNeverInstantiated.Global -public class CustomMigrationModel -{ - public FieldMigrationSerializable[]? FieldMigrations { get; set; } -} \ No newline at end of file +using Microsoft.Extensions.Configuration; + +namespace Migration.Toolkit.Common; + +// ReSharper disable once ClassNeverInstantiated.Global +public class OptInFeatures +{ + [ConfigurationKeyName(ConfigurationNames.QuerySourceInstanceApi)] + public AdvancedFeatureQuerySourceInstanceApi? QuerySourceInstanceApi { get; set; } + + [ConfigurationKeyName(ConfigurationNames.CustomMigration)] + public CustomMigrationModel? CustomMigration { get; set; } +} + +// ReSharper disable once ClassNeverInstantiated.Global +public class AdvancedFeatureQuerySourceInstanceApi +{ + [ConfigurationKeyName(ConfigurationNames.Enabled)] + public bool Enabled { get; set; } = false; + + [ConfigurationKeyName(ConfigurationNames.Connections)] + public List Connections { get; set; } = []; +} + +// ReSharper disable once ClassNeverInstantiated.Global +public class SourceInstanceInfo +{ + [ConfigurationKeyName(ConfigurationNames.SourceInstanceUri)] + public Uri? SourceInstanceUri { get; set; } = null!; + + [ConfigurationKeyName(ConfigurationNames.Secret)] + public string Secret { get; set; } = null!; +} + +// ReSharper disable once ClassNeverInstantiated.Global +public class FieldMigrationSerializable +{ + [ConfigurationKeyName(ConfigurationNames.SourceDataType)] + public string? SourceDataType { get; set; } + + [ConfigurationKeyName(ConfigurationNames.TargetDataType)] + public string? TargetDataType { get; set; } + + [ConfigurationKeyName(ConfigurationNames.SourceFormControl)] + public string? SourceFormControl { get; set; } + + [ConfigurationKeyName(ConfigurationNames.TargetFormComponent)] + public string? TargetFormComponent { get; set; } + + [ConfigurationKeyName(ConfigurationNames.Actions)] + public string[]? Actions { get; set; } + + [ConfigurationKeyName(ConfigurationNames.FieldNameRegex)] + public string? FieldNameRegex { get; set; } +} + +// ReSharper disable once ClassNeverInstantiated.Global +public class CustomMigrationModel +{ + public FieldMigrationSerializable[]? FieldMigrations { get; set; } +} diff --git a/Migration.Toolkit.Common/Resources.resx b/Migration.Toolkit.Common/Resources.resx index 92a08ad6..525afa32 100644 --- a/Migration.Toolkit.Common/Resources.resx +++ b/Migration.Toolkit.Common/Resources.resx @@ -1,9 +1,10 @@ - + - + @@ -13,10 +14,14 @@ 1.3 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, + PublicKeyToken=b77a5c561934e089 + Section 'Settings' is required @@ -42,10 +47,12 @@ Configuration value in path 'Settings.XbKApiSettings.ConnectionStrings.CMSConnectionString' is required - + Configuration value in path 'Settings.UseOmActivitySiteRelationAutofix' must fit one of: {0} - + Configuration value in path 'Settings.UseOmActivityNodeRelationAutofix' must fit one of: {0} diff --git a/Migration.Toolkit.Common/SemanticVersion.cs b/Migration.Toolkit.Common/SemanticVersion.cs index 9b64a37b..5dcbb63e 100644 --- a/Migration.Toolkit.Common/SemanticVersion.cs +++ b/Migration.Toolkit.Common/SemanticVersion.cs @@ -1,95 +1,105 @@ -namespace Migration.Toolkit.Common; - -using System.Diagnostics.CodeAnalysis; -using System.Runtime.CompilerServices; -using System.Text; - -/// -/// simplified implementation of semantic version object for this use-case -/// -/// -/// -/// -public record SemanticVersion(int Major, int? Minor, int? Hotfix) //, string? Build -{ - public override string ToString() - { - var sb = new StringBuilder(); - sb.Append(Major); - if (!Minor.HasValue) return sb.ToString(); - sb.Append($".{Minor}"); - if (!Hotfix.HasValue) return sb.ToString(); - sb.Append($".{Hotfix}"); - return sb.ToString(); - } - - public static bool TryParse(string? s, [NotNullWhen(true)] out SemanticVersion? semVer) - { - semVer = null; - if (!string.IsNullOrWhiteSpace(s)) - { - var split = s.Split("."); - switch (split.Length) - { - case 1 when int.TryParse(split[0], out var major): - { - semVer = new(major, null, null); - return true; - } - case 2 when int.TryParse(split[0], out var major) && int.TryParse(split[1], out var minor): - { - semVer = new(major, minor, null); - return true; - } - case 3 when int.TryParse(split[0], out var major) && int.TryParse(split[1], out var minor) && int.TryParse(split[2], out var hotfix): - { - semVer = new(major, minor, hotfix); - return true; - } - } - } - - return false; - } - - public bool IsLesserThan(SemanticVersion ver, bool compareOnlySpecified = true) - { - var (major, minor, hotfix) = ver; - if (compareOnlySpecified) - { - if (Major - major < 0) - { - return true; - } - - if (minor.HasValue && Minor.HasValue && Minor - minor < 0) - { - return true; - } - - if (hotfix.HasValue && Hotfix.HasValue && Hotfix - hotfix < 0) - { - return true; - } - } - else - { - if (Major - major < 0) - { - return true; - } - - if (Minor.GetValueOrDefault(0) - minor.GetValueOrDefault(0) < 0) - { - return true; - } - - if (Hotfix.GetValueOrDefault(0) - hotfix.GetValueOrDefault(0) < 0) - { - return true; - } - } - - return false; - } -} \ No newline at end of file +using System.Diagnostics.CodeAnalysis; +using System.Text; + +namespace Migration.Toolkit.Common; + +/// +/// simplified implementation of semantic version object for this use-case +/// +/// +/// +/// +public record SemanticVersion(int Major, int? Minor, int? Hotfix) //, string? Build +{ + public override string ToString() + { + var sb = new StringBuilder(); + sb.Append(Major); + if (!Minor.HasValue) + { + return sb.ToString(); + } + + sb.Append($".{Minor}"); + if (!Hotfix.HasValue) + { + return sb.ToString(); + } + + sb.Append($".{Hotfix}"); + return sb.ToString(); + } + + public static bool TryParse(string? s, [NotNullWhen(true)] out SemanticVersion? semVer) + { + semVer = null; + if (!string.IsNullOrWhiteSpace(s)) + { + string[] split = s.Split("."); + switch (split.Length) + { + case 1 when int.TryParse(split[0], out int major): + { + semVer = new SemanticVersion(major, null, null); + return true; + } + case 2 when int.TryParse(split[0], out int major) && int.TryParse(split[1], out int minor): + { + semVer = new SemanticVersion(major, minor, null); + return true; + } + case 3 when int.TryParse(split[0], out int major) && int.TryParse(split[1], out int minor) && int.TryParse(split[2], out int hotfix): + { + semVer = new SemanticVersion(major, minor, hotfix); + return true; + } + + default: + break; + } + } + + return false; + } + + public bool IsLesserThan(SemanticVersion ver, bool compareOnlySpecified = true) + { + (int major, int? minor, int? hotfix) = ver; + if (compareOnlySpecified) + { + if (Major - major < 0) + { + return true; + } + + if (minor.HasValue && Minor.HasValue && Minor - minor < 0) + { + return true; + } + + if (hotfix.HasValue && Hotfix.HasValue && Hotfix - hotfix < 0) + { + return true; + } + } + else + { + if (Major - major < 0) + { + return true; + } + + if (Minor.GetValueOrDefault(0) - minor.GetValueOrDefault(0) < 0) + { + return true; + } + + if (Hotfix.GetValueOrDefault(0) - hotfix.GetValueOrDefault(0) < 0) + { + return true; + } + } + + return false; + } +} diff --git a/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs b/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs index d6bb8aa0..24015d96 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/BulkCopyRequest.cs @@ -1,18 +1,37 @@ -namespace Migration.Toolkit.Common.Services.BulkCopy; - -using System.Data; - -/// -/// Request definition for bulk copy service -/// -/// Table name of table that will be copied -/// Column exclusion -/// Data exclusion - use for data validation and data exclusion when you know, that data will not satisfy target DB constraints -/// Size of batch for bulk copy -/// Columns used for bulk copy -/// Use for data validation and error reporting, avoid expensive operations -/// Called when row is skipped for whatever reason -/// SQL ORDER BY definition -public record BulkCopyRequest(string TableName, Func ColumnFilter, Func DataFilter, int BatchSize, List? Columns = null, ValueInterceptor? ValueInterceptor = null, ValueInterceptingReaderSkippedRow? SkippedRowCallback = null, string? OrderBy = null); - -public record BulkCopyRequestExtended(string TableName, Func ColumnFilter, Func DataFilter, int BatchSize, Dictionary ColumnsMapping, ValueInterceptor? ValueInterceptor = null, ValueInterceptingReaderSkippedRow? SkippedRowCallback = null, string? OrderBy = null) : BulkCopyRequest(TableName, ColumnFilter, DataFilter, BatchSize, ColumnsMapping.Keys.ToList(), ValueInterceptor, SkippedRowCallback, OrderBy); \ No newline at end of file +using System.Data; + +namespace Migration.Toolkit.Common.Services.BulkCopy; + +/// +/// Request definition for bulk copy service +/// +/// Table name of table that will be copied +/// Column exclusion +/// +/// Data exclusion - use for data validation and data exclusion when you know, that data will not +/// satisfy target DB constraints +/// +/// Size of batch for bulk copy +/// Columns used for bulk copy +/// Use for data validation and error reporting, avoid expensive operations +/// Called when row is skipped for whatever reason +/// SQL ORDER BY definition +public record BulkCopyRequest( + string TableName, + Func ColumnFilter, + Func DataFilter, + int BatchSize, + List? Columns = null, + ValueInterceptor? ValueInterceptor = null, + ValueInterceptingReaderSkippedRow? SkippedRowCallback = null, + string? OrderBy = null); + +public record BulkCopyRequestExtended( + string TableName, + Func ColumnFilter, + Func DataFilter, + int BatchSize, + Dictionary ColumnsMapping, + ValueInterceptor? ValueInterceptor = null, + ValueInterceptingReaderSkippedRow? SkippedRowCallback = null, + string? OrderBy = null) : BulkCopyRequest(TableName, ColumnFilter, DataFilter, BatchSize, ColumnsMapping.Keys.ToList(), ValueInterceptor, SkippedRowCallback, OrderBy); diff --git a/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs b/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs index efd6b1bb..98055e6e 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/BulkDataCopyService.cs @@ -1,234 +1,232 @@ -namespace Migration.Toolkit.Common.Services.BulkCopy; - -using System.Data; -using System.Text; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Helpers; - -public record SqlColumn(string ColumnName, int OrdinalPosition); - -public class BulkDataCopyService(ToolkitConfiguration configuration, ILogger logger) -{ - public bool CheckIfDataExistsInTargetTable(string tableName) - { - using var targetConnection = new SqlConnection(configuration.XbKConnectionString); - using var command = targetConnection.CreateCommand(); - var query = $"SELECT COUNT(*) FROM {tableName}"; - command.CommandText = query; - - - targetConnection.Open(); - return ((int)command.ExecuteScalar()) > 0; - } - - public bool CheckForTableColumnsDifferences(string tableName, Dictionary? checkedColumns, out List<(string? sourceColumn, string? targetColumn)> columnsWithFailedCheck) - { - var anyFailedColumnCheck = false; - var sourceTableColumns = GetSqlTableColumns(tableName, configuration.KxConnectionString) - .Where(c => checkedColumns?.Keys.Any(k => k.Equals(c.ColumnName, StringComparison.InvariantCultureIgnoreCase)) ?? true) - .Select(x => x.ColumnName).OrderBy(x => x); - var targetTableColumns = GetSqlTableColumns(tableName, configuration.XbKConnectionString) - .Where(c => checkedColumns?.Values.Any(k => k.Equals(c.ColumnName, StringComparison.InvariantCultureIgnoreCase)) ?? true) - .Select(x => x.ColumnName).OrderBy(x => x); - - var aligner = EnumerableHelper.CreateAligner( - sourceTableColumns, - targetTableColumns, - sourceTableColumns.Union(targetTableColumns).OrderBy(x => x), - a => a, - b => b, - false - ); - - columnsWithFailedCheck = new List<(string sourceColumn, string targetColumn)>(); - while (aligner.MoveNext()) - { - switch (aligner.Current) - { - case SimpleAlignResultMatch result: - logger.LogDebug("Table {Table} pairing source({SourceColumnName}) <> target({TargetColumnName}) success", tableName, result?.A, result?.B); - break; - case { } result: - columnsWithFailedCheck.Add((result.A, result.B)); - logger.LogError("Table {Table} pairing source({SourceColumnName}) <> target({TargetColumnName}) has failed", tableName, result?.A, result?.B); - anyFailedColumnCheck = true; - break; - } - } - - return anyFailedColumnCheck; - } - - public bool CheckForTableColumnsDifferences(string tableName, out List<(string sourceColumn, string targetColumn)> columnsWithFailedCheck) - => CheckForTableColumnsDifferences(tableName, null, out columnsWithFailedCheck); - - public void CopyTableToTable(BulkCopyRequest request) - { - var (tableName, columnFilter, dataFilter, batchSize, columns, valueInterceptor, skippedRowCallback, orderBy) = request; - - logger.LogInformation("Copy of {TableName} started", tableName); - - var sourceColumns = GetSqlTableColumns(tableName, configuration.KxConnectionString, columns) - .ToArray(); - var targetColumns = GetSqlTableColumns(tableName, configuration.XbKConnectionString, columns) - .ToArray(); - var allTargetColumns = GetSqlTableColumns(tableName, configuration.XbKConnectionString) - .ToArray(); - - AssertColumnsMatch(request, sourceColumns, targetColumns); - - using var sourceConnection = new SqlConnection(configuration.KxConnectionString); - using var sourceCommand = sourceConnection.CreateCommand(); - using var sqlBulkCopy = new SqlBulkCopy(configuration.XbKConnectionString, SqlBulkCopyOptions.KeepIdentity); - - sqlBulkCopy.BulkCopyTimeout = 1200; - sqlBulkCopy.BatchSize = batchSize; - // sqlBulkCopy.EnableStreaming - // sqlBulkCopy.BulkCopyTimeout - - sqlBulkCopy.NotifyAfter = 100000; - sqlBulkCopy.SqlRowsCopied += (sender, args) => - { - logger.LogInformation("Copy '{TableName}': Rows copied={Rows}", tableName, args.RowsCopied); - }; - - - var selectQuery = BuildSelectQuery(tableName, sourceColumns, orderBy).ToString(); - logger.LogTrace("Select QUERY: {Query}", selectQuery); - sqlBulkCopy.DestinationTableName = tableName; - // foreach (var (columnName, ordinalPosition) in sourceColumns) - if (request is BulkCopyRequestExtended extended) - { - foreach (var (sourceColumn, targetColumn) in extended.ColumnsMapping) - { - if (!columnFilter(sourceColumn)) - { - continue; - } - - var tc = allTargetColumns - .FirstOrDefault(tc => tc.ColumnName.Equals(targetColumn, StringComparison.InvariantCultureIgnoreCase)) - ?? throw new InvalidOperationException($"Missing column '{targetColumn}'"); - sqlBulkCopy.ColumnMappings.Add(sourceColumn, tc.ColumnName); - logger.LogTrace("Column mapping '{Source}' => '{Target}', {SC} {TC}", sourceColumn, tc.ColumnName, - sourceColumns.Any(s => s.ColumnName.Equals(sourceColumn, StringComparison.InvariantCultureIgnoreCase)), - targetColumns.Any(s => s.ColumnName.Equals(tc.ColumnName, StringComparison.InvariantCultureIgnoreCase)) - ); - } - } - else - { - foreach (var (columnName, ordinalPosition) in sourceColumns) - { - if (!columnFilter(columnName)) - { - continue; - } - sqlBulkCopy.ColumnMappings.Add(columnName, columnName); - logger.LogTrace("Column mapping '{Source}' => '{Target}', {SC} {TC}", columnName, columnName, - sourceColumns.Any(s => s.ColumnName.Equals(columnName, StringComparison.InvariantCultureIgnoreCase)), - targetColumns.Any(s => s.ColumnName.Equals(columnName, StringComparison.InvariantCultureIgnoreCase)) - ); - } - } - - sourceCommand.CommandText = selectQuery; - sourceCommand.CommandType = CommandType.Text; - sourceConnection.Open(); - using var reader = sourceCommand.ExecuteReader(); - var filteredReader = new FilteredDbDataReader(reader, dataFilter); - IDataReader readerPipeline = filteredReader; - if (valueInterceptor != null) - { - readerPipeline = new ValueInterceptingReader(readerPipeline, valueInterceptor, sourceColumns, skippedRowCallback); - } - - try - { - sqlBulkCopy.WriteToServer(readerPipeline); - } - catch (Exception ex) - { - throw; - } - - logger.LogInformation("Copy of {TableName} finished! Total={Total}, TotalCopied={TotalCopied}", tableName, filteredReader.TotalItems, filteredReader.TotalNonFiltered); - } - - private void AssertColumnsMatch(BulkCopyRequest request, SqlColumn[] sourceColumns, SqlColumn[] targetColumns) - { - foreach (var (columnName, ordinalPosition) in targetColumns) - { - if (sourceColumns.All(x => x.ColumnName != columnName)) - { - logger.LogWarning("{TableName} target column '{TargetColumn}' has no match", request.TableName, columnName); - } - } - - foreach (var (columnName, ordinalPosition) in sourceColumns) - { - if (targetColumns.All(x => x.ColumnName != columnName)) - { - logger.LogDebug("{TableName} source column '{SourceColumn}' has no match", request.TableName, columnName); - } - } - } - - private static StringBuilder BuildSelectQuery(string tableName, SqlColumn[] sourceColumns, string? orderBy) - { - StringBuilder selectBuilder = new StringBuilder(); - selectBuilder.Append("SELECT "); - for (var i = 0; i < sourceColumns.Length; i++) - { - var (columnName, ordinalPosition) = sourceColumns[i]; - selectBuilder.Append($"[{columnName}]"); - if (i < sourceColumns.Length - 1) - { - selectBuilder.Append(", "); - } - } - - selectBuilder.Append($" FROM {tableName}"); - if (orderBy != null) selectBuilder.Append($" ORDER BY {orderBy}"); - return selectBuilder; - } - - public IEnumerable GetSqlTableColumns(string tableName, string? connectionString, IEnumerable? allowedColumns = null) - { - using var sourceConnection = new SqlConnection(connectionString); - using var cmd = sourceConnection.CreateCommand(); - - cmd.CommandText = @"SELECT * FROM INFORMATION_SCHEMA.COLUMNS JOIN INFORMATION_SCHEMA.TABLES ON COLUMNS.TABLE_NAME = TABLES.TABLE_NAME - WHERE TABLES.TABLE_NAME = @tableName"; - - cmd.Parameters.AddWithValue("tableName", tableName); - - sourceConnection.Open(); - using var reader = cmd.ExecuteReader(); - - var ordinal = 0; - - var allowedColumnsList = allowedColumns?.ToList(); - var columnFiler = allowedColumnsList != null && allowedColumnsList.Count != 0 - ? new Func(s => allowedColumnsList.Contains(s, StringComparer.InvariantCultureIgnoreCase)) - : _ => true; - - while (reader.Read()) - { - var columnName = reader.GetString("COLUMN_NAME"); - if (columnFiler(columnName)) - { - logger.LogTrace("[{Table}].{ColumnName} INCLUDED", tableName, columnName); - yield return new(columnName, ordinal);// reader.GetInt32("ORDINAL_POSITION")); - ordinal++; - } - else - { - logger.LogTrace("[{Table}].{ColumnName} SKIPPED", tableName, columnName); - } - // TODO tk: 2022-05-31 IS_NULLABLE, DATA_TYPE, ... check column compatibility - - } - } -} \ No newline at end of file +using System.Data; +using System.Text; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Helpers; + +namespace Migration.Toolkit.Common.Services.BulkCopy; + +public record SqlColumn(string ColumnName, int OrdinalPosition); + +public class BulkDataCopyService(ToolkitConfiguration configuration, ILogger logger) +{ + public bool CheckIfDataExistsInTargetTable(string tableName) + { + using var targetConnection = new SqlConnection(configuration.XbKConnectionString); + using var command = targetConnection.CreateCommand(); + string query = $"SELECT COUNT(*) FROM {tableName}"; + command.CommandText = query; + + + targetConnection.Open(); + return (int)command.ExecuteScalar() > 0; + } + + public bool CheckForTableColumnsDifferences(string tableName, Dictionary? checkedColumns, out List<(string? sourceColumn, string? targetColumn)> columnsWithFailedCheck) + { + bool anyFailedColumnCheck = false; + var sourceTableColumns = GetSqlTableColumns(tableName, configuration.KxConnectionString) + .Where(c => checkedColumns?.Keys.Any(k => k.Equals(c.ColumnName, StringComparison.InvariantCultureIgnoreCase)) ?? true) + .Select(x => x.ColumnName).OrderBy(x => x); + var targetTableColumns = GetSqlTableColumns(tableName, configuration.XbKConnectionString) + .Where(c => checkedColumns?.Values.Any(k => k.Equals(c.ColumnName, StringComparison.InvariantCultureIgnoreCase)) ?? true) + .Select(x => x.ColumnName).OrderBy(x => x); + + var aligner = EnumerableHelper.CreateAligner( + sourceTableColumns, + targetTableColumns, + sourceTableColumns.Union(targetTableColumns).OrderBy(x => x), + a => a, + b => b, + false + ); + + columnsWithFailedCheck = []; + while (aligner.MoveNext()) + { + switch (aligner.Current) + { + case SimpleAlignResultMatch result: + logger.LogDebug("Table {Table} pairing source({SourceColumnName}) <> target({TargetColumnName}) success", tableName, result?.A, result?.B); + break; + case { } result: + columnsWithFailedCheck.Add((result.A, result.B)); + logger.LogError("Table {Table} pairing source({SourceColumnName}) <> target({TargetColumnName}) has failed", tableName, result?.A, result?.B); + anyFailedColumnCheck = true; + break; + default: + break; + } + } + + return anyFailedColumnCheck; + } + + public bool CheckForTableColumnsDifferences(string tableName, out List<(string sourceColumn, string targetColumn)> columnsWithFailedCheck) + => CheckForTableColumnsDifferences(tableName, null, out columnsWithFailedCheck); + + public void CopyTableToTable(BulkCopyRequest request) + { + (string tableName, var columnFilter, var dataFilter, int batchSize, var columns, var valueInterceptor, var skippedRowCallback, string? orderBy) = request; + + logger.LogInformation("Copy of {TableName} started", tableName); + + var sourceColumns = GetSqlTableColumns(tableName, configuration.KxConnectionString, columns) + .ToArray(); + var targetColumns = GetSqlTableColumns(tableName, configuration.XbKConnectionString, columns) + .ToArray(); + var allTargetColumns = GetSqlTableColumns(tableName, configuration.XbKConnectionString) + .ToArray(); + + AssertColumnsMatch(request, sourceColumns, targetColumns); + + using var sourceConnection = new SqlConnection(configuration.KxConnectionString); + using var sourceCommand = sourceConnection.CreateCommand(); + using var sqlBulkCopy = new SqlBulkCopy(configuration.XbKConnectionString, SqlBulkCopyOptions.KeepIdentity); + + sqlBulkCopy.BulkCopyTimeout = 1200; + sqlBulkCopy.BatchSize = batchSize; + // sqlBulkCopy.EnableStreaming + // sqlBulkCopy.BulkCopyTimeout + + sqlBulkCopy.NotifyAfter = 100000; + sqlBulkCopy.SqlRowsCopied += (sender, args) => logger.LogInformation("Copy '{TableName}': Rows copied={Rows}", tableName, args.RowsCopied); + + + string selectQuery = BuildSelectQuery(tableName, sourceColumns, orderBy).ToString(); + logger.LogTrace("Select QUERY: {Query}", selectQuery); + sqlBulkCopy.DestinationTableName = tableName; + // foreach (var (columnName, ordinalPosition) in sourceColumns) + if (request is BulkCopyRequestExtended extended) + { + foreach ((string sourceColumn, string targetColumn) in extended.ColumnsMapping) + { + if (!columnFilter(sourceColumn)) + { + continue; + } + + var tc = allTargetColumns + .FirstOrDefault(tc => tc.ColumnName.Equals(targetColumn, StringComparison.InvariantCultureIgnoreCase)) + ?? throw new InvalidOperationException($"Missing column '{targetColumn}'"); + sqlBulkCopy.ColumnMappings.Add(sourceColumn, tc.ColumnName); + logger.LogTrace("Column mapping '{Source}' => '{Target}', {SC} {TC}", sourceColumn, tc.ColumnName, + sourceColumns.Any(s => s.ColumnName.Equals(sourceColumn, StringComparison.InvariantCultureIgnoreCase)), + targetColumns.Any(s => s.ColumnName.Equals(tc.ColumnName, StringComparison.InvariantCultureIgnoreCase)) + ); + } + } + else + { + foreach ((string columnName, int ordinalPosition) in sourceColumns) + { + if (!columnFilter(columnName)) + { + continue; + } + + sqlBulkCopy.ColumnMappings.Add(columnName, columnName); + logger.LogTrace("Column mapping '{Source}' => '{Target}', {SC} {TC}", columnName, columnName, + sourceColumns.Any(s => s.ColumnName.Equals(columnName, StringComparison.InvariantCultureIgnoreCase)), + targetColumns.Any(s => s.ColumnName.Equals(columnName, StringComparison.InvariantCultureIgnoreCase)) + ); + } + } + + sourceCommand.CommandText = selectQuery; + sourceCommand.CommandType = CommandType.Text; + sourceConnection.Open(); + using var reader = sourceCommand.ExecuteReader(); + var filteredReader = new FilteredDbDataReader(reader, dataFilter); + IDataReader readerPipeline = filteredReader; + if (valueInterceptor != null) + { + readerPipeline = new ValueInterceptingReader(readerPipeline, valueInterceptor, sourceColumns, skippedRowCallback); + } + + sqlBulkCopy.WriteToServer(readerPipeline); + + logger.LogInformation("Copy of {TableName} finished! Total={Total}, TotalCopied={TotalCopied}", tableName, filteredReader.TotalItems, filteredReader.TotalNonFiltered); + } + + private void AssertColumnsMatch(BulkCopyRequest request, SqlColumn[] sourceColumns, SqlColumn[] targetColumns) + { + foreach ((string columnName, int ordinalPosition) in targetColumns) + { + if (sourceColumns.All(x => x.ColumnName != columnName)) + { + logger.LogWarning("{TableName} target column '{TargetColumn}' has no match", request.TableName, columnName); + } + } + + foreach ((string columnName, int ordinalPosition) in sourceColumns) + { + if (targetColumns.All(x => x.ColumnName != columnName)) + { + logger.LogDebug("{TableName} source column '{SourceColumn}' has no match", request.TableName, columnName); + } + } + } + + private static StringBuilder BuildSelectQuery(string tableName, SqlColumn[] sourceColumns, string? orderBy) + { + var selectBuilder = new StringBuilder(); + selectBuilder.Append("SELECT "); + for (int i = 0; i < sourceColumns.Length; i++) + { + (string columnName, int _) = sourceColumns[i]; + selectBuilder.Append($"[{columnName}]"); + if (i < sourceColumns.Length - 1) + { + selectBuilder.Append(", "); + } + } + + selectBuilder.Append($" FROM {tableName}"); + if (orderBy != null) + { + selectBuilder.Append($" ORDER BY {orderBy}"); + } + + return selectBuilder; + } + + public IEnumerable GetSqlTableColumns(string tableName, string? connectionString, IEnumerable? allowedColumns = null) + { + using var sourceConnection = new SqlConnection(connectionString); + using var cmd = sourceConnection.CreateCommand(); + + cmd.CommandText = @"SELECT * FROM INFORMATION_SCHEMA.COLUMNS JOIN INFORMATION_SCHEMA.TABLES ON COLUMNS.TABLE_NAME = TABLES.TABLE_NAME + WHERE TABLES.TABLE_NAME = @tableName"; + + cmd.Parameters.AddWithValue("tableName", tableName); + + sourceConnection.Open(); + using var reader = cmd.ExecuteReader(); + + int ordinal = 0; + + var allowedColumnsList = allowedColumns?.ToList(); + var columnFiler = allowedColumnsList != null && allowedColumnsList.Count != 0 + ? new Func(s => allowedColumnsList.Contains(s, StringComparer.InvariantCultureIgnoreCase)) + : _ => true; + + while (reader.Read()) + { + string columnName = reader.GetString("COLUMN_NAME"); + if (columnFiler(columnName)) + { + logger.LogTrace("[{Table}].{ColumnName} INCLUDED", tableName, columnName); + yield return new SqlColumn(columnName, ordinal); // reader.GetInt32("ORDINAL_POSITION")); + ordinal++; + } + else + { + logger.LogTrace("[{Table}].{ColumnName} SKIPPED", tableName, columnName); + } + // TODO tk: 2022-05-31 IS_NULLABLE, DATA_TYPE, ... check column compatibility + } + } +} diff --git a/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs b/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs index 2ad77298..82891467 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/DataReaderProxyBase.cs @@ -1,54 +1,49 @@ -namespace Migration.Toolkit.Common.Services.BulkCopy; - -using System.Data; - -public class DataReaderProxyBase : IDataReader -{ - protected readonly IDataReader _innerReader; - - public DataReaderProxyBase(IDataReader innerReader) - { - _innerReader = innerReader; - } - - public virtual int FieldCount => _innerReader.FieldCount; - public virtual int Depth => _innerReader.Depth; - public virtual bool IsClosed => _innerReader.IsClosed; - public virtual int RecordsAffected => _innerReader.RecordsAffected; - - public virtual bool GetBoolean(int i) => _innerReader.GetBoolean(i); - public virtual byte GetByte(int i) => _innerReader.GetByte(i); - - public virtual long GetBytes(int i, long fieldOffset, byte[]? buffer, int bufferoffset, int length) => - _innerReader.GetBytes(i, fieldOffset, buffer, bufferoffset, length); - - public virtual char GetChar(int i) => _innerReader.GetChar(i); - - public virtual long GetChars(int i, long fieldoffset, char[]? buffer, int bufferoffset, int length) => - _innerReader.GetChars(i, fieldoffset, buffer, bufferoffset, length); - - public virtual IDataReader GetData(int i) => _innerReader.GetData(i); - public virtual string GetDataTypeName(int i) => _innerReader.GetDataTypeName(i); - public virtual DateTime GetDateTime(int i) => _innerReader.GetDateTime(i); - public virtual decimal GetDecimal(int i) => _innerReader.GetDecimal(i); - public virtual double GetDouble(int i) => _innerReader.GetDouble(i); - public virtual Type GetFieldType(int i) => _innerReader.GetFieldType(i); - public virtual float GetFloat(int i) => _innerReader.GetFloat(i); - public virtual Guid GetGuid(int i) => _innerReader.GetGuid(i); - public virtual short GetInt16(int i) => _innerReader.GetInt16(i); - public virtual int GetInt32(int i) => _innerReader.GetInt32(i); - public virtual long GetInt64(int i) => _innerReader.GetInt64(i); - public virtual string GetName(int i) => _innerReader.GetName(i); - public virtual int GetOrdinal(string name) => _innerReader.GetOrdinal(name); - public virtual string GetString(int i) => _innerReader.GetString(i); - public virtual object GetValue(int i) => _innerReader.GetValue(i); - public virtual int GetValues(object[] values) => _innerReader.GetValues(values); - public virtual bool IsDBNull(int i) => _innerReader.IsDBNull(i); - public virtual object this[int i] => _innerReader[i]; - public virtual object this[string name] => _innerReader[name]; - public virtual void Dispose() => _innerReader.Dispose(); - public virtual void Close() => _innerReader.Close(); - public virtual DataTable? GetSchemaTable() => _innerReader.GetSchemaTable(); - public virtual bool NextResult() => _innerReader.NextResult(); - public virtual bool Read() => _innerReader.Read(); -} \ No newline at end of file +using System.Data; + +namespace Migration.Toolkit.Common.Services.BulkCopy; + +public class DataReaderProxyBase(IDataReader innerReader) : IDataReader +{ + protected readonly IDataReader InnerReader = innerReader; + + public virtual int FieldCount => InnerReader.FieldCount; + public virtual int Depth => InnerReader.Depth; + public virtual bool IsClosed => InnerReader.IsClosed; + public virtual int RecordsAffected => InnerReader.RecordsAffected; + + public virtual bool GetBoolean(int i) => InnerReader.GetBoolean(i); + public virtual byte GetByte(int i) => InnerReader.GetByte(i); + + public virtual long GetBytes(int i, long fieldOffset, byte[]? buffer, int bufferoffset, int length) => + InnerReader.GetBytes(i, fieldOffset, buffer, bufferoffset, length); + + public virtual char GetChar(int i) => InnerReader.GetChar(i); + + public virtual long GetChars(int i, long fieldoffset, char[]? buffer, int bufferoffset, int length) => + InnerReader.GetChars(i, fieldoffset, buffer, bufferoffset, length); + + public virtual IDataReader GetData(int i) => InnerReader.GetData(i); + public virtual string GetDataTypeName(int i) => InnerReader.GetDataTypeName(i); + public virtual DateTime GetDateTime(int i) => InnerReader.GetDateTime(i); + public virtual decimal GetDecimal(int i) => InnerReader.GetDecimal(i); + public virtual double GetDouble(int i) => InnerReader.GetDouble(i); + public virtual Type GetFieldType(int i) => InnerReader.GetFieldType(i); + public virtual float GetFloat(int i) => InnerReader.GetFloat(i); + public virtual Guid GetGuid(int i) => InnerReader.GetGuid(i); + public virtual short GetInt16(int i) => InnerReader.GetInt16(i); + public virtual int GetInt32(int i) => InnerReader.GetInt32(i); + public virtual long GetInt64(int i) => InnerReader.GetInt64(i); + public virtual string GetName(int i) => InnerReader.GetName(i); + public virtual int GetOrdinal(string name) => InnerReader.GetOrdinal(name); + public virtual string GetString(int i) => InnerReader.GetString(i); + public virtual object GetValue(int i) => InnerReader.GetValue(i); + public virtual int GetValues(object[] values) => InnerReader.GetValues(values); + public virtual bool IsDBNull(int i) => InnerReader.IsDBNull(i); + public virtual object this[int i] => InnerReader[i]; + public virtual object this[string name] => InnerReader[name]; + public virtual void Dispose() => InnerReader.Dispose(); + public virtual void Close() => InnerReader.Close(); + public virtual DataTable? GetSchemaTable() => InnerReader.GetSchemaTable(); + public virtual bool NextResult() => InnerReader.NextResult(); + public virtual bool Read() => InnerReader.Read(); +} diff --git a/Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs b/Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs index d1ac02c8..26c483d5 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/FilteredDbDataReader.cs @@ -1,30 +1,30 @@ -namespace Migration.Toolkit.Common.Services.BulkCopy; - -using System.Data; - -public class FilteredDbDataReader(IDataReader innerReader, Func includePredicate) : DataReaderProxyBase(innerReader) - where TReader : IDataReader -{ - public int TotalItems { get; private set; } = 0; - public int TotalNonFiltered { get; private set; } = 0; - - public override bool Read() - { - while (true) - { - if (base.Read()) - { - TotalItems++; - if (!includePredicate(_innerReader)) - { - continue; - } - - TotalNonFiltered++; - return true; - } - - return false; - } - } -} \ No newline at end of file +using System.Data; + +namespace Migration.Toolkit.Common.Services.BulkCopy; + +public class FilteredDbDataReader(IDataReader innerReader, Func includePredicate) : DataReaderProxyBase(innerReader) + where TReader : IDataReader +{ + public int TotalItems { get; private set; } + public int TotalNonFiltered { get; private set; } + + public override bool Read() + { + while (true) + { + if (base.Read()) + { + TotalItems++; + if (!includePredicate(InnerReader)) + { + continue; + } + + TotalNonFiltered++; + return true; + } + + return false; + } + } +} diff --git a/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs b/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs index d5dfb102..f8632608 100644 --- a/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs +++ b/Migration.Toolkit.Common/Services/BulkCopy/ValueInterceptingReader.cs @@ -1,66 +1,67 @@ -namespace Migration.Toolkit.Common.Services.BulkCopy; - -using System.Data; - -public record ValueInterceptorResult(object? Value = null, bool OverwriteValue = false, bool SkipDataRow = false) -{ - public static ValueInterceptorResult DoNothing => new ValueInterceptorResult(); - public static ValueInterceptorResult SkipRow => new ValueInterceptorResult(null, false, true); - public static ValueInterceptorResult ReplaceValue(object? value) => new ValueInterceptorResult(value, true, false); -}; -public delegate ValueInterceptorResult ValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow); -public delegate void ValueInterceptingReaderSkippedRow(Dictionary current); - -public class ValueInterceptingReader : DataReaderProxyBase -{ - private readonly ValueInterceptor _valueInterceptor; - private readonly ValueInterceptingReaderSkippedRow? _skippedValueCallback; - private readonly Dictionary _columnOrdinals; - - private Dictionary _overwrittenValues = new Dictionary(); - - public ValueInterceptingReader(IDataReader innerReader, ValueInterceptor valueInterceptor, SqlColumn[] columnOrdinals, ValueInterceptingReaderSkippedRow? skippedValueCallback) : base(innerReader) - { - _valueInterceptor = valueInterceptor; - _skippedValueCallback = skippedValueCallback; - _columnOrdinals = columnOrdinals.ToDictionary(x => x.OrdinalPosition, x => x.ColumnName); - } - - public override object? GetValue(int i) => _overwrittenValues.ContainsKey(i) ? _overwrittenValues[i] : base.GetValue(i); - - public override bool Read() - { - while (base.Read()) - { - _overwrittenValues = new Dictionary(); - - var skipCurrentDataRow = false; - var currentRow = _columnOrdinals.ToDictionary(k => k.Value, v => base.GetValue(v.Key)); - foreach (var (columnOrdinal, columnName) in this._columnOrdinals) - { - - var (newValue, overwriteValue, skipDataRow) = _valueInterceptor.Invoke(columnOrdinal, columnName, base.GetValue(columnOrdinal), currentRow); - if (skipDataRow) - { - skipCurrentDataRow = true; - break; - } - - if (overwriteValue) - { - _overwrittenValues[columnOrdinal] = newValue; - } - } - - if (skipCurrentDataRow) - { - _skippedValueCallback?.Invoke(currentRow); - continue; - } - - return true; - } - - return false; - } -} \ No newline at end of file +using System.Data; + +namespace Migration.Toolkit.Common.Services.BulkCopy; + +public record ValueInterceptorResult(object? Value = null, bool OverwriteValue = false, bool SkipDataRow = false) +{ + public static ValueInterceptorResult DoNothing => new(); + public static ValueInterceptorResult SkipRow => new(null, false, true); + public static ValueInterceptorResult ReplaceValue(object? value) => new(value, true); +} + +public delegate ValueInterceptorResult ValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow); + +public delegate void ValueInterceptingReaderSkippedRow(Dictionary current); + +public class ValueInterceptingReader : DataReaderProxyBase +{ + private readonly Dictionary columnOrdinals; + private readonly ValueInterceptingReaderSkippedRow? skippedValueCallback; + private readonly ValueInterceptor valueInterceptor; + + private Dictionary overwrittenValues = []; + + public ValueInterceptingReader(IDataReader innerReader, ValueInterceptor valueInterceptor, SqlColumn[] columnOrdinals, ValueInterceptingReaderSkippedRow? skippedValueCallback) : base(innerReader) + { + this.valueInterceptor = valueInterceptor; + this.skippedValueCallback = skippedValueCallback; + this.columnOrdinals = columnOrdinals.ToDictionary(x => x.OrdinalPosition, x => x.ColumnName); + } + + public override object? GetValue(int i) => overwrittenValues.ContainsKey(i) ? overwrittenValues[i] : base.GetValue(i); + + public override bool Read() + { + while (base.Read()) + { + overwrittenValues = []; + + bool skipCurrentDataRow = false; + var currentRow = columnOrdinals.ToDictionary(k => k.Value, v => base.GetValue(v.Key)); + foreach ((int columnOrdinal, string columnName) in columnOrdinals) + { + (object? newValue, bool overwriteValue, bool skipDataRow) = valueInterceptor.Invoke(columnOrdinal, columnName, base.GetValue(columnOrdinal), currentRow); + if (skipDataRow) + { + skipCurrentDataRow = true; + break; + } + + if (overwriteValue) + { + overwrittenValues[columnOrdinal] = newValue; + } + } + + if (skipCurrentDataRow) + { + skippedValueCallback?.Invoke(currentRow); + continue; + } + + return true; + } + + return false; + } +} diff --git a/Migration.Toolkit.Common/Services/CommandParser.cs b/Migration.Toolkit.Common/Services/CommandParser.cs index c09fe5f1..53a461f2 100644 --- a/Migration.Toolkit.Common/Services/CommandParser.cs +++ b/Migration.Toolkit.Common/Services/CommandParser.cs @@ -1,148 +1,144 @@ -namespace Migration.Toolkit.Common.Services; - -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using static Migration.Toolkit.Common.Helpers.ConsoleHelper; - -public class CommandParser : ICommandParser -{ - public List Parse(Queue args, ref bool bypassDependencyCheck, bool firstHaveToBeMigrate = true) - { - var commands = new List(); - while (args.TryDequeue(out var arg)) - { - if (arg.IsIn("help", "h")) - { - PrintCommandDescriptions(); - break; - } - - if (arg == "migrate" && firstHaveToBeMigrate) - { - firstHaveToBeMigrate = false; - continue; - } - - if (arg == "--bypass-dependency-check") - { - bypassDependencyCheck = true; - continue; - } - - if (firstHaveToBeMigrate) - { - Console.WriteLine($@"First must be command, for example {Green("migrate")}"); - PrintCommandDescriptions(); - break; - } - - // if (arg == $"--{MigrateContactGroupsCommand.Moniker}") - // { - // commands.Add(new MigrateContactGroupsCommand()); - // continue; - // } - - if (arg == $"--{MigrateContactManagementCommand.Moniker}") - { - commands.Add(new MigrateContactManagementCommand()); - continue; - } - - if (arg == $"--{MigrateDataProtectionCommand.Moniker}") - { - // RequireNumberParameter("--batchSize", out var batchSize); - commands.Add(new MigrateDataProtectionCommand()); - continue; - } - - if (arg == $"--{MigrateFormsCommand.Moniker}") - { - commands.Add(new MigrateFormsCommand()); - continue; - } - - if (arg == $"--{MigrateMediaLibrariesCommand.Moniker}") - { - commands.Add(new MigrateMediaLibrariesCommand()); - continue; - } - - if (arg == $"--{MigratePageTypesCommand.Moniker}") - { - commands.Add(new MigratePageTypesCommand()); - continue; - } - - if (arg == $"--{MigratePagesCommand.Moniker}") - { - commands.Add(new MigratePagesCommand()); - continue; - } - - if (arg == $"--{MigrateCategoriesCommand.Moniker}") - { - commands.Add(new MigrateCategoriesCommand()); - continue; - } - - if (arg == $"--{MigrateSettingKeysCommand.Moniker}") - { - commands.Add(new MigrateSettingKeysCommand()); - continue; - } - - if (arg == $"--{MigrateSitesCommand.Moniker}") - { - commands.Add(new MigrateSitesCommand()); - continue; - } - - if (arg == $"--{MigrateUsersCommand.Moniker}") - { - commands.Add(new MigrateUsersCommand()); - continue; - } - - if (arg == $"--{MigrateMembersCommand.Moniker}") - { - commands.Add(new MigrateMembersCommand()); - } - - if (arg == $"--{MigrateCustomModulesCommand.Moniker}") - { - commands.Add(new MigrateCustomModulesCommand()); - continue; - } - - if (arg == $"--{MigrateCustomTablesCommand.Moniker}") - { - commands.Add(new MigrateCustomTablesCommand()); - continue; - } - } - - return commands; - } - - void PrintCommandDescriptions() - { - WriteCommandDesc($"starts migration of {Green(MigratePageTypesCommand.MonikerFriendly)}", $"migrate --{MigratePageTypesCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigratePagesCommand.MonikerFriendly)}", $"migrate --{MigratePagesCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateCategoriesCommand.MonikerFriendly)}", $"migrate --{MigrateCategoriesCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateSettingKeysCommand.MonikerFriendly)}", $"migrate --{MigrateSettingKeysCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateContactManagementCommand.MonikerFriendly)}", $"migrate --{MigrateContactManagementCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateDataProtectionCommand.MonikerFriendly)}", $"migrate --{MigrateDataProtectionCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateFormsCommand.MonikerFriendly)}", $"migrate --{MigrateFormsCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateMediaLibrariesCommand.MonikerFriendly)}", $"migrate --{MigrateMediaLibrariesCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateSitesCommand.MonikerFriendly)}", $"migrate --{MigrateSitesCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateUsersCommand.MonikerFriendly)}", $"migrate --{MigrateUsersCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateMembersCommand.MonikerFriendly)}", $"migrate --{MigrateMembersCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateAttachmentsCommand.MonikerFriendly)}", $"migrate --{MigrateAttachmentsCommand.Moniker}"); - WriteCommandDesc($"starts migration of {Green(MigrateCustomModulesCommand.MonikerFriendly)}", $"migrate --{MigrateCustomModulesCommand.Moniker}"); - } - - void WriteCommandDesc(string desc, string commandMoniker) - { - Console.WriteLine($@"{Yellow(commandMoniker)}: {desc}"); - } -} \ No newline at end of file +using Migration.Toolkit.Common.Abstractions; + +using static Migration.Toolkit.Common.Helpers.ConsoleHelper; + +namespace Migration.Toolkit.Common.Services; + +public class CommandParser : ICommandParser +{ + public List Parse(Queue args, ref bool bypassDependencyCheck, bool firstHaveToBeMigrate = true) + { + var commands = new List(); + while (args.TryDequeue(out string? arg)) + { + if (arg.IsIn("help", "h")) + { + PrintCommandDescriptions(); + break; + } + + if (arg == "migrate" && firstHaveToBeMigrate) + { + firstHaveToBeMigrate = false; + continue; + } + + if (arg == "--bypass-dependency-check") + { + bypassDependencyCheck = true; + continue; + } + + if (firstHaveToBeMigrate) + { + Console.WriteLine($@"First must be command, for example {Green("migrate")}"); + PrintCommandDescriptions(); + break; + } + + // if (arg == $"--{MigrateContactGroupsCommand.Moniker}") + // { + // commands.Add(new MigrateContactGroupsCommand()); + // continue; + // } + + if (arg == $"--{MigrateContactManagementCommand.Moniker}") + { + commands.Add(new MigrateContactManagementCommand()); + continue; + } + + if (arg == $"--{MigrateDataProtectionCommand.Moniker}") + { + // RequireNumberParameter("--batchSize", out var batchSize); + commands.Add(new MigrateDataProtectionCommand()); + continue; + } + + if (arg == $"--{MigrateFormsCommand.Moniker}") + { + commands.Add(new MigrateFormsCommand()); + continue; + } + + if (arg == $"--{MigrateMediaLibrariesCommand.Moniker}") + { + commands.Add(new MigrateMediaLibrariesCommand()); + continue; + } + + if (arg == $"--{MigratePageTypesCommand.Moniker}") + { + commands.Add(new MigratePageTypesCommand()); + continue; + } + + if (arg == $"--{MigratePagesCommand.Moniker}") + { + commands.Add(new MigratePagesCommand()); + continue; + } + + if (arg == $"--{MigrateCategoriesCommand.Moniker}") + { + commands.Add(new MigrateCategoriesCommand()); + continue; + } + + if (arg == $"--{MigrateSettingKeysCommand.Moniker}") + { + commands.Add(new MigrateSettingKeysCommand()); + continue; + } + + if (arg == $"--{MigrateSitesCommand.Moniker}") + { + commands.Add(new MigrateSitesCommand()); + continue; + } + + if (arg == $"--{MigrateUsersCommand.Moniker}") + { + commands.Add(new MigrateUsersCommand()); + continue; + } + + if (arg == $"--{MigrateMembersCommand.Moniker}") + { + commands.Add(new MigrateMembersCommand()); + } + + if (arg == $"--{MigrateCustomModulesCommand.Moniker}") + { + commands.Add(new MigrateCustomModulesCommand()); + continue; + } + + if (arg == $"--{MigrateCustomTablesCommand.Moniker}") + { + commands.Add(new MigrateCustomTablesCommand()); + } + } + + return commands; + } + + private void PrintCommandDescriptions() + { + WriteCommandDesc($"starts migration of {Green(MigratePageTypesCommand.MonikerFriendly)}", $"migrate --{MigratePageTypesCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigratePagesCommand.MonikerFriendly)}", $"migrate --{MigratePagesCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateCategoriesCommand.MonikerFriendly)}", $"migrate --{MigrateCategoriesCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateSettingKeysCommand.MonikerFriendly)}", $"migrate --{MigrateSettingKeysCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateContactManagementCommand.MonikerFriendly)}", $"migrate --{MigrateContactManagementCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateDataProtectionCommand.MonikerFriendly)}", $"migrate --{MigrateDataProtectionCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateFormsCommand.MonikerFriendly)}", $"migrate --{MigrateFormsCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateMediaLibrariesCommand.MonikerFriendly)}", $"migrate --{MigrateMediaLibrariesCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateSitesCommand.MonikerFriendly)}", $"migrate --{MigrateSitesCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateUsersCommand.MonikerFriendly)}", $"migrate --{MigrateUsersCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateMembersCommand.MonikerFriendly)}", $"migrate --{MigrateMembersCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateAttachmentsCommand.MonikerFriendly)}", $"migrate --{MigrateAttachmentsCommand.Moniker}"); + WriteCommandDesc($"starts migration of {Green(MigrateCustomModulesCommand.MonikerFriendly)}", $"migrate --{MigrateCustomModulesCommand.Moniker}"); + } + + private void WriteCommandDesc(string desc, string commandMoniker) => Console.WriteLine($@"{Yellow(commandMoniker)}: {desc}"); +} diff --git a/Migration.Toolkit.Common/Services/CoupledDataService.cs b/Migration.Toolkit.Common/Services/CoupledDataService.cs index 19de8466..b39c5e01 100644 --- a/Migration.Toolkit.Common/Services/CoupledDataService.cs +++ b/Migration.Toolkit.Common/Services/CoupledDataService.cs @@ -1,42 +1,35 @@ -namespace Migration.Toolkit.Common.Services; - -using Microsoft.Data.SqlClient; - -public class CoupledDataService -{ - private readonly ToolkitConfiguration _configuration; - - public CoupledDataService(ToolkitConfiguration configuration) - { - _configuration = configuration; - } - - public Dictionary? GetSourceCoupledDataRow(string tableName, string primaryKeyColumn, int? coupledDataId) - { - ArgumentNullException.ThrowIfNull(tableName); - ArgumentNullException.ThrowIfNull(primaryKeyColumn); - ArgumentNullException.ThrowIfNull(coupledDataId); - - using var targetConnection = new SqlConnection(_configuration.KxConnectionString); - using var command = targetConnection.CreateCommand(); - var query = $"SELECT * FROM {tableName} WHERE {primaryKeyColumn} = @{primaryKeyColumn}"; - command.CommandText = query; - command.Parameters.AddWithValue(primaryKeyColumn, coupledDataId); - - targetConnection.Open(); - using var reader = command.ExecuteReader(); - - var result = new Dictionary(); - if (reader.Read()) - { - for (var i = 0; i < reader.FieldCount; i++) - { - result.Add(reader.GetName(i), reader.GetValue(i)); - } - - return result; - } - - return null; - } -} \ No newline at end of file +using Microsoft.Data.SqlClient; + +namespace Migration.Toolkit.Common.Services; + +public class CoupledDataService(ToolkitConfiguration configuration) +{ + public Dictionary? GetSourceCoupledDataRow(string tableName, string primaryKeyColumn, int? coupledDataId) + { + ArgumentNullException.ThrowIfNull(tableName); + ArgumentNullException.ThrowIfNull(primaryKeyColumn); + ArgumentNullException.ThrowIfNull(coupledDataId); + + using var targetConnection = new SqlConnection(configuration.KxConnectionString); + using var command = targetConnection.CreateCommand(); + string query = $"SELECT * FROM {tableName} WHERE {primaryKeyColumn} = @{primaryKeyColumn}"; + command.CommandText = query; + command.Parameters.AddWithValue(primaryKeyColumn, coupledDataId); + + targetConnection.Open(); + using var reader = command.ExecuteReader(); + + var result = new Dictionary(); + if (reader.Read()) + { + for (int i = 0; i < reader.FieldCount; i++) + { + result.Add(reader.GetName(i), reader.GetValue(i)); + } + + return result; + } + + return null; + } +} diff --git a/Migration.Toolkit.Common/Services/ICommandParser.cs b/Migration.Toolkit.Common/Services/ICommandParser.cs index d436763d..d6b421dd 100644 --- a/Migration.Toolkit.Common/Services/ICommandParser.cs +++ b/Migration.Toolkit.Common/Services/ICommandParser.cs @@ -1,8 +1,8 @@ -namespace Migration.Toolkit.Common.Services; - -using Migration.Toolkit.Common.Abstractions; - -public interface ICommandParser -{ - List Parse(Queue args, ref bool bypassDependencyCheck, bool firstHaveToBeMigrate = true); -} \ No newline at end of file +using Migration.Toolkit.Common.Abstractions; + +namespace Migration.Toolkit.Common.Services; + +public interface ICommandParser +{ + List Parse(Queue args, ref bool bypassDependencyCheck, bool firstHaveToBeMigrate = true); +} diff --git a/Migration.Toolkit.Common/Services/IPrintService.cs b/Migration.Toolkit.Common/Services/IPrintService.cs index a84d783b..5a0fee6f 100644 --- a/Migration.Toolkit.Common/Services/IPrintService.cs +++ b/Migration.Toolkit.Common/Services/IPrintService.cs @@ -1,9 +1,9 @@ -namespace Migration.Toolkit.Common.Services; - -public interface IPrintService -{ - string PrintKxpModelInfo(T model); - string GetEntityIdentityPrint(T model, bool printType = true); - string GetEntityIdentityPrints(IEnumerable models, string separator = "|"); - string PrintEnumValues(string separator) where TEnum : struct, Enum; -} \ No newline at end of file +namespace Migration.Toolkit.Common.Services; + +public interface IPrintService +{ + string PrintKxpModelInfo(T model); + string GetEntityIdentityPrint(T model, bool printType = true); + string GetEntityIdentityPrints(IEnumerable models, string separator = "|"); + string PrintEnumValues(string separator) where TEnum : struct, Enum; +} diff --git a/Migration.Toolkit.Common/Services/ISpoiledGuidContext.cs b/Migration.Toolkit.Common/Services/ISpoiledGuidContext.cs new file mode 100644 index 00000000..37cef9a2 --- /dev/null +++ b/Migration.Toolkit.Common/Services/ISpoiledGuidContext.cs @@ -0,0 +1,9 @@ +namespace Migration.Toolkit.Common.Services; + +public interface ISpoiledGuidContext +{ + Guid EnsureDocumentGuid(Guid documentGuid, int siteId, int nodeId, int documentId); + Guid EnsureNodeGuid(Guid nodeGuid, int siteId, int nodeId); + Guid EnsureNodeGuid(Guid nodeGuid, int siteId); + Guid? GetNodeGuid(int nodeId, int siteId); +} diff --git a/Migration.Toolkit.Common/Services/Ipc/IpcService.cs b/Migration.Toolkit.Common/Services/Ipc/IpcService.cs index 58f50b66..9a01a943 100644 --- a/Migration.Toolkit.Common/Services/Ipc/IpcService.cs +++ b/Migration.Toolkit.Common/Services/Ipc/IpcService.cs @@ -1,116 +1,116 @@ -namespace Migration.Toolkit.Common.Services.Ipc; - -using System.Text; -using Microsoft.Extensions.Logging; -using Newtonsoft.Json; - -public class IpcService(ToolkitConfiguration toolkitConfiguration, ILogger logger) -{ - private const string IPC_PING_PATH = "/ToolkitApi/Test"; - private const string IPC_DISCOVERED_INFO_PATH = "/ToolkitApi/GetAllDefinitions"; - - public async Task IsConfiguredAsync() - { - var advancedFeatures = toolkitConfiguration.OptInFeatures?.QuerySourceInstanceApi; - var connections = advancedFeatures?.Connections ?? new List(); - - if (!(advancedFeatures?.Enabled ?? false)) - { - logger.LogInformation("Advanced features are disabled"); - return false; - } - else - { - logger.LogInformation("Advanced features are enabled"); - } - - var hc = new HttpClient(); - var results = new List(); - foreach (var connectionInfo in connections) - { - if (connectionInfo.SourceInstanceUri != null) - { - var pingUri = new Uri(connectionInfo.SourceInstanceUri, IPC_PING_PATH); - var request = new HttpRequestMessage( - HttpMethod.Post, pingUri - ); - - var json = JsonConvert.SerializeObject(new { secret = connectionInfo.Secret }); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - request.Content = content; - - results.Add(await hc.SendAsync(request)); - } - else - { - logger.LogError("SourceInstanceUri is required"); - return false; - } - } - - var ok = true; - foreach (var httpResponseMessage in results) - { - httpResponseMessage.EnsureSuccessStatusCode(); - - try - { - var response = await httpResponseMessage.Content.ReadAsStringAsync(); - if (JsonConvert.DeserializeObject(response) is { } deserializeObject) - { - ok &= ((dynamic)deserializeObject).pong == true; - } - else - { - ok = false; - } - } - catch (Exception ex) - { - logger.LogError(ex, "Error while connecting to source instance"); - ok = false; - } - } - - return ok; - } - - public async Task> GetSourceInstanceDiscoveredInfos() - { - var advancedFeatures = toolkitConfiguration.OptInFeatures?.QuerySourceInstanceApi; - var connections = advancedFeatures?.Connections ?? new List(); - - var discoveredInfoList = new Dictionary(StringComparer.InvariantCultureIgnoreCase); - - foreach (var connectionInfo in connections) - { - if (connectionInfo.SourceInstanceUri != null) - { - var pingUri = new Uri(connectionInfo.SourceInstanceUri, IPC_DISCOVERED_INFO_PATH); - var hc = new HttpClient(); - var request = new HttpRequestMessage( - HttpMethod.Post, pingUri - ); - - var json = JsonConvert.SerializeObject(new { secret = connectionInfo.Secret }); - var content = new StringContent(json, Encoding.UTF8, "application/json"); - request.Content = content; - - var response = await hc.SendAsync(request); - response.EnsureSuccessStatusCode(); - - var responseBody = await response.Content.ReadAsStringAsync(); - if (JsonConvert.DeserializeObject(responseBody) is { } deserializedResponse) - { - discoveredInfoList.Add(deserializedResponse.SiteName, deserializedResponse); - } - else - { - throw new Exception("Invalid response to IPC from source instance"); - } - } - } - - return discoveredInfoList; - } -} \ No newline at end of file +using System.Text; + +using Microsoft.Extensions.Logging; + +using Newtonsoft.Json; + +namespace Migration.Toolkit.Common.Services.Ipc; + +public class IpcService(ToolkitConfiguration toolkitConfiguration, ILogger logger) +{ + private const string IPC_PING_PATH = "/ToolkitApi/Test"; + private const string IPC_DISCOVERED_INFO_PATH = "/ToolkitApi/GetAllDefinitions"; + + public async Task IsConfiguredAsync() + { + var advancedFeatures = toolkitConfiguration.OptInFeatures?.QuerySourceInstanceApi; + var connections = advancedFeatures?.Connections ?? []; + + if (!(advancedFeatures?.Enabled ?? false)) + { + logger.LogInformation("Advanced features are disabled"); + return false; + } + + logger.LogInformation("Advanced features are enabled"); + + var hc = new HttpClient(); + var results = new List(); + foreach (var connectionInfo in connections) + { + if (connectionInfo.SourceInstanceUri != null) + { + var pingUri = new Uri(connectionInfo.SourceInstanceUri, IPC_PING_PATH); + var request = new HttpRequestMessage( + HttpMethod.Post, pingUri + ); + + string json = JsonConvert.SerializeObject(new { secret = connectionInfo.Secret }); + var content = new StringContent(json, Encoding.UTF8, "application/json"); + request.Content = content; + + results.Add(await hc.SendAsync(request)); + } + else + { + logger.LogError("SourceInstanceUri is required"); + return false; + } + } + + bool ok = true; + foreach (var httpResponseMessage in results) + { + httpResponseMessage.EnsureSuccessStatusCode(); + + try + { + string response = await httpResponseMessage.Content.ReadAsStringAsync(); + if (JsonConvert.DeserializeObject(response) is { } deserializeObject) + { + ok &= ((dynamic)deserializeObject).pong == true; + } + else + { + ok = false; + } + } + catch (Exception ex) + { + logger.LogError(ex, "Error while connecting to source instance"); + ok = false; + } + } + + return ok; + } + + public async Task> GetSourceInstanceDiscoveredInfos() + { + var advancedFeatures = toolkitConfiguration.OptInFeatures?.QuerySourceInstanceApi; + var connections = advancedFeatures?.Connections ?? []; + + var discoveredInfoList = new Dictionary(StringComparer.InvariantCultureIgnoreCase); + + foreach (var connectionInfo in connections) + { + if (connectionInfo.SourceInstanceUri != null) + { + var pingUri = new Uri(connectionInfo.SourceInstanceUri, IPC_DISCOVERED_INFO_PATH); + var hc = new HttpClient(); + var request = new HttpRequestMessage( + HttpMethod.Post, pingUri + ); + + string json = JsonConvert.SerializeObject(new { secret = connectionInfo.Secret }); + var content = new StringContent(json, Encoding.UTF8, "application/json"); + request.Content = content; + + var response = await hc.SendAsync(request); + response.EnsureSuccessStatusCode(); + + string responseBody = await response.Content.ReadAsStringAsync(); + if (JsonConvert.DeserializeObject(responseBody) is { } deserializedResponse) + { + discoveredInfoList.Add(deserializedResponse.SiteName, deserializedResponse); + } + else + { + throw new Exception("Invalid response to IPC from source instance"); + } + } + } + + return discoveredInfoList; + } +} diff --git a/Migration.Toolkit.Common/Services/Ipc/Model.cs b/Migration.Toolkit.Common/Services/Ipc/Model.cs index 4fdd5840..32c4fcab 100644 --- a/Migration.Toolkit.Common/Services/Ipc/Model.cs +++ b/Migration.Toolkit.Common/Services/Ipc/Model.cs @@ -1,45 +1,46 @@ -namespace Migration.Toolkit.Common.Services.Ipc; - -public class SourceInstanceDiscoveredInfo -{ - public Dictionary>? WidgetProperties { get; set; } - public Dictionary>? PageTemplateProperties { get; set; } - public Dictionary>? SectionProperties { get; set; } - public string SiteName { get; set; } -} - -public class EditingFormControlModel -{ - /// - /// Identifier of the form component to be used for editing. - /// - /// - /// The identifier defines a registered via . - /// - /// - public string FormComponentIdentifier { get; set; } - - /// Gets or sets the label of the form component. - /// - public string Label { get; set; } - - /// Gets or sets the default value of the form component. - /// - public object? DefaultValue { get; set; } - - /// - /// Gets or sets the explanation text of the form component. - /// - /// - public string ExplanationText { get; set; } - - /// Gets or sets the tooltip of the form component. - /// - public string Tooltip { get; set; } - - /// Gets or sets the order weight of the form component. - /// - public int? Order { get; set; } - - public string PropertyName { get; set; } -} \ No newline at end of file +namespace Migration.Toolkit.Common.Services.Ipc; + +public class SourceInstanceDiscoveredInfo +{ + public Dictionary>? WidgetProperties { get; set; } + public Dictionary>? PageTemplateProperties { get; set; } + public Dictionary>? SectionProperties { get; set; } + public string SiteName { get; set; } +} + +public class EditingFormControlModel +{ + /// + /// Identifier of the form component to be used for editing. + /// + /// + /// The identifier defines a registered via + /// . + /// + /// + public string FormComponentIdentifier { get; set; } + + /// Gets or sets the label of the form component. + /// + public string Label { get; set; } + + /// Gets or sets the default value of the form component. + /// + public object? DefaultValue { get; set; } + + /// + /// Gets or sets the explanation text of the form component. + /// + /// + public string ExplanationText { get; set; } + + /// Gets or sets the tooltip of the form component. + /// + public string Tooltip { get; set; } + + /// Gets or sets the order weight of the form component. + /// + public int? Order { get; set; } + + public string PropertyName { get; set; } +} diff --git a/Migration.Toolkit.Common/ToolkitConfiguration.cs b/Migration.Toolkit.Common/ToolkitConfiguration.cs index 617cac22..e251b5db 100644 --- a/Migration.Toolkit.Common/ToolkitConfiguration.cs +++ b/Migration.Toolkit.Common/ToolkitConfiguration.cs @@ -1,218 +1,100 @@ -using System.Linq.Expressions; -using System.Text.Json.Serialization; - -namespace Migration.Toolkit.Common; - -using System.Runtime.Serialization; -using Microsoft.Extensions.Configuration; - -/// -/// Autofix enum -/// -/// do not update value names, they are used in json configuration -public enum AutofixEnum -{ - DiscardData, - AttemptFix, - Error, -} - -public class ToolkitConfiguration -{ - #region Connection string of source instance - - private string? _kxConnectionString; - - [ConfigurationKeyName(ConfigurationNames.SourceConnectionString)] - [Obsolete("Use KxConnectionString instead")] - public string? ObsoleteSourceConnectionString { get; set; } - - [ConfigurationKeyName(ConfigurationNames.KxConnectionString)] - public string KxConnectionString - { - get - { - if (string.IsNullOrWhiteSpace(_kxConnectionString.NullIf(ConfigurationNames.TodoPlaceholder))) - { -#pragma warning disable CS0618 // usage is related to resolving deprecation and backwards compatibility - return ObsoleteSourceConnectionString!; -#pragma warning restore CS0618 - } - - return _kxConnectionString!; - } - set => _kxConnectionString = value; - } - - #endregion - - #region Path to CMS dir of source instance - - private string? _kxCmsDirPath; - - [ConfigurationKeyName(ConfigurationNames.SourceCmsDirPath)] - [Obsolete("Use KxCmsDirPath instead")] - public string? ObsoleteSourceCmsDirPath { get; set; } - - [ConfigurationKeyName(ConfigurationNames.KxCmsDirPath)] - public string? KxCmsDirPath - { - get - { - if (string.IsNullOrWhiteSpace(_kxCmsDirPath.NullIf(ConfigurationNames.TodoPlaceholder))) - { -#pragma warning disable CS0618 - return ObsoleteSourceCmsDirPath; -#pragma warning restore CS0618 - } - - return _kxCmsDirPath; - } - set => _kxCmsDirPath = value; - } - - #endregion - - #region Connection string of target instance - - private string? _xbKConnectionString; - - [ConfigurationKeyName(ConfigurationNames.TargetConnectionString)] - [Obsolete("Use XbKConnectionString instead")] - public string? ObsoleteTargetConnectionString { get; set; } - - [ConfigurationKeyName(ConfigurationNames.XbKConnectionString)] - public string? XbKConnectionString - { - get - { - if (string.IsNullOrWhiteSpace(_xbKConnectionString.NullIf(ConfigurationNames.TodoPlaceholder))) - { -#pragma warning disable CS0618 // usage is related to resolving deprecation and backwards compatibility - return ObsoleteTargetConnectionString; -#pragma warning restore CS0618 - } - - return _xbKConnectionString; - } - set => _xbKConnectionString = value; - } - - #endregion - - #region Path to root directory of target instance - - private string? _xbKDirPath = null; - private HashSet? _classNamesCreateReusableSchema; - - - [ConfigurationKeyName(ConfigurationNames.TargetCmsDirPath)] - [Obsolete("Use XbKDirPath instead")] - public string? ObsoleteTargetCmsDirPath { get; set; } = null; - - [ConfigurationKeyName(ConfigurationNames.XbKDirPath)] - public string? XbKDirPath - { - get - { - if (string.IsNullOrWhiteSpace(_xbKDirPath.NullIf(ConfigurationNames.TodoPlaceholder))) - { -#pragma warning disable CS0618 // usage is related to resolving deprecation and backwards compatibility - return ObsoleteTargetCmsDirPath; -#pragma warning restore CS0618 - } - - return _xbKDirPath; - } - set => _xbKDirPath = value; - } - - #endregion - - [ConfigurationKeyName(ConfigurationNames.EntityConfigurations)] - public EntityConfigurations EntityConfigurations { get; set; } = new(); - - [ConfigurationKeyName(ConfigurationNames.MigrateOnlyMediaFileInfo)] - public bool? MigrateOnlyMediaFileInfo { get; set; } = true; - - [ConfigurationKeyName(ConfigurationNames.UseOmActivityNodeRelationAutofix)] - public AutofixEnum? UseOmActivityNodeRelationAutofix { get; set; } = AutofixEnum.Error; - - [ConfigurationKeyName(ConfigurationNames.UseOmActivitySiteRelationAutofix)] - public AutofixEnum? UseOmActivitySiteRelationAutofix { get; set; } = AutofixEnum.Error; - - [ConfigurationKeyName(ConfigurationNames.MigrationProtocolPath)] - public string? MigrationProtocolPath { get; set; } - - [ConfigurationKeyName(ConfigurationNames.MemberIncludeUserSystemFields)] - public string? MemberIncludeUserSystemFields { get; set; } - - [ConfigurationKeyName(ConfigurationNames.CreateReusableFieldSchemaForClasses)] - public string? CreateReusableFieldSchemaForClasses { get; set; } - - - public IReadOnlySet ClassNamesCreateReusableSchema => _classNamesCreateReusableSchema ??= new HashSet( - (CreateReusableFieldSchemaForClasses?.Split(new char[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) ?? []).Select(x => x.Trim()), - StringComparer.InvariantCultureIgnoreCase - ); - - public Dictionary RequireExplicitMapping(Expression> keyNameSelector) - { - var memberName = keyNameSelector.GetMemberName(); - var migratedIds = EntityConfigurations?.GetEntityConfiguration()?.ExplicitPrimaryKeyMapping[memberName]; - if (migratedIds == null) - { - throw new InvalidOperationException(string.Format(Resources.Exception_MappingIsRequired, typeof(TEntityType).Name, memberName)); - } - - return migratedIds.ToDictionary(kvp => - { - if (int.TryParse(kvp.Key, out var id)) - { - return id; - } - - throw new InvalidOperationException(string.Format(Resources.Exception_MappingIsRequired, typeof(TEntityType).Name, memberName)); - }, kvp => - { - if (kvp.Value is { } id) - { - return id; - } - - throw new InvalidOperationException(string.Format(Resources.Exception_MappingIsRequired, typeof(TEntityType).Name, memberName)); - }); - } - - public void AddExplicitMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - var memberName = keyNameSelector.GetMemberName(); - EntityConfigurations ??= new EntityConfigurations(); - - var entityConfiguration = EntityConfigurations.GetEntityConfiguration(); - var mapping = entityConfiguration.ExplicitPrimaryKeyMapping; - if (!mapping.ContainsKey(memberName)) - { - mapping.Add(memberName, new()); - } - - if (!mapping[memberName].ContainsKey(sourceId.ToString())) - { - mapping[memberName].Add(sourceId.ToString(), targetId); - } - else - { - mapping[memberName][sourceId.ToString()] = targetId; - } - - EntityConfigurations.SetEntityConfiguration(entityConfiguration); - } - - - #region Opt-in features - - [ConfigurationKeyName(ConfigurationNames.OptInFeatures)] - public OptInFeatures? OptInFeatures { get; set; } - - #endregion -} \ No newline at end of file +using Microsoft.Extensions.Configuration; + +namespace Migration.Toolkit.Common; + +/// +/// Autofix enum +/// +/// do not update value names, they are used in json configuration +public enum AutofixEnum +{ + DiscardData, + AttemptFix, + Error +} + +public class ToolkitConfiguration +{ + #region Path to CMS dir of source instance + + [ConfigurationKeyName(ConfigurationNames.KxCmsDirPath)] + public string? KxCmsDirPath { get; set; } + + #endregion + + [ConfigurationKeyName(ConfigurationNames.EntityConfigurations)] + public EntityConfigurations EntityConfigurations { get; set; } = []; + + [ConfigurationKeyName(ConfigurationNames.MigrateOnlyMediaFileInfo)] + public bool? MigrateOnlyMediaFileInfo { get; set; } = true; + + [ConfigurationKeyName(ConfigurationNames.UseOmActivityNodeRelationAutofix)] + public AutofixEnum? UseOmActivityNodeRelationAutofix { get; set; } = AutofixEnum.Error; + + [ConfigurationKeyName(ConfigurationNames.UseOmActivitySiteRelationAutofix)] + public AutofixEnum? UseOmActivitySiteRelationAutofix { get; set; } = AutofixEnum.Error; + + [ConfigurationKeyName(ConfigurationNames.MigrationProtocolPath)] + public string? MigrationProtocolPath { get; set; } + + [ConfigurationKeyName(ConfigurationNames.MemberIncludeUserSystemFields)] + public string? MemberIncludeUserSystemFields { get; set; } + + [ConfigurationKeyName(ConfigurationNames.CreateReusableFieldSchemaForClasses)] + public string? CreateReusableFieldSchemaForClasses { get; set; } + + + public IReadOnlySet ClassNamesCreateReusableSchema => classNamesCreateReusableSchema ??= new HashSet( + (CreateReusableFieldSchemaForClasses?.Split(new[] { ',', ';' }, StringSplitOptions.RemoveEmptyEntries) ?? []).Select(x => x.Trim()), + StringComparer.InvariantCultureIgnoreCase + ); + + #region Opt-in features + + [ConfigurationKeyName(ConfigurationNames.OptInFeatures)] + public OptInFeatures? OptInFeatures { get; set; } + + #endregion + + #region Connection string of source instance + + private string? kxConnectionString; + + [ConfigurationKeyName(ConfigurationNames.KxConnectionString)] + public string KxConnectionString + { + get => kxConnectionString!; + set => kxConnectionString = value; + } + + #endregion + + #region Connection string of target instance + + [ConfigurationKeyName(ConfigurationNames.XbKConnectionString)] + public string XbKConnectionString + { + get => xbKConnectionString!; + set => xbKConnectionString = value; + } + + public void SetXbKConnectionStringIfNotEmpty(string? connectionString) + { + if (!string.IsNullOrWhiteSpace(connectionString)) + { + xbKConnectionString = connectionString; + } + } + + #endregion + + #region Path to root directory of target instance + + private HashSet? classNamesCreateReusableSchema; + private string? xbKConnectionString; + + [ConfigurationKeyName(ConfigurationNames.XbKDirPath)] + public string? XbKDirPath { get; set; } = null; + + #endregion +} diff --git a/Migration.Toolkit.Core.K11/Auxiliary/NodeXmlAdapter.cs b/Migration.Toolkit.Core.K11/Auxiliary/NodeXmlAdapter.cs deleted file mode 100644 index add8a988..00000000 --- a/Migration.Toolkit.Core.K11/Auxiliary/NodeXmlAdapter.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace Migration.Toolkit.Core.K11.Auxiliary; - -using System; -using System.Xml.Linq; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Enumerations; - -internal class NodeXmlAdapter -{ - private readonly XElement _xClass; - - public bool ParsingSuccessful { get; } - - public NodeXmlAdapter(string xml) - { - var xDoc = XDocument.Parse(xml); - if (xDoc.Root?.FirstNode is XElement dClass) - { - _xClass = dClass; - ParsingSuccessful = true; - } - else - { - _xClass = null!; - ParsingSuccessful = false; - } - } - - public string? GetValue(string columnName) - { - return _xClass.Element(columnName)?.Value; - } - - public bool HasValueSet(string columnName) - { - return _xClass.Element(columnName) != null; - } - - public int? NodeID => _xClass.Element(NodeXmlColumns.NODE_ID)?.Value(); - public string? NodeAliasPath => _xClass.Element(NodeXmlColumns.NODE_ALIAS_PATH)?.Value; - public string? NodeName => _xClass.Element(NodeXmlColumns.NODE_NAME)?.Value; - public string? NodeAlias => _xClass.Element(NodeXmlColumns.NODE_ALIAS)?.Value; - public int? NodeClassID => _xClass.Element(NodeXmlColumns.NODE_CLASS_ID)?.Value(); - public int? NodeParentID => _xClass.Element(NodeXmlColumns.NODE_PARENT_ID)?.Value(); - public int? NodeLevel => _xClass.Element(NodeXmlColumns.NODE_LEVEL)?.Value(); - public int? NodeSiteID => _xClass.Element(NodeXmlColumns.NODE_SITE_ID)?.Value(); - public Guid? NodeGUID => _xClass.Element(NodeXmlColumns.NODE_GUID)?.Value(); - public int? NodeOrder => _xClass.Element(NodeXmlColumns.NODE_ORDER)?.Value(); - public int? NodeOwner => _xClass.Element(NodeXmlColumns.NODE_OWNER)?.Value(); - public bool? NodeHasChildren => _xClass.Element(NodeXmlColumns.NODE_HAS_CHILDREN)?.ValueAsBool(); - public bool? NodeHasLinks => _xClass.Element(NodeXmlColumns.NODE_HAS_LINKS)?.ValueAsBool(); - public int? NodeOriginalNodeID => _xClass.Element(NodeXmlColumns.NODE_ORIGINAL_NODE_ID)?.Value(); - public bool? NodeIsPage => _xClass.Element(NodeXmlColumns.NODE_IS_PAGE)?.ValueAsBool(); - public bool? NodeIsSecured => _xClass.Element(NodeXmlColumns.NODE_IS_SECURED)?.ValueAsBool(); - public int? DocumentID => _xClass.Element(NodeXmlColumns.DOCUMENT_ID)?.Value(); - public string? DocumentName => _xClass.Element(NodeXmlColumns.DOCUMENT_NAME)?.Value; - public DateTime? DocumentModifiedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_WHEN)?.Value(); - public int? DocumentModifiedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_BY_USER_ID)?.Value(); - public int? DocumentCreatedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_BY_USER_ID)?.Value(); - public DateTime? DocumentCreatedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_WHEN)?.Value(); - public int? DocumentCheckedOutVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID)?.Value(); - public int? DocumentPublishedVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_PUBLISHED_VERSION_HISTORY_ID)?.Value(); - public int? DocumentWorkflowStepID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_STEP_ID)?.Value(); - public string? DocumentCulture => _xClass.Element(NodeXmlColumns.DOCUMENT_CULTURE)?.Value; - public int? DocumentNodeID => _xClass.Element(NodeXmlColumns.DOCUMENT_NODE_ID)?.Value(); - public string? DocumentContent => _xClass.Element(NodeXmlColumns.DOCUMENT_CONTENT)?.Value; - public string? DocumentLastVersionNumber => _xClass.Element(NodeXmlColumns.DOCUMENT_LAST_VERSION_NUMBER)?.Value; - public bool? DocumentIsArchived => _xClass.Element(NodeXmlColumns.DOCUMENT_IS_ARCHIVED)?.ValueAsBool(); - public Guid? DocumentGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_GUID)?.Value(); - public Guid? DocumentWorkflowCycleGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_CYCLE_GUID)?.Value(); - public bool? DocumentCanBePublished => _xClass.Element(NodeXmlColumns.DOCUMENT_CAN_BE_PUBLISHED)?.ValueAsBool(); - public string? DocumentPageBuilderWidgets => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_BUILDER_WIDGETS)?.Value; - public string? ClassName => _xClass.Element(NodeXmlColumns.CLASS_NAME)?.Value; - - public string? DocumentPageTemplateConfiguration => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_TEMPLATE_CONFIGURATION)?.Value; -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs b/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs index 621e207d..6b035ae6 100644 --- a/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs +++ b/Migration.Toolkit.Core.K11/Behaviors/CommandConstraintBehavior.cs @@ -1,285 +1,109 @@ -namespace Migration.Toolkit.Core.K11.Behaviors; - -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; - -public class CommandConstraintBehavior(ILogger> logger, - IMigrationProtocol protocol, - IDbContextFactory k11ContextFactory, - ToolkitConfiguration toolkitConfiguration) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - try - { - var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - var criticalCheckPassed = PerformChecks(request, k11Context); - if (!criticalCheckPassed) - { - return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); - } - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogCritical(ex, "Error occured while checking command constraints"); - return (TResponse)(CommandResult)new CommandCheckFailedResult(false); - } - - return await next(); - } - - private bool PerformChecks(TRequest request, K11Context k11Context) - { - var criticalCheckPassed = true; - // const string supportedVersion = "12.0.20"; - // if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) - // { - // criticalCheckPassed &= CheckVersion(k11Context, minimalVersion); - // } - - // var sites = _toolkitConfiguration.RequireExplicitMapping(s => s.SiteId); - var sourceSites = k11Context.CmsSites - .Include(s => s.Cultures) - .ToList(); - - foreach (var site in sourceSites) - { - criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); - } - - if (request is ICultureReliantCommand cultureReliantCommand) - { - criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); - } - - // criticalCheckPassed &= CheckDbCollations(); - - return criticalCheckPassed; - } - - private bool CheckVersion(K11Context k11Context, SemanticVersion minimalVersion) - { - var criticalCheckPassed = true; - - #region Check conclusion methods - - void UnableToReadVersionKey(string keyName) - { - logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - ErrorKind = "Settings key value incorrect format", - SettingsKeyName = keyName, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void VersionKeyNotFound(string keyName) - { - logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - ErrorKind = "Settings key not found", - SettingsKeyName = keyName, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void UpgradeNeeded(string keyName, string currentVersion) - { - logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - CurrentVersion = currentVersion, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void LowHotfix(string keyName, int currentHotfix) - { - logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); - protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - CurrentHotfix = currentHotfix.ToString(), - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - #endregion - - if (k11Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) - { - if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDataVersion); - } - - if (k11Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) - { - if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDBVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDBVersion); - } - - if (k11Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) - { - if (int.TryParse(cmsHotfixDataVersion.KeyValue, out var version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); - } - - if (k11Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) - { - if (int.TryParse(cmsHotfixVersion.KeyValue, out var version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); - } - - return criticalCheckPassed; - } - - private bool CheckSite(List sourceSites, int sourceSiteId) - { - var criticalCheckPassed = true; - if (sourceSites.All(s => s.SiteId != sourceSiteId)) - { - var supportedSites = sourceSites.Select(x => new - { - x.SiteName, - x.SiteId - }).ToArray(); - var supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); - logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, - supportedSitesStr); - protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") - .WithMessage("Check program argument '--siteId'") - .WithData(new - { - sourceSiteId, - AvailableSites = supportedSites - })); - criticalCheckPassed = false; - } - - return criticalCheckPassed; - } - - private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) - { - var criticalCheckPassed = true; - var cultureCode = cultureReliantCommand.CultureCode; - var siteCultureLookup = sourceSites - .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); - - foreach (var site in sourceSites) - { - if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) - { - var siteCultures = value.ToArray(); - if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) - { - var supportedCultures = string.Join(", ", siteCultures); - logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); - protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") - .WithMessage("Check program argument '--culture'") - .WithData(new - { - cultureCode, - site.SiteId, - SiteCultures = supportedCultures - })); - criticalCheckPassed = false; - } - } - } - - return criticalCheckPassed; - } - - private bool CheckDbCollations() - { - var kxCollation = GetDbCollationName(toolkitConfiguration.KxConnectionString ?? throw new InvalidOperationException("KxConnectionString is required")); - var xbkCollation = GetDbCollationName(toolkitConfiguration.XbKConnectionString ?? throw new InvalidOperationException("XbKConnectionString is required")); - var collationAreSame = kxCollation == xbkCollation; - if (!collationAreSame) - { - logger.LogCritical("Source db collation '{SourceDbCollation}' is not same as target db collation {TargetDbCollation} => same collations are required", kxCollation, xbkCollation); - } - - return collationAreSame; - } - - private string? GetDbCollationName(string connectionString) - { - using var sqlConnection = new SqlConnection(connectionString); - using var sqlCommand = sqlConnection.CreateCommand(); - sqlCommand.CommandText = "SELECT DATABASEPROPERTYEX(DB_NAME(), 'Collation')"; - - sqlConnection.Open(); - return sqlCommand.ExecuteScalar() as string; - } -} \ No newline at end of file +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Behaviors; + +public class CommandConstraintBehavior( + ILogger> logger, + IMigrationProtocol protocol, + IDbContextFactory k11ContextFactory +) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + try + { + var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + bool criticalCheckPassed = PerformChecks(request, k11Context); + if (!criticalCheckPassed) + { + return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); + } + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogCritical(ex, "Error occured while checking command constraints"); + return (TResponse)(CommandResult)new CommandCheckFailedResult(false); + } + + return await next(); + } + + private bool PerformChecks(TRequest request, K11Context k11Context) + { + bool criticalCheckPassed = true; + var sourceSites = k11Context.CmsSites + .Include(s => s.Cultures) + .ToList(); + + foreach (var site in sourceSites) + { + criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); + } + + if (request is ICultureReliantCommand cultureReliantCommand) + { + criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); + } + + return criticalCheckPassed; + } + + private bool CheckSite(List sourceSites, int sourceSiteId) + { + bool criticalCheckPassed = true; + if (sourceSites.All(s => s.SiteId != sourceSiteId)) + { + var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); + string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); + logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, + supportedSitesStr); + protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") + .WithMessage("Check program argument '--siteId'") + .WithData(new { sourceSiteId, AvailableSites = supportedSites })); + criticalCheckPassed = false; + } + + return criticalCheckPassed; + } + + private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) + { + bool criticalCheckPassed = true; + string cultureCode = cultureReliantCommand.CultureCode; + var siteCultureLookup = sourceSites + .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); + + foreach (var site in sourceSites) + { + if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) + { + string[] siteCultures = value.ToArray(); + if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) + { + string supportedCultures = string.Join(", ", siteCultures); + logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, + site.SiteId, supportedCultures); + protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") + .WithMessage("Check program argument '--culture'") + .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); + criticalCheckPassed = false; + } + } + } + + return criticalCheckPassed; + } +} diff --git a/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs index 1b506353..59ee489c 100644 --- a/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs +++ b/Migration.Toolkit.Core.K11/Behaviors/RequestHandlingBehavior.cs @@ -1,36 +1,39 @@ -namespace Migration.Toolkit.Core.K11.Behaviors; - -using System.Diagnostics; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; - -public class RequestHandlingBehavior(ILogger> logger, IMigrationProtocol protocol) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - var sw = Stopwatch.StartNew(); - logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); - try - { - protocol.CommandRequest(request); - var response = await next(); - protocol.CommandFinished(request, response); - return response; - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogError(ex, "Error occured"); - throw; - } - finally - { - logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); - } - } -} \ No newline at end of file +using System.Diagnostics; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; + +namespace Migration.Toolkit.Core.K11.Behaviors; + +public class RequestHandlingBehavior(ILogger> logger, IMigrationProtocol protocol) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + var sw = Stopwatch.StartNew(); + logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); + try + { + protocol.CommandRequest(request); + var response = await next(); + protocol.CommandFinished(request, response); + return response; + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogError(ex, "Error occured"); + throw; + } + finally + { + logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); + } + } +} diff --git a/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs index 924e3727..a9c17fc3 100644 --- a/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs +++ b/Migration.Toolkit.Core.K11/Behaviors/XbKApiContextBehavior.cs @@ -1,41 +1,45 @@ -namespace Migration.Toolkit.Core.K11.Behaviors; - -using CMS.Base; -using CMS.Membership; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; - -public class XbKApiContextBehavior(ILogger> logger, - IMigrationProtocol protocol, - KxpApiInitializer initializer) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - initializer.EnsureApiIsInitialized(); - - var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); - if (defaultAdmin == null) - { - protocol.Append(HandbookReferences - .MissingRequiredDependency() - .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") - ); - throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); - } - - using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) - { - // TODO tk: 2022-11-25 revise in future - // MembershipContext.AuthenticatedUser = defaultAdmin; - - logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); - return await next(); - } - } -} \ No newline at end of file +using CMS.Base; +using CMS.Membership; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.K11.Behaviors; + +public class XbKApiContextBehavior( + ILogger> logger, + IMigrationProtocol protocol, + KxpApiInitializer initializer) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + initializer.EnsureApiIsInitialized(); + + var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); + if (defaultAdmin == null) + { + protocol.Append(HandbookReferences + .MissingRequiredDependency() + .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") + ); + throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); + } + + using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) + { + // TODO tk: 2022-11-25 revise in future + // MembershipContext.AuthenticatedUser = defaultAdmin; + + logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); + return await next(); + } + } +} diff --git a/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs index 37aca71d..ec7d1bde 100644 --- a/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs +++ b/Migration.Toolkit.Core.K11/Contexts/KeyMappingContext.cs @@ -1,33 +1,34 @@ -namespace Migration.Toolkit.Core.K11.Contexts; - -using System.Linq.Expressions; -using Migration.Toolkit.Core.K11.Services; - -public record MapSourceKeyResult(bool Success, TMapped? Mapped); - -public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) -{ - public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, - Expression> sourceGuidSelector, - object? sourceKey, - Expression> targetKeySelector, - Expression> targetGuidSelector) where TSource : class where TTarget : class - { - if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) - { - return new MapSourceKeyResult(true, targetKey); - } - - if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) - { - return new MapSourceKeyResult(true, located); - } - - return new MapSourceKeyResult(false, default); - } - - public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => - keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) - ? new MapSourceKeyResult(true, located) - : new MapSourceKeyResult(false, null); -} \ No newline at end of file +using System.Linq.Expressions; + +using Migration.Toolkit.Core.K11.Services; + +namespace Migration.Toolkit.Core.K11.Contexts; + +public record MapSourceKeyResult(bool Success, TMapped? Mapped); + +public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) +{ + public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, + Expression> sourceGuidSelector, + object? sourceKey, + Expression> targetKeySelector, + Expression> targetGuidSelector) where TSource : class where TTarget : class + { + if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) + { + return new MapSourceKeyResult(true, targetKey); + } + + if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) + { + return new MapSourceKeyResult(true, located); + } + + return new MapSourceKeyResult(false, default); + } + + public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => + keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) + ? new MapSourceKeyResult(true, located) + : new MapSourceKeyResult(false, null); +} diff --git a/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs index 4906381a..978ffd5e 100644 --- a/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs +++ b/Migration.Toolkit.Core.K11/Contexts/PrimaryKeyMappingContext.cs @@ -1,285 +1,287 @@ -namespace Migration.Toolkit.Core.K11.Contexts; - -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reflection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Core.K11.Services; - -public class PrimaryKeyMappingContext(ILogger logger, - IPrimaryKeyLocatorService primaryKeyLocatorService, - ToolkitConfiguration toolkitConfiguration) - : IPrimaryKeyMappingContext -{ - private readonly Dictionary _mappings = new(StringComparer.OrdinalIgnoreCase); - - private int? GetExplicitMappingOrNull(string memberName, int? sourceId) - { - if (sourceId == null) return null; - - var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; - if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) - { - return memberMappings.TryGetValue($"{sourceId}", out var mappedId) ? mappedId : null; - } - - return null; - } - - private static string CreateKey(Expression> keyNameSelector, int sourceId) - { - return $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; - } - - public void SetMapping(Type type, string keyName, int sourceId, int targetId) - { - Debug.Assert(sourceId > 0, "sourceId > 0"); - Debug.Assert(targetId > 0, "targetId > 0"); - - var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); - - Debug.Assert(foundProp != null, "foundProp != null"); - - var fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; - - _mappings[fullKeyName] = targetId; - logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); - } - - public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - var fullKeyName = CreateKey(keyNameSelector, sourceId); - _mappings[fullKeyName] = targetId; - logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); - } - - public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) - { - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sourceId); - if (sourceId == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out var targetId)) - { - SetMapping(keyNameSelector, sourceId, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) - { - targetIdResult = -1; - if (!(sourceId is int sid)) - { - return false; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - targetIdResult = explicitlyMappedId; - return true; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - targetIdResult = resultId; - return true; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - targetIdResult = targetId; - return true; - } - - return false; - } - - public int? MapFromSource(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, $"Target entity is missing"); - } - - public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - return null; - } - - public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return new MapSourceIdResult(true, null); - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return new MapSourceIdResult(true, null); - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return new MapSourceIdResult(true, explicitlyMappedId); - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return new MapSourceIdResult(true, resultId); - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return new MapSourceIdResult(true, targetId); - } - - return new MapSourceIdResult(false, null); - } - - public void PreloadDependencies(Expression> keyNameSelector) - { - foreach (var (sourceId, targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) - { - SetMapping(keyNameSelector, sourceId, targetId); - } - } - - public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return true; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - return true; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { }) - { - return true; - } - - if (_mappings.TryGetValue(fullKeyName, out _)) - { - return true; - } - - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) - { - return true; - } - - return false; - } -} \ No newline at end of file +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Core.K11.Services; + +namespace Migration.Toolkit.Core.K11.Contexts; + +public class PrimaryKeyMappingContext( + ILogger logger, + IPrimaryKeyLocatorService primaryKeyLocatorService, + ToolkitConfiguration toolkitConfiguration) + : IPrimaryKeyMappingContext +{ + private readonly Dictionary mappingCache = new(StringComparer.OrdinalIgnoreCase); + + public void SetMapping(Type type, string keyName, int sourceId, int targetId) + { + Debug.Assert(sourceId > 0, "sourceId > 0"); + Debug.Assert(targetId > 0, "targetId > 0"); + + var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); + + Debug.Assert(foundProp != null, "foundProp != null"); + + string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; + + mappingCache[fullKeyName] = targetId; + logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); + } + + public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) + { + string fullKeyName = CreateKey(keyNameSelector, sourceId); + mappingCache[fullKeyName] = targetId; + logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); + } + + public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) + { + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sourceId); + if (sourceId == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) + { + SetMapping(keyNameSelector, sourceId, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) + { + targetIdResult = -1; + if (sourceId is not int sid) + { + return false; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + targetIdResult = explicitlyMappedId; + return true; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + targetIdResult = resultId; + return true; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + targetIdResult = targetId; + return true; + } + + return false; + } + + public int? MapFromSource(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + return null; + } + + public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return new MapSourceIdResult(true, null); + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return new MapSourceIdResult(true, null); + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return new MapSourceIdResult(true, explicitlyMappedId); + } + + if (mappingCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return new MapSourceIdResult(true, resultId); + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return new MapSourceIdResult(true, targetId); + } + + return new MapSourceIdResult(false, null); + } + + public void PreloadDependencies(Expression> keyNameSelector) + { + foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) + { + SetMapping(keyNameSelector, sourceId, targetId); + } + } + + public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + return true; + } + + if (GetExplicitMappingOrNull(memberName, sid) is not null) + { + return true; + } + + if (mappingCache.TryGetValue(fullKeyName, out _)) + { + return true; + } + + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) + { + return true; + } + + return false; + } + + private int? GetExplicitMappingOrNull(string memberName, int? sourceId) + { + if (sourceId == null) + { + return null; + } + + var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; + if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) + { + return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; + } + + return null; + } + + private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; +} diff --git a/Migration.Toolkit.Core.K11/Contexts/SourceInstanceContext.cs b/Migration.Toolkit.Core.K11/Contexts/SourceInstanceContext.cs deleted file mode 100644 index 7fbf5404..00000000 --- a/Migration.Toolkit.Core.K11/Contexts/SourceInstanceContext.cs +++ /dev/null @@ -1,99 +0,0 @@ -namespace Migration.Toolkit.Core.K11.Contexts; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.K11; - -public class SourceInstanceContext(IpcService ipcService, IDbContextFactory k11ContextFactory, ILogger logger, - ToolkitConfiguration configuration) -{ - private readonly Dictionary _cachedInfos = new(StringComparer.InvariantCultureIgnoreCase); - - private bool _sourceInfoLoaded; - - public bool HasInfo => _cachedInfos.Count > 0 && _sourceInfoLoaded; - - public bool IsQuerySourceInstanceEnabled() - { - return configuration.OptInFeatures?.QuerySourceInstanceApi?.Enabled ?? false; - } - - public async Task RequestSourceInstanceInfo() - { - if (!_sourceInfoLoaded) - { - var result = await ipcService.GetSourceInstanceDiscoveredInfos(); - foreach (var (key, value) in result) - { - _cachedInfos.Add(key, value); - logger.LogInformation("Source instance info loaded for site '{SiteName}' successfully", key); - } - - _sourceInfoLoaded = true; - } - - return _sourceInfoLoaded; - } - - public List? GetWidgetPropertyFormComponents(string siteName, string widgetIdentifier) - { - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.WidgetProperties != null && info.WidgetProperties.TryGetValue(widgetIdentifier, out var widgetProperties) - ? widgetProperties - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - - public List? GetPageTemplateFormComponents(string siteName, string pageTemplateIdentifier) - { - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.PageTemplateProperties != null && info.PageTemplateProperties.TryGetValue(pageTemplateIdentifier, out var pageTemplate) - ? pageTemplate - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - - public List? GetWidgetPropertyFormComponents(int siteId, string widgetIdentifier) - { - var context = k11ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - return GetWidgetPropertyFormComponents(siteName, widgetIdentifier); - } - - public List? GetPageTemplateFormComponents(int siteId, string pageTemplateIdentifier) - { - var context = k11ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - return GetPageTemplateFormComponents(siteName, pageTemplateIdentifier); - } - - public List? GetSectionFormComponents(int siteId, string sectionIdentifier) - { - var context = k11ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.SectionProperties != null && info.SectionProperties.TryGetValue(sectionIdentifier, out var sectionFcs) - ? sectionFcs - : null; - } - else - { - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.K11/Exceptions.cs b/Migration.Toolkit.Core.K11/Exceptions.cs index 8e272ff5..a111bc02 100644 --- a/Migration.Toolkit.Core.K11/Exceptions.cs +++ b/Migration.Toolkit.Core.K11/Exceptions.cs @@ -1,7 +1,7 @@ -namespace Migration.Toolkit.Core.K11; - -public class MappingFailureException(string keyName, string reason) : InvalidOperationException($"Key '{keyName}' mapping failed: {reason}") -{ - public string KeyName { get; } = keyName; - public string Reason { get; } = reason; -} \ No newline at end of file +namespace Migration.Toolkit.Core.K11; + +public class MappingFailureException(string keyName, string reason) : InvalidOperationException($"Key '{keyName}' mapping failed: {reason}") +{ + public string KeyName { get; } = keyName; + public string Reason { get; } = reason; +} diff --git a/Migration.Toolkit.Core.K11/GlobalUsings.cs b/Migration.Toolkit.Core.K11/GlobalUsings.cs index 1d1f2495..871318d2 100644 --- a/Migration.Toolkit.Core.K11/GlobalUsings.cs +++ b/Migration.Toolkit.Core.K11/GlobalUsings.cs @@ -1,2 +1 @@ -global using System; -global using Migration.Toolkit; \ No newline at end of file +global using System; diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs index 209658b7..57444e3b 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateContactManagementCommandHandler.cs @@ -1,366 +1,388 @@ -namespace Migration.Toolkit.Core.K11.Handlers; - -using CMS.Activities; -using CMS.ContactManagement; -using CMS.ContentEngine; -using CMS.Websites.Internal; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.Core.K11.Services; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; - -public class MigrateContactManagementCommandHandler(ILogger logger, - IDbContextFactory kxpContextFactory, - BulkDataCopyService bulkDataCopyService, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - KeyMappingContext keyMappingContext, - CountryMigrator countryMigrator, - KxpClassFacade kxpClassFacade, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private readonly KxpContext _kxpContext = kxpContextFactory.CreateDbContext(); - - public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) - { - countryMigrator.MigrateCountriesAndStates(); - - if (MigrateContacts() is { } ccr) return Task.FromResult(ccr); - if (MigrateContactActivities() is { } acr) return Task.FromResult(acr); - - return Task.FromResult(new GenericCommandResult()); - } - - #region "Migrate contacts" - - private CommandResult? MigrateContacts() - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(OmContact.ContactId), nameof(KXP.Models.OmContact.ContactId) }, - { nameof(OmContact.ContactFirstName), nameof(KXP.Models.OmContact.ContactFirstName) }, - { nameof(OmContact.ContactMiddleName), nameof(KXP.Models.OmContact.ContactMiddleName) }, - { nameof(OmContact.ContactLastName), nameof(KXP.Models.OmContact.ContactLastName) }, - { nameof(OmContact.ContactJobTitle), nameof(KXP.Models.OmContact.ContactJobTitle) }, - { nameof(OmContact.ContactAddress1), nameof(KXP.Models.OmContact.ContactAddress1) }, - { nameof(OmContact.ContactCity), nameof(KXP.Models.OmContact.ContactCity) }, - { nameof(OmContact.ContactZip), nameof(KXP.Models.OmContact.ContactZip) }, - { nameof(OmContact.ContactStateId), nameof(KXP.Models.OmContact.ContactStateId) }, - { nameof(OmContact.ContactCountryId), nameof(KXP.Models.OmContact.ContactCountryId) }, - { nameof(OmContact.ContactMobilePhone), nameof(KXP.Models.OmContact.ContactMobilePhone) }, - { nameof(OmContact.ContactBusinessPhone), nameof(KXP.Models.OmContact.ContactBusinessPhone) }, - { nameof(OmContact.ContactEmail), nameof(KXP.Models.OmContact.ContactEmail) }, - // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, - { nameof(OmContact.ContactGender), nameof(KXP.Models.OmContact.ContactGender) }, - // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint - { nameof(OmContact.ContactNotes), nameof(KXP.Models.OmContact.ContactNotes) }, - { nameof(OmContact.ContactOwnerUserId), nameof(KXP.Models.OmContact.ContactOwnerUserId) }, - // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, - { nameof(OmContact.ContactGuid), nameof(KXP.Models.OmContact.ContactGuid) }, - { nameof(OmContact.ContactLastModified), nameof(KXP.Models.OmContact.ContactLastModified) }, - { nameof(OmContact.ContactCreated), nameof(KXP.Models.OmContact.ContactCreated) }, - // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, - { nameof(OmContact.ContactCampaign), nameof(KXP.Models.OmContact.ContactCampaign) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, - { nameof(OmContact.ContactCompanyName), nameof(KXP.Models.OmContact.ContactCompanyName) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) - { - protocol.Append(HandbookReferences - .BulkCopyColumnMismatch("OM_Contact") - .NeedsManualAction() - .WithData(differences) - ); - logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); - { - return new CommandFailureResult(); - } - } - - primaryKeyMappingContext.PreloadDependencies(u => u.UserId); - primaryKeyMappingContext.PreloadDependencies(u => u.StateId); - primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); - - var bulkCopyRequest = new BulkCopyRequest("OM_Contact", - s => true,// s => s != "ContactID", - _ => true, - 50000, - requiredColumnsForContactMigration.Keys.ToList(), - ContactValueInterceptor, - current => { logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)); }, - "ContactID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate contacts"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) - { - // autofix removed in favor of error report and data consistency - // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); - // return new ValueInterceptorResult(truncatedValue, true, false); - - if (value is string { Length: > 100 } s) - { - protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") - .WithData(new { value, maxLength = 100, s.Length, columnName, contact = PrintHelper.PrintDictionary(currentRow) }) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - // try search member - if (keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - sourceUserId, - t => t.MemberId, - t => t.MemberGuid - ) is { Success: true, Mapped: { } memberId }) - { - return ValueInterceptorResult.ReplaceValue(memberId); - } - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - #region "Migrate contact activities" - - private CommandResult? MigrateContactActivities() //(List migratedSiteIds) - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(OmActivity.ActivityId), nameof(KXP.Models.OmActivity.ActivityId) }, - { nameof(OmActivity.ActivityContactId), nameof(KXP.Models.OmActivity.ActivityContactId) }, - { nameof(OmActivity.ActivityCreated), nameof(KXP.Models.OmActivity.ActivityCreated) }, - { nameof(OmActivity.ActivityType), nameof(KXP.Models.OmActivity.ActivityType) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, - { nameof(OmActivity.ActivityValue), nameof(KXP.Models.OmActivity.ActivityValue) }, - { nameof(OmActivity.ActivityUrl), nameof(KXP.Models.OmActivity.ActivityUrl) }, - { nameof(OmActivity.ActivityTitle), nameof(KXP.Models.OmActivity.ActivityTitle) }, - { nameof(OmActivity.ActivitySiteId), nameof(KXP.Models.OmActivity.ActivityChannelId) }, - { nameof(OmActivity.ActivityComment), nameof(KXP.Models.OmActivity.ActivityComment) }, - // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 - { nameof(OmActivity.ActivityUrlreferrer), nameof(KXP.Models.OmActivity.ActivityUrlreferrer) }, - { nameof(OmActivity.ActivityCulture), nameof(KXP.Models.OmActivity.ActivityLanguageId) }, - { nameof(OmActivity.ActivityNodeId), nameof(KXP.Models.OmActivity.ActivityWebPageItemGuid) }, - { nameof(OmActivity.ActivityUtmsource), nameof(KXP.Models.OmActivity.ActivityUtmsource) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, - // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, - { nameof(OmActivity.ActivityUtmcontent), nameof(KXP.Models.OmActivity.ActivityUtmcontent) }, - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - // _primaryKeyMappingContext.PreloadDependencies(u => u.NodeId); - // no need to preload contact, ID should stay same - // _primaryKeyMappingContext.PreloadDependencies(u => u.ContactId); - - var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", - s => true,// s => s != "ActivityID", - reader => true, - 50000, - requiredColumnsForContactMigration, - ActivityValueInterceptor, - current => { logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)); }, - "ActivityID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate activities"); - return new CommandFailureResult(); - } - return null; - } - - private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && - value is int sourceActivitySiteId) - { - var result = keyMappingContext.MapSourceKey( - s => s.SiteId, - s => s.SiteGuid, - sourceActivitySiteId.NullIfZero(), - t => t.ChannelId, - t => t.ChannelGuid - ); - switch (result) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id ?? 0); - case { Success: false }: - { - switch (toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); - return ValueInterceptorResult.ReplaceValue(0); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - } - } - - if (columnName.Equals(nameof(OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) - { - var result = keyMappingContext.MapSourceKey( - s => s.NodeId, - s => s.NodeGuid, - activityNodeId.NullIfZero(), t => t.WebPageItemGuid, t => t.WebPageItemGuid); - switch (result) - { - case (true, var guid): - return ValueInterceptorResult.ReplaceValue(guid); - case { Success: false }: - { - switch (toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); - return ValueInterceptorResult.ReplaceValue(null); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - } - } - - if (columnName.Equals(nameof(KXP.Models.OmActivity.ActivityLanguageId), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) - { - return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); - } - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file +using CMS.Activities; +using CMS.ContactManagement; +using CMS.ContentEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.Core.K11.Helpers; +using Migration.Toolkit.Core.K11.Services; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.K11.Handlers; + +public class MigrateContactManagementCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + BulkDataCopyService bulkDataCopyService, + ToolkitConfiguration toolkitConfiguration, + PrimaryKeyMappingContext primaryKeyMappingContext, + KeyMappingContext keyMappingContext, + CountryMigrator countryMigrator, + KxpClassFacade kxpClassFacade, + ISpoiledGuidContext spoiledGuidContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); + + public void Dispose() => kxpContext.Dispose(); + + public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) + { + countryMigrator.MigrateCountriesAndStates(); + + if (MigrateContacts() is { } ccr) + { + return Task.FromResult(ccr); + } + + if (MigrateContactActivities() is { } acr) + { + return Task.FromResult(acr); + } + + return Task.FromResult(new GenericCommandResult()); + } + + #region "Migrate contacts" + + private CommandResult? MigrateContacts() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(Toolkit.K11.Models.OmContact.ContactId), nameof(KXP.Models.OmContact.ContactId) }, + { nameof(Toolkit.K11.Models.OmContact.ContactFirstName), nameof(KXP.Models.OmContact.ContactFirstName) }, + { nameof(Toolkit.K11.Models.OmContact.ContactMiddleName), nameof(KXP.Models.OmContact.ContactMiddleName) }, + { nameof(Toolkit.K11.Models.OmContact.ContactLastName), nameof(KXP.Models.OmContact.ContactLastName) }, + { nameof(Toolkit.K11.Models.OmContact.ContactJobTitle), nameof(KXP.Models.OmContact.ContactJobTitle) }, + { nameof(Toolkit.K11.Models.OmContact.ContactAddress1), nameof(KXP.Models.OmContact.ContactAddress1) }, + { nameof(Toolkit.K11.Models.OmContact.ContactCity), nameof(KXP.Models.OmContact.ContactCity) }, + { nameof(Toolkit.K11.Models.OmContact.ContactZip), nameof(KXP.Models.OmContact.ContactZip) }, + { nameof(Toolkit.K11.Models.OmContact.ContactStateId), nameof(KXP.Models.OmContact.ContactStateId) }, + { nameof(Toolkit.K11.Models.OmContact.ContactCountryId), nameof(KXP.Models.OmContact.ContactCountryId) }, + { nameof(Toolkit.K11.Models.OmContact.ContactMobilePhone), nameof(KXP.Models.OmContact.ContactMobilePhone) }, + { nameof(Toolkit.K11.Models.OmContact.ContactBusinessPhone), nameof(KXP.Models.OmContact.ContactBusinessPhone) }, + { nameof(Toolkit.K11.Models.OmContact.ContactEmail), nameof(KXP.Models.OmContact.ContactEmail) }, + // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, + { nameof(Toolkit.K11.Models.OmContact.ContactGender), nameof(KXP.Models.OmContact.ContactGender) }, + // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint + { nameof(Toolkit.K11.Models.OmContact.ContactNotes), nameof(KXP.Models.OmContact.ContactNotes) }, + { nameof(Toolkit.K11.Models.OmContact.ContactOwnerUserId), nameof(KXP.Models.OmContact.ContactOwnerUserId) }, + // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, + { nameof(Toolkit.K11.Models.OmContact.ContactGuid), nameof(KXP.Models.OmContact.ContactGuid) }, + { nameof(Toolkit.K11.Models.OmContact.ContactLastModified), nameof(KXP.Models.OmContact.ContactLastModified) }, + { nameof(Toolkit.K11.Models.OmContact.ContactCreated), nameof(KXP.Models.OmContact.ContactCreated) }, + // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, + { nameof(Toolkit.K11.Models.OmContact.ContactCampaign), nameof(KXP.Models.OmContact.ContactCampaign) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, + { nameof(Toolkit.K11.Models.OmContact.ContactCompanyName), nameof(KXP.Models.OmContact.ContactCompanyName) } + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) + { + protocol.Append(HandbookReferences + .BulkCopyColumnMismatch("OM_Contact") + .NeedsManualAction() + .WithData(differences) + ); + logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); + { + return new CommandFailureResult(); + } + } + + primaryKeyMappingContext.PreloadDependencies(u => u.UserId); + primaryKeyMappingContext.PreloadDependencies(u => u.StateId); + primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); + + var bulkCopyRequest = new BulkCopyRequest("OM_Contact", + s => true, // s => s != "ContactID", + _ => true, + 50000, + requiredColumnsForContactMigration.Keys.ToList(), + ContactValueInterceptor, + current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), + "ContactID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate contacts"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) + { + // autofix removed in favor of error report and data consistency + // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); + // return new ValueInterceptorResult(truncatedValue, true, false); + + if (value is string { Length: > 100 } s) + { + protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") + .WithData(new + { + value, + maxLength = 100, + s.Length, + columnName, + contact = PrintHelper.PrintDictionary(currentRow) + }) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(KXP.Models.OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + // try search member + if (keyMappingContext.MapSourceKey( + s => s.UserId, + s => s.UserGuid, + sourceUserId, + t => t.MemberId, + t => t.MemberGuid + ) is { Success: true, Mapped: { } memberId }) + { + return ValueInterceptorResult.ReplaceValue(memberId); + } + + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(KXP.Models.OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + + return ValueInterceptorResult.DoNothing; + } + + #endregion + + #region "Migrate contact activities" + + private CommandResult? MigrateContactActivities() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(Toolkit.K11.Models.OmActivity.ActivityId), nameof(KXP.Models.OmActivity.ActivityId) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityContactId), nameof(KXP.Models.OmActivity.ActivityContactId) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityCreated), nameof(KXP.Models.OmActivity.ActivityCreated) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityType), nameof(KXP.Models.OmActivity.ActivityType) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityValue), nameof(KXP.Models.OmActivity.ActivityValue) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityUrl), nameof(KXP.Models.OmActivity.ActivityUrl) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityTitle), nameof(KXP.Models.OmActivity.ActivityTitle) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivitySiteId), nameof(KXP.Models.OmActivity.ActivityChannelId) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityComment), nameof(KXP.Models.OmActivity.ActivityComment) }, + // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 + { nameof(Toolkit.K11.Models.OmActivity.ActivityUrlreferrer), nameof(KXP.Models.OmActivity.ActivityUrlreferrer) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityCulture), nameof(KXP.Models.OmActivity.ActivityLanguageId) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityNodeId), nameof(KXP.Models.OmActivity.ActivityWebPageItemGuid) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityUtmsource), nameof(KXP.Models.OmActivity.ActivityUtmsource) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, + // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, + { nameof(Toolkit.K11.Models.OmActivity.ActivityUtmcontent), nameof(KXP.Models.OmActivity.ActivityUtmcontent) } + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", + s => true, // s => s != "ActivityID", + reader => true, + 50000, + requiredColumnsForContactMigration, + ActivityValueInterceptor, + current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), + "ActivityID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate activities"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(Toolkit.K11.Models.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && + value is int sourceActivitySiteId) + { + var result = keyMappingContext.MapSourceKey( + s => s.SiteId, + s => s.SiteGuid, + sourceActivitySiteId.NullIfZero(), + t => t.ChannelId, + t => t.ChannelGuid + ); + switch (result) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id ?? 0); + case { Success: false }: + { + switch (toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); + return ValueInterceptorResult.ReplaceValue(0); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + default: + break; + } + } + + if (columnName.Equals(nameof(Toolkit.K11.Models.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) + { + if (currentRow.TryGetValue(nameof(Toolkit.K11.Models.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) + { + if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) + { + return ValueInterceptorResult.ReplaceValue(nodeGuid); + } + } + + switch (toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); + return ValueInterceptorResult.ReplaceValue(null); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(KXP.Models.OmActivity.ActivityLanguageId), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) + { + return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); + } + + return ValueInterceptorResult.DoNothing; + } + + #endregion +} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs index eacd885a..b0f2cef1 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateDataProtectionCommandHandler.cs @@ -1,284 +1,281 @@ -namespace Migration.Toolkit.Core.K11.Handlers; - -using CMS.DataProtection; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Context; - -public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _k11ContextFactory; - private readonly IEntityMapper _consentMapper; - private readonly IEntityMapper _consentArchiveMapper; - private readonly IEntityMapper _consentAgreementMapper; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - - private KxpContext _kxpContext; - - private static readonly int _batchSize = 1000; - - public MigrateDataProtectionCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory k11ContextFactory, - IEntityMapper consentMapper, - IEntityMapper consentArchiveMapper, - IEntityMapper consentAgreementMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _k11ContextFactory = k11ContextFactory; - _consentMapper = consentMapper; - _consentArchiveMapper = consentArchiveMapper; - _consentAgreementMapper = consentAgreementMapper; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - _kxpContext = _kxpContextFactory.CreateDbContext(); - } - - public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) - { - var batchSize = _batchSize; - - await MigrateConsent(cancellationToken); - await MigrateConsentArchive(cancellationToken); - await MigrateConsentAgreement(cancellationToken, batchSize); - - return new GenericCommandResult(); - } - - private async Task MigrateConsent(CancellationToken cancellationToken) - { - await using var k11Context = await _k11ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var k11Consent in k11Context.CmsConsents) - { - _protocol.FetchedSource(k11Consent); - _logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", k11Consent.ConsentName, k11Consent.ConsentGuid); - - var kxoConsent = await _kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == k11Consent.ConsentGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsent); - - var mapped = _consentMapper.Map(k11Consent, kxoConsent); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsent, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); - - if (newInstance) - { - _kxpContext.CmsConsents.Add(cmsConsent); - } - else - { - _kxpContext.CmsConsents.Update(cmsConsent); - } - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - _protocol.Success(k11Consent, cmsConsent, mapped); - _logger.LogEntitySetAction(newInstance, cmsConsent); - _primaryKeyMappingContext.SetMapping(r => r.ConsentId, k11Consent.ConsentId, cmsConsent.ConsentId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - _logger.LogEntitySetError(sqlException, newInstance, k11Consent); - _protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, k11Consent) - .WithMessage("Failed to migrate consent, target database constraint broken.") - ); - - await _kxpContext.DisposeAsync(); - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentArchive(CancellationToken cancellationToken) - { - await using var k11Context = await _k11ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var k11ArchiveConsent in k11Context.CmsConsentArchives) - { - _protocol.FetchedSource(k11ArchiveConsent); - _logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", k11ArchiveConsent.ConsentArchiveGuid); - - var kxoConsentArchive = await _kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == k11ArchiveConsent.ConsentArchiveGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsentArchive); - - var mapped = _consentArchiveMapper.Map(k11ArchiveConsent, kxoConsentArchive); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsentArchive, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); - - if (newInstance) - { - _kxpContext.CmsConsentArchives.Add(cmsConsentArchive); - } - else - { - _kxpContext.CmsConsentArchives.Update(cmsConsentArchive); - } - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - _protocol.Success(k11ArchiveConsent, cmsConsentArchive, mapped); - _logger.LogEntitySetAction(newInstance, cmsConsentArchive); - _primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, - k11ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - _logger.LogEntitySetError(sqlException, newInstance, k11ArchiveConsent); - _protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, k11ArchiveConsent) - .WithMessage("Failed to migrate consent archive, target database constraint broken.") - ); - - await _kxpContext.DisposeAsync(); - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) - { - await using var k11Context = await _k11ContextFactory.CreateDbContextAsync(cancellationToken); - var index = 0; - var indexFull = 0; - var consentAgreementUpdates = new List(); - var consentAgreementNews = new List(); - var itemsCount = k11Context.CmsConsentAgreements.Count(); - - foreach (var k11ConsentAgreement in k11Context.CmsConsentAgreements) - { - _protocol.FetchedSource(k11ConsentAgreement); - _logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", k11ConsentAgreement.ConsentAgreementGuid); - - var kxoConsentAgreement = await _kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == k11ConsentAgreement.ConsentAgreementGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsentAgreement); - - var mapped = _consentAgreementMapper.Map(k11ConsentAgreement, kxoConsentAgreement); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsentAgreement, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); - - if (newInstance) - { - consentAgreementNews.Add(cmsConsentAgreement); - } - else - { - consentAgreementUpdates.Add(cmsConsentAgreement); - } - } - - index++; - indexFull++; - - if (index == batchSize || indexFull == itemsCount) - { - _kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); - _kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - foreach (var newK11ConsentAgreement in consentAgreementNews) - { - _protocol.Success(k11ConsentAgreement, newK11ConsentAgreement, mapped); - _logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", - newK11ConsentAgreement.ConsentAgreementGuid); - } - - foreach (var updateK11ConsentAgreement in consentAgreementUpdates) - { - _protocol.Success(k11ConsentAgreement, updateK11ConsentAgreement, mapped); - _logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", - updateK11ConsentAgreement.ConsentAgreementGuid); - } - } - catch (DbUpdateException dbUpdateException) when ( - dbUpdateException.InnerException is SqlException sqlException && - sqlException.Message.Contains("Cannot insert duplicate key row in object") - ) - { - await _kxpContext.DisposeAsync(); - - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementNews) - ); - _logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); - - - _protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementUpdates) - ); - - var cai = ConsentAgreementInfo.New(); - _protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrint(cai) - ); - - _logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); - - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - finally - { - index = 0; - consentAgreementUpdates = new List(); - consentAgreementNews = new List(); - } - } - } - - return new GenericCommandResult(); - } - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file +using CMS.DataProtection; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Context; + +namespace Migration.Toolkit.Core.K11.Handlers; + +public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable +{ + private static readonly int batchSize = 1000; + private readonly IEntityMapper consentAgreementMapper; + private readonly IEntityMapper consentArchiveMapper; + private readonly IEntityMapper consentMapper; + private readonly IDbContextFactory k11ContextFactory; + private readonly IDbContextFactory kxpContextFactory; + private readonly ILogger logger; + private readonly PrimaryKeyMappingContext primaryKeyMappingContext; + private readonly IProtocol protocol; + + private KxpContext kxpContext; + + public MigrateDataProtectionCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory k11ContextFactory, + IEntityMapper consentMapper, + IEntityMapper consentArchiveMapper, + IEntityMapper consentAgreementMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) + { + this.logger = logger; + this.kxpContextFactory = kxpContextFactory; + this.k11ContextFactory = k11ContextFactory; + this.consentMapper = consentMapper; + this.consentArchiveMapper = consentArchiveMapper; + this.consentAgreementMapper = consentAgreementMapper; + this.primaryKeyMappingContext = primaryKeyMappingContext; + this.protocol = protocol; + kxpContext = this.kxpContextFactory.CreateDbContext(); + } + + public void Dispose() => kxpContext.Dispose(); + + public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) + { + await MigrateConsent(cancellationToken); + await MigrateConsentArchive(cancellationToken); + await MigrateConsentAgreement(cancellationToken, batchSize); + + return new GenericCommandResult(); + } + + private async Task MigrateConsent(CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var k11Consent in k11Context.CmsConsents) + { + protocol.FetchedSource(k11Consent); + logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", k11Consent.ConsentName, k11Consent.ConsentGuid); + + var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == k11Consent.ConsentGuid, cancellationToken); + protocol.FetchedTarget(kxoConsent); + + var mapped = consentMapper.Map(k11Consent, kxoConsent); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsent, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); + + if (newInstance) + { + kxpContext.CmsConsents.Add(cmsConsent); + } + else + { + kxpContext.CmsConsents.Update(cmsConsent); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(k11Consent, cmsConsent, mapped); + logger.LogEntitySetAction(newInstance, cmsConsent); + primaryKeyMappingContext.SetMapping(r => r.ConsentId, k11Consent.ConsentId, cmsConsent.ConsentId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, k11Consent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, k11Consent) + .WithMessage("Failed to migrate consent, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentArchive(CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var k11ArchiveConsent in k11Context.CmsConsentArchives) + { + protocol.FetchedSource(k11ArchiveConsent); + logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", k11ArchiveConsent.ConsentArchiveGuid); + + var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == k11ArchiveConsent.ConsentArchiveGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentArchive); + + var mapped = consentArchiveMapper.Map(k11ArchiveConsent, kxoConsentArchive); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentArchive, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); + + if (newInstance) + { + kxpContext.CmsConsentArchives.Add(cmsConsentArchive); + } + else + { + kxpContext.CmsConsentArchives.Update(cmsConsentArchive); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(k11ArchiveConsent, cmsConsentArchive, mapped); + logger.LogEntitySetAction(newInstance, cmsConsentArchive); + primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, + k11ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, k11ArchiveConsent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, k11ArchiveConsent) + .WithMessage("Failed to migrate consent archive, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + int index = 0; + int indexFull = 0; + var consentAgreementUpdates = new List(); + var consentAgreementNews = new List(); + int itemsCount = k11Context.CmsConsentAgreements.Count(); + + foreach (var k11ConsentAgreement in k11Context.CmsConsentAgreements) + { + protocol.FetchedSource(k11ConsentAgreement); + logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", k11ConsentAgreement.ConsentAgreementGuid); + + var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == k11ConsentAgreement.ConsentAgreementGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentAgreement); + + var mapped = consentAgreementMapper.Map(k11ConsentAgreement, kxoConsentAgreement); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentAgreement, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); + + if (newInstance) + { + consentAgreementNews.Add(cmsConsentAgreement); + } + else + { + consentAgreementUpdates.Add(cmsConsentAgreement); + } + } + + index++; + indexFull++; + + if (index == batchSize || indexFull == itemsCount) + { + kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); + kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + foreach (var newK11ConsentAgreement in consentAgreementNews) + { + protocol.Success(k11ConsentAgreement, newK11ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", + newK11ConsentAgreement.ConsentAgreementGuid); + } + + foreach (var updateK11ConsentAgreement in consentAgreementUpdates) + { + protocol.Success(k11ConsentAgreement, updateK11ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", + updateK11ConsentAgreement.ConsentAgreementGuid); + } + } + catch (DbUpdateException dbUpdateException) when ( + dbUpdateException.InnerException is SqlException sqlException && + sqlException.Message.Contains("Cannot insert duplicate key row in object") + ) + { + await kxpContext.DisposeAsync(); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementNews) + ); + logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); + + + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementUpdates) + ); + + var cai = ConsentAgreementInfo.New(); + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrint(cai) + ); + + logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); + + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + finally + { + index = 0; + consentAgreementUpdates = []; + consentAgreementNews = []; + } + } + } + + return new GenericCommandResult(); + } +} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs index 4e5bbb4d..057f97f3 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateMembersCommandHandler.cs @@ -1,104 +1,104 @@ -namespace Migration.Toolkit.Core.K11.Handlers; - -using System.Diagnostics; -using CMS.Membership; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Mappers; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api.Enums; - -public class MigrateMembersCommandHandler(ILogger logger, - IDbContextFactory k11ContextFactory, - IEntityMapper memberInfoMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - private static int[] MigratedAdminUserPrivilegeLevels => [(int)UserPrivilegeLevelEnum.None]; - - public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - var k11CmsUsers = k11Context.CmsUsers - .Include(u => u.CmsUserSettingUserSettingsUserNavigation) - .Where(u => MigratedAdminUserPrivilegeLevels.Contains(u.UserPrivilegeLevel)) - ; - - foreach (var k11User in k11CmsUsers) - { - protocol.FetchedSource(k11User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", k11User.UserName, k11User.UserGuid); - - var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(k11User.UserGuid); - - protocol.FetchedTarget(xbkMemberInfo); - - - if (xbkMemberInfo?.MemberName == USER_PUBLIC || k11User.UserName == USER_PUBLIC) - { - continue; - } - - var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(k11User, k11User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); - protocol.MappedTarget(mapped); - - SaveUserUsingKenticoApi(mapped, k11User); - } - - return new GenericCommandResult(); - } - - private void SaveUserUsingKenticoApi(IModelMappingResult mapped, CmsUser k11User) - { - if (mapped is { Success: true } result) - { - var (memberInfo, newInstance) = result; - ArgumentNullException.ThrowIfNull(memberInfo); - - try - { - MemberInfoProvider.ProviderObject.Set(memberInfo); - - protocol.Success(k11User, memberInfo, mapped); - logger.LogEntitySetAction(newInstance, memberInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, memberInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k11User) - .WithData(new { k11User.UserName, k11User.UserGuid, k11User.UserId, }) - .WithMessage("Failed to migrate user, target database broken.") - ); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, memberInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(memberInfo) - ); - } - - // left for OM_Activity - primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, memberInfo.MemberID); - } - } - - public void Dispose() - { - - } -} \ No newline at end of file +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.Core.K11.Mappers; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Api.Auxiliary; + +namespace Migration.Toolkit.Core.K11.Handlers; + +public class MigrateMembersCommandHandler( + ILogger logger, + IDbContextFactory k11ContextFactory, + IEntityMapper memberInfoMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + var k11CmsUsers = k11Context.CmsUsers + .Include(u => u.CmsUserSettingUserSettingsUserNavigation) + .Where(u => UserHelper.PrivilegeLevelsMigratedAsMemberUser.Contains(u.UserPrivilegeLevel)) + ; + + foreach (var k11User in k11CmsUsers) + { + protocol.FetchedSource(k11User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", k11User.UserName, k11User.UserGuid); + + var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(k11User.UserGuid); + + protocol.FetchedTarget(xbkMemberInfo); + + + if (xbkMemberInfo?.MemberName == USER_PUBLIC || k11User.UserName == USER_PUBLIC) + { + continue; + } + + var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(k11User, k11User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, k11User); + } + + return new GenericCommandResult(); + } + + private void SaveUserUsingKenticoApi(IModelMappingResult mapped, CmsUser k11User) + { + if (mapped is { Success: true } result) + { + (var memberInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(memberInfo); + + try + { + MemberInfoProvider.ProviderObject.Set(memberInfo); + + protocol.Success(k11User, memberInfo, mapped); + logger.LogEntitySetAction(newInstance, memberInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, memberInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k11User) + .WithData(new { k11User.UserName, k11User.UserGuid, k11User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, memberInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(memberInfo) + ); + } + + // left for OM_Activity + primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, memberInfo.MemberID); + } + } +} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs index a28a56c8..4186d84f 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateSettingKeysCommandHandler.cs @@ -1,89 +1,85 @@ -namespace Migration.Toolkit.Core.K11.Handlers; - -using CMS.DataEngine; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; - -public class MigrateSettingKeysCommandHandler(ILogger logger, - IEntityMapper mapper, - IDbContextFactory k11ContextFactory, - ToolkitConfiguration toolkitConfiguration, - IProtocol protocol) - : IRequestHandler -{ - public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - logger.LogInformation("CmsSettingsKey synchronization starting"); - var cmsSettingsKeys = k11Context.CmsSettingsKeys - .Where(csk => csk.SiteId == null) - .AsNoTrackingWithIdentityResolution() - ; - - foreach (var k11CmsSettingsKey in cmsSettingsKeys) - { - protocol.FetchedSource(k11CmsSettingsKey); - - var kxoGlobalSettingsKey = GetKxoSettingsKey(k11CmsSettingsKey); - - var canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; - var kxoCmsSettingsKey = k11CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(k11CmsSettingsKey); - - if (!canBeMigrated) - { - logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", k11CmsSettingsKey.KeyName); - protocol.Append( - HandbookReferences - .NotCurrentlySupportedSkip() - .WithId(nameof(k11CmsSettingsKey.KeyId), k11CmsSettingsKey.KeyId) - .WithMessage("Settings key is not supported in target instance") - .WithData(new - { - k11CmsSettingsKey.KeyName, - k11CmsSettingsKey.SiteId, - k11CmsSettingsKey.KeyGuid - }) - ); - continue; - } - - protocol.FetchedTarget(kxoCmsSettingsKey); - - if (entityConfiguration.ExcludeCodeNames.Contains(k11CmsSettingsKey.KeyName)) - { - protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, k11CmsSettingsKey); - logger.LogWarning("KeyName {KeyName} is excluded => skipping", k11CmsSettingsKey.KeyName); - continue; - } - - var mapped = mapper.Map(k11CmsSettingsKey, kxoCmsSettingsKey); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); - - SettingsKeyInfoProvider.ProviderObject.Set(result.Item); - - protocol.Success(k11CmsSettingsKey, kxoCmsSettingsKey, mapped); - logger.LogEntitySetAction(result.NewInstance, result.Item); - } - } - - return new GenericCommandResult(); - } - - private SettingsKeyInfo? GetKxoSettingsKey(CmsSettingsKey k11CmsSettingsKey) - { - return SettingsKeyInfoProvider.ProviderObject.Get(k11CmsSettingsKey.KeyName); - } -} \ No newline at end of file +using CMS.DataEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Handlers; + +public class MigrateSettingKeysCommandHandler( + ILogger logger, + IEntityMapper mapper, + IDbContextFactory k11ContextFactory, + ToolkitConfiguration toolkitConfiguration, + IProtocol protocol) + : IRequestHandler +{ + public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); + + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + logger.LogInformation("CmsSettingsKey synchronization starting"); + var cmsSettingsKeys = k11Context.CmsSettingsKeys + .Where(csk => csk.SiteId == null) + .AsNoTrackingWithIdentityResolution() + ; + + foreach (var k11CmsSettingsKey in cmsSettingsKeys) + { + protocol.FetchedSource(k11CmsSettingsKey); + + var kxoGlobalSettingsKey = GetKxoSettingsKey(k11CmsSettingsKey); + + bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; + var kxoCmsSettingsKey = k11CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(k11CmsSettingsKey); + + if (!canBeMigrated) + { + logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", k11CmsSettingsKey.KeyName); + protocol.Append( + HandbookReferences + .NotCurrentlySupportedSkip() + .WithId(nameof(k11CmsSettingsKey.KeyId), k11CmsSettingsKey.KeyId) + .WithMessage("Settings key is not supported in target instance") + .WithData(new { k11CmsSettingsKey.KeyName, k11CmsSettingsKey.SiteId, k11CmsSettingsKey.KeyGuid }) + ); + continue; + } + + protocol.FetchedTarget(kxoCmsSettingsKey); + + if (entityConfiguration.ExcludeCodeNames.Contains(k11CmsSettingsKey.KeyName)) + { + protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, k11CmsSettingsKey); + logger.LogWarning("KeyName {KeyName} is excluded => skipping", k11CmsSettingsKey.KeyName); + continue; + } + + var mapped = mapper.Map(k11CmsSettingsKey, kxoCmsSettingsKey); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); + + SettingsKeyInfoProvider.ProviderObject.Set(result.Item); + + protocol.Success(k11CmsSettingsKey, kxoCmsSettingsKey, mapped); + logger.LogEntitySetAction(result.NewInstance, result.Item); + } + } + + return new GenericCommandResult(); + } + + private SettingsKeyInfo? GetKxoSettingsKey(CmsSettingsKey k11CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(k11CmsSettingsKey.KeyName); +} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs index be6454f5..baca6e5d 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateSitesCommandHandler.cs @@ -1,236 +1,239 @@ -namespace Migration.Toolkit.Core.K11.Handlers; - -using CMS.ContentEngine; -using CMS.Websites; -using Kentico.Xperience.UMT.Model; -using Kentico.Xperience.UMT.Services; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; - -// ReSharper disable once UnusedType.Global -public class MigrateSitesCommandHandler(ILogger logger, - IDbContextFactory k11ContextFactory, - IProtocol protocol, - IImporter importer) - : IRequestHandler -{ - public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); - var fallbackDomainPort = 5000; - var migratedDomains = new HashSet(StringComparer.CurrentCultureIgnoreCase); - - foreach (var k11CmsSite in k11Context.CmsSites.Include(s => s.Cultures).Include(cmsSite => cmsSite.CmsSiteDomainAliases)) - { - protocol.FetchedSource(k11CmsSite); - logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", k11CmsSite.SiteName, k11CmsSite.SiteGuid); - - var defaultCultureCode = GetSiteCulture(k11CmsSite); - var migratedSiteCultures = k11CmsSite.Cultures.ToList(); - if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) - { - await using var ctx = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) - { - migratedSiteCultures.Add(defaultCulture); - } - } - - foreach (var cmsCulture in migratedSiteCultures) - { - var existing = ContentLanguageInfoProvider.ProviderObject.Get() - .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) - .FirstOrDefault(); - - if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) - { - existing.ContentLanguageGUID = cmsCulture.CultureGuid; - existing.Update(); - } - - if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) continue; - var langResult = await importer.ImportAsync(new ContentLanguageModel - { - ContentLanguageGUID = cmsCulture.CultureGuid, - ContentLanguageDisplayName = cmsCulture.CultureName, - ContentLanguageName = cmsCulture.CultureCode, - ContentLanguageIsDefault = true, - ContentLanguageFallbackContentLanguageGuid = null, - ContentLanguageCultureFormat = cmsCulture.CultureCode - }); - - if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) - { - migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); - logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); - } - } - - // TODO tomas.krch 2024-02-23: treepath migration when upgrade to recent XbyK occurs - var homePageNodeAliasPath = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, SettingsKeys.CMSDefaultAliasPath); - var cookieLevel = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch - { - "all" => CookieLevelConstants.ALL, - "visitor" => CookieLevelConstants.VISITOR, - "editor" => CookieLevelConstants.EDITOR, - "system" => CookieLevelConstants.SYSTEM, - "essential" => CookieLevelConstants.ESSENTIAL, - _ => (int?)null - }; - var storeFormerUrls = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSStoreFormerUrls") is { } storeFormerUrlsStr - ? bool.TryParse(storeFormerUrlsStr, out var sfu) ? (bool?)sfu : null - : true; - - var result = UriHelperXbyk.GetUniqueDomainCandidate( - k11CmsSite.SiteDomainName, - ref fallbackDomainPort, - candidate => !migratedDomains.Contains(candidate) - ); - - string webSiteChannelDomain; - switch (result) - { - case (true, false, var candidate, null): - { - webSiteChannelDomain = candidate; - break; - } - case (true, true, var candidate, null): - { - webSiteChannelDomain = candidate; - logger.LogWarning("Domain '{Domain}' of site '{SiteName}' is not unique. '{Fallback}' is used instead", k11CmsSite.SiteDomainName, k11CmsSite.SiteName, candidate); - protocol.Warning(HandbookReferences - .InvalidSourceData() - .WithMessage($"Domain '{k11CmsSite.SiteDomainName}' of site '{k11CmsSite.SiteName}' is not unique. '{candidate}' is used instead"), k11CmsSite); - break; - } - case { Success: false, Fallback: { } fallback }: - { - webSiteChannelDomain = fallback; - logger.LogWarning("Unable to use domain '{Domain}' of site '{SiteName}' as channel domain. Fallback '{Fallback}' is used", k11CmsSite.SiteDomainName, k11CmsSite.SiteName, fallback); - protocol.Warning(HandbookReferences - .InvalidSourceData() - .WithMessage($"Non-unique domain name '{k11CmsSite.SiteDomainName}', fallback '{fallback}' used"), k11CmsSite); - break; - } - default: - { - logger.LogError("Unable to use domain '{Domain}' of site '{SiteName}' as channel domain. No fallback available, skipping site", k11CmsSite.SiteDomainName, k11CmsSite.SiteName); - protocol.Warning(HandbookReferences - .InvalidSourceData() - .WithMessage($"Invalid domain name for migration '{k11CmsSite.SiteDomainName}'"), k11CmsSite); - continue; - } - } - - await importer.ImportAsync(new ChannelModel - { - ChannelDisplayName = k11CmsSite.SiteDisplayName, - ChannelName = k11CmsSite.SiteName, - ChannelGUID = k11CmsSite.SiteGuid, - ChannelType = ChannelType.Website - }); - - var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel - { - WebsiteChannelGUID = k11CmsSite.SiteGuid, - WebsiteChannelChannelGuid = k11CmsSite.SiteGuid, - WebsiteChannelDomain = webSiteChannelDomain, - WebsiteChannelHomePage = homePageNodeAliasPath ?? "/", - WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, - WebsiteChannelDefaultCookieLevel = cookieLevel, - WebsiteChannelStoreFormerUrls = storeFormerUrls - }); - - if (!webSiteChannelResult.Success) - { - if (webSiteChannelResult.ModelValidationResults != null) - { - foreach (var mvr in webSiteChannelResult.ModelValidationResults) - { - logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); - } - } - else - { - logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); - } - return new CommandFailureResult(); - } - - if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) - { - migratedDomains.Add(webSiteChannelDomain); - - var cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaPublicKey"); - var cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaPrivateKey"); - - WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; - var cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); - var cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); - var cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSRecaptchaV3Threshold"); - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) - { - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, - WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3, - }; - } - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) - { - if (reCaptchaSettings is not null) - { - logger.LogError(""" - Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. - Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' - or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. - """); - throw new InvalidOperationException("Invalid ReCaptcha settings"); - } - - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2, - }; - } - - if (reCaptchaSettings != null) - { - WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); - } - } - } - - return new GenericCommandResult(); - } - - private string GetSiteCulture(CmsSite site) - { - // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() - // domain alias skipped, HttpContext logic skipped - var siteCulture = site.SiteDefaultVisitorCulture.NullIf(string.Empty) - ?? KenticoHelper.GetSettingsKey(k11ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); - - return siteCulture - ?? throw new InvalidOperationException("Unknown site culture"); - } -} \ No newline at end of file +using CMS.ContentEngine; +using CMS.Websites; + +using Kentico.Xperience.UMT.Model; +using Kentico.Xperience.UMT.Services; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Helpers; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Handlers; + +// ReSharper disable once UnusedType.Global +public class MigrateSitesCommandHandler( + ILogger logger, + IDbContextFactory k11ContextFactory, + IProtocol protocol, + IImporter importer) + : IRequestHandler +{ + public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); + int fallbackDomainPort = 5000; + var migratedDomains = new HashSet(StringComparer.CurrentCultureIgnoreCase); + + foreach (var k11CmsSite in k11Context.CmsSites.Include(s => s.Cultures).Include(cmsSite => cmsSite.CmsSiteDomainAliases)) + { + protocol.FetchedSource(k11CmsSite); + logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", k11CmsSite.SiteName, k11CmsSite.SiteGuid); + + string defaultCultureCode = GetSiteCulture(k11CmsSite); + var migratedSiteCultures = k11CmsSite.Cultures.ToList(); + if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) + { + await using var ctx = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) + { + migratedSiteCultures.Add(defaultCulture); + } + } + + foreach (var cmsCulture in migratedSiteCultures) + { + var existing = ContentLanguageInfoProvider.ProviderObject.Get() + .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) + .FirstOrDefault(); + + if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) + { + existing.ContentLanguageGUID = cmsCulture.CultureGuid; + existing.Update(); + } + + if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) + { + continue; + } + + var langResult = await importer.ImportAsync(new ContentLanguageModel + { + ContentLanguageGUID = cmsCulture.CultureGuid, + ContentLanguageDisplayName = cmsCulture.CultureName, + ContentLanguageName = cmsCulture.CultureCode, + ContentLanguageIsDefault = true, + ContentLanguageFallbackContentLanguageGuid = null, + ContentLanguageCultureFormat = cmsCulture.CultureCode + }); + + if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) + { + migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); + logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); + } + } + + // TODO tomas.krch 2024-02-23: treepath migration when upgrade to recent XbyK occurs + string? homePageNodeAliasPath = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, SettingsKeys.CMSDefaultAliasPath); + int? cookieLevel = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch + { + "all" => CookieLevelConstants.ALL, + "visitor" => CookieLevelConstants.VISITOR, + "editor" => CookieLevelConstants.EDITOR, + "system" => CookieLevelConstants.SYSTEM, + "essential" => CookieLevelConstants.ESSENTIAL, + _ => null + }; + bool? storeFormerUrls = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSStoreFormerUrls") is { } storeFormerUrlsStr + ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null + : true; + + var result = UriHelperXbyk.GetUniqueDomainCandidate( + k11CmsSite.SiteDomainName, + ref fallbackDomainPort, + candidate => !migratedDomains.Contains(candidate) + ); + + string webSiteChannelDomain; + switch (result) + { + case (true, false, var candidate, null): + { + webSiteChannelDomain = candidate; + break; + } + case (true, true, var candidate, null): + { + webSiteChannelDomain = candidate; + logger.LogWarning("Domain '{Domain}' of site '{SiteName}' is not unique. '{Fallback}' is used instead", k11CmsSite.SiteDomainName, k11CmsSite.SiteName, candidate); + protocol.Warning(HandbookReferences + .InvalidSourceData() + .WithMessage($"Domain '{k11CmsSite.SiteDomainName}' of site '{k11CmsSite.SiteName}' is not unique. '{candidate}' is used instead"), k11CmsSite); + break; + } + case { Success: false, Fallback: { } fallback }: + { + webSiteChannelDomain = fallback; + logger.LogWarning("Unable to use domain '{Domain}' of site '{SiteName}' as channel domain. Fallback '{Fallback}' is used", k11CmsSite.SiteDomainName, k11CmsSite.SiteName, fallback); + protocol.Warning(HandbookReferences + .InvalidSourceData() + .WithMessage($"Non-unique domain name '{k11CmsSite.SiteDomainName}', fallback '{fallback}' used"), k11CmsSite); + break; + } + default: + { + logger.LogError("Unable to use domain '{Domain}' of site '{SiteName}' as channel domain. No fallback available, skipping site", k11CmsSite.SiteDomainName, k11CmsSite.SiteName); + protocol.Warning(HandbookReferences + .InvalidSourceData() + .WithMessage($"Invalid domain name for migration '{k11CmsSite.SiteDomainName}'"), k11CmsSite); + continue; + } + } + + await importer.ImportAsync(new ChannelModel { ChannelDisplayName = k11CmsSite.SiteDisplayName, ChannelName = k11CmsSite.SiteName, ChannelGUID = k11CmsSite.SiteGuid, ChannelType = ChannelType.Website }); + + var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel + { + WebsiteChannelGUID = k11CmsSite.SiteGuid, + WebsiteChannelChannelGuid = k11CmsSite.SiteGuid, + WebsiteChannelDomain = webSiteChannelDomain, + WebsiteChannelHomePage = homePageNodeAliasPath ?? "/", + WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, + WebsiteChannelDefaultCookieLevel = cookieLevel, + WebsiteChannelStoreFormerUrls = storeFormerUrls + }); + + if (!webSiteChannelResult.Success) + { + if (webSiteChannelResult.ModelValidationResults != null) + { + foreach (var mvr in webSiteChannelResult.ModelValidationResults) + { + logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); + } + } + else + { + logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); + } + + return new CommandFailureResult(); + } + + if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) + { + migratedDomains.Add(webSiteChannelDomain); + + string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaPublicKey"); + string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaPrivateKey"); + + WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; + string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); + string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); + double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(k11ContextFactory, k11CmsSite.SiteId, "CMSRecaptchaV3Threshold"); + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) + { + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, + WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 + }; + } + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) + { + if (reCaptchaSettings is not null) + { + logger.LogError(""" + Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. + Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' + or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. + """); + throw new InvalidOperationException("Invalid ReCaptcha settings"); + } + + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 + }; + } + + if (reCaptchaSettings != null) + { + WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); + } + } + } + + return new GenericCommandResult(); + } + + private string GetSiteCulture(CmsSite site) + { + // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() + // domain alias skipped, HttpContext logic skipped + string? siteCulture = site.SiteDefaultVisitorCulture.NullIf(string.Empty) + ?? KenticoHelper.GetSettingsKey(k11ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); + + return siteCulture + ?? throw new InvalidOperationException("Unknown site culture"); + } +} diff --git a/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs index 6ead7bcf..15c08e45 100644 --- a/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs +++ b/Migration.Toolkit.Core.K11/Handlers/MigrateUsersCommandHandler.cs @@ -1,267 +1,272 @@ -namespace Migration.Toolkit.Core.K11.Handlers; - -using CMS.Membership; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api.Enums; - -public class MigrateUsersCommandHandler(ILogger logger, - IDbContextFactory k11ContextFactory, - IEntityMapper userInfoMapper, - IEntityMapper roleMapper, - IEntityMapper userRoleMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - private static int[] MigratedAdminUserPrivilegeLevels => new[] { (int)UserPrivilegeLevelEnum.Editor, (int)UserPrivilegeLevelEnum.Admin, (int)UserPrivilegeLevelEnum.GlobalAdmin }; - - public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) - { - await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); - - var k11CmsUsers = k11Context.CmsUsers - .Where(u => MigratedAdminUserPrivilegeLevels.Contains(u.UserPrivilegeLevel)) - ; - - foreach (var k11User in k11CmsUsers) - { - protocol.FetchedSource(k11User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", k11User.UserName, k11User.UserGuid); - - var xbkUserInfo = UserInfoProvider.ProviderObject.Get(k11User.UserGuid); - - protocol.FetchedTarget(xbkUserInfo); - - if (k11User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) - { - protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); - logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", k11User.UserGuid); - primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, xbkUserInfo.UserID); - continue; - } - - if (xbkUserInfo?.UserName == USER_PUBLIC || k11User.UserName == USER_PUBLIC) - { - protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); - logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? k11User.UserGuid); - if (xbkUserInfo != null) - { - primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, xbkUserInfo.UserID); - } - - continue; - } - - var mapped = userInfoMapper.Map(k11User, xbkUserInfo); - protocol.MappedTarget(mapped); - - await SaveUserUsingKenticoApi(cancellationToken, mapped, k11User); - } - - await MigrateUserCmsRoles(k11Context, cancellationToken); - - return new GenericCommandResult(); - } - - private async Task SaveUserUsingKenticoApi(CancellationToken cancellationToken, IModelMappingResult mapped, CmsUser k11User) - { - if (mapped is { Success: true } result) - { - var (userInfo, newInstance) = result; - ArgumentNullException.ThrowIfNull(userInfo); - - try - { - UserInfoProvider.ProviderObject.Set(userInfo); - - protocol.Success(k11User, userInfo, mapped); - logger.LogEntitySetAction(newInstance, userInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, userInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k11User) - .WithData(new { k11User.UserName, k11User.UserGuid, k11User.UserId, }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return false; - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, userInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(userInfo) - ); - return false; - } - - primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, userInfo.UserID); - return true; - } - - return false; - } - - private async Task MigrateUserCmsRoles(K11Context k11Context, CancellationToken cancellationToken) - { - var groupedRoles = k11Context.CmsRoles - .Where(r => - r.CmsUserRoles.Any(ur => MigratedAdminUserPrivilegeLevels.Contains(ur.User.UserPrivilegeLevel)) - ) - .GroupBy(x => x.RoleName) - .AsNoTracking(); - - var skippedRoles = new HashSet(); - foreach (var groupedRole in groupedRoles) - { - if (groupedRole.Count() <= 1) - { - continue; - } - - logger.LogError(""" - Roles with RoleGuid ({RoleGuids}) have same RoleName '{RoleName}', due to removal of sites and role globalization it is required to set unique RoleName - """, string.Join(",", groupedRole.Select(l => l.RoleGuid)), groupedRole.Key); - - foreach (var r in groupedRole) - { - skippedRoles.Add(r.RoleGuid); - protocol.Append(HandbookReferences.NotCurrentlySupportedSkip() - .WithMessage($"Role '{r.RoleName}' with RoleGUID '{r.RoleGuid}' doesn't satisfy unique RoleName condition for migration") - .WithIdentityPrint(r) - .WithData(new { r.RoleGuid, r.RoleName, r.SiteId }) - ); - } - } - - var k11CmsRoles = k11Context.CmsRoles - .Where(r => - r.CmsUserRoles.Any(ur => MigratedAdminUserPrivilegeLevels.Contains(ur.User.UserPrivilegeLevel)) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var k11CmsRole in k11CmsRoles.WithCancellation(cancellationToken)) - { - if (skippedRoles.Contains(k11CmsRole.RoleGuid)) continue; - - protocol.FetchedSource(k11CmsRole); - - var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(k11CmsRole.RoleGuid); - protocol.FetchedTarget(xbkRoleInfo); - var mapped = roleMapper.Map(k11CmsRole, xbkRoleInfo); - protocol.MappedTarget(mapped); - - if (mapped is not (var roleInfo, var newInstance) { Success: true }) - { - continue; - } - - ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); - try - { - RoleInfoProvider.ProviderObject.Set(roleInfo); - - protocol.Success(k11CmsRole, roleInfo, mapped); - logger.LogEntitySetAction(newInstance, roleInfo); - - primaryKeyMappingContext.SetMapping( - r => r.RoleId, - k11CmsRole.RoleId, - roleInfo.RoleID - ); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, roleInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(roleInfo) - ); - continue; - } - - await MigrateUserRole(k11CmsRole.RoleId); - } - } - - private async Task MigrateUserRole(int k11RoleId) - { - var k11Context = await k11ContextFactory.CreateDbContextAsync(); - var k11UserRoles = k11Context.CmsUserRoles - .Where(ur => - ur.RoleId == k11RoleId && - MigratedAdminUserPrivilegeLevels.Contains(ur.User.UserPrivilegeLevel) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var k11UserRole in k11UserRoles) - { - protocol.FetchedSource(k11UserRole); - if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, k11RoleId, out var xbkRoleId)) - { - var handbookRef = HandbookReferences - .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), k11UserRole.RoleId) - .NeedsManualAction(); - - protocol.Append(handbookRef); - logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", k11UserRole.RoleId); - continue; - } - - if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, k11UserRole.UserId, out var xbkUserId)) - { - continue; - } - - var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); - protocol.FetchedTarget(xbkUserRole); - - var mapped = userRoleMapper.Map(k11UserRole, xbkUserRole); - protocol.MappedTarget(mapped); - - if (mapped is { Success: true }) - { - var (userRoleInfo, newInstance) = mapped; - ArgumentNullException.ThrowIfNull(userRoleInfo); - - try - { - UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); - - protocol.Success(k11UserRole, userRoleInfo, mapped); - logger.LogEntitySetAction(newInstance, userRoleInfo); - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, userRoleInfo); - protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) - .WithData(new { k11UserRole.UserRoleId, k11UserRole.UserId, k11UserRole.RoleId, }) - .WithMessage("Failed to migrate user role") - ); - } - } - } - } - - public void Dispose() - { - - } -} \ No newline at end of file +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Api.Enums; + +namespace Migration.Toolkit.Core.K11.Handlers; + +public class MigrateUsersCommandHandler( + ILogger logger, + IDbContextFactory k11ContextFactory, + IEntityMapper userInfoMapper, + IEntityMapper roleMapper, + IEntityMapper userRoleMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) + { + await using var k11Context = await k11ContextFactory.CreateDbContextAsync(cancellationToken); + + var k11CmsUsers = k11Context.CmsUsers + .Where(u => UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(u.UserPrivilegeLevel)) + ; + + foreach (var k11User in k11CmsUsers) + { + protocol.FetchedSource(k11User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", k11User.UserName, k11User.UserGuid); + + var xbkUserInfo = UserInfoProvider.ProviderObject.Get(k11User.UserGuid); + + protocol.FetchedTarget(xbkUserInfo); + + if (k11User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) + { + protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", k11User.UserGuid); + primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, xbkUserInfo.UserID); + continue; + } + + if (xbkUserInfo?.UserName == USER_PUBLIC || k11User.UserName == USER_PUBLIC) + { + protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? k11User.UserGuid); + if (xbkUserInfo != null) + { + primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, xbkUserInfo.UserID); + } + + continue; + } + + var mapped = userInfoMapper.Map(k11User, xbkUserInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, k11User); + } + + await MigrateUserCmsRoles(k11Context, cancellationToken); + + return new GenericCommandResult(); + } + + private bool SaveUserUsingKenticoApi(IModelMappingResult mapped, CmsUser k11User) + { + if (mapped is { Success: true } result) + { + (var userInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(userInfo); + + try + { + UserInfoProvider.ProviderObject.Set(userInfo); + + protocol.Success(k11User, userInfo, mapped); + logger.LogEntitySetAction(newInstance, userInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, userInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k11User) + .WithData(new { k11User.UserName, k11User.UserGuid, k11User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return false; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(userInfo) + ); + return false; + } + + primaryKeyMappingContext.SetMapping(r => r.UserId, k11User.UserId, userInfo.UserID); + return true; + } + + return false; + } + + private async Task MigrateUserCmsRoles(K11Context k11Context, CancellationToken cancellationToken) + { + var groupedRoles = k11Context.CmsRoles + .Where(r => + r.CmsUserRoles.Any(ur => UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(ur.User.UserPrivilegeLevel)) + ) + .GroupBy(x => x.RoleName) + .AsNoTracking(); + + var skippedRoles = new HashSet(); + foreach (var groupedRole in groupedRoles) + { + if (groupedRole.Count() <= 1) + { + continue; + } + + logger.LogError(""" + Roles with RoleGuid ({RoleGuids}) have same RoleName '{RoleName}', due to removal of sites and role globalization it is required to set unique RoleName + """, string.Join(",", groupedRole.Select(l => l.RoleGuid)), groupedRole.Key); + + foreach (var r in groupedRole) + { + skippedRoles.Add(r.RoleGuid); + protocol.Append(HandbookReferences.NotCurrentlySupportedSkip() + .WithMessage($"Role '{r.RoleName}' with RoleGUID '{r.RoleGuid}' doesn't satisfy unique RoleName condition for migration") + .WithIdentityPrint(r) + .WithData(new { r.RoleGuid, r.RoleName, r.SiteId }) + ); + } + } + + var k11CmsRoles = k11Context.CmsRoles + .Where(r => + r.CmsUserRoles.Any(ur => UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(ur.User.UserPrivilegeLevel)) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var k11CmsRole in k11CmsRoles.WithCancellation(cancellationToken)) + { + if (skippedRoles.Contains(k11CmsRole.RoleGuid)) + { + continue; + } + + protocol.FetchedSource(k11CmsRole); + + var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(k11CmsRole.RoleGuid); + protocol.FetchedTarget(xbkRoleInfo); + var mapped = roleMapper.Map(k11CmsRole, xbkRoleInfo); + protocol.MappedTarget(mapped); + + if (mapped is not (var roleInfo, var newInstance) { Success: true }) + { + continue; + } + + ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); + try + { + RoleInfoProvider.ProviderObject.Set(roleInfo); + + protocol.Success(k11CmsRole, roleInfo, mapped); + logger.LogEntitySetAction(newInstance, roleInfo); + + primaryKeyMappingContext.SetMapping( + r => r.RoleId, + k11CmsRole.RoleId, + roleInfo.RoleID + ); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, roleInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(roleInfo) + ); + continue; + } + + await MigrateUserRole(k11CmsRole.RoleId); + } + } + + private async Task MigrateUserRole(int k11RoleId) + { + var k11Context = await k11ContextFactory.CreateDbContextAsync(); + var k11UserRoles = k11Context.CmsUserRoles + .Where(ur => + ur.RoleId == k11RoleId && + UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(ur.User.UserPrivilegeLevel) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var k11UserRole in k11UserRoles) + { + protocol.FetchedSource(k11UserRole); + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, k11RoleId, out int xbkRoleId)) + { + var handbookRef = HandbookReferences + .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), k11UserRole.RoleId) + .NeedsManualAction(); + + protocol.Append(handbookRef); + logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", k11UserRole.RoleId); + continue; + } + + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, k11UserRole.UserId, out int xbkUserId)) + { + continue; + } + + var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); + protocol.FetchedTarget(xbkUserRole); + + var mapped = userRoleMapper.Map(k11UserRole, xbkUserRole); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true }) + { + (var userRoleInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(userRoleInfo); + + try + { + UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); + + protocol.Success(k11UserRole, userRoleInfo, mapped); + logger.LogEntitySetAction(newInstance, userRoleInfo); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userRoleInfo); + protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) + .WithData(new { k11UserRole.UserRoleId, k11UserRole.UserId, k11UserRole.RoleId }) + .WithMessage("Failed to migrate user role") + ); + } + } + } + } +} diff --git a/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs index ecde8c29..d1efa48a 100644 --- a/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs +++ b/Migration.Toolkit.Core.K11/Helpers/KenticoHelper.cs @@ -1,46 +1,46 @@ -namespace Migration.Toolkit.Core.K11.Helpers; - -using System.Globalization; -using CMS.Helpers; -using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.K11; - -public static class KenticoHelper -{ - public static void CopyCustomData(ContainerCustomData target, string? sourceXml) - { - var customNodeData = new ContainerCustomData(); - customNodeData.LoadData(sourceXml); - foreach (var columnName in customNodeData.ColumnNames) - { - target.SetValue(columnName, customNodeData.GetValue(columnName)); - } - } - - public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) - { - using var k11Context = ctxf.CreateDbContext(); - var keys = k11Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - - return (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - } - - public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable - { - using var k11Context = ctxf.CreateDbContext(); - var keys = k11Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - var value = (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - - - return T.TryParse(value, CultureInfo.InvariantCulture, out var result) - ? result - : null; - } - - public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable - { - return T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); - } -} \ No newline at end of file +using System.Globalization; + +using CMS.Helpers; + +using Microsoft.EntityFrameworkCore; + +using Migration.Toolkit.K11; + +namespace Migration.Toolkit.Core.K11.Helpers; + +public static class KenticoHelper +{ + public static void CopyCustomData(ContainerCustomData target, string? sourceXml) + { + var customNodeData = new ContainerCustomData(); + customNodeData.LoadData(sourceXml); + foreach (string? columnName in customNodeData.ColumnNames) + { + target.SetValue(columnName, customNodeData.GetValue(columnName)); + } + } + + public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) + { + using var k11Context = ctxf.CreateDbContext(); + var keys = k11Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + + return (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + } + + public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable + { + using var k11Context = ctxf.CreateDbContext(); + var keys = k11Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + + + return T.TryParse(value, CultureInfo.InvariantCulture, out var result) + ? result + : null; + } + + public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); +} diff --git a/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs index 481f631b..8956050d 100644 --- a/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs +++ b/Migration.Toolkit.Core.K11/Helpers/PrintHelper.cs @@ -1,7 +1,7 @@ -namespace Migration.Toolkit.Core.K11.Helpers; - -public static class PrintHelper -{ - public static string PrintDictionary(Dictionary dictionary) => - string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); -} \ No newline at end of file +namespace Migration.Toolkit.Core.K11.Helpers; + +public static class PrintHelper +{ + public static string PrintDictionary(Dictionary dictionary) => + string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); +} diff --git a/Migration.Toolkit.Core.K11/Helpers/Printer.cs b/Migration.Toolkit.Core.K11/Helpers/Printer.cs index 17f43ea1..cf7d4929 100644 --- a/Migration.Toolkit.Core.K11/Helpers/Printer.cs +++ b/Migration.Toolkit.Core.K11/Helpers/Printer.cs @@ -1,120 +1,102 @@ -namespace Migration.Toolkit.Core.K11.Helpers; - -using CMS.DataEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.K11.Models; - -public class Printer -{ - public static string PrintKxpModelInfo(T model) - { - var currentTypeName = ReflectionHelper.CurrentType.Name; - - return model switch - { - KXP.Models.MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", - KXP.Models.MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", - KXP.Models.CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", - KXP.Models.CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", - KXP.Models.CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", - KXP.Models.CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", - KXP.Models.CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", - KXP.Models.CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", - KXP.Models.OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", - - null => $"{currentTypeName}: ", - _ => $"TODO: {typeof(T).FullName}" - }; - } - - public static string GetEntityIdentityPrint(T model, bool printType = true) - { - var currentTypeName = ReflectionHelper.CurrentType.Name; - - string Fallback(object obj) => printType - ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" - : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}" - ; - - string FormatModel(string inner) => printType - ? $"{currentTypeName}({inner})" - : $"{inner}" - ; - - return model switch - { - MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), - MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), - DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - - CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - - ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), - CMS.FormEngine.AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), - UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), - RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), - MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), - - KXP.Models.CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), - KXP.Models.CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), - KXP.Models.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - KXP.Models.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - KXP.Models.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - KXP.Models.CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), - - Toolkit.K11.Models.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), - CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), - CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), - CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), - CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), - CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), - CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), - CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), - - null => $" ref of {currentTypeName}", - _ => Fallback(model) - }; - } - - public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") - { - return string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); - } - - public static string PrintEnumValues(string separator) where TEnum : struct, Enum - { - return string.Join(separator, Enum.GetValues()); - } -} - -public class PrintService : IPrintService -{ - public string PrintKxpModelInfo(T model) - { - return Printer.PrintKxpModelInfo(model); - } - - public string GetEntityIdentityPrint(T model, bool printType = true) - { - return Printer.GetEntityIdentityPrint(model, printType); - } - - public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") - { - return Printer.GetEntityIdentityPrints(models, separator); - } - - public string PrintEnumValues(string separator) where TEnum : struct, Enum - { - return Printer.PrintEnumValues(separator); - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; + +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Helpers; + +public class Printer +{ + public static string PrintKxpModelInfo(T model) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + return model switch + { + KXP.Models.MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", + KXP.Models.MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", + KXP.Models.CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", + KXP.Models.CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", + KXP.Models.CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", + KXP.Models.CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", + KXP.Models.CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", + KXP.Models.CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", + KXP.Models.OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", + + null => $"{currentTypeName}: ", + _ => $"TODO: {typeof(T).FullName}" + }; + } + + public static string GetEntityIdentityPrint(T model, bool printType = true) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + string Fallback(object obj) => printType + ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" + : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; + + string FormatModel(string inner) => printType + ? $"{currentTypeName}({inner})" + : $"{inner}"; + + return model switch + { + MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), + MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), + DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + + CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + + ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), + AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), + UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), + RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), + MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), + + KXP.Models.CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), + KXP.Models.CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), + KXP.Models.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + KXP.Models.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + KXP.Models.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + KXP.Models.CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), + + CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), + CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), + CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), + CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), + CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), + CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), + CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), + CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), + + null => $" ref of {currentTypeName}", + _ => Fallback(model) + }; + } + + public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); + + public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); +} + +public class PrintService : IPrintService +{ + public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); + + public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); + + public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); + + public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); +} diff --git a/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs b/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs index 62cd09c3..928e1414 100644 --- a/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs +++ b/Migration.Toolkit.Core.K11/K11CoreDiExtensions.cs @@ -1,107 +1,69 @@ -namespace Migration.Toolkit.Core.K11; - -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using CMS.OnlineForms; -using CMS.Websites; -using Kentico.Xperience.UMT; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.Core.K11.Behaviors; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Handlers; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.Core.K11.Mappers; -using Migration.Toolkit.Core.K11.Services; -using Migration.Toolkit.KXP.Models; - -public static class K11CoreDiExtensions -{ - public static IServiceCollection UseK11ToolkitCore(this IServiceCollection services) - { - var printService = new PrintService(); - services.AddSingleton(printService); - HandbookReference.PrintService = printService; - LogExtensions.PrintService = printService; - - // services.AddTransient(); - // services.AddSingleton(); - - - - services.AddTransient(); - // services.AddTransient(); - services.AddTransient(); - // services.AddScoped(); - // services.AddScoped(); - services.AddScoped(); - // services.AddScoped(); - - services.AddMediatR(typeof(K11CoreDiExtensions)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); - - services.AddSingleton(s => new TableReflectionService(s.GetRequiredService>())); - services.AddSingleton(); - services.AddTransient(); - - services.AddScoped(); - services.AddSingleton(); - services.AddScoped(); - services.AddSingleton(); - - // commands - services.AddTransient(); - // services.AddTransient(); - // services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - // services.AddTransient(); - - // umt mappers - // services.AddTransient, ContentItemMapper>(); - - // mappers - services.AddTransient, CmsAttachmentMapper>(); - // services.AddTransient, CmsClassMapper>(); - services.AddTransient, CmsConsentMapper>(); - services.AddTransient, CmsConsentAgreementMapper>(); - services.AddTransient, CmsConsentArchiveMapper>(); - // services.AddTransient, CmsFormMapper>(); - // services.AddTransient, CmsFormMapperEf>(); - services.AddTransient, ResourceMapper>(); - services.AddTransient, AlternativeFormMapper>(); - services.AddTransient, RoleInfoMapper>(); - services.AddTransient, CmsSettingsCategoryMapper>(); - services.AddTransient, CmsSettingsKeyMapper>(); - services.AddTransient, UserInfoMapper>(); - services.AddTransient, MemberInfoMapper>(); - services.AddTransient, UserRoleInfoMapper>(); - services.AddTransient, MediaLibraryInfoMapper>(); - services.AddTransient, OmContactMapper>(); - services.AddTransient, OmContactGroupMapper>(); - services.AddTransient, OmContactStatusMapper>(); - services.AddTransient, MediaFileInfoMapper>(); - services.AddTransient, CountryInfoMapper>(); - services.AddTransient, StateInfoMapper>(); - - services.AddUniversalMigrationToolkit(); - - return services; - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using Kentico.Xperience.UMT; + +using MediatR; + +using Microsoft.Extensions.DependencyInjection; +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.Core.K11.Behaviors; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.Core.K11.Helpers; +using Migration.Toolkit.Core.K11.Mappers; +using Migration.Toolkit.Core.K11.Services; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11; + +public static class K11CoreDiExtensions +{ + public static IServiceCollection UseK11ToolkitCore(this IServiceCollection services) + { + var printService = new PrintService(); + services.AddSingleton(printService); + HandbookReference.PrintService = printService; + LogExtensions.PrintService = printService; + + services.AddTransient(); + services.AddTransient(); + services.AddScoped(); + + services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(K11CoreDiExtensions).Assembly)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); + + services.AddScoped(); + services.AddSingleton(); + services.AddScoped(); + services.AddSingleton(); + + // mappers + services.AddTransient, CmsAttachmentMapper>(); + services.AddTransient, CmsConsentMapper>(); + services.AddTransient, CmsConsentAgreementMapper>(); + services.AddTransient, CmsConsentArchiveMapper>(); + services.AddTransient, AlternativeFormMapper>(); + services.AddTransient, RoleInfoMapper>(); + services.AddTransient, CmsSettingsCategoryMapper>(); + services.AddTransient, CmsSettingsKeyMapper>(); + services.AddTransient, UserInfoMapper>(); + services.AddTransient, MemberInfoMapper>(); + services.AddTransient, UserRoleInfoMapper>(); + services.AddTransient, OmContactGroupMapper>(); + services.AddTransient, OmContactStatusMapper>(); + services.AddTransient, CountryInfoMapper>(); + services.AddTransient, StateInfoMapper>(); + + services.AddUniversalMigrationToolkit(); + + return services; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs index 15f9c7ef..f2c1830e 100644 --- a/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/AlternativeFormMapper.cs @@ -1,89 +1,91 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.DataEngine; -using CMS.FormEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Services; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api.Services.CmsClass; - -public record AlternativeFormMapperSource(CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); - -public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - => AlternativeFormInfo.New(); - - protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (source, xbkFormClass) = sourceObj; - - target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out var classId) - ? classId ?? 0 - : 0; - target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out var coupledClassId) - ? coupledClassId ?? 0 - : 0; - - var coupledClassIsDeprecated = - source.FormCoupledClass?.ClassName is { } coupledClassName && - K12SystemClass.NoLongerSupported.Contains(coupledClassName); - - var classIsSysInternal = K12SystemClass.All.Contains(source.FormClass.ClassName); - - var mergedDefinition = source.FormClass.ClassFormDefinition; - if (source.FormCoupledClass != null) - { - logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); - } - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); - - var patcher = new FormDefinitionPatcher( - logger, - mergedDefinition, - fieldMigrationService, - source.FormClass.ClassIsForm.GetValueOrDefault(false), - source.FormClass.ClassIsDocumentType, - false, - !classIsSysInternal, - true - ); - - var fieldNames = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); - - patcher.PatchFields(); - - var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); - - if (coupledClassIsDeprecated && source.FormCoupledClass != null) - { - logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); - patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); - - var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); - logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); - } - - var result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); - - var formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); - - target.FormDefinition = formDefinitionDifference; - - target.FormDisplayName = source.FormDisplayName; - target.FormGUID = source.FormGuid; - target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); - target.FormLastModified = source.FormLastModified; - target.FormName = source.FormName; - - return target; - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Api.Services.CmsClass; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public record AlternativeFormMapperSource(CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); + +public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + => AlternativeFormInfo.New(); + + protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (source, xbkFormClass) = sourceObj; + + target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) + ? classId ?? 0 + : 0; + target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) + ? coupledClassId ?? 0 + : 0; + + bool coupledClassIsDeprecated = + source.FormCoupledClass?.ClassName is { } coupledClassName && + K12SystemClass.NoLongerSupported.Contains(coupledClassName); + + bool classIsSysInternal = K12SystemClass.All.Contains(source.FormClass.ClassName); + + string mergedDefinition = source.FormClass.ClassFormDefinition; + if (source.FormCoupledClass != null) + { + logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); + } + + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); + + var patcher = new FormDefinitionPatcher( + logger, + mergedDefinition, + fieldMigrationService, + source.FormClass.ClassIsForm.GetValueOrDefault(false), + source.FormClass.ClassIsDocumentType, + false, + !classIsSysInternal, + true + ); + + var fieldNames = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); + + patcher.PatchFields(); + + var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); + + if (coupledClassIsDeprecated && source.FormCoupledClass != null) + { + logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); + patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); + + var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); + } + + string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); + + string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); + + target.FormDefinition = formDefinitionDifference; + + target.FormDisplayName = source.FormDisplayName; + target.FormGUID = source.FormGuid; + target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); + target.FormLastModified = source.FormLastModified; + target.FormName = source.FormName; + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs index 802ef8d2..cd671afb 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsAttachmentMapper.cs @@ -1,55 +1,59 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.Base; -using CMS.MediaLibrary; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.Core.K11.Helpers; -using Migration.Toolkit.K11.Models; - -public record CmsAttachmentMapperSource(CmsAttachment Attachment, int TargetLibraryId, IUploadedFile File, string LibrarySubFolder, - CmsDocument? AttachmentDocument); - -public class CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - { - // library name is generated with site name in it - return new MediaFileInfo(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); - } - - protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (cmsAttachment, targetLibraryId, _, _, attachmentDocument) = args; - - target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); - target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; - target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; - target.FileExtension = cmsAttachment.AttachmentExtension; - target.FileMimeType = cmsAttachment.AttachmentMimeType; - target.FileSize = cmsAttachment.AttachmentSize; - target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; - target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; - target.FileGUID = cmsAttachment.AttachmentGuid; - target.FileLibraryID = targetLibraryId; - - // target.FileCreatedByUserID = cmsAttachment.?; - // target.FileModifiedByUserID = cmsAttachment.?; - // target.FileCreatedWhen = cmsAttachment.?; - - target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; - - KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); - - if (attachmentDocument != null) - { - target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } -} \ No newline at end of file +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.Core.K11.Helpers; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public record CmsAttachmentMapperSource( + CmsAttachment Attachment, + int TargetLibraryId, + IUploadedFile File, + string LibrarySubFolder, + CmsDocument? AttachmentDocument); + +public class CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + // library name is generated with site name in it + new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); + + protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; + + target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); + target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; + target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; + target.FileExtension = cmsAttachment.AttachmentExtension; + target.FileMimeType = cmsAttachment.AttachmentMimeType; + target.FileSize = cmsAttachment.AttachmentSize; + target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; + target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; + target.FileGUID = cmsAttachment.AttachmentGuid; + target.FileLibraryID = targetLibraryId; + + // target.FileCreatedByUserID = cmsAttachment.?; + // target.FileModifiedByUserID = cmsAttachment.?; + // target.FileCreatedWhen = cmsAttachment.?; + + target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; + + KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); + + if (attachmentDocument != null) + { + target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs index a8be50a2..ed40187e 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsConsentAgreementMapper.cs @@ -1,33 +1,34 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override CmsConsentAgreement? CreateNewInstance(Toolkit.K11.Models.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentAgreement MapInternal(Toolkit.K11.Models.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentAgreementGuid = source.ConsentAgreementGuid; - target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; - target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; - target.ConsentAgreementTime = source.ConsentAgreementTime; - - if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out var contactId)) - { - target.ConsentAgreementContactId = contactId; - } - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out var consentId)) - { - target.ConsentAgreementConsentId = consentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.CmsConsentAgreement? CreateNewInstance(CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsConsentAgreement MapInternal(CmsConsentAgreement source, KXP.Models.CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentAgreementGuid = source.ConsentAgreementGuid; + target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; + target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; + target.ConsentAgreementTime = source.ConsentAgreementTime; + + if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) + { + target.ConsentAgreementContactId = contactId; + } + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) + { + target.ConsentAgreementConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs index 62bc9cb4..e3687c80 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsConsentArchiveMapper.cs @@ -1,30 +1,33 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override CmsConsentArchive? CreateNewInstance(Toolkit.K11.Models.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentArchive MapInternal(Toolkit.K11.Models.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentArchiveContent = source.ConsentArchiveContent; - target.ConsentArchiveGuid = source.ConsentArchiveGuid; - target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; - target.ConsentArchiveHash = source.ConsentArchiveHash; - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out var consentId)) - { - target.ConsentArchiveConsentId = consentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class CmsConsentArchiveMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.CmsConsentArchive? CreateNewInstance(CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsConsentArchive MapInternal(CmsConsentArchive source, KXP.Models.CmsConsentArchive target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentArchiveContent = source.ConsentArchiveContent; + target.ConsentArchiveGuid = source.ConsentArchiveGuid; + target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; + target.ConsentArchiveHash = source.ConsentArchiveHash; + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) + { + target.ConsentArchiveConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs index 0fcb6e73..181b74d6 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsConsentMapper.cs @@ -1,72 +1,79 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using System.Text; -using System.Xml.Linq; -using System.Xml.XPath; -using CMS.ContentEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override CmsConsent? CreateNewInstance(Toolkit.K11.Models.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsent MapInternal(Toolkit.K11.Models.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentDisplayName = source.ConsentDisplayName; - var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); - target.ConsentName = source.ConsentName; - target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); - target.ConsentGuid = source.ConsentGuid; - target.ConsentLastModified = source.ConsentLastModified; - target.ConsentHash = source.ConsentHash; - - return target; - } -} - -static file class ConsentContentPatcher -{ - public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) - { - if (string.IsNullOrWhiteSpace(content)) return content; - XDocument doc; - try - { - doc = XDocument.Parse(content); - } - catch (Exception) - { - // cannot patch xml that cannot be parsed - return content; - } - - foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) - { - cultureCodeElement.Name = "LanguageName"; - if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) - { - // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); - } - - // if elements are not swapped, FULLTEXT is not shown in UI - var p = cultureCodeElement.NextNode; - if (p is XElement e && e.Name == "FullText") - { - p.ReplaceWith(cultureCodeElement); - cultureCodeElement.ReplaceWith(p); - } - } - - var builder = new StringBuilder(); - using (var writer = new CMS.IO.StringWriter(builder)) - { - doc.Save(writer); - } - - return builder.ToString(); - } -} \ No newline at end of file +using System.Text; +using System.Xml.Linq; +using System.Xml.XPath; + +using CMS.ContentEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override KXP.Models.CmsConsent? CreateNewInstance(CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsConsent MapInternal(CmsConsent source, KXP.Models.CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentDisplayName = source.ConsentDisplayName; + var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); + target.ConsentName = source.ConsentName; + target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); + target.ConsentGuid = source.ConsentGuid; + target.ConsentLastModified = source.ConsentLastModified; + target.ConsentHash = source.ConsentHash; + + return target; + } +} + +static file class ConsentContentPatcher +{ + public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) + { + if (string.IsNullOrWhiteSpace(content)) + { + return content; + } + + XDocument doc; + try + { + doc = XDocument.Parse(content); + } + catch (Exception) + { + // cannot patch xml that cannot be parsed + return content; + } + + foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) + { + cultureCodeElement.Name = "LanguageName"; + if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) + { + // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); + } + + // if elements are not swapped, FULLTEXT is not shown in UI + var p = cultureCodeElement.NextNode; + if (p is XElement e && e.Name == "FullText") + { + p.ReplaceWith(cultureCodeElement); + cultureCodeElement.ReplaceWith(p); + } + } + + var builder = new StringBuilder(); + using (var writer = new CMS.IO.StringWriter(builder)) + { + doc.Save(writer); + } + + return builder.ToString(); + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs index a97be1c9..565bfa83 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsFormMapper.cs @@ -1,80 +1,83 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.FormEngine; -using CMS.OnlineForms; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsFormMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override BizFormInfo? CreateNewInstance(Toolkit.K11.Models.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) - { - var newBizFormInfo = BizFormInfo.New(); - newBizFormInfo.FormGUID = source.FormGuid; - return newBizFormInfo; - } - - protected override BizFormInfo MapInternal(Toolkit.K11.Models.CmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - target.FormAccess = source.FormAccess.AsEnum(); - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormLastModified = source.FormLastModified; - target.FormLogActivity = source.FormLogActivity.UseKenticoDefault(); - // target.FormBuilderLayout = source.FormBuilderLayout; - - if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out var formClassId)) - { - target.FormClassID = formClassId; - } - - return target; - } -} - -public class CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override CmsForm? CreateNewInstance(Toolkit.K11.Models.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsForm MapInternal(Toolkit.K11.Models.CmsForm source, CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - // target.FormSendToEmail = source.FormSendToEmail; - // target.FormSendFromEmail = source.FormSendFromEmail; - // target.FormEmailSubject = source.FormEmailSubject; - // target.FormEmailTemplate = source.FormEmailTemplate; - // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - // target.FormConfirmationEmailField = source.FormConfirmationEmailField; - // target.FormConfirmationTemplate = source.FormConfirmationTemplate; - // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; - // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; - target.FormAccess = source.FormAccess; - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormGuid = source.FormGuid; - target.FormLastModified = source.FormLastModified; - target.FormLogActivity = source.FormLogActivity; - // target.FormBuilderLayout = source.FormBuilderLayout; - - if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out var classId)) - { - target.FormClassId = classId; - } - - return target; - } -} \ No newline at end of file +using CMS.FormEngine; +using CMS.OnlineForms; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class CmsFormMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override BizFormInfo? CreateNewInstance(CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) + { + var newBizFormInfo = BizFormInfo.New(); + newBizFormInfo.FormGUID = source.FormGuid; + return newBizFormInfo; + } + + protected override BizFormInfo MapInternal(CmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + target.FormAccess = source.FormAccess.AsEnum(); + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormLastModified = source.FormLastModified; + target.FormLogActivity = source.FormLogActivity.UseKenticoDefault(); + // target.FormBuilderLayout = source.FormBuilderLayout; + + if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int formClassId)) + { + target.FormClassID = formClassId; + } + + return target; + } +} + +public class CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override KXP.Models.CmsForm? CreateNewInstance(CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsForm MapInternal(CmsForm source, KXP.Models.CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + // target.FormSendToEmail = source.FormSendToEmail; + // target.FormSendFromEmail = source.FormSendFromEmail; + // target.FormEmailSubject = source.FormEmailSubject; + // target.FormEmailTemplate = source.FormEmailTemplate; + // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + // target.FormConfirmationEmailField = source.FormConfirmationEmailField; + // target.FormConfirmationTemplate = source.FormConfirmationTemplate; + // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; + // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; + target.FormAccess = source.FormAccess; + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormGuid = source.FormGuid; + target.FormLastModified = source.FormLastModified; + target.FormLogActivity = source.FormLogActivity ?? false; + // target.FormBuilderLayout = source.FormBuilderLayout; + + if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int classId)) + { + target.FormClassId = classId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs index a5a9a5e6..0e17b6be 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsCategoryMapper.cs @@ -1,87 +1,97 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -public class CmsSettingsCategoryMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, - IEntityMapper cmsResourceMapper) - : EntityMapperBase(logger, pkContext, protocol) -{ - protected override KXP.Models.CmsSettingsCategory? CreateNewInstance(Toolkit.K11.Models.CmsSettingsCategory source, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - - protected override KXP.Models.CmsSettingsCategory MapInternal(Toolkit.K11.Models.CmsSettingsCategory source, KXP.Models.CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // no category guid to match on... - if (newInstance) - { - target.CategoryOrder = source.CategoryOrder; - target.CategoryName = source.CategoryName; - target.CategoryDisplayName = source.CategoryDisplayName; - target.CategoryIdpath = source.CategoryIdpath; - target.CategoryLevel = source.CategoryLevel; - target.CategoryChildCount = source.CategoryChildCount; - target.CategoryIconPath = source.CategoryIconPath; - target.CategoryIsGroup = source.CategoryIsGroup; - target.CategoryIsCustom = source.CategoryIsCustom; - } - - if (source.CategoryResource != null) - { - if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) - { - // skip if target is present - logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); - pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); - } - else - { - switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) - { - case { Success: true } result: - { - target.CategoryResource = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out var categoryResourceId)) - { - target.CategoryResourceId = categoryResourceId; - } - - if (source.CategoryParent != null) - { - switch (Map(source.CategoryParent, target.CategoryParent)) - { - case { Success: true } result: - { - target.CategoryParent = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out var categoryParentId)) - { - target.CategoryParentId = categoryParentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class CmsSettingsCategoryMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + IEntityMapper cmsResourceMapper) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override KXP.Models.CmsSettingsCategory? CreateNewInstance(CmsSettingsCategory source, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + + protected override KXP.Models.CmsSettingsCategory MapInternal(CmsSettingsCategory source, KXP.Models.CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + // no category guid to match on... + if (newInstance) + { + target.CategoryOrder = source.CategoryOrder; + target.CategoryName = source.CategoryName; + target.CategoryDisplayName = source.CategoryDisplayName; + target.CategoryIdpath = source.CategoryIdpath; + target.CategoryLevel = source.CategoryLevel; + target.CategoryChildCount = source.CategoryChildCount; + target.CategoryIconPath = source.CategoryIconPath; + target.CategoryIsGroup = source.CategoryIsGroup; + target.CategoryIsCustom = source.CategoryIsCustom; + } + + if (source.CategoryResource != null) + { + if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) + { + // skip if target is present + logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); + pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); + } + else + { + switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) + { + case { Success: true } result: + { + target.CategoryResource = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + } + else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) + { + target.CategoryResourceId = categoryResourceId; + } + + if (source.CategoryParent != null) + { + switch (Map(source.CategoryParent, target.CategoryParent)) + { + case { Success: true } result: + { + target.CategoryParent = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) + { + target.CategoryParentId = categoryParentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs index 599e46e2..728e8945 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsSettingsKeyMapper.cs @@ -1,64 +1,67 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using System.Diagnostics; -using CMS.DataEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -public class CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; - - protected override SettingsKeyInfo CreateNewInstance(CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override SettingsKeyInfo MapInternal(CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - if (newInstance) - { - target.KeyName = source.KeyName; - target.KeyDisplayName = source.KeyDisplayName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyGUID = source.KeyGuid; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - else - { - target.KeyName = source.KeyName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - - // special migrations for keys - switch (source.KeyName) - { - case SOURCE_KEY_NAME: - { - target.KeyValue = int.TryParse(source.KeyValue, out var cmsDefaultUserId) - ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out var targetCmsDefaultUserId) - ? targetCmsDefaultUserId.ToString() - : source.KeyValue - : source.KeyValue; - break; - } - default: - target.KeyValue = source.KeyValue; - break; - } - - Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); - target.KeyLastModified = source.KeyLastModified; - return target; - } -} \ No newline at end of file +using System.Diagnostics; + +using CMS.DataEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; + + protected override SettingsKeyInfo CreateNewInstance(CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override SettingsKeyInfo MapInternal(CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + if (newInstance) + { + target.KeyName = source.KeyName; + target.KeyDisplayName = source.KeyDisplayName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyGUID = source.KeyGuid; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + else + { + target.KeyName = source.KeyName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + + // special migrations for keys + switch (source.KeyName) + { + case SOURCE_KEY_NAME: + { + target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) + ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) + ? targetCmsDefaultUserId.ToString() + : source.KeyValue + : source.KeyValue; + break; + } + default: + target.KeyValue = source.KeyValue; + break; + } + + Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); + target.KeyLastModified = source.KeyLastModified; + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs index cb91b732..5d5a5013 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CmsUserMapper.cs @@ -1,58 +1,56 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsUserMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override CmsUser CreateNewInstance(Toolkit.K11.Models.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsUser MapInternal(Toolkit.K11.Models.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - target.UserPassword = source.UserPassword; - target.UserEnabled = source.UserEnabled; - target.UserCreated = source.UserCreated; - target.LastLogon = source.LastLogon; - target.UserGuid = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserPasswordLastChanged = null; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - foreach (var sourceCmsUserRole in source.CmsUserRoles) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out var targetRoleId)) - { - if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) - { - target.CmsUserRoles.Add(new CmsUserRole - { - RoleId = targetRoleId, - User = target, - }); - } - } - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class CmsUserMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.CmsUser CreateNewInstance(CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.CmsUser MapInternal(CmsUser source, KXP.Models.CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + target.UserPassword = source.UserPassword; + target.UserEnabled = source.UserEnabled; + target.UserCreated = source.UserCreated; + target.LastLogon = source.LastLogon; + target.UserGuid = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserPasswordLastChanged = null; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + foreach (var sourceCmsUserRole in source.CmsUserRoles) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) + { + if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) + { + target.CmsUserRoles.Add(new KXP.Models.CmsUserRole { RoleId = targetRoleId, User = target }); + } + } + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs index 73405d49..f0dc3e6a 100644 --- a/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/CountryInfoMapper.cs @@ -1,25 +1,27 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.Globalization; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -public class CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override CountryInfo? CreateNewInstance(CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) - => CountryInfo.New(); - - protected override CountryInfo MapInternal(CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.CountryName = source.CountryName; - target.CountryDisplayName = source.CountryDisplayName; - target.CountryGUID = source.CountryGuid; - target.CountryLastModified = source.CountryLastModified; - target.CountryThreeLetterCode = source.CountryThreeLetterCode; - target.CountryTwoLetterCode = source.CountryTwoLetterCode; - return target; - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override CountryInfo? CreateNewInstance(CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) + => CountryInfo.New(); + + protected override CountryInfo MapInternal(CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.CountryName = source.CountryName; + target.CountryDisplayName = source.CountryDisplayName; + target.CountryGUID = source.CountryGuid; + target.CountryLastModified = source.CountryLastModified; + target.CountryThreeLetterCode = source.CountryThreeLetterCode; + target.CountryTwoLetterCode = source.CountryTwoLetterCode; + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/MediaLibraryInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/MediaLibraryInfoMapper.cs deleted file mode 100644 index e1ad240b..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/MediaLibraryInfoMapper.cs +++ /dev/null @@ -1,38 +0,0 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.MediaLibrary; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -public class MediaLibraryInfoMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override MediaLibraryInfo? CreateNewInstance(MediaLibrary source, MappingHelper mappingHelper, AddFailure addFailure) => - MediaLibraryInfo.New(); - - protected override MediaLibraryInfo MapInternal(MediaLibrary source, MediaLibraryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // Sets the library properties - target.LibraryDisplayName = source.LibraryDisplayName; - target.LibraryName = source.LibraryName; - target.LibraryDescription = source.LibraryDescription; - target.LibraryFolder = source.LibraryFolder; - target.LibraryGUID = mappingHelper.Require(source.LibraryGuid, nameof(source.LibraryGuid)); - target.LibraryDisplayName = source.LibraryDisplayName; - target.LibraryDescription = source.LibraryDescription; - - if (!target.LibraryFolder.StartsWith($"{source.LibrarySite.SiteName}_", StringComparison.InvariantCultureIgnoreCase)) - { - target.LibraryFolder = $"{source.LibrarySite.SiteName}_{source.LibraryFolder}"; - } - - target.LibraryLastModified = mappingHelper.Require(source.LibraryLastModified, nameof(source.LibraryLastModified)); - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs index 3329fdbb..7c5c1a95 100644 --- a/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/MemberInfoMapper.cs @@ -1,187 +1,191 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using System.Data; -using CMS.FormEngine; -using CMS.Membership; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; - -public record MemberInfoMapperSource(CmsUser User, CmsUserSetting UserSetting); - -public class MemberInfoMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration, - IDbContextFactory k11DbContextFactory) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - public static IReadOnlyList MigratedUserFields = new List - { - nameof(CmsUser.UserGuid), - nameof(CmsUser.UserName), - nameof(CmsUser.Email), - // nameof(KX12M.CmsUser.UserPassword), - nameof(CmsUser.UserEnabled), - nameof(CmsUser.UserCreated), - nameof(CmsUser.UserSecurityStamp), - }; - - protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (user, userSetting) = source; - - if (!newInstance && user.UserGuid != target.MemberGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - // target.UserName = source.UserName; - target.MemberName = user.UserName; - - // target.FirstName = source.FirstName; // TODO tomas.krch: 2023-04-11 configurable autocreate - // target.LastName = source.LastName; // TODO tomas.krch: 2023-04-11 configurable autocreate - - // target.Email = source.Email; - target.MemberEmail = user.Email; - - // target.SetValue("UserPassword", source.UserPassword); - target.MemberPassword = null; // source.UserPassword; // not migrated - - // target.UserEnabled = source.UserEnabled; - target.MemberEnabled = user.UserEnabled; - - target.SetValue("UserCreated", user.UserCreated); - target.MemberCreated = user.UserCreated.GetValueOrDefault(); - - // target.SetValue("LastLogon", source.LastLogon); // TODO tomas.krch: 2023-04-11 configurable autocreate - - // target.UserGUID = source.UserGuid; - target.MemberGuid = user.UserGuid; - - // target.UserLastModified = source.UserLastModified; // TODO tomas.krch: 2023-04-11 configurable autocreate - target.MemberSecurityStamp = user.UserSecurityStamp; // TODO tomas.krch: 2023-04-11 still relevant? - - // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // OBSOLETE: target.UserIsPendingRegistration = false; - // OBSOLETE: target.UserPasswordLastChanged = null; - // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - // TODO tomas.krch: 2023-04-11 migrate customized fields - var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); - foreach (var customizedFieldInfo in customized) - { - var fieldName = customizedFieldInfo.FieldName; - - if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out var value) || - ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) - { - target.SetValue(fieldName, value); - } - } - - using var k11Context = k11DbContextFactory.CreateDbContext(); - var uDci = k11Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); - if (uDci != null) - { - var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); - if (userCustomizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.User.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - } - - var usDci = k11Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); - if (usDci != null) - { - var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); - if (userSettingsCustomizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userSettingsCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserSettingsInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); - } - } - } - - - return target; - } -} \ No newline at end of file +using System.Data; + +using CMS.FormEngine; +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public record MemberInfoMapperSource(CmsUser User, CmsUserSetting UserSetting); + +public class MemberInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolkitConfiguration toolkitConfiguration, + IDbContextFactory k11DbContextFactory) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + public static IReadOnlyList MigratedUserFields = new List + { + nameof(CmsUser.UserGuid), + nameof(CmsUser.UserName), + nameof(CmsUser.Email), + // nameof(KX12M.CmsUser.UserPassword), + nameof(CmsUser.UserEnabled), + nameof(CmsUser.UserCreated), + nameof(CmsUser.UserSecurityStamp) + }; + + protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (user, userSetting) = source; + + if (!newInstance && user.UserGuid != target.MemberGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + // target.UserName = source.UserName; + target.MemberName = user.UserName; + + // target.FirstName = source.FirstName; // TODO tomas.krch: 2023-04-11 configurable autocreate + // target.LastName = source.LastName; // TODO tomas.krch: 2023-04-11 configurable autocreate + + // target.Email = source.Email; + target.MemberEmail = user.Email; + + // target.SetValue("UserPassword", source.UserPassword); + target.MemberPassword = null; // source.UserPassword; // not migrated + + // target.UserEnabled = source.UserEnabled; + target.MemberEnabled = user.UserEnabled; + + target.SetValue("UserCreated", user.UserCreated); + target.MemberCreated = user.UserCreated.GetValueOrDefault(); + + // target.SetValue("LastLogon", source.LastLogon); // TODO tomas.krch: 2023-04-11 configurable autocreate + + // target.UserGUID = source.UserGuid; + target.MemberGuid = user.UserGuid; + + // target.UserLastModified = source.UserLastModified; // TODO tomas.krch: 2023-04-11 configurable autocreate + target.MemberSecurityStamp = user.UserSecurityStamp; // TODO tomas.krch: 2023-04-11 still relevant? + + // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // OBSOLETE: target.UserIsPendingRegistration = false; + // OBSOLETE: target.UserPasswordLastChanged = null; + // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + // TODO tomas.krch: 2023-04-11 migrate customized fields + var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); + foreach (var customizedFieldInfo in customized) + { + string fieldName = customizedFieldInfo.FieldName; + + if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || + ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) + { + target.SetValue(fieldName, value); + } + } + + using var k11Context = k11DbContextFactory.CreateDbContext(); + var uDci = k11Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); + if (uDci != null) + { + var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); + if (userCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.User.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + } + + var usDci = k11Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); + if (usDci != null) + { + var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); + if (userSettingsCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userSettingsCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserSettingsInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); + } + } + } + + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs index bb9f8927..8abca943 100644 --- a/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/OmContactGroupMapper.cs @@ -1,30 +1,32 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactGroupMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override OmContactGroup? CreateNewInstance(Toolkit.K11.Models.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override OmContactGroup MapInternal(Toolkit.K11.Models.OmContactGroup source, OmContactGroup target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactGroupName = source.ContactGroupName; - target.ContactGroupDisplayName = source.ContactGroupDisplayName; - target.ContactGroupDescription = source.ContactGroupDescription; - target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; - target.ContactGroupEnabled = source.ContactGroupEnabled; - target.ContactGroupLastModified = source.ContactGroupLastModified; - target.ContactGroupGuid = source.ContactGroupGuid; - target.ContactGroupStatus = source.ContactGroupStatus; - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class OmContactGroupMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.OmContactGroup? CreateNewInstance(OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override KXP.Models.OmContactGroup MapInternal(OmContactGroup source, KXP.Models.OmContactGroup target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactGroupName = source.ContactGroupName; + target.ContactGroupDisplayName = source.ContactGroupDisplayName; + target.ContactGroupDescription = source.ContactGroupDescription; + target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; + target.ContactGroupEnabled = source.ContactGroupEnabled; + target.ContactGroupLastModified = source.ContactGroupLastModified; + target.ContactGroupGuid = source.ContactGroupGuid; + target.ContactGroupStatus = source.ContactGroupStatus; + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/OmContactMapper.cs b/Migration.Toolkit.Core.K11/Mappers/OmContactMapper.cs deleted file mode 100644 index 7e380b05..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/OmContactMapper.cs +++ /dev/null @@ -1,85 +0,0 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IEntityMapper contactStatusMapper, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override OmContact? CreateNewInstance(Toolkit.K11.Models.OmContact tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override OmContact MapInternal(Toolkit.K11.Models.OmContact source, OmContact target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.ContactGuid != target.ContactGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch"); - } - - // do not try to insert pk - // target.ContactId = source.ContactId; - target.ContactFirstName = source.ContactFirstName; - target.ContactMiddleName = source.ContactMiddleName; - target.ContactLastName = source.ContactLastName; - target.ContactJobTitle = source.ContactJobTitle; - target.ContactAddress1 = source.ContactAddress1; - target.ContactCity = source.ContactCity; - target.ContactZip = source.ContactZip; - target.ContactMobilePhone = source.ContactMobilePhone; - target.ContactBusinessPhone = source.ContactBusinessPhone; - target.ContactEmail = source.ContactEmail; - target.ContactBirthday = source.ContactBirthday; - target.ContactGender = source.ContactGender; - target.ContactNotes = source.ContactNotes; - target.ContactMonitored = source.ContactMonitored; - target.ContactGuid = source.ContactGuid; - target.ContactLastModified = source.ContactLastModified; - target.ContactCreated = source.ContactCreated; - target.ContactBounces = source.ContactBounces; - target.ContactCampaign = source.ContactCampaign; - target.ContactSalesForceLeadReplicationDisabled = source.ContactSalesForceLeadReplicationDisabled; - target.ContactSalesForceLeadReplicationDateTime = source.ContactSalesForceLeadReplicationDateTime; - target.ContactSalesForceLeadReplicationSuspensionDateTime = source.ContactSalesForceLeadReplicationSuspensionDateTime; - target.ContactCompanyName = source.ContactCompanyName; - target.ContactSalesForceLeadReplicationRequired = source.ContactSalesForceLeadReplicationRequired; - - // TODO tk: 2022-06-13 resolve migration of target.ContactStateId = _primaryKeyMappingContext.MapFromSource(u => u.StateId, source.ContactStateId); - // TODO tk: 2022-06-13 resolve migration of target.ContactCountryId = _primaryKeyMappingContext.MapFromSource(u => u.CountryId, source.ContactCountryId); - - if (source.ContactStatus != null) - { - switch (contactStatusMapper.Map(source.ContactStatus, target.ContactStatus)) - { - case { Success: true } result: - { - target.ContactStatus = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result?.HandbookReference)); - break; - } - } - } - else - { - target.ContactStatus = null; - } - - target.ContactSalesForceLeadId = source.ContactSalesForceLeadId; - if (mappingHelper.TranslateIdAllowNulls(u => u.UserId, source.ContactOwnerUserId, out var userId)) - { - target.ContactOwnerUserId = userId; - } - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs b/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs index 68f46d59..25de76fe 100644 --- a/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/OmContactStatusMapper.cs @@ -1,26 +1,28 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactStatusMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override OmContactStatus? CreateNewInstance(Toolkit.K11.Models.OmContactStatus tSourceEntity, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - protected override OmContactStatus MapInternal(Toolkit.K11.Models.OmContactStatus source, OmContactStatus target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactStatusName = source.ContactStatusName; - target.ContactStatusDisplayName = source.ContactStatusDisplayName; - target.ContactStatusDescription = source.ContactStatusDescription; - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class OmContactStatusMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override KXP.Models.OmContactStatus? CreateNewInstance(OmContactStatus tSourceEntity, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + protected override KXP.Models.OmContactStatus MapInternal(OmContactStatus source, KXP.Models.OmContactStatus target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactStatusName = source.ContactStatusName; + target.ContactStatusDisplayName = source.ContactStatusDisplayName; + target.ContactStatusDescription = source.ContactStatusDescription; + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/ResourceMapper.cs b/Migration.Toolkit.Core.K11/Mappers/ResourceMapper.cs deleted file mode 100644 index a3648e7d..00000000 --- a/Migration.Toolkit.Core.K11/Mappers/ResourceMapper.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.Modules; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -public class ResourceMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override ResourceInfo? CreateNewInstance(CmsResource source, MappingHelper mappingHelper, AddFailure addFailure) - => ResourceInfo.New(); - - protected override ResourceInfo MapInternal(CmsResource source, ResourceInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ResourceDescription = source.ResourceDescription; - target.ResourceDisplayName = source.ResourceDisplayName; - target.ResourceGUID = source.ResourceGuid; - target.ResourceIsInDevelopment = false; // TODO tk: 2022-10-10 if true, module is not shown in UI of XbK - target.ResourceLastModified = source.ResourceLastModified; - target.ResourceName = source.ResourceName; - - if (target.ResourceName == K12SystemResource.Licenses) - { - target.ResourceName = XbkSystemResource.CMS_Licenses; - logger.LogInformation("Patching CMS Resource 'Licences': name changed to '{ResourceNamePatched}'", XbkSystemResource.CMS_Licenses); - } - - if (!XbkSystemResource.All.Contains(target.ResourceName) || K12SystemResource.ConvertToNonSysResource.Contains(target.ResourceName)) - { - // custom resource - - if (target.ResourceName.StartsWith("CMS.", StringComparison.InvariantCultureIgnoreCase)) - { - var targetResourceNamePatched = target.ResourceName.Substring(4, target.ResourceName.Length - 4); - logger.LogInformation("Patching CMS Resource '{ResourceName}': name changed to '{ResourceNamePatched}'", target.ResourceName, targetResourceNamePatched); - target.ResourceName = targetResourceNamePatched; - } - } - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs index 2a663f57..66e962ff 100644 --- a/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/RoleInfoMapper.cs @@ -1,26 +1,29 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.Membership; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -public class RoleInfoMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override RoleInfo? CreateNewInstance(CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override RoleInfo MapInternal(CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.RoleDisplayName = source.RoleDisplayName; - target.RoleName = source.RoleName; - target.RoleDescription = source.RoleDescription; - target.RoleGUID = source.RoleGuid; - target.RoleLastModified = source.RoleLastModified; - return target; - } -} \ No newline at end of file +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class RoleInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override RoleInfo? CreateNewInstance(CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override RoleInfo MapInternal(CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.RoleDisplayName = source.RoleDisplayName; + target.RoleName = source.RoleName; + target.RoleDescription = source.RoleDescription; + target.RoleGUID = source.RoleGuid; + target.RoleLastModified = source.RoleLastModified; + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs index 9aadaebb..94f3a655 100644 --- a/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/StateInfoMapper.cs @@ -1,30 +1,32 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.Globalization; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -public class StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override StateInfo? CreateNewInstance(CmsState source, MappingHelper mappingHelper, AddFailure addFailure) - => StateInfo.New(); - - protected override StateInfo MapInternal(CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.StateName = source.StateName; - target.StateDisplayName = source.StateDisplayName; - target.StateLastModified = source.StateLastModified; - target.StateGUID = source.StateGuid; - target.StateCode = source.StateCode; - - if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out var countryId)) - { - target.CountryID = countryId; - } - - return target; - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override StateInfo? CreateNewInstance(CmsState source, MappingHelper mappingHelper, AddFailure addFailure) + => StateInfo.New(); + + protected override StateInfo MapInternal(CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.StateName = source.StateName; + target.StateDisplayName = source.StateDisplayName; + target.StateLastModified = source.StateLastModified; + target.StateGUID = source.StateGuid; + target.StateCode = source.StateCode; + + if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) + { + target.CountryID = countryId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs index 97629a89..b45952eb 100644 --- a/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/UserInfoMapper.cs @@ -1,92 +1,96 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using System.Data; -using CMS.Membership; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; - -public class UserInfoMapper(ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override UserInfo CreateNewInstance(CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override UserInfo MapInternal(CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGUID) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - // target.UserPassword = source.UserPassword; - target.SetValue("UserPassword", source.UserPassword); - target.UserEnabled = source.UserEnabled; - target.SetValue("UserCreated", source.UserCreated); - // target.UserCreated = source.UserCreated; - target.SetValue("LastLogon", source.LastLogon); - // target.LastLogon = source.LastLogon; - target.UserGUID = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - - - return target; - } -} \ No newline at end of file +using System.Data; + +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class UserInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolkitConfiguration toolkitConfiguration) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override UserInfo CreateNewInstance(CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override UserInfo MapInternal(CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGUID) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + // target.UserPassword = source.UserPassword; + target.SetValue("UserPassword", source.UserPassword); + target.UserEnabled = source.UserEnabled; + target.SetValue("UserCreated", source.UserCreated); + // target.UserCreated = source.UserCreated; + target.SetValue("LastLogon", source.LastLogon); + // target.LastLogon = source.LastLogon; + target.UserGUID = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); + if (customizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in customizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs index bbad5140..6d8b6c9c 100644 --- a/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs +++ b/Migration.Toolkit.Core.K11/Mappers/UserRoleInfoMapper.cs @@ -1,29 +1,31 @@ -namespace Migration.Toolkit.Core.K11.Mappers; - -using CMS.Membership; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11.Models; - -public class UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) -{ - protected override UserRoleInfo? CreateNewInstance(CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) - => UserRoleInfo.New(); - - protected override UserRoleInfo MapInternal(CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out var xbkRoleId)) - { - target.RoleID = xbkRoleId; - } - - if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out var xbkUserId)) - { - target.UserID = xbkUserId; - } - - return target; - } -} \ No newline at end of file +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.Core.K11.Mappers; + +public class UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : EntityMapperBase(logger, pkContext, protocol) +{ + protected override UserRoleInfo? CreateNewInstance(CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) + => UserRoleInfo.New(); + + protected override UserRoleInfo MapInternal(CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) + { + target.RoleID = xbkRoleId; + } + + if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) + { + target.UserID = xbkUserId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.K11/Migration.Toolkit.Core.K11.csproj b/Migration.Toolkit.Core.K11/Migration.Toolkit.Core.K11.csproj index f37b5e1d..5d19b93c 100644 --- a/Migration.Toolkit.Core.K11/Migration.Toolkit.Core.K11.csproj +++ b/Migration.Toolkit.Core.K11/Migration.Toolkit.Core.K11.csproj @@ -4,12 +4,11 @@ - + - - + diff --git a/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs index 1287064c..6a7be8ba 100644 --- a/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.K11/Providers/ContentItemNameProvider.cs @@ -1,47 +1,42 @@ -namespace Migration.Toolkit.Core.K11.Providers; - -using System; -using System.Threading.Tasks; -using CMS.Base; -using CMS.ContentEngine.Internal; -using CMS.Helpers; - -internal class ContentItemNameProvider -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) - { - this.codeNameValidator = codeNameValidator; - } - - public Task Get(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); - } - - async Task Get(string name) - { - var codeName = ValidationHelper.GetCodeName(name, useUnicode: false); - - var isCodeNameValid = ValidationHelper.IsCodeName(codeName); - - if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) - { - codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); - } - - var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); - - return await uniqueCodeNameProvider.GetUniqueValue(codeName); - } - - return Get(name); - } -} \ No newline at end of file +using CMS.Base; +using CMS.ContentEngine.Internal; +using CMS.Helpers; + +namespace Migration.Toolkit.Core.K11.Providers; + +internal class ContentItemNameProvider +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; + + public Task Get(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); + } + + async Task Get(string name) + { + string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); + + bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); + + if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) + { + codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); + } + + var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); + + return await uniqueCodeNameProvider.GetUniqueValue(codeName); + } + + return Get(name); + } +} diff --git a/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs index 36b8cfcb..7145f071 100644 --- a/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs +++ b/Migration.Toolkit.Core.K11/Providers/ContentItemNameValidator.cs @@ -1,25 +1,18 @@ -namespace Migration.Toolkit.Core.K11.Providers; - -using CMS.ContentEngine.Internal; - -internal class ContentItemNameValidator : IContentItemNameValidator -{ - /// - public bool IsUnique(string name) - { - return IsUnique(0, name); - } - - - /// - public bool IsUnique(int id, string name) - { - var contentItemInfo = new ContentItemInfo() - { - ContentItemID = id, - ContentItemName = name, - }; - - return contentItemInfo.CheckUniqueCodeName(); - } -} \ No newline at end of file +using CMS.ContentEngine.Internal; + +namespace Migration.Toolkit.Core.K11.Providers; + +internal class ContentItemNameValidator : IContentItemNameValidator +{ + /// + public bool IsUnique(string name) => IsUnique(0, name); + + + /// + public bool IsUnique(int id, string name) + { + var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; + + return contentItemInfo.CheckUniqueCodeName(); + } +} diff --git a/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs index c7a968f3..6a8fc262 100644 --- a/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.K11/Providers/UniqueContentItemNameProvider.cs @@ -1,48 +1,38 @@ -namespace Migration.Toolkit.Core.K11.Providers; - -using System.Threading.Tasks; -using CMS.Base; -using CMS.ContentEngine.Internal; - -internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) - : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) - { - this.codeNameValidator = codeNameValidator; - } - - public override Task GetUniqueValue(string inputValue) - { - return base.GetUniqueValue(AddSuffix(inputValue)); - } - - - private string AddSuffix(string codeName) - { - var randomSuffix = GetRandomSuffix(); - var codeNameWithSuffix = codeName += randomSuffix; - - if (codeNameWithSuffix.Length > MaxLength) - { - var availableLength = MaxLength - randomSuffix.Length; - - codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; - } - - return codeNameWithSuffix; - } - - - /// - protected override Task IsValueUnique(string value) - { - return Task.FromResult(codeNameValidator.IsUnique(value)); - } -} \ No newline at end of file +using CMS.Base; +using CMS.ContentEngine.Internal; + +namespace Migration.Toolkit.Core.K11.Providers; + +internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) + : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; + + public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); + + + private string AddSuffix(string codeName) + { + string randomSuffix = GetRandomSuffix(); + string codeNameWithSuffix = codeName += randomSuffix; + + if (codeNameWithSuffix.Length > MaxLength) + { + int availableLength = MaxLength - randomSuffix.Length; + + codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; + } + + return codeNameWithSuffix; + } + + + /// + protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); +} diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs index 4f03240e..b00b477e 100644 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs +++ b/Migration.Toolkit.Core.K11/Services/CmsClass/AttachmentSelectorItem.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Core.K11.Services.CmsClass; - -using Newtonsoft.Json; - -/// Represents an item for the attachment selector. -public class AttachmentSelectorItem -{ - /// Attachment GUID. - [JsonProperty("fileGuid")] - public Guid FileGuid { get; set; } -} \ No newline at end of file +using Newtonsoft.Json; + +namespace Migration.Toolkit.Core.K11.Services.CmsClass; + +/// Represents an item for the attachment selector. +public class AttachmentSelectorItem +{ + /// Attachment GUID. + [JsonProperty("fileGuid")] + public Guid FileGuid { get; set; } +} diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs index 599271ae..cd561d5c 100644 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs +++ b/Migration.Toolkit.Core.K11/Services/CmsClass/EditableAreasConfiguration.cs @@ -1,186 +1,189 @@ -namespace Migration.Toolkit.Core.K11.Services.CmsClass; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -#region Copied from Kentico assembly - -[DataContract(Name = "Configuration", Namespace = "")] -public sealed class EditableAreasConfiguration -{ - /// Editable areas within the page. - [DataMember] - [JsonProperty("editableAreas")] - public List EditableAreas { get; private set; } - - /// - /// Creates an instance of class. - /// - public EditableAreasConfiguration() => this.EditableAreas = new List(); -} - -/// -/// Represents configuration of editable area within the instance. -/// -[DataContract(Name = "EditableArea", Namespace = "")] -public sealed class EditableAreaConfiguration -{ - /// Identifier of the editable area. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// Sections within editable area. - [DataMember] - [JsonProperty("sections")] - public List Sections { get; private set; } - - /// - /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. - /// - public bool AllowWidgetOutputCache { get; set; } - - /// - /// An absolute expiration date for the cached output of the individual widgets. - /// - public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } - - /// - /// The length of time from the first request to cache the output of the individual widgets. - /// - public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } - - /// - /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. - /// - public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } - - /// - /// Creates an instance of class. - /// - public EditableAreaConfiguration() => this.Sections = new List(); -} - -/// -/// Represents configuration of section within the instance. -/// -[DataContract(Name = "Section", Namespace = "")] -public sealed class SectionConfiguration -{ - /// Identifier of the section. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type section identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Section properties. - [DataMember] - [JsonProperty("properties")] - // public ISectionProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Zones within the section. - [DataMember] - [JsonProperty("zones")] - public List Zones { get; private set; } - - /// - /// Creates an instance of class. - /// - public SectionConfiguration() => this.Zones = new List(); -} - -/// -/// Represents the zone within the configuration class. -/// -[DataContract(Name = "Zone", Namespace = "")] -public sealed class ZoneConfiguration -{ - /// Identifier of the widget zone. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Name of the widget zone. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// List of widgets within the zone. - [DataMember] - [JsonProperty("widgets")] - public List Widgets { get; private set; } - - /// - /// Creates an instance of class. - /// - public ZoneConfiguration() => this.Widgets = new List(); -} - -/// -/// Represents the configuration of a widget within the list. -/// -[DataContract(Name = "Widget", Namespace = "")] -public sealed class WidgetConfiguration -{ - /// Identifier of the widget instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type widget identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Personalization condition type identifier. - [DataMember] - [JsonProperty("conditionType")] - public string PersonalizationConditionTypeIdentifier { get; set; } - - /// List of widget variants. - [DataMember] - [JsonProperty("variants")] - public List Variants { get; set; } - - /// - /// Creates an instance of class. - /// - public WidgetConfiguration() => this.Variants = new List(); -} - -/// -/// Represents the configuration variant of a widget within the list. -/// -[DataContract(Name = "Variant", Namespace = "")] -public sealed class WidgetVariantConfiguration -{ - /// Identifier of the variant instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Widget variant name. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// Widget variant properties. - [DataMember] - [JsonProperty("properties")] - // public IWidgetProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Widget variant personalization condition type. - /// Only personalization condition type parameters are serialized to JSON. - [DataMember] - [JsonProperty("conditionTypeParameters")] - public JObject PersonalizationConditionType { get; set; } -} - -#endregion \ No newline at end of file +// namespace Migration.Toolkit.Core.K11.Services.CmsClass; +// +// using System.Runtime.Serialization; +// using Newtonsoft.Json; +// using Newtonsoft.Json.Linq; +// +// #region Copied from Kentico assembly +// +// [DataContract(Name = "Configuration", Namespace = "")] +// public sealed class EditableAreasConfiguration +// { +// /// Editable areas within the page. +// [DataMember] +// [JsonProperty("editableAreas")] +// public List EditableAreas { get; private set; } +// +// /// +// /// Creates an instance of class. +// /// +// public EditableAreasConfiguration() => this.EditableAreas = new List(); +// } +// +// /// +// /// Represents configuration of editable area within the instance. +// /// +// [DataContract(Name = "EditableArea", Namespace = "")] +// public sealed class EditableAreaConfiguration +// { +// /// Identifier of the editable area. +// [DataMember] +// [JsonProperty("identifier")] +// public string Identifier { get; set; } +// +// /// Sections within editable area. +// [DataMember] +// [JsonProperty("sections")] +// public List Sections { get; private set; } +// +// /// +// /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. +// /// +// public bool AllowWidgetOutputCache { get; set; } +// +// /// +// /// An absolute expiration date for the cached output of the individual widgets. +// /// +// public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } +// +// /// +// /// The length of time from the first request to cache the output of the individual widgets. +// /// +// public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } +// +// /// +// /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. +// /// +// public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } +// +// /// +// /// Creates an instance of class. +// /// +// public EditableAreaConfiguration() => this.Sections = new List(); +// } +// +// /// +// /// Represents configuration of section within the instance. +// /// +// [DataContract(Name = "Section", Namespace = "")] +// public sealed class SectionConfiguration +// { +// /// Identifier of the section. +// [DataMember] +// [JsonProperty("identifier")] +// public Guid Identifier { get; set; } +// +// /// Type section identifier. +// [DataMember] +// [JsonProperty("type")] +// public string TypeIdentifier { get; set; } +// +// /// Section properties. +// [DataMember] +// [JsonProperty("properties")] +// // public ISectionProperties Properties { get; set; } +// public JObject Properties { get; set; } +// +// /// Zones within the section. +// [DataMember] +// [JsonProperty("zones")] +// public List Zones { get; private set; } +// +// /// +// /// Creates an instance of class. +// /// +// public SectionConfiguration() => this.Zones = new List(); +// } +// +// /// +// /// Represents the zone within the configuration class. +// /// +// [DataContract(Name = "Zone", Namespace = "")] +// public sealed class ZoneConfiguration +// { +// /// Identifier of the widget zone. +// [DataMember] +// [JsonProperty("identifier")] +// public Guid Identifier { get; set; } +// +// /// Name of the widget zone. +// [DataMember] +// [JsonProperty("name")] +// public string Name { get; set; } +// +// /// List of widgets within the zone. +// [DataMember] +// [JsonProperty("widgets")] +// public List Widgets { get; private set; } +// +// /// +// /// Creates an instance of class. +// /// +// public ZoneConfiguration() => this.Widgets = new List(); +// } +// +// /// +// /// Represents the configuration of a widget within the list. +// /// +// [DataContract(Name = "Widget", Namespace = "")] +// public sealed class WidgetConfiguration +// { +// /// Identifier of the widget instance. +// [DataMember] +// [JsonProperty("identifier")] +// public Guid Identifier { get; set; } +// +// /// Type widget identifier. +// [DataMember] +// [JsonProperty("type")] +// public string TypeIdentifier { get; set; } +// +// /// Personalization condition type identifier. +// [DataMember] +// [JsonProperty("conditionType")] +// public string PersonalizationConditionTypeIdentifier { get; set; } +// +// /// List of widget variants. +// [DataMember] +// [JsonProperty("variants")] +// public List Variants { get; set; } +// +// /// +// /// Creates an instance of class. +// /// +// public WidgetConfiguration() => this.Variants = new List(); +// } +// +// /// +// /// Represents the configuration variant of a widget within the list. +// /// +// [DataContract(Name = "Variant", Namespace = "")] +// public sealed class WidgetVariantConfiguration +// { +// /// Identifier of the variant instance. +// [DataMember] +// [JsonProperty("identifier")] +// public Guid Identifier { get; set; } +// +// /// Widget variant name. +// [DataMember] +// [JsonProperty("name")] +// public string Name { get; set; } +// +// /// Widget variant properties. +// [DataMember] +// [JsonProperty("properties")] +// // public IWidgetProperties Properties { get; set; } +// public JObject Properties { get; set; } +// +// /// Widget variant personalization condition type. +// /// Only personalization condition type parameters are serialized to JSON. +// [DataMember] +// [JsonProperty("conditionTypeParameters")] +// public JObject PersonalizationConditionType { get; set; } +// } +// +// #endregion +// + + diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs index 241eaf06..e4a31280 100644 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs +++ b/Migration.Toolkit.Core.K11/Services/CmsClass/PageSelectorItem.cs @@ -1,11 +1,13 @@ -namespace Migration.Toolkit.Core.K11.Services.CmsClass; - -using Newtonsoft.Json; - -/// Represents an item for a page selector. -public class PageSelectorItem -{ - /// Node Guid of a page. - [JsonProperty("nodeGuid")] - public Guid NodeGuid { get; set; } -} \ No newline at end of file +// namespace Migration.Toolkit.Core.K11.Services.CmsClass; +// +// using Newtonsoft.Json; +// +// /// Represents an item for a page selector. +// public class PageSelectorItem +// { +// /// Node Guid of a page. +// [JsonProperty("nodeGuid")] +// public Guid NodeGuid { get; set; } +// } + + diff --git a/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs b/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs index bc72637d..e10908f6 100644 --- a/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs +++ b/Migration.Toolkit.Core.K11/Services/CmsClass/PageTemplateConfiguration.cs @@ -1,29 +1,31 @@ -namespace Migration.Toolkit.Core.K11.Services.CmsClass; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -/// -/// Page template configuration for the instance. -/// -[DataContract(Name = "PageTemplate", Namespace = "")] -public class PageTemplateConfiguration -{ - /// Identifier of the page template. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// - /// Identifier of the page template configuration based on which the page was created. - /// - [DataMember] - [JsonProperty("configurationIdentifier")] - public Guid ConfigurationIdentifier { get; set; } - - /// Page template properties. - [DataMember] - [JsonProperty("properties")] - public JObject Properties { get; set; } -} \ No newline at end of file +// namespace Migration.Toolkit.Core.K11.Services.CmsClass; +// +// using System.Runtime.Serialization; +// using Newtonsoft.Json; +// using Newtonsoft.Json.Linq; +// +// /// +// /// Page template configuration for the instance. +// /// +// [DataContract(Name = "PageTemplate", Namespace = "")] +// public class PageTemplateConfiguration +// { +// /// Identifier of the page template. +// [DataMember] +// [JsonProperty("identifier")] +// public string Identifier { get; set; } +// +// /// +// /// Identifier of the page template configuration based on which the page was created. +// /// +// [DataMember] +// [JsonProperty("configurationIdentifier")] +// public Guid ConfigurationIdentifier { get; set; } +// +// /// Page template properties. +// [DataMember] +// [JsonProperty("properties")] +// public JObject Properties { get; set; } +// } + + diff --git a/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs b/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs index bf2126db..b0562a57 100644 --- a/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs +++ b/Migration.Toolkit.Core.K11/Services/CountryMigrator.cs @@ -1,102 +1,105 @@ -namespace Migration.Toolkit.Core.K11.Services; - -using CMS.Globalization; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.K11.Contexts; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Api; - -public class CountryMigrator(ILogger logger, - IDbContextFactory k11ContextFactory, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - IEntityMapper countryMapper, - IEntityMapper stateMapper, - KxpApiInitializer kxpApiInitializer) -{ - public void MigrateCountriesAndStates() - { - if (!kxpApiInitializer.EnsureApiIsInitialized()) - { - throw new InvalidOperationException($"Falied to initialize kentico API. Please check configuration."); - } - - var k11Context = k11ContextFactory.CreateDbContext(); - - var k11Countries = k11Context.CmsCountries.AsNoTracking(); - foreach (var k11CmsCountry in k11Countries) - { - var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(k11CmsCountry.CountryName); - - if (kxpCountryInfo != null) // do not update when exists - { - continue; - } - - var mapped = countryMapper.Map(k11CmsCountry, null); - protocol.MappedTarget(mapped); - - if (mapped is (var countryInfo, var newInstance) { Success: true }) - { - try - { - CountryInfoProvider.ProviderObject.Set(countryInfo); - - protocol.Success(k11CmsCountry, countryInfo, mapped); - logger.LogEntitySetAction(newInstance, countryInfo); - - primaryKeyMappingContext.SetMapping(r => r.CountryId, k11CmsCountry.CountryId, countryInfo.CountryID); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, countryInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(countryInfo) - ); - } - } - } - - - var k11States = k11Context.CmsStates.AsNoTracking(); - foreach (var k11CmsState in k11States) - { - var kxpStateInfo = StateInfoProvider.ProviderObject.Get(k11CmsState.StateName); - - if (kxpStateInfo != null) // do not update when exists - { - continue; - } - - var mapped = stateMapper.Map(k11CmsState, null); - protocol.MappedTarget(mapped); - - if (mapped is (var stateInfo, var newInstance) { Success: true }) - { - try - { - StateInfoProvider.ProviderObject.Set(stateInfo); - - protocol.Success(k11CmsState, stateInfo, mapped); - logger.LogEntitySetAction(newInstance, stateInfo); - - primaryKeyMappingContext.SetMapping(r => r.StateId, k11CmsState.StateId, stateInfo.StateID); - } - catch (Exception exception) - { - logger.LogEntitySetError(exception, newInstance, stateInfo); - protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(stateInfo) - ); - } - } - } - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.K11.Contexts; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.K11.Services; + +public class CountryMigrator( + ILogger logger, + IDbContextFactory k11ContextFactory, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + IEntityMapper countryMapper, + IEntityMapper stateMapper, + KxpApiInitializer kxpApiInitializer) +{ + public void MigrateCountriesAndStates() + { + if (!kxpApiInitializer.EnsureApiIsInitialized()) + { + throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); + } + + var k11Context = k11ContextFactory.CreateDbContext(); + + var k11Countries = k11Context.CmsCountries.AsNoTracking(); + foreach (var k11CmsCountry in k11Countries) + { + var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(k11CmsCountry.CountryName); + + if (kxpCountryInfo != null) // do not update when exists + { + continue; + } + + var mapped = countryMapper.Map(k11CmsCountry, null); + protocol.MappedTarget(mapped); + + if (mapped is (var countryInfo, var newInstance) { Success: true }) + { + try + { + CountryInfoProvider.ProviderObject.Set(countryInfo); + + protocol.Success(k11CmsCountry, countryInfo, mapped); + logger.LogEntitySetAction(newInstance, countryInfo); + + primaryKeyMappingContext.SetMapping(r => r.CountryId, k11CmsCountry.CountryId, countryInfo.CountryID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, countryInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(countryInfo) + ); + } + } + } + + + var k11States = k11Context.CmsStates.AsNoTracking(); + foreach (var k11CmsState in k11States) + { + var kxpStateInfo = StateInfoProvider.ProviderObject.Get(k11CmsState.StateName); + + if (kxpStateInfo != null) // do not update when exists + { + continue; + } + + var mapped = stateMapper.Map(k11CmsState, null); + protocol.MappedTarget(mapped); + + if (mapped is (var stateInfo, var newInstance) { Success: true }) + { + try + { + StateInfoProvider.ProviderObject.Set(stateInfo); + + protocol.Success(k11CmsState, stateInfo, mapped); + logger.LogEntitySetAction(newInstance, stateInfo); + + primaryKeyMappingContext.SetMapping(r => r.StateId, k11CmsState.StateId, stateInfo.StateID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, stateInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(stateInfo) + ); + } + } + } + } +} diff --git a/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs index 19e6b3c5..fc5b664e 100644 --- a/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.K11/Services/IPrimaryKeyLocatorService.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Core.K11.Services; - -using System.Linq.Expressions; - -public record SourceTargetKeyMapping(int SourceId, int TargetId); - -public interface IPrimaryKeyLocatorService -{ - bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); - IEnumerable SelectAll(Expression> keyNameSelector); -} \ No newline at end of file +using System.Linq.Expressions; + +namespace Migration.Toolkit.Core.K11.Services; + +public record SourceTargetKeyMapping(int SourceId, int TargetId); + +public interface IPrimaryKeyLocatorService +{ + bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); + IEnumerable SelectAll(Expression> keyNameSelector); +} diff --git a/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs index 599af70e..78eb544e 100644 --- a/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs +++ b/Migration.Toolkit.Core.K11/Services/KeyLocatorService.cs @@ -1,109 +1,108 @@ -namespace Migration.Toolkit.Core.K11.Services; - -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.K11; -using Migration.Toolkit.KXP.Context; - -public class KeyLocatorService(ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory k11ContextFactory) -{ - public bool TryLocate( - Expression> sourceKeySelector, - Expression> targetKeySelector, - Expression> sourceGuidSelector, - Expression> targetGuidSelector, - object? sourceKey, out TTargetKey targetId - ) where TSource : class where TTarget : class - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var k11Context = k11ContextFactory.CreateDbContext(); - - var sourceType = typeof(TSource); - Unsafe.SkipInit(out targetId); - - try - { - if (sourceKey is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - sourceKeySelector.Body, - Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); - var k11Guid = k11Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); - - var param = Expression.Parameter(typeof(TTarget), "t"); - var member = targetGuidSelector.Body as MemberExpression; - if (member == null) - { - throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); - } - var targetEquals = Expression.Equal( - Expression.MakeMemberAccess(param, member.Member), - Expression.Constant(k11Guid, typeof(Guid)) - ); - var targetPredicate = Expression.Lambda>(targetEquals, param); - - var query = kxpContext.Set().Where(targetPredicate); - var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); - targetId = query.Select(selector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); - return false; - } - finally - { - if (!targetId?.Equals(default) ?? false) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); - } - } - } - - public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) - where T : class - { - using var KX12Context = k11ContextFactory.CreateDbContext(); - - var type = typeof(T); - Unsafe.SkipInit(out guid); - - try - { - if (key is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - keySelector.Body, - Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); - guid = KX12Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); - return false; - } - finally - { - if (!guid?.Equals(default) ?? false) - { - logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); - } - } - } -} \ No newline at end of file +using System.Linq.Expressions; +using System.Runtime.CompilerServices; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.K11; +using Migration.Toolkit.KXP.Context; + +namespace Migration.Toolkit.Core.K11.Services; + +public class KeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory k11ContextFactory) +{ + public bool TryLocate( + Expression> sourceKeySelector, + Expression> targetKeySelector, + Expression> sourceGuidSelector, + Expression> targetGuidSelector, + object? sourceKey, out TTargetKey targetId + ) where TSource : class where TTarget : class + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var k11Context = k11ContextFactory.CreateDbContext(); + + var sourceType = typeof(TSource); + Unsafe.SkipInit(out targetId); + + try + { + if (sourceKey is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + sourceKeySelector.Body, + Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); + var k11Guid = k11Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); + + var param = Expression.Parameter(typeof(TTarget), "t"); + var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); + var targetEquals = Expression.Equal( + Expression.MakeMemberAccess(param, member.Member), + Expression.Constant(k11Guid, typeof(Guid)) + ); + var targetPredicate = Expression.Lambda>(targetEquals, param); + + var query = kxpContext.Set().Where(targetPredicate); + var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); + targetId = query.Select(selector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); + return false; + } + finally + { + if (!targetId?.Equals(default) ?? false) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); + } + } + } + + public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) + where T : class + { + using var KX12Context = k11ContextFactory.CreateDbContext(); + + var type = typeof(T); + Unsafe.SkipInit(out guid); + + try + { + if (key is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + keySelector.Body, + Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); + guid = KX12Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); + return false; + } + finally + { + if (!guid?.Equals(default) ?? false) + { + logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); + } + } + } +} diff --git a/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs index 957361d4..be16f844 100644 --- a/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.K11/Services/PrimaryKeyLocatorService.cs @@ -1,245 +1,220 @@ -namespace Migration.Toolkit.Core.K11.Services; - -using System.Linq.Expressions; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.K11; -using Migration.Toolkit.K11.Models; -using Migration.Toolkit.KXP.Context; - -public class PrimaryKeyLocatorService(ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory k11ContextFactory) - : IPrimaryKeyLocatorService -{ - private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer - { - public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); - - public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; - } - - private record CmsUserKey(Guid UserGuid, string UserName); - - public IEnumerable SelectAll(Expression> keyNameSelector) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var k11Context = k11ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - var memberName = keyNameSelector.GetMemberName(); - - logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); - - if (sourceType == typeof(CmsUser) && memberName == nameof(CmsUser.UserId)) - { - var sourceUsers = k11Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); - var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); - - var result = sourceUsers.Join(targetUsers, - a => new CmsUserKey(a.UserGuid, a.UserName), - b => new CmsUserKey(b.UserGuid, b.UserName), - (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), - new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(OmContact) && memberName == nameof(OmContact.ContactId)) - { - var source = k11Context.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - var target = kxpContext.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - - var result = source.Join(target, - a => a.ContactGuid, - b => b.ContactGuid, - (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(CmsTree) && memberName == nameof(CmsTree.NodeId)) - { - var source = k11Context.CmsTrees.Select(x => new { x.NodeId, x.NodeGuid }).ToList(); - var target = kxpContext.CmsChannels.Select(x => new { x.ChannelId, x.ChannelGuid }).ToList(); - - var result = source.Join(target, - a => a.NodeGuid, - b => b.ChannelGuid, - (a, b) => new SourceTargetKeyMapping(a.NodeId, b.ChannelId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(CmsState) && memberName == nameof(CmsState.StateId)) - { - var source = k11Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - - var result = source.Join(target, - a => a.StateName, - b => b.StateName, - (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(CmsCountry) && memberName == nameof(CmsCountry.CountryId)) - { - var source = k11Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - - var result = source.Join(target, - a => a.CountryName, - b => b.CountryName, - (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - - - throw new NotImplementedException(); - } - - public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) - { - using var kxpContext = kxpContextFactory.CreateDbContext(); - using var KX12Context = k11ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - targetId = -1; - try - { - if (sourceType == typeof(CmsResource)) - { - var k11Guid = KX12Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); - targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == k11Guid).Select(x => x.ResourceId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.K11.Models.CmsClass)) - { - var k11Guid = KX12Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); - targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == k11Guid).Select(x => x.ClassId).Single(); - return true; - } - - if (sourceType == typeof(CmsUser)) - { - var k11User = KX12Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); - targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == k11User.UserGuid || x.UserName == k11User.UserName).Select(x => x.UserId).Single(); - return true; - } - - if (sourceType == typeof(CmsRole)) - { - var k11Role = KX12Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); - targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == k11Role.RoleGuid).Select(x => x.RoleId).Single(); - return true; - } - - if (sourceType == typeof(CmsSite)) - { - var k11Guid = KX12Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k11Guid).Select(x => x.ChannelId).Single(); - return true; - } - - if (sourceType == typeof(CmsState)) - { - var k11CodeName = KX12Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); - targetId = kxpContext.CmsStates.Where(x => x.StateName == k11CodeName).Select(x => x.StateId).Single(); - return true; - } - - if (sourceType == typeof(CmsCountry)) - { - var k11CodeName = KX12Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); - targetId = kxpContext.CmsCountries.Where(x => x.CountryName == k11CodeName).Select(x => x.CountryId).Single(); - return true; - } - - if (sourceType == typeof(OmContactStatus)) - { - var k11Guid = KX12Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); - targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == k11Guid).Select(x => x.ContactStatusId).Single(); - return true; - } - - if (sourceType == typeof(OmContact)) - { - var k11Guid = KX12Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); - targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == k11Guid).Select(x => x.ContactId).Single(); - return true; - } - - if (sourceType == typeof(CmsTree)) - { - // careful - cms.root will have different guid - var k11Guid = KX12Context.CmsTrees.Where(c => c.NodeId == sourceId).Select(x => x.NodeGuid).Single(); - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k11Guid).Select(x => x.ChannelId).Single(); - return true; - } - } - catch (InvalidOperationException ioex) - { - if (ioex.Message.StartsWith("Sequence contains no elements")) - { - logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - else - { - logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - return false; - } - finally - { - if (targetId != -1) - { - logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); - } - } - - logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); - targetId = -1; - return false; - } -} \ No newline at end of file +using System.Linq.Expressions; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.K11; +using Migration.Toolkit.K11.Models; +using Migration.Toolkit.KXP.Context; + +namespace Migration.Toolkit.Core.K11.Services; + +public class PrimaryKeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory k11ContextFactory) + : IPrimaryKeyLocatorService +{ + public IEnumerable SelectAll(Expression> keyNameSelector) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var k11Context = k11ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + string memberName = keyNameSelector.GetMemberName(); + + logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); + + if (sourceType == typeof(CmsUser) && memberName == nameof(CmsUser.UserId)) + { + var sourceUsers = k11Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); + var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); + + var result = sourceUsers.Join(targetUsers, + a => new CmsUserKey(a.UserGuid, a.UserName), + b => new CmsUserKey(b.UserGuid, b.UserName), + (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), + new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(OmContact) && memberName == nameof(OmContact.ContactId)) + { + var source = k11Context.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + var target = kxpContext.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + + var result = source.Join(target, + a => a.ContactGuid, + b => b.ContactGuid, + (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(CmsState) && memberName == nameof(CmsState.StateId)) + { + var source = k11Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + + var result = source.Join(target, + a => a.StateName, + b => b.StateName, + (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(CmsCountry) && memberName == nameof(CmsCountry.CountryId)) + { + var source = k11Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + + var result = source.Join(target, + a => a.CountryName, + b => b.CountryName, + (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + + throw new NotImplementedException(); + } + + public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var KX12Context = k11ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + targetId = -1; + try + { + if (sourceType == typeof(CmsResource)) + { + var k11Guid = KX12Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); + targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == k11Guid).Select(x => x.ResourceId).Single(); + return true; + } + + if (sourceType == typeof(Toolkit.K11.Models.CmsClass)) + { + var k11Guid = KX12Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); + targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == k11Guid).Select(x => x.ClassId).Single(); + return true; + } + + if (sourceType == typeof(CmsUser)) + { + var k11User = KX12Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); + targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == k11User.UserGuid || x.UserName == k11User.UserName).Select(x => x.UserId).Single(); + return true; + } + + if (sourceType == typeof(CmsRole)) + { + var k11Role = KX12Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); + targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == k11Role.RoleGuid).Select(x => x.RoleId).Single(); + return true; + } + + if (sourceType == typeof(CmsSite)) + { + var k11Guid = KX12Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); + targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k11Guid).Select(x => x.ChannelId).Single(); + return true; + } + + if (sourceType == typeof(CmsState)) + { + string k11CodeName = KX12Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); + targetId = kxpContext.CmsStates.Where(x => x.StateName == k11CodeName).Select(x => x.StateId).Single(); + return true; + } + + if (sourceType == typeof(CmsCountry)) + { + string k11CodeName = KX12Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); + targetId = kxpContext.CmsCountries.Where(x => x.CountryName == k11CodeName).Select(x => x.CountryId).Single(); + return true; + } + + if (sourceType == typeof(OmContactStatus)) + { + string k11Guid = KX12Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); + targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == k11Guid).Select(x => x.ContactStatusId).Single(); + return true; + } + + if (sourceType == typeof(OmContact)) + { + var k11Guid = KX12Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); + targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == k11Guid).Select(x => x.ContactId).Single(); + return true; + } + } + catch (InvalidOperationException ioex) + { + if (ioex.Message.StartsWith("Sequence contains no elements")) + { + logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + else + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + + return false; + } + finally + { + if (targetId != -1) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); + } + } + + logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); + targetId = -1; + return false; + } + + private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer + { + public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); + + public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; + } + + private record CmsUserKey(Guid UserGuid, string UserName); +} diff --git a/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs b/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs index 08965db1..8226b38d 100644 --- a/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs +++ b/Migration.Toolkit.Core.K11/Services/TableReflectionService.cs @@ -1,45 +1,46 @@ -namespace Migration.Toolkit.Core.K11.Services; - -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.K11; - -public class TableReflectionService -{ - private readonly ILogger _logger; - private readonly Dictionary _tableNameLookup; - - public TableReflectionService(ILogger logger) - { - _logger = logger; - var (_, tableNameLookup) = typeof(K11Context).Assembly.GetTypes().Aggregate(( - nameLookup: new Dictionary(), - tableNameLookup: new Dictionary() - ), (lookups, type) => - { - var rh = new ReflectionHelper(type); - - if (rh.GetFirstAttributeOrNull()?.Name is { } tableName && !string.IsNullOrWhiteSpace(tableName)) - { - lookups.tableNameLookup[tableName] = type; - lookups.nameLookup[type.Name] = type; - } - - return lookups; - }); - - this._tableNameLookup = tableNameLookup; - } - - public Type GetSourceTableTypeByTableName(string tableName) - { - if (!_tableNameLookup.ContainsKey(tableName)) - { - var joinedKeys = string.Join(", ", _tableNameLookup.Keys); - _logger.LogError("Invalid table name, use one of following: {TableNames}", joinedKeys); - throw new KeyNotFoundException($"Invalid table name, use one of following: {joinedKeys}"); - } - return _tableNameLookup[tableName]; - } -} \ No newline at end of file +// using System.ComponentModel.DataAnnotations.Schema; +// using Microsoft.Extensions.Logging; +// using Migration.Toolkit.Common.Helpers; +// using Migration.Toolkit.K11; +// +// namespace Migration.Toolkit.Core.K11.Services; +// +// public class TableReflectionService +// { +// private readonly ILogger logger; +// private readonly Dictionary tableNameLookup; +// +// public TableReflectionService(ILogger logger) +// { +// this.logger = logger; +// var (_, tnl) = typeof(K11Context).Assembly.GetTypes().Aggregate(( +// nameLookup: new Dictionary(), +// tableNameLookup: new Dictionary() +// ), (lookups, type) => +// { +// var rh = new ReflectionHelper(type); +// +// if (rh.GetFirstAttributeOrNull()?.Name is { } tableName && !string.IsNullOrWhiteSpace(tableName)) +// { +// lookups.tableNameLookup[tableName] = type; +// lookups.nameLookup[type.Name] = type; +// } +// +// return lookups; +// }); +// +// tableNameLookup = tnl; +// } +// +// public Type GetSourceTableTypeByTableName(string tableName) +// { +// if (!tableNameLookup.TryGetValue(tableName, out var name)) +// { +// string joinedKeys = string.Join(", ", tableNameLookup.Keys); +// logger.LogError("Invalid table name, use one of following: {TableNames}", joinedKeys); +// throw new KeyNotFoundException($"Invalid table name, use one of following: {joinedKeys}"); +// } +// +// return name; +// } +// } diff --git a/Migration.Toolkit.Core.KX12/Auxiliary/NodeXmlAdapter.cs b/Migration.Toolkit.Core.KX12/Auxiliary/NodeXmlAdapter.cs deleted file mode 100644 index 9996072b..00000000 --- a/Migration.Toolkit.Core.KX12/Auxiliary/NodeXmlAdapter.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Auxiliary; - -using System; -using System.Xml.Linq; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Enumerations; - -internal class NodeXmlAdapter -{ - private readonly XElement _xClass; - - public bool ParsingSuccessful { get; } - - public NodeXmlAdapter(string xml) - { - var xDoc = XDocument.Parse(xml); - if (xDoc.Root?.FirstNode is XElement dClass) - { - _xClass = dClass; - ParsingSuccessful = true; - } - else - { - _xClass = null!; - ParsingSuccessful = false; - } - } - - public string? GetValue(string columnName) - { - return _xClass.Element(columnName)?.Value; - } - - public bool HasValueSet(string columnName) - { - return _xClass.Element(columnName) != null; - } - - public int? NodeID => _xClass.Element(NodeXmlColumns.NODE_ID)?.Value(); - public string? NodeAliasPath => _xClass.Element(NodeXmlColumns.NODE_ALIAS_PATH)?.Value; - public string? NodeName => _xClass.Element(NodeXmlColumns.NODE_NAME)?.Value; - public string? NodeAlias => _xClass.Element(NodeXmlColumns.NODE_ALIAS)?.Value; - public int? NodeClassID => _xClass.Element(NodeXmlColumns.NODE_CLASS_ID)?.Value(); - public int? NodeParentID => _xClass.Element(NodeXmlColumns.NODE_PARENT_ID)?.Value(); - public int? NodeLevel => _xClass.Element(NodeXmlColumns.NODE_LEVEL)?.Value(); - public int? NodeSiteID => _xClass.Element(NodeXmlColumns.NODE_SITE_ID)?.Value(); - public Guid? NodeGUID => _xClass.Element(NodeXmlColumns.NODE_GUID)?.Value(); - public int? NodeOrder => _xClass.Element(NodeXmlColumns.NODE_ORDER)?.Value(); - public int? NodeOwner => _xClass.Element(NodeXmlColumns.NODE_OWNER)?.Value(); - public bool? NodeHasChildren => _xClass.Element(NodeXmlColumns.NODE_HAS_CHILDREN)?.ValueAsBool(); - public bool? NodeHasLinks => _xClass.Element(NodeXmlColumns.NODE_HAS_LINKS)?.ValueAsBool(); - public int? NodeOriginalNodeID => _xClass.Element(NodeXmlColumns.NODE_ORIGINAL_NODE_ID)?.Value(); - public bool? NodeIsPage => _xClass.Element(NodeXmlColumns.NODE_IS_PAGE)?.ValueAsBool(); - public bool? NodeIsSecured => _xClass.Element(NodeXmlColumns.NODE_IS_SECURED)?.ValueAsBool(); - public int? DocumentID => _xClass.Element(NodeXmlColumns.DOCUMENT_ID)?.Value(); - public string? DocumentName => _xClass.Element(NodeXmlColumns.DOCUMENT_NAME)?.Value; - public DateTime? DocumentModifiedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_WHEN)?.Value(); - public int? DocumentModifiedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_BY_USER_ID)?.Value(); - public int? DocumentCreatedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_BY_USER_ID)?.Value(); - public DateTime? DocumentCreatedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_WHEN)?.Value(); - public int? DocumentCheckedOutVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID)?.Value(); - public int? DocumentPublishedVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_PUBLISHED_VERSION_HISTORY_ID)?.Value(); - public int? DocumentWorkflowStepID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_STEP_ID)?.Value(); - public string? DocumentCulture => _xClass.Element(NodeXmlColumns.DOCUMENT_CULTURE)?.Value; - public int? DocumentNodeID => _xClass.Element(NodeXmlColumns.DOCUMENT_NODE_ID)?.Value(); - public string? DocumentContent => _xClass.Element(NodeXmlColumns.DOCUMENT_CONTENT)?.Value; - public string? DocumentLastVersionNumber => _xClass.Element(NodeXmlColumns.DOCUMENT_LAST_VERSION_NUMBER)?.Value; - public bool? DocumentIsArchived => _xClass.Element(NodeXmlColumns.DOCUMENT_IS_ARCHIVED)?.ValueAsBool(); - public Guid? DocumentGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_GUID)?.Value(); - public Guid? DocumentWorkflowCycleGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_CYCLE_GUID)?.Value(); - public bool? DocumentCanBePublished => _xClass.Element(NodeXmlColumns.DOCUMENT_CAN_BE_PUBLISHED)?.ValueAsBool(); - public string? DocumentPageBuilderWidgets => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_BUILDER_WIDGETS)?.Value; - public string? ClassName => _xClass.Element(NodeXmlColumns.CLASS_NAME)?.Value; - - public string? DocumentPageTemplateConfiguration => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_TEMPLATE_CONFIGURATION)?.Value; -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs b/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs index 7129d51f..c095439f 100644 --- a/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs +++ b/Migration.Toolkit.Core.KX12/Behaviors/CommandConstraintBehavior.cs @@ -1,300 +1,229 @@ -namespace Migration.Toolkit.Core.KX12.Behaviors; - -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KX12; -using Migration.Toolkit.KX12.Context; - -public class CommandConstraintBehavior : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - private readonly ILogger> _logger; - private readonly IMigrationProtocol _protocol; - private readonly IDbContextFactory _kx12ContextFactory; - private readonly ToolkitConfiguration _toolkitConfiguration; - - public CommandConstraintBehavior( - ILogger> logger, - IMigrationProtocol protocol, - IDbContextFactory kx12ContextFactory, - ToolkitConfiguration toolkitConfiguration - ) - { - _logger = logger; - _protocol = protocol; - _kx12ContextFactory = kx12ContextFactory; - _toolkitConfiguration = toolkitConfiguration; - } - - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - try - { - var kx12Context = await _kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - var criticalCheckPassed = PerformChecks(request, kx12Context); - if (!criticalCheckPassed) - { - return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); - } - } - catch (Exception ex) - { - _protocol.CommandError(ex, request); - _logger.LogCritical(ex, "Error occured while checking command constraints"); - return (TResponse)(CommandResult)new CommandCheckFailedResult(false); - } - - return await next(); - } - - private bool PerformChecks(TRequest request, KX12Context KX12Context) - { - var criticalCheckPassed = true; - const string supportedVersion = "12.0.20"; - if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) - { - criticalCheckPassed &= CheckVersion(KX12Context, minimalVersion); - } - - // var sites = _toolkitConfiguration.RequireExplicitMapping(s => s.SiteId); - var sourceSites = KX12Context.CmsSites - .Include(s => s.Cultures) - .ToList(); - - foreach (var site in sourceSites) - { - criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); - } - - if (request is ICultureReliantCommand cultureReliantCommand) - { - criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); - } - - // criticalCheckPassed &= CheckDbCollations(); - - return criticalCheckPassed; - } - - private bool CheckVersion(KX12Context KX12Context, SemanticVersion minimalVersion) - { - var criticalCheckPassed = true; - - #region Check conclusion methods - - void UnableToReadVersionKey(string keyName) - { - _logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - _protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - ErrorKind = "Settings key value incorrect format", - SettingsKeyName = keyName, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void VersionKeyNotFound(string keyName) - { - _logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - _protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - ErrorKind = "Settings key not found", - SettingsKeyName = keyName, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void UpgradeNeeded(string keyName, string currentVersion) - { - _logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); - _protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - CurrentVersion = currentVersion, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void LowHotfix(string keyName, int currentHotfix) - { - _logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); - _protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - CurrentHotfix = currentHotfix.ToString(), - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - #endregion - - if (KX12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) - { - if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDataVersion); - } - - if (KX12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) - { - if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDBVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDBVersion); - } - - if (KX12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) - { - if (int.TryParse(cmsHotfixDataVersion.KeyValue, out var version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); - } - - if (KX12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) - { - if (int.TryParse(cmsHotfixVersion.KeyValue, out var version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); - } - - return criticalCheckPassed; - } - - private bool CheckSite(List sourceSites, int sourceSiteId) - { - var criticalCheckPassed = true; - if (sourceSites.All(s => s.SiteId != sourceSiteId)) - { - var supportedSites = sourceSites.Select(x => new - { - x.SiteName, - x.SiteId - }).ToArray(); - var supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); - _logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, - supportedSitesStr); - _protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") - .WithMessage("Check program argument '--siteId'") - .WithData(new - { - sourceSiteId, - AvailableSites = supportedSites - })); - criticalCheckPassed = false; - } - - return criticalCheckPassed; - } - - private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) - { - var criticalCheckPassed = true; - var cultureCode = cultureReliantCommand.CultureCode; - var siteCultureLookup = sourceSites - .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); - - foreach (var site in sourceSites) - { - if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) - { - var siteCultures = value.ToArray(); - if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) - { - var supportedCultures = string.Join(", ", siteCultures); - _logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); - _protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") - .WithMessage("Check program argument '--culture'") - .WithData(new - { - cultureCode, - site.SiteId, - SiteCultures = supportedCultures - })); - criticalCheckPassed = false; - } - } - } - - return criticalCheckPassed; - } - - // TODO tk: 2022-11-02 create global rule - private bool CheckDbCollations() - { - var kxCollation = GetDbCollationName(_toolkitConfiguration.KxConnectionString ?? throw new InvalidOperationException("KxConnectionString is required")); - var xbkCollation = GetDbCollationName(_toolkitConfiguration.XbKConnectionString ?? throw new InvalidOperationException("XbKConnectionString is required")); - var collationAreSame = kxCollation == xbkCollation; - if (!collationAreSame) - { - _logger.LogCritical("Source db collation '{SourceDbCollation}' is not same as target db collation {TargetDbCollation} => same collations are required", kxCollation, xbkCollation); - } - - return collationAreSame; - } - - private string? GetDbCollationName(string connectionString) - { - using var sqlConnection = new SqlConnection(connectionString); - using var sqlCommand = sqlConnection.CreateCommand(); - sqlCommand.CommandText = "SELECT DATABASEPROPERTYEX(DB_NAME(), 'Collation')"; - - sqlConnection.Open(); - return sqlCommand.ExecuteScalar() as string; - } -} \ No newline at end of file +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KX12; +using Migration.Toolkit.KX12.Context; + +namespace Migration.Toolkit.Core.KX12.Behaviors; + +public class CommandConstraintBehavior( + ILogger> logger, + IMigrationProtocol protocol, + IDbContextFactory kx12ContextFactory) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + try + { + var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + bool criticalCheckPassed = PerformChecks(request, kx12Context); + if (!criticalCheckPassed) + { + return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); + } + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogCritical(ex, "Error occured while checking command constraints"); + return (TResponse)(CommandResult)new CommandCheckFailedResult(false); + } + + return await next(); + } + + private bool PerformChecks(TRequest request, KX12Context kx12Context) + { + bool criticalCheckPassed = true; + const string supportedVersion = "12.0.20"; + if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) + { + criticalCheckPassed &= CheckVersion(kx12Context, minimalVersion); + } + + var sourceSites = kx12Context.CmsSites + .Include(s => s.Cultures) + .ToList(); + + foreach (var site in sourceSites) + { + criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); + } + + if (request is ICultureReliantCommand cultureReliantCommand) + { + criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); + } + + return criticalCheckPassed; + } + + private bool CheckVersion(KX12Context kx12Context, SemanticVersion minimalVersion) + { + bool criticalCheckPassed = true; + + #region Check conclusion methods + + void UnableToReadVersionKey(string keyName) + { + logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key value incorrect format", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void VersionKeyNotFound(string keyName) + { + logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key not found", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void UpgradeNeeded(string keyName, string currentVersion) + { + logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentVersion = currentVersion, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void LowHotfix(string keyName, int currentHotfix) + { + logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentHotfix = currentHotfix.ToString(), SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + #endregion + + if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) + { + if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) + { + if (cmsDataVer.IsLesserThan(minimalVersion)) + { + UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSDataVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSDataVersion); + } + + if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) + { + if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) + { + if (cmsDataVer.IsLesserThan(minimalVersion)) + { + UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSDBVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSDBVersion); + } + + if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) + { + if (int.TryParse(cmsHotfixDataVersion.KeyValue, out int version)) + { + if (version < minimalVersion.Hotfix) + { + LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); + } + + if (kx12Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) + { + if (int.TryParse(cmsHotfixVersion.KeyValue, out int version)) + { + if (version < minimalVersion.Hotfix) + { + LowHotfix(SettingsKeys.CMSHotfixVersion, version); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); + } + + return criticalCheckPassed; + } + + private bool CheckSite(List sourceSites, int sourceSiteId) + { + bool criticalCheckPassed = true; + if (sourceSites.All(s => s.SiteId != sourceSiteId)) + { + var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); + string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); + logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, + supportedSitesStr); + protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") + .WithMessage("Check program argument '--siteId'") + .WithData(new { sourceSiteId, AvailableSites = supportedSites })); + criticalCheckPassed = false; + } + + return criticalCheckPassed; + } + + private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) + { + bool criticalCheckPassed = true; + string cultureCode = cultureReliantCommand.CultureCode; + var siteCultureLookup = sourceSites + .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); + + foreach (var site in sourceSites) + { + if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) + { + string[] siteCultures = value.ToArray(); + if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) + { + string supportedCultures = string.Join(", ", siteCultures); + logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); + protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") + .WithMessage("Check program argument '--culture'") + .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); + criticalCheckPassed = false; + } + } + } + + return criticalCheckPassed; + } +} diff --git a/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs index 48a87f6e..5307143d 100644 --- a/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs +++ b/Migration.Toolkit.Core.KX12/Behaviors/RequestHandlingBehavior.cs @@ -1,36 +1,39 @@ -namespace Migration.Toolkit.Core.KX12.Behaviors; - -using System.Diagnostics; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; - -public class RequestHandlingBehavior(ILogger> logger, IMigrationProtocol protocol) - : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - var sw = Stopwatch.StartNew(); - logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); - try - { - protocol.CommandRequest(request); - var response = await next(); - protocol.CommandFinished(request, response); - return response; - } - catch (Exception ex) - { - protocol.CommandError(ex, request); - logger.LogError(ex, "Error occured"); - throw; - } - finally - { - logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); - } - } -} \ No newline at end of file +using System.Diagnostics; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; + +namespace Migration.Toolkit.Core.KX12.Behaviors; + +public class RequestHandlingBehavior(ILogger> logger, IMigrationProtocol protocol) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + var sw = Stopwatch.StartNew(); + logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); + try + { + protocol.CommandRequest(request); + var response = await next(); + protocol.CommandFinished(request, response); + return response; + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogError(ex, "Error occured"); + throw; + } + finally + { + logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); + } + } +} diff --git a/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs index 30e98c61..41f6d648 100644 --- a/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs +++ b/Migration.Toolkit.Core.KX12/Behaviors/XbKApiContextBehavior.cs @@ -1,53 +1,42 @@ -namespace Migration.Toolkit.Core.KX12.Behaviors; - -using CMS.Base; -using CMS.Membership; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; - -public class XbKApiContextBehavior : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - private readonly ILogger> _logger; - private readonly IMigrationProtocol _protocol; - private readonly KxpApiInitializer _initializer; - - public XbKApiContextBehavior( - ILogger> logger, - IMigrationProtocol protocol, - KxpApiInitializer initializer - ) - { - _logger = logger; - _protocol = protocol; - _initializer = initializer; - } - - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - _initializer.EnsureApiIsInitialized(); - - var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); - if (defaultAdmin == null) - { - _protocol.Append(HandbookReferences - .MissingRequiredDependency() - .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") - ); - throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); - } - - using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) - { - // TODO tk: 2022-11-25 revise in future - // MembershipContext.AuthenticatedUser = defaultAdmin; - - _logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); - return await next(); - } - } -} \ No newline at end of file +using CMS.Base; +using CMS.Membership; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.KX12.Behaviors; + +public class XbKApiContextBehavior( + ILogger> logger, + IMigrationProtocol protocol, + KxpApiInitializer initializer) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + initializer.EnsureApiIsInitialized(); + + var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); + if (defaultAdmin == null) + { + protocol.Append(HandbookReferences + .MissingRequiredDependency() + .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") + ); + throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); + } + + using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) + { + logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); + return await next(); + } + } +} diff --git a/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs index 5463364e..7a20a5d3 100644 --- a/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs +++ b/Migration.Toolkit.Core.KX12/Contexts/KeyMappingContext.cs @@ -1,42 +1,34 @@ -namespace Migration.Toolkit.Core.KX12.Contexts; - -using System.Linq.Expressions; -using Migration.Toolkit.Core.KX12.Services; - -public record MapSourceKeyResult(bool Success, TMapped? Mapped); - -public class KeyMappingContext -{ - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly KeyLocatorService _keyLocatorService; - - public KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) - { - _primaryKeyMappingContext = primaryKeyMappingContext; - _keyLocatorService = keyLocatorService; - } - - public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, - Expression> sourceGuidSelector, - object? sourceKey, - Expression> targetKeySelector, - Expression> targetGuidSelector) where TSource : class where TTarget : class - { - if (sourceKey is int id && _primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) - { - return new MapSourceKeyResult(true, targetKey); - } - - if (_keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) - { - return new MapSourceKeyResult(true, located); - } - - return new MapSourceKeyResult(false, default); - } - - public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => - _keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) - ? new MapSourceKeyResult(true, located) - : new MapSourceKeyResult(false, null); -} \ No newline at end of file +using System.Linq.Expressions; + +using Migration.Toolkit.Core.KX12.Services; + +namespace Migration.Toolkit.Core.KX12.Contexts; + +public record MapSourceKeyResult(bool Success, TMapped? Mapped); + +public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) +{ + public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, + Expression> sourceGuidSelector, + object? sourceKey, + Expression> targetKeySelector, + Expression> targetGuidSelector) where TSource : class where TTarget : class + { + if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) + { + return new MapSourceKeyResult(true, targetKey); + } + + if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) + { + return new MapSourceKeyResult(true, located); + } + + return new MapSourceKeyResult(false, default); + } + + public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => + keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) + ? new MapSourceKeyResult(true, located) + : new MapSourceKeyResult(false, null); +} diff --git a/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs index c2413042..0790c3a1 100644 --- a/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs +++ b/Migration.Toolkit.Core.KX12/Contexts/PrimaryKeyMappingContext.cs @@ -1,297 +1,287 @@ -namespace Migration.Toolkit.Core.KX12.Contexts; - -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reflection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Core.KX12.Services; - -public class PrimaryKeyMappingContext : IPrimaryKeyMappingContext -{ - private readonly Dictionary _mappings = new(StringComparer.OrdinalIgnoreCase); - - private readonly ILogger _logger; - private readonly IPrimaryKeyLocatorService _primaryKeyLocatorService; - private readonly ToolkitConfiguration _toolkitConfiguration; - - public PrimaryKeyMappingContext( - ILogger logger, - IPrimaryKeyLocatorService primaryKeyLocatorService, - ToolkitConfiguration toolkitConfiguration - ) - { - _logger = logger; - _primaryKeyLocatorService = primaryKeyLocatorService; - _toolkitConfiguration = toolkitConfiguration; - } - - private int? GetExplicitMappingOrNull(string memberName, int? sourceId) - { - if (sourceId == null) return null; - - var mappings = _toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; - if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) - { - return memberMappings.TryGetValue($"{sourceId}", out var mappedId) ? mappedId : null; - } - - return null; - } - - private static string CreateKey(Expression> keyNameSelector, int sourceId) - { - return $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; - } - - public void SetMapping(Type type, string keyName, int sourceId, int targetId) - { - Debug.Assert(sourceId > 0, "sourceId > 0"); - Debug.Assert(targetId > 0, "targetId > 0"); - - var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); - - Debug.Assert(foundProp != null, "foundProp != null"); - - var fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; - - _mappings[fullKeyName] = targetId; - _logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); - } - - public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - var fullKeyName = CreateKey(keyNameSelector, sourceId); - _mappings[fullKeyName] = targetId; - _logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); - } - - public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) - { - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sourceId); - if (sourceId == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - _logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - _logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - _logger.LogTrace("TryLocate {Key}", fullKeyName); - if (_primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out var targetId)) - { - SetMapping(keyNameSelector, sourceId, targetId); // cache id - _logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) - { - targetIdResult = -1; - if (!(sourceId is int sid)) - { - return false; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - _logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - targetIdResult = explicitlyMappedId; - return true; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - _logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - targetIdResult = resultId; - return true; - } - - _logger.LogTrace("TryLocate {Key}", fullKeyName); - if (_primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - _logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - targetIdResult = targetId; - return true; - } - - return false; - } - - public int? MapFromSource(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - _logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - _logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - _logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - _logger.LogTrace("TryLocate {Key}", fullKeyName); - if (_primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - _logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, $"Target entity is missing"); - } - - public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - _logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - _logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - _logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - _logger.LogTrace("TryLocate {Key}", fullKeyName); - if (_primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - _logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - return null; - } - - public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return new MapSourceIdResult(true, null); - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - _logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return new MapSourceIdResult(true, null); - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - _logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return new MapSourceIdResult(true, explicitlyMappedId); - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - _logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return new MapSourceIdResult(true, resultId); - } - - _logger.LogTrace("TryLocate {Key}", fullKeyName); - if (useLocator && _primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - _logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return new MapSourceIdResult(true, targetId); - } - - return new MapSourceIdResult(false, null); - } - - public void PreloadDependencies(Expression> keyNameSelector) - { - foreach (var (sourceId, targetId) in _primaryKeyLocatorService.SelectAll(keyNameSelector)) - { - SetMapping(keyNameSelector, sourceId, targetId); - } - } - - public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return true; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - return true; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { }) - { - return true; - } - - if (_mappings.TryGetValue(fullKeyName, out _)) - { - return true; - } - - if (useLocator && _primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) - { - return true; - } - - return false; - } -} \ No newline at end of file +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Core.KX12.Services; + +namespace Migration.Toolkit.Core.KX12.Contexts; + +public class PrimaryKeyMappingContext( + ILogger logger, + IPrimaryKeyLocatorService primaryKeyLocatorService, + ToolkitConfiguration toolkitConfiguration) + : IPrimaryKeyMappingContext +{ + private readonly Dictionary mappingsCache = new(StringComparer.OrdinalIgnoreCase); + + public void SetMapping(Type type, string keyName, int sourceId, int targetId) + { + Debug.Assert(sourceId > 0, "sourceId > 0"); + Debug.Assert(targetId > 0, "targetId > 0"); + + var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); + + Debug.Assert(foundProp != null, "foundProp != null"); + + string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; + + mappingsCache[fullKeyName] = targetId; + logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); + } + + public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) + { + string fullKeyName = CreateKey(keyNameSelector, sourceId); + mappingsCache[fullKeyName] = targetId; + logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); + } + + public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) + { + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sourceId); + if (sourceId == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) + { + SetMapping(keyNameSelector, sourceId, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) + { + targetIdResult = -1; + if (sourceId is not int sid) + { + return false; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + targetIdResult = explicitlyMappedId; + return true; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + targetIdResult = resultId; + return true; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + targetIdResult = targetId; + return true; + } + + return false; + } + + public int? MapFromSource(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + return null; + } + + public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return new MapSourceIdResult(true, null); + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return new MapSourceIdResult(true, null); + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return new MapSourceIdResult(true, explicitlyMappedId); + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return new MapSourceIdResult(true, resultId); + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return new MapSourceIdResult(true, targetId); + } + + return new MapSourceIdResult(false, null); + } + + public void PreloadDependencies(Expression> keyNameSelector) + { + foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) + { + SetMapping(keyNameSelector, sourceId, targetId); + } + } + + public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + return true; + } + + if (GetExplicitMappingOrNull(memberName, sid) is not null) + { + return true; + } + + if (mappingsCache.TryGetValue(fullKeyName, out _)) + { + return true; + } + + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) + { + return true; + } + + return false; + } + + private int? GetExplicitMappingOrNull(string memberName, int? sourceId) + { + if (sourceId == null) + { + return null; + } + + var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; + if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) + { + return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; + } + + return null; + } + + private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; +} diff --git a/Migration.Toolkit.Core.KX12/Contexts/SourceInstanceContext.cs b/Migration.Toolkit.Core.KX12/Contexts/SourceInstanceContext.cs deleted file mode 100644 index 8b8e4c07..00000000 --- a/Migration.Toolkit.Core.KX12/Contexts/SourceInstanceContext.cs +++ /dev/null @@ -1,112 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Contexts; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.KX12.Context; - -public class SourceInstanceContext -{ - private readonly IpcService _ipcService; - private readonly IDbContextFactory _kx12ContextFactory; - private readonly ILogger _logger; - private readonly ToolkitConfiguration _configuration; - - private readonly Dictionary _cachedInfos = new(StringComparer.InvariantCultureIgnoreCase); - - private bool _sourceInfoLoaded; - - public bool HasInfo => _cachedInfos.Count > 0 && _sourceInfoLoaded; - - public SourceInstanceContext(IpcService ipcService, IDbContextFactory kx12ContextFactory, ILogger logger, - ToolkitConfiguration configuration) - { - _ipcService = ipcService; - _kx12ContextFactory = kx12ContextFactory; - _logger = logger; - _configuration = configuration; - } - - public bool IsQuerySourceInstanceEnabled() - { - return _configuration.OptInFeatures?.QuerySourceInstanceApi?.Enabled ?? false; - } - - public async Task RequestSourceInstanceInfo() - { - if (!_sourceInfoLoaded) - { - var result = await _ipcService.GetSourceInstanceDiscoveredInfos(); - foreach (var (key, value) in result) - { - _cachedInfos.Add(key, value); - _logger.LogInformation("Source instance info loaded for site '{SiteName}' successfully", key); - } - - _sourceInfoLoaded = true; - } - - return _sourceInfoLoaded; - } - - public List? GetWidgetPropertyFormComponents(string siteName, string widgetIdentifier) - { - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.WidgetProperties != null && info.WidgetProperties.TryGetValue(widgetIdentifier, out var widgetProperties) - ? widgetProperties - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - - public List? GetPageTemplateFormComponents(string siteName, string pageTemplateIdentifier) - { - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.PageTemplateProperties != null && info.PageTemplateProperties.TryGetValue(pageTemplateIdentifier, out var pageTemplate) - ? pageTemplate - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - - public List? GetWidgetPropertyFormComponents(int siteId, string widgetIdentifier) - { - var context = _kx12ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - return GetWidgetPropertyFormComponents(siteName, widgetIdentifier); - } - - public List? GetPageTemplateFormComponents(int siteId, string pageTemplateIdentifier) - { - var context = _kx12ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - return GetPageTemplateFormComponents(siteName, pageTemplateIdentifier); - } - - public List? GetSectionFormComponents(int siteId, string sectionIdentifier) - { - var context = _kx12ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.SectionProperties != null && info.SectionProperties.TryGetValue(sectionIdentifier, out var sectionFcs) - ? sectionFcs - : null; - } - else - { - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Exceptions.cs b/Migration.Toolkit.Core.KX12/Exceptions.cs index 7e725554..b7ba75fc 100644 --- a/Migration.Toolkit.Core.KX12/Exceptions.cs +++ b/Migration.Toolkit.Core.KX12/Exceptions.cs @@ -1,13 +1,13 @@ -namespace Migration.Toolkit.Core.KX12; - -public class MappingFailureException : InvalidOperationException -{ - public string KeyName { get; } - public string Reason { get; } - - public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") - { - KeyName = keyName; - Reason = reason; - } -} \ No newline at end of file +namespace Migration.Toolkit.Core.KX12; + +public class MappingFailureException : InvalidOperationException +{ + public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") + { + KeyName = keyName; + Reason = reason; + } + + public string KeyName { get; } + public string Reason { get; } +} diff --git a/Migration.Toolkit.Core.KX12/GlobalUsings.cs b/Migration.Toolkit.Core.KX12/GlobalUsings.cs index f262502b..d87d0f35 100644 --- a/Migration.Toolkit.Core.KX12/GlobalUsings.cs +++ b/Migration.Toolkit.Core.KX12/GlobalUsings.cs @@ -1,3 +1,3 @@ -global using System; -global using KX12M = Migration.Toolkit.KX12.Models; -global using Migration.Toolkit; \ No newline at end of file +global using System; + +global using KX12M = Migration.Toolkit.KX12.Models; diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs index f87544f9..0a7a2904 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateContactManagementCommandHandler.cs @@ -1,368 +1,392 @@ -namespace Migration.Toolkit.Core.KX12.Handlers; - -using CMS.Activities; -using CMS.ContactManagement; -using CMS.ContentEngine; -using CMS.Websites.Internal; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Helpers; -using Migration.Toolkit.Core.KX12.Services; -using Migration.Toolkit.KX12.Models; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; - -public class MigrateContactManagementCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - BulkDataCopyService bulkDataCopyService, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - KeyMappingContext keyMappingContext, - CountryMigrator countryMigrator, - KxpClassFacade kxpClassFacade, - IProtocol protocol - ) - : IRequestHandler, IDisposable -{ - private readonly KxpContext _kxpContext = kxpContextFactory.CreateDbContext(); - - public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) - { - countryMigrator.MigrateCountriesAndStates(); - - if (MigrateContacts() is { } ccr) return Task.FromResult(ccr); - if (MigrateContactActivities() is { } acr) return Task.FromResult(acr); - - return Task.FromResult(new GenericCommandResult()); - } - - #region "Migrate contacts" - - private CommandResult? MigrateContacts() - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(OmContact.ContactId), nameof(KXP.Models.OmContact.ContactId) }, - { nameof(OmContact.ContactFirstName), nameof(KXP.Models.OmContact.ContactFirstName) }, - { nameof(OmContact.ContactMiddleName), nameof(KXP.Models.OmContact.ContactMiddleName) }, - { nameof(OmContact.ContactLastName), nameof(KXP.Models.OmContact.ContactLastName) }, - { nameof(OmContact.ContactJobTitle), nameof(KXP.Models.OmContact.ContactJobTitle) }, - { nameof(OmContact.ContactAddress1), nameof(KXP.Models.OmContact.ContactAddress1) }, - { nameof(OmContact.ContactCity), nameof(KXP.Models.OmContact.ContactCity) }, - { nameof(OmContact.ContactZip), nameof(KXP.Models.OmContact.ContactZip) }, - { nameof(OmContact.ContactStateId), nameof(KXP.Models.OmContact.ContactStateId) }, - { nameof(OmContact.ContactCountryId), nameof(KXP.Models.OmContact.ContactCountryId) }, - { nameof(OmContact.ContactMobilePhone), nameof(KXP.Models.OmContact.ContactMobilePhone) }, - { nameof(OmContact.ContactBusinessPhone), nameof(KXP.Models.OmContact.ContactBusinessPhone) }, - { nameof(OmContact.ContactEmail), nameof(KXP.Models.OmContact.ContactEmail) }, - // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, - { nameof(OmContact.ContactGender), nameof(KXP.Models.OmContact.ContactGender) }, - // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint - { nameof(OmContact.ContactNotes), nameof(KXP.Models.OmContact.ContactNotes) }, - { nameof(OmContact.ContactOwnerUserId), nameof(KXP.Models.OmContact.ContactOwnerUserId) }, - // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, - { nameof(OmContact.ContactGuid), nameof(KXP.Models.OmContact.ContactGuid) }, - { nameof(OmContact.ContactLastModified), nameof(KXP.Models.OmContact.ContactLastModified) }, - { nameof(OmContact.ContactCreated), nameof(KXP.Models.OmContact.ContactCreated) }, - // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, - { nameof(OmContact.ContactCampaign), nameof(KXP.Models.OmContact.ContactCampaign) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, - { nameof(OmContact.ContactCompanyName), nameof(KXP.Models.OmContact.ContactCompanyName) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) - { - protocol.Append(HandbookReferences - .BulkCopyColumnMismatch("OM_Contact") - .NeedsManualAction() - .WithData(differences) - ); - logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); - { - return new CommandFailureResult(); - } - } - - primaryKeyMappingContext.PreloadDependencies(u => u.UserId); - primaryKeyMappingContext.PreloadDependencies(u => u.StateId); - primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); - - var bulkCopyRequest = new BulkCopyRequest("OM_Contact", - s => true,// s => s != "ContactID", - _ => true, - 50000, - requiredColumnsForContactMigration.Keys.ToList(), - ContactValueInterceptor, - current => { logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)); }, - "ContactID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate contacts"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) - { - // autofix removed in favor of error report and data consistency - // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); - // return new ValueInterceptorResult(truncatedValue, true, false); - - if (value is string { Length: > 100 } s) - { - protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") - .WithData(new { value, maxLength = 100, s.Length, columnName, contact = PrintHelper.PrintDictionary(currentRow) }) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - // try search member - if (keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - sourceUserId, - t => t.MemberId, - t => t.MemberGuid - ) is { Success: true, Mapped: { } memberId }) - { - return ValueInterceptorResult.ReplaceValue(memberId); - } - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) - { - switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - #region "Migrate contact activities" - - private CommandResult? MigrateContactActivities() //(List migratedSiteIds) - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(OmActivity.ActivityId), nameof(KXP.Models.OmActivity.ActivityId) }, - { nameof(OmActivity.ActivityContactId), nameof(KXP.Models.OmActivity.ActivityContactId) }, - { nameof(OmActivity.ActivityCreated), nameof(KXP.Models.OmActivity.ActivityCreated) }, - { nameof(OmActivity.ActivityType), nameof(KXP.Models.OmActivity.ActivityType) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, - { nameof(OmActivity.ActivityValue), nameof(KXP.Models.OmActivity.ActivityValue) }, - { nameof(OmActivity.ActivityUrl), nameof(KXP.Models.OmActivity.ActivityUrl) }, - { nameof(OmActivity.ActivityTitle), nameof(KXP.Models.OmActivity.ActivityTitle) }, - { nameof(OmActivity.ActivitySiteId), nameof(KXP.Models.OmActivity.ActivityChannelId) }, - { nameof(OmActivity.ActivityComment), nameof(KXP.Models.OmActivity.ActivityComment) }, - // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 - { nameof(OmActivity.ActivityUrlreferrer), nameof(KXP.Models.OmActivity.ActivityUrlreferrer) }, - { nameof(OmActivity.ActivityCulture), nameof(KXP.Models.OmActivity.ActivityLanguageId) }, - { nameof(OmActivity.ActivityNodeId), nameof(KXP.Models.OmActivity.ActivityWebPageItemGuid) }, - { nameof(OmActivity.ActivityUtmsource), nameof(KXP.Models.OmActivity.ActivityUtmsource) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, - // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, - { nameof(OmActivity.ActivityUtmcontent), nameof(KXP.Models.OmActivity.ActivityUtmcontent) }, - }; - - foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) - { - protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); - logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - // _primaryKeyMappingContext.PreloadDependencies(u => u.NodeId); - // no need to preload contact, ID should stay same - // _primaryKeyMappingContext.PreloadDependencies(u => u.ContactId); - - var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", - s => true,// s => s != "ActivityID", - reader => true, // migratedSiteIds.Contains(reader.GetInt32(reader.GetOrdinal("ActivitySiteID"))), // TODO tk: 2022-07-07 move condition to source query - 50000, - requiredColumnsForContactMigration, - ActivityValueInterceptor, - current => { logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)); }, - "ActivityID" - ); - - logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - - try - { - bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to migrate activities"); - return new CommandFailureResult(); - } - return null; - } - - private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(KX12M.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && - value is int sourceActivitySiteId) - { - var result = keyMappingContext.MapSourceKey( - s => s.SiteId, - s => s.SiteGuid, - sourceActivitySiteId.NullIfZero(), - t => t.ChannelId, - t => t.ChannelGuid - ); - switch (result) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id ?? 0); - case { Success: false }: - { - switch (toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); - return ValueInterceptorResult.ReplaceValue(0); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - } - } - - if (columnName.Equals(nameof(KX12M.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) - { - var result = keyMappingContext.MapSourceKey( - s => s.NodeId, - s => s.NodeGuid, - activityNodeId.NullIfZero(), t => t.WebPageItemGuid, t => t.WebPageItemGuid); - switch (result) - { - case (true, var guid): - return ValueInterceptorResult.ReplaceValue(guid); - case { Success: false }: - { - switch (toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); - return ValueInterceptorResult.ReplaceValue(null); - case AutofixEnum.Error: - default: //error - protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - } - } - - if (columnName.Equals(nameof(KXP.Models.OmActivity.ActivityLanguageId), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) - { - return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); - } - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file +using CMS.Activities; +using CMS.ContactManagement; +using CMS.ContentEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.Core.KX12.Helpers; +using Migration.Toolkit.Core.KX12.Services; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Handlers; + +public class MigrateContactManagementCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + BulkDataCopyService bulkDataCopyService, + ToolkitConfiguration toolkitConfiguration, + PrimaryKeyMappingContext primaryKeyMappingContext, + KeyMappingContext keyMappingContext, + CountryMigrator countryMigrator, + KxpClassFacade kxpClassFacade, + ISpoiledGuidContext spoiledGuidContext, + IProtocol protocol +) + : IRequestHandler, IDisposable +{ + private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); + + public void Dispose() => kxpContext.Dispose(); + + public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) + { + countryMigrator.MigrateCountriesAndStates(); + + if (MigrateContacts() is { } ccr) + { + return Task.FromResult(ccr); + } + + if (MigrateContactActivities() is { } acr) + { + return Task.FromResult(acr); + } + + return Task.FromResult(new GenericCommandResult()); + } + + #region "Migrate contacts" + + private CommandResult? MigrateContacts() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(KX12M.OmContact.ContactId), nameof(OmContact.ContactId) }, + { nameof(KX12M.OmContact.ContactFirstName), nameof(OmContact.ContactFirstName) }, + { nameof(KX12M.OmContact.ContactMiddleName), nameof(OmContact.ContactMiddleName) }, + { nameof(KX12M.OmContact.ContactLastName), nameof(OmContact.ContactLastName) }, + { nameof(KX12M.OmContact.ContactJobTitle), nameof(OmContact.ContactJobTitle) }, + { nameof(KX12M.OmContact.ContactAddress1), nameof(OmContact.ContactAddress1) }, + { nameof(KX12M.OmContact.ContactCity), nameof(OmContact.ContactCity) }, + { nameof(KX12M.OmContact.ContactZip), nameof(OmContact.ContactZip) }, + { nameof(KX12M.OmContact.ContactStateId), nameof(OmContact.ContactStateId) }, + { nameof(KX12M.OmContact.ContactCountryId), nameof(OmContact.ContactCountryId) }, + { nameof(KX12M.OmContact.ContactMobilePhone), nameof(OmContact.ContactMobilePhone) }, + { nameof(KX12M.OmContact.ContactBusinessPhone), nameof(OmContact.ContactBusinessPhone) }, + { nameof(KX12M.OmContact.ContactEmail), nameof(OmContact.ContactEmail) }, + // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, + { nameof(KX12M.OmContact.ContactGender), nameof(OmContact.ContactGender) }, + // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint + { nameof(KX12M.OmContact.ContactNotes), nameof(OmContact.ContactNotes) }, + { nameof(KX12M.OmContact.ContactOwnerUserId), nameof(OmContact.ContactOwnerUserId) }, + // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, + { nameof(KX12M.OmContact.ContactGuid), nameof(OmContact.ContactGuid) }, + { nameof(KX12M.OmContact.ContactLastModified), nameof(OmContact.ContactLastModified) }, + { nameof(KX12M.OmContact.ContactCreated), nameof(OmContact.ContactCreated) }, + // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, + { nameof(KX12M.OmContact.ContactCampaign), nameof(OmContact.ContactCampaign) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, + { nameof(KX12M.OmContact.ContactCompanyName), nameof(OmContact.ContactCompanyName) } + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) + { + protocol.Append(HandbookReferences + .BulkCopyColumnMismatch("OM_Contact") + .NeedsManualAction() + .WithData(differences) + ); + logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); + { + return new CommandFailureResult(); + } + } + + primaryKeyMappingContext.PreloadDependencies(u => u.UserId); + primaryKeyMappingContext.PreloadDependencies(u => u.StateId); + primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); + + var bulkCopyRequest = new BulkCopyRequest("OM_Contact", + s => true, // s => s != "ContactID", + _ => true, + 50000, + requiredColumnsForContactMigration.Keys.ToList(), + ContactValueInterceptor, + current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), + "ContactID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate contacts"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) + { + // autofix removed in favor of error report and data consistency + // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); + // return new ValueInterceptorResult(truncatedValue, true, false); + + if (value is string { Length: > 100 } s) + { + protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") + .WithData(new + { + value, + maxLength = 100, + s.Length, + columnName, + contact = PrintHelper.PrintDictionary(currentRow) + }) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + // try search member + if (keyMappingContext.MapSourceKey( + s => s.UserId, + s => s.UserGuid, + sourceUserId, + t => t.MemberId, + t => t.MemberGuid + ) is { Success: true, Mapped: { } memberId }) + { + return ValueInterceptorResult.ReplaceValue(memberId); + } + + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + + return ValueInterceptorResult.DoNothing; + } + + #endregion + + #region "Migrate contact activities" + + private CommandResult? MigrateContactActivities() //(List migratedSiteIds) + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(KX12M.OmActivity.ActivityId), nameof(OmActivity.ActivityId) }, + { nameof(KX12M.OmActivity.ActivityContactId), nameof(OmActivity.ActivityContactId) }, + { nameof(KX12M.OmActivity.ActivityCreated), nameof(OmActivity.ActivityCreated) }, + { nameof(KX12M.OmActivity.ActivityType), nameof(OmActivity.ActivityType) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, + { nameof(KX12M.OmActivity.ActivityValue), nameof(OmActivity.ActivityValue) }, + { nameof(KX12M.OmActivity.ActivityUrl), nameof(OmActivity.ActivityUrl) }, + { nameof(KX12M.OmActivity.ActivityTitle), nameof(OmActivity.ActivityTitle) }, + { nameof(KX12M.OmActivity.ActivitySiteId), nameof(OmActivity.ActivityChannelId) }, + { nameof(KX12M.OmActivity.ActivityComment), nameof(OmActivity.ActivityComment) }, + // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 + { nameof(KX12M.OmActivity.ActivityUrlreferrer), nameof(OmActivity.ActivityUrlreferrer) }, + { nameof(KX12M.OmActivity.ActivityCulture), nameof(OmActivity.ActivityLanguageId) }, + { nameof(KX12M.OmActivity.ActivityNodeId), nameof(OmActivity.ActivityWebPageItemGuid) }, + { nameof(KX12M.OmActivity.ActivityUtmsource), nameof(OmActivity.ActivityUtmsource) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, + // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, + { nameof(KX12M.OmActivity.ActivityUtmcontent), nameof(OmActivity.ActivityUtmcontent) } + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + // _primaryKeyMappingContext.PreloadDependencies(u => u.NodeId); + // no need to preload contact, ID should stay same + // _primaryKeyMappingContext.PreloadDependencies(u => u.ContactId); + + var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", + s => true, // s => s != "ActivityID", + reader => true, // migratedSiteIds.Contains(reader.GetInt32(reader.GetOrdinal("ActivitySiteID"))), // TODO tk: 2022-07-07 move condition to source query + 50000, + requiredColumnsForContactMigration, + ActivityValueInterceptor, + current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), + "ActivityID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate activities"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(KX12M.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && + value is int sourceActivitySiteId) + { + var result = keyMappingContext.MapSourceKey( + s => s.SiteId, + s => s.SiteGuid, + sourceActivitySiteId.NullIfZero(), + t => t.ChannelId, + t => t.ChannelGuid + ); + switch (result) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id ?? 0); + case { Success: false }: + { + switch (toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); + return ValueInterceptorResult.ReplaceValue(0); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + default: + break; + } + } + + if (columnName.Equals(nameof(KX12M.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) + { + if (currentRow.TryGetValue(nameof(KX12M.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) + { + if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) + { + return ValueInterceptorResult.ReplaceValue(nodeGuid); + } + } + + switch (toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); + return ValueInterceptorResult.ReplaceValue(null); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(OmActivity.ActivityLanguageId), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) + { + return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); + } + + return ValueInterceptorResult.DoNothing; + } + + #endregion +} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs index 52d3d75a..746320b2 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateDataProtectionCommandHandler.cs @@ -1,284 +1,281 @@ -namespace Migration.Toolkit.Core.KX12.Handlers; - -using CMS.DataProtection; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KX12.Models; -using Migration.Toolkit.KXP.Context; - -public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _kx12ContextFactory; - private readonly IEntityMapper _consentMapper; - private readonly IEntityMapper _consentArchiveMapper; - private readonly IEntityMapper _consentAgreementMapper; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - - private KxpContext _kxpContext; - - private static readonly int _batchSize = 1000; - - public MigrateDataProtectionCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx12ContextFactory, - IEntityMapper consentMapper, - IEntityMapper consentArchiveMapper, - IEntityMapper consentAgreementMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _kx12ContextFactory = kx12ContextFactory; - _consentMapper = consentMapper; - _consentArchiveMapper = consentArchiveMapper; - _consentAgreementMapper = consentAgreementMapper; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - _kxpContext = _kxpContextFactory.CreateDbContext(); - } - - public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) - { - var batchSize = _batchSize; - - await MigrateConsent(cancellationToken); - await MigrateConsentArchive(cancellationToken); - await MigrateConsentAgreement(cancellationToken, batchSize); - - return new GenericCommandResult(); - } - - private async Task MigrateConsent(CancellationToken cancellationToken) - { - await using var kx12Context = await _kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var k12Consent in kx12Context.CmsConsents) - { - _protocol.FetchedSource(k12Consent); - _logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", k12Consent.ConsentName, k12Consent.ConsentGuid); - - var kxoConsent = await _kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == k12Consent.ConsentGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsent); - - var mapped = _consentMapper.Map(k12Consent, kxoConsent); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsent, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); - - if (newInstance) - { - _kxpContext.CmsConsents.Add(cmsConsent); - } - else - { - _kxpContext.CmsConsents.Update(cmsConsent); - } - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - _protocol.Success(k12Consent, cmsConsent, mapped); - _logger.LogEntitySetAction(newInstance, cmsConsent); - _primaryKeyMappingContext.SetMapping(r => r.ConsentId, k12Consent.ConsentId, cmsConsent.ConsentId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - _logger.LogEntitySetError(sqlException, newInstance, k12Consent); - _protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, k12Consent) - .WithMessage("Failed to migrate consent, target database constraint broken.") - ); - - await _kxpContext.DisposeAsync(); - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentArchive(CancellationToken cancellationToken) - { - await using var kx12Context = await _kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var k12ArchiveConsent in kx12Context.CmsConsentArchives) - { - _protocol.FetchedSource(k12ArchiveConsent); - _logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", k12ArchiveConsent.ConsentArchiveGuid); - - var kxoConsentArchive = await _kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == k12ArchiveConsent.ConsentArchiveGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsentArchive); - - var mapped = _consentArchiveMapper.Map(k12ArchiveConsent, kxoConsentArchive); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsentArchive, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); - - if (newInstance) - { - _kxpContext.CmsConsentArchives.Add(cmsConsentArchive); - } - else - { - _kxpContext.CmsConsentArchives.Update(cmsConsentArchive); - } - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - _protocol.Success(k12ArchiveConsent, cmsConsentArchive, mapped); - _logger.LogEntitySetAction(newInstance, cmsConsentArchive); - _primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, - k12ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - _logger.LogEntitySetError(sqlException, newInstance, k12ArchiveConsent); - _protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, k12ArchiveConsent) - .WithMessage("Failed to migrate consent archive, target database constraint broken.") - ); - - await _kxpContext.DisposeAsync(); - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) - { - await using var kx12Context = await _kx12ContextFactory.CreateDbContextAsync(cancellationToken); - var index = 0; - var indexFull = 0; - var consentAgreementUpdates = new List(); - var consentAgreementNews = new List(); - var itemsCount = kx12Context.CmsConsentAgreements.Count(); - - foreach (var k12ConsentAgreement in kx12Context.CmsConsentAgreements) - { - _protocol.FetchedSource(k12ConsentAgreement); - _logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", k12ConsentAgreement.ConsentAgreementGuid); - - var kxoConsentAgreement = await _kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == k12ConsentAgreement.ConsentAgreementGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsentAgreement); - - var mapped = _consentAgreementMapper.Map(k12ConsentAgreement, kxoConsentAgreement); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsentAgreement, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); - - if (newInstance) - { - consentAgreementNews.Add(cmsConsentAgreement); - } - else - { - consentAgreementUpdates.Add(cmsConsentAgreement); - } - } - - index++; - indexFull++; - - if (index == batchSize || indexFull == itemsCount) - { - _kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); - _kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - foreach (var newK12ConsentAgreement in consentAgreementNews) - { - _protocol.Success(k12ConsentAgreement, newK12ConsentAgreement, mapped); - _logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", - newK12ConsentAgreement.ConsentAgreementGuid); - } - - foreach (var updateK12ConsentAgreement in consentAgreementUpdates) - { - _protocol.Success(k12ConsentAgreement, updateK12ConsentAgreement, mapped); - _logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", - updateK12ConsentAgreement.ConsentAgreementGuid); - } - } - catch (DbUpdateException dbUpdateException) when ( - dbUpdateException.InnerException is SqlException sqlException && - sqlException.Message.Contains("Cannot insert duplicate key row in object") - ) - { - await _kxpContext.DisposeAsync(); - - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementNews) - ); - _logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); - - - _protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementUpdates) - ); - - var cai = ConsentAgreementInfo.New(); - _protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrint(cai) - ); - - _logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); - - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - finally - { - index = 0; - consentAgreementUpdates = new List(); - consentAgreementNews = new List(); - } - } - } - - return new GenericCommandResult(); - } - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file +using CMS.DataProtection; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KX12.Context; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Handlers; + +public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable +{ + private static readonly int batchSize = 1000; + private readonly IEntityMapper consentAgreementMapper; + private readonly IEntityMapper consentArchiveMapper; + private readonly IEntityMapper consentMapper; + private readonly IDbContextFactory kx12ContextFactory; + private readonly IDbContextFactory kxpContextFactory; + private readonly ILogger logger; + private readonly PrimaryKeyMappingContext primaryKeyMappingContext; + private readonly IProtocol protocol; + + private KxpContext kxpContext; + + public MigrateDataProtectionCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx12ContextFactory, + IEntityMapper consentMapper, + IEntityMapper consentArchiveMapper, + IEntityMapper consentAgreementMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) + { + this.logger = logger; + this.kxpContextFactory = kxpContextFactory; + this.kx12ContextFactory = kx12ContextFactory; + this.consentMapper = consentMapper; + this.consentArchiveMapper = consentArchiveMapper; + this.consentAgreementMapper = consentAgreementMapper; + this.primaryKeyMappingContext = primaryKeyMappingContext; + this.protocol = protocol; + kxpContext = this.kxpContextFactory.CreateDbContext(); + } + + public void Dispose() => kxpContext.Dispose(); + + public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) + { + await MigrateConsent(cancellationToken); + await MigrateConsentArchive(cancellationToken); + await MigrateConsentAgreement(cancellationToken, batchSize); + + return new GenericCommandResult(); + } + + private async Task MigrateConsent(CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var k12Consent in kx12Context.CmsConsents) + { + protocol.FetchedSource(k12Consent); + logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", k12Consent.ConsentName, k12Consent.ConsentGuid); + + var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == k12Consent.ConsentGuid, cancellationToken); + protocol.FetchedTarget(kxoConsent); + + var mapped = consentMapper.Map(k12Consent, kxoConsent); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsent, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); + + if (newInstance) + { + kxpContext.CmsConsents.Add(cmsConsent); + } + else + { + kxpContext.CmsConsents.Update(cmsConsent); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(k12Consent, cmsConsent, mapped); + logger.LogEntitySetAction(newInstance, cmsConsent); + primaryKeyMappingContext.SetMapping(r => r.ConsentId, k12Consent.ConsentId, cmsConsent.ConsentId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, k12Consent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, k12Consent) + .WithMessage("Failed to migrate consent, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentArchive(CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var k12ArchiveConsent in kx12Context.CmsConsentArchives) + { + protocol.FetchedSource(k12ArchiveConsent); + logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", k12ArchiveConsent.ConsentArchiveGuid); + + var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == k12ArchiveConsent.ConsentArchiveGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentArchive); + + var mapped = consentArchiveMapper.Map(k12ArchiveConsent, kxoConsentArchive); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentArchive, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); + + if (newInstance) + { + kxpContext.CmsConsentArchives.Add(cmsConsentArchive); + } + else + { + kxpContext.CmsConsentArchives.Update(cmsConsentArchive); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(k12ArchiveConsent, cmsConsentArchive, mapped); + logger.LogEntitySetAction(newInstance, cmsConsentArchive); + primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, + k12ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, k12ArchiveConsent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, k12ArchiveConsent) + .WithMessage("Failed to migrate consent archive, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + int index = 0; + int indexFull = 0; + var consentAgreementUpdates = new List(); + var consentAgreementNews = new List(); + int itemsCount = kx12Context.CmsConsentAgreements.Count(); + + foreach (var k12ConsentAgreement in kx12Context.CmsConsentAgreements) + { + protocol.FetchedSource(k12ConsentAgreement); + logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", k12ConsentAgreement.ConsentAgreementGuid); + + var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == k12ConsentAgreement.ConsentAgreementGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentAgreement); + + var mapped = consentAgreementMapper.Map(k12ConsentAgreement, kxoConsentAgreement); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentAgreement, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); + + if (newInstance) + { + consentAgreementNews.Add(cmsConsentAgreement); + } + else + { + consentAgreementUpdates.Add(cmsConsentAgreement); + } + } + + index++; + indexFull++; + + if (index == batchSize || indexFull == itemsCount) + { + kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); + kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + foreach (var newK12ConsentAgreement in consentAgreementNews) + { + protocol.Success(k12ConsentAgreement, newK12ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", + newK12ConsentAgreement.ConsentAgreementGuid); + } + + foreach (var updateK12ConsentAgreement in consentAgreementUpdates) + { + protocol.Success(k12ConsentAgreement, updateK12ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", + updateK12ConsentAgreement.ConsentAgreementGuid); + } + } + catch (DbUpdateException dbUpdateException) when ( + dbUpdateException.InnerException is SqlException sqlException && + sqlException.Message.Contains("Cannot insert duplicate key row in object") + ) + { + await kxpContext.DisposeAsync(); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementNews) + ); + logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); + + + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementUpdates) + ); + + var cai = ConsentAgreementInfo.New(); + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrint(cai) + ); + + logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); + + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + finally + { + index = 0; + consentAgreementUpdates = []; + consentAgreementNews = []; + } + } + } + + return new GenericCommandResult(); + } +} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateMediaLibrariesCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateMediaLibrariesCommandHandler.cs deleted file mode 100644 index d53984a6..00000000 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateMediaLibrariesCommandHandler.cs +++ /dev/null @@ -1,247 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Handlers; - -using CMS.Base; -using CMS.MediaLibrary; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Mappers; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KX12.Models; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Context; - -public class MigrateMediaLibrariesCommandHandler : IRequestHandler, IDisposable -{ - private const string DIR_MEDIA = "media"; - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _kx12ContextFactory; - private readonly IEntityMapper _mediaLibraryInfoMapper; - private readonly KxpMediaFileFacade _mediaFileFacade; - private readonly IEntityMapper _mediaFileInfoMapper; - private readonly ToolkitConfiguration _toolkitConfiguration; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - - private KxpContext _kxpContext; - - public MigrateMediaLibrariesCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx12ContextFactory, - IEntityMapper mediaLibraryInfoMapper, - KxpMediaFileFacade mediaFileFacade, - IEntityMapper mediaFileInfoMapper, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _kx12ContextFactory = kx12ContextFactory; - _mediaLibraryInfoMapper = mediaLibraryInfoMapper; - _mediaFileFacade = mediaFileFacade; - _mediaFileInfoMapper = mediaFileInfoMapper; - _toolkitConfiguration = toolkitConfiguration; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - _kxpContext = kxpContextFactory.CreateDbContext(); - } - - public async Task Handle(MigrateMediaLibrariesCommand request, CancellationToken cancellationToken) - { - await using var kx12Context = await _kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - var k12MediaLibraries = kx12Context.MediaLibraries - .Include(ml => ml.LibrarySite) - .OrderBy(t => t.LibraryId) - ; - - var migratedMediaLibraries = new List<(MediaLibrary sourceLibrary, MediaLibraryInfo targetLibrary)>(); - foreach (var k12MediaLibrary in k12MediaLibraries) - { - _protocol.FetchedSource(k12MediaLibrary); - - if (k12MediaLibrary.LibraryGuid is not { } mediaLibraryGuid) - { - _protocol.Append(HandbookReferences - .InvalidSourceData() - .WithId(nameof(MediaLibrary.LibraryId), k12MediaLibrary.LibraryId) - .WithMessage("Media library has missing MediaLibraryGUID") - ); - continue; - } - - var mediaLibraryInfo = _mediaFileFacade.GetMediaLibraryInfo(mediaLibraryGuid); - - _protocol.FetchedTarget(mediaLibraryInfo); - - var mapped = _mediaLibraryInfoMapper.Map(k12MediaLibrary, mediaLibraryInfo); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (mfi, newInstance) = result; - ArgumentNullException.ThrowIfNull(mfi, nameof(mfi)); - - try - { - _mediaFileFacade.SetMediaLibrary(mfi); - - _protocol.Success(k12MediaLibrary, mfi, mapped); - _logger.LogEntitySetAction(newInstance, mfi); - } - catch (Exception ex) - { - await _kxpContext.DisposeAsync(); // reset context errors - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(mfi) - ); - _logger.LogEntitySetError(ex, newInstance, mfi); - continue; - } - - _primaryKeyMappingContext.SetMapping( - r => r.LibraryId, - k12MediaLibrary.LibraryId, - mfi.LibraryID - ); - - migratedMediaLibraries.Add((k12MediaLibrary, mfi)); - } - } - - await RequireMigratedMediaFiles(migratedMediaLibraries, kx12Context, cancellationToken); - - return new GenericCommandResult(); - } - - private record LoadMediaFileResult(bool Found, IUploadedFile? File); - private LoadMediaFileResult LoadMediaFileBinary(string? sourceMediaLibraryPath, string relativeFilePath, string contentType) - { - if (sourceMediaLibraryPath == null) - { - return new LoadMediaFileResult(false, null); - } - - var filePath = Path.Combine(sourceMediaLibraryPath, relativeFilePath); - if (File.Exists(filePath)) - { - var data = File.ReadAllBytes(filePath); - var dummyFile = DummyUploadedFile.FromByteArray(data, contentType, data.LongLength, Path.GetFileName(filePath)); - return new LoadMediaFileResult(true, dummyFile); - } - - return new LoadMediaFileResult(false, null); - } - - private async Task RequireMigratedMediaFiles( - List<(MediaLibrary sourceLibrary, MediaLibraryInfo targetLibrary)> migratedMediaLibraries, - KX12Context KX12Context, CancellationToken cancellationToken) - { - var kxoDbContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - try - { - foreach (var (sourceMediaLibrary, targetMediaLibrary) in migratedMediaLibraries) - { - string? sourceMediaLibraryPath = null; - var loadMediaFileData = false; - if (!_toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(true) && - !string.IsNullOrWhiteSpace(_toolkitConfiguration.KxCmsDirPath)) - { - sourceMediaLibraryPath = Path.Combine(_toolkitConfiguration.KxCmsDirPath, sourceMediaLibrary.LibrarySite.SiteName, DIR_MEDIA, sourceMediaLibrary.LibraryFolder); - loadMediaFileData = true; - } - - var k12MediaFiles = KX12Context.MediaFiles - .Where(x => x.FileLibraryId == sourceMediaLibrary.LibraryId); - - foreach (var k12MediaFile in k12MediaFiles) - { - _protocol.FetchedSource(k12MediaFile); - - bool found = false; - IUploadedFile? uploadedFile = null; - if (loadMediaFileData) - { - (found, uploadedFile) = LoadMediaFileBinary(sourceMediaLibraryPath, k12MediaFile.FilePath, k12MediaFile.FileMimeType); - if (!found) - { - // TODO tk: 2022-07-07 report missing file (currently reported in mapper) - } - } - - var librarySubfolder = Path.GetDirectoryName(k12MediaFile.FilePath); - - var kxoMediaFile = _mediaFileFacade.GetMediaFile(k12MediaFile.FileGuid); - - _protocol.FetchedTarget(kxoMediaFile); - - var source = new MediaFileInfoMapperSource(k12MediaFile, targetMediaLibrary.LibraryID, found ? uploadedFile : null, - librarySubfolder, _toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false)); - var mapped = _mediaFileInfoMapper.Map(source, kxoMediaFile); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (mf, newInstance) = result; - ArgumentNullException.ThrowIfNull(mf, nameof(mf)); - - try - { - if (newInstance) - { - _mediaFileFacade.EnsureMediaFilePathExistsInLibrary(mf, targetMediaLibrary.LibraryID); - } - - _mediaFileFacade.SetMediaFile(mf, newInstance); - await _kxpContext.SaveChangesAsync(cancellationToken); - - _protocol.Success(k12MediaFile, mf, mapped); - _logger.LogEntitySetAction(newInstance, mf); - } - catch (Exception ex) // TODO tk: 2022-05-18 handle exceptions - { - await kxoDbContext.DisposeAsync(); // reset context errors - kxoDbContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(mf) - ); - _logger.LogEntitySetError(ex, newInstance, mf); - continue; - } - - _primaryKeyMappingContext.SetMapping( - r => r.FileId, - k12MediaFile.FileId, - mf.FileID - ); - } - } - } - } - finally - { - await kxoDbContext.DisposeAsync(); - } - } - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs index d2cc6bb5..a0f1b766 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateMembersCommandHandler.cs @@ -1,110 +1,112 @@ -namespace Migration.Toolkit.Core.KX12.Handlers; - -using System.Diagnostics; -using CMS.Membership; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Mappers; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Api.Enums; - -public class MigrateMembersCommandHandler( - ILogger logger, - IDbContextFactory kx12ContextFactory, - IEntityMapper memberInfoMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - private static int[] MigratedAdminUserPrivilegeLevels => new[] { (int)UserPrivilegeLevelEnum.None }; - - public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) - { - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - var k12CmsUsers = kx12Context.CmsUsers - .Include(u => u.CmsUserSettingUserSettingsUserNavigation) - .Where(u => MigratedAdminUserPrivilegeLevels.Contains(u.UserPrivilegeLevel)) - ; - - foreach (var k12User in k12CmsUsers) - { - protocol.FetchedSource(k12User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", k12User.UserName, k12User.UserGuid); - - var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(k12User.UserGuid); - - protocol.FetchedTarget(xbkMemberInfo); - - // no member shall be admin, editor - Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin"); - Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin"); - Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor"); - - if (xbkMemberInfo?.MemberName == USER_PUBLIC || k12User.UserName == USER_PUBLIC) - { - continue; - } - - var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(k12User, k12User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); - protocol.MappedTarget(mapped); - - SaveUserUsingKenticoApi(mapped, k12User); - } - - return new GenericCommandResult(); - } - - private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX12M.CmsUser k12User) - { - if (mapped is { Success: true } result) - { - var (memberInfo, newInstance) = result; - ArgumentNullException.ThrowIfNull(memberInfo); - - try - { - MemberInfoProvider.ProviderObject.Set(memberInfo); - - protocol.Success(k12User, memberInfo, mapped); - logger.LogEntitySetAction(newInstance, memberInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, memberInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k12User) - .WithData(new { k12User.UserName, k12User.UserGuid, k12User.UserId, }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return; - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, memberInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(memberInfo) - ); - return; - } - - // left for OM_Activity - primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, memberInfo.MemberID); - } - } - - public void Dispose() - { - - } -} \ No newline at end of file +using System.Diagnostics; + +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.Core.KX12.Mappers; +using Migration.Toolkit.KX12.Context; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Api.Enums; + +namespace Migration.Toolkit.Core.KX12.Handlers; + +public class MigrateMembersCommandHandler( + ILogger logger, + IDbContextFactory kx12ContextFactory, + IEntityMapper memberInfoMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + var k12CmsUsers = kx12Context.CmsUsers + .Include(u => u.CmsUserSettingUserSettingsUserNavigation) + .Where(u => UserHelper.PrivilegeLevelsMigratedAsMemberUser.Contains(u.UserPrivilegeLevel)) + ; + + foreach (var k12User in k12CmsUsers) + { + protocol.FetchedSource(k12User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", k12User.UserName, k12User.UserGuid); + + var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(k12User.UserGuid); + + protocol.FetchedTarget(xbkMemberInfo); + + // no member shall be admin, editor + Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin"); + Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin"); + Debug.Assert(k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor, "k12User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor"); + + if (xbkMemberInfo?.MemberName == USER_PUBLIC || k12User.UserName == USER_PUBLIC) + { + continue; + } + + var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(k12User, k12User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, k12User); + } + + return new GenericCommandResult(); + } + + private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX12M.CmsUser k12User) + { + if (mapped is { Success: true } result) + { + (var memberInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(memberInfo); + + try + { + MemberInfoProvider.ProviderObject.Set(memberInfo); + + protocol.Success(k12User, memberInfo, mapped); + logger.LogEntitySetAction(newInstance, memberInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, memberInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k12User) + .WithData(new { k12User.UserName, k12User.UserGuid, k12User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, memberInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(memberInfo) + ); + return; + } + + // left for OM_Activity + primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, memberInfo.MemberID); + } + } +} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs index 06ad3826..12e365b1 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateSettingKeysCommandHandler.cs @@ -1,105 +1,84 @@ -namespace Migration.Toolkit.Core.KX12.Handlers; - -using CMS.DataEngine; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KX12.Models; - -public class MigrateSettingKeysCommandHandler : IRequestHandler -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kx12ContextFactory; - private readonly ToolkitConfiguration _toolkitConfiguration; - private readonly IProtocol _protocol; - private readonly IEntityMapper _mapper; - - public MigrateSettingKeysCommandHandler( - ILogger logger, - IEntityMapper mapper, - IDbContextFactory kx12ContextFactory, - ToolkitConfiguration toolkitConfiguration, - IProtocol protocol - ) - { - _logger = logger; - _mapper = mapper; - _kx12ContextFactory = kx12ContextFactory; - _toolkitConfiguration = toolkitConfiguration; - _protocol = protocol; - } - - public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = _toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - await using var kx12Context = await _kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - _logger.LogInformation("CmsSettingsKey synchronization starting"); - var cmsSettingsKeys = kx12Context.CmsSettingsKeys - .Where(csk => csk.SiteId == null) - .AsNoTrackingWithIdentityResolution() - ; - - foreach (var k12CmsSettingsKey in cmsSettingsKeys) - { - _protocol.FetchedSource(k12CmsSettingsKey); - - var kxoGlobalSettingsKey = GetKxoSettingsKey(k12CmsSettingsKey); - - var canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; - var kxoCmsSettingsKey = k12CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(k12CmsSettingsKey); - - if (!canBeMigrated) - { - _logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", k12CmsSettingsKey.KeyName); - _protocol.Append( - HandbookReferences - .NotCurrentlySupportedSkip() - .WithId(nameof(k12CmsSettingsKey.KeyId), k12CmsSettingsKey.KeyId) - .WithMessage("Settings key is not supported in target instance") - .WithData(new - { - k12CmsSettingsKey.KeyName, - k12CmsSettingsKey.SiteId, - k12CmsSettingsKey.KeyGuid - }) - ); - continue; - } - - _protocol.FetchedTarget(kxoCmsSettingsKey); - - if (entityConfiguration.ExcludeCodeNames.Contains(k12CmsSettingsKey.KeyName)) - { - _protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, k12CmsSettingsKey); - _logger.LogWarning("KeyName {KeyName} is excluded => skipping", k12CmsSettingsKey.KeyName); - continue; - } - - var mapped = _mapper.Map(k12CmsSettingsKey, kxoCmsSettingsKey); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); - - SettingsKeyInfoProvider.ProviderObject.Set(result.Item); - - _protocol.Success(k12CmsSettingsKey, kxoCmsSettingsKey, mapped); - _logger.LogEntitySetAction(result.NewInstance, result.Item); - } - } - - return new GenericCommandResult(); - } - - private SettingsKeyInfo? GetKxoSettingsKey(CmsSettingsKey k12CmsSettingsKey) - { - return SettingsKeyInfoProvider.ProviderObject.Get(k12CmsSettingsKey.KeyName); - } -} \ No newline at end of file +using CMS.DataEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KX12.Context; + +namespace Migration.Toolkit.Core.KX12.Handlers; + +public class MigrateSettingKeysCommandHandler( + ILogger logger, + IEntityMapper mapper, + IDbContextFactory kx12ContextFactory, + ToolkitConfiguration toolkitConfiguration, + IProtocol protocol) + : IRequestHandler +{ + public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); + + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + logger.LogInformation("CmsSettingsKey synchronization starting"); + var cmsSettingsKeys = kx12Context.CmsSettingsKeys + .Where(csk => csk.SiteId == null) + .AsNoTrackingWithIdentityResolution() + ; + + foreach (var k12CmsSettingsKey in cmsSettingsKeys) + { + protocol.FetchedSource(k12CmsSettingsKey); + + var kxoGlobalSettingsKey = GetKxoSettingsKey(k12CmsSettingsKey); + + bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; + var kxoCmsSettingsKey = k12CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(k12CmsSettingsKey); + + if (!canBeMigrated) + { + logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", k12CmsSettingsKey.KeyName); + protocol.Append( + HandbookReferences + .NotCurrentlySupportedSkip() + .WithId(nameof(k12CmsSettingsKey.KeyId), k12CmsSettingsKey.KeyId) + .WithMessage("Settings key is not supported in target instance") + .WithData(new { k12CmsSettingsKey.KeyName, k12CmsSettingsKey.SiteId, k12CmsSettingsKey.KeyGuid }) + ); + continue; + } + + protocol.FetchedTarget(kxoCmsSettingsKey); + + if (entityConfiguration.ExcludeCodeNames.Contains(k12CmsSettingsKey.KeyName)) + { + protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, k12CmsSettingsKey); + logger.LogWarning("KeyName {KeyName} is excluded => skipping", k12CmsSettingsKey.KeyName); + continue; + } + + var mapped = mapper.Map(k12CmsSettingsKey, kxoCmsSettingsKey); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); + + SettingsKeyInfoProvider.ProviderObject.Set(result.Item); + + protocol.Success(k12CmsSettingsKey, kxoCmsSettingsKey, mapped); + logger.LogEntitySetAction(result.NewInstance, result.Item); + } + } + + return new GenericCommandResult(); + } + + private SettingsKeyInfo? GetKxoSettingsKey(KX12M.CmsSettingsKey k12CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(k12CmsSettingsKey.KeyName); +} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs index 19d85d09..ff88afc7 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateSitesCommandHandler.cs @@ -1,187 +1,190 @@ -namespace Migration.Toolkit.Core.KX12.Handlers; - -using CMS.ContentEngine; -using CMS.Websites; -using Kentico.Xperience.UMT.Model; -using Kentico.Xperience.UMT.Services; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Helpers; -using Migration.Toolkit.KX12; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KX12.Models; - -// ReSharper disable once UnusedType.Global -public class MigrateSitesCommandHandler(ILogger logger, - IDbContextFactory kx12ContextFactory, - IProtocol protocol, - IImporter importer) - : IRequestHandler -{ - public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) - { - await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); - foreach (var kx12CmsSite in kx12Context.CmsSites.Include(s => s.Cultures)) - { - protocol.FetchedSource(kx12CmsSite); - logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", kx12CmsSite.SiteName, kx12CmsSite.SiteGuid); - - var defaultCultureCode = GetSiteCulture(kx12CmsSite); - var migratedSiteCultures = kx12CmsSite.Cultures.ToList(); - if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) - { - await using var ctx = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); - if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) - { - migratedSiteCultures.Add(defaultCulture); - } - } - - foreach (var cmsCulture in migratedSiteCultures) - { - var existing = ContentLanguageInfoProvider.ProviderObject.Get() - .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) - .FirstOrDefault(); - - if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) - { - existing.ContentLanguageGUID = cmsCulture.CultureGuid; - existing.Update(); - } - - if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) continue; - var langResult = await importer.ImportAsync(new ContentLanguageModel - { - ContentLanguageGUID = cmsCulture.CultureGuid, - ContentLanguageDisplayName = cmsCulture.CultureName, - ContentLanguageName = cmsCulture.CultureCode, - ContentLanguageIsDefault = true, - ContentLanguageFallbackContentLanguageGuid = null, - ContentLanguageCultureFormat = cmsCulture.CultureCode - }); - - if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) - { - migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); - logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); - } - } - - // var homePageNodeAliasPath = KenticoHelper.GetSettingsKey(_kx12ContextFactory, kx12CmsSite.SiteId, SettingsKeys.CMSDefaultAliasPath); - var cookieLevel = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch - { - "all" => CookieLevelConstants.ALL, - "visitor" => CookieLevelConstants.VISITOR, - "editor" => CookieLevelConstants.EDITOR, - "system" => CookieLevelConstants.SYSTEM, - "essential" => CookieLevelConstants.ESSENTIAL, - _ => (int?)null - }; - var storeFormerUrls = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSStoreFormerUrls") is string storeFormerUrlsStr - ? bool.TryParse(storeFormerUrlsStr, out var sfu) ? (bool?)sfu : null - : true; - - var channelResult = await importer.ImportAsync(new ChannelModel - { - ChannelDisplayName = kx12CmsSite.SiteDisplayName, - ChannelName = kx12CmsSite.SiteName, - ChannelGUID = kx12CmsSite.SiteGuid, - ChannelType = ChannelType.Website - }); - - var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel - { - WebsiteChannelGUID = kx12CmsSite.SiteGuid, - WebsiteChannelChannelGuid = kx12CmsSite.SiteGuid, - WebsiteChannelDomain = kx12CmsSite.SiteDomainName, - // WebsiteChannelHomePage = homePageNodeAliasPath, - WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, - WebsiteChannelDefaultCookieLevel = cookieLevel, - WebsiteChannelStoreFormerUrls = storeFormerUrls - }); - - if (!webSiteChannelResult.Success) - { - if (webSiteChannelResult.ModelValidationResults != null) - { - foreach (var mvr in webSiteChannelResult.ModelValidationResults) - { - logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); - } - } - else - { - logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); - } - return new CommandFailureResult(); - } - - if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) - { - var cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaPublicKey") as string; - var cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaPrivateKey") as string; - - WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; - var cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaV3PrivateKey") as string; - var cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSRecaptchaV3PublicKey") as string; - var cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSRecaptchaV3Threshold"); - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) - { - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, - WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3, - }; - } - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) - { - if (reCaptchaSettings is not null) - { - logger.LogError(""" - Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. - Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' - or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. - """); - throw new InvalidOperationException("Invalid ReCaptcha settings"); - } - - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2, - }; - } - - if (reCaptchaSettings != null) - { - WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); - } - } - } - - return new GenericCommandResult(); - } - - private string GetSiteCulture(CmsSite site) - { - // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() - // domain alias skipped, HttpContext logic skipped - var siteCulture = site.SiteDefaultVisitorCulture.NullIf(string.Empty) - ?? KenticoHelper.GetSettingsKey(kx12ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); - - return siteCulture - ?? throw new InvalidOperationException("Unknown site culture"); - } -} \ No newline at end of file +using CMS.ContentEngine; +using CMS.Websites; + +using Kentico.Xperience.UMT.Model; +using Kentico.Xperience.UMT.Services; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Helpers; +using Migration.Toolkit.KX12; +using Migration.Toolkit.KX12.Context; + +namespace Migration.Toolkit.Core.KX12.Handlers; + +// ReSharper disable once UnusedType.Global +public class MigrateSitesCommandHandler( + ILogger logger, + IDbContextFactory kx12ContextFactory, + IProtocol protocol, + IImporter importer) + : IRequestHandler +{ + public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); + foreach (var kx12CmsSite in kx12Context.CmsSites.Include(s => s.Cultures)) + { + protocol.FetchedSource(kx12CmsSite); + logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", kx12CmsSite.SiteName, kx12CmsSite.SiteGuid); + + string defaultCultureCode = GetSiteCulture(kx12CmsSite); + var migratedSiteCultures = kx12CmsSite.Cultures.ToList(); + if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) + { + await using var ctx = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) + { + migratedSiteCultures.Add(defaultCulture); + } + } + + foreach (var cmsCulture in migratedSiteCultures) + { + var existing = ContentLanguageInfoProvider.ProviderObject.Get() + .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) + .FirstOrDefault(); + + if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) + { + existing.ContentLanguageGUID = cmsCulture.CultureGuid; + existing.Update(); + } + + if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) + { + continue; + } + + var langResult = await importer.ImportAsync(new ContentLanguageModel + { + ContentLanguageGUID = cmsCulture.CultureGuid, + ContentLanguageDisplayName = cmsCulture.CultureName, + ContentLanguageName = cmsCulture.CultureCode, + ContentLanguageIsDefault = true, + ContentLanguageFallbackContentLanguageGuid = null, + ContentLanguageCultureFormat = cmsCulture.CultureCode + }); + + if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) + { + migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); + logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); + } + } + + // var homePageNodeAliasPath = KenticoHelper.GetSettingsKey(_kx12ContextFactory, kx12CmsSite.SiteId, SettingsKeys.CMSDefaultAliasPath); + int? cookieLevel = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch + { + "all" => CookieLevelConstants.ALL, + "visitor" => CookieLevelConstants.VISITOR, + "editor" => CookieLevelConstants.EDITOR, + "system" => CookieLevelConstants.SYSTEM, + "essential" => CookieLevelConstants.ESSENTIAL, + _ => null + }; + bool? storeFormerUrls = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSStoreFormerUrls") is string storeFormerUrlsStr + ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null + : true; + + var channelResult = await importer.ImportAsync(new ChannelModel { ChannelDisplayName = kx12CmsSite.SiteDisplayName, ChannelName = kx12CmsSite.SiteName, ChannelGUID = kx12CmsSite.SiteGuid, ChannelType = ChannelType.Website }); + + var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel + { + WebsiteChannelGUID = kx12CmsSite.SiteGuid, + WebsiteChannelChannelGuid = kx12CmsSite.SiteGuid, + WebsiteChannelDomain = kx12CmsSite.SiteDomainName, + // WebsiteChannelHomePage = homePageNodeAliasPath, + WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, + WebsiteChannelDefaultCookieLevel = cookieLevel, + WebsiteChannelStoreFormerUrls = storeFormerUrls + }); + + if (!webSiteChannelResult.Success) + { + if (webSiteChannelResult.ModelValidationResults != null) + { + foreach (var mvr in webSiteChannelResult.ModelValidationResults) + { + logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); + } + } + else + { + logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); + } + + return new CommandFailureResult(); + } + + if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) + { + string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaPublicKey"); + string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaPrivateKey"); + + WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; + string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); + string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); + double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(kx12ContextFactory, kx12CmsSite.SiteId, "CMSRecaptchaV3Threshold"); + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) + { + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, + WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 + }; + } + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) + { + if (reCaptchaSettings is not null) + { + logger.LogError(""" + Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. + Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' + or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. + """); + throw new InvalidOperationException("Invalid ReCaptcha settings"); + } + + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 + }; + } + + if (reCaptchaSettings != null) + { + WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); + } + } + } + + return new GenericCommandResult(); + } + + private string GetSiteCulture(KX12M.CmsSite site) + { + // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() + // domain alias skipped, HttpContext logic skipped + string? siteCulture = site.SiteDefaultVisitorCulture.NullIf(string.Empty) + ?? KenticoHelper.GetSettingsKey(kx12ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); + + return siteCulture + ?? throw new InvalidOperationException("Unknown site culture"); + } +} diff --git a/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs index fe021393..b0c2f475 100644 --- a/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs +++ b/Migration.Toolkit.Core.KX12/Handlers/MigrateUsersCommandHandler.cs @@ -1,254 +1,234 @@ -namespace Migration.Toolkit.Core.KX12.Handlers; - -using CMS.Membership; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Api.Enums; - -public class MigrateUsersCommandHandler : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - private readonly ILogger _logger; - private readonly IDbContextFactory _kx12ContextFactory; - private readonly IEntityMapper _userInfoMapper; - private readonly IEntityMapper _roleMapper; - private readonly IEntityMapper _userRoleMapper; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - - private static int[] MigratedAdminUserPrivilegeLevels => new[] { (int)UserPrivilegeLevelEnum.Editor, (int)UserPrivilegeLevelEnum.Admin, (int)UserPrivilegeLevelEnum.GlobalAdmin }; - - public MigrateUsersCommandHandler( - ILogger logger, - IDbContextFactory kx12ContextFactory, - IEntityMapper userInfoMapper, - IEntityMapper roleMapper, - IEntityMapper userRoleMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - _logger = logger; - _kx12ContextFactory = kx12ContextFactory; - _userInfoMapper = userInfoMapper; - _roleMapper = roleMapper; - _userRoleMapper = userRoleMapper; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - } - - public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) - { - await using var kx12Context = await _kx12ContextFactory.CreateDbContextAsync(cancellationToken); - - var k12CmsUsers = kx12Context.CmsUsers - .Where(u => MigratedAdminUserPrivilegeLevels.Contains(u.UserPrivilegeLevel)) - ; - - foreach (var k12User in k12CmsUsers) - { - _protocol.FetchedSource(k12User); - _logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", k12User.UserName, k12User.UserGuid); - - var xbkUserInfo = UserInfoProvider.ProviderObject.Get(k12User.UserGuid); - - _protocol.FetchedTarget(xbkUserInfo); - - if (k12User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) - { - _protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); - _logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", k12User.UserGuid); - _primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, xbkUserInfo.UserID); - continue; - } - - if (xbkUserInfo?.UserName == USER_PUBLIC || k12User.UserName == USER_PUBLIC) - { - _protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); - _logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? k12User.UserGuid); - if (xbkUserInfo != null) - { - _primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, xbkUserInfo.UserID); - } - - continue; - } - - var mapped = _userInfoMapper.Map(k12User, xbkUserInfo); - _protocol.MappedTarget(mapped); - - await SaveUserUsingKenticoApi(cancellationToken, mapped, k12User); - } - - await MigrateUserCmsRoles(kx12Context, cancellationToken); - - return new GenericCommandResult(); - } - - private async Task SaveUserUsingKenticoApi(CancellationToken cancellationToken, IModelMappingResult mapped, KX12M.CmsUser k12User) - { - if (mapped is { Success: true } result) - { - var (userInfo, newInstance) = result; - ArgumentNullException.ThrowIfNull(userInfo); - - try - { - UserInfoProvider.ProviderObject.Set(userInfo); - - _protocol.Success(k12User, userInfo, mapped); - _logger.LogEntitySetAction(newInstance, userInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - _logger.LogEntitySetError(sqlException, newInstance, userInfo); - _protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k12User) - .WithData(new { k12User.UserName, k12User.UserGuid, k12User.UserId, }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return false; - } - catch (Exception ex) - { - _logger.LogEntitySetError(ex, newInstance, userInfo); - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(userInfo) - ); - return false; - } - - _primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, userInfo.UserID); - return true; - } - - return false; - } - - private async Task MigrateUserCmsRoles(KX12Context KX12Context, CancellationToken cancellationToken) - { - var k12CmsRoles = KX12Context.CmsRoles - .Where(r => - r.CmsUserRoles.Any(ur => MigratedAdminUserPrivilegeLevels.Contains(ur.User.UserPrivilegeLevel)) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var k12CmsRole in k12CmsRoles.WithCancellation(cancellationToken)) - { - _protocol.FetchedSource(k12CmsRole); - - var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(k12CmsRole.RoleGuid); - _protocol.FetchedTarget(xbkRoleInfo); - var mapped = _roleMapper.Map(k12CmsRole, xbkRoleInfo); - _protocol.MappedTarget(mapped); - - if (mapped is not (var roleInfo, var newInstance) { Success: true }) - { - continue; - } - - ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); - try - { - RoleInfoProvider.ProviderObject.Set(roleInfo); - - _protocol.Success(k12CmsRole, roleInfo, mapped); - _logger.LogEntitySetAction(newInstance, roleInfo); - - _primaryKeyMappingContext.SetMapping( - r => r.RoleId, - k12CmsRole.RoleId, - roleInfo.RoleID - ); - } - catch (Exception ex) - { - _logger.LogEntitySetError(ex, newInstance, roleInfo); - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(roleInfo) - ); - continue; - } - - await MigrateUserRole(k12CmsRole.RoleId); - } - } - - private async Task MigrateUserRole(int k12RoleId) - { - var kx12Context = await _kx12ContextFactory.CreateDbContextAsync(); - var k12UserRoles = kx12Context.CmsUserRoles - .Where(ur => - ur.RoleId == k12RoleId && - MigratedAdminUserPrivilegeLevels.Contains(ur.User.UserPrivilegeLevel) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var k12UserRole in k12UserRoles) - { - _protocol.FetchedSource(k12UserRole); - if (!_primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, k12RoleId, out var xbkRoleId)) - { - var handbookRef = HandbookReferences - .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), k12UserRole.RoleId) - .NeedsManualAction(); - - _protocol.Append(handbookRef); - _logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", k12UserRole.RoleId); - continue; - } - - if (!_primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, k12UserRole.UserId, out var xbkUserId)) - { - continue; - } - - var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); - _protocol.FetchedTarget(xbkUserRole); - - var mapped = _userRoleMapper.Map(k12UserRole, xbkUserRole); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true }) - { - var (userRoleInfo, newInstance) = mapped; - ArgumentNullException.ThrowIfNull(userRoleInfo); - - try - { - UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); - - _protocol.Success(k12UserRole, userRoleInfo, mapped); - _logger.LogEntitySetAction(newInstance, userRoleInfo); - } - catch (Exception ex) - { - _logger.LogEntitySetError(ex, newInstance, userRoleInfo); - _protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) - .WithData(new { k12UserRole.UserRoleId, k12UserRole.UserId, k12UserRole.RoleId, }) - .WithMessage("Failed to migrate user role") - ); - } - } - } - } - - public void Dispose() - { - - } -} \ No newline at end of file +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KX12.Context; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Api.Enums; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Handlers; + +public class MigrateUsersCommandHandler( + ILogger logger, + IDbContextFactory kx12ContextFactory, + IEntityMapper userInfoMapper, + IEntityMapper roleMapper, + IEntityMapper userRoleMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) + { + await using var kx12Context = await kx12ContextFactory.CreateDbContextAsync(cancellationToken); + + var k12CmsUsers = kx12Context.CmsUsers + .Where(u => UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(u.UserPrivilegeLevel)) + ; + + foreach (var k12User in k12CmsUsers) + { + protocol.FetchedSource(k12User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", k12User.UserName, k12User.UserGuid); + + var xbkUserInfo = UserInfoProvider.ProviderObject.Get(k12User.UserGuid); + + protocol.FetchedTarget(xbkUserInfo); + + if (k12User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) + { + protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", k12User.UserGuid); + primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, xbkUserInfo.UserID); + continue; + } + + if (xbkUserInfo?.UserName == USER_PUBLIC || k12User.UserName == USER_PUBLIC) + { + protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? k12User.UserGuid); + if (xbkUserInfo != null) + { + primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, xbkUserInfo.UserID); + } + + continue; + } + + var mapped = userInfoMapper.Map(k12User, xbkUserInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, k12User); + } + + await MigrateUserCmsRoles(kx12Context, cancellationToken); + + return new GenericCommandResult(); + } + + private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX12M.CmsUser k12User) + { + if (mapped is { Success: true } result) + { + (var userInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(userInfo); + + try + { + UserInfoProvider.ProviderObject.Set(userInfo); + + protocol.Success(k12User, userInfo, mapped); + logger.LogEntitySetAction(newInstance, userInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, userInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, k12User) + .WithData(new { k12User.UserName, k12User.UserGuid, k12User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(userInfo) + ); + return; + } + + primaryKeyMappingContext.SetMapping(r => r.UserId, k12User.UserId, userInfo.UserID); + } + } + + private async Task MigrateUserCmsRoles(KX12Context kx12Context, CancellationToken cancellationToken) + { + var k12CmsRoles = kx12Context.CmsRoles + .Where(r => + r.CmsUserRoles.Any(ur => UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(ur.User.UserPrivilegeLevel)) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var k12CmsRole in k12CmsRoles.WithCancellation(cancellationToken)) + { + protocol.FetchedSource(k12CmsRole); + + var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(k12CmsRole.RoleGuid); + protocol.FetchedTarget(xbkRoleInfo); + var mapped = roleMapper.Map(k12CmsRole, xbkRoleInfo); + protocol.MappedTarget(mapped); + + if (mapped is not (var roleInfo, var newInstance) { Success: true }) + { + continue; + } + + ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); + try + { + RoleInfoProvider.ProviderObject.Set(roleInfo); + + protocol.Success(k12CmsRole, roleInfo, mapped); + logger.LogEntitySetAction(newInstance, roleInfo); + + primaryKeyMappingContext.SetMapping( + r => r.RoleId, + k12CmsRole.RoleId, + roleInfo.RoleID + ); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, roleInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(roleInfo) + ); + continue; + } + + await MigrateUserRole(k12CmsRole.RoleId); + } + } + + private async Task MigrateUserRole(int k12RoleId) + { + var kx12Context = await kx12ContextFactory.CreateDbContextAsync(); + var k12UserRoles = kx12Context.CmsUserRoles + .Where(ur => + ur.RoleId == k12RoleId && + UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(ur.User.UserPrivilegeLevel) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var k12UserRole in k12UserRoles) + { + protocol.FetchedSource(k12UserRole); + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, k12RoleId, out int xbkRoleId)) + { + var handbookRef = HandbookReferences + .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), k12UserRole.RoleId) + .NeedsManualAction(); + + protocol.Append(handbookRef); + logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", k12UserRole.RoleId); + continue; + } + + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, k12UserRole.UserId, out int xbkUserId)) + { + continue; + } + + var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); + protocol.FetchedTarget(xbkUserRole); + + var mapped = userRoleMapper.Map(k12UserRole, xbkUserRole); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true }) + { + (var userRoleInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(userRoleInfo); + + try + { + UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); + + protocol.Success(k12UserRole, userRoleInfo, mapped); + logger.LogEntitySetAction(newInstance, userRoleInfo); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userRoleInfo); + protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) + .WithData(new { k12UserRole.UserRoleId, k12UserRole.UserId, k12UserRole.RoleId }) + .WithMessage("Failed to migrate user role") + ); + } + } + } + } +} diff --git a/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs index dae5f108..821fc479 100644 --- a/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs +++ b/Migration.Toolkit.Core.KX12/Helpers/KenticoHelper.cs @@ -1,46 +1,46 @@ -namespace Migration.Toolkit.Core.KX12.Helpers; - -using System.Globalization; -using CMS.Helpers; -using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.KX12.Context; - -public static class KenticoHelper -{ - public static void CopyCustomData(ContainerCustomData target, string? sourceXml) - { - var customNodeData = new ContainerCustomData(); - customNodeData.LoadData(sourceXml); - foreach (var columnName in customNodeData.ColumnNames) - { - target.SetValue(columnName, customNodeData.GetValue(columnName)); - } - } - - public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) - { - using var kx12Context = ctxf.CreateDbContext(); - var keys = kx12Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - - return (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - } - - public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable - { - using var kx12Context = ctxf.CreateDbContext(); - var keys = kx12Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - var value = (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - - - return T.TryParse(value, CultureInfo.InvariantCulture, out var result) - ? result - : null; - } - - public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable - { - return T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); - } -} \ No newline at end of file +using System.Globalization; + +using CMS.Helpers; + +using Microsoft.EntityFrameworkCore; + +using Migration.Toolkit.KX12.Context; + +namespace Migration.Toolkit.Core.KX12.Helpers; + +public static class KenticoHelper +{ + public static void CopyCustomData(ContainerCustomData target, string? sourceXml) + { + var customNodeData = new ContainerCustomData(); + customNodeData.LoadData(sourceXml); + foreach (string? columnName in customNodeData.ColumnNames) + { + target.SetValue(columnName, customNodeData.GetValue(columnName)); + } + } + + public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) + { + using var kx12Context = ctxf.CreateDbContext(); + var keys = kx12Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + + return (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + } + + public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable + { + using var kx12Context = ctxf.CreateDbContext(); + var keys = kx12Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + + + return T.TryParse(value, CultureInfo.InvariantCulture, out var result) + ? result + : null; + } + + public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); +} diff --git a/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs index 8374b51b..c136dac6 100644 --- a/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs +++ b/Migration.Toolkit.Core.KX12/Helpers/PrintHelper.cs @@ -1,7 +1,7 @@ -namespace Migration.Toolkit.Core.KX12.Helpers; - -public static class PrintHelper -{ - public static string PrintDictionary(Dictionary dictionary) => - string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); -} \ No newline at end of file +namespace Migration.Toolkit.Core.KX12.Helpers; + +public static class PrintHelper +{ + public static string PrintDictionary(Dictionary dictionary) => + string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); +} diff --git a/Migration.Toolkit.Core.KX12/Helpers/Printer.cs b/Migration.Toolkit.Core.KX12/Helpers/Printer.cs index 378d3071..aada412c 100644 --- a/Migration.Toolkit.Core.KX12/Helpers/Printer.cs +++ b/Migration.Toolkit.Core.KX12/Helpers/Printer.cs @@ -1,121 +1,103 @@ -namespace Migration.Toolkit.Core.KX12.Helpers; - -using CMS.DataEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.KXP.Models; - -public class Printer -{ - public static string PrintKxpModelInfo(T model) - { - var currentTypeName = ReflectionHelper.CurrentType.Name; - - return model switch - { - MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", - MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", - CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", - CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", - CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", - CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", - CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", - CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", - OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", - - null => $"{currentTypeName}: ", - _ => $"TODO: {typeof(T).FullName}" - }; - } - - public static string GetEntityIdentityPrint(T model, bool printType = true) - { - var currentTypeName = ReflectionHelper.CurrentType.Name; - - string Fallback(object obj) => printType - ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" - : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}" - ; - - string FormatModel(string inner) => printType - ? $"{currentTypeName}({inner})" - : $"{inner}" - ; - - return model switch - { - MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), - MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), - DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - - CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - - ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), - CMS.FormEngine.AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), - UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), - RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), - MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), - - CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), - CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), - CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), - - KX12M.CmsPageTemplateConfiguration item => FormatModel($"ID={item.PageTemplateConfigurationId}, GUID={item.PageTemplateConfigurationGuid}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteId}"), - KX12M.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), - KX12M.CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), - KX12M.CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), - KX12M.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - KX12M.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - KX12M.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - KX12M.CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), - KX12M.CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), - KX12M.CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), - KX12M.CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), - KX12M.CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), - - null => $" ref of {currentTypeName}", - _ => Fallback(model) - }; - } - - public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") - { - return string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); - } - - public static string PrintEnumValues(string separator) where TEnum : struct, Enum - { - return string.Join(separator, Enum.GetValues()); - } -} - -public class PrintService : IPrintService -{ - public string PrintKxpModelInfo(T model) - { - return Printer.PrintKxpModelInfo(model); - } - - public string GetEntityIdentityPrint(T model, bool printType = true) - { - return Printer.GetEntityIdentityPrint(model, printType); - } - - public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") - { - return Printer.GetEntityIdentityPrints(models, separator); - } - - public string PrintEnumValues(string separator) where TEnum : struct, Enum - { - return Printer.PrintEnumValues(separator); - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; + +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Helpers; + +public class Printer +{ + public static string PrintKxpModelInfo(T model) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + return model switch + { + MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", + MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", + CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", + CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", + CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", + CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", + CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", + CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", + OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", + + null => $"{currentTypeName}: ", + _ => $"TODO: {typeof(T).FullName}" + }; + } + + public static string GetEntityIdentityPrint(T model, bool printType = true) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + string Fallback(object obj) => printType + ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" + : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; + + string FormatModel(string inner) => printType + ? $"{currentTypeName}({inner})" + : $"{inner}"; + + return model switch + { + MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), + MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), + DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + + CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + + ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), + AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), + UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), + RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), + MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), + + CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), + CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), + CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), + + KX12M.CmsPageTemplateConfiguration item => FormatModel($"ID={item.PageTemplateConfigurationId}, GUID={item.PageTemplateConfigurationGuid}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteId}"), + KX12M.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), + KX12M.CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), + KX12M.CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), + KX12M.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + KX12M.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + KX12M.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + KX12M.CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), + KX12M.CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), + KX12M.CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), + KX12M.CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), + KX12M.CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), + + null => $" ref of {currentTypeName}", + _ => Fallback(model) + }; + } + + public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); + + public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); +} + +public class PrintService : IPrintService +{ + public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); + + public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); + + public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); + + public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); +} diff --git a/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs b/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs index 35dc8415..8a1c679c 100644 --- a/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs +++ b/Migration.Toolkit.Core.KX12/KX12CoreDiExtensions.cs @@ -1,107 +1,69 @@ -namespace Migration.Toolkit.Core.KX12; - -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using CMS.OnlineForms; -using CMS.Websites; -using Kentico.Xperience.UMT; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.Core.KX12.Behaviors; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Handlers; -using Migration.Toolkit.Core.KX12.Helpers; -using Migration.Toolkit.Core.KX12.Mappers; -using Migration.Toolkit.Core.KX12.Services; -using Migration.Toolkit.KXP.Models; - -public static class Kx12CoreDiExtensions -{ - public static IServiceCollection UseKx12ToolkitCore(this IServiceCollection services) - { - var printService = new PrintService(); - services.AddSingleton(printService); - HandbookReference.PrintService = printService; - LogExtensions.PrintService = printService; - - // services.AddTransient(); - // services.AddSingleton(); - // services.AddSingleton(); - - services.AddTransient(); - // services.AddTransient(); - services.AddTransient(); - // services.AddScoped(); - // services.AddScoped(); - services.AddScoped(); - // services.AddScoped(); - - services.AddMediatR(typeof(Kx12CoreDiExtensions)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); - - services.AddSingleton(s => new TableReflectionService(s.GetRequiredService>())); - services.AddSingleton(); - services.AddTransient(); - - services.AddScoped(); - services.AddSingleton(); - services.AddScoped(); - services.AddSingleton(); - - // commands - services.AddTransient(); - // services.AddTransient(); - // services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - // services.AddTransient(); - - // umt mappers - // services.AddTransient, ContentItemMapper>(); - - // mappers - services.AddTransient, CmsAttachmentMapper>(); - // services.AddTransient, CmsClassMapper>(); - services.AddTransient, CmsConsentMapper>(); - services.AddTransient, CmsConsentAgreementMapper>(); - services.AddTransient, CmsConsentArchiveMapper>(); - // services.AddTransient, CmsFormMapper>(); - // services.AddTransient, CmsFormMapperEf>(); - services.AddTransient, ResourceMapper>(); - services.AddTransient, AlternativeFormMapper>(); - services.AddTransient, RoleInfoMapper>(); - services.AddTransient, CmsSettingsCategoryMapper>(); - services.AddTransient, CmsSettingsKeyMapper>(); - services.AddTransient, UserInfoMapper>(); - services.AddTransient, MemberInfoMapper>(); - services.AddTransient, UserRoleInfoMapper>(); - services.AddTransient, MediaLibraryInfoMapper>(); - services.AddTransient, OmContactMapper>(); - services.AddTransient, OmContactGroupMapper>(); - services.AddTransient, OmContactStatusMapper>(); - services.AddTransient, MediaFileInfoMapper>(); - services.AddTransient, CountryInfoMapper>(); - services.AddTransient, StateInfoMapper>(); - // services.AddTransient, PageTemplateConfigurationMapper>(); - - services.AddUniversalMigrationToolkit(); - - return services; - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using Kentico.Xperience.UMT; + +using MediatR; + +using Microsoft.Extensions.DependencyInjection; +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.Core.KX12.Behaviors; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.Core.KX12.Helpers; +using Migration.Toolkit.Core.KX12.Mappers; +using Migration.Toolkit.Core.KX12.Services; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12; + +public static class Kx12CoreDiExtensions +{ + public static IServiceCollection UseKx12ToolkitCore(this IServiceCollection services) + { + var printService = new PrintService(); + services.AddSingleton(printService); + HandbookReference.PrintService = printService; + LogExtensions.PrintService = printService; + + services.AddTransient(); + services.AddTransient(); + services.AddScoped(); + + services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(Kx12CoreDiExtensions).Assembly)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); + + services.AddScoped(); + services.AddSingleton(); + services.AddScoped(); + services.AddSingleton(); + + // mappers + services.AddTransient, CmsAttachmentMapper>(); + services.AddTransient, CmsConsentMapper>(); + services.AddTransient, CmsConsentAgreementMapper>(); + services.AddTransient, CmsConsentArchiveMapper>(); + services.AddTransient, AlternativeFormMapper>(); + services.AddTransient, RoleInfoMapper>(); + services.AddTransient, CmsSettingsCategoryMapper>(); + services.AddTransient, CmsSettingsKeyMapper>(); + services.AddTransient, UserInfoMapper>(); + services.AddTransient, MemberInfoMapper>(); + services.AddTransient, UserRoleInfoMapper>(); + services.AddTransient, OmContactGroupMapper>(); + services.AddTransient, OmContactStatusMapper>(); + services.AddTransient, CountryInfoMapper>(); + services.AddTransient, StateInfoMapper>(); + + services.AddUniversalMigrationToolkit(); + + return services; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs index c5fd14a5..1f41944e 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/AlternativeFormMapper.cs @@ -1,96 +1,90 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.DataEngine; -using CMS.FormEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Services; -using Migration.Toolkit.KXP.Api.Services.CmsClass; - -public record AlternativeFormMapperSource(KX12M.CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); - -public class AlternativeFormMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly FieldMigrationService _fieldMigrationService; - - public AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) : base(logger, pkContext, protocol) - { - _logger = logger; - _fieldMigrationService = fieldMigrationService; - } - - protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - => AlternativeFormInfo.New(); - - protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (source, xbkFormClass) = sourceObj; - - target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out var classId) - ? classId ?? 0 - : 0; - target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out var coupledClassId) - ? coupledClassId ?? 0 - : 0; - - var coupledClassIsDeprecated = - source.FormCoupledClass?.ClassName is { } coupledClassName && - K12SystemClass.NoLongerSupported.Contains(coupledClassName); - - var classIsSysInternal = K12SystemClass.All.Contains(source.FormClass.ClassName); - - var mergedDefinition = source.FormClass.ClassFormDefinition; - if (source.FormCoupledClass != null) - { - _logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); - } - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); - - var patcher = new FormDefinitionPatcher( - _logger, - mergedDefinition, - _fieldMigrationService, - source.FormClass.ClassIsForm.GetValueOrDefault(false), - source.FormClass.ClassIsDocumentType, - false, - !classIsSysInternal, - true - ); - - var fieldNames = patcher.GetFieldNames().ToList(); - _logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); - - patcher.PatchFields(); - - var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); - _logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); - - if (coupledClassIsDeprecated && source.FormCoupledClass != null) - { - _logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); - patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); - - var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); - _logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); - } - - var result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); - - var formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); - - target.FormDefinition = formDefinitionDifference; - - target.FormDisplayName = source.FormDisplayName; - target.FormGUID = source.FormGuid; - target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); - target.FormLastModified = source.FormLastModified; - target.FormName = source.FormName; - - return target; - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Api.Services.CmsClass; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public record AlternativeFormMapperSource(KX12M.CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); + +public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + => AlternativeFormInfo.New(); + + protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (source, xbkFormClass) = sourceObj; + + target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) + ? classId ?? 0 + : 0; + target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) + ? coupledClassId ?? 0 + : 0; + + bool coupledClassIsDeprecated = + source.FormCoupledClass?.ClassName is { } coupledClassName && + K12SystemClass.NoLongerSupported.Contains(coupledClassName); + + bool classIsSysInternal = K12SystemClass.All.Contains(source.FormClass.ClassName); + + string mergedDefinition = source.FormClass.ClassFormDefinition; + if (source.FormCoupledClass != null) + { + logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); + } + + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); + + var patcher = new FormDefinitionPatcher( + logger, + mergedDefinition, + fieldMigrationService, + source.FormClass.ClassIsForm.GetValueOrDefault(false), + source.FormClass.ClassIsDocumentType, + false, + !classIsSysInternal, + true + ); + + var fieldNames = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); + + patcher.PatchFields(); + + var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); + + if (coupledClassIsDeprecated && source.FormCoupledClass != null) + { + logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); + patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); + + var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); + } + + string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); + + string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); + + target.FormDefinition = formDefinitionDifference; + + target.FormDisplayName = source.FormDisplayName; + target.FormGUID = source.FormGuid; + target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); + target.FormLastModified = source.FormLastModified; + target.FormName = source.FormName; + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs index 681b9926..d02efc5f 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsAttachmentMapper.cs @@ -1,59 +1,62 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.Base; -using CMS.MediaLibrary; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Helpers; -using Migration.Toolkit.KX12.Models; - -public record CmsAttachmentMapperSource(CmsAttachment Attachment, int TargetLibraryId, IUploadedFile File, string LibrarySubFolder, - CmsDocument? AttachmentDocument); - -public class CmsAttachmentMapper : EntityMapperBase -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - public CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - { - // library name is generated with site name in it - return new MediaFileInfo(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); - } - - protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (cmsAttachment, targetLibraryId, _, _, attachmentDocument) = args; - - target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); - target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; - target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; - target.FileExtension = cmsAttachment.AttachmentExtension; - target.FileMimeType = cmsAttachment.AttachmentMimeType; - target.FileSize = cmsAttachment.AttachmentSize; - target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; - target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; - target.FileGUID = cmsAttachment.AttachmentGuid; - target.FileLibraryID = targetLibraryId; - - // target.FileCreatedByUserID = cmsAttachment.?; - // target.FileModifiedByUserID = cmsAttachment.?; - // target.FileCreatedWhen = cmsAttachment.?; - - target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; - - KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); - - if (attachmentDocument != null) - { - target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } -} \ No newline at end of file +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.Core.KX12.Helpers; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public record CmsAttachmentMapperSource( + KX12M.CmsAttachment Attachment, + int TargetLibraryId, + IUploadedFile File, + string LibrarySubFolder, + KX12M.CmsDocument? AttachmentDocument); + +public class CmsAttachmentMapper : EntityMapperBase +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + public CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + // library name is generated with site name in it + new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); + + protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; + + target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); + target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; + target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; + target.FileExtension = cmsAttachment.AttachmentExtension; + target.FileMimeType = cmsAttachment.AttachmentMimeType; + target.FileSize = cmsAttachment.AttachmentSize; + target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; + target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; + target.FileGUID = cmsAttachment.AttachmentGuid; + target.FileLibraryID = targetLibraryId; + + // target.FileCreatedByUserID = cmsAttachment.?; + // target.FileModifiedByUserID = cmsAttachment.?; + // target.FileCreatedWhen = cmsAttachment.?; + + target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; + + KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); + + if (attachmentDocument != null) + { + target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs index fc5bd35a..a4b6a30d 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentAgreementMapper.cs @@ -1,36 +1,37 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentAgreementMapper : EntityMapperBase -{ - public CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override CmsConsentAgreement? CreateNewInstance(KX12M.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentAgreement MapInternal(KX12M.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentAgreementGuid = source.ConsentAgreementGuid; - target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; - target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; - target.ConsentAgreementTime = source.ConsentAgreementTime; - - if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out var contactId)) - { - target.ConsentAgreementContactId = contactId; - } - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out var consentId)) - { - target.ConsentAgreementConsentId = consentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class CmsConsentAgreementMapper : EntityMapperBase +{ + public CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override CmsConsentAgreement? CreateNewInstance(KX12M.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsentAgreement MapInternal(KX12M.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentAgreementGuid = source.ConsentAgreementGuid; + target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; + target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; + target.ConsentAgreementTime = source.ConsentAgreementTime; + + if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) + { + target.ConsentAgreementContactId = contactId; + } + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) + { + target.ConsentAgreementConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs index 8c98b7a9..24141470 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentArchiveMapper.cs @@ -1,33 +1,34 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentArchiveMapper : EntityMapperBase -{ - public CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override CmsConsentArchive? CreateNewInstance(KX12M.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentArchive MapInternal(KX12M.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentArchiveContent = source.ConsentArchiveContent; - target.ConsentArchiveGuid = source.ConsentArchiveGuid; - target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; - target.ConsentArchiveHash = source.ConsentArchiveHash; - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out var consentId)) - { - target.ConsentArchiveConsentId = consentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class CmsConsentArchiveMapper : EntityMapperBase +{ + public CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override CmsConsentArchive? CreateNewInstance(KX12M.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsentArchive MapInternal(KX12M.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentArchiveContent = source.ConsentArchiveContent; + target.ConsentArchiveGuid = source.ConsentArchiveGuid; + target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; + target.ConsentArchiveHash = source.ConsentArchiveHash; + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) + { + target.ConsentArchiveConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs index 5a72fbb2..af83c93e 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsConsentMapper.cs @@ -1,76 +1,83 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using System.Text; -using System.Xml.Linq; -using System.Xml.XPath; -using CMS.ContentEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentMapper : EntityMapperBase -{ - public CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CmsConsent? CreateNewInstance(KX12M.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsent MapInternal(KX12M.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentDisplayName = source.ConsentDisplayName; - var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); - target.ConsentName = source.ConsentName; - target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); - target.ConsentGuid = source.ConsentGuid; - target.ConsentLastModified = source.ConsentLastModified; - target.ConsentHash = source.ConsentHash; - - return target; - } -} - -static file class ConsentContentPatcher -{ - public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) - { - if (string.IsNullOrWhiteSpace(content)) return content; - XDocument doc; - try - { - doc = XDocument.Parse(content); - } - catch (Exception) - { - // cannot patch xml that cannot be parsed - return content; - } - - foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) - { - cultureCodeElement.Name = "LanguageName"; - if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) - { - // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); - } - - // if elements are not swapped, FULLTEXT is not shown in UI - var p = cultureCodeElement.NextNode; - if (p is XElement e && e.Name == "FullText") - { - p.ReplaceWith(cultureCodeElement); - cultureCodeElement.ReplaceWith(p); - } - } - - var builder = new StringBuilder(); - using (var writer = new CMS.IO.StringWriter(builder)) - { - doc.Save(writer); - } - - return builder.ToString(); - } -} \ No newline at end of file +using System.Text; +using System.Xml.Linq; +using System.Xml.XPath; + +using CMS.ContentEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class CmsConsentMapper : EntityMapperBase +{ + public CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CmsConsent? CreateNewInstance(KX12M.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsent MapInternal(KX12M.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentDisplayName = source.ConsentDisplayName; + var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); + target.ConsentName = source.ConsentName; + target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); + target.ConsentGuid = source.ConsentGuid; + target.ConsentLastModified = source.ConsentLastModified; + target.ConsentHash = source.ConsentHash; + + return target; + } +} + +static file class ConsentContentPatcher +{ + public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) + { + if (string.IsNullOrWhiteSpace(content)) + { + return content; + } + + XDocument doc; + try + { + doc = XDocument.Parse(content); + } + catch (Exception) + { + // cannot patch xml that cannot be parsed + return content; + } + + foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) + { + cultureCodeElement.Name = "LanguageName"; + if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) + { + // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); + } + + // if elements are not swapped, FULLTEXT is not shown in UI + var p = cultureCodeElement.NextNode; + if (p is XElement e && e.Name == "FullText") + { + p.ReplaceWith(cultureCodeElement); + cultureCodeElement.ReplaceWith(p); + } + } + + var builder = new StringBuilder(); + using (var writer = new CMS.IO.StringWriter(builder)) + { + doc.Save(writer); + } + + return builder.ToString(); + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs index 3fb16582..5e892771 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsFormMapper.cs @@ -1,92 +1,91 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.FormEngine; -using CMS.OnlineForms; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsFormMapper : EntityMapperBase -{ - public CmsFormMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override BizFormInfo? CreateNewInstance(KX12M.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) - { - var newBizFormInfo = BizFormInfo.New(); - newBizFormInfo.FormGUID = source.FormGuid; - return newBizFormInfo; - } - - protected override BizFormInfo MapInternal(KX12M.CmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - target.FormAccess = source.FormAccess.AsEnum(); - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormLastModified = source.FormLastModified; - target.FormLogActivity = source.FormLogActivity.UseKenticoDefault(); - target.FormBuilderLayout = source.FormBuilderLayout; - - if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out var formClassId)) - { - target.FormClassID = formClassId; - } - - return target; - } -} - -public class CmsFormMapperEf : EntityMapperBase -{ - public CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CmsForm? CreateNewInstance(KX12M.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsForm MapInternal(KX12M.CmsForm source, CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.FormDisplayName = source.FormDisplayName; - target.FormName = source.FormName; - // target.FormSendToEmail = source.FormSendToEmail; - // target.FormSendFromEmail = source.FormSendFromEmail; - // target.FormEmailSubject = source.FormEmailSubject; - // target.FormEmailTemplate = source.FormEmailTemplate; - // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; - target.FormItems = source.FormItems; - target.FormReportFields = source.FormReportFields; - target.FormSubmitButtonText = source.FormSubmitButtonText; - // target.FormConfirmationEmailField = source.FormConfirmationEmailField; - // target.FormConfirmationTemplate = source.FormConfirmationTemplate; - // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; - // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; - target.FormAccess = source.FormAccess; - target.FormSubmitButtonImage = source.FormSubmitButtonImage; - target.FormGuid = source.FormGuid; - target.FormLastModified = source.FormLastModified; - target.FormLogActivity = source.FormLogActivity; - target.FormBuilderLayout = source.FormBuilderLayout; - - // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitMode = source.FormAfterSubmitMode; - // TODO tk: 2022-05-20 new deduce: target.FormAfterSubmitRelatedValue = source.FormAfterSubmitRelatedValue; - - if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out var classId)) - { - target.FormClassId = classId; - } - - return target; - } -} \ No newline at end of file +using CMS.FormEngine; +using CMS.OnlineForms; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class CmsFormMapper : EntityMapperBase +{ + public CmsFormMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override BizFormInfo? CreateNewInstance(KX12M.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) + { + var newBizFormInfo = BizFormInfo.New(); + newBizFormInfo.FormGUID = source.FormGuid; + return newBizFormInfo; + } + + protected override BizFormInfo MapInternal(KX12M.CmsForm source, BizFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + target.FormAccess = source.FormAccess.AsEnum(); + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormLastModified = source.FormLastModified; + target.FormLogActivity = source.FormLogActivity.UseKenticoDefault(); + target.FormBuilderLayout = source.FormBuilderLayout; + + if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int formClassId)) + { + target.FormClassID = formClassId; + } + + return target; + } +} + +public class CmsFormMapperEf : EntityMapperBase +{ + public CmsFormMapperEf(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CmsForm? CreateNewInstance(KX12M.CmsForm source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsForm MapInternal(KX12M.CmsForm source, CmsForm target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.FormDisplayName = source.FormDisplayName; + target.FormName = source.FormName; + // target.FormSendToEmail = source.FormSendToEmail; + // target.FormSendFromEmail = source.FormSendFromEmail; + // target.FormEmailSubject = source.FormEmailSubject; + // target.FormEmailTemplate = source.FormEmailTemplate; + // target.FormEmailAttachUploadedDocs = source.FormEmailAttachUploadedDocs; + target.FormItems = source.FormItems; + target.FormReportFields = source.FormReportFields; + target.FormSubmitButtonText = source.FormSubmitButtonText; + // target.FormConfirmationEmailField = source.FormConfirmationEmailField; + // target.FormConfirmationTemplate = source.FormConfirmationTemplate; + // target.FormConfirmationSendFromEmail = source.FormConfirmationSendFromEmail; + // target.FormConfirmationEmailSubject = source.FormConfirmationEmailSubject; + target.FormAccess = source.FormAccess; + target.FormSubmitButtonImage = source.FormSubmitButtonImage; + target.FormGuid = source.FormGuid; + target.FormLastModified = source.FormLastModified; + target.FormLogActivity = source.FormLogActivity ?? false; + target.FormBuilderLayout = source.FormBuilderLayout; + + if (mappingHelper.TranslateRequiredId(c => c.ClassId, source.FormClassId, out int classId)) + { + target.FormClassId = classId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs index f102bfd3..e5e0c167 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsCategoryMapper.cs @@ -1,97 +1,97 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsSettingsCategoryMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly PrimaryKeyMappingContext _pkContext; - private readonly IEntityMapper _cmsResourceMapper; - - public CmsSettingsCategoryMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, - IEntityMapper cmsResourceMapper) : base(logger, pkContext, protocol) - { - _logger = logger; - _pkContext = pkContext; - _cmsResourceMapper = cmsResourceMapper; - } - - protected override CmsSettingsCategory? CreateNewInstance(KX12M.CmsSettingsCategory source, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - - protected override CmsSettingsCategory MapInternal(KX12M.CmsSettingsCategory source, CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // no category guid to match on... - if (newInstance) - { - target.CategoryOrder = source.CategoryOrder; - target.CategoryName = source.CategoryName; - target.CategoryDisplayName = source.CategoryDisplayName; - target.CategoryIdpath = source.CategoryIdpath; - target.CategoryLevel = source.CategoryLevel; - target.CategoryChildCount = source.CategoryChildCount; - target.CategoryIconPath = source.CategoryIconPath; - target.CategoryIsGroup = source.CategoryIsGroup; - target.CategoryIsCustom = source.CategoryIsCustom; - } - - if (source.CategoryResource != null) - { - if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) - { - // skip if target is present - _logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); - _pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); - } - else - { - switch (_cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) - { - case { Success: true } result: - { - target.CategoryResource = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out var categoryResourceId)) - { - target.CategoryResourceId = categoryResourceId; - } - - if (source.CategoryParent != null) - { - switch (Map(source.CategoryParent, target.CategoryParent)) - { - case { Success: true } result: - { - target.CategoryParent = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out var categoryParentId)) - { - target.CategoryParentId = categoryParentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class CmsSettingsCategoryMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + IEntityMapper cmsResourceMapper) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override CmsSettingsCategory? CreateNewInstance(KX12M.CmsSettingsCategory source, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + + protected override CmsSettingsCategory MapInternal(KX12M.CmsSettingsCategory source, CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + // no category guid to match on... + if (newInstance) + { + target.CategoryOrder = source.CategoryOrder; + target.CategoryName = source.CategoryName; + target.CategoryDisplayName = source.CategoryDisplayName; + target.CategoryIdpath = source.CategoryIdpath; + target.CategoryLevel = source.CategoryLevel; + target.CategoryChildCount = source.CategoryChildCount; + target.CategoryIconPath = source.CategoryIconPath; + target.CategoryIsGroup = source.CategoryIsGroup; + target.CategoryIsCustom = source.CategoryIsCustom; + } + + if (source.CategoryResource != null) + { + if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) + { + // skip if target is present + logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); + pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); + } + else + { + switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) + { + case { Success: true } result: + { + target.CategoryResource = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + } + else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) + { + target.CategoryResourceId = categoryResourceId; + } + + if (source.CategoryParent != null) + { + switch (Map(source.CategoryParent, target.CategoryParent)) + { + case { Success: true } result: + { + target.CategoryParent = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) + { + target.CategoryParentId = categoryParentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs index 71b23fcc..4bbffb22 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsSettingsKeyMapper.cs @@ -1,68 +1,70 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using System.Diagnostics; -using CMS.DataEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -public class CmsSettingsKeyMapper : EntityMapperBase -{ - private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; - - public CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - - } - - protected override SettingsKeyInfo CreateNewInstance(KX12M.CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override SettingsKeyInfo MapInternal(KX12M.CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - if (newInstance) - { - target.KeyName = source.KeyName; - target.KeyDisplayName = source.KeyDisplayName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyGUID = source.KeyGuid; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - else - { - target.KeyName = source.KeyName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - - // special migrations for keys - switch (source.KeyName) - { - case SOURCE_KEY_NAME: - { - target.KeyValue = int.TryParse(source.KeyValue, out var cmsDefaultUserId) - ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out var targetCmsDefaultUserId) - ? targetCmsDefaultUserId.ToString() - : source.KeyValue - : source.KeyValue; - break; - } - default: - target.KeyValue = source.KeyValue; - break; - } - - Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); - target.KeyLastModified = source.KeyLastModified; - return target; - } -} \ No newline at end of file +using System.Diagnostics; + +using CMS.DataEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class CmsSettingsKeyMapper : EntityMapperBase +{ + private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; + + public CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override SettingsKeyInfo CreateNewInstance(KX12M.CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override SettingsKeyInfo MapInternal(KX12M.CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + if (newInstance) + { + target.KeyName = source.KeyName; + target.KeyDisplayName = source.KeyDisplayName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyGUID = source.KeyGuid; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + else + { + target.KeyName = source.KeyName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + + // special migrations for keys + switch (source.KeyName) + { + case SOURCE_KEY_NAME: + { + target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) + ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) + ? targetCmsDefaultUserId.ToString() + : source.KeyValue + : source.KeyValue; + break; + } + default: + target.KeyValue = source.KeyValue; + break; + } + + Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); + target.KeyLastModified = source.KeyLastModified; + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs index a97d5d19..21430f7d 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CmsUserMapper.cs @@ -1,66 +1,55 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsUserMapper : EntityMapperBase -{ - private readonly ILogger _logger; - - public CmsUserMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - _logger = logger; - } - - protected override CmsUser CreateNewInstance(KX12M.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsUser MapInternal(KX12M.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGuid) - { - // assertion failed - _logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - target.UserPassword = source.UserPassword; - target.UserEnabled = source.UserEnabled; - target.UserCreated = source.UserCreated; - target.LastLogon = source.LastLogon; - target.UserGuid = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserPasswordLastChanged = null; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - foreach (var sourceCmsUserRole in source.CmsUserRoles) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out var targetRoleId)) - { - if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) - { - target.CmsUserRoles.Add(new CmsUserRole - { - RoleId = targetRoleId, - User = target, - }); - } - } - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class CmsUserMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override CmsUser CreateNewInstance(KX12M.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsUser MapInternal(KX12M.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + target.UserPassword = source.UserPassword; + target.UserEnabled = source.UserEnabled; + target.UserCreated = source.UserCreated; + target.LastLogon = source.LastLogon; + target.UserGuid = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserPasswordLastChanged = null; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + foreach (var sourceCmsUserRole in source.CmsUserRoles) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) + { + if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) + { + target.CmsUserRoles.Add(new CmsUserRole { RoleId = targetRoleId, User = target }); + } + } + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs index 834b430e..6b9cb88b 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/CountryInfoMapper.cs @@ -1,29 +1,30 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.Globalization; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Models; - -public class CountryInfoMapper : EntityMapperBase -{ - public CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CountryInfo? CreateNewInstance(CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) - => CountryInfo.New(); - - protected override CountryInfo MapInternal(CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.CountryName = source.CountryName; - target.CountryDisplayName = source.CountryDisplayName; - target.CountryGUID = source.CountryGuid; - target.CountryLastModified = source.CountryLastModified; - target.CountryThreeLetterCode = source.CountryThreeLetterCode; - target.CountryTwoLetterCode = source.CountryTwoLetterCode; - return target; - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class CountryInfoMapper : EntityMapperBase +{ + public CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CountryInfo? CreateNewInstance(KX12M.CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) + => CountryInfo.New(); + + protected override CountryInfo MapInternal(KX12M.CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.CountryName = source.CountryName; + target.CountryDisplayName = source.CountryDisplayName; + target.CountryGUID = source.CountryGuid; + target.CountryLastModified = source.CountryLastModified; + target.CountryThreeLetterCode = source.CountryThreeLetterCode; + target.CountryTwoLetterCode = source.CountryTwoLetterCode; + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/MediaFileInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/MediaFileInfoMapper.cs deleted file mode 100644 index 7cb353a3..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/MediaFileInfoMapper.cs +++ /dev/null @@ -1,174 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using System.Data; -using CMS.Base; -using CMS.MediaLibrary; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.Core.KX12.Helpers; -using Migration.Toolkit.KX12.Models; -using Migration.Toolkit.KXP.Api; - -public record MediaFileInfoMapperSource(MediaFile MediaFile, int TargetLibraryId, IUploadedFile? File, string? LibrarySubFolder, - bool MigrateOnlyMediaFileInfo); - -public class MediaFileInfoMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly KxpClassFacade _classFacade; - private readonly IProtocol _protocol; - private readonly ToolkitConfiguration _toolkitConfiguration; - private readonly KeyMappingContext _keyMappingContext; - - public MediaFileInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - KxpClassFacade classFacade, - IProtocol protocol, - ToolkitConfiguration toolkitConfiguration, - KeyMappingContext keyMappingContext - ) : base(logger, primaryKeyMappingContext, protocol) - { - _logger = logger; - _classFacade = classFacade; - _protocol = protocol; - _toolkitConfiguration = toolkitConfiguration; - _keyMappingContext = keyMappingContext; - } - - - protected override MediaFileInfo? CreateNewInstance(MediaFileInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - { - if (source.File != null) - { - var mf = new MediaFileInfo(source.File, source.TargetLibraryId, source.LibrarySubFolder ?? "", 0, 0, 0); - mf.SaveFileToDisk(true); - return mf; - } - - return new MediaFileInfo(); - } - - protected override MediaFileInfo MapInternal(MediaFileInfoMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (mediaFile, targetLibraryId, file, _, migrateOnlyMediaFileInfo) = args; - - target.FileName = mediaFile.FileName; - target.FileTitle = mediaFile.FileTitle; - target.FileDescription = mediaFile.FileDescription; - target.FileExtension = mediaFile.FileExtension; - target.FileMimeType = mediaFile.FileMimeType; - target.FileSize = mediaFile.FileSize; - target.FileImageWidth = mediaFile.FileImageWidth ?? 0; - target.FileImageHeight = mediaFile.FileImageHeight ?? 0; - target.FileGUID = mediaFile.FileGuid; - target.FileCreatedWhen = mediaFile.FileCreatedWhen; - target.FileModifiedWhen = mediaFile.FileModifiedWhen; - KenticoHelper.CopyCustomData(target.FileCustomData, mediaFile.FileCustomData); - - MigrateCustomizedFields(target, mediaFile); - - target.FileLibraryID = targetLibraryId; - - var targetCreatedMemberId = _keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - mediaFile.FileCreatedByUserId, - t => t.MemberId, - t => t.MemberGuid - ); - if (targetCreatedMemberId.Success) - { - // user was migrated to MEMBER => setting user would break foreign key - target.SetValue(nameof(target.FileCreatedByUserID), CMSActionContext.CurrentUser.UserID); - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.UserId, mediaFile.FileCreatedByUserId, out var createdByUserId)) - { - target.SetValue(nameof(target.FileCreatedByUserID), createdByUserId); - } - - var targetModifiedMemberId = _keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - mediaFile.FileModifiedByUserId, - t => t.MemberId, - t => t.MemberGuid - ); - if (targetModifiedMemberId.Success) - { - // user was migrated to MEMBER => setting user would break foreign key - target.SetValue(nameof(target.FileModifiedByUserID), CMSActionContext.CurrentUser.UserID); - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.UserId, mediaFile.FileModifiedByUserId, out var modifiedByUserId)) - { - target.SetValue(nameof(target.FileModifiedByUserID), modifiedByUserId); - } - - if (string.IsNullOrWhiteSpace(target.FilePath)) - { - target.FilePath = mediaFile.FilePath; - } - - if (file == null && !migrateOnlyMediaFileInfo) - { - addFailure(HandbookReferences.MediaFileIsMissingOnSourceFilesystem - .WithId(nameof(mediaFile.FileId), mediaFile.FileId) - .WithData(new - { - mediaFile.FilePath, - mediaFile.FileGuid, - mediaFile.FileLibraryId, - mediaFile.FileSiteId - }) - .AsFailure() - ); - } - - return target; - } - - private void MigrateCustomizedFields(MediaFileInfo target, MediaFile mediaFile) - { - var customizedFields = _classFacade.GetCustomizedFieldInfos(MediaFileInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count <= 0) return; - - try - { - var query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {MediaFileInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {MediaFileInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(_toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", mediaFile.FileId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - _logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - _logger.LogError("Failed to load MediaFileInfo custom data from source database"); - } - } - catch (Exception ex) - { - _logger.LogError(ex, "Failed to load MediaFileInfo custom data from source database"); - } - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Mappers/MediaLibraryInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/MediaLibraryInfoMapper.cs deleted file mode 100644 index 7be47dc9..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/MediaLibraryInfoMapper.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.MediaLibrary; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -public class MediaLibraryInfoMapper : EntityMapperBase -{ - public MediaLibraryInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override MediaLibraryInfo? CreateNewInstance(KX12M.MediaLibrary source, MappingHelper mappingHelper, AddFailure addFailure) => - MediaLibraryInfo.New(); - - protected override MediaLibraryInfo MapInternal(KX12M.MediaLibrary source, MediaLibraryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // Sets the library properties - target.LibraryDisplayName = source.LibraryDisplayName; - target.LibraryName = source.LibraryName; - target.LibraryDescription = source.LibraryDescription; - target.LibraryFolder = source.LibraryFolder; - target.LibraryGUID = mappingHelper.Require(source.LibraryGuid, nameof(source.LibraryGuid)); - target.LibraryDisplayName = source.LibraryDisplayName; - target.LibraryDescription = source.LibraryDescription; - - if (!target.LibraryFolder.StartsWith($"{source.LibrarySite.SiteName}_", StringComparison.InvariantCultureIgnoreCase)) - { - target.LibraryFolder = $"{source.LibrarySite.SiteName}_{source.LibraryFolder}"; - } - - target.LibraryLastModified = mappingHelper.Require(source.LibraryLastModified, nameof(source.LibraryLastModified)); - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs index 588f3f0c..12fc1954 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/MemberInfoMapper.cs @@ -1,189 +1,179 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using System.Data; -using CMS.FormEngine; -using CMS.Membership; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Api; - -public record MemberInfoMapperSource(KX12M.CmsUser User, KX12M.CmsUserSetting UserSetting); - -public class MemberInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration, - IDbContextFactory k12DbContextFactory) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - private readonly KxpClassFacade _kxpClassFacade = kxpClassFacade; - - protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - public static IReadOnlyList MigratedUserFields = new List - { - nameof(KX12M.CmsUser.UserGuid), - nameof(KX12M.CmsUser.UserName), - nameof(KX12M.CmsUser.Email), - // nameof(KX12M.CmsUser.UserPassword), - nameof(KX12M.CmsUser.UserEnabled), - nameof(KX12M.CmsUser.UserCreated), - nameof(KX12M.CmsUser.UserSecurityStamp), - }; - - protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (user, userSetting) = source; - - if (!newInstance && user.UserGuid != target.MemberGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - // target.UserName = source.UserName; - target.MemberName = user.UserName; - - // target.FirstName = source.FirstName; // TODO tomas.krch: 2023-04-11 configurable autocreate - // target.LastName = source.LastName; // TODO tomas.krch: 2023-04-11 configurable autocreate - - // target.Email = source.Email; - target.MemberEmail = user.Email; - - // target.SetValue("UserPassword", source.UserPassword); - target.MemberPassword = null; // source.UserPassword; // not migrated - - // target.UserEnabled = source.UserEnabled; - target.MemberEnabled = user.UserEnabled; - - target.SetValue("UserCreated", user.UserCreated); - target.MemberCreated = user.UserCreated.GetValueOrDefault(); - - // target.SetValue("LastLogon", source.LastLogon); // TODO tomas.krch: 2023-04-11 configurable autocreate - - // target.UserGUID = source.UserGuid; - target.MemberGuid = user.UserGuid; - - // target.UserLastModified = source.UserLastModified; // TODO tomas.krch: 2023-04-11 configurable autocreate - target.MemberSecurityStamp = user.UserSecurityStamp; // TODO tomas.krch: 2023-04-11 still relevant? - - // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // OBSOLETE: target.UserIsPendingRegistration = false; - // OBSOLETE: target.UserPasswordLastChanged = null; - // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - // TODO tomas.krch: 2023-04-11 migrate customized fields - var customized = _kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); - foreach (var customizedFieldInfo in customized) - { - var fieldName = customizedFieldInfo.FieldName; - - if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out var value) || - ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) - { - target.SetValue(fieldName, value); - } - } - - using var kx12Context = k12DbContextFactory.CreateDbContext(); - var uDci = kx12Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); - if (uDci != null) - { - var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); - if (userCustomizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.User.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - } - - var usDci = kx12Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); - if (usDci != null) - { - var userSettingsCustomizedFields = _kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); - if (userSettingsCustomizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userSettingsCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserSettingsInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); - } - } - } - - - return target; - } -} \ No newline at end of file +using System.Data; + +using CMS.FormEngine; +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KX12.Context; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public record MemberInfoMapperSource(KX12M.CmsUser User, KX12M.CmsUserSetting UserSetting); + +public class MemberInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolkitConfiguration toolkitConfiguration, + IDbContextFactory k12DbContextFactory) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (user, userSetting) = source; + + if (!newInstance && user.UserGuid != target.MemberGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + // target.UserName = source.UserName; + target.MemberName = user.UserName; + + // target.FirstName = source.FirstName; // TODO tomas.krch: 2023-04-11 configurable autocreate + // target.LastName = source.LastName; // TODO tomas.krch: 2023-04-11 configurable autocreate + + // target.Email = source.Email; + target.MemberEmail = user.Email; + + // target.SetValue("UserPassword", source.UserPassword); + target.MemberPassword = null; // source.UserPassword; // not migrated + + // target.UserEnabled = source.UserEnabled; + target.MemberEnabled = user.UserEnabled; + + target.SetValue("UserCreated", user.UserCreated); + target.MemberCreated = user.UserCreated.GetValueOrDefault(); + + // target.SetValue("LastLogon", source.LastLogon); // TODO tomas.krch: 2023-04-11 configurable autocreate + + // target.UserGUID = source.UserGuid; + target.MemberGuid = user.UserGuid; + + // target.UserLastModified = source.UserLastModified; // TODO tomas.krch: 2023-04-11 configurable autocreate + target.MemberSecurityStamp = user.UserSecurityStamp; // TODO tomas.krch: 2023-04-11 still relevant? + + // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // OBSOLETE: target.UserIsPendingRegistration = false; + // OBSOLETE: target.UserPasswordLastChanged = null; + // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + // TODO tomas.krch: 2023-04-11 migrate customized fields + var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); + foreach (var customizedFieldInfo in customized) + { + string fieldName = customizedFieldInfo.FieldName; + + if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || + ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) + { + target.SetValue(fieldName, value); + } + } + + using var kx12Context = k12DbContextFactory.CreateDbContext(); + var uDci = kx12Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); + if (uDci != null) + { + var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); + if (userCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.User.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + } + + var usDci = kx12Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == K12SystemClass.cms_usersettings); + if (usDci != null) + { + var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); + if (userSettingsCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userSettingsCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserSettingsInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); + } + } + } + + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs index 66b4cd48..0749a0e9 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/OmContactGroupMapper.cs @@ -1,35 +1,36 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactGroupMapper : EntityMapperBase -{ - public OmContactGroupMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override OmContactGroup? CreateNewInstance(KX12M.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override OmContactGroup MapInternal(KX12M.OmContactGroup source, OmContactGroup target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactGroupName = source.ContactGroupName; - target.ContactGroupDisplayName = source.ContactGroupDisplayName; - target.ContactGroupDescription = source.ContactGroupDescription; - target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; - target.ContactGroupEnabled = source.ContactGroupEnabled; - target.ContactGroupLastModified = source.ContactGroupLastModified; - target.ContactGroupGuid = source.ContactGroupGuid; - target.ContactGroupStatus = source.ContactGroupStatus; - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class OmContactGroupMapper : EntityMapperBase +{ + public OmContactGroupMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override OmContactGroup? CreateNewInstance(KX12M.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override OmContactGroup MapInternal(KX12M.OmContactGroup source, OmContactGroup target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactGroupName = source.ContactGroupName; + target.ContactGroupDisplayName = source.ContactGroupDisplayName; + target.ContactGroupDescription = source.ContactGroupDescription; + target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; + target.ContactGroupEnabled = source.ContactGroupEnabled; + target.ContactGroupLastModified = source.ContactGroupLastModified; + target.ContactGroupGuid = source.ContactGroupGuid; + target.ContactGroupStatus = source.ContactGroupStatus; + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/OmContactMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/OmContactMapper.cs deleted file mode 100644 index 040e8700..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/OmContactMapper.cs +++ /dev/null @@ -1,95 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly IEntityMapper _contactStatusMapper; - - public OmContactMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IEntityMapper contactStatusMapper, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - _logger = logger; - _contactStatusMapper = contactStatusMapper; - } - - protected override OmContact? CreateNewInstance(KX12M.OmContact tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override OmContact MapInternal(KX12M.OmContact source, OmContact target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.ContactGuid != target.ContactGuid) - { - // assertion failed - _logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch"); - } - - // do not try to insert pk - // target.ContactId = source.ContactId; - target.ContactFirstName = source.ContactFirstName; - target.ContactMiddleName = source.ContactMiddleName; - target.ContactLastName = source.ContactLastName; - target.ContactJobTitle = source.ContactJobTitle; - target.ContactAddress1 = source.ContactAddress1; - target.ContactCity = source.ContactCity; - target.ContactZip = source.ContactZip; - target.ContactMobilePhone = source.ContactMobilePhone; - target.ContactBusinessPhone = source.ContactBusinessPhone; - target.ContactEmail = source.ContactEmail; - target.ContactBirthday = source.ContactBirthday; - target.ContactGender = source.ContactGender; - target.ContactNotes = source.ContactNotes; - target.ContactMonitored = source.ContactMonitored; - target.ContactGuid = source.ContactGuid; - target.ContactLastModified = source.ContactLastModified; - target.ContactCreated = source.ContactCreated; - target.ContactBounces = source.ContactBounces; - target.ContactCampaign = source.ContactCampaign; - target.ContactSalesForceLeadReplicationDisabled = source.ContactSalesForceLeadReplicationDisabled; - target.ContactSalesForceLeadReplicationDateTime = source.ContactSalesForceLeadReplicationDateTime; - target.ContactSalesForceLeadReplicationSuspensionDateTime = source.ContactSalesForceLeadReplicationSuspensionDateTime; - target.ContactCompanyName = source.ContactCompanyName; - target.ContactSalesForceLeadReplicationRequired = source.ContactSalesForceLeadReplicationRequired; - - // TODO tk: 2022-06-13 resolve migration of target.ContactStateId = _primaryKeyMappingContext.MapFromSource(u => u.StateId, source.ContactStateId); - // TODO tk: 2022-06-13 resolve migration of target.ContactCountryId = _primaryKeyMappingContext.MapFromSource(u => u.CountryId, source.ContactCountryId); - - if (source.ContactStatus != null) - { - switch (_contactStatusMapper.Map(source.ContactStatus, target.ContactStatus)) - { - case { Success: true } result: - { - target.ContactStatus = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result?.HandbookReference)); - break; - } - } - } - else - { - target.ContactStatus = null; - } - - target.ContactSalesForceLeadId = source.ContactSalesForceLeadId; - if (mappingHelper.TranslateIdAllowNulls(u => u.UserId, source.ContactOwnerUserId, out var userId)) - { - target.ContactOwnerUserId = userId; - } - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs index 8ab2ce85..c2f74537 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/OmContactStatusMapper.cs @@ -1,31 +1,32 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactStatusMapper : EntityMapperBase -{ - public OmContactStatusMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override OmContactStatus? CreateNewInstance(KX12M.OmContactStatus tSourceEntity, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - protected override OmContactStatus MapInternal(KX12M.OmContactStatus source, OmContactStatus target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactStatusName = source.ContactStatusName; - target.ContactStatusDisplayName = source.ContactStatusDisplayName; - target.ContactStatusDescription = source.ContactStatusDescription; - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class OmContactStatusMapper : EntityMapperBase +{ + public OmContactStatusMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override OmContactStatus? CreateNewInstance(KX12M.OmContactStatus tSourceEntity, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + protected override OmContactStatus MapInternal(KX12M.OmContactStatus source, OmContactStatus target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactStatusName = source.ContactStatusName; + target.ContactStatusDisplayName = source.ContactStatusDisplayName; + target.ContactStatusDescription = source.ContactStatusDescription; + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/ResourceMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/ResourceMapper.cs deleted file mode 100644 index b24bf72f..00000000 --- a/Migration.Toolkit.Core.KX12/Mappers/ResourceMapper.cs +++ /dev/null @@ -1,52 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.Modules; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Models; - -public class ResourceMapper : EntityMapperBase -{ - private readonly ILogger _logger; - - public ResourceMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - _logger = logger; - } - - protected override ResourceInfo? CreateNewInstance(CmsResource source, MappingHelper mappingHelper, AddFailure addFailure) - => ResourceInfo.New(); - - protected override ResourceInfo MapInternal(CmsResource source, ResourceInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ResourceDescription = source.ResourceDescription; - target.ResourceDisplayName = source.ResourceDisplayName; - target.ResourceGUID = source.ResourceGuid; - target.ResourceIsInDevelopment = false; // TODO tk: 2022-10-10 if true, module is not shown in UI of XbK - target.ResourceLastModified = source.ResourceLastModified; - target.ResourceName = source.ResourceName; - - if (target.ResourceName == K12SystemResource.Licenses) - { - target.ResourceName = XbkSystemResource.CMS_Licenses; - _logger.LogInformation("Patching CMS Resource 'Licences': name changed to '{ResourceNamePatched}'", XbkSystemResource.CMS_Licenses); - } - - if (!XbkSystemResource.All.Contains(target.ResourceName) || K12SystemResource.ConvertToNonSysResource.Contains(target.ResourceName)) - { - // custom resource - - if (target.ResourceName.StartsWith("CMS.", StringComparison.InvariantCultureIgnoreCase)) - { - var targetResourceNamePatched = target.ResourceName.Substring(4, target.ResourceName.Length - 4); - _logger.LogInformation("Patching CMS Resource '{ResourceName}': name changed to '{ResourceNamePatched}'", target.ResourceName, targetResourceNamePatched); - target.ResourceName = targetResourceNamePatched; - } - } - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs index 856d1e9f..9de63db4 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/RoleInfoMapper.cs @@ -1,30 +1,32 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.Membership; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -public class RoleInfoMapper : EntityMapperBase -{ - public RoleInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override RoleInfo? CreateNewInstance(KX12M.CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override RoleInfo MapInternal(KX12M.CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.RoleDisplayName = source.RoleDisplayName; - target.RoleName = source.RoleName; - target.RoleDescription = source.RoleDescription; - target.RoleGUID = source.RoleGuid; - target.RoleLastModified = source.RoleLastModified; - return target; - } -} \ No newline at end of file +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class RoleInfoMapper : EntityMapperBase +{ + public RoleInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override RoleInfo? CreateNewInstance(KX12M.CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override RoleInfo MapInternal(KX12M.CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.RoleDisplayName = source.RoleDisplayName; + target.RoleName = source.RoleName; + target.RoleDescription = source.RoleDescription; + target.RoleGUID = source.RoleGuid; + target.RoleLastModified = source.RoleLastModified; + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs index bb948da0..94145e18 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/StateInfoMapper.cs @@ -1,34 +1,35 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.Globalization; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Models; - -public class StateInfoMapper : EntityMapperBase -{ - public StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override StateInfo? CreateNewInstance(CmsState source, MappingHelper mappingHelper, AddFailure addFailure) - => StateInfo.New(); - - protected override StateInfo MapInternal(CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.StateName = source.StateName; - target.StateDisplayName = source.StateDisplayName; - target.StateLastModified = source.StateLastModified; - target.StateGUID = source.StateGuid; - target.StateCode = source.StateCode; - - if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out var countryId)) - { - target.CountryID = countryId; - } - - return target; - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class StateInfoMapper : EntityMapperBase +{ + public StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override StateInfo? CreateNewInstance(KX12M.CmsState source, MappingHelper mappingHelper, AddFailure addFailure) + => StateInfo.New(); + + protected override StateInfo MapInternal(KX12M.CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.StateName = source.StateName; + target.StateDisplayName = source.StateDisplayName; + target.StateLastModified = source.StateLastModified; + target.StateGUID = source.StateGuid; + target.StateCode = source.StateCode; + + if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) + { + target.CountryID = countryId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs index 54727e9a..57363de4 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/UserInfoMapper.cs @@ -1,109 +1,101 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using System.Data; -using CMS.Membership; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KXP.Api; - -public class UserInfoMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly KxpClassFacade _kxpClassFacade; - private readonly ToolkitConfiguration _toolkitConfiguration; - - public UserInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration - ) : base(logger, primaryKeyMappingContext, protocol) - { - _logger = logger; - _kxpClassFacade = kxpClassFacade; - _toolkitConfiguration = toolkitConfiguration; - } - - protected override UserInfo CreateNewInstance(KX12M.CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override UserInfo MapInternal(KX12M.CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGUID) - { - // assertion failed - _logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - // target.UserPassword = source.UserPassword; - target.SetValue("UserPassword", source.UserPassword); - target.UserEnabled = source.UserEnabled; - target.SetValue("UserCreated", source.UserCreated); - // target.UserCreated = source.UserCreated; - target.SetValue("LastLogon", source.LastLogon); - // target.LastLogon = source.LastLogon; - target.UserGUID = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - - // TODO tk: 2022-05-18 deduced - check - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // TODO tk: 2022-05-18 deduce info - target.UserIsPendingRegistration = false; - // TODO tk: 2022-05-18 deduce info - // target.UserPasswordLastChanged = null; - // TODO tk: 2022-05-18 deduce info - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customizedFields = _kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(_toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - _logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - _logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - _logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - - - return target; - } -} \ No newline at end of file +using System.Data; + +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class UserInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolkitConfiguration toolkitConfiguration) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override UserInfo CreateNewInstance(KX12M.CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override UserInfo MapInternal(KX12M.CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGUID) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + // target.UserPassword = source.UserPassword; + target.SetValue("UserPassword", source.UserPassword); + target.UserEnabled = source.UserEnabled; + target.SetValue("UserCreated", source.UserCreated); + // target.UserCreated = source.UserCreated; + target.SetValue("LastLogon", source.LastLogon); + // target.LastLogon = source.LastLogon; + target.UserGUID = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + + // TODO tk: 2022-05-18 deduced - check + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // TODO tk: 2022-05-18 deduce info + target.UserIsPendingRegistration = false; + // TODO tk: 2022-05-18 deduce info + // target.UserPasswordLastChanged = null; + // TODO tk: 2022-05-18 deduce info + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); + if (customizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in customizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs index 9a0b9be8..7e302d3e 100644 --- a/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs +++ b/Migration.Toolkit.Core.KX12/Mappers/UserRoleInfoMapper.cs @@ -1,32 +1,34 @@ -namespace Migration.Toolkit.Core.KX12.Mappers; - -using CMS.Membership; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; - -public class UserRoleInfoMapper : EntityMapperBase -{ - public UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override UserRoleInfo? CreateNewInstance(KX12M.CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) - => UserRoleInfo.New(); - - protected override UserRoleInfo MapInternal(KX12M.CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out var xbkRoleId)) - { - target.RoleID = xbkRoleId; - } - - if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out var xbkUserId)) - { - target.UserID = xbkUserId; - } - - return target; - } -} \ No newline at end of file +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; + +namespace Migration.Toolkit.Core.KX12.Mappers; + +public class UserRoleInfoMapper : EntityMapperBase +{ + public UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override UserRoleInfo? CreateNewInstance(KX12M.CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) + => UserRoleInfo.New(); + + protected override UserRoleInfo MapInternal(KX12M.CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) + { + target.RoleID = xbkRoleId; + } + + if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) + { + target.UserID = xbkUserId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX12/Migration.Toolkit.Core.KX12.csproj b/Migration.Toolkit.Core.KX12/Migration.Toolkit.Core.KX12.csproj index e880fa76..b7bbc5c7 100644 --- a/Migration.Toolkit.Core.KX12/Migration.Toolkit.Core.KX12.csproj +++ b/Migration.Toolkit.Core.KX12/Migration.Toolkit.Core.KX12.csproj @@ -4,13 +4,16 @@ - + - - + + + + + diff --git a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs index 369f0858..c573a121 100644 --- a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameProvider.cs @@ -1,47 +1,42 @@ -namespace Migration.Toolkit.Core.KX12.Providers; - -using System; -using System.Threading.Tasks; -using CMS.Base; -using CMS.ContentEngine.Internal; -using CMS.Helpers; - -internal class ContentItemNameProvider -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) - { - this.codeNameValidator = codeNameValidator; - } - - public Task Get(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); - } - - async Task Get(string name) - { - var codeName = ValidationHelper.GetCodeName(name, useUnicode: false); - - var isCodeNameValid = ValidationHelper.IsCodeName(codeName); - - if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) - { - codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); - } - - var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); - - return await uniqueCodeNameProvider.GetUniqueValue(codeName); - } - - return Get(name); - } -} \ No newline at end of file +using CMS.Base; +using CMS.ContentEngine.Internal; +using CMS.Helpers; + +namespace Migration.Toolkit.Core.KX12.Providers; + +internal class ContentItemNameProvider +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; + + public Task Get(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); + } + + async Task Get(string name) + { + string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); + + bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); + + if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) + { + codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); + } + + var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); + + return await uniqueCodeNameProvider.GetUniqueValue(codeName); + } + + return Get(name); + } +} diff --git a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs index bccb5914..696674c6 100644 --- a/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs +++ b/Migration.Toolkit.Core.KX12/Providers/ContentItemNameValidator.cs @@ -1,25 +1,18 @@ -namespace Migration.Toolkit.Core.KX12.Providers; - -using CMS.ContentEngine.Internal; - -internal class ContentItemNameValidator : IContentItemNameValidator -{ - /// - public bool IsUnique(string name) - { - return IsUnique(0, name); - } - - - /// - public bool IsUnique(int id, string name) - { - var contentItemInfo = new ContentItemInfo() - { - ContentItemID = id, - ContentItemName = name, - }; - - return contentItemInfo.CheckUniqueCodeName(); - } -} \ No newline at end of file +using CMS.ContentEngine.Internal; + +namespace Migration.Toolkit.Core.KX12.Providers; + +internal class ContentItemNameValidator : IContentItemNameValidator +{ + /// + public bool IsUnique(string name) => IsUnique(0, name); + + + /// + public bool IsUnique(int id, string name) + { + var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; + + return contentItemInfo.CheckUniqueCodeName(); + } +} diff --git a/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs index 4a7affe3..99062b83 100644 --- a/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.KX12/Providers/UniqueContentItemNameProvider.cs @@ -1,48 +1,38 @@ -namespace Migration.Toolkit.Core.KX12.Providers; - -using System.Threading.Tasks; -using CMS.Base; -using CMS.ContentEngine.Internal; - -internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) - : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) - { - this.codeNameValidator = codeNameValidator; - } - - public override Task GetUniqueValue(string inputValue) - { - return base.GetUniqueValue(AddSuffix(inputValue)); - } - - - private string AddSuffix(string codeName) - { - var randomSuffix = GetRandomSuffix(); - var codeNameWithSuffix = codeName += randomSuffix; - - if (codeNameWithSuffix.Length > MaxLength) - { - var availableLength = MaxLength - randomSuffix.Length; - - codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; - } - - return codeNameWithSuffix; - } - - - /// - protected override Task IsValueUnique(string value) - { - return Task.FromResult(codeNameValidator.IsUnique(value)); - } -} \ No newline at end of file +using CMS.Base; +using CMS.ContentEngine.Internal; + +namespace Migration.Toolkit.Core.KX12.Providers; + +internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) + : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; + + public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); + + + private string AddSuffix(string codeName) + { + string randomSuffix = GetRandomSuffix(); + string codeNameWithSuffix = codeName += randomSuffix; + + if (codeNameWithSuffix.Length > MaxLength) + { + int availableLength = MaxLength - randomSuffix.Length; + + codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; + } + + return codeNameWithSuffix; + } + + + /// + protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); +} diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs index 6e1f0286..61991ae4 100644 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs +++ b/Migration.Toolkit.Core.KX12/Services/CmsClass/AttachmentSelectorItem.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Core.KX12.Services.CmsClass; - -using Newtonsoft.Json; - -/// Represents an item for the attachment selector. -public class AttachmentSelectorItem -{ - /// Attachment GUID. - [JsonProperty("fileGuid")] - public Guid FileGuid { get; set; } -} \ No newline at end of file +using Newtonsoft.Json; + +namespace Migration.Toolkit.Core.KX12.Services.CmsClass; + +/// Represents an item for the attachment selector. +public class AttachmentSelectorItem +{ + /// Attachment GUID. + [JsonProperty("fileGuid")] + public Guid FileGuid { get; set; } +} diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs deleted file mode 100644 index f4668789..00000000 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/EditableAreasConfiguration.cs +++ /dev/null @@ -1,186 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Services.CmsClass; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -#region Copied from Kentico assembly - -[DataContract(Name = "Configuration", Namespace = "")] -public sealed class EditableAreasConfiguration -{ - /// Editable areas within the page. - [DataMember] - [JsonProperty("editableAreas")] - public List EditableAreas { get; private set; } - - /// - /// Creates an instance of class. - /// - public EditableAreasConfiguration() => this.EditableAreas = new List(); -} - -/// -/// Represents configuration of editable area within the instance. -/// -[DataContract(Name = "EditableArea", Namespace = "")] -public sealed class EditableAreaConfiguration -{ - /// Identifier of the editable area. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// Sections within editable area. - [DataMember] - [JsonProperty("sections")] - public List Sections { get; private set; } - - /// - /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. - /// - public bool AllowWidgetOutputCache { get; set; } - - /// - /// An absolute expiration date for the cached output of the individual widgets. - /// - public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } - - /// - /// The length of time from the first request to cache the output of the individual widgets. - /// - public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } - - /// - /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. - /// - public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } - - /// - /// Creates an instance of class. - /// - public EditableAreaConfiguration() => this.Sections = new List(); -} - -/// -/// Represents configuration of section within the instance. -/// -[DataContract(Name = "Section", Namespace = "")] -public sealed class SectionConfiguration -{ - /// Identifier of the section. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type section identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Section properties. - [DataMember] - [JsonProperty("properties")] - // public ISectionProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Zones within the section. - [DataMember] - [JsonProperty("zones")] - public List Zones { get; private set; } - - /// - /// Creates an instance of class. - /// - public SectionConfiguration() => this.Zones = new List(); -} - -/// -/// Represents the zone within the configuration class. -/// -[DataContract(Name = "Zone", Namespace = "")] -public sealed class ZoneConfiguration -{ - /// Identifier of the widget zone. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Name of the widget zone. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// List of widgets within the zone. - [DataMember] - [JsonProperty("widgets")] - public List Widgets { get; private set; } - - /// - /// Creates an instance of class. - /// - public ZoneConfiguration() => this.Widgets = new List(); -} - -/// -/// Represents the configuration of a widget within the list. -/// -[DataContract(Name = "Widget", Namespace = "")] -public sealed class WidgetConfiguration -{ - /// Identifier of the widget instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type widget identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Personalization condition type identifier. - [DataMember] - [JsonProperty("conditionType")] - public string PersonalizationConditionTypeIdentifier { get; set; } - - /// List of widget variants. - [DataMember] - [JsonProperty("variants")] - public List Variants { get; set; } - - /// - /// Creates an instance of class. - /// - public WidgetConfiguration() => this.Variants = new List(); -} - -/// -/// Represents the configuration variant of a widget within the list. -/// -[DataContract(Name = "Variant", Namespace = "")] -public sealed class WidgetVariantConfiguration -{ - /// Identifier of the variant instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Widget variant name. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// Widget variant properties. - [DataMember] - [JsonProperty("properties")] - // public IWidgetProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Widget variant personalization condition type. - /// Only personalization condition type parameters are serialized to JSON. - [DataMember] - [JsonProperty("conditionTypeParameters")] - public JObject PersonalizationConditionType { get; set; } -} - -#endregion \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs deleted file mode 100644 index 00432666..00000000 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageSelectorItem.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Services.CmsClass; - -using Newtonsoft.Json; - -/// Represents an item for a page selector. -public class PageSelectorItem -{ - /// Node Guid of a page. - [JsonProperty("nodeGuid")] - public Guid NodeGuid { get; set; } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs b/Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs deleted file mode 100644 index f2885705..00000000 --- a/Migration.Toolkit.Core.KX12/Services/CmsClass/PageTemplateConfiguration.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Services.CmsClass; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -/// -/// Page template configuration for the instance. -/// -[DataContract(Name = "PageTemplate", Namespace = "")] -public class PageTemplateConfiguration -{ - /// Identifier of the page template. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// - /// Identifier of the page template configuration based on which the page was created. - /// - [DataMember] - [JsonProperty("configurationIdentifier")] - public Guid ConfigurationIdentifier { get; set; } - - /// Page template properties. - [DataMember] - [JsonProperty("properties")] - public JObject Properties { get; set; } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs b/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs index 043db008..8fb5024a 100644 --- a/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs +++ b/Migration.Toolkit.Core.KX12/Services/CountryMigrator.cs @@ -1,123 +1,104 @@ -namespace Migration.Toolkit.Core.KX12.Services; - -using CMS.Globalization; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX12.Contexts; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KX12.Models; -using Migration.Toolkit.KXP.Api; - -public class CountryMigrator -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kx12ContextFactory; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - private readonly IEntityMapper _countryMapper; - private readonly IEntityMapper _stateMapper; - private readonly KxpApiInitializer _kxpApiInitializer; - - public CountryMigrator( - ILogger logger, - IDbContextFactory kx12ContextFactory, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - IEntityMapper countryMapper, - IEntityMapper stateMapper, - KxpApiInitializer kxpApiInitializer - ) - { - _logger = logger; - _kx12ContextFactory = kx12ContextFactory; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - _countryMapper = countryMapper; - _stateMapper = stateMapper; - _kxpApiInitializer = kxpApiInitializer; - } - - public void MigrateCountriesAndStates() - { - if (!_kxpApiInitializer.EnsureApiIsInitialized()) - { - throw new InvalidOperationException($"Falied to initialize kentico API. Please check configuration."); - } - - var kx12Context = _kx12ContextFactory.CreateDbContext(); - - var k12Countries = kx12Context.CmsCountries.AsNoTracking(); - foreach (var k12CmsCountry in k12Countries) - { - var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(k12CmsCountry.CountryName); - - if (kxpCountryInfo != null) // do not update when exists - { - continue; - } - - var mapped = _countryMapper.Map(k12CmsCountry, null); - _protocol.MappedTarget(mapped); - - if (mapped is (var countryInfo, var newInstance) { Success: true }) - { - try - { - CountryInfoProvider.ProviderObject.Set(countryInfo); - - _protocol.Success(k12CmsCountry, countryInfo, mapped); - _logger.LogEntitySetAction(newInstance, countryInfo); - - _primaryKeyMappingContext.SetMapping(r => r.CountryId, k12CmsCountry.CountryId, countryInfo.CountryID); - } - catch (Exception exception) - { - _logger.LogEntitySetError(exception, newInstance, countryInfo); - _protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(countryInfo) - ); - } - } - } - - - var k12States = kx12Context.CmsStates.AsNoTracking(); - foreach (var k12CmsState in k12States) - { - var kxpStateInfo = StateInfoProvider.ProviderObject.Get(k12CmsState.StateName); - - if (kxpStateInfo != null) // do not update when exists - { - continue; - } - - var mapped = _stateMapper.Map(k12CmsState, null); - _protocol.MappedTarget(mapped); - - if (mapped is (var stateInfo, var newInstance) { Success: true }) - { - try - { - StateInfoProvider.ProviderObject.Set(stateInfo); - - _protocol.Success(k12CmsState, stateInfo, mapped); - _logger.LogEntitySetAction(newInstance, stateInfo); - - _primaryKeyMappingContext.SetMapping(r => r.StateId, k12CmsState.StateId, stateInfo.StateID); - } - catch (Exception exception) - { - _logger.LogEntitySetError(exception, newInstance, stateInfo); - _protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(stateInfo) - ); - } - } - } - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX12.Contexts; +using Migration.Toolkit.KX12.Context; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.KX12.Services; + +public class CountryMigrator( + ILogger logger, + IDbContextFactory kx12ContextFactory, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + IEntityMapper countryMapper, + IEntityMapper stateMapper, + KxpApiInitializer kxpApiInitializer) +{ + public void MigrateCountriesAndStates() + { + if (!kxpApiInitializer.EnsureApiIsInitialized()) + { + throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); + } + + var kx12Context = kx12ContextFactory.CreateDbContext(); + + var k12Countries = kx12Context.CmsCountries.AsNoTracking(); + foreach (var k12CmsCountry in k12Countries) + { + var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(k12CmsCountry.CountryName); + + if (kxpCountryInfo != null) // do not update when exists + { + continue; + } + + var mapped = countryMapper.Map(k12CmsCountry, null); + protocol.MappedTarget(mapped); + + if (mapped is (var countryInfo, var newInstance) { Success: true }) + { + try + { + CountryInfoProvider.ProviderObject.Set(countryInfo); + + protocol.Success(k12CmsCountry, countryInfo, mapped); + logger.LogEntitySetAction(newInstance, countryInfo); + + primaryKeyMappingContext.SetMapping(r => r.CountryId, k12CmsCountry.CountryId, countryInfo.CountryID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, countryInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(countryInfo) + ); + } + } + } + + + var k12States = kx12Context.CmsStates.AsNoTracking(); + foreach (var k12CmsState in k12States) + { + var kxpStateInfo = StateInfoProvider.ProviderObject.Get(k12CmsState.StateName); + + if (kxpStateInfo != null) // do not update when exists + { + continue; + } + + var mapped = stateMapper.Map(k12CmsState, null); + protocol.MappedTarget(mapped); + + if (mapped is (var stateInfo, var newInstance) { Success: true }) + { + try + { + StateInfoProvider.ProviderObject.Set(stateInfo); + + protocol.Success(k12CmsState, stateInfo, mapped); + logger.LogEntitySetAction(newInstance, stateInfo); + + primaryKeyMappingContext.SetMapping(r => r.StateId, k12CmsState.StateId, stateInfo.StateID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, stateInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(stateInfo) + ); + } + } + } + } +} diff --git a/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs index 8e873085..d48f28b3 100644 --- a/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX12/Services/IPrimaryKeyLocatorService.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Core.KX12.Services; - -using System.Linq.Expressions; - -public record SourceTargetKeyMapping(int SourceId, int TargetId); - -public interface IPrimaryKeyLocatorService -{ - bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); - IEnumerable SelectAll(Expression> keyNameSelector); -} \ No newline at end of file +using System.Linq.Expressions; + +namespace Migration.Toolkit.Core.KX12.Services; + +public record SourceTargetKeyMapping(int SourceId, int TargetId); + +public interface IPrimaryKeyLocatorService +{ + bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); + IEnumerable SelectAll(Expression> keyNameSelector); +} diff --git a/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs index 54247c61..b5f59e8e 100644 --- a/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX12/Services/KeyLocatorService.cs @@ -1,122 +1,108 @@ -namespace Migration.Toolkit.Core.KX12.Services; - -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Context; - -public class KeyLocatorService -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _kx12ContextFactory; - - public KeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx12ContextFactory - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _kx12ContextFactory = kx12ContextFactory; - } - - public bool TryLocate( - Expression> sourceKeySelector, - Expression> targetKeySelector, - Expression> sourceGuidSelector, - Expression> targetGuidSelector, - object? sourceKey, out TTargetKey targetId - ) where TSource : class where TTarget : class - { - using var kxpContext = _kxpContextFactory.CreateDbContext(); - using var kx12Context = _kx12ContextFactory.CreateDbContext(); - - var sourceType = typeof(TSource); - Unsafe.SkipInit(out targetId); - - try - { - if (sourceKey is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - sourceKeySelector.Body, - Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); - var k12Guid = kx12Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); - - var param = Expression.Parameter(typeof(TTarget), "t"); - var member = targetGuidSelector.Body as MemberExpression; - if (member == null) - { - throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); - } - var targetEquals = Expression.Equal( - Expression.MakeMemberAccess(param, member.Member), - Expression.Constant(k12Guid, typeof(Guid)) - ); - var targetPredicate = Expression.Lambda>(targetEquals, param); - - var query = kxpContext.Set().Where(targetPredicate); - var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); - targetId = query.Select(selector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - _logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); - return false; - } - finally - { - if (!targetId?.Equals(default) ?? false) - { - _logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); - } - } - } - - public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) - where T : class - { - using var KX12Context = _kx12ContextFactory.CreateDbContext(); - - var type = typeof(T); - Unsafe.SkipInit(out guid); - - try - { - if (key is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - keySelector.Body, - Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); - guid = KX12Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - _logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); - return false; - } - finally - { - if (!guid?.Equals(default) ?? false) - { - _logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); - } - } - } -} \ No newline at end of file +using System.Linq.Expressions; +using System.Runtime.CompilerServices; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.KX12.Context; +using Migration.Toolkit.KXP.Context; + +namespace Migration.Toolkit.Core.KX12.Services; + +public class KeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx12ContextFactory) +{ + public bool TryLocate( + Expression> sourceKeySelector, + Expression> targetKeySelector, + Expression> sourceGuidSelector, + Expression> targetGuidSelector, + object? sourceKey, out TTargetKey targetId + ) where TSource : class where TTarget : class + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx12Context = kx12ContextFactory.CreateDbContext(); + + var sourceType = typeof(TSource); + Unsafe.SkipInit(out targetId); + + try + { + if (sourceKey is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + sourceKeySelector.Body, + Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); + var k12Guid = kx12Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); + + var param = Expression.Parameter(typeof(TTarget), "t"); + var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); + var targetEquals = Expression.Equal( + Expression.MakeMemberAccess(param, member.Member), + Expression.Constant(k12Guid, typeof(Guid)) + ); + var targetPredicate = Expression.Lambda>(targetEquals, param); + + var query = kxpContext.Set().Where(targetPredicate); + var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); + targetId = query.Select(selector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); + return false; + } + finally + { + if (!targetId?.Equals(default) ?? false) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); + } + } + } + + public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) + where T : class + { + using var kx12Context = kx12ContextFactory.CreateDbContext(); + + var type = typeof(T); + Unsafe.SkipInit(out guid); + + try + { + if (key is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + keySelector.Body, + Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); + guid = kx12Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); + return false; + } + finally + { + if (!guid?.Equals(default) ?? false) + { + logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); + } + } + } +} diff --git a/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs index 42ea6d85..68b02aba 100644 --- a/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX12/Services/PrimaryKeyLocatorService.cs @@ -1,263 +1,219 @@ -namespace Migration.Toolkit.Core.KX12.Services; - -using System.Linq.Expressions; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.KX12.Context; -using Migration.Toolkit.KXP.Context; - -public class PrimaryKeyLocatorService : IPrimaryKeyLocatorService -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _kx12ContextFactory; - - public PrimaryKeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx12ContextFactory - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _kx12ContextFactory = kx12ContextFactory; - } - - private class KeyEqualityComparerWithLambda : IEqualityComparer - { - private readonly Func _equalityComparer; - - public KeyEqualityComparerWithLambda(Func equalityComparer) - { - _equalityComparer = equalityComparer; - } - - public bool Equals(T? x, T? y) => _equalityComparer.Invoke(x, y); - - public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; - } - - private record CmsUserKey(Guid UserGuid, string UserName); - - public IEnumerable SelectAll(Expression> keyNameSelector) - { - using var kxpContext = _kxpContextFactory.CreateDbContext(); - using var kx12Context = _kx12ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - var memberName = keyNameSelector.GetMemberName(); - - _logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); - - if (sourceType == typeof(KX12M.CmsUser) && memberName == nameof(KX12M.CmsUser.UserId)) - { - var sourceUsers = kx12Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); - var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); - - var result = sourceUsers.Join(targetUsers, - a => new CmsUserKey(a.UserGuid, a.UserName), - b => new CmsUserKey(b.UserGuid, b.UserName), - (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), - new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX12M.OmContact) && memberName == nameof(KX12M.OmContact.ContactId)) - { - var source = kx12Context.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - var target = kxpContext.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - - var result = source.Join(target, - a => a.ContactGuid, - b => b.ContactGuid, - (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX12M.CmsTree) && memberName == nameof(KX12M.CmsTree.NodeId)) - { - var source = kx12Context.CmsTrees.Select(x => new { x.NodeId, x.NodeGuid }).ToList(); - var target = kxpContext.CmsChannels.Select(x => new { x.ChannelId, x.ChannelGuid }).ToList(); - - var result = source.Join(target, - a => a.NodeGuid, - b => b.ChannelGuid, - (a, b) => new SourceTargetKeyMapping(a.NodeId, b.ChannelId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX12M.CmsState) && memberName == nameof(KX12M.CmsState.StateId)) - { - var source = kx12Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - - var result = source.Join(target, - a => a.StateName, - b => b.StateName, - (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(KX12M.CmsCountry) && memberName == nameof(KX12M.CmsCountry.CountryId)) - { - var source = kx12Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - - var result = source.Join(target, - a => a.CountryName, - b => b.CountryName, - (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - - - throw new NotImplementedException(); - } - - public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) - { - using var kxpContext = _kxpContextFactory.CreateDbContext(); - using var KX12Context = _kx12ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - targetId = -1; - try - { - if (sourceType == typeof(KX12M.CmsResource)) - { - var k12Guid = KX12Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); - targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == k12Guid).Select(x => x.ResourceId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsClass)) - { - var k12Guid = KX12Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); - targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == k12Guid).Select(x => x.ClassId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsUser)) - { - var k12User = KX12Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); - targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == k12User.UserGuid || x.UserName == k12User.UserName).Select(x => x.UserId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsRole)) - { - var k12User = KX12Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); - targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == k12User.RoleGuid).Select(x => x.RoleId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsSite)) - { - var k12Guid = KX12Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k12Guid).Select(x => x.ChannelId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsState)) - { - var k12CodeName = KX12Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); - targetId = kxpContext.CmsStates.Where(x => x.StateName == k12CodeName).Select(x => x.StateId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsCountry)) - { - var k12CodeName = KX12Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); - targetId = kxpContext.CmsCountries.Where(x => x.CountryName == k12CodeName).Select(x => x.CountryId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.OmContactStatus)) - { - var k12Guid = KX12Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); - targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == k12Guid).Select(x => x.ContactStatusId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.OmContact)) - { - var k12Guid = KX12Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); - targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == k12Guid).Select(x => x.ContactId).Single(); - return true; - } - - if (sourceType == typeof(KX12M.CmsTree)) - { - // careful - cms.root will have different guid - var k12Guid = KX12Context.CmsTrees.Where(c => c.NodeId == sourceId).Select(x => x.NodeGuid).Single(); - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k12Guid).Select(x => x.ChannelId).Single(); - return true; - } - } - catch (InvalidOperationException ioex) - { - if (ioex.Message.StartsWith("Sequence contains no elements")) - { - _logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - else - { - _logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - return false; - } - finally - { - if (targetId != -1) - { - _logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); - } - } - - _logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); - targetId = -1; - return false; - } -} \ No newline at end of file +using System.Linq.Expressions; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.KX12.Context; +using Migration.Toolkit.KXP.Context; + +namespace Migration.Toolkit.Core.KX12.Services; + +public class PrimaryKeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx12ContextFactory) + : IPrimaryKeyLocatorService +{ + public IEnumerable SelectAll(Expression> keyNameSelector) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx12Context = kx12ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + string memberName = keyNameSelector.GetMemberName(); + + logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); + + if (sourceType == typeof(KX12M.CmsUser) && memberName == nameof(KX12M.CmsUser.UserId)) + { + var sourceUsers = kx12Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); + var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); + + var result = sourceUsers.Join(targetUsers, + a => new CmsUserKey(a.UserGuid, a.UserName), + b => new CmsUserKey(b.UserGuid, b.UserName), + (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), + new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX12M.OmContact) && memberName == nameof(KX12M.OmContact.ContactId)) + { + var source = kx12Context.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + var target = kxpContext.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + + var result = source.Join(target, + a => a.ContactGuid, + b => b.ContactGuid, + (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX12M.CmsState) && memberName == nameof(KX12M.CmsState.StateId)) + { + var source = kx12Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + + var result = source.Join(target, + a => a.StateName, + b => b.StateName, + (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX12M.CmsCountry) && memberName == nameof(KX12M.CmsCountry.CountryId)) + { + var source = kx12Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + + var result = source.Join(target, + a => a.CountryName, + b => b.CountryName, + (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + + throw new NotImplementedException(); + } + + public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var KX12Context = kx12ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + targetId = -1; + try + { + if (sourceType == typeof(KX12M.CmsResource)) + { + var k12Guid = KX12Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); + targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == k12Guid).Select(x => x.ResourceId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsClass)) + { + var k12Guid = KX12Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); + targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == k12Guid).Select(x => x.ClassId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsUser)) + { + var k12User = KX12Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); + targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == k12User.UserGuid || x.UserName == k12User.UserName).Select(x => x.UserId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsRole)) + { + var k12User = KX12Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); + targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == k12User.RoleGuid).Select(x => x.RoleId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsSite)) + { + var k12Guid = KX12Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); + targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == k12Guid).Select(x => x.ChannelId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsState)) + { + string k12CodeName = KX12Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); + targetId = kxpContext.CmsStates.Where(x => x.StateName == k12CodeName).Select(x => x.StateId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.CmsCountry)) + { + string k12CodeName = KX12Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); + targetId = kxpContext.CmsCountries.Where(x => x.CountryName == k12CodeName).Select(x => x.CountryId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.OmContactStatus)) + { + string k12Guid = KX12Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); + targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == k12Guid).Select(x => x.ContactStatusId).Single(); + return true; + } + + if (sourceType == typeof(KX12M.OmContact)) + { + var k12Guid = KX12Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); + targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == k12Guid).Select(x => x.ContactId).Single(); + return true; + } + } + catch (InvalidOperationException ioex) + { + if (ioex.Message.StartsWith("Sequence contains no elements")) + { + logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + else + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + + return false; + } + finally + { + if (targetId != -1) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); + } + } + + logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); + targetId = -1; + return false; + } + + private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer + { + public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); + + public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; + } + + private record CmsUserKey(Guid UserGuid, string UserName); +} diff --git a/Migration.Toolkit.Core.KX12/Services/TableReflectionService.cs b/Migration.Toolkit.Core.KX12/Services/TableReflectionService.cs deleted file mode 100644 index 4bde41d7..00000000 --- a/Migration.Toolkit.Core.KX12/Services/TableReflectionService.cs +++ /dev/null @@ -1,45 +0,0 @@ -namespace Migration.Toolkit.Core.KX12.Services; - -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.KX12.Context; - -public class TableReflectionService -{ - private readonly ILogger _logger; - private readonly Dictionary _tableNameLookup; - - public TableReflectionService(ILogger logger) - { - _logger = logger; - var (_, tableNameLookup) = typeof(KX12Context).Assembly.GetTypes().Aggregate(( - nameLookup: new Dictionary(), - tableNameLookup: new Dictionary() - ), (lookups, type) => - { - var rh = new ReflectionHelper(type); - - if (rh.GetFirstAttributeOrNull()?.Name is { } tableName && !string.IsNullOrWhiteSpace(tableName)) - { - lookups.tableNameLookup[tableName] = type; - lookups.nameLookup[type.Name] = type; - } - - return lookups; - }); - - this._tableNameLookup = tableNameLookup; - } - - public Type GetSourceTableTypeByTableName(string tableName) - { - if (!_tableNameLookup.ContainsKey(tableName)) - { - var joinedKeys = string.Join(", ", _tableNameLookup.Keys); - _logger.LogError("Invalid table name, use one of following: {TableNames}", joinedKeys); - throw new KeyNotFoundException($"Invalid table name, use one of following: {joinedKeys}"); - } - return _tableNameLookup[tableName]; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Auxiliary/NodeXmlAdapter.cs b/Migration.Toolkit.Core.KX13/Auxiliary/NodeXmlAdapter.cs deleted file mode 100644 index d5ecc788..00000000 --- a/Migration.Toolkit.Core.KX13/Auxiliary/NodeXmlAdapter.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Auxiliary; - -using System; -using System.Xml.Linq; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Enumerations; - -internal class NodeXmlAdapter -{ - private readonly XElement _xClass; - - public bool ParsingSuccessful { get; } - - public NodeXmlAdapter(string xml) - { - var xDoc = XDocument.Parse(xml); - if (xDoc.Root?.FirstNode is XElement dClass) - { - _xClass = dClass; - ParsingSuccessful = true; - } - else - { - _xClass = null!; - ParsingSuccessful = false; - } - } - - public string? GetValue(string columnName) - { - return _xClass.Element(columnName)?.Value; - } - - public bool HasValueSet(string columnName) - { - return _xClass.Element(columnName) != null; - } - - public int? NodeID => _xClass.Element(NodeXmlColumns.NODE_ID)?.Value(); - public string? NodeAliasPath => _xClass.Element(NodeXmlColumns.NODE_ALIAS_PATH)?.Value; - public string? NodeName => _xClass.Element(NodeXmlColumns.NODE_NAME)?.Value; - public string? NodeAlias => _xClass.Element(NodeXmlColumns.NODE_ALIAS)?.Value; - public int? NodeClassID => _xClass.Element(NodeXmlColumns.NODE_CLASS_ID)?.Value(); - public int? NodeParentID => _xClass.Element(NodeXmlColumns.NODE_PARENT_ID)?.Value(); - public int? NodeLevel => _xClass.Element(NodeXmlColumns.NODE_LEVEL)?.Value(); - public int? NodeSiteID => _xClass.Element(NodeXmlColumns.NODE_SITE_ID)?.Value(); - public Guid? NodeGUID => _xClass.Element(NodeXmlColumns.NODE_GUID)?.Value(); - public int? NodeOrder => _xClass.Element(NodeXmlColumns.NODE_ORDER)?.Value(); - public int? NodeOwner => _xClass.Element(NodeXmlColumns.NODE_OWNER)?.Value(); - public bool? NodeHasChildren => _xClass.Element(NodeXmlColumns.NODE_HAS_CHILDREN)?.ValueAsBool(); - public bool? NodeHasLinks => _xClass.Element(NodeXmlColumns.NODE_HAS_LINKS)?.ValueAsBool(); - public int? NodeOriginalNodeID => _xClass.Element(NodeXmlColumns.NODE_ORIGINAL_NODE_ID)?.Value(); - public bool? NodeIsPage => _xClass.Element(NodeXmlColumns.NODE_IS_PAGE)?.ValueAsBool(); - public bool? NodeIsSecured => _xClass.Element(NodeXmlColumns.NODE_IS_SECURED)?.ValueAsBool(); - public int? DocumentID => _xClass.Element(NodeXmlColumns.DOCUMENT_ID)?.Value(); - public string? DocumentName => _xClass.Element(NodeXmlColumns.DOCUMENT_NAME)?.Value; - public DateTime? DocumentModifiedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_WHEN)?.Value(); - public int? DocumentModifiedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_MODIFIED_BY_USER_ID)?.Value(); - public int? DocumentCreatedByUserID => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_BY_USER_ID)?.Value(); - public DateTime? DocumentCreatedWhen => _xClass.Element(NodeXmlColumns.DOCUMENT_CREATED_WHEN)?.Value(); - public int? DocumentCheckedOutVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_CHECKED_OUT_VERSION_HISTORY_ID)?.Value(); - public int? DocumentPublishedVersionHistoryID => _xClass.Element(NodeXmlColumns.DOCUMENT_PUBLISHED_VERSION_HISTORY_ID)?.Value(); - public int? DocumentWorkflowStepID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_STEP_ID)?.Value(); - public string? DocumentCulture => _xClass.Element(NodeXmlColumns.DOCUMENT_CULTURE)?.Value; - public int? DocumentNodeID => _xClass.Element(NodeXmlColumns.DOCUMENT_NODE_ID)?.Value(); - public string? DocumentContent => _xClass.Element(NodeXmlColumns.DOCUMENT_CONTENT)?.Value; - public string? DocumentLastVersionNumber => _xClass.Element(NodeXmlColumns.DOCUMENT_LAST_VERSION_NUMBER)?.Value; - public bool? DocumentIsArchived => _xClass.Element(NodeXmlColumns.DOCUMENT_IS_ARCHIVED)?.ValueAsBool(); - public Guid? DocumentGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_GUID)?.Value(); - public Guid? DocumentWorkflowCycleGUID => _xClass.Element(NodeXmlColumns.DOCUMENT_WORKFLOW_CYCLE_GUID)?.Value(); - public bool? DocumentCanBePublished => _xClass.Element(NodeXmlColumns.DOCUMENT_CAN_BE_PUBLISHED)?.ValueAsBool(); - public string? DocumentPageBuilderWidgets => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_BUILDER_WIDGETS)?.Value; - public string? ClassName => _xClass.Element(NodeXmlColumns.CLASS_NAME)?.Value; - - public string? DocumentPageTemplateConfiguration => _xClass.Element(NodeXmlColumns.DOCUMENT_PAGE_TEMPLATE_CONFIGURATION)?.Value; -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs b/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs index 0ee676f6..1691c1a4 100644 --- a/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs +++ b/Migration.Toolkit.Core.KX13/Behaviors/CommandConstraintBehavior.cs @@ -1,301 +1,232 @@ -namespace Migration.Toolkit.Core.KX13.Behaviors; - -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KX13; -using Migration.Toolkit.KX13.Context; - -public class CommandConstraintBehavior : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - private readonly ILogger> _logger; - private readonly IMigrationProtocol _protocol; - private readonly IDbContextFactory _kx13ContextFactory; - private readonly ToolkitConfiguration _toolkitConfiguration; - - public CommandConstraintBehavior( - ILogger> logger, - IMigrationProtocol protocol, - IDbContextFactory kx13ContextFactory, - ToolkitConfiguration toolkitConfiguration - ) - { - _logger = logger; - _protocol = protocol; - _kx13ContextFactory = kx13ContextFactory; - _toolkitConfiguration = toolkitConfiguration; - } - - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - try - { - var kx13Context = await _kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - var criticalCheckPassed = PerformChecks(request, kx13Context); - if (!criticalCheckPassed) - { - return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); - } - } - catch (Exception ex) - { - _protocol.CommandError(ex, request); - _logger.LogCritical(ex, "Error occured while checking command constraints"); - return (TResponse)(CommandResult)new CommandCheckFailedResult(false); - } - - return await next(); - } - - private bool PerformChecks(TRequest request, KX13Context kx13Context) - { - var criticalCheckPassed = true; - // const string supportedVersion = "13.0.64"; - const string supportedVersion = "13.0.0"; - if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) - { - criticalCheckPassed &= CheckVersion(kx13Context, minimalVersion); - } - - // var sites = _toolkitConfiguration.RequireExplicitMapping(s => s.SiteId); - var sourceSites = kx13Context.CmsSites - .Include(s => s.Cultures) - .ToList(); - - foreach (var site in sourceSites) - { - criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); - } - - if (request is ICultureReliantCommand cultureReliantCommand) - { - criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); - } - - // criticalCheckPassed &= CheckDbCollations(); - - return criticalCheckPassed; - } - - private bool CheckVersion(KX13Context kx13Context, SemanticVersion minimalVersion) - { - var criticalCheckPassed = true; - - #region Check conclusion methods - - void UnableToReadVersionKey(string keyName) - { - _logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - _protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - ErrorKind = "Settings key value incorrect format", - SettingsKeyName = keyName, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void VersionKeyNotFound(string keyName) - { - _logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); - _protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - ErrorKind = "Settings key not found", - SettingsKeyName = keyName, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void UpgradeNeeded(string keyName, string currentVersion) - { - _logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); - _protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - CurrentVersion = currentVersion, - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - void LowHotfix(string keyName, int currentHotfix) - { - _logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); - _protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new - { - CurrentHotfix = currentHotfix.ToString(), - SupportedVersion = minimalVersion.ToString() - })); - criticalCheckPassed = false; - } - - #endregion - - if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) - { - if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDataVersion); - } - - if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) - { - if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) - { - if (cmsDataVer.IsLesserThan(minimalVersion)) - { - UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSDBVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSDBVersion); - } - - if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) - { - if (int.TryParse(cmsHotfixDataVersion.KeyValue, out var version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); - } - - if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) - { - if (int.TryParse(cmsHotfixVersion.KeyValue, out var version)) - { - if (version < minimalVersion.Hotfix) - { - LowHotfix(SettingsKeys.CMSHotfixVersion, version); - } - } - else - { - UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); - } - } - else - { - VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); - } - - return criticalCheckPassed; - } - - private bool CheckSite(List sourceSites, int sourceSiteId) - { - var criticalCheckPassed = true; - if (sourceSites.All(s => s.SiteId != sourceSiteId)) - { - var supportedSites = sourceSites.Select(x => new - { - x.SiteName, - x.SiteId - }).ToArray(); - var supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); - _logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, - supportedSitesStr); - _protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") - .WithMessage("Check program argument '--siteId'") - .WithData(new - { - sourceSiteId, - AvailableSites = supportedSites - })); - criticalCheckPassed = false; - } - - return criticalCheckPassed; - } - - private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) - { - var criticalCheckPassed = true; - var cultureCode = cultureReliantCommand.CultureCode; - var siteCultureLookup = sourceSites - .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); - - foreach (var site in sourceSites) - { - if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) - { - var siteCultures = value.ToArray(); - if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) - { - var supportedCultures = string.Join(", ", siteCultures); - _logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); - _protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") - .WithMessage("Check program argument '--culture'") - .WithData(new - { - cultureCode, - site.SiteId, - SiteCultures = supportedCultures - })); - criticalCheckPassed = false; - } - } - } - - return criticalCheckPassed; - } - - // TODO tk: 2022-11-02 create global rule - private bool CheckDbCollations() - { - var kxCollation = GetDbCollationName(_toolkitConfiguration.KxConnectionString ?? throw new InvalidOperationException("KxConnectionString is required")); - var xbkCollation = GetDbCollationName(_toolkitConfiguration.XbKConnectionString ?? throw new InvalidOperationException("XbKConnectionString is required")); - var collationAreSame = kxCollation == xbkCollation; - if (!collationAreSame) - { - _logger.LogCritical("Source db collation '{SourceDbCollation}' is not same as target db collation {TargetDbCollation} => same collations are required", kxCollation, xbkCollation); - } - - return collationAreSame; - } - - private string? GetDbCollationName(string connectionString) - { - using var sqlConnection = new SqlConnection(connectionString); - using var sqlCommand = sqlConnection.CreateCommand(); - sqlCommand.CommandText = "SELECT DATABASEPROPERTYEX(DB_NAME(), 'Collation')"; - - sqlConnection.Open(); - return sqlCommand.ExecuteScalar() as string; - } -} \ No newline at end of file +using MediatR; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KX13; +using Migration.Toolkit.KX13.Context; + +namespace Migration.Toolkit.Core.KX13.Behaviors; + +public class CommandConstraintBehavior( + ILogger> logger, + IMigrationProtocol protocol, + IDbContextFactory kx13ContextFactory, + ToolkitConfiguration toolkitConfiguration) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + try + { + var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + bool criticalCheckPassed = PerformChecks(request, kx13Context); + if (!criticalCheckPassed) + { + return (TResponse)(CommandResult)new CommandCheckFailedResult(criticalCheckPassed); + } + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogCritical(ex, "Error occured while checking command constraints"); + return (TResponse)(CommandResult)new CommandCheckFailedResult(false); + } + + return await next(); + } + + private bool PerformChecks(TRequest request, KX13Context kx13Context) + { + bool criticalCheckPassed = true; + // const string supportedVersion = "13.0.64"; + const string supportedVersion = "13.0.0"; + if (SemanticVersion.TryParse(supportedVersion, out var minimalVersion)) + { + criticalCheckPassed &= CheckVersion(kx13Context, minimalVersion); + } + + var sourceSites = kx13Context.CmsSites + .Include(s => s.Cultures) + .ToList(); + + foreach (var site in sourceSites) + { + criticalCheckPassed &= CheckSite(sourceSites, site.SiteId); + } + + if (request is ICultureReliantCommand cultureReliantCommand) + { + criticalCheckPassed &= CheckCulture(cultureReliantCommand, sourceSites); + } + + // criticalCheckPassed &= CheckDbCollations(); + + return criticalCheckPassed; + } + + private bool CheckVersion(KX13Context kx13Context, SemanticVersion minimalVersion) + { + bool criticalCheckPassed = true; + + #region Check conclusion methods + + void UnableToReadVersionKey(string keyName) + { + logger.LogCritical("Unable to read CMS version (incorrect format) - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key value incorrect format", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void VersionKeyNotFound(string keyName) + { + logger.LogCritical("CMS version not found - SettingsKeyName '{Key}'. Ensure Kentico version is at least '{SupportedVersion}'", keyName, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { ErrorKind = "Settings key not found", SettingsKeyName = keyName, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void UpgradeNeeded(string keyName, string currentVersion) + { + logger.LogCritical("{Key} '{CurrentVersion}' is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentVersion, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentVersion = currentVersion, SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + void LowHotfix(string keyName, int currentHotfix) + { + logger.LogCritical("{Key} '{CurrentVersion}' hotfix is not supported for migration. Upgrade Kentico to at least '{SupportedVersion}'", keyName, currentHotfix, minimalVersion.ToString()); + protocol.Append(HandbookReferences.InvalidSourceCmsVersion().WithData(new { CurrentHotfix = currentHotfix.ToString(), SupportedVersion = minimalVersion.ToString() })); + criticalCheckPassed = false; + } + + #endregion + + if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDataVersion) is { } cmsDataVersion) + { + if (SemanticVersion.TryParse(cmsDataVersion.KeyValue, out var cmsDataVer)) + { + if (cmsDataVer.IsLesserThan(minimalVersion)) + { + UpgradeNeeded(SettingsKeys.CMSDataVersion, cmsDataVer.ToString()); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSDataVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSDataVersion); + } + + if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSDBVersion) is { } cmsDbVersion) + { + if (SemanticVersion.TryParse(cmsDbVersion.KeyValue, out var cmsDataVer)) + { + if (cmsDataVer.IsLesserThan(minimalVersion)) + { + UpgradeNeeded(SettingsKeys.CMSDBVersion, cmsDataVer.ToString()); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSDBVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSDBVersion); + } + + if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixDataVersion) is { } cmsHotfixDataVersion) + { + if (int.TryParse(cmsHotfixDataVersion.KeyValue, out int version)) + { + if (version < minimalVersion.Hotfix) + { + LowHotfix(SettingsKeys.CMSHotfixDataVersion, version); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSHotfixDataVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSHotfixDataVersion); + } + + if (kx13Context.CmsSettingsKeys.FirstOrDefault(s => s.KeyName == SettingsKeys.CMSHotfixVersion) is { } cmsHotfixVersion) + { + if (int.TryParse(cmsHotfixVersion.KeyValue, out int version)) + { + if (version < minimalVersion.Hotfix) + { + LowHotfix(SettingsKeys.CMSHotfixVersion, version); + } + } + else + { + UnableToReadVersionKey(SettingsKeys.CMSHotfixVersion); + } + } + else + { + VersionKeyNotFound(SettingsKeys.CMSHotfixVersion); + } + + return criticalCheckPassed; + } + + private bool CheckSite(List sourceSites, int sourceSiteId) + { + bool criticalCheckPassed = true; + if (sourceSites.All(s => s.SiteId != sourceSiteId)) + { + var supportedSites = sourceSites.Select(x => new { x.SiteName, x.SiteId }).ToArray(); + string supportedSitesStr = string.Join(", ", supportedSites.Select(x => x.ToString())); + logger.LogCritical("Unable to find site with ID '{SourceSiteId}'. Check --siteId parameter. Supported sites: {SupportedSites}", sourceSiteId, + supportedSitesStr); + protocol.Append(HandbookReferences.CommandConstraintBroken("Site exists") + .WithMessage("Check program argument '--siteId'") + .WithData(new { sourceSiteId, AvailableSites = supportedSites })); + criticalCheckPassed = false; + } + + return criticalCheckPassed; + } + + private bool CheckCulture(ICultureReliantCommand cultureReliantCommand, List sourceSites) + { + bool criticalCheckPassed = true; + string cultureCode = cultureReliantCommand.CultureCode; + var siteCultureLookup = sourceSites + .ToDictionary(x => x.SiteId, x => x.Cultures.Select(s => s.CultureCode.ToLowerInvariant())); + + foreach (var site in sourceSites) + { + if (siteCultureLookup.TryGetValue(site.SiteId, out var value)) + { + string[] siteCultures = value.ToArray(); + if (!siteCultures.Contains(cultureCode.ToLowerInvariant())) + { + string supportedCultures = string.Join(", ", siteCultures); + logger.LogCritical("Unable to find culture '{Culture}' mapping to site '{SiteId}'. Check --culture parameter. Supported cultures for site: {SupportedCultures}", cultureCode, site.SiteId, supportedCultures); + protocol.Append(HandbookReferences.CommandConstraintBroken("Culture is mapped to site") + .WithMessage("Check program argument '--culture'") + .WithData(new { cultureCode, site.SiteId, SiteCultures = supportedCultures })); + criticalCheckPassed = false; + } + } + } + + return criticalCheckPassed; + } +} diff --git a/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs b/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs index 9f6ed038..c88c280a 100644 --- a/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs +++ b/Migration.Toolkit.Core.KX13/Behaviors/RequestHandlingBehavior.cs @@ -1,47 +1,40 @@ -namespace Migration.Toolkit.Core.KX13.Behaviors; - -using System.Diagnostics; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; - -public class RequestHandlingBehavior : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - private readonly ILogger> _logger; - private readonly IMigrationProtocol _protocol; - - public RequestHandlingBehavior( - ILogger> logger, - IMigrationProtocol protocol - ) - { - _logger = logger; - _protocol = protocol; - } - - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - var sw = Stopwatch.StartNew(); - _logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); - try - { - _protocol.CommandRequest(request); - var response = await next(); - _protocol.CommandFinished(request, response); - return response; - } - catch (Exception ex) - { - _protocol.CommandError(ex, request); - _logger.LogError(ex, "Error occured"); - throw; - } - finally - { - _logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); - } - } -} \ No newline at end of file +using System.Diagnostics; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; + +namespace Migration.Toolkit.Core.KX13.Behaviors; + +public class RequestHandlingBehavior( + ILogger> logger, + IMigrationProtocol protocol) : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + var sw = Stopwatch.StartNew(); + logger.LogInformation("Handling {CommandName}", typeof(TRequest).Name); + try + { + protocol.CommandRequest(request); + var response = await next(); + protocol.CommandFinished(request, response); + return response; + } + catch (Exception ex) + { + protocol.CommandError(ex, request); + logger.LogError(ex, "Error occured"); + throw; + } + finally + { + logger.LogInformation("Handled {CommandName} in elapsed: {Elapsed}", typeof(TRequest).Name, sw.Elapsed); + } + } +} diff --git a/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs b/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs index 84fd5f39..e56f4ee4 100644 --- a/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs +++ b/Migration.Toolkit.Core.KX13/Behaviors/XbKApiContextBehavior.cs @@ -1,53 +1,42 @@ -namespace Migration.Toolkit.Core.KX13.Behaviors; - -using CMS.Base; -using CMS.Membership; -using MediatR; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KXP.Api; - -public class XbKApiContextBehavior : IPipelineBehavior - where TRequest : IRequest - where TResponse : CommandResult -{ - private readonly ILogger> _logger; - private readonly IMigrationProtocol _protocol; - private readonly KxpApiInitializer _initializer; - - public XbKApiContextBehavior( - ILogger> logger, - IMigrationProtocol protocol, - KxpApiInitializer initializer - ) - { - _logger = logger; - _protocol = protocol; - _initializer = initializer; - } - - public async Task Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate next) - { - _initializer.EnsureApiIsInitialized(); - - var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); - if (defaultAdmin == null) - { - _protocol.Append(HandbookReferences - .MissingRequiredDependency() - .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") - ); - throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); - } - - using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) - { - // TODO tk: 2022-11-25 revise in future - // MembershipContext.AuthenticatedUser = defaultAdmin; - - _logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); - return await next(); - } - } -} \ No newline at end of file +using CMS.Base; +using CMS.Membership; + +using MediatR; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.KX13.Behaviors; + +public class XbKApiContextBehavior( + ILogger> logger, + IMigrationProtocol protocol, + KxpApiInitializer initializer) + : IPipelineBehavior + where TRequest : IRequest + where TResponse : CommandResult +{ + public async Task Handle(TRequest request, RequestHandlerDelegate next, CancellationToken cancellationToken) + { + initializer.EnsureApiIsInitialized(); + + var defaultAdmin = UserInfoProvider.ProviderObject.Get(UserInfoProvider.DEFAULT_ADMIN_USERNAME); + if (defaultAdmin == null) + { + protocol.Append(HandbookReferences + .MissingRequiredDependency() + .WithMessage($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}'). Default administrator account is required for migration.") + ); + throw new InvalidOperationException($"Target XbK doesn't contain default administrator account ('{UserInfoProvider.DEFAULT_ADMIN_USERNAME}')"); + } + + using (new CMSActionContext(defaultAdmin) { User = defaultAdmin, UseGlobalAdminContext = true }) + { + logger.LogInformation("Using CMSActionContext of user '{UserName}'", UserInfoProvider.DEFAULT_ADMIN_USERNAME); + return await next(); + } + } +} diff --git a/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs b/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs index a21464d2..8945684d 100644 --- a/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs +++ b/Migration.Toolkit.Core.KX13/Contexts/KeyMappingContext.cs @@ -1,42 +1,34 @@ -namespace Migration.Toolkit.Core.KX13.Contexts; - -using System.Linq.Expressions; -using Migration.Toolkit.Core.KX13.Services; - -public record MapSourceKeyResult(bool Success, TMapped? Mapped); - -public class KeyMappingContext -{ - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly KeyLocatorService _keyLocatorService; - - public KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) - { - _primaryKeyMappingContext = primaryKeyMappingContext; - _keyLocatorService = keyLocatorService; - } - - public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, - Expression> sourceGuidSelector, - object? sourceKey, - Expression> targetKeySelector, - Expression> targetGuidSelector) where TSource : class where TTarget : class - { - if (sourceKey is int id && _primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) - { - return new MapSourceKeyResult(true, targetKey); - } - - if (_keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) - { - return new MapSourceKeyResult(true, located); - } - - return new MapSourceKeyResult(false, default); - } - - public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => - _keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) - ? new MapSourceKeyResult(true, located) - : new MapSourceKeyResult(false, null); -} \ No newline at end of file +using System.Linq.Expressions; + +using Migration.Toolkit.Core.KX13.Services; + +namespace Migration.Toolkit.Core.KX13.Contexts; + +public record MapSourceKeyResult(bool Success, TMapped? Mapped); + +public class KeyMappingContext(PrimaryKeyMappingContext primaryKeyMappingContext, KeyLocatorService keyLocatorService) +{ + public MapSourceKeyResult MapSourceKey(Expression> sourceKeySelector, + Expression> sourceGuidSelector, + object? sourceKey, + Expression> targetKeySelector, + Expression> targetGuidSelector) where TSource : class where TTarget : class + { + if (sourceKey is int id && primaryKeyMappingContext.MapSourceId(sourceKeySelector, id) is { Success: true, MappedId: TTargetKey targetKey }) + { + return new MapSourceKeyResult(true, targetKey); + } + + if (keyLocatorService.TryLocate(sourceKeySelector, targetKeySelector, sourceGuidSelector, targetGuidSelector, sourceKey, out var located)) + { + return new MapSourceKeyResult(true, located); + } + + return new MapSourceKeyResult(false, default); + } + + public MapSourceKeyResult GetGuid(Expression> keySelector, Expression> guidSelector, object? key) where T : class => + keyLocatorService.TryGetSourceGuid(keySelector, guidSelector, key, out var located) + ? new MapSourceKeyResult(true, located) + : new MapSourceKeyResult(false, null); +} diff --git a/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs b/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs index f48e3d69..ae0d268d 100644 --- a/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs +++ b/Migration.Toolkit.Core.KX13/Contexts/PrimaryKeyMappingContext.cs @@ -1,285 +1,287 @@ -namespace Migration.Toolkit.Core.KX13.Contexts; - -using System.Diagnostics; -using System.Linq.Expressions; -using System.Reflection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Core.KX13.Services; - -public class PrimaryKeyMappingContext( - ILogger logger, - IPrimaryKeyLocatorService primaryKeyLocatorService, - ToolkitConfiguration toolkitConfiguration) - : IPrimaryKeyMappingContext -{ - private readonly Dictionary _mappings = new(StringComparer.OrdinalIgnoreCase); - - private int? GetExplicitMappingOrNull(string memberName, int? sourceId) - { - if (sourceId == null) return null; - - var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; - if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) - { - return memberMappings.TryGetValue($"{sourceId}", out var mappedId) ? mappedId : null; - } - - return null; - } - - private static string CreateKey(Expression> keyNameSelector, int sourceId) - { - return $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; - } - - public void SetMapping(Type type, string keyName, int sourceId, int targetId) - { - Debug.Assert(sourceId > 0, "sourceId > 0"); - Debug.Assert(targetId > 0, "targetId > 0"); - - var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) - .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); - - Debug.Assert(foundProp != null, "foundProp != null"); - - var fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; - - _mappings[fullKeyName] = targetId; - logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); - } - - public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) - { - var fullKeyName = CreateKey(keyNameSelector, sourceId); - _mappings[fullKeyName] = targetId; - logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); - } - - public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) - { - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sourceId); - if (sourceId == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out var targetId)) - { - SetMapping(keyNameSelector, sourceId, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, "Target entity is missing"); - } - - public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) - { - targetIdResult = -1; - if (!(sourceId is int sid)) - { - return false; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); - } - - if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - targetIdResult = explicitlyMappedId; - return true; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - targetIdResult = resultId; - return true; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - targetIdResult = targetId; - return true; - } - - return false; - } - - public int? MapFromSource(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - throw new MappingFailureException(fullKeyName, $"Target entity is missing"); - } - - public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) - { - if (sourceId is not { } sid) - { - return null; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return null; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return explicitlyMappedId; - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return resultId; - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return targetId; - } - - return null; - } - - public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return new MapSourceIdResult(true, null); - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); - return new MapSourceIdResult(true, null); - } - - if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) - { - logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); - return new MapSourceIdResult(true, explicitlyMappedId); - } - - if (_mappings.TryGetValue(fullKeyName, out var resultId)) - { - logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); - return new MapSourceIdResult(true, resultId); - } - - logger.LogTrace("TryLocate {Key}", fullKeyName); - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out var targetId)) - { - SetMapping(keyNameSelector, sid, targetId); // cache id - logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); - return new MapSourceIdResult(true, targetId); - } - - return new MapSourceIdResult(false, null); - } - - public void PreloadDependencies(Expression> keyNameSelector) - { - foreach (var (sourceId, targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) - { - SetMapping(keyNameSelector, sourceId, targetId); - } - } - - public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) - { - if (sourceId is not { } sid) - { - return true; - } - - var memberName = keyNameSelector.GetMemberName(); - var fullKeyName = CreateKey(keyNameSelector, sid); - if (sid == 0) - { - return true; - } - - if (GetExplicitMappingOrNull(memberName, sid) is { }) - { - return true; - } - - if (_mappings.TryGetValue(fullKeyName, out _)) - { - return true; - } - - if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) - { - return true; - } - - return false; - } -} \ No newline at end of file +using System.Diagnostics; +using System.Linq.Expressions; +using System.Reflection; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Core.KX13.Services; + +namespace Migration.Toolkit.Core.KX13.Contexts; + +public class PrimaryKeyMappingContext( + ILogger logger, + IPrimaryKeyLocatorService primaryKeyLocatorService, + ToolkitConfiguration toolkitConfiguration) + : IPrimaryKeyMappingContext +{ + private readonly Dictionary mappingsCache = new(StringComparer.OrdinalIgnoreCase); + + public void SetMapping(Type type, string keyName, int sourceId, int targetId) + { + Debug.Assert(sourceId > 0, "sourceId > 0"); + Debug.Assert(targetId > 0, "targetId > 0"); + + var foundProp = type.GetProperties(BindingFlags.Instance | BindingFlags.Public) + .FirstOrDefault(p => p.Name.Equals(keyName, StringComparison.OrdinalIgnoreCase)); + + Debug.Assert(foundProp != null, "foundProp != null"); + + string fullKeyName = $"{type.FullName}.{foundProp.Name}.{sourceId}"; + + mappingsCache[fullKeyName] = targetId; + logger.LogTrace("Primary key for {FullKeyName} stored. {SourceId} maps to {TargetId}", fullKeyName, sourceId, targetId); + } + + public void SetMapping(Expression> keyNameSelector, int sourceId, int targetId) + { + string fullKeyName = CreateKey(keyNameSelector, sourceId); + mappingsCache[fullKeyName] = targetId; + logger.LogTrace("{Key}: {SourceValue}=>{TargetValue}", fullKeyName, sourceId, targetId); + } + + public int RequireMapFromSource(Expression> keyNameSelector, int sourceId) + { + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sourceId); + if (sourceId == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sourceId, out int targetId)) + { + SetMapping(keyNameSelector, sourceId, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, resultId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public bool TryRequireMapFromSource(Expression> keyNameSelector, int? sourceId, out int targetIdResult) + { + targetIdResult = -1; + if (sourceId is not int sid) + { + return false; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + throw new MappingFailureException(fullKeyName, $"Cannot satisfy required mapping {fullKeyName} - source Id cannot be 0."); + } + + if (GetExplicitMappingOrNull(memberName, sourceId) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + targetIdResult = explicitlyMappedId; + return true; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + targetIdResult = resultId; + return true; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + targetIdResult = targetId; + return true; + } + + return false; + } + + public int? MapFromSource(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + throw new MappingFailureException(fullKeyName, "Target entity is missing"); + } + + public int? MapFromSourceOrNull(Expression> keyNameSelector, int? sourceId) + { + if (sourceId is not { } sid) + { + return null; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return null; + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return explicitlyMappedId; + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return resultId; + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return targetId; + } + + return null; + } + + public MapSourceIdResult MapSourceId(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return new MapSourceIdResult(true, null); + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + logger.LogWarning("{Key} Key locator invalid argument, cannot supply 0 as argument", fullKeyName); + return new MapSourceIdResult(true, null); + } + + if (GetExplicitMappingOrNull(memberName, sid) is { } explicitlyMappedId) + { + logger.LogTrace("{Key} resolved as {Value} from explicit mapping", fullKeyName, explicitlyMappedId); + return new MapSourceIdResult(true, explicitlyMappedId); + } + + if (mappingsCache.TryGetValue(fullKeyName, out int resultId)) + { + logger.LogTrace("{Key} resolved as {Value}", fullKeyName, resultId); + return new MapSourceIdResult(true, resultId); + } + + logger.LogTrace("TryLocate {Key}", fullKeyName); + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out int targetId)) + { + SetMapping(keyNameSelector, sid, targetId); // cache id + logger.LogTrace("{Key} located as {Value}", fullKeyName, targetId); + return new MapSourceIdResult(true, targetId); + } + + return new MapSourceIdResult(false, null); + } + + public void PreloadDependencies(Expression> keyNameSelector) + { + foreach ((int sourceId, int targetId) in primaryKeyLocatorService.SelectAll(keyNameSelector)) + { + SetMapping(keyNameSelector, sourceId, targetId); + } + } + + public bool HasMapping(Expression> keyNameSelector, int? sourceId, bool useLocator = true) + { + if (sourceId is not { } sid) + { + return true; + } + + string memberName = keyNameSelector.GetMemberName(); + string fullKeyName = CreateKey(keyNameSelector, sid); + if (sid == 0) + { + return true; + } + + if (GetExplicitMappingOrNull(memberName, sid) is not null) + { + return true; + } + + if (mappingsCache.TryGetValue(fullKeyName, out _)) + { + return true; + } + + if (useLocator && primaryKeyLocatorService.TryLocate(keyNameSelector, sid, out _)) + { + return true; + } + + return false; + } + + private int? GetExplicitMappingOrNull(string memberName, int? sourceId) + { + if (sourceId == null) + { + return null; + } + + var mappings = toolkitConfiguration.EntityConfigurations?.GetEntityConfiguration().ExplicitPrimaryKeyMapping; + if (mappings?.TryGetValue(memberName, out var memberMappings) ?? false) + { + return memberMappings.TryGetValue($"{sourceId}", out int? mappedId) ? mappedId : null; + } + + return null; + } + + private static string CreateKey(Expression> keyNameSelector, int sourceId) => $"{typeof(T).FullName}.{keyNameSelector.GetMemberName()}.{sourceId}"; +} diff --git a/Migration.Toolkit.Core.KX13/Contexts/SourceInstanceContext.cs b/Migration.Toolkit.Core.KX13/Contexts/SourceInstanceContext.cs deleted file mode 100644 index ed104049..00000000 --- a/Migration.Toolkit.Core.KX13/Contexts/SourceInstanceContext.cs +++ /dev/null @@ -1,110 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Contexts; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.KX13.Context; - -public class SourceInstanceContext -{ - private readonly IpcService _ipcService; - private readonly IDbContextFactory _kx13ContextFactory; - private readonly ILogger _logger; - private readonly ToolkitConfiguration _configuration; - - private readonly Dictionary _cachedInfos = new(StringComparer.InvariantCultureIgnoreCase); - - private bool _sourceInfoLoaded; - - public bool HasInfo => _cachedInfos.Count > 0 && _sourceInfoLoaded; - - public SourceInstanceContext(IpcService ipcService, IDbContextFactory kx13ContextFactory, ILogger logger, - ToolkitConfiguration configuration) - { - _ipcService = ipcService; - _kx13ContextFactory = kx13ContextFactory; - _logger = logger; - _configuration = configuration; - } - - public bool IsQuerySourceInstanceEnabled() - { - return _configuration.OptInFeatures?.QuerySourceInstanceApi?.Enabled ?? false; - } - - public async Task RequestSourceInstanceInfo() - { - if (!_sourceInfoLoaded) - { - var result = await _ipcService.GetSourceInstanceDiscoveredInfos(); - foreach (var (key, value) in result) - { - _cachedInfos.Add(key, value); - _logger.LogInformation("Source instance info loaded for site '{SiteName}' successfully", key); - } - - _sourceInfoLoaded = true; - } - - return _sourceInfoLoaded; - } - - public List? GetWidgetPropertyFormComponents(string siteName, string widgetIdentifier) - { - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.WidgetProperties != null && info.WidgetProperties.TryGetValue(widgetIdentifier, out var widgetProperties) - ? widgetProperties - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - - public List? GetPageTemplateFormComponents(string siteName, string pageTemplateIdentifier) - { - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.PageTemplateProperties != null && info.PageTemplateProperties.TryGetValue(pageTemplateIdentifier, out var pageTemplate) - ? pageTemplate - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } - - public List? GetWidgetPropertyFormComponents(int siteId, string widgetIdentifier) - { - var context = _kx13ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - return GetWidgetPropertyFormComponents(siteName, widgetIdentifier); - } - - public List? GetPageTemplateFormComponents(int siteId, string pageTemplateIdentifier) - { - var context = _kx13ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - return GetPageTemplateFormComponents(siteName, pageTemplateIdentifier); - } - - public List? GetSectionFormComponents(int siteId, string sectionIdentifier) - { - var context = _kx13ContextFactory.CreateDbContext(); - var siteName = context.CmsSites.FirstOrDefault(s => s.SiteId == siteId)?.SiteName - ?? throw new InvalidOperationException($"Source site with SiteID '{siteId}' not exists"); - - if (_cachedInfos.TryGetValue(siteName, out var info)) - { - return info.SectionProperties != null && info.SectionProperties.TryGetValue(sectionIdentifier, out var sectionFcs) - ? sectionFcs - : null; - } - - throw new InvalidOperationException($"No info was loaded for site '{siteName}'"); - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs b/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs index 448e071b..a3c2ce82 100644 --- a/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.Core.KX13/DependencyInjectionExtensions.cs @@ -1,107 +1,69 @@ -namespace Migration.Toolkit.Core.KX13; - -using CMS.DataEngine; -using CMS.FormEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using CMS.OnlineForms; -using CMS.Websites; -using Kentico.Xperience.UMT; -using MediatR; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.Core.KX13.Behaviors; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Handlers; -using Migration.Toolkit.Core.KX13.Helpers; -using Migration.Toolkit.Core.KX13.Mappers; -using Migration.Toolkit.Core.KX13.Services; -using Migration.Toolkit.KXP.Models; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKx13ToolkitCore(this IServiceCollection services) - { - var printService = new PrintService(); - services.AddSingleton(printService); - HandbookReference.PrintService = printService; - LogExtensions.PrintService = printService; - - // services.AddTransient(); - // services.AddSingleton(); - - // services.AddSingleton(); - - services.AddTransient(); - // services.AddTransient(); - services.AddTransient(); - // services.AddScoped(); - // services.AddScoped(); - services.AddScoped(); - // services.AddScoped(); - - services.AddMediatR(typeof(DependencyInjectionExtensions)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); - services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); - - services.AddSingleton(s => new TableReflectionService(s.GetRequiredService>())); - services.AddSingleton(); - services.AddTransient(); - - services.AddScoped(); - services.AddSingleton(); - services.AddScoped(); - services.AddSingleton(); - - // commands - services.AddTransient(); - // services.AddTransient(); - // services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - services.AddTransient(); - - // umt mappers - // services.AddTransient, ContentItemMapper>(); - - // mappers - services.AddTransient, CmsAttachmentMapper>(); - // services.AddTransient, CmsClassMapper>(); - services.AddTransient, CmsConsentMapper>(); - services.AddTransient, CmsConsentAgreementMapper>(); - services.AddTransient, CmsConsentArchiveMapper>(); - // services.AddTransient, CmsFormMapper>(); - // services.AddTransient, CmsFormMapperEf>(); - services.AddTransient, ResourceMapper>(); - services.AddTransient, AlternativeFormMapper>(); - services.AddTransient, RoleInfoMapper>(); - services.AddTransient, CmsSettingsCategoryMapper>(); - services.AddTransient, CmsSettingsKeyMapper>(); - services.AddTransient, UserInfoMapper>(); - services.AddTransient, MemberInfoMapper>(); - services.AddTransient, UserRoleInfoMapper>(); - services.AddTransient, MediaLibraryInfoMapper>(); - services.AddTransient, OmContactMapper>(); - services.AddTransient, OmContactGroupMapper>(); - services.AddTransient, OmContactStatusMapper>(); - services.AddTransient, MediaFileInfoMapper>(); - services.AddTransient, CountryInfoMapper>(); - services.AddTransient, StateInfoMapper>(); - // services.AddTransient, PageTemplateConfigurationMapper>(); - - services.AddUniversalMigrationToolkit(); - - return services; - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using Kentico.Xperience.UMT; + +using MediatR; + +using Microsoft.Extensions.DependencyInjection; +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.Core.KX13.Behaviors; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.Core.KX13.Helpers; +using Migration.Toolkit.Core.KX13.Mappers; +using Migration.Toolkit.Core.KX13.Services; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKx13ToolkitCore(this IServiceCollection services) + { + var printService = new PrintService(); + services.AddSingleton(printService); + HandbookReference.PrintService = printService; + LogExtensions.PrintService = printService; + + services.AddTransient(); + services.AddTransient(); + services.AddScoped(); + + services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(DependencyInjectionExtensions).Assembly)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(RequestHandlingBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(CommandConstraintBehavior<,>)); + services.AddTransient(typeof(IPipelineBehavior<,>), typeof(XbKApiContextBehavior<,>)); + + services.AddScoped(); + services.AddSingleton(); + services.AddScoped(); + services.AddSingleton(); + + // mappers + services.AddTransient, CmsAttachmentMapper>(); + services.AddTransient, CmsConsentMapper>(); + services.AddTransient, CmsConsentAgreementMapper>(); + services.AddTransient, CmsConsentArchiveMapper>(); + services.AddTransient, AlternativeFormMapper>(); + services.AddTransient, RoleInfoMapper>(); + services.AddTransient, CmsSettingsCategoryMapper>(); + services.AddTransient, CmsSettingsKeyMapper>(); + services.AddTransient, UserInfoMapper>(); + services.AddTransient, MemberInfoMapper>(); + services.AddTransient, UserRoleInfoMapper>(); + services.AddTransient, OmContactGroupMapper>(); + services.AddTransient, OmContactStatusMapper>(); + services.AddTransient, CountryInfoMapper>(); + services.AddTransient, StateInfoMapper>(); + + services.AddUniversalMigrationToolkit(); + + return services; + } +} diff --git a/Migration.Toolkit.Core.KX13/Exceptions.cs b/Migration.Toolkit.Core.KX13/Exceptions.cs index b58523a0..c726f2e5 100644 --- a/Migration.Toolkit.Core.KX13/Exceptions.cs +++ b/Migration.Toolkit.Core.KX13/Exceptions.cs @@ -1,13 +1,13 @@ -namespace Migration.Toolkit.Core.KX13; - -public class MappingFailureException : InvalidOperationException -{ - public string KeyName { get; } - public string Reason { get; } - - public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") - { - KeyName = keyName; - Reason = reason; - } -} \ No newline at end of file +namespace Migration.Toolkit.Core.KX13; + +public class MappingFailureException : InvalidOperationException +{ + public MappingFailureException(string keyName, string reason) : base($"Key '{keyName}' mapping failed: {reason}") + { + KeyName = keyName; + Reason = reason; + } + + public string KeyName { get; } + public string Reason { get; } +} diff --git a/Migration.Toolkit.Core.KX13/GlobalUsings.cs b/Migration.Toolkit.Core.KX13/GlobalUsings.cs index f177493b..ab26e503 100644 --- a/Migration.Toolkit.Core.KX13/GlobalUsings.cs +++ b/Migration.Toolkit.Core.KX13/GlobalUsings.cs @@ -1,2 +1,3 @@ -global using System; -global using KX13M = Migration.Toolkit.KX13.Models; \ No newline at end of file +global using System; + +global using KX13M = Migration.Toolkit.KX13.Models; diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs index 90244fc3..44834225 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateContactManagementCommandHandler.cs @@ -1,388 +1,387 @@ -namespace Migration.Toolkit.Core.KX13.Handlers; - -using CMS.Activities; -using CMS.ContactManagement; -using CMS.ContentEngine; -using CMS.Websites.Internal; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.BulkCopy; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Helpers; -using Migration.Toolkit.Core.KX13.Services; -using Migration.Toolkit.KX13.Models; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; - -public class MigrateContactManagementCommandHandler : IRequestHandler, IDisposable -{ - private readonly ILogger _logger; - private readonly BulkDataCopyService _bulkDataCopyService; - private readonly ToolkitConfiguration _toolkitConfiguration; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly KeyMappingContext _keyMappingContext; - private readonly CountryMigrator _countryMigrator; - private readonly KxpClassFacade _kxpClassFacade; - private readonly IProtocol _protocol; - private readonly KxpContext _kxpContext; - - public MigrateContactManagementCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - BulkDataCopyService bulkDataCopyService, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - KeyMappingContext keyMappingContext, - CountryMigrator countryMigrator, - KxpClassFacade kxpClassFacade, - IProtocol protocol - ) - { - _logger = logger; - _kxpContext = kxpContextFactory.CreateDbContext(); - _bulkDataCopyService = bulkDataCopyService; - _toolkitConfiguration = toolkitConfiguration; - _primaryKeyMappingContext = primaryKeyMappingContext; - _keyMappingContext = keyMappingContext; - _countryMigrator = countryMigrator; - _kxpClassFacade = kxpClassFacade; - _protocol = protocol; - } - - public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) - { - _countryMigrator.MigrateCountriesAndStates(); - - if (MigrateContacts() is { } ccr) return Task.FromResult(ccr); - if (MigrateContactActivities() is { } acr) return Task.FromResult(acr); - - return Task.FromResult(new GenericCommandResult()); - } - - #region "Migrate contacts" - - private CommandResult? MigrateContacts() - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(OmContact.ContactId), nameof(KXP.Models.OmContact.ContactId) }, - { nameof(OmContact.ContactFirstName), nameof(KXP.Models.OmContact.ContactFirstName) }, - { nameof(OmContact.ContactMiddleName), nameof(KXP.Models.OmContact.ContactMiddleName) }, - { nameof(OmContact.ContactLastName), nameof(KXP.Models.OmContact.ContactLastName) }, - { nameof(OmContact.ContactJobTitle), nameof(KXP.Models.OmContact.ContactJobTitle) }, - { nameof(OmContact.ContactAddress1), nameof(KXP.Models.OmContact.ContactAddress1) }, - { nameof(OmContact.ContactCity), nameof(KXP.Models.OmContact.ContactCity) }, - { nameof(OmContact.ContactZip), nameof(KXP.Models.OmContact.ContactZip) }, - { nameof(OmContact.ContactStateId), nameof(KXP.Models.OmContact.ContactStateId) }, - { nameof(OmContact.ContactCountryId), nameof(KXP.Models.OmContact.ContactCountryId) }, - { nameof(OmContact.ContactMobilePhone), nameof(KXP.Models.OmContact.ContactMobilePhone) }, - { nameof(OmContact.ContactBusinessPhone), nameof(KXP.Models.OmContact.ContactBusinessPhone) }, - { nameof(OmContact.ContactEmail), nameof(KXP.Models.OmContact.ContactEmail) }, - // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, - { nameof(OmContact.ContactGender), nameof(KXP.Models.OmContact.ContactGender) }, - // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint - { nameof(OmContact.ContactNotes), nameof(KXP.Models.OmContact.ContactNotes) }, - { nameof(OmContact.ContactOwnerUserId), nameof(KXP.Models.OmContact.ContactOwnerUserId) }, - // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, - { nameof(OmContact.ContactGuid), nameof(KXP.Models.OmContact.ContactGuid) }, - { nameof(OmContact.ContactLastModified), nameof(KXP.Models.OmContact.ContactLastModified) }, - { nameof(OmContact.ContactCreated), nameof(KXP.Models.OmContact.ContactCreated) }, - // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, - { nameof(OmContact.ContactCampaign), nameof(KXP.Models.OmContact.ContactCampaign) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, - { nameof(OmContact.ContactCompanyName), nameof(KXP.Models.OmContact.ContactCompanyName) }, - // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, - }; - - foreach (var cfi in _kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (_bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) - { - _protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); - _logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - if (_bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) - { - _protocol.Append(HandbookReferences - .BulkCopyColumnMismatch("OM_Contact") - .NeedsManualAction() - .WithData(differences) - ); - _logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); - { - return new CommandFailureResult(); - } - } - - _primaryKeyMappingContext.PreloadDependencies(u => u.UserId); - _primaryKeyMappingContext.PreloadDependencies(u => u.StateId); - _primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); - - var bulkCopyRequest = new BulkCopyRequest("OM_Contact", - s => true,// s => s != "ContactID", - _ => true, - 50000, - requiredColumnsForContactMigration.Keys.ToList(), - ContactValueInterceptor, - current => { _logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)); }, - "ContactID" - ); - - _logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - try - { - _bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - _logger.LogError(ex, "Failed to migrate contacts"); - return new CommandFailureResult(); - } - - return null; - } - - private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) - { - // autofix removed in favor of error report and data consistency - // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); - // return new ValueInterceptorResult(truncatedValue, true, false); - - if (value is string { Length: > 100 } s) - { - _protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") - .WithData(new { value, maxLength = 100, s.Length, columnName, contact = PrintHelper.PrintDictionary(currentRow) }) - ); - return ValueInterceptorResult.SkipRow; - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) - { - switch (_primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - // try search member - if (_keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - sourceUserId, - t => t.MemberId, - t => t.MemberGuid - ) is { Success: true, Mapped: { } memberId }) - { - return ValueInterceptorResult.ReplaceValue(memberId); - } - _protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) - { - switch (_primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - _protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - if (columnName.Equals(nameof(KXP.Models.OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) - { - switch (_primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id); - case { Success: false }: - { - _protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) - .WithData(currentRow)); - return ValueInterceptorResult.SkipRow; - } - } - } - - - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - #region "Migrate contact activities" - - private CommandResult? MigrateContactActivities() //(List migratedSiteIds) - { - var requiredColumnsForContactMigration = new Dictionary - { - { nameof(OmActivity.ActivityId), nameof(KXP.Models.OmActivity.ActivityId) }, - { nameof(OmActivity.ActivityContactId), nameof(KXP.Models.OmActivity.ActivityContactId) }, - { nameof(OmActivity.ActivityCreated), nameof(KXP.Models.OmActivity.ActivityCreated) }, - { nameof(OmActivity.ActivityType), nameof(KXP.Models.OmActivity.ActivityType) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, - { nameof(OmActivity.ActivityValue), nameof(KXP.Models.OmActivity.ActivityValue) }, - { nameof(OmActivity.ActivityUrl), nameof(KXP.Models.OmActivity.ActivityUrl) }, - { nameof(OmActivity.ActivityTitle), nameof(KXP.Models.OmActivity.ActivityTitle) }, - { nameof(OmActivity.ActivitySiteId), nameof(KXP.Models.OmActivity.ActivityChannelId) }, - { nameof(OmActivity.ActivityComment), nameof(KXP.Models.OmActivity.ActivityComment) }, - // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 - { nameof(OmActivity.ActivityUrlreferrer), nameof(KXP.Models.OmActivity.ActivityUrlreferrer) }, - { nameof(OmActivity.ActivityCulture), nameof(KXP.Models.OmActivity.ActivityLanguageId) }, - { nameof(OmActivity.ActivityNodeId), nameof(KXP.Models.OmActivity.ActivityWebPageItemGuid) }, - { nameof(OmActivity.ActivityUtmsource), nameof(KXP.Models.OmActivity.ActivityUtmsource) }, - // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, - // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, - { nameof(OmActivity.ActivityUtmcontent), nameof(KXP.Models.OmActivity.ActivityUtmcontent) }, - }; - - foreach (var cfi in _kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) - { - requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); - } - - if (_bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) - { - _protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); - _logger.LogError("Data must not exist in target instance table, remove data before proceeding"); - return new CommandFailureResult(); - } - - // _primaryKeyMappingContext.PreloadDependencies(u => u.NodeId); - // no need to preload contact, ID should stay same - // _primaryKeyMappingContext.PreloadDependencies(u => u.ContactId); - - var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", - s => true,// s => s != "ActivityID", - reader => true, // migratedSiteIds.Contains(reader.GetInt32(reader.GetOrdinal("ActivitySiteID"))), // TODO tk: 2022-07-07 move condition to source query - 50000, - requiredColumnsForContactMigration, - ActivityValueInterceptor, - current => { _logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)); }, - "ActivityID" - ); - - _logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); - - try - { - _bulkDataCopyService.CopyTableToTable(bulkCopyRequest); - } - catch (Exception ex) - { - _logger.LogError(ex, "Failed to migrate activities"); - return new CommandFailureResult(); - } - return null; - } - - private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) - { - if (columnName.Equals(nameof(KX13M.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && - value is int sourceActivitySiteId) - { - var result = _keyMappingContext.MapSourceKey( - s => s.SiteId, - s => s.SiteGuid, - sourceActivitySiteId.NullIfZero(), - t => t.ChannelId, - t => t.ChannelGuid - ); - switch (result) - { - case (true, var id): - return ValueInterceptorResult.ReplaceValue(id ?? 0); - case { Success: false }: - { - switch (_toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - _logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - _logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); - return ValueInterceptorResult.ReplaceValue(0); - case AutofixEnum.Error: - default: //error - _protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - } - } - - if (columnName.Equals(nameof(KX13M.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) - { - var result = _keyMappingContext.MapSourceKey( - s => s.NodeId, - s => s.NodeGuid, - activityNodeId.NullIfZero(), t => t.WebPageItemGuid, t => t.WebPageItemGuid); - switch (result) - { - case (true, var guid): - return ValueInterceptorResult.ReplaceValue(guid); - case { Success: false }: - { - switch (_toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) - { - case AutofixEnum.DiscardData: - _logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); - return ValueInterceptorResult.SkipRow; - case AutofixEnum.AttemptFix: - _logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); - return ValueInterceptorResult.ReplaceValue(null); - case AutofixEnum.Error: - default: //error - _protocol.Append(HandbookReferences - .MissingRequiredDependency(columnName, value) - .WithData(currentRow) - ); - return ValueInterceptorResult.SkipRow; - } - } - } - } - - if (columnName.Equals(nameof(KX13M.OmActivity.ActivityCulture), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) - { - return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); - } - - return ValueInterceptorResult.DoNothing; - } - - #endregion - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file +using CMS.Activities; +using CMS.ContactManagement; +using CMS.ContentEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.Common.Services.BulkCopy; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.Core.KX13.Helpers; +using Migration.Toolkit.Core.KX13.Services; +using Migration.Toolkit.KXP.Api; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Handlers; + +public class MigrateContactManagementCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + BulkDataCopyService bulkDataCopyService, + ToolkitConfiguration toolkitConfiguration, + PrimaryKeyMappingContext primaryKeyMappingContext, + KeyMappingContext keyMappingContext, + CountryMigrator countryMigrator, + KxpClassFacade kxpClassFacade, + ISpoiledGuidContext spoiledGuidContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private readonly KxpContext kxpContext = kxpContextFactory.CreateDbContext(); + + public void Dispose() => kxpContext.Dispose(); + + public Task Handle(MigrateContactManagementCommand request, CancellationToken cancellationToken) + { + countryMigrator.MigrateCountriesAndStates(); + + if (MigrateContacts() is { } ccr) + { + return Task.FromResult(ccr); + } + + if (MigrateContactActivities() is { } acr) + { + return Task.FromResult(acr); + } + + return Task.FromResult(new GenericCommandResult()); + } + + #region "Migrate contacts" + + private CommandResult? MigrateContacts() + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(KX13M.OmContact.ContactId), nameof(OmContact.ContactId) }, + { nameof(KX13M.OmContact.ContactFirstName), nameof(OmContact.ContactFirstName) }, + { nameof(KX13M.OmContact.ContactMiddleName), nameof(OmContact.ContactMiddleName) }, + { nameof(KX13M.OmContact.ContactLastName), nameof(OmContact.ContactLastName) }, + { nameof(KX13M.OmContact.ContactJobTitle), nameof(OmContact.ContactJobTitle) }, + { nameof(KX13M.OmContact.ContactAddress1), nameof(OmContact.ContactAddress1) }, + { nameof(KX13M.OmContact.ContactCity), nameof(OmContact.ContactCity) }, + { nameof(KX13M.OmContact.ContactZip), nameof(OmContact.ContactZip) }, + { nameof(KX13M.OmContact.ContactStateId), nameof(OmContact.ContactStateId) }, + { nameof(KX13M.OmContact.ContactCountryId), nameof(OmContact.ContactCountryId) }, + { nameof(KX13M.OmContact.ContactMobilePhone), nameof(OmContact.ContactMobilePhone) }, + { nameof(KX13M.OmContact.ContactBusinessPhone), nameof(OmContact.ContactBusinessPhone) }, + { nameof(KX13M.OmContact.ContactEmail), nameof(OmContact.ContactEmail) }, + // No support 2022-07-07 { nameof(OmContact.ContactBirthday), nameof(KXO.Models.OmContact.ContactBirthday) }, + { nameof(KX13M.OmContact.ContactGender), nameof(OmContact.ContactGender) }, + // { nameof(OmContact.ContactStatusId), nameof(KXO.Models.OmContact.ContactStatusId) }, // No support 2022-07-07 but needs to be mapped because of constraint + { nameof(KX13M.OmContact.ContactNotes), nameof(OmContact.ContactNotes) }, + { nameof(KX13M.OmContact.ContactOwnerUserId), nameof(OmContact.ContactOwnerUserId) }, + // No support 2022-07-07 { nameof(OmContact.ContactMonitored), nameof(KXO.Models.OmContact.ContactMonitored) }, + { nameof(KX13M.OmContact.ContactGuid), nameof(OmContact.ContactGuid) }, + { nameof(KX13M.OmContact.ContactLastModified), nameof(OmContact.ContactLastModified) }, + { nameof(KX13M.OmContact.ContactCreated), nameof(OmContact.ContactCreated) }, + // No support 2022-07-07 { nameof(OmContact.ContactBounces), nameof(KXO.Models.OmContact.ContactBounces) }, + { nameof(KX13M.OmContact.ContactCampaign), nameof(OmContact.ContactCampaign) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadId), nameof(KXO.Models.OmContact.ContactSalesForceLeadId) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDisabled), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDisabled) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationDateTime) }, + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationSuspensionDateTime), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationSuspensionDateTime) }, + { nameof(KX13M.OmContact.ContactCompanyName), nameof(OmContact.ContactCompanyName) } + // No support 2022-07-07 { nameof(OmContact.ContactSalesForceLeadReplicationRequired), nameof(KXO.Models.OmContact.ContactSalesForceLeadReplicationRequired) }, + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ContactInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Contact")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Contact")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + if (bulkDataCopyService.CheckForTableColumnsDifferences("OM_Contact", requiredColumnsForContactMigration, out var differences)) + { + protocol.Append(HandbookReferences + .BulkCopyColumnMismatch("OM_Contact") + .NeedsManualAction() + .WithData(differences) + ); + logger.LogError("Table {TableName} columns do not match, fix columns before proceeding", "OM_Contact"); + { + return new CommandFailureResult(); + } + } + + primaryKeyMappingContext.PreloadDependencies(u => u.UserId); + primaryKeyMappingContext.PreloadDependencies(u => u.StateId); + primaryKeyMappingContext.PreloadDependencies(u => u.CountryId); + + var bulkCopyRequest = new BulkCopyRequest("OM_Contact", + s => true, // s => s != "ContactID", + _ => true, + 50000, + requiredColumnsForContactMigration.Keys.ToList(), + ContactValueInterceptor, + current => logger.LogError("Contact skipped due error, contact: {Contact}", PrintHelper.PrintDictionary(current)), + "ContactID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate contacts"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ContactValueInterceptor(int ordinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(OmContact.ContactCompanyName), StringComparison.InvariantCultureIgnoreCase)) + { + // autofix removed in favor of error report and data consistency + // var truncatedValue = SqlDataTypeHelper.TruncateString(value, 100); + // return new ValueInterceptorResult(truncatedValue, true, false); + + if (value is string { Length: > 100 } s) + { + protocol.Append(HandbookReferences.ValueTruncationSkip("OM_Contact") + .WithData(new + { + value, + maxLength = 100, + s.Length, + columnName, + contact = PrintHelper.PrintDictionary(currentRow) + }) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(OmContact.ContactOwnerUserId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceUserId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.UserId, sourceUserId)) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + // try search member + if (keyMappingContext.MapSourceKey( + s => s.UserId, + s => s.UserGuid, + sourceUserId, + t => t.MemberId, + t => t.MemberGuid + ) is { Success: true, Mapped: { } memberId }) + { + return ValueInterceptorResult.ReplaceValue(memberId); + } + + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(OmContact.ContactStateId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceStateId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.StateId, sourceStateId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + if (columnName.Equals(nameof(OmContact.ContactCountryId), StringComparison.InvariantCultureIgnoreCase) && value is int sourceCountryId) + { + switch (primaryKeyMappingContext.MapSourceId(u => u.CountryId, sourceCountryId.NullIfZero())) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id); + case { Success: false }: + { + protocol.Append(HandbookReferences.MissingRequiredDependency(columnName, value) + .WithData(currentRow)); + return ValueInterceptorResult.SkipRow; + } + + default: + break; + } + } + + + return ValueInterceptorResult.DoNothing; + } + + #endregion + + #region "Migrate contact activities" + + private CommandResult? MigrateContactActivities() //(List migratedSiteIds) + { + var requiredColumnsForContactMigration = new Dictionary + { + { nameof(KX13M.OmActivity.ActivityId), nameof(OmActivity.ActivityId) }, + { nameof(KX13M.OmActivity.ActivityContactId), nameof(OmActivity.ActivityContactId) }, + { nameof(KX13M.OmActivity.ActivityCreated), nameof(OmActivity.ActivityCreated) }, + { nameof(KX13M.OmActivity.ActivityType), nameof(OmActivity.ActivityType) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemId), nameof(KXO.Models.OmActivity.ActivityItemId) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityItemDetailId), nameof(KXO.Models.OmActivity.ActivityItemDetailId) }, + { nameof(KX13M.OmActivity.ActivityValue), nameof(OmActivity.ActivityValue) }, + { nameof(KX13M.OmActivity.ActivityUrl), nameof(OmActivity.ActivityUrl) }, + { nameof(KX13M.OmActivity.ActivityTitle), nameof(OmActivity.ActivityTitle) }, + { nameof(KX13M.OmActivity.ActivitySiteId), nameof(OmActivity.ActivityChannelId) }, + { nameof(KX13M.OmActivity.ActivityComment), nameof(OmActivity.ActivityComment) }, + // { nameof(OmActivity.ActivityCampaign), nameof(KXP.Models.OmActivity.ActivityCampaign) }, // deprecated without replacement in v27 + { nameof(KX13M.OmActivity.ActivityUrlreferrer), nameof(OmActivity.ActivityUrlreferrer) }, + { nameof(KX13M.OmActivity.ActivityCulture), nameof(OmActivity.ActivityLanguageId) }, + { nameof(KX13M.OmActivity.ActivityNodeId), nameof(OmActivity.ActivityWebPageItemGuid) }, + { nameof(KX13M.OmActivity.ActivityUtmsource), nameof(OmActivity.ActivityUtmsource) }, + // No support 2022-07-07 { nameof(OmActivity.ActivityAbvariantName), nameof(KXO.Models.OmActivity.ActivityAbvariantName) }, + // OBSOLETE 26.0.0: { nameof(OmActivity.ActivityUrlhash), nameof(KXP.Models.OmActivity.ActivityUrlhash) }, + { nameof(KX13M.OmActivity.ActivityUtmcontent), nameof(OmActivity.ActivityUtmcontent) } + }; + + foreach (var cfi in kxpClassFacade.GetCustomizedFieldInfos(ActivityInfo.TYPEINFO.ObjectClassName)) + { + requiredColumnsForContactMigration.Add(cfi.FieldName, cfi.FieldName); + } + + if (bulkDataCopyService.CheckIfDataExistsInTargetTable("OM_Activity")) + { + protocol.Append(HandbookReferences.DataMustNotExistInTargetInstanceTable("OM_Activity")); + logger.LogError("Data must not exist in target instance table, remove data before proceeding"); + return new CommandFailureResult(); + } + + var bulkCopyRequest = new BulkCopyRequestExtended("OM_Activity", + s => true, // s => s != "ActivityID", + reader => true, // migratedSiteIds.Contains(reader.GetInt32(reader.GetOrdinal("ActivitySiteID"))), // TODO tk: 2022-07-07 move condition to source query + 50000, + requiredColumnsForContactMigration, + ActivityValueInterceptor, + current => logger.LogError("Contact activity skipped due error, activity: {Activity}", PrintHelper.PrintDictionary(current)), + "ActivityID" + ); + + logger.LogTrace("Bulk data copy request: {Request}", bulkCopyRequest); + + try + { + bulkDataCopyService.CopyTableToTable(bulkCopyRequest); + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to migrate activities"); + return new CommandFailureResult(); + } + + return null; + } + + private ValueInterceptorResult ActivityValueInterceptor(int columnOrdinal, string columnName, object value, Dictionary currentRow) + { + if (columnName.Equals(nameof(KX13M.OmActivity.ActivitySiteId), StringComparison.InvariantCultureIgnoreCase) && + value is int sourceActivitySiteId) + { + var result = keyMappingContext.MapSourceKey( + s => s.SiteId, + s => s.SiteGuid, + sourceActivitySiteId.NullIfZero(), + t => t.ChannelId, + t => t.ChannelGuid + ); + switch (result) + { + case (true, var id): + return ValueInterceptorResult.ReplaceValue(id ?? 0); + case { Success: false }: + { + switch (toolkitConfiguration.UseOmActivitySiteRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => discard data", sourceActivitySiteId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivitySiteId={ActivitySiteId} not exists) => ActivityNodeId=0", sourceActivitySiteId); + return ValueInterceptorResult.ReplaceValue(0); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + default: + break; + } + } + + if (columnName.Equals(nameof(KX13M.OmActivity.ActivityNodeId), StringComparison.InvariantCultureIgnoreCase) && value is int activityNodeId) + { + if (currentRow.TryGetValue(nameof(KX13M.OmActivity.ActivitySiteId), out object? mSiteId) && mSiteId is int siteId) + { + if (spoiledGuidContext.GetNodeGuid(siteId, activityNodeId) is { } nodeGuid) + { + return ValueInterceptorResult.ReplaceValue(nodeGuid); + } + } + + switch (toolkitConfiguration.UseOmActivityNodeRelationAutofix ?? AutofixEnum.Error) + { + case AutofixEnum.DiscardData: + logger.LogTrace("Autofix (ActivitySiteId={NodeId} not exists) => discard data", activityNodeId); + return ValueInterceptorResult.SkipRow; + case AutofixEnum.AttemptFix: + logger.LogTrace("Autofix (ActivityNodeId={NodeId} not exists) => ActivityNodeId=0", activityNodeId); + return ValueInterceptorResult.ReplaceValue(null); + case AutofixEnum.Error: + default: //error + protocol.Append(HandbookReferences + .MissingRequiredDependency(columnName, value) + .WithData(currentRow) + ); + return ValueInterceptorResult.SkipRow; + } + } + + if (columnName.Equals(nameof(KX13M.OmActivity.ActivityCulture), StringComparison.InvariantCultureIgnoreCase) && value is string cultureCode) + { + return ValueInterceptorResult.ReplaceValue(ContentLanguageInfoProvider.ProviderObject.Get(cultureCode)?.ContentLanguageID); + } + + return ValueInterceptorResult.DoNothing; + } + + #endregion +} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs index a737f6cb..225b7154 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateDataProtectionCommandHandler.cs @@ -1,284 +1,281 @@ -namespace Migration.Toolkit.Core.KX13.Handlers; - -using CMS.DataProtection; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KX13.Models; -using Migration.Toolkit.KXP.Context; - -public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _kx13ContextFactory; - private readonly IEntityMapper _consentMapper; - private readonly IEntityMapper _consentArchiveMapper; - private readonly IEntityMapper _consentAgreementMapper; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - - private KxpContext _kxpContext; - - private static readonly int _batchSize = 1000; - - public MigrateDataProtectionCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx13ContextFactory, - IEntityMapper consentMapper, - IEntityMapper consentArchiveMapper, - IEntityMapper consentAgreementMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _kx13ContextFactory = kx13ContextFactory; - _consentMapper = consentMapper; - _consentArchiveMapper = consentArchiveMapper; - _consentAgreementMapper = consentAgreementMapper; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - _kxpContext = _kxpContextFactory.CreateDbContext(); - } - - public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) - { - var batchSize = _batchSize; - - await MigrateConsent(cancellationToken); - await MigrateConsentArchive(cancellationToken); - await MigrateConsentAgreement(cancellationToken, batchSize); - - return new GenericCommandResult(); - } - - private async Task MigrateConsent(CancellationToken cancellationToken) - { - await using var kx13Context = await _kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var kx13Consent in kx13Context.CmsConsents) - { - _protocol.FetchedSource(kx13Consent); - _logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", kx13Consent.ConsentName, kx13Consent.ConsentGuid); - - var kxoConsent = await _kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == kx13Consent.ConsentGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsent); - - var mapped = _consentMapper.Map(kx13Consent, kxoConsent); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsent, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); - - if (newInstance) - { - _kxpContext.CmsConsents.Add(cmsConsent); - } - else - { - _kxpContext.CmsConsents.Update(cmsConsent); - } - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - _protocol.Success(kx13Consent, cmsConsent, mapped); - _logger.LogEntitySetAction(newInstance, cmsConsent); - _primaryKeyMappingContext.SetMapping(r => r.ConsentId, kx13Consent.ConsentId, cmsConsent.ConsentId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - _logger.LogEntitySetError(sqlException, newInstance, kx13Consent); - _protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, kx13Consent) - .WithMessage("Failed to migrate consent, target database constraint broken.") - ); - - await _kxpContext.DisposeAsync(); - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentArchive(CancellationToken cancellationToken) - { - await using var kx13Context = await _kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - foreach (var kx13ArchiveConsent in kx13Context.CmsConsentArchives) - { - _protocol.FetchedSource(kx13ArchiveConsent); - _logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", kx13ArchiveConsent.ConsentArchiveGuid); - - var kxoConsentArchive = await _kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == kx13ArchiveConsent.ConsentArchiveGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsentArchive); - - var mapped = _consentArchiveMapper.Map(kx13ArchiveConsent, kxoConsentArchive); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsentArchive, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); - - if (newInstance) - { - _kxpContext.CmsConsentArchives.Add(cmsConsentArchive); - } - else - { - _kxpContext.CmsConsentArchives.Update(cmsConsentArchive); - } - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - _protocol.Success(kx13ArchiveConsent, cmsConsentArchive, mapped); - _logger.LogEntitySetAction(newInstance, cmsConsentArchive); - _primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, - kx13ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - _logger.LogEntitySetError(sqlException, newInstance, kx13ArchiveConsent); - _protocol.Append(HandbookReferences - .DbConstraintBroken(sqlException, kx13ArchiveConsent) - .WithMessage("Failed to migrate consent archive, target database constraint broken.") - ); - - await _kxpContext.DisposeAsync(); - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - } - } - - return new GenericCommandResult(); - } - - private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) - { - await using var kx13Context = await _kx13ContextFactory.CreateDbContextAsync(cancellationToken); - var index = 0; - var indexFull = 0; - var consentAgreementUpdates = new List(); - var consentAgreementNews = new List(); - var itemsCount = kx13Context.CmsConsentAgreements.Count(); - - foreach (var kx13ConsentAgreement in kx13Context.CmsConsentAgreements) - { - _protocol.FetchedSource(kx13ConsentAgreement); - _logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", kx13ConsentAgreement.ConsentAgreementGuid); - - var kxoConsentAgreement = await _kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == kx13ConsentAgreement.ConsentAgreementGuid, cancellationToken); - _protocol.FetchedTarget(kxoConsentAgreement); - - var mapped = _consentAgreementMapper.Map(kx13ConsentAgreement, kxoConsentAgreement); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (cmsConsentAgreement, newInstance) = result; - ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); - - if (newInstance) - { - consentAgreementNews.Add(cmsConsentAgreement); - } - else - { - consentAgreementUpdates.Add(cmsConsentAgreement); - } - } - - index++; - indexFull++; - - if (index == batchSize || indexFull == itemsCount) - { - _kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); - _kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); - - try - { - await _kxpContext.SaveChangesAsync(cancellationToken); - - foreach (var newKx13ConsentAgreement in consentAgreementNews) - { - _protocol.Success(kx13ConsentAgreement, newKx13ConsentAgreement, mapped); - _logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", - newKx13ConsentAgreement.ConsentAgreementGuid); - } - - foreach (var updateKx13ConsentAgreement in consentAgreementUpdates) - { - _protocol.Success(kx13ConsentAgreement, updateKx13ConsentAgreement, mapped); - _logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", - updateKx13ConsentAgreement.ConsentAgreementGuid); - } - } - catch (DbUpdateException dbUpdateException) when ( - dbUpdateException.InnerException is SqlException sqlException && - sqlException.Message.Contains("Cannot insert duplicate key row in object") - ) - { - await _kxpContext.DisposeAsync(); - - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementNews) - ); - _logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); - - - _protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrints(consentAgreementUpdates) - ); - - var cai = ConsentAgreementInfo.New(); - _protocol.Append(HandbookReferences - .ErrorUpdatingTargetInstance(dbUpdateException) - .NeedsManualAction() - .WithIdentityPrint(cai) - ); - - _logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); - - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - } - finally - { - index = 0; - consentAgreementUpdates = new List(); - consentAgreementNews = new List(); - } - } - } - - return new GenericCommandResult(); - } - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file +using CMS.DataProtection; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KX13.Context; +using Migration.Toolkit.KXP.Context; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Handlers; + +public class MigrateDataProtectionCommandHandler : IRequestHandler, IDisposable +{ + private static readonly int batchSize = 1000; + private readonly IEntityMapper consentAgreementMapper; + private readonly IEntityMapper consentArchiveMapper; + private readonly IEntityMapper consentMapper; + private readonly IDbContextFactory kx13ContextFactory; + private readonly IDbContextFactory kxpContextFactory; + private readonly ILogger logger; + private readonly PrimaryKeyMappingContext primaryKeyMappingContext; + private readonly IProtocol protocol; + + private KxpContext kxpContext; + + public MigrateDataProtectionCommandHandler( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx13ContextFactory, + IEntityMapper consentMapper, + IEntityMapper consentArchiveMapper, + IEntityMapper consentAgreementMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) + { + this.logger = logger; + this.kxpContextFactory = kxpContextFactory; + this.kx13ContextFactory = kx13ContextFactory; + this.consentMapper = consentMapper; + this.consentArchiveMapper = consentArchiveMapper; + this.consentAgreementMapper = consentAgreementMapper; + this.primaryKeyMappingContext = primaryKeyMappingContext; + this.protocol = protocol; + kxpContext = this.kxpContextFactory.CreateDbContext(); + } + + public void Dispose() => kxpContext.Dispose(); + + public async Task Handle(MigrateDataProtectionCommand request, CancellationToken cancellationToken) + { + await MigrateConsent(cancellationToken); + await MigrateConsentArchive(cancellationToken); + await MigrateConsentAgreement(cancellationToken, batchSize); + + return new GenericCommandResult(); + } + + private async Task MigrateConsent(CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var kx13Consent in kx13Context.CmsConsents) + { + protocol.FetchedSource(kx13Consent); + logger.LogTrace("Migrating consent {ConsentName} with ConsentGuid {ConsentGuid}", kx13Consent.ConsentName, kx13Consent.ConsentGuid); + + var kxoConsent = await kxpContext.CmsConsents.FirstOrDefaultAsync(consent => consent.ConsentGuid == kx13Consent.ConsentGuid, cancellationToken); + protocol.FetchedTarget(kxoConsent); + + var mapped = consentMapper.Map(kx13Consent, kxoConsent); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsent, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsent, nameof(cmsConsent)); + + if (newInstance) + { + kxpContext.CmsConsents.Add(cmsConsent); + } + else + { + kxpContext.CmsConsents.Update(cmsConsent); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(kx13Consent, cmsConsent, mapped); + logger.LogEntitySetAction(newInstance, cmsConsent); + primaryKeyMappingContext.SetMapping(r => r.ConsentId, kx13Consent.ConsentId, cmsConsent.ConsentId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, kx13Consent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, kx13Consent) + .WithMessage("Failed to migrate consent, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentArchive(CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + foreach (var kx13ArchiveConsent in kx13Context.CmsConsentArchives) + { + protocol.FetchedSource(kx13ArchiveConsent); + logger.LogTrace("Migrating consent archive with ConsentArchiveGuid {ConsentGuid}", kx13ArchiveConsent.ConsentArchiveGuid); + + var kxoConsentArchive = await kxpContext.CmsConsentArchives.FirstOrDefaultAsync(consentArchive => consentArchive.ConsentArchiveGuid == kx13ArchiveConsent.ConsentArchiveGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentArchive); + + var mapped = consentArchiveMapper.Map(kx13ArchiveConsent, kxoConsentArchive); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentArchive, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentArchive, nameof(cmsConsentArchive)); + + if (newInstance) + { + kxpContext.CmsConsentArchives.Add(cmsConsentArchive); + } + else + { + kxpContext.CmsConsentArchives.Update(cmsConsentArchive); + } + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + protocol.Success(kx13ArchiveConsent, cmsConsentArchive, mapped); + logger.LogEntitySetAction(newInstance, cmsConsentArchive); + primaryKeyMappingContext.SetMapping(r => r.ConsentArchiveGuid, + kx13ArchiveConsent.ConsentArchiveId, cmsConsentArchive.ConsentArchiveId); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, kx13ArchiveConsent); + protocol.Append(HandbookReferences + .DbConstraintBroken(sqlException, kx13ArchiveConsent) + .WithMessage("Failed to migrate consent archive, target database constraint broken.") + ); + + await kxpContext.DisposeAsync(); + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + } + } + + return new GenericCommandResult(); + } + + private async Task MigrateConsentAgreement(CancellationToken cancellationToken, int batchSize) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + int index = 0; + int indexFull = 0; + var consentAgreementUpdates = new List(); + var consentAgreementNews = new List(); + int itemsCount = kx13Context.CmsConsentAgreements.Count(); + + foreach (var kx13ConsentAgreement in kx13Context.CmsConsentAgreements) + { + protocol.FetchedSource(kx13ConsentAgreement); + logger.LogTrace("Migrating consent agreement with ConsentAgreementGuid {ConsentAgreementGuid}", kx13ConsentAgreement.ConsentAgreementGuid); + + var kxoConsentAgreement = await kxpContext.CmsConsentAgreements.FirstOrDefaultAsync(consentAgreement => consentAgreement.ConsentAgreementGuid == kx13ConsentAgreement.ConsentAgreementGuid, cancellationToken); + protocol.FetchedTarget(kxoConsentAgreement); + + var mapped = consentAgreementMapper.Map(kx13ConsentAgreement, kxoConsentAgreement); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + (var cmsConsentAgreement, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(cmsConsentAgreement, nameof(cmsConsentAgreement)); + + if (newInstance) + { + consentAgreementNews.Add(cmsConsentAgreement); + } + else + { + consentAgreementUpdates.Add(cmsConsentAgreement); + } + } + + index++; + indexFull++; + + if (index == batchSize || indexFull == itemsCount) + { + kxpContext.CmsConsentAgreements.AddRange(consentAgreementNews); + kxpContext.CmsConsentAgreements.UpdateRange(consentAgreementUpdates); + + try + { + await kxpContext.SaveChangesAsync(cancellationToken); + + foreach (var newKx13ConsentAgreement in consentAgreementNews) + { + protocol.Success(kx13ConsentAgreement, newKx13ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was inserted", + newKx13ConsentAgreement.ConsentAgreementGuid); + } + + foreach (var updateKx13ConsentAgreement in consentAgreementUpdates) + { + protocol.Success(kx13ConsentAgreement, updateKx13ConsentAgreement, mapped); + logger.LogDebug("CmsConsentAgreement: with ConsentAgreementGuid \'{ConsentAgreementGuid}\' was updated", + updateKx13ConsentAgreement.ConsentAgreementGuid); + } + } + catch (DbUpdateException dbUpdateException) when ( + dbUpdateException.InnerException is SqlException sqlException && + sqlException.Message.Contains("Cannot insert duplicate key row in object") + ) + { + await kxpContext.DisposeAsync(); + + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementNews) + ); + logger.LogEntitiesSetError(dbUpdateException, true, consentAgreementNews); + + + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrints(consentAgreementUpdates) + ); + + var cai = ConsentAgreementInfo.New(); + protocol.Append(HandbookReferences + .ErrorUpdatingTargetInstance(dbUpdateException) + .NeedsManualAction() + .WithIdentityPrint(cai) + ); + + logger.LogEntitiesSetError(dbUpdateException, false, consentAgreementUpdates); + + kxpContext = await kxpContextFactory.CreateDbContextAsync(cancellationToken); + } + finally + { + index = 0; + consentAgreementUpdates = []; + consentAgreementNews = []; + } + } + } + + return new GenericCommandResult(); + } +} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateMediaLibrariesCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateMediaLibrariesCommandHandler.cs deleted file mode 100644 index 0886c0e5..00000000 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateMediaLibrariesCommandHandler.cs +++ /dev/null @@ -1,247 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Handlers; - -using CMS.Base; -using CMS.MediaLibrary; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Mappers; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KX13.Models; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Context; - -public class MigrateMediaLibrariesCommandHandler : IRequestHandler, IDisposable -{ - private const string DIR_MEDIA = "media"; - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _kx13ContextFactory; - private readonly IEntityMapper _mediaLibraryInfoMapper; - private readonly KxpMediaFileFacade _mediaFileFacade; - private readonly IEntityMapper _mediaFileInfoMapper; - private readonly ToolkitConfiguration _toolkitConfiguration; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - - private KxpContext _kxpContext; - - public MigrateMediaLibrariesCommandHandler( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx13ContextFactory, - IEntityMapper mediaLibraryInfoMapper, - KxpMediaFileFacade mediaFileFacade, - IEntityMapper mediaFileInfoMapper, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _kx13ContextFactory = kx13ContextFactory; - _mediaLibraryInfoMapper = mediaLibraryInfoMapper; - _mediaFileFacade = mediaFileFacade; - _mediaFileInfoMapper = mediaFileInfoMapper; - _toolkitConfiguration = toolkitConfiguration; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - _kxpContext = kxpContextFactory.CreateDbContext(); - } - - public async Task Handle(MigrateMediaLibrariesCommand request, CancellationToken cancellationToken) - { - await using var kx13Context = await _kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - var kx13MediaLibraries = kx13Context.MediaLibraries - .Include(ml => ml.LibrarySite) - .OrderBy(t => t.LibraryId) - ; - - var migratedMediaLibraries = new List<(MediaLibrary sourceLibrary, MediaLibraryInfo targetLibrary)>(); - foreach (var kx13MediaLibrary in kx13MediaLibraries) - { - _protocol.FetchedSource(kx13MediaLibrary); - - if (kx13MediaLibrary.LibraryGuid is not { } mediaLibraryGuid) - { - _protocol.Append(HandbookReferences - .InvalidSourceData() - .WithId(nameof(MediaLibrary.LibraryId), kx13MediaLibrary.LibraryId) - .WithMessage("Media library has missing MediaLibraryGUID") - ); - continue; - } - - var mediaLibraryInfo = _mediaFileFacade.GetMediaLibraryInfo(mediaLibraryGuid); - - _protocol.FetchedTarget(mediaLibraryInfo); - - var mapped = _mediaLibraryInfoMapper.Map(kx13MediaLibrary, mediaLibraryInfo); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (mfi, newInstance) = result; - ArgumentNullException.ThrowIfNull(mfi, nameof(mfi)); - - try - { - _mediaFileFacade.SetMediaLibrary(mfi); - - _protocol.Success(kx13MediaLibrary, mfi, mapped); - _logger.LogEntitySetAction(newInstance, mfi); - } - catch (Exception ex) - { - await _kxpContext.DisposeAsync(); // reset context errors - _kxpContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(mfi) - ); - _logger.LogEntitySetError(ex, newInstance, mfi); - continue; - } - - _primaryKeyMappingContext.SetMapping( - r => r.LibraryId, - kx13MediaLibrary.LibraryId, - mfi.LibraryID - ); - - migratedMediaLibraries.Add((kx13MediaLibrary, mfi)); - } - } - - await RequireMigratedMediaFiles(migratedMediaLibraries, kx13Context, cancellationToken); - - return new GenericCommandResult(); - } - - private record LoadMediaFileResult(bool Found, IUploadedFile? File); - private LoadMediaFileResult LoadMediaFileBinary(string? sourceMediaLibraryPath, string relativeFilePath, string contentType) - { - if (sourceMediaLibraryPath == null) - { - return new LoadMediaFileResult(false, null); - } - - var filePath = Path.Combine(sourceMediaLibraryPath, relativeFilePath); - if (File.Exists(filePath)) - { - var data = File.ReadAllBytes(filePath); - var dummyFile = DummyUploadedFile.FromByteArray(data, contentType, data.LongLength, Path.GetFileName(filePath)); - return new LoadMediaFileResult(true, dummyFile); - } - - return new LoadMediaFileResult(false, null); - } - - private async Task RequireMigratedMediaFiles( - List<(MediaLibrary sourceLibrary, MediaLibraryInfo targetLibrary)> migratedMediaLibraries, - KX13Context kx13Context, CancellationToken cancellationToken) - { - var kxoDbContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - try - { - foreach (var (sourceMediaLibrary, targetMediaLibrary) in migratedMediaLibraries) - { - string? sourceMediaLibraryPath = null; - var loadMediaFileData = false; - if (!_toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(true) && - !string.IsNullOrWhiteSpace(_toolkitConfiguration.KxCmsDirPath)) - { - sourceMediaLibraryPath = Path.Combine(_toolkitConfiguration.KxCmsDirPath, sourceMediaLibrary.LibrarySite.SiteName, DIR_MEDIA, sourceMediaLibrary.LibraryFolder); - loadMediaFileData = true; - } - - var kx13MediaFiles = kx13Context.MediaFiles - .Where(x => x.FileLibraryId == sourceMediaLibrary.LibraryId); - - foreach (var kx13MediaFile in kx13MediaFiles) - { - _protocol.FetchedSource(kx13MediaFile); - - bool found = false; - IUploadedFile? uploadedFile = null; - if (loadMediaFileData) - { - (found, uploadedFile) = LoadMediaFileBinary(sourceMediaLibraryPath, kx13MediaFile.FilePath, kx13MediaFile.FileMimeType); - if (!found) - { - // TODO tk: 2022-07-07 report missing file (currently reported in mapper) - } - } - - var librarySubfolder = Path.GetDirectoryName(kx13MediaFile.FilePath); - - var kxoMediaFile = _mediaFileFacade.GetMediaFile(kx13MediaFile.FileGuid); - - _protocol.FetchedTarget(kxoMediaFile); - - var source = new MediaFileInfoMapperSource(kx13MediaFile, targetMediaLibrary.LibraryID, found ? uploadedFile : null, - librarySubfolder, _toolkitConfiguration.MigrateOnlyMediaFileInfo.GetValueOrDefault(false)); - var mapped = _mediaFileInfoMapper.Map(source, kxoMediaFile); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - var (mf, newInstance) = result; - ArgumentNullException.ThrowIfNull(mf, nameof(mf)); - - try - { - if (newInstance) - { - _mediaFileFacade.EnsureMediaFilePathExistsInLibrary(mf, targetMediaLibrary.LibraryID); - } - - _mediaFileFacade.SetMediaFile(mf, newInstance); - await _kxpContext.SaveChangesAsync(cancellationToken); - - _protocol.Success(kx13MediaFile, mf, mapped); - _logger.LogEntitySetAction(newInstance, mf); - } - catch (Exception ex) // TODO tk: 2022-05-18 handle exceptions - { - await kxoDbContext.DisposeAsync(); // reset context errors - kxoDbContext = await _kxpContextFactory.CreateDbContextAsync(cancellationToken); - - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(mf) - ); - _logger.LogEntitySetError(ex, newInstance, mf); - continue; - } - - _primaryKeyMappingContext.SetMapping( - r => r.FileId, - kx13MediaFile.FileId, - mf.FileID - ); - } - } - } - } - finally - { - await kxoDbContext.DisposeAsync(); - } - } - - public void Dispose() - { - _kxpContext.Dispose(); - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs index ba03479f..8dbf7b11 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateMembersCommandHandler.cs @@ -1,111 +1,112 @@ -namespace Migration.Toolkit.Core.KX13.Handlers; - -using System.Diagnostics; -using CMS.Membership; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Mappers; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Api.Enums; - -public class MigrateMembersCommandHandler( - ILogger logger, - IDbContextFactory kx13ContextFactory, - IEntityMapper memberInfoMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) - : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - private static int[] MigratedAdminUserPrivilegeLevels => [(int)UserPrivilegeLevelEnum.None]; - - public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) - { - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - var kx13CmsUsers = kx13Context.CmsUsers - .Include(u => u.CmsUserSettingUserSettingsUserNavigation) - .Where(u => MigratedAdminUserPrivilegeLevels.Contains(u.UserPrivilegeLevel)) - ; - - foreach (var kx13User in kx13CmsUsers) - { - protocol.FetchedSource(kx13User); - logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", kx13User.UserName, kx13User.UserGuid); - - var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(kx13User.UserGuid); - - protocol.FetchedTarget(xbkMemberInfo); - - // no member shall be admin, editor - Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin"); - Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin"); - Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor"); - - if (xbkMemberInfo?.MemberName == USER_PUBLIC || kx13User.UserName == USER_PUBLIC) - { - continue; - } - - var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(kx13User, kx13User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); - protocol.MappedTarget(mapped); - - SaveUserUsingKenticoApi(mapped, kx13User); - } - - return new GenericCommandResult(); - } - - private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX13M.CmsUser kx13User) - { - if (mapped is { Success: true } result) - { - var (memberInfo, newInstance) = result; - ArgumentNullException.ThrowIfNull(memberInfo); - - try - { - MemberInfoProvider.ProviderObject.Set(memberInfo); - - protocol.Success(kx13User, memberInfo, mapped); - logger.LogEntitySetAction(newInstance, memberInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - logger.LogEntitySetError(sqlException, newInstance, memberInfo); - protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, kx13User) - .WithData(new { kx13User.UserName, kx13User.UserGuid, kx13User.UserId, }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return; - } - catch (Exception ex) - { - logger.LogEntitySetError(ex, newInstance, memberInfo); - protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(memberInfo) - ); - return; - } - - // left for OM_Activity - primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, memberInfo.MemberID); - return; - } - } - - public void Dispose() - { - - } -} \ No newline at end of file +using System.Diagnostics; + +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.Core.KX13.Mappers; +using Migration.Toolkit.KX13.Context; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Api.Enums; + +namespace Migration.Toolkit.Core.KX13.Handlers; + +public class MigrateMembersCommandHandler( + ILogger logger, + IDbContextFactory kx13ContextFactory, + IEntityMapper memberInfoMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateMembersCommand request, CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + var kx13CmsUsers = kx13Context.CmsUsers + .Include(u => u.CmsUserSettingUserSettingsUserNavigation) + .Where(u => UserHelper.PrivilegeLevelsMigratedAsMemberUser.Contains(u.UserPrivilegeLevel)) + ; + + foreach (var kx13User in kx13CmsUsers) + { + protocol.FetchedSource(kx13User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid} to member", kx13User.UserName, kx13User.UserGuid); + + var xbkMemberInfo = MemberInfoProvider.ProviderObject.Get(kx13User.UserGuid); + + protocol.FetchedTarget(xbkMemberInfo); + + // no member shall be admin, editor + Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.GlobalAdmin"); + Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Admin"); + Debug.Assert(kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor, "kx13User.UserPrivilegeLevel != (int)UserPrivilegeLevelEnum.Editor"); + + if (xbkMemberInfo?.MemberName == USER_PUBLIC || kx13User.UserName == USER_PUBLIC) + { + continue; + } + + var mapped = memberInfoMapper.Map(new MemberInfoMapperSource(kx13User, kx13User.CmsUserSettingUserSettingsUserNavigation), xbkMemberInfo); + protocol.MappedTarget(mapped); + + SaveUserUsingKenticoApi(mapped, kx13User); + } + + return new GenericCommandResult(); + } + + private void SaveUserUsingKenticoApi(IModelMappingResult mapped, KX13M.CmsUser kx13User) + { + if (mapped is { Success: true } result) + { + (var memberInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(memberInfo); + + try + { + MemberInfoProvider.ProviderObject.Set(memberInfo); + + protocol.Success(kx13User, memberInfo, mapped); + logger.LogEntitySetAction(newInstance, memberInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, memberInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, kx13User) + .WithData(new { kx13User.UserName, kx13User.UserGuid, kx13User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, memberInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(memberInfo) + ); + return; + } + + // left for OM_Activity + primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, memberInfo.MemberID); + } + } +} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs index f40f424b..ecb616b3 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateSettingKeysCommandHandler.cs @@ -1,105 +1,84 @@ -namespace Migration.Toolkit.Core.KX13.Handlers; - -using CMS.DataEngine; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KX13.Models; - -public class MigrateSettingKeysCommandHandler : IRequestHandler -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kx13ContextFactory; - private readonly ToolkitConfiguration _toolkitConfiguration; - private readonly IProtocol _protocol; - private readonly IEntityMapper _mapper; - - public MigrateSettingKeysCommandHandler( - ILogger logger, - IEntityMapper mapper, - IDbContextFactory kx13ContextFactory, - ToolkitConfiguration toolkitConfiguration, - IProtocol protocol - ) - { - _logger = logger; - _mapper = mapper; - _kx13ContextFactory = kx13ContextFactory; - _toolkitConfiguration = toolkitConfiguration; - _protocol = protocol; - } - - public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) - { - var entityConfiguration = _toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); - - await using var kx13Context = await _kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - _logger.LogInformation("CmsSettingsKey synchronization starting"); - var cmsSettingsKeys = kx13Context.CmsSettingsKeys - .Where(csk => csk.SiteId == null) - .AsNoTrackingWithIdentityResolution() - ; - - foreach (var kx13CmsSettingsKey in cmsSettingsKeys) - { - _protocol.FetchedSource(kx13CmsSettingsKey); - - var kxoGlobalSettingsKey = GetKxoSettingsKey(kx13CmsSettingsKey); - - var canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; - var kxoCmsSettingsKey = kx13CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(kx13CmsSettingsKey); - - if (!canBeMigrated) - { - _logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", kx13CmsSettingsKey.KeyName); - _protocol.Append( - HandbookReferences - .NotCurrentlySupportedSkip() - .WithId(nameof(kx13CmsSettingsKey.KeyId), kx13CmsSettingsKey.KeyId) - .WithMessage("Settings key is not supported in target instance") - .WithData(new - { - kx13CmsSettingsKey.KeyName, - kx13CmsSettingsKey.SiteId, - kx13CmsSettingsKey.KeyGuid - }) - ); - continue; - } - - _protocol.FetchedTarget(kxoCmsSettingsKey); - - if (entityConfiguration.ExcludeCodeNames.Contains(kx13CmsSettingsKey.KeyName)) - { - _protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, kx13CmsSettingsKey); - _logger.LogWarning("KeyName {KeyName} is excluded => skipping", kx13CmsSettingsKey.KeyName); - continue; - } - - var mapped = _mapper.Map(kx13CmsSettingsKey, kxoCmsSettingsKey); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true } result) - { - ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); - - SettingsKeyInfoProvider.ProviderObject.Set(result.Item); - - _protocol.Success(kx13CmsSettingsKey, kxoCmsSettingsKey, mapped); - _logger.LogEntitySetAction(result.NewInstance, result.Item); - } - } - - return new GenericCommandResult(); - } - - private SettingsKeyInfo? GetKxoSettingsKey(CmsSettingsKey kx13CmsSettingsKey) - { - return SettingsKeyInfoProvider.ProviderObject.Get(kx13CmsSettingsKey.KeyName); - } -} \ No newline at end of file +using CMS.DataEngine; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.KX13.Context; + +namespace Migration.Toolkit.Core.KX13.Handlers; + +public class MigrateSettingKeysCommandHandler( + ILogger logger, + IEntityMapper mapper, + IDbContextFactory kx13ContextFactory, + ToolkitConfiguration toolkitConfiguration, + IProtocol protocol) + : IRequestHandler +{ + public async Task Handle(MigrateSettingKeysCommand request, CancellationToken cancellationToken) + { + var entityConfiguration = toolkitConfiguration.EntityConfigurations.GetEntityConfiguration(); + + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + logger.LogInformation("CmsSettingsKey synchronization starting"); + var cmsSettingsKeys = kx13Context.CmsSettingsKeys + .Where(csk => csk.SiteId == null) + .AsNoTrackingWithIdentityResolution() + ; + + foreach (var kx13CmsSettingsKey in cmsSettingsKeys) + { + protocol.FetchedSource(kx13CmsSettingsKey); + + var kxoGlobalSettingsKey = GetKxoSettingsKey(kx13CmsSettingsKey); + + bool canBeMigrated = !kxoGlobalSettingsKey?.KeyIsHidden ?? false; + var kxoCmsSettingsKey = kx13CmsSettingsKey.SiteId is null ? kxoGlobalSettingsKey : GetKxoSettingsKey(kx13CmsSettingsKey); + + if (!canBeMigrated) + { + logger.LogInformation("Setting with key '{KeyName}' is currently not supported for migration", kx13CmsSettingsKey.KeyName); + protocol.Append( + HandbookReferences + .NotCurrentlySupportedSkip() + .WithId(nameof(kx13CmsSettingsKey.KeyId), kx13CmsSettingsKey.KeyId) + .WithMessage("Settings key is not supported in target instance") + .WithData(new { kx13CmsSettingsKey.KeyName, kx13CmsSettingsKey.SiteId, kx13CmsSettingsKey.KeyGuid }) + ); + continue; + } + + protocol.FetchedTarget(kxoCmsSettingsKey); + + if (entityConfiguration.ExcludeCodeNames.Contains(kx13CmsSettingsKey.KeyName)) + { + protocol.Warning(HandbookReferences.CmsSettingsKeyExclusionListSkip, kx13CmsSettingsKey); + logger.LogWarning("KeyName {KeyName} is excluded => skipping", kx13CmsSettingsKey.KeyName); + continue; + } + + var mapped = mapper.Map(kx13CmsSettingsKey, kxoCmsSettingsKey); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true } result) + { + ArgumentNullException.ThrowIfNull(result.Item, nameof(result.Item)); + + SettingsKeyInfoProvider.ProviderObject.Set(result.Item); + + protocol.Success(kx13CmsSettingsKey, kxoCmsSettingsKey, mapped); + logger.LogEntitySetAction(result.NewInstance, result.Item); + } + } + + return new GenericCommandResult(); + } + + private SettingsKeyInfo? GetKxoSettingsKey(KX13M.CmsSettingsKey kx13CmsSettingsKey) => SettingsKeyInfoProvider.ProviderObject.Get(kx13CmsSettingsKey.KeyName); +} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs index b0a72c2b..6e3c0b25 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateSitesCommandHandler.cs @@ -1,191 +1,191 @@ -namespace Migration.Toolkit.Core.KX13.Handlers; - -using CMS.ContentEngine; -using CMS.DataEngine; -using CMS.Websites; -using Kentico.Xperience.UMT.Model; -using Kentico.Xperience.UMT.Services; -using MediatR; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Helpers; -using Migration.Toolkit.KX13; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KX13.Models; - -// ReSharper disable once UnusedType.Global -public class MigrateSitesCommandHandler( - ILogger logger, - IDbContextFactory kx13ContextFactory, - IProtocol protocol, - IImporter importer) - : IRequestHandler -{ - public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) - { - await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); - foreach (var kx13CmsSite in kx13Context.CmsSites.Include(s => s.Cultures)) - { - protocol.FetchedSource(kx13CmsSite); - logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", kx13CmsSite.SiteName, kx13CmsSite.SiteGuid); - - var defaultCultureCode = GetSiteCulture(kx13CmsSite); - var migratedSiteCultures = kx13CmsSite.Cultures.ToList(); - if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) - { - await using var ctx = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); - if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) - { - migratedSiteCultures.Add(defaultCulture); - } - } - - foreach (var cmsCulture in migratedSiteCultures) - { - var existing = ContentLanguageInfoProvider.ProviderObject.Get() - .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) - .FirstOrDefault(); - - if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) - { - existing.ContentLanguageGUID = cmsCulture.CultureGuid; - existing.Update(); - } - - if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) continue; - - var langResult = await importer.ImportAsync(new ContentLanguageModel - { - ContentLanguageGUID = cmsCulture.CultureGuid, - ContentLanguageDisplayName = cmsCulture.CultureName, - ContentLanguageName = cmsCulture.CultureCode, - ContentLanguageIsDefault = true, - ContentLanguageFallbackContentLanguageGuid = null, - ContentLanguageCultureFormat = cmsCulture.CultureCode - }); - - if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) - { - migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); - logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); - } - } - - - var homePagePath = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, SettingsKeys.CMSHomePagePath); - var cookieLevel = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch - { - "all" => CookieLevelConstants.ALL, - "visitor" => CookieLevelConstants.VISITOR, - "editor" => CookieLevelConstants.EDITOR, - "system" => CookieLevelConstants.SYSTEM, - "essential" => CookieLevelConstants.ESSENTIAL, - _ => (int?)null - }; - var storeFormerUrls = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSStoreFormerUrls") is string storeFormerUrlsStr - ? bool.TryParse(storeFormerUrlsStr, out var sfu) ? (bool?)sfu : null - : null; - - var channelResult = await importer.ImportAsync(new ChannelModel - { - ChannelDisplayName = kx13CmsSite.SiteDisplayName, - ChannelName = kx13CmsSite.SiteName, - ChannelGUID = kx13CmsSite.SiteGuid, - ChannelType = ChannelType.Website - }); - - var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel - { - WebsiteChannelGUID = kx13CmsSite.SiteGuid, - WebsiteChannelChannelGuid = kx13CmsSite.SiteGuid, - WebsiteChannelDomain = kx13CmsSite.SiteDomainName, - WebsiteChannelHomePage = homePagePath, - WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, - WebsiteChannelDefaultCookieLevel = cookieLevel, - WebsiteChannelStoreFormerUrls = storeFormerUrls - }); - - if (!webSiteChannelResult.Success) - { - if (webSiteChannelResult.ModelValidationResults != null) - { - foreach (var mvr in webSiteChannelResult.ModelValidationResults) - { - logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); - } - } - else - { - logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); - } - return new CommandFailureResult(); - } - - if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) - { - var cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaPublicKey") as string; - var cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaPrivateKey") as string; - - WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; - var cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaV3PrivateKey") as string; - var cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSRecaptchaV3PublicKey") as string; - var cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSRecaptchaV3Threshold"); - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) - { - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, - WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3, - }; - } - - if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) - { - if (reCaptchaSettings is not null) - { - logger.LogError(""" - Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. - Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' - or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. - """); - throw new InvalidOperationException("Invalid ReCaptcha settings"); - } - - reCaptchaSettings = new WebsiteCaptchaSettingsInfo - { - WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, - WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, - WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, - WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2, - }; - } - - if (reCaptchaSettings != null) - { - WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); - } - } - } - - return new GenericCommandResult(); - } - - private string GetSiteCulture(CmsSite site) - { - // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() - // domain alias skipped, HttpContext logic skipped - var siteCulture = site.SiteDefaultVisitorCulture - ?? KenticoHelper.GetSettingsKey(kx13ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); - - return siteCulture - ?? throw new InvalidOperationException("Unknown site culture"); - } -} \ No newline at end of file +using CMS.ContentEngine; +using CMS.Websites; + +using Kentico.Xperience.UMT.Model; +using Kentico.Xperience.UMT.Services; + +using MediatR; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Helpers; +using Migration.Toolkit.KX13; +using Migration.Toolkit.KX13.Context; + +namespace Migration.Toolkit.Core.KX13.Handlers; + +// ReSharper disable once UnusedType.Global +public class MigrateSitesCommandHandler( + ILogger logger, + IDbContextFactory kx13ContextFactory, + IProtocol protocol, + IImporter importer) + : IRequestHandler +{ + public async Task Handle(MigrateSitesCommand request, CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + var migratedCultureCodes = new Dictionary(StringComparer.CurrentCultureIgnoreCase); + foreach (var kx13CmsSite in kx13Context.CmsSites.Include(s => s.Cultures)) + { + protocol.FetchedSource(kx13CmsSite); + logger.LogTrace("Migrating site {SiteName} with SiteGuid {SiteGuid}", kx13CmsSite.SiteName, kx13CmsSite.SiteGuid); + + string defaultCultureCode = GetSiteCulture(kx13CmsSite); + var migratedSiteCultures = kx13CmsSite.Cultures.ToList(); + if (!migratedSiteCultures.Any(x => x.CultureCode.Equals(defaultCultureCode, StringComparison.InvariantCultureIgnoreCase))) + { + await using var ctx = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + if (ctx.CmsCultures.FirstOrDefault(c => c.CultureCode == defaultCultureCode) is { } defaultCulture) + { + migratedSiteCultures.Add(defaultCulture); + } + } + + foreach (var cmsCulture in migratedSiteCultures) + { + var existing = ContentLanguageInfoProvider.ProviderObject.Get() + .WhereEquals(nameof(ContentLanguageInfo.ContentLanguageCultureFormat), cmsCulture.CultureCode) + .FirstOrDefault(); + + if (existing != null && existing.ContentLanguageGUID != cmsCulture.CultureGuid) + { + existing.ContentLanguageGUID = cmsCulture.CultureGuid; + existing.Update(); + } + + if (migratedCultureCodes.ContainsKey(cmsCulture.CultureCode)) + { + continue; + } + + var langResult = await importer.ImportAsync(new ContentLanguageModel + { + ContentLanguageGUID = cmsCulture.CultureGuid, + ContentLanguageDisplayName = cmsCulture.CultureName, + ContentLanguageName = cmsCulture.CultureCode, + ContentLanguageIsDefault = true, + ContentLanguageFallbackContentLanguageGuid = null, + ContentLanguageCultureFormat = cmsCulture.CultureCode + }); + + if (langResult is { Success: true, Imported: ContentLanguageInfo importedLanguage }) + { + migratedCultureCodes.TryAdd(cmsCulture.CultureCode, importedLanguage); + logger.LogTrace("Imported language {Language} from {Culture}", importedLanguage.ContentLanguageName, cmsCulture.CultureCode); + } + } + + + string? homePagePath = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, SettingsKeys.CMSHomePagePath); + int? cookieLevel = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, SettingsKeys.CMSDefaultCookieLevel) switch + { + "all" => CookieLevelConstants.ALL, + "visitor" => CookieLevelConstants.VISITOR, + "editor" => CookieLevelConstants.EDITOR, + "system" => CookieLevelConstants.SYSTEM, + "essential" => CookieLevelConstants.ESSENTIAL, + _ => null + }; + bool? storeFormerUrls = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSStoreFormerUrls") is string storeFormerUrlsStr + ? bool.TryParse(storeFormerUrlsStr, out bool sfu) ? sfu : null + : null; + + var channelResult = await importer.ImportAsync(new ChannelModel { ChannelDisplayName = kx13CmsSite.SiteDisplayName, ChannelName = kx13CmsSite.SiteName, ChannelGUID = kx13CmsSite.SiteGuid, ChannelType = ChannelType.Website }); + + var webSiteChannelResult = await importer.ImportAsync(new WebsiteChannelModel + { + WebsiteChannelGUID = kx13CmsSite.SiteGuid, + WebsiteChannelChannelGuid = kx13CmsSite.SiteGuid, + WebsiteChannelDomain = kx13CmsSite.SiteDomainName, + WebsiteChannelHomePage = homePagePath, + WebsiteChannelPrimaryContentLanguageGuid = migratedCultureCodes[defaultCultureCode].ContentLanguageGUID, + WebsiteChannelDefaultCookieLevel = cookieLevel, + WebsiteChannelStoreFormerUrls = storeFormerUrls + }); + + if (!webSiteChannelResult.Success) + { + if (webSiteChannelResult.ModelValidationResults != null) + { + foreach (var mvr in webSiteChannelResult.ModelValidationResults) + { + logger.LogError("Invalid channel properties {Members}: {ErrorMessage}", string.Join(", ", mvr.MemberNames), mvr.ErrorMessage); + } + } + else + { + logger.LogError(webSiteChannelResult.Exception, "Failed to migrate site"); + } + + return new CommandFailureResult(); + } + + if (webSiteChannelResult.Imported is WebsiteChannelInfo webSiteChannel) + { + string? cmsReCaptchaPublicKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaPublicKey"); + string? cmsReCaptchaPrivateKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaPrivateKey"); + + WebsiteCaptchaSettingsInfo? reCaptchaSettings = null; + string? cmsReCaptchaV3PrivateKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSReCaptchaV3PrivateKey"); + string? cmsRecaptchaV3PublicKey = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSRecaptchaV3PublicKey"); + double? cmsRecaptchaV3Threshold = KenticoHelper.GetSettingsKey(kx13ContextFactory, kx13CmsSite.SiteId, "CMSRecaptchaV3Threshold"); + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaV3PrivateKey) || !string.IsNullOrWhiteSpace(cmsRecaptchaV3PublicKey)) + { + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsRecaptchaV3PublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaV3PrivateKey, + WebsiteCaptchaSettingsReCaptchaThreshold = cmsRecaptchaV3Threshold ?? 0.5d, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV3 + }; + } + + if (!string.IsNullOrWhiteSpace(cmsReCaptchaPublicKey) || !string.IsNullOrWhiteSpace(cmsReCaptchaPrivateKey)) + { + if (reCaptchaSettings is not null) + { + logger.LogError(""" + Conflicting settings found, ReCaptchaV2 and ReCaptchaV3 is set simultaneously. + Remove setting keys 'CMSReCaptchaPublicKey', 'CMSReCaptchaPrivateKey' + or remove setting keys 'CMSReCaptchaV3PrivateKey', 'CMSRecaptchaV3PublicKey', 'CMSRecaptchaV3Threshold'. + """); + throw new InvalidOperationException("Invalid ReCaptcha settings"); + } + + reCaptchaSettings = new WebsiteCaptchaSettingsInfo + { + WebsiteCaptchaSettingsWebsiteChannelID = webSiteChannel.WebsiteChannelID, + WebsiteCaptchaSettingsReCaptchaSiteKey = cmsReCaptchaPublicKey, + WebsiteCaptchaSettingsReCaptchaSecretKey = cmsReCaptchaPrivateKey, + WebsiteCaptchaSettingsReCaptchaVersion = ReCaptchaVersion.ReCaptchaV2 + }; + } + + if (reCaptchaSettings != null) + { + WebsiteCaptchaSettingsInfo.Provider.Set(reCaptchaSettings); + } + } + } + + return new GenericCommandResult(); + } + + private string GetSiteCulture(KX13M.CmsSite site) + { + // simplified logic from CMS.DocumentEngine.DefaultPreferredCultureEvaluator.Evaluate() + // domain alias skipped, HttpContext logic skipped + string? siteCulture = site.SiteDefaultVisitorCulture + ?? KenticoHelper.GetSettingsKey(kx13ContextFactory, site.SiteId, SettingsKeys.CMSDefaultCultureCode); + + return siteCulture + ?? throw new InvalidOperationException("Unknown site culture"); + } +} diff --git a/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs b/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs index bde724e7..582eefcf 100644 --- a/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs +++ b/Migration.Toolkit.Core.KX13/Handlers/MigrateUsersCommandHandler.cs @@ -1,254 +1,237 @@ -namespace Migration.Toolkit.Core.KX13.Handlers; - -using CMS.Membership; -using MediatR; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Api.Enums; - -public class MigrateUsersCommandHandler : IRequestHandler, IDisposable -{ - private const string USER_PUBLIC = "public"; - - private readonly ILogger _logger; - private readonly IDbContextFactory _kx13ContextFactory; - private readonly IEntityMapper _userInfoMapper; - private readonly IEntityMapper _roleMapper; - private readonly IEntityMapper _userRoleMapper; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - - private static int[] MigratedAdminUserPrivilegeLevels => new[] { (int)UserPrivilegeLevelEnum.Editor, (int)UserPrivilegeLevelEnum.Admin, (int)UserPrivilegeLevelEnum.GlobalAdmin }; - - public MigrateUsersCommandHandler( - ILogger logger, - IDbContextFactory kx13ContextFactory, - IEntityMapper userInfoMapper, - IEntityMapper roleMapper, - IEntityMapper userRoleMapper, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) - { - _logger = logger; - _kx13ContextFactory = kx13ContextFactory; - _userInfoMapper = userInfoMapper; - _roleMapper = roleMapper; - _userRoleMapper = userRoleMapper; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - } - - public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) - { - await using var kx13Context = await _kx13ContextFactory.CreateDbContextAsync(cancellationToken); - - var kx13CmsUsers = kx13Context.CmsUsers - .Where(u => MigratedAdminUserPrivilegeLevels.Contains(u.UserPrivilegeLevel)) - ; - - foreach (var kx13User in kx13CmsUsers) - { - _protocol.FetchedSource(kx13User); - _logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", kx13User.UserName, kx13User.UserGuid); - - var xbkUserInfo = UserInfoProvider.ProviderObject.Get(kx13User.UserGuid); - - _protocol.FetchedTarget(xbkUserInfo); - - if (kx13User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) - { - _protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); - _logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", kx13User.UserGuid); - _primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, xbkUserInfo.UserID); - continue; - } - - if (xbkUserInfo?.UserName == USER_PUBLIC || kx13User.UserName == USER_PUBLIC) - { - _protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); - _logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? kx13User.UserGuid); - if (xbkUserInfo != null) - { - _primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, xbkUserInfo.UserID); - } - - continue; - } - - var mapped = _userInfoMapper.Map(kx13User, xbkUserInfo); - _protocol.MappedTarget(mapped); - - await SaveUserUsingKenticoApi(mapped, kx13User); - } - - await MigrateUserCmsRoles(kx13Context, cancellationToken); - - return new GenericCommandResult(); - } - - private Task SaveUserUsingKenticoApi(IModelMappingResult mapped, KX13M.CmsUser kx13User) - { - if (mapped is { Success: true } result) - { - var (userInfo, newInstance) = result; - ArgumentNullException.ThrowIfNull(userInfo); - - try - { - UserInfoProvider.ProviderObject.Set(userInfo); - - _protocol.Success(kx13User, userInfo, mapped); - _logger.LogEntitySetAction(newInstance, userInfo); - } - /*Violation in unique index or Violation in unique constraint */ - catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) - { - _logger.LogEntitySetError(sqlException, newInstance, userInfo); - _protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, kx13User) - .WithData(new { kx13User.UserName, kx13User.UserGuid, kx13User.UserId, }) - .WithMessage("Failed to migrate user, target database broken.") - ); - return Task.CompletedTask; - } - catch (Exception ex) - { - _logger.LogEntitySetError(ex, newInstance, userInfo); - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(userInfo) - ); - return Task.CompletedTask; - } - - _primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, userInfo.UserID); - return Task.CompletedTask; - } - - return Task.CompletedTask; - } - - private async Task MigrateUserCmsRoles(KX13Context kx13Context, CancellationToken cancellationToken) - { - var kx13CmsRoles = kx13Context.CmsRoles - .Where(r => - r.CmsUserRoles.Any(ur => MigratedAdminUserPrivilegeLevels.Contains(ur.User.UserPrivilegeLevel)) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var kx13CmsRole in kx13CmsRoles.WithCancellation(cancellationToken)) - { - _protocol.FetchedSource(kx13CmsRole); - - var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(kx13CmsRole.RoleGuid); - _protocol.FetchedTarget(xbkRoleInfo); - var mapped = _roleMapper.Map(kx13CmsRole, xbkRoleInfo); - _protocol.MappedTarget(mapped); - - if (mapped is not (var roleInfo, var newInstance) { Success: true }) - { - continue; - } - - ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); - try - { - RoleInfoProvider.ProviderObject.Set(roleInfo); - - _protocol.Success(kx13CmsRole, roleInfo, mapped); - _logger.LogEntitySetAction(newInstance, roleInfo); - - _primaryKeyMappingContext.SetMapping( - r => r.RoleId, - kx13CmsRole.RoleId, - roleInfo.RoleID - ); - } - catch (Exception ex) - { - _logger.LogEntitySetError(ex, newInstance, roleInfo); - _protocol.Append(HandbookReferences - .ErrorCreatingTargetInstance(ex) - .NeedsManualAction() - .WithIdentityPrint(roleInfo) - ); - continue; - } - - await MigrateUserRole(kx13CmsRole.RoleId); - } - } - - private async Task MigrateUserRole(int kx13RoleId) - { - var kx13Context = await _kx13ContextFactory.CreateDbContextAsync(); - var kx13UserRoles = kx13Context.CmsUserRoles - .Where(ur => - ur.RoleId == kx13RoleId && - MigratedAdminUserPrivilegeLevels.Contains(ur.User.UserPrivilegeLevel) - ) - .AsNoTracking() - .AsAsyncEnumerable(); - - await foreach (var kx13UserRole in kx13UserRoles) - { - _protocol.FetchedSource(kx13UserRole); - if (!_primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, kx13RoleId, out var xbkRoleId)) - { - var handbookRef = HandbookReferences - .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), kx13UserRole.RoleId) - .NeedsManualAction(); - - _protocol.Append(handbookRef); - _logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", kx13UserRole.RoleId); - continue; - } - - if (!_primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, kx13UserRole.UserId, out var xbkUserId)) - { - continue; - } - - var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); - _protocol.FetchedTarget(xbkUserRole); - - var mapped = _userRoleMapper.Map(kx13UserRole, xbkUserRole); - _protocol.MappedTarget(mapped); - - if (mapped is { Success: true }) - { - var (userRoleInfo, newInstance) = mapped; - ArgumentNullException.ThrowIfNull(userRoleInfo); - - try - { - UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); - - _protocol.Success(kx13UserRole, userRoleInfo, mapped); - _logger.LogEntitySetAction(newInstance, userRoleInfo); - } - catch (Exception ex) - { - _logger.LogEntitySetError(ex, newInstance, userRoleInfo); - _protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) - .WithData(new { kx13UserRole.UserRoleId, kx13UserRole.UserId, kx13UserRole.RoleId, }) - .WithMessage("Failed to migrate user role") - ); - } - } - } - } - - public void Dispose() - { - - } -} \ No newline at end of file +using CMS.Membership; + +using MediatR; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KX13.Context; +using Migration.Toolkit.KXP.Api.Auxiliary; +using Migration.Toolkit.KXP.Api.Enums; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Handlers; + +public class MigrateUsersCommandHandler( + ILogger logger, + IDbContextFactory kx13ContextFactory, + IEntityMapper userInfoMapper, + IEntityMapper roleMapper, + IEntityMapper userRoleMapper, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) + : IRequestHandler, IDisposable +{ + private const string USER_PUBLIC = "public"; + + public void Dispose() + { + } + + public async Task Handle(MigrateUsersCommand request, CancellationToken cancellationToken) + { + await using var kx13Context = await kx13ContextFactory.CreateDbContextAsync(cancellationToken); + + var kx13CmsUsers = kx13Context.CmsUsers + .Where(u => UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(u.UserPrivilegeLevel)) + ; + + foreach (var kx13User in kx13CmsUsers) + { + protocol.FetchedSource(kx13User); + logger.LogTrace("Migrating user {UserName} with UserGuid {UserGuid}", kx13User.UserName, kx13User.UserGuid); + + var xbkUserInfo = UserInfoProvider.ProviderObject.Get(kx13User.UserGuid); + + protocol.FetchedTarget(xbkUserInfo); + + if (kx13User.UserPrivilegeLevel == (int)UserPrivilegeLevelEnum.GlobalAdmin && xbkUserInfo != null) + { + protocol.Append(HandbookReferences.CmsUserAdminUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is administrator, you need to update administrators manually => skipping", kx13User.UserGuid); + primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, xbkUserInfo.UserID); + continue; + } + + if (xbkUserInfo?.UserName == USER_PUBLIC || kx13User.UserName == USER_PUBLIC) + { + protocol.Append(HandbookReferences.CmsUserPublicUserSkip.WithIdentityPrint(xbkUserInfo)); + logger.LogInformation("User with guid {UserGuid} is public user, special case that can't be migrated => skipping", xbkUserInfo?.UserGUID ?? kx13User.UserGuid); + if (xbkUserInfo != null) + { + primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, xbkUserInfo.UserID); + } + + continue; + } + + var mapped = userInfoMapper.Map(kx13User, xbkUserInfo); + protocol.MappedTarget(mapped); + + await SaveUserUsingKenticoApi(mapped, kx13User); + } + + await MigrateUserCmsRoles(kx13Context, cancellationToken); + + return new GenericCommandResult(); + } + + private Task SaveUserUsingKenticoApi(IModelMappingResult mapped, KX13M.CmsUser kx13User) + { + if (mapped is { Success: true } result) + { + (var userInfo, bool newInstance) = result; + ArgumentNullException.ThrowIfNull(userInfo); + + try + { + UserInfoProvider.ProviderObject.Set(userInfo); + + protocol.Success(kx13User, userInfo, mapped); + logger.LogEntitySetAction(newInstance, userInfo); + } + /*Violation in unique index or Violation in unique constraint */ + catch (DbUpdateException dbUpdateException) when (dbUpdateException.InnerException is SqlException { Number: 2601 or 2627 } sqlException) + { + logger.LogEntitySetError(sqlException, newInstance, userInfo); + protocol.Append(HandbookReferences.DbConstraintBroken(sqlException, kx13User) + .WithData(new { kx13User.UserName, kx13User.UserGuid, kx13User.UserId }) + .WithMessage("Failed to migrate user, target database broken.") + ); + return Task.CompletedTask; + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(userInfo) + ); + return Task.CompletedTask; + } + + primaryKeyMappingContext.SetMapping(r => r.UserId, kx13User.UserId, userInfo.UserID); + return Task.CompletedTask; + } + + return Task.CompletedTask; + } + + private async Task MigrateUserCmsRoles(KX13Context kx13Context, CancellationToken cancellationToken) + { + var kx13CmsRoles = kx13Context.CmsRoles + .Where(r => + r.CmsUserRoles.Any(ur => UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(ur.User.UserPrivilegeLevel)) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var kx13CmsRole in kx13CmsRoles.WithCancellation(cancellationToken)) + { + protocol.FetchedSource(kx13CmsRole); + + var xbkRoleInfo = RoleInfoProvider.ProviderObject.Get(kx13CmsRole.RoleGuid); + protocol.FetchedTarget(xbkRoleInfo); + var mapped = roleMapper.Map(kx13CmsRole, xbkRoleInfo); + protocol.MappedTarget(mapped); + + if (mapped is not (var roleInfo, var newInstance) { Success: true }) + { + continue; + } + + ArgumentNullException.ThrowIfNull(roleInfo, nameof(roleInfo)); + try + { + RoleInfoProvider.ProviderObject.Set(roleInfo); + + protocol.Success(kx13CmsRole, roleInfo, mapped); + logger.LogEntitySetAction(newInstance, roleInfo); + + primaryKeyMappingContext.SetMapping( + r => r.RoleId, + kx13CmsRole.RoleId, + roleInfo.RoleID + ); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, roleInfo); + protocol.Append(HandbookReferences + .ErrorCreatingTargetInstance(ex) + .NeedsManualAction() + .WithIdentityPrint(roleInfo) + ); + continue; + } + + await MigrateUserRole(kx13CmsRole.RoleId); + } + } + + private async Task MigrateUserRole(int kx13RoleId) + { + var kx13Context = await kx13ContextFactory.CreateDbContextAsync(); + var kx13UserRoles = kx13Context.CmsUserRoles + .Where(ur => + ur.RoleId == kx13RoleId && + UserHelper.PrivilegeLevelsMigratedAsAdminUser.Contains(ur.User.UserPrivilegeLevel) + ) + .AsNoTracking() + .AsAsyncEnumerable(); + + await foreach (var kx13UserRole in kx13UserRoles) + { + protocol.FetchedSource(kx13UserRole); + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.RoleId, kx13RoleId, out int xbkRoleId)) + { + var handbookRef = HandbookReferences + .MissingRequiredDependency(nameof(UserRoleInfo.RoleID), kx13UserRole.RoleId) + .NeedsManualAction(); + + protocol.Append(handbookRef); + logger.LogWarning("Unable to locate role in target instance with source RoleID '{RoleID}'", kx13UserRole.RoleId); + continue; + } + + if (!primaryKeyMappingContext.TryRequireMapFromSource(u => u.UserId, kx13UserRole.UserId, out int xbkUserId)) + { + continue; + } + + var xbkUserRole = UserRoleInfoProvider.ProviderObject.Get(xbkUserId, xbkRoleId); + protocol.FetchedTarget(xbkUserRole); + + var mapped = userRoleMapper.Map(kx13UserRole, xbkUserRole); + protocol.MappedTarget(mapped); + + if (mapped is { Success: true }) + { + (var userRoleInfo, bool newInstance) = mapped; + ArgumentNullException.ThrowIfNull(userRoleInfo); + + try + { + UserRoleInfoProvider.ProviderObject.Set(userRoleInfo); + + protocol.Success(kx13UserRole, userRoleInfo, mapped); + logger.LogEntitySetAction(newInstance, userRoleInfo); + } + catch (Exception ex) + { + logger.LogEntitySetError(ex, newInstance, userRoleInfo); + protocol.Append(HandbookReferences.ErrorSavingTargetInstance(ex) + .WithData(new { kx13UserRole.UserRoleId, kx13UserRole.UserId, kx13UserRole.RoleId }) + .WithMessage("Failed to migrate user role") + ); + } + } + } + } +} diff --git a/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs b/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs index 5328d9e4..787cadd0 100644 --- a/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs +++ b/Migration.Toolkit.Core.KX13/Helpers/KenticoHelper.cs @@ -1,46 +1,46 @@ -namespace Migration.Toolkit.Core.KX13.Helpers; - -using System.Globalization; -using CMS.Helpers; -using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.KX13.Context; - -public static class KenticoHelper -{ - public static void CopyCustomData(ContainerCustomData target, string? sourceXml) - { - var customNodeData = new ContainerCustomData(); - customNodeData.LoadData(sourceXml); - foreach (var columnName in customNodeData.ColumnNames) - { - target.SetValue(columnName, customNodeData.GetValue(columnName)); - } - } - - public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) - { - using var kx13Context = ctxf.CreateDbContext(); - var keys = kx13Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - - return (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - } - - public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable - { - using var kx13Context = ctxf.CreateDbContext(); - var keys = kx13Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); - var value = (keys.FirstOrDefault(x => x.SiteId == siteId) - ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; - - - return T.TryParse(value, CultureInfo.InvariantCulture, out var result) - ? result - : null; - } - - public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable - { - return T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); - } -} \ No newline at end of file +using System.Globalization; + +using CMS.Helpers; + +using Microsoft.EntityFrameworkCore; + +using Migration.Toolkit.KX13.Context; + +namespace Migration.Toolkit.Core.KX13.Helpers; + +public static class KenticoHelper +{ + public static void CopyCustomData(ContainerCustomData target, string? sourceXml) + { + var customNodeData = new ContainerCustomData(); + customNodeData.LoadData(sourceXml); + foreach (string? columnName in customNodeData.ColumnNames) + { + target.SetValue(columnName, customNodeData.GetValue(columnName)); + } + } + + public static string? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) + { + using var kx13Context = ctxf.CreateDbContext(); + var keys = kx13Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + + return (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + } + + public static T? GetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName) where T : struct, IParsable + { + using var kx13Context = ctxf.CreateDbContext(); + var keys = kx13Context.CmsSettingsKeys.Where(x => x.KeyName == keyName); + string? value = (keys.FirstOrDefault(x => x.SiteId == siteId) + ?? keys.FirstOrDefault(x => x.SiteId == null))?.KeyValue; + + + return T.TryParse(value, CultureInfo.InvariantCulture, out var result) + ? result + : null; + } + + public static bool? TryGetSettingsKey(IDbContextFactory ctxf, int? siteId, string keyName, out T? result) where T : IParsable => T.TryParse(GetSettingsKey(ctxf, siteId, keyName), CultureInfo.InvariantCulture, out result); +} diff --git a/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs b/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs index 95b4e30c..8ee16d2d 100644 --- a/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs +++ b/Migration.Toolkit.Core.KX13/Helpers/PrintHelper.cs @@ -1,7 +1,7 @@ -namespace Migration.Toolkit.Core.KX13.Helpers; - -public static class PrintHelper -{ - public static string PrintDictionary(Dictionary dictionary) => - string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); -} \ No newline at end of file +namespace Migration.Toolkit.Core.KX13.Helpers; + +public static class PrintHelper +{ + public static string PrintDictionary(Dictionary dictionary) => + string.Join(", ", dictionary.Select(x => $"{x.Key}:{x.Value ?? ""}")); +} diff --git a/Migration.Toolkit.Core.KX13/Helpers/Printer.cs b/Migration.Toolkit.Core.KX13/Helpers/Printer.cs index f9479aca..79563369 100644 --- a/Migration.Toolkit.Core.KX13/Helpers/Printer.cs +++ b/Migration.Toolkit.Core.KX13/Helpers/Printer.cs @@ -1,121 +1,103 @@ -namespace Migration.Toolkit.Core.KX13.Helpers; - -using CMS.DataEngine; -using CMS.Globalization; -using CMS.MediaLibrary; -using CMS.Membership; -using CMS.Modules; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.KXP.Models; - -public class Printer -{ - public static string PrintKxpModelInfo(T model) - { - var currentTypeName = ReflectionHelper.CurrentType.Name; - - return model switch - { - MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", - MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", - CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", - CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", - CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", - CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", - CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", - CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", - OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", - - null => $"{currentTypeName}: ", - _ => $"TODO: {typeof(T).FullName}" - }; - } - - public static string GetEntityIdentityPrint(T model, bool printType = true) - { - var currentTypeName = ReflectionHelper.CurrentType.Name; - - string Fallback(object obj) => printType - ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" - : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}" - ; - - string FormatModel(string inner) => printType - ? $"{currentTypeName}({inner})" - : $"{inner}" - ; - - return model switch - { - MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), - MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), - DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), - - CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), - StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), - - ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), - CMS.FormEngine.AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), - UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), - RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), - MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), - - CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), - CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), - CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), - - KX13M.CmsPageTemplateConfiguration item => FormatModel($"ID={item.PageTemplateConfigurationId}, GUID={item.PageTemplateConfigurationGuid}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteId}"), - KX13M.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), - KX13M.CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), - KX13M.CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), - KX13M.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), - KX13M.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), - KX13M.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), - KX13M.CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), - KX13M.CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), - KX13M.CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), - KX13M.CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), - KX13M.CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), - - null => $" ref of {currentTypeName}", - _ => Fallback(model) - }; - } - - public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") - { - return string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); - } - - public static string PrintEnumValues(string separator) where TEnum : struct, Enum - { - return string.Join(separator, Enum.GetValues()); - } -} - -public class PrintService : IPrintService -{ - public string PrintKxpModelInfo(T model) - { - return Printer.PrintKxpModelInfo(model); - } - - public string GetEntityIdentityPrint(T model, bool printType = true) - { - return Printer.GetEntityIdentityPrint(model, printType); - } - - public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") - { - return Printer.GetEntityIdentityPrints(models, separator); - } - - public string PrintEnumValues(string separator) where TEnum : struct, Enum - { - return Printer.PrintEnumValues(separator); - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; +using CMS.Globalization; +using CMS.MediaLibrary; +using CMS.Membership; +using CMS.Modules; + +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.Services; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Helpers; + +public class Printer +{ + public static string PrintKxpModelInfo(T model) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + return model switch + { + MediaLibrary mediaLibrary => $"{currentTypeName}: {nameof(mediaLibrary.LibraryGuid)}={mediaLibrary.LibraryGuid}", + MediaFile mediaFile => $"{currentTypeName}: {nameof(mediaFile.FileGuid)}={mediaFile.FileGuid}", + CmsRole role => $"{currentTypeName}: {nameof(role.RoleGuid)}={role.RoleGuid}, {nameof(role.RoleName)}={role.RoleName}", + CmsUser user => $"{currentTypeName}: {nameof(user.UserGuid)}={user.UserGuid}, {nameof(user.UserName)}={user.UserName}", + CmsResource resource => $"{currentTypeName}: {nameof(resource.ResourceGuid)}={resource.ResourceGuid}, {nameof(resource.ResourceName)}={resource.ResourceName}", + CmsSettingsCategory settingsCategory => $"{currentTypeName}: {nameof(settingsCategory.CategoryName)}={settingsCategory.CategoryName}", + CmsSettingsKey settingsKey => $"{currentTypeName}: {nameof(settingsKey.KeyGuid)}={settingsKey.KeyGuid}, {nameof(settingsKey.KeyName)}={settingsKey.KeyName}", + CmsForm form => $"{currentTypeName}: {nameof(form.FormGuid)}={form.FormGuid}, {nameof(form.FormName)}={form.FormName}", + OmContactGroup omContactGroup => $"{currentTypeName}: {nameof(omContactGroup.ContactGroupGuid)}={omContactGroup.ContactGroupGuid}, {nameof(omContactGroup.ContactGroupName)}={omContactGroup.ContactGroupName}", + + null => $"{currentTypeName}: ", + _ => $"TODO: {typeof(T).FullName}" + }; + } + + public static string GetEntityIdentityPrint(T model, bool printType = true) + { + string currentTypeName = ReflectionHelper.CurrentType.Name; + + string Fallback(object obj) => printType + ? $"{currentTypeName}({SerializationHelper.SerializeOnlyNonComplexProperties(obj)})" + : $"{SerializationHelper.SerializeOnlyNonComplexProperties(obj)}"; + + string FormatModel(string inner) => printType + ? $"{currentTypeName}({inner})" + : $"{inner}"; + + return model switch + { + MediaLibraryInfo item => FormatModel($"ID={item.LibraryID}, GUID={item.LibraryGUID}, Name={item.LibraryName}"), + MediaFileInfo item => FormatModel($"ID={item.FileID}, GUID={item.FileGUID}, Name={item.FileName}"), + DataClassInfo item => FormatModel($"ID={item.ClassID}, GUID={item.ClassGUID}, Name={item.ClassName}"), + + CountryInfo item => FormatModel($"ID={item.CountryID}, GUID={item.CountryGUID}, Name={item.CountryName}"), + StateInfo item => FormatModel($"ID={item.StateID}, GUID={item.StateGUID}, Name={item.StateName}"), + + ResourceInfo item => FormatModel($"ID={item.ResourceID}, Guid={item.ResourceGUID} Name={item.ResourceName}"), + AlternativeFormInfo item => FormatModel($"ID={item.FormID}, Guid={item.FormGUID} Name={item.FormName}"), + UserInfo item => FormatModel($"ID={item.UserID}, Guid={item.UserGUID} Name={item.UserName}"), + RoleInfo item => FormatModel($"ID={item.RoleID}, Guid={item.RoleGUID} Name={item.RoleName}"), + MemberInfo item => FormatModel($"ID={item.MemberID}, Guid={item.MemberGuid} Name={item.MemberName}"), + + CmsForm item => FormatModel($"ID={item.FormId}, GUID={item.FormGuid}, Name={item.FormName}"), + CmsUser item => FormatModel($"ID={item.UserId}, GUID={item.UserGuid}, Name={item.UserName}"), + CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + CmsSettingsKey item => FormatModel($"ID={item.KeyId}, GUID={item.KeyGuid}, Name={item.KeyName}"), + + KX13M.CmsPageTemplateConfiguration item => FormatModel($"ID={item.PageTemplateConfigurationId}, GUID={item.PageTemplateConfigurationGuid}, Name={item.PageTemplateConfigurationName}, SiteId={item.PageTemplateConfigurationSiteId}"), + KX13M.CmsRole item => FormatModel($"ID={item.RoleId}, GUID={item.RoleGuid}, Name={item.RoleName}, SiteId={item.SiteId}"), + KX13M.CmsAttachment item => FormatModel($"ID={item.AttachmentId}, GUID={item.AttachmentGuid}, Name={item.AttachmentName}"), + KX13M.CmsClass item => FormatModel($"ID={item.ClassId}, GUID={item.ClassGuid}, Name={item.ClassName}"), + KX13M.CmsConsent item => FormatModel($"ID={item.ConsentId}, GUID={item.ConsentGuid}, Name={item.ConsentName}"), + KX13M.CmsConsentArchive item => FormatModel($"ID={item.ConsentArchiveId}, GUID={item.ConsentArchiveGuid}"), + KX13M.CmsConsentAgreement item => FormatModel($"ID={item.ConsentAgreementId}, GUID={item.ConsentAgreementGuid}"), + KX13M.CmsCountry item => FormatModel($"ID={item.CountryId}, GUID={item.CountryGuid}, Name={item.CountryName}"), + KX13M.CmsState item => FormatModel($"ID={item.StateId}, GUID={item.StateGuid}, Name={item.StateName}"), + KX13M.CmsTree item => FormatModel($"NodeID={item.NodeId}, NodeGUID={item.NodeGuid}, NodeName={item.NodeName}, NodeAliasPath={item.NodeAliasPath}"), + KX13M.CmsDocument item => FormatModel($"NodeID={item.DocumentNodeId}, DocumentID={item.DocumentId}, DocumentGUID={item.DocumentGuid}, DocumentCulture={item.DocumentCulture}, DocumentName={item.DocumentName}"), + KX13M.CmsResource item => FormatModel($"ID={item.ResourceId}, GUID={item.ResourceGuid}, Name={item.ResourceName}"), + + null => $" ref of {currentTypeName}", + _ => Fallback(model) + }; + } + + public static string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => string.Join(separator, models.Select(m => GetEntityIdentityPrint(m, false))); + + public static string PrintEnumValues(string separator) where TEnum : struct, Enum => string.Join(separator, Enum.GetValues()); +} + +public class PrintService : IPrintService +{ + public string PrintKxpModelInfo(T model) => Printer.PrintKxpModelInfo(model); + + public string GetEntityIdentityPrint(T model, bool printType = true) => Printer.GetEntityIdentityPrint(model, printType); + + public string GetEntityIdentityPrints(IEnumerable models, string separator = "|") => Printer.GetEntityIdentityPrints(models, separator); + + public string PrintEnumValues(string separator) where TEnum : struct, Enum => Printer.PrintEnumValues(separator); +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs index 542e4c22..36a90ff2 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/AlternativeFormMapper.cs @@ -1,96 +1,90 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using CMS.DataEngine; -using CMS.FormEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Services; -using Migration.Toolkit.KXP.Api.Services.CmsClass; - -public record AlternativeFormMapperSource(KX13M.CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); - -public class AlternativeFormMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly FieldMigrationService _fieldMigrationService; - - public AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) : base(logger, pkContext, protocol) - { - _logger = logger; - _fieldMigrationService = fieldMigrationService; - } - - protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - => AlternativeFormInfo.New(); - - protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (source, xbkFormClass) = sourceObj; - - target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out var classId) - ? classId ?? 0 - : 0; - target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out var coupledClassId) - ? coupledClassId ?? 0 - : 0; - - var coupledClassIsDeprecated = - source.FormCoupledClass?.ClassName is { } coupledClassName && - Kx13SystemClass.NoLongerSupported.Contains(coupledClassName); - - var classIsSysInternal = Kx13SystemClass.All.Contains(source.FormClass.ClassName); - - var mergedDefinition = source.FormClass.ClassFormDefinition; - if (source.FormCoupledClass != null) - { - _logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); - } - mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); - - var patcher = new FormDefinitionPatcher( - _logger, - mergedDefinition, - _fieldMigrationService, - source.FormClass.ClassIsForm.GetValueOrDefault(false), - source.FormClass.ClassIsDocumentType, - false, - !classIsSysInternal, - true - ); - - var fieldNames = patcher.GetFieldNames().ToList(); - _logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); - - patcher.PatchFields(); - - var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); - _logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); - - if (coupledClassIsDeprecated && source.FormCoupledClass != null) - { - _logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); - patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); - - var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); - _logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); - } - - var result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); - - var formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); - - target.FormDefinition = formDefinitionDifference; - - target.FormDisplayName = source.FormDisplayName; - target.FormGUID = source.FormGuid; - target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); - target.FormLastModified = source.FormLastModified; - target.FormName = source.FormName; - - return target; - } -} \ No newline at end of file +using CMS.DataEngine; +using CMS.FormEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Api.Services.CmsClass; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public record AlternativeFormMapperSource(KX13M.CmsAlternativeForm AlternativeForm, DataClassInfo XbkFormClass); + +public class AlternativeFormMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, FieldMigrationService fieldMigrationService) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override AlternativeFormInfo? CreateNewInstance(AlternativeFormMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) + => AlternativeFormInfo.New(); + + protected override AlternativeFormInfo MapInternal(AlternativeFormMapperSource sourceObj, AlternativeFormInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (source, xbkFormClass) = sourceObj; + + target.FormClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormClassId, out int? classId) + ? classId ?? 0 + : 0; + target.FormCoupledClassID = mappingHelper.TranslateIdAllowNulls(c => c.ClassId, source.FormCoupledClassId, out int? coupledClassId) + ? coupledClassId ?? 0 + : 0; + + bool coupledClassIsDeprecated = + source.FormCoupledClass?.ClassName is { } coupledClassName && + Kx13SystemClass.NoLongerSupported.Contains(coupledClassName); + + bool classIsSysInternal = Kx13SystemClass.All.Contains(source.FormClass.ClassName); + + string mergedDefinition = source.FormClass.ClassFormDefinition; + if (source.FormCoupledClass != null) + { + logger.LogDebug("Merging coupled class ('{FormCoupledClassName}') form definition with form definition ('{FormClassName}')", source.FormCoupledClass.ClassName, source.FormClass.ClassName); + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormCoupledClass.ClassFormDefinition); + } + + mergedDefinition = FormHelper.MergeFormDefinitions(mergedDefinition, source.FormDefinition); + + var patcher = new FormDefinitionPatcher( + logger, + mergedDefinition, + fieldMigrationService, + source.FormClass.ClassIsForm.GetValueOrDefault(false), + source.FormClass.ClassIsDocumentType, + false, + !classIsSysInternal, + true + ); + + var fieldNames = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) before patch: {Fields}", fieldNames.Count, string.Join(",", fieldNames)); + + patcher.PatchFields(); + + var fieldNamesAfterPatch = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after patch: {Fields}", fieldNamesAfterPatch.Count, string.Join(",", fieldNamesAfterPatch)); + + if (coupledClassIsDeprecated && source.FormCoupledClass != null) + { + logger.LogDebug("Form coupled class ('{FormCoupledClassName}') is deprecated, removing fields", source.FormCoupledClass.ClassName); + patcher.RemoveFields(source.FormCoupledClass.ClassFormDefinition); + + var fileNamesAfterDeprecatedRemoval = patcher.GetFieldNames().ToList(); + logger.LogDebug("Fields ({Count}) after deprecated removal: {Fields}", fileNamesAfterDeprecatedRemoval.Count, string.Join(",", fileNamesAfterDeprecatedRemoval)); + } + + string result = new FormInfo(patcher.GetPatched()).GetXmlDefinition(); + + string formDefinitionDifference = FormHelper.GetFormDefinitionDifference(xbkFormClass.ClassFormDefinition, result, true); + + target.FormDefinition = formDefinitionDifference; + + target.FormDisplayName = source.FormDisplayName; + target.FormGUID = source.FormGuid; + target.FormIsCustom = source.FormIsCustom.GetValueOrDefault(false); + target.FormLastModified = source.FormLastModified; + target.FormName = source.FormName; + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs index da40f84d..3b67ad5e 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsAttachmentMapper.cs @@ -1,59 +1,62 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using CMS.Base; -using CMS.MediaLibrary; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Helpers; -using Migration.Toolkit.KX13.Models; - -public record CmsAttachmentMapperSource(CmsAttachment Attachment, int TargetLibraryId, IUploadedFile File, string LibrarySubFolder, - CmsDocument? AttachmentDocument); - -public class CmsAttachmentMapper : EntityMapperBase -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - public CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - { - // library name is generated with site name in it - return new MediaFileInfo(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); - } - - protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (cmsAttachment, targetLibraryId, _, _, attachmentDocument) = args; - - target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); - target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; - target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; - target.FileExtension = cmsAttachment.AttachmentExtension; - target.FileMimeType = cmsAttachment.AttachmentMimeType; - target.FileSize = cmsAttachment.AttachmentSize; - target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; - target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; - target.FileGUID = cmsAttachment.AttachmentGuid; - target.FileLibraryID = targetLibraryId; - - // target.FileCreatedByUserID = cmsAttachment.?; - // target.FileModifiedByUserID = cmsAttachment.?; - // target.FileCreatedWhen = cmsAttachment.?; - - target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; - - KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); - - if (attachmentDocument != null) - { - target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); - } - - return target; - } -} \ No newline at end of file +using CMS.Base; +using CMS.MediaLibrary; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.Core.KX13.Helpers; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public record CmsAttachmentMapperSource( + KX13M.CmsAttachment Attachment, + int TargetLibraryId, + IUploadedFile File, + string LibrarySubFolder, + KX13M.CmsDocument? AttachmentDocument); + +public class CmsAttachmentMapper : EntityMapperBase +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + public CmsAttachmentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override MediaFileInfo? CreateNewInstance(CmsAttachmentMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => + // library name is generated with site name in it + new(source.File, source.TargetLibraryId, source.LibrarySubFolder, 0, 0, 0); + + protected override MediaFileInfo MapInternal(CmsAttachmentMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + (var cmsAttachment, int targetLibraryId, _, _, var attachmentDocument) = args; + + target.FileName = Path.GetFileNameWithoutExtension(cmsAttachment.AttachmentName); + target.FileTitle = cmsAttachment.AttachmentTitle ?? cmsAttachment.AttachmentName; + target.FileDescription = cmsAttachment.AttachmentDescription ?? string.Empty; + target.FileExtension = cmsAttachment.AttachmentExtension; + target.FileMimeType = cmsAttachment.AttachmentMimeType; + target.FileSize = cmsAttachment.AttachmentSize; + target.FileImageWidth = cmsAttachment.AttachmentImageWidth ?? 0; + target.FileImageHeight = cmsAttachment.AttachmentImageHeight ?? 0; + target.FileGUID = cmsAttachment.AttachmentGuid; + target.FileLibraryID = targetLibraryId; + + // target.FileCreatedByUserID = cmsAttachment.?; + // target.FileModifiedByUserID = cmsAttachment.?; + // target.FileCreatedWhen = cmsAttachment.?; + + target.FileModifiedWhen = cmsAttachment.AttachmentLastModified; + + KenticoHelper.CopyCustomData(target.FileCustomData, cmsAttachment.AttachmentCustomData); + + if (attachmentDocument != null) + { + target.FileCustomData.SetValue(LEGACY_ORIGINAL_PATH, attachmentDocument.DocumentNode.NodeAliasPath); + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs index 65b52f5c..c564ed84 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentAgreementMapper.cs @@ -1,36 +1,37 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentAgreementMapper : EntityMapperBase -{ - public CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override CmsConsentAgreement? CreateNewInstance(Toolkit.KX13.Models.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentAgreement MapInternal(Toolkit.KX13.Models.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentAgreementGuid = source.ConsentAgreementGuid; - target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; - target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; - target.ConsentAgreementTime = source.ConsentAgreementTime; - - if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out var contactId)) - { - target.ConsentAgreementContactId = contactId; - } - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out var consentId)) - { - target.ConsentAgreementConsentId = consentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class CmsConsentAgreementMapper : EntityMapperBase +{ + public CmsConsentAgreementMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override CmsConsentAgreement? CreateNewInstance(KX13M.CmsConsentAgreement source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsentAgreement MapInternal(KX13M.CmsConsentAgreement source, CmsConsentAgreement target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentAgreementGuid = source.ConsentAgreementGuid; + target.ConsentAgreementRevoked = source.ConsentAgreementRevoked; + target.ConsentAgreementConsentHash = source.ConsentAgreementConsentHash; + target.ConsentAgreementTime = source.ConsentAgreementTime; + + if (mappingHelper.TranslateRequiredId(c => c.ContactId, source.ConsentAgreementContactId, out int contactId)) + { + target.ConsentAgreementContactId = contactId; + } + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentAgreementConsentId, out int consentId)) + { + target.ConsentAgreementConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs index 8e6eade5..874e3c11 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentArchiveMapper.cs @@ -1,33 +1,34 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentArchiveMapper : EntityMapperBase -{ - public CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override CmsConsentArchive? CreateNewInstance(Toolkit.KX13.Models.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsentArchive MapInternal(Toolkit.KX13.Models.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentArchiveContent = source.ConsentArchiveContent; - target.ConsentArchiveGuid = source.ConsentArchiveGuid; - target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; - target.ConsentArchiveHash = source.ConsentArchiveHash; - - if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out var consentId)) - { - target.ConsentArchiveConsentId = consentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class CmsConsentArchiveMapper : EntityMapperBase +{ + public CmsConsentArchiveMapper(ILogger logger, PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override CmsConsentArchive? CreateNewInstance(KX13M.CmsConsentArchive source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsentArchive MapInternal(KX13M.CmsConsentArchive source, CmsConsentArchive target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentArchiveContent = source.ConsentArchiveContent; + target.ConsentArchiveGuid = source.ConsentArchiveGuid; + target.ConsentArchiveLastModified = source.ConsentArchiveLastModified; + target.ConsentArchiveHash = source.ConsentArchiveHash; + + if (mappingHelper.TranslateRequiredId(r => r.ConsentId, source.ConsentArchiveConsentId, out int consentId)) + { + target.ConsentArchiveConsentId = consentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs index 02f40ac1..52af062b 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsConsentMapper.cs @@ -1,76 +1,83 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using System.Text; -using System.Xml.Linq; -using System.Xml.XPath; -using CMS.ContentEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsConsentMapper : EntityMapperBase -{ - public CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CmsConsent? CreateNewInstance(Toolkit.KX13.Models.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsConsent MapInternal(Toolkit.KX13.Models.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ConsentDisplayName = source.ConsentDisplayName; - var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); - target.ConsentName = source.ConsentName; - target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); - target.ConsentGuid = source.ConsentGuid; - target.ConsentLastModified = source.ConsentLastModified; - target.ConsentHash = source.ConsentHash; - - return target; - } -} - -static file class ConsentContentPatcher -{ - public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) - { - if (string.IsNullOrWhiteSpace(content)) return content; - XDocument doc; - try - { - doc = XDocument.Parse(content); - } - catch (Exception) - { - // cannot patch xml that cannot be parsed - return content; - } - - foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) - { - cultureCodeElement.Name = "LanguageName"; - if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) - { - // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); - } - - // if elements are not swapped, FULLTEXT is not shown in UI - var p = cultureCodeElement.NextNode; - if (p is XElement e && e.Name == "FullText") - { - p.ReplaceWith(cultureCodeElement); - cultureCodeElement.ReplaceWith(p); - } - } - - var builder = new StringBuilder(); - using (var writer = new CMS.IO.StringWriter(builder)) - { - doc.Save(writer); - } - - return builder.ToString(); - } -} \ No newline at end of file +using System.Text; +using System.Xml.Linq; +using System.Xml.XPath; + +using CMS.ContentEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class CmsConsentMapper : EntityMapperBase +{ + public CmsConsentMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CmsConsent? CreateNewInstance(KX13M.CmsConsent source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsConsent MapInternal(KX13M.CmsConsent source, CmsConsent target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.ConsentDisplayName = source.ConsentDisplayName; + var defaultContentLanguageInfo = ContentLanguageInfo.Provider.Get().WhereEquals(nameof(ContentLanguageInfo.ContentLanguageIsDefault), true).FirstOrDefault() ?? throw new InvalidCastException("Missing default content language"); + target.ConsentName = source.ConsentName; + target.ConsentContent = ConsentContentPatcher.PatchConsentContent(source.ConsentContent, defaultContentLanguageInfo); + target.ConsentGuid = source.ConsentGuid; + target.ConsentLastModified = source.ConsentLastModified; + target.ConsentHash = source.ConsentHash; + + return target; + } +} + +static file class ConsentContentPatcher +{ + public static string PatchConsentContent(string content, ContentLanguageInfo defaultContentLanguage) + { + if (string.IsNullOrWhiteSpace(content)) + { + return content; + } + + XDocument doc; + try + { + doc = XDocument.Parse(content); + } + catch (Exception) + { + // cannot patch xml that cannot be parsed + return content; + } + + foreach (var cultureCodeElement in doc.XPathSelectElements("//CultureCode")) + { + cultureCodeElement.Name = "LanguageName"; + if (!string.Equals(defaultContentLanguage.ContentLanguageName, cultureCodeElement.Value, StringComparison.InvariantCultureIgnoreCase)) + { + // mLogger.LogWarning($"Consent '{consentInfo.ConsentName}' has unknown content language set '{cultureCodeElement.Value}'"); + } + + // if elements are not swapped, FULLTEXT is not shown in UI + var p = cultureCodeElement.NextNode; + if (p is XElement e && e.Name == "FullText") + { + p.ReplaceWith(cultureCodeElement); + cultureCodeElement.ReplaceWith(p); + } + } + + var builder = new StringBuilder(); + using (var writer = new CMS.IO.StringWriter(builder)) + { + doc.Save(writer); + } + + return builder.ToString(); + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs index 898902ac..4a86002f 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsCategoryMapper.cs @@ -1,97 +1,97 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsSettingsCategoryMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly PrimaryKeyMappingContext _pkContext; - private readonly IEntityMapper _cmsResourceMapper; - - public CmsSettingsCategoryMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol, - IEntityMapper cmsResourceMapper) : base(logger, pkContext, protocol) - { - _logger = logger; - _pkContext = pkContext; - _cmsResourceMapper = cmsResourceMapper; - } - - protected override CmsSettingsCategory? CreateNewInstance(Toolkit.KX13.Models.CmsSettingsCategory source, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - - protected override CmsSettingsCategory MapInternal(Toolkit.KX13.Models.CmsSettingsCategory source, CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // no category guid to match on... - if (newInstance) - { - target.CategoryOrder = source.CategoryOrder; - target.CategoryName = source.CategoryName; - target.CategoryDisplayName = source.CategoryDisplayName; - target.CategoryIdpath = source.CategoryIdpath; - target.CategoryLevel = source.CategoryLevel; - target.CategoryChildCount = source.CategoryChildCount; - target.CategoryIconPath = source.CategoryIconPath; - target.CategoryIsGroup = source.CategoryIsGroup; - target.CategoryIsCustom = source.CategoryIsCustom; - } - - if (source.CategoryResource != null) - { - if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) - { - // skip if target is present - _logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); - _pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); - } - else - { - switch (_cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) - { - case { Success: true } result: - { - target.CategoryResource = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out var categoryResourceId)) - { - target.CategoryResourceId = categoryResourceId; - } - - if (source.CategoryParent != null) - { - switch (Map(source.CategoryParent, target.CategoryParent)) - { - case { Success: true } result: - { - target.CategoryParent = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result.HandbookReference)); - break; - } - } - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out var categoryParentId)) - { - target.CategoryParentId = categoryParentId; - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class CmsSettingsCategoryMapper( + ILogger logger, + PrimaryKeyMappingContext pkContext, + IProtocol protocol, + IEntityMapper cmsResourceMapper) + : EntityMapperBase(logger, pkContext, protocol) +{ + protected override CmsSettingsCategory? CreateNewInstance(KX13M.CmsSettingsCategory source, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + + protected override CmsSettingsCategory MapInternal(KX13M.CmsSettingsCategory source, CmsSettingsCategory target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + // no category guid to match on... + if (newInstance) + { + target.CategoryOrder = source.CategoryOrder; + target.CategoryName = source.CategoryName; + target.CategoryDisplayName = source.CategoryDisplayName; + target.CategoryIdpath = source.CategoryIdpath; + target.CategoryLevel = source.CategoryLevel; + target.CategoryChildCount = source.CategoryChildCount; + target.CategoryIconPath = source.CategoryIconPath; + target.CategoryIsGroup = source.CategoryIsGroup; + target.CategoryIsCustom = source.CategoryIsCustom; + } + + if (source.CategoryResource != null) + { + if (target.CategoryResource != null && source.CategoryResourceId != null && target.CategoryResourceId != null) + { + // skip if target is present + logger.LogTrace("Skipping category resource '{ResourceGuid}', already present in target instance", target.CategoryResource.ResourceGuid); + pkContext.SetMapping(r => r.ResourceId, source.CategoryResourceId.Value, target.CategoryResourceId.Value); + } + else + { + switch (cmsResourceMapper.Map(source.CategoryResource, target.CategoryResource)) + { + case { Success: true } result: + { + target.CategoryResource = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + } + else if (mappingHelper.TranslateIdAllowNulls(r => r.ResourceId, source.CategoryResourceId, out int? categoryResourceId)) + { + target.CategoryResourceId = categoryResourceId; + } + + if (source.CategoryParent != null) + { + switch (Map(source.CategoryParent, target.CategoryParent)) + { + case { Success: true } result: + { + target.CategoryParent = result.Item; + break; + } + case { Success: false } result: + { + addFailure(new MapperResultFailure(result.HandbookReference)); + break; + } + + default: + break; + } + } + else if (mappingHelper.TranslateIdAllowNulls(c => c.CategoryId, source.CategoryParentId, out int? categoryParentId)) + { + target.CategoryParentId = categoryParentId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs index 0f2f48c8..f61b965c 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsSettingsKeyMapper.cs @@ -1,68 +1,70 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using System.Diagnostics; -using CMS.DataEngine; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -public class CmsSettingsKeyMapper : EntityMapperBase -{ - private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; - - public CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - - } - - protected override SettingsKeyInfo CreateNewInstance(Toolkit.KX13.Models.CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override SettingsKeyInfo MapInternal(Toolkit.KX13.Models.CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - if (newInstance) - { - target.KeyName = source.KeyName; - target.KeyDisplayName = source.KeyDisplayName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyGUID = source.KeyGuid; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - else - { - target.KeyName = source.KeyName; - target.KeyDescription = source.KeyDescription; - target.KeyType = source.KeyType; - target.KeyValidation = source.KeyValidation; - target.KeyEditingControlPath = source.KeyEditingControlPath; - target.KeyFormControlSettings = source.KeyFormControlSettings; - target.KeyExplanationText = source.KeyExplanationText; - } - - // special migrations for keys - switch (source.KeyName) - { - case SOURCE_KEY_NAME: - { - target.KeyValue = int.TryParse(source.KeyValue, out var cmsDefaultUserId) - ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out var targetCmsDefaultUserId) - ? targetCmsDefaultUserId.ToString() - : source.KeyValue - : source.KeyValue; - break; - } - default: - target.KeyValue = source.KeyValue; - break; - } - - Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); - target.KeyLastModified = source.KeyLastModified; - return target; - } -} \ No newline at end of file +using System.Diagnostics; + +using CMS.DataEngine; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class CmsSettingsKeyMapper : EntityMapperBase +{ + private const string SOURCE_KEY_NAME = "CMSDefaultUserID"; + + public CmsSettingsKeyMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override SettingsKeyInfo CreateNewInstance(KX13M.CmsSettingsKey source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override SettingsKeyInfo MapInternal(KX13M.CmsSettingsKey source, SettingsKeyInfo target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + if (newInstance) + { + target.KeyName = source.KeyName; + target.KeyDisplayName = source.KeyDisplayName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyGUID = source.KeyGuid; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + else + { + target.KeyName = source.KeyName; + target.KeyDescription = source.KeyDescription; + target.KeyType = source.KeyType; + target.KeyValidation = source.KeyValidation; + target.KeyEditingControlPath = source.KeyEditingControlPath; + target.KeyFormControlSettings = source.KeyFormControlSettings; + target.KeyExplanationText = source.KeyExplanationText; + } + + // special migrations for keys + switch (source.KeyName) + { + case SOURCE_KEY_NAME: + { + target.KeyValue = int.TryParse(source.KeyValue, out int cmsDefaultUserId) + ? mappingHelper.TranslateRequiredId(u => u.UserId, cmsDefaultUserId, out int targetCmsDefaultUserId) + ? targetCmsDefaultUserId.ToString() + : source.KeyValue + : source.KeyValue; + break; + } + default: + target.KeyValue = source.KeyValue; + break; + } + + Debug.Assert(!source.SiteId.HasValue, "!source.SiteId.HasValue"); + target.KeyLastModified = source.KeyLastModified; + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs index 515352a5..d65321e1 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CmsUserMapper.cs @@ -1,66 +1,55 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -public class CmsUserMapper : EntityMapperBase -{ - private readonly ILogger _logger; - - public CmsUserMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - _logger = logger; - } - - protected override CmsUser CreateNewInstance(Toolkit.KX13.Models.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override CmsUser MapInternal(Toolkit.KX13.Models.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGuid) - { - // assertion failed - _logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - target.UserPassword = source.UserPassword; - target.UserEnabled = source.UserEnabled; - target.UserCreated = source.UserCreated; - target.LastLogon = source.LastLogon; - target.UserGuid = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - target.UserIsPendingRegistration = false; - target.UserPasswordLastChanged = null; - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - foreach (var sourceCmsUserRole in source.CmsUserRoles) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out var targetRoleId)) - { - if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) - { - target.CmsUserRoles.Add(new CmsUserRole - { - RoleId = targetRoleId, - User = target, - }); - } - } - } - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class CmsUserMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol) : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override CmsUser CreateNewInstance(KX13M.CmsUser tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override CmsUser MapInternal(KX13M.CmsUser source, CmsUser target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + target.UserPassword = source.UserPassword; + target.UserEnabled = source.UserEnabled; + target.UserCreated = source.UserCreated; + target.LastLogon = source.LastLogon; + target.UserGuid = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + target.UserIsPendingRegistration = false; + target.UserPasswordLastChanged = null; + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + foreach (var sourceCmsUserRole in source.CmsUserRoles) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, sourceCmsUserRole.RoleId, out int targetRoleId)) + { + if (target.CmsUserRoles.All(x => x.RoleId != targetRoleId)) + { + target.CmsUserRoles.Add(new CmsUserRole { RoleId = targetRoleId, User = target }); + } + } + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs index adee6bd2..f0eb39da 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/CountryInfoMapper.cs @@ -1,29 +1,30 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using CMS.Globalization; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Models; - -public class CountryInfoMapper : EntityMapperBase -{ - public CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override CountryInfo? CreateNewInstance(CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) - => CountryInfo.New(); - - protected override CountryInfo MapInternal(CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.CountryName = source.CountryName; - target.CountryDisplayName = source.CountryDisplayName; - target.CountryGUID = source.CountryGuid; - target.CountryLastModified = source.CountryLastModified; - target.CountryThreeLetterCode = source.CountryThreeLetterCode; - target.CountryTwoLetterCode = source.CountryTwoLetterCode; - return target; - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class CountryInfoMapper : EntityMapperBase +{ + public CountryInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override CountryInfo? CreateNewInstance(KX13M.CmsCountry source, MappingHelper mappingHelper, AddFailure addFailure) + => CountryInfo.New(); + + protected override CountryInfo MapInternal(KX13M.CmsCountry source, CountryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.CountryName = source.CountryName; + target.CountryDisplayName = source.CountryDisplayName; + target.CountryGUID = source.CountryGuid; + target.CountryLastModified = source.CountryLastModified; + target.CountryThreeLetterCode = source.CountryThreeLetterCode; + target.CountryTwoLetterCode = source.CountryTwoLetterCode; + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/MediaFileInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/MediaFileInfoMapper.cs deleted file mode 100644 index fced1152..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/MediaFileInfoMapper.cs +++ /dev/null @@ -1,174 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using System.Data; -using CMS.Base; -using CMS.MediaLibrary; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Helpers; -using Migration.Toolkit.KX13.Models; -using Migration.Toolkit.KXP.Api; - -public record MediaFileInfoMapperSource(MediaFile MediaFile, int TargetLibraryId, IUploadedFile? File, string? LibrarySubFolder, - bool MigrateOnlyMediaFileInfo); - -public class MediaFileInfoMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly KxpClassFacade _classFacade; - private readonly IProtocol _protocol; - private readonly ToolkitConfiguration _toolkitConfiguration; - private readonly KeyMappingContext _keyMappingContext; - - public MediaFileInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - KxpClassFacade classFacade, - IProtocol protocol, - ToolkitConfiguration toolkitConfiguration, - KeyMappingContext keyMappingContext - ) : base(logger, primaryKeyMappingContext, protocol) - { - _logger = logger; - _classFacade = classFacade; - _protocol = protocol; - _toolkitConfiguration = toolkitConfiguration; - _keyMappingContext = keyMappingContext; - } - - - protected override MediaFileInfo? CreateNewInstance(MediaFileInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) - { - if (source.File != null) - { - var mf = new MediaFileInfo(source.File, source.TargetLibraryId, source.LibrarySubFolder ?? "", 0, 0, 0); - mf.SaveFileToDisk(true); - return mf; - } - - return new MediaFileInfo(); - } - - protected override MediaFileInfo MapInternal(MediaFileInfoMapperSource args, MediaFileInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (mediaFile, targetLibraryId, file, _, migrateOnlyMediaFileInfo) = args; - - target.FileName = mediaFile.FileName; - target.FileTitle = mediaFile.FileTitle; - target.FileDescription = mediaFile.FileDescription; - target.FileExtension = mediaFile.FileExtension; - target.FileMimeType = mediaFile.FileMimeType; - target.FileSize = mediaFile.FileSize; - target.FileImageWidth = mediaFile.FileImageWidth ?? 0; - target.FileImageHeight = mediaFile.FileImageHeight ?? 0; - target.FileGUID = mediaFile.FileGuid; - target.FileCreatedWhen = mediaFile.FileCreatedWhen; - target.FileModifiedWhen = mediaFile.FileModifiedWhen; - KenticoHelper.CopyCustomData(target.FileCustomData, mediaFile.FileCustomData); - - MigrateCustomizedFields(target, mediaFile); - - target.FileLibraryID = targetLibraryId; - - var targetCreatedMemberId = _keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - mediaFile.FileCreatedByUserId, - t => t.MemberId, - t => t.MemberGuid - ); - if (targetCreatedMemberId.Success) - { - // user was migrated to MEMBER => setting user would break foreign key - target.SetValue(nameof(target.FileCreatedByUserID), CMSActionContext.CurrentUser.UserID); - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.UserId, mediaFile.FileCreatedByUserId, out var createdByUserId)) - { - target.SetValue(nameof(target.FileCreatedByUserID), createdByUserId); - } - - var targetModifiedMemberId = _keyMappingContext.MapSourceKey( - s => s.UserId, - s => s.UserGuid, - mediaFile.FileModifiedByUserId, - t => t.MemberId, - t => t.MemberGuid - ); - if (targetModifiedMemberId.Success) - { - // user was migrated to MEMBER => setting user would break foreign key - target.SetValue(nameof(target.FileModifiedByUserID), CMSActionContext.CurrentUser.UserID); - } - else if (mappingHelper.TranslateIdAllowNulls(c => c.UserId, mediaFile.FileModifiedByUserId, out var modifiedByUserId)) - { - target.SetValue(nameof(target.FileModifiedByUserID), modifiedByUserId); - } - - if (string.IsNullOrWhiteSpace(target.FilePath)) - { - target.FilePath = mediaFile.FilePath; - } - - if (file == null && !migrateOnlyMediaFileInfo) - { - addFailure(HandbookReferences.MediaFileIsMissingOnSourceFilesystem - .WithId(nameof(mediaFile.FileId), mediaFile.FileId) - .WithData(new - { - mediaFile.FilePath, - mediaFile.FileGuid, - mediaFile.FileLibraryId, - mediaFile.FileSiteId - }) - .AsFailure() - ); - } - - return target; - } - - private void MigrateCustomizedFields(MediaFileInfo target, MediaFile mediaFile) - { - var customizedFields = _classFacade.GetCustomizedFieldInfos(MediaFileInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count <= 0) return; - - try - { - var query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {MediaFileInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {MediaFileInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(_toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", mediaFile.FileId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - _logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - _logger.LogError("Failed to load MediaFileInfo custom data from source database"); - } - } - catch (Exception ex) - { - _logger.LogError(ex, "Failed to load MediaFileInfo custom data from source database"); - } - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Mappers/MediaLibraryInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/MediaLibraryInfoMapper.cs deleted file mode 100644 index 6b11cc2f..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/MediaLibraryInfoMapper.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using CMS.MediaLibrary; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -public class MediaLibraryInfoMapper : EntityMapperBase -{ - public MediaLibraryInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override MediaLibraryInfo? CreateNewInstance(Toolkit.KX13.Models.MediaLibrary source, MappingHelper mappingHelper, AddFailure addFailure) => - MediaLibraryInfo.New(); - - protected override MediaLibraryInfo MapInternal(Toolkit.KX13.Models.MediaLibrary source, MediaLibraryInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - // Sets the library properties - target.LibraryDisplayName = source.LibraryDisplayName; - target.LibraryName = source.LibraryName; - target.LibraryDescription = source.LibraryDescription; - target.LibraryFolder = source.LibraryFolder; - target.LibraryGUID = mappingHelper.Require(source.LibraryGuid, nameof(source.LibraryGuid)); - target.LibraryDisplayName = source.LibraryDisplayName; - target.LibraryDescription = source.LibraryDescription; - - if (!target.LibraryFolder.StartsWith($"{source.LibrarySite.SiteName}_", StringComparison.InvariantCultureIgnoreCase)) - { - target.LibraryFolder = $"{source.LibrarySite.SiteName}_{source.LibraryFolder}"; - } - - target.LibraryLastModified = mappingHelper.Require(source.LibraryLastModified, nameof(source.LibraryLastModified)); - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs index 0087c754..fd0875e4 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/MemberInfoMapper.cs @@ -1,187 +1,190 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using System.Data; -using CMS.FormEngine; -using CMS.Membership; -using Microsoft.Data.SqlClient; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Api; - -public record MemberInfoMapperSource(KX13M.CmsUser User, KX13M.CmsUserSetting UserSetting); - -public class MemberInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration, - IDbContextFactory kx13DbContextFactory) - : EntityMapperBase(logger, primaryKeyMappingContext, protocol) -{ - protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - public static IReadOnlyList MigratedUserFields = new List - { - nameof(KX13M.CmsUser.UserGuid), - nameof(KX13M.CmsUser.UserName), - nameof(KX13M.CmsUser.Email), - // nameof(KX13M.CmsUser.UserPassword), - nameof(KX13M.CmsUser.UserEnabled), - nameof(KX13M.CmsUser.UserCreated), - nameof(KX13M.CmsUser.UserSecurityStamp), - }; - - protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - var (user, userSetting) = source; - - if (!newInstance && user.UserGuid != target.MemberGuid) - { - // assertion failed - logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - // target.UserName = source.UserName; - target.MemberName = user.UserName; - - // target.FirstName = source.FirstName; // TODO tomas.krch: 2023-04-11 configurable autocreate - // target.LastName = source.LastName; // TODO tomas.krch: 2023-04-11 configurable autocreate - - // target.Email = source.Email; - target.MemberEmail = user.Email; - - // target.SetValue("UserPassword", source.UserPassword); - target.MemberPassword = null; // source.UserPassword; // not migrated - - // target.UserEnabled = source.UserEnabled; - target.MemberEnabled = user.UserEnabled; - - target.SetValue("UserCreated", user.UserCreated); - target.MemberCreated = user.UserCreated.GetValueOrDefault(); - - // target.SetValue("LastLogon", source.LastLogon); // TODO tomas.krch: 2023-04-11 configurable autocreate - - // target.UserGUID = source.UserGuid; - target.MemberGuid = user.UserGuid; - - // target.UserLastModified = source.UserLastModified; // TODO tomas.krch: 2023-04-11 configurable autocreate - target.MemberSecurityStamp = user.UserSecurityStamp; // TODO tomas.krch: 2023-04-11 still relevant? - - // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // OBSOLETE: target.UserIsPendingRegistration = false; - // OBSOLETE: target.UserPasswordLastChanged = null; - // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - // TODO tomas.krch: 2023-04-11 migrate customized fields - var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); - foreach (var customizedFieldInfo in customized) - { - var fieldName = customizedFieldInfo.FieldName; - - if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out var value) || - ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) - { - target.SetValue(fieldName, value); - } - } - - using var kx13Context = kx13DbContextFactory.CreateDbContext(); - var uDci = kx13Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); - if (uDci != null) - { - var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); - if (userCustomizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.User.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - } - - var usDci = kx13Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_usersettings); - if (usDci != null) - { - var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); - if (userSettingsCustomizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; - - using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in userSettingsCustomizedFields) - { - logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - logger.LogError("Failed to load UserSettingsInfo custom data from source database"); - } - } - catch (Exception ex) - { - logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); - } - } - } - - - return target; - } -} \ No newline at end of file +using System.Data; + +using CMS.FormEngine; +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.Common.Helpers; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KX13.Context; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public record MemberInfoMapperSource(KX13M.CmsUser User, KX13M.CmsUserSetting UserSetting); + +public class MemberInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolkitConfiguration toolkitConfiguration, + IDbContextFactory kx13DbContextFactory) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + public static IReadOnlyList MigratedUserFields = new List + { + nameof(KX13M.CmsUser.UserGuid), + nameof(KX13M.CmsUser.UserName), + nameof(KX13M.CmsUser.Email), + // nameof(KX13M.CmsUser.UserPassword), + nameof(KX13M.CmsUser.UserEnabled), + nameof(KX13M.CmsUser.UserCreated), + nameof(KX13M.CmsUser.UserSecurityStamp) + }; + + protected override MemberInfo CreateNewInstance(MemberInfoMapperSource source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override MemberInfo MapInternal(MemberInfoMapperSource source, MemberInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + var (user, userSetting) = source; + + if (!newInstance && user.UserGuid != target.MemberGuid) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + // target.UserName = source.UserName; + target.MemberName = user.UserName; + + // target.FirstName = source.FirstName; // TODO tomas.krch: 2023-04-11 configurable autocreate + // target.LastName = source.LastName; // TODO tomas.krch: 2023-04-11 configurable autocreate + + // target.Email = source.Email; + target.MemberEmail = user.Email; + + // target.SetValue("UserPassword", source.UserPassword); + target.MemberPassword = null; // source.UserPassword; // not migrated + + // target.UserEnabled = source.UserEnabled; + target.MemberEnabled = user.UserEnabled; + + target.SetValue("UserCreated", user.UserCreated); + target.MemberCreated = user.UserCreated.GetValueOrDefault(); + + // target.SetValue("LastLogon", source.LastLogon); // TODO tomas.krch: 2023-04-11 configurable autocreate + + // target.UserGUID = source.UserGuid; + target.MemberGuid = user.UserGuid; + + // target.UserLastModified = source.UserLastModified; // TODO tomas.krch: 2023-04-11 configurable autocreate + target.MemberSecurityStamp = user.UserSecurityStamp; // TODO tomas.krch: 2023-04-11 still relevant? + + // OBSOLETE: target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // OBSOLETE: target.UserIsPendingRegistration = false; + // OBSOLETE: target.UserPasswordLastChanged = null; + // OBSOLETE: target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + // TODO tomas.krch: 2023-04-11 migrate customized fields + var customized = kxpClassFacade.GetCustomizedFieldInfosAll(MemberInfo.TYPEINFO.ObjectClassName); + foreach (var customizedFieldInfo in customized) + { + string fieldName = customizedFieldInfo.FieldName; + + if (ReflectionHelper.TryGetPropertyValue(user, fieldName, StringComparison.InvariantCultureIgnoreCase, out object? value) || + ReflectionHelper.TryGetPropertyValue(userSetting, fieldName, StringComparison.InvariantCultureIgnoreCase, out value)) + { + target.SetValue(fieldName, value); + } + } + + using var kx13Context = kx13DbContextFactory.CreateDbContext(); + var uDci = kx13Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_user); + if (uDci != null) + { + var userCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(uDci?.ClassFormDefinition)).ToList(); + if (userCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userCustomizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.User.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + } + + var usDci = kx13Context.CmsClasses.Select(x => new { x.ClassFormDefinition, x.ClassName, x.ClassTableName }).FirstOrDefault(x => x.ClassName == Kx13SystemClass.cms_usersettings); + if (usDci != null) + { + var userSettingsCustomizedFields = kxpClassFacade.GetCustomizedFieldInfos(new FormInfo(usDci?.ClassFormDefinition)).ToList(); + if (userSettingsCustomizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", userSettingsCustomizedFields.Select(x => x.FieldName))} FROM {usDci.ClassTableName} WHERE UserSettingsID = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserSetting.UserSettingsId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in userSettingsCustomizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserSettingsInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserSettingsInfo custom data from source database"); + } + } + } + + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs index 214737cd..7416c148 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/OmContactGroupMapper.cs @@ -1,35 +1,36 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactGroupMapper : EntityMapperBase -{ - public OmContactGroupMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override OmContactGroup? CreateNewInstance(Toolkit.KX13.Models.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override OmContactGroup MapInternal(Toolkit.KX13.Models.OmContactGroup source, OmContactGroup target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactGroupName = source.ContactGroupName; - target.ContactGroupDisplayName = source.ContactGroupDisplayName; - target.ContactGroupDescription = source.ContactGroupDescription; - target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; - target.ContactGroupEnabled = source.ContactGroupEnabled; - target.ContactGroupLastModified = source.ContactGroupLastModified; - target.ContactGroupGuid = source.ContactGroupGuid; - target.ContactGroupStatus = source.ContactGroupStatus; - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class OmContactGroupMapper : EntityMapperBase +{ + public OmContactGroupMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override OmContactGroup? CreateNewInstance(KX13M.OmContactGroup tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override OmContactGroup MapInternal(KX13M.OmContactGroup source, OmContactGroup target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactGroupName = source.ContactGroupName; + target.ContactGroupDisplayName = source.ContactGroupDisplayName; + target.ContactGroupDescription = source.ContactGroupDescription; + target.ContactGroupDynamicCondition = source.ContactGroupDynamicCondition; + target.ContactGroupEnabled = source.ContactGroupEnabled; + target.ContactGroupLastModified = source.ContactGroupLastModified; + target.ContactGroupGuid = source.ContactGroupGuid; + target.ContactGroupStatus = source.ContactGroupStatus; + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/OmContactMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/OmContactMapper.cs deleted file mode 100644 index 1b14b524..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/OmContactMapper.cs +++ /dev/null @@ -1,95 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly IEntityMapper _contactStatusMapper; - - public OmContactMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IEntityMapper contactStatusMapper, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - _logger = logger; - _contactStatusMapper = contactStatusMapper; - } - - protected override OmContact? CreateNewInstance(Toolkit.KX13.Models.OmContact tSourceEntity, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override OmContact MapInternal(Toolkit.KX13.Models.OmContact source, OmContact target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.ContactGuid != target.ContactGuid) - { - // assertion failed - _logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch"); - } - - // do not try to insert pk - // target.ContactId = source.ContactId; - target.ContactFirstName = source.ContactFirstName; - target.ContactMiddleName = source.ContactMiddleName; - target.ContactLastName = source.ContactLastName; - target.ContactJobTitle = source.ContactJobTitle; - target.ContactAddress1 = source.ContactAddress1; - target.ContactCity = source.ContactCity; - target.ContactZip = source.ContactZip; - target.ContactMobilePhone = source.ContactMobilePhone; - target.ContactBusinessPhone = source.ContactBusinessPhone; - target.ContactEmail = source.ContactEmail; - target.ContactBirthday = source.ContactBirthday; - target.ContactGender = source.ContactGender; - target.ContactNotes = source.ContactNotes; - target.ContactMonitored = source.ContactMonitored; - target.ContactGuid = source.ContactGuid; - target.ContactLastModified = source.ContactLastModified; - target.ContactCreated = source.ContactCreated; - target.ContactBounces = source.ContactBounces; - target.ContactCampaign = source.ContactCampaign; - target.ContactSalesForceLeadReplicationDisabled = source.ContactSalesForceLeadReplicationDisabled; - target.ContactSalesForceLeadReplicationDateTime = source.ContactSalesForceLeadReplicationDateTime; - target.ContactSalesForceLeadReplicationSuspensionDateTime = source.ContactSalesForceLeadReplicationSuspensionDateTime; - target.ContactCompanyName = source.ContactCompanyName; - target.ContactSalesForceLeadReplicationRequired = source.ContactSalesForceLeadReplicationRequired; - - // TODO tk: 2022-06-13 resolve migration of target.ContactStateId = _primaryKeyMappingContext.MapFromSource(u => u.StateId, source.ContactStateId); - // TODO tk: 2022-06-13 resolve migration of target.ContactCountryId = _primaryKeyMappingContext.MapFromSource(u => u.CountryId, source.ContactCountryId); - - if (source.ContactStatus != null) - { - switch (_contactStatusMapper.Map(source.ContactStatus, target.ContactStatus)) - { - case { Success: true } result: - { - target.ContactStatus = result.Item; - break; - } - case { Success: false } result: - { - addFailure(new MapperResultFailure(result?.HandbookReference)); - break; - } - } - } - else - { - target.ContactStatus = null; - } - - target.ContactSalesForceLeadId = source.ContactSalesForceLeadId; - if (mappingHelper.TranslateIdAllowNulls(u => u.UserId, source.ContactOwnerUserId, out var userId)) - { - target.ContactOwnerUserId = userId; - } - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs index bbd2076c..0ad2916a 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/OmContactStatusMapper.cs @@ -1,31 +1,32 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Models; - -public class OmContactStatusMapper : EntityMapperBase -{ - public OmContactStatusMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override OmContactStatus? CreateNewInstance(Toolkit.KX13.Models.OmContactStatus tSourceEntity, MappingHelper mappingHelper, - AddFailure addFailure) => new(); - - protected override OmContactStatus MapInternal(Toolkit.KX13.Models.OmContactStatus source, OmContactStatus target, bool newInstance, - MappingHelper mappingHelper, AddFailure addFailure) - { - target.ContactStatusName = source.ContactStatusName; - target.ContactStatusDisplayName = source.ContactStatusDisplayName; - target.ContactStatusDescription = source.ContactStatusDescription; - - return target; - } -} \ No newline at end of file +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class OmContactStatusMapper : EntityMapperBase +{ + public OmContactStatusMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override OmContactStatus? CreateNewInstance(KX13M.OmContactStatus tSourceEntity, MappingHelper mappingHelper, + AddFailure addFailure) => new(); + + protected override OmContactStatus MapInternal(KX13M.OmContactStatus source, OmContactStatus target, bool newInstance, + MappingHelper mappingHelper, AddFailure addFailure) + { + target.ContactStatusName = source.ContactStatusName; + target.ContactStatusDisplayName = source.ContactStatusDisplayName; + target.ContactStatusDescription = source.ContactStatusDescription; + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/PageTemplateConfigurationMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/PageTemplateConfigurationMapper.cs deleted file mode 100644 index 22286810..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/PageTemplateConfigurationMapper.cs +++ /dev/null @@ -1,223 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using AngleSharp.Text; -using CMS.MediaLibrary; -using CMS.Websites; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Common.Services.Ipc; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Services.CmsClass; -using Migration.Toolkit.KX13.Models; -using Migration.Toolkit.KXP.Api.Auxiliary; -using Migration.Toolkit.KXP.Api.Services.CmsClass; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -public class PageTemplateConfigurationMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly SourceInstanceContext _sourceInstanceContext; - - public PageTemplateConfigurationMapper( - ILogger logger, - PrimaryKeyMappingContext pkContext, - IProtocol protocol, - SourceInstanceContext sourceInstanceContext - ) : base(logger, pkContext, protocol) - { - _logger = logger; - _sourceInstanceContext = sourceInstanceContext; - } - - protected override PageTemplateConfigurationInfo? CreateNewInstance(CmsPageTemplateConfiguration source, MappingHelper mappingHelper, - AddFailure addFailure) - => PageTemplateConfigurationInfo.New(); - - protected override PageTemplateConfigurationInfo MapInternal(KX13M.CmsPageTemplateConfiguration source, PageTemplateConfigurationInfo target, - bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.PageTemplateConfigurationDescription = source.PageTemplateConfigurationDescription; - target.PageTemplateConfigurationName = source.PageTemplateConfigurationName; - target.PageTemplateConfigurationLastModified = source.PageTemplateConfigurationLastModified; - target.PageTemplateConfigurationIcon = "xp-custom-element"; // TODO tomas.krch: 2023-11-27 some better default icon pick? - - if (newInstance) - { - target.PageTemplateConfigurationGUID = source.PageTemplateConfigurationGuid; - } - - if (_sourceInstanceContext.HasInfo) - { - if (source.PageTemplateConfigurationTemplate != null) - { - var pageTemplateConfiguration = JsonConvert.DeserializeObject(source.PageTemplateConfigurationTemplate); - if (pageTemplateConfiguration?.Identifier != null) - { - _logger.LogTrace("Walk page template configuration {Identifier}", pageTemplateConfiguration.Identifier); - - - var pageTemplateConfigurationFcs = - _sourceInstanceContext.GetPageTemplateFormComponents(source.PageTemplateConfigurationSiteId, pageTemplateConfiguration.Identifier); - if (pageTemplateConfiguration.Properties is { Count: > 0 }) - { - WalkProperties(pageTemplateConfiguration.Properties, pageTemplateConfigurationFcs); - } - - target.PageTemplateConfigurationTemplate = JsonConvert.SerializeObject(pageTemplateConfiguration); - } - } - - if (source.PageTemplateConfigurationWidgets != null) - { - var areas = JsonConvert.DeserializeObject(source.PageTemplateConfigurationWidgets); - if (areas?.EditableAreas is { Count: > 0 }) - { - WalkAreas(source.PageTemplateConfigurationSiteId, areas.EditableAreas); - } - - target.PageTemplateConfigurationWidgets = JsonConvert.SerializeObject(areas); - } - } - else - { - // simply copy if no info is available - target.PageTemplateConfigurationTemplate = source.PageTemplateConfigurationTemplate; - target.PageTemplateConfigurationWidgets = source.PageTemplateConfigurationWidgets; - } - - return target; - } - - // TODO tk: 2022-09-14 move walker logic to separate class - #region "Page template & page widget walkers" - - private void WalkAreas(int siteId, List areas) - { - foreach (var area in areas) - { - _logger.LogTrace("Walk area {Identifier}", area.Identifier); - - if (area.Sections is { Count: > 0 }) - { - WalkSections(siteId, area.Sections); - } - } - } - - private void WalkSections(int siteId, List sections) - { - foreach (var section in sections) - { - _logger.LogTrace("Walk section {TypeIdentifier}|{Identifier}", section.TypeIdentifier, section.Identifier); - - var sectionFcs = _sourceInstanceContext.GetSectionFormComponents(siteId, section.TypeIdentifier); - WalkProperties(section.Properties, sectionFcs); - - if (section.Zones is { Count: > 0 }) - { - WalkZones(siteId, section.Zones); - } - } - } - - private void WalkZones(int siteId, List zones) - { - foreach (var zone in zones) - { - _logger.LogTrace("Walk zone {Name}|{Identifier}", zone.Name, zone.Identifier); - - if (zone.Widgets is { Count: > 0 }) - { - WalkWidgets(siteId, zone.Widgets); - } - } - } - - private void WalkWidgets(int siteId, List widgets) - { - foreach (var widget in widgets) - { - _logger.LogTrace("Walk widget {TypeIdentifier}|{Identifier}", widget.TypeIdentifier, widget.Identifier); - - var widgetFcs = _sourceInstanceContext.GetWidgetPropertyFormComponents(siteId, widget.TypeIdentifier); - foreach (var variant in widget.Variants) - { - _logger.LogTrace("Walk widget variant {Name}|{Identifier}", variant.Name, variant.Identifier); - - if (variant.Properties is { Count: > 0 }) - { - WalkProperties(variant.Properties, widgetFcs); - } - } - } - } - - private void WalkProperties(JObject properties, List? formControlModels) - { - foreach (var (key, value) in properties) - { - _logger.LogTrace("Walk property {Name}|{Identifier}", key, value?.ToString()); - - var editingFcm = formControlModels?.FirstOrDefault(x => x.PropertyName.Equals(key, StringComparison.InvariantCultureIgnoreCase)); - if (editingFcm != null) - { - if (FieldMappingInstance.BuiltInModel.NotSupportedInKxpLegacyMode - .SingleOrDefault(x => x.OldFormComponent == editingFcm.FormComponentIdentifier) is var (oldFormComponent, newFormComponent)) - { - Protocol.Append(HandbookReferences.FormComponentNotSupportedInLegacyMode(oldFormComponent, newFormComponent)); - _logger.LogTrace("Editing form component found {FormComponentName} => no longer supported {Replacement}", - editingFcm.FormComponentIdentifier, newFormComponent); - - switch (oldFormComponent) - { - case Kx13FormComponents.Kentico_AttachmentSelector when newFormComponent == FormComponents.AdminAssetSelectorComponent: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - properties[key] = JToken.FromObject(items.Select(x => new AssetRelatedItem - { - Identifier = x.FileGuid - }).ToList()); - } - - _logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); - break; - } - case Kx13FormComponents.Kentico_PageSelector when newFormComponent == FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent: - { - if (value?.ToObject>() is { Count: > 0 } items) - { - properties[key] = JToken.FromObject(items.Select(x => new WebPageRelatedItem - { - WebPageGuid = x.NodeGuid - }).ToList()); - } - - _logger.LogTrace("Value migrated from {Old} model to {New} model", oldFormComponent, newFormComponent); - break; - } - } - } - else if (FieldMappingInstance.BuiltInModel.SupportedInKxpLegacyMode.Contains(editingFcm.FormComponentIdentifier)) - { - // OK - _logger.LogTrace("Editing form component found {FormComponentName} => supported in legacy mode", - editingFcm.FormComponentIdentifier); - } - else - { - // unknown control, probably custom - Protocol.Append(HandbookReferences.FormComponentCustom(editingFcm.FormComponentIdentifier)); - _logger.LogTrace( - "Editing form component found {FormComponentName} => custom or inlined component, don't forget to migrate code accordingly", - editingFcm.FormComponentIdentifier); - } - } - } - } - - #endregion -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Mappers/ResourceMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/ResourceMapper.cs deleted file mode 100644 index 2af18813..00000000 --- a/Migration.Toolkit.Core.KX13/Mappers/ResourceMapper.cs +++ /dev/null @@ -1,52 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using CMS.Modules; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Models; - -public class ResourceMapper : EntityMapperBase -{ - private readonly ILogger _logger; - - public ResourceMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - _logger = logger; - } - - protected override ResourceInfo? CreateNewInstance(CmsResource source, MappingHelper mappingHelper, AddFailure addFailure) - => ResourceInfo.New(); - - protected override ResourceInfo MapInternal(CmsResource source, ResourceInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.ResourceDescription = source.ResourceDescription; - target.ResourceDisplayName = source.ResourceDisplayName; - target.ResourceGUID = source.ResourceGuid; - target.ResourceIsInDevelopment = false; // TODO tk: 2022-10-10 if true, module is not shown in UI of XbK - target.ResourceLastModified = source.ResourceLastModified; - target.ResourceName = source.ResourceName; - - if (target.ResourceName == Kx13SystemResource.Licenses) - { - target.ResourceName = XbkSystemResource.CMS_Licenses; - _logger.LogInformation("Patching CMS Resource 'Licences': name changed to '{ResourceNamePatched}'", XbkSystemResource.CMS_Licenses); - } - - if (!XbkSystemResource.All.Contains(target.ResourceName) || Kx13SystemResource.ConvertToNonSysResource.Contains(target.ResourceName)) - { - // custom resource - - if (target.ResourceName.StartsWith("CMS.", StringComparison.InvariantCultureIgnoreCase)) - { - var targetResourceNamePatched = target.ResourceName.Substring(4, target.ResourceName.Length - 4); - _logger.LogInformation("Patching CMS Resource '{ResourceName}': name changed to '{ResourceNamePatched}'", target.ResourceName, targetResourceNamePatched); - target.ResourceName = targetResourceNamePatched; - } - } - - return target; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs index 4b41239b..87312e87 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/RoleInfoMapper.cs @@ -1,30 +1,32 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using CMS.Membership; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -public class RoleInfoMapper : EntityMapperBase -{ - public RoleInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol - ) : base(logger, primaryKeyMappingContext, protocol) - { - } - - protected override RoleInfo? CreateNewInstance(Toolkit.KX13.Models.CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override RoleInfo MapInternal(Toolkit.KX13.Models.CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.RoleDisplayName = source.RoleDisplayName; - target.RoleName = source.RoleName; - target.RoleDescription = source.RoleDescription; - target.RoleGUID = source.RoleGuid; - target.RoleLastModified = source.RoleLastModified; - return target; - } -} \ No newline at end of file +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class RoleInfoMapper : EntityMapperBase +{ + public RoleInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol + ) : base(logger, primaryKeyMappingContext, protocol) + { + } + + protected override RoleInfo? CreateNewInstance(KX13M.CmsRole source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override RoleInfo MapInternal(KX13M.CmsRole source, RoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.RoleDisplayName = source.RoleDisplayName; + target.RoleName = source.RoleName; + target.RoleDescription = source.RoleDescription; + target.RoleGUID = source.RoleGuid; + target.RoleLastModified = source.RoleLastModified; + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs index 20b4505f..26ef9e68 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/StateInfoMapper.cs @@ -1,34 +1,35 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using CMS.Globalization; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Models; - -public class StateInfoMapper : EntityMapperBase -{ - public StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override StateInfo? CreateNewInstance(CmsState source, MappingHelper mappingHelper, AddFailure addFailure) - => StateInfo.New(); - - protected override StateInfo MapInternal(CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - target.StateName = source.StateName; - target.StateDisplayName = source.StateDisplayName; - target.StateLastModified = source.StateLastModified; - target.StateGUID = source.StateGuid; - target.StateCode = source.StateCode; - - if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out var countryId)) - { - target.CountryID = countryId; - } - - return target; - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class StateInfoMapper : EntityMapperBase +{ + public StateInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override StateInfo? CreateNewInstance(KX13M.CmsState source, MappingHelper mappingHelper, AddFailure addFailure) + => StateInfo.New(); + + protected override StateInfo MapInternal(KX13M.CmsState source, StateInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + target.StateName = source.StateName; + target.StateDisplayName = source.StateDisplayName; + target.StateLastModified = source.StateLastModified; + target.StateGUID = source.StateGuid; + target.StateCode = source.StateCode; + + if (mappingHelper.TranslateRequiredId(k => k.CountryId, source.CountryId, out int countryId)) + { + target.CountryID = countryId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs index e946d178..581852bd 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/UserInfoMapper.cs @@ -1,109 +1,101 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using System.Data; -using CMS.Membership; -using Microsoft.Data.SqlClient; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KXP.Api; - -public class UserInfoMapper : EntityMapperBase -{ - private readonly ILogger _logger; - private readonly KxpClassFacade _kxpClassFacade; - private readonly ToolkitConfiguration _toolkitConfiguration; - - public UserInfoMapper( - ILogger logger, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - KxpClassFacade kxpClassFacade, - ToolkitConfiguration toolkitConfiguration - ) : base(logger, primaryKeyMappingContext, protocol) - { - _logger = logger; - _kxpClassFacade = kxpClassFacade; - _toolkitConfiguration = toolkitConfiguration; - } - - protected override UserInfo CreateNewInstance(Toolkit.KX13.Models.CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); - - protected override UserInfo MapInternal(Toolkit.KX13.Models.CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (!newInstance && source.UserGuid != target.UserGUID) - { - // assertion failed - _logger.LogTrace("Assertion failed, entity key mismatch"); - throw new InvalidOperationException("Assertion failed, entity key mismatch."); - } - - target.UserName = source.UserName; - target.FirstName = source.FirstName; - target.LastName = source.LastName; - target.Email = source.Email; - // target.UserPassword = source.UserPassword; - target.SetValue("UserPassword", source.UserPassword); - target.UserEnabled = source.UserEnabled; - target.SetValue("UserCreated", source.UserCreated); - // target.UserCreated = source.UserCreated; - target.SetValue("LastLogon", source.LastLogon); - // target.LastLogon = source.LastLogon; - target.UserGUID = source.UserGuid; - target.UserLastModified = source.UserLastModified; - target.UserSecurityStamp = source.UserSecurityStamp; - - // TODO tk: 2022-05-18 deduced - check - target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; - // TODO tk: 2022-05-18 deduce info - target.UserIsPendingRegistration = false; - // TODO tk: 2022-05-18 deduce info - // target.UserPasswordLastChanged = null; - // TODO tk: 2022-05-18 deduce info - target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); - - var customizedFields = _kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); - if (customizedFields.Count > 0) - { - try - { - var query = - $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; - - using var conn = new SqlConnection(_toolkitConfiguration.KxConnectionString); - using var cmd = conn.CreateCommand(); - - cmd.CommandText = query; - cmd.CommandType = CommandType.Text; - cmd.CommandTimeout = 3; - cmd.Parameters.AddWithValue("id", source.UserId); - - conn.Open(); - - using var reader = cmd.ExecuteReader(); - if (reader.Read()) - { - foreach (var customizedFieldInfo in customizedFields) - { - _logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); - target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); - } - } - else - { - // failed! - _logger.LogError("Failed to load UserInfo custom data from source database"); - } - } - catch (Exception ex) - { - _logger.LogError(ex, "Failed to load UserInfo custom data from source database"); - } - } - - - return target; - } -} \ No newline at end of file +using System.Data; + +using CMS.Membership; + +using Microsoft.Data.SqlClient; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class UserInfoMapper( + ILogger logger, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + KxpClassFacade kxpClassFacade, + ToolkitConfiguration toolkitConfiguration) + : EntityMapperBase(logger, primaryKeyMappingContext, protocol) +{ + protected override UserInfo CreateNewInstance(KX13M.CmsUser source, MappingHelper mappingHelper, AddFailure addFailure) => new(); + + protected override UserInfo MapInternal(KX13M.CmsUser source, UserInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (!newInstance && source.UserGuid != target.UserGUID) + { + // assertion failed + logger.LogTrace("Assertion failed, entity key mismatch"); + throw new InvalidOperationException("Assertion failed, entity key mismatch."); + } + + target.UserName = source.UserName; + target.FirstName = source.FirstName; + target.LastName = source.LastName; + target.Email = source.Email; + // target.UserPassword = source.UserPassword; + target.SetValue("UserPassword", source.UserPassword); + target.UserEnabled = source.UserEnabled; + target.SetValue("UserCreated", source.UserCreated); + // target.UserCreated = source.UserCreated; + target.SetValue("LastLogon", source.LastLogon); + // target.LastLogon = source.LastLogon; + target.UserGUID = source.UserGuid; + target.UserLastModified = source.UserLastModified; + target.UserSecurityStamp = source.UserSecurityStamp; + + // TODO tk: 2022-05-18 deduced - check + target.UserAdministrationAccess = source.UserPrivilegeLevel == 3; + // TODO tk: 2022-05-18 deduce info + target.UserIsPendingRegistration = false; + // TODO tk: 2022-05-18 deduce info + // target.UserPasswordLastChanged = null; + // TODO tk: 2022-05-18 deduce info + target.UserRegistrationLinkExpiration = DateTime.Now.AddDays(365); + + var customizedFields = kxpClassFacade.GetCustomizedFieldInfos(UserInfo.TYPEINFO.ObjectClassName).ToList(); + if (customizedFields.Count > 0) + { + try + { + string query = + $"SELECT {string.Join(", ", customizedFields.Select(x => x.FieldName))} FROM {UserInfo.TYPEINFO.ClassStructureInfo.TableName} WHERE {UserInfo.TYPEINFO.ClassStructureInfo.IDColumn} = @id"; + + using var conn = new SqlConnection(toolkitConfiguration.KxConnectionString); + using var cmd = conn.CreateCommand(); + + cmd.CommandText = query; + cmd.CommandType = CommandType.Text; + cmd.CommandTimeout = 3; + cmd.Parameters.AddWithValue("id", source.UserId); + + conn.Open(); + + using var reader = cmd.ExecuteReader(); + if (reader.Read()) + { + foreach (var customizedFieldInfo in customizedFields) + { + logger.LogDebug("Map customized field '{FieldName}'", customizedFieldInfo.FieldName); + target.SetValue(customizedFieldInfo.FieldName, reader.GetValue(customizedFieldInfo.FieldName)); + } + } + else + { + // failed! + logger.LogError("Failed to load UserInfo custom data from source database"); + } + } + catch (Exception ex) + { + logger.LogError(ex, "Failed to load UserInfo custom data from source database"); + } + } + + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs b/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs index 5fd05810..fcb9e05f 100644 --- a/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs +++ b/Migration.Toolkit.Core.KX13/Mappers/UserRoleInfoMapper.cs @@ -1,32 +1,34 @@ -namespace Migration.Toolkit.Core.KX13.Mappers; - -using CMS.Membership; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; - -public class UserRoleInfoMapper : EntityMapperBase -{ - public UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) - { - } - - protected override UserRoleInfo? CreateNewInstance(KX13M.CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) - => UserRoleInfo.New(); - - protected override UserRoleInfo MapInternal(KX13M.CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) - { - if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out var xbkRoleId)) - { - target.RoleID = xbkRoleId; - } - - if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out var xbkUserId)) - { - target.UserID = xbkUserId; - } - - return target; - } -} \ No newline at end of file +using CMS.Membership; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; + +namespace Migration.Toolkit.Core.KX13.Mappers; + +public class UserRoleInfoMapper : EntityMapperBase +{ + public UserRoleInfoMapper(ILogger logger, PrimaryKeyMappingContext pkContext, IProtocol protocol) : base(logger, pkContext, protocol) + { + } + + protected override UserRoleInfo? CreateNewInstance(KX13M.CmsUserRole source, MappingHelper mappingHelper, AddFailure addFailure) + => UserRoleInfo.New(); + + protected override UserRoleInfo MapInternal(KX13M.CmsUserRole source, UserRoleInfo target, bool newInstance, MappingHelper mappingHelper, AddFailure addFailure) + { + if (mappingHelper.TranslateRequiredId(r => r.RoleId, source.RoleId, out int xbkRoleId)) + { + target.RoleID = xbkRoleId; + } + + if (mappingHelper.TranslateRequiredId(r => r.UserId, source.UserId, out int xbkUserId)) + { + target.UserID = xbkUserId; + } + + return target; + } +} diff --git a/Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.KX13.csproj b/Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.KX13.csproj index 1006cd68..de33abf0 100644 --- a/Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.KX13.csproj +++ b/Migration.Toolkit.Core.KX13/Migration.Toolkit.Core.KX13.csproj @@ -1,20 +1,19 @@ - Migration.Toolkit.Core.KX13 + Migration.Toolkit.Core.KX13 - + - - - + + diff --git a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs index a4667a0b..4baa9a43 100644 --- a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameProvider.cs @@ -1,47 +1,42 @@ -namespace Migration.Toolkit.Core.KX13.Providers; - -using System; -using System.Threading.Tasks; -using CMS.Base; -using CMS.ContentEngine.Internal; -using CMS.Helpers; - -internal class ContentItemNameProvider -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) - { - this.codeNameValidator = codeNameValidator; - } - - public Task Get(string name) - { - if (string.IsNullOrEmpty(name)) - { - throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); - } - - async Task Get(string name) - { - var codeName = ValidationHelper.GetCodeName(name, useUnicode: false); - - var isCodeNameValid = ValidationHelper.IsCodeName(codeName); - - if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) - { - codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); - } - - var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); - - return await uniqueCodeNameProvider.GetUniqueValue(codeName); - } - - return Get(name); - } -} \ No newline at end of file +using CMS.Base; +using CMS.ContentEngine.Internal; +using CMS.Helpers; + +namespace Migration.Toolkit.Core.KX13.Providers; + +internal class ContentItemNameProvider +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public ContentItemNameProvider(IContentItemNameValidator codeNameValidator) => this.codeNameValidator = codeNameValidator; + + public Task Get(string name) + { + if (string.IsNullOrEmpty(name)) + { + throw new ArgumentException($"'{nameof(name)}' cannot be null or empty.", nameof(name)); + } + + async Task Get(string name) + { + string codeName = ValidationHelper.GetCodeName(name, useUnicode: false); + + bool isCodeNameValid = ValidationHelper.IsCodeName(codeName); + + if (string.IsNullOrEmpty(codeName) || !isCodeNameValid) + { + codeName = TypeHelper.GetNiceName(ContentItemInfo.OBJECT_TYPE); + } + + var uniqueCodeNameProvider = new UniqueContentItemNameProvider(codeNameValidator); + + return await uniqueCodeNameProvider.GetUniqueValue(codeName); + } + + return Get(name); + } +} diff --git a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs index 01c80a2d..f55e5e7d 100644 --- a/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs +++ b/Migration.Toolkit.Core.KX13/Providers/ContentItemNameValidator.cs @@ -1,25 +1,18 @@ -namespace Migration.Toolkit.Core.KX13.Providers; - -using CMS.ContentEngine.Internal; - -internal class ContentItemNameValidator : IContentItemNameValidator -{ - /// - public bool IsUnique(string name) - { - return IsUnique(0, name); - } - - - /// - public bool IsUnique(int id, string name) - { - var contentItemInfo = new ContentItemInfo() - { - ContentItemID = id, - ContentItemName = name, - }; - - return contentItemInfo.CheckUniqueCodeName(); - } -} \ No newline at end of file +using CMS.ContentEngine.Internal; + +namespace Migration.Toolkit.Core.KX13.Providers; + +internal class ContentItemNameValidator : IContentItemNameValidator +{ + /// + public bool IsUnique(string name) => IsUnique(0, name); + + + /// + public bool IsUnique(int id, string name) + { + var contentItemInfo = new ContentItemInfo { ContentItemID = id, ContentItemName = name }; + + return contentItemInfo.CheckUniqueCodeName(); + } +} diff --git a/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs b/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs index aa814050..6e029e10 100644 --- a/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs +++ b/Migration.Toolkit.Core.KX13/Providers/UniqueContentItemNameProvider.cs @@ -1,48 +1,38 @@ -namespace Migration.Toolkit.Core.KX13.Providers; - -using System.Threading.Tasks; -using CMS.Base; -using CMS.ContentEngine.Internal; - -internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase -{ - private readonly IContentItemNameValidator codeNameValidator; - - - /// - /// Creates a new instance of . - /// - public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) - : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) - { - this.codeNameValidator = codeNameValidator; - } - - public override Task GetUniqueValue(string inputValue) - { - return base.GetUniqueValue(AddSuffix(inputValue)); - } - - - private string AddSuffix(string codeName) - { - var randomSuffix = GetRandomSuffix(); - var codeNameWithSuffix = codeName += randomSuffix; - - if (codeNameWithSuffix.Length > MaxLength) - { - var availableLength = MaxLength - randomSuffix.Length; - - codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; - } - - return codeNameWithSuffix; - } - - - /// - protected override Task IsValueUnique(string value) - { - return Task.FromResult(codeNameValidator.IsUnique(value)); - } -} \ No newline at end of file +using CMS.Base; +using CMS.ContentEngine.Internal; + +namespace Migration.Toolkit.Core.KX13.Providers; + +internal class UniqueContentItemNameProvider : UniqueStringValueProviderBase +{ + private readonly IContentItemNameValidator codeNameValidator; + + + /// + /// Creates a new instance of . + /// + public UniqueContentItemNameProvider(IContentItemNameValidator codeNameValidator) + : base(TypeHelper.GetMaxCodeNameLength(ContentItemInfo.TYPEINFO.MaxCodeNameLength)) => this.codeNameValidator = codeNameValidator; + + public override Task GetUniqueValue(string inputValue) => base.GetUniqueValue(AddSuffix(inputValue)); + + + private string AddSuffix(string codeName) + { + string randomSuffix = GetRandomSuffix(); + string codeNameWithSuffix = codeName += randomSuffix; + + if (codeNameWithSuffix.Length > MaxLength) + { + int availableLength = MaxLength - randomSuffix.Length; + + codeNameWithSuffix = $"{codeName[..availableLength]}{randomSuffix}"; + } + + return codeNameWithSuffix; + } + + + /// + protected override Task IsValueUnique(string value) => Task.FromResult(codeNameValidator.IsUnique(value)); +} diff --git a/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs b/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs index c1a00a2d..9f3e60dc 100644 --- a/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs +++ b/Migration.Toolkit.Core.KX13/Services/CmsClass/AttachmentSelectorItem.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Core.KX13.Services.CmsClass; - -using Newtonsoft.Json; - -/// Represents an item for the attachment selector. -public class AttachmentSelectorItem -{ - /// Attachment GUID. - [JsonProperty("fileGuid")] - public Guid FileGuid { get; set; } -} \ No newline at end of file +using Newtonsoft.Json; + +namespace Migration.Toolkit.Core.KX13.Services.CmsClass; + +/// Represents an item for the attachment selector. +public class AttachmentSelectorItem +{ + /// Attachment GUID. + [JsonProperty("fileGuid")] + public Guid FileGuid { get; set; } +} diff --git a/Migration.Toolkit.Core.KX13/Services/CmsClass/EditableAreasConfiguration.cs b/Migration.Toolkit.Core.KX13/Services/CmsClass/EditableAreasConfiguration.cs deleted file mode 100644 index b4c762ab..00000000 --- a/Migration.Toolkit.Core.KX13/Services/CmsClass/EditableAreasConfiguration.cs +++ /dev/null @@ -1,186 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Services.CmsClass; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -#region Copied from Kentico assembly - -[DataContract(Name = "Configuration", Namespace = "")] -public sealed class EditableAreasConfiguration -{ - /// Editable areas within the page. - [DataMember] - [JsonProperty("editableAreas")] - public List EditableAreas { get; private set; } - - /// - /// Creates an instance of class. - /// - public EditableAreasConfiguration() => this.EditableAreas = new List(); -} - -/// -/// Represents configuration of editable area within the instance. -/// -[DataContract(Name = "EditableArea", Namespace = "")] -public sealed class EditableAreaConfiguration -{ - /// Identifier of the editable area. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// Sections within editable area. - [DataMember] - [JsonProperty("sections")] - public List Sections { get; private set; } - - /// - /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. - /// - public bool AllowWidgetOutputCache { get; set; } - - /// - /// An absolute expiration date for the cached output of the individual widgets. - /// - public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } - - /// - /// The length of time from the first request to cache the output of the individual widgets. - /// - public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } - - /// - /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. - /// - public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } - - /// - /// Creates an instance of class. - /// - public EditableAreaConfiguration() => this.Sections = new List(); -} - -/// -/// Represents configuration of section within the instance. -/// -[DataContract(Name = "Section", Namespace = "")] -public sealed class SectionConfiguration -{ - /// Identifier of the section. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type section identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Section properties. - [DataMember] - [JsonProperty("properties")] - // public ISectionProperties Properties { get; set; } - public JObject? Properties { get; set; } - - /// Zones within the section. - [DataMember] - [JsonProperty("zones")] - public List Zones { get; private set; } - - /// - /// Creates an instance of class. - /// - public SectionConfiguration() => this.Zones = new List(); -} - -/// -/// Represents the zone within the configuration class. -/// -[DataContract(Name = "Zone", Namespace = "")] -public sealed class ZoneConfiguration -{ - /// Identifier of the widget zone. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Name of the widget zone. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// List of widgets within the zone. - [DataMember] - [JsonProperty("widgets")] - public List Widgets { get; private set; } - - /// - /// Creates an instance of class. - /// - public ZoneConfiguration() => this.Widgets = new List(); -} - -/// -/// Represents the configuration of a widget within the list. -/// -[DataContract(Name = "Widget", Namespace = "")] -public sealed class WidgetConfiguration -{ - /// Identifier of the widget instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type widget identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Personalization condition type identifier. - [DataMember] - [JsonProperty("conditionType")] - public string PersonalizationConditionTypeIdentifier { get; set; } - - /// List of widget variants. - [DataMember] - [JsonProperty("variants")] - public List Variants { get; set; } - - /// - /// Creates an instance of class. - /// - public WidgetConfiguration() => this.Variants = new List(); -} - -/// -/// Represents the configuration variant of a widget within the list. -/// -[DataContract(Name = "Variant", Namespace = "")] -public sealed class WidgetVariantConfiguration -{ - /// Identifier of the variant instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Widget variant name. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// Widget variant properties. - [DataMember] - [JsonProperty("properties")] - // public IWidgetProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Widget variant personalization condition type. - /// Only personalization condition type parameters are serialized to JSON. - [DataMember] - [JsonProperty("conditionTypeParameters")] - public JObject PersonalizationConditionType { get; set; } -} - -#endregion \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Services/CmsClass/PageSelectorItem.cs b/Migration.Toolkit.Core.KX13/Services/CmsClass/PageSelectorItem.cs deleted file mode 100644 index 5740175d..00000000 --- a/Migration.Toolkit.Core.KX13/Services/CmsClass/PageSelectorItem.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Services.CmsClass; - -using Newtonsoft.Json; - -/// Represents an item for a page selector. -public class PageSelectorItem -{ - /// Node Guid of a page. - [JsonProperty("nodeGuid")] - public Guid NodeGuid { get; set; } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Services/CmsClass/PageTemplateConfiguration.cs b/Migration.Toolkit.Core.KX13/Services/CmsClass/PageTemplateConfiguration.cs deleted file mode 100644 index 52be7651..00000000 --- a/Migration.Toolkit.Core.KX13/Services/CmsClass/PageTemplateConfiguration.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Services.CmsClass; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -/// -/// Page template configuration for the instance. -/// -[DataContract(Name = "PageTemplate", Namespace = "")] -public class PageTemplateConfiguration -{ - /// Identifier of the page template. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// - /// Identifier of the page template configuration based on which the page was created. - /// - [DataMember] - [JsonProperty("configurationIdentifier")] - public Guid ConfigurationIdentifier { get; set; } - - /// Page template properties. - [DataMember] - [JsonProperty("properties")] - public JObject Properties { get; set; } -} \ No newline at end of file diff --git a/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs b/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs index 5815c15f..f15da902 100644 --- a/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs +++ b/Migration.Toolkit.Core.KX13/Services/CountryMigrator.cs @@ -1,124 +1,104 @@ -namespace Migration.Toolkit.Core.KX13.Services; - -using CMS.Globalization; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Abstractions; -using Migration.Toolkit.Common.MigrationProtocol; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KX13.Models; -using Migration.Toolkit.KXP.Api; - -public class CountryMigrator -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kx13ContextFactory; - private readonly PrimaryKeyMappingContext _primaryKeyMappingContext; - private readonly IProtocol _protocol; - private readonly IEntityMapper _countryMapper; - private readonly IEntityMapper _stateMapper; - private readonly KxpApiInitializer _kxpApiInitializer; - - public CountryMigrator( - ILogger logger, - IDbContextFactory kx13ContextFactory, - ToolkitConfiguration toolkitConfiguration, - PrimaryKeyMappingContext primaryKeyMappingContext, - IProtocol protocol, - IEntityMapper countryMapper, - IEntityMapper stateMapper, - KxpApiInitializer kxpApiInitializer - ) - { - _logger = logger; - _kx13ContextFactory = kx13ContextFactory; - _primaryKeyMappingContext = primaryKeyMappingContext; - _protocol = protocol; - _countryMapper = countryMapper; - _stateMapper = stateMapper; - _kxpApiInitializer = kxpApiInitializer; - } - - public void MigrateCountriesAndStates() - { - if (!_kxpApiInitializer.EnsureApiIsInitialized()) - { - throw new InvalidOperationException($"Falied to initialize kentico API. Please check configuration."); - } - - var kx13Context = _kx13ContextFactory.CreateDbContext(); - - var kx13Countries = kx13Context.CmsCountries.AsNoTracking(); - foreach (var kx13CmsCountry in kx13Countries) - { - var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(kx13CmsCountry.CountryName); - - if (kxpCountryInfo != null) // do not update when exists - { - continue; - } - - var mapped = _countryMapper.Map(kx13CmsCountry, null); - _protocol.MappedTarget(mapped); - - if (mapped is (var countryInfo, var newInstance) { Success: true }) - { - try - { - CountryInfoProvider.ProviderObject.Set(countryInfo); - - _protocol.Success(kx13CmsCountry, countryInfo, mapped); - _logger.LogEntitySetAction(newInstance, countryInfo); - - _primaryKeyMappingContext.SetMapping(r => r.CountryId, kx13CmsCountry.CountryId, countryInfo.CountryID); - } - catch (Exception exception) - { - _logger.LogEntitySetError(exception, newInstance, countryInfo); - _protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(countryInfo) - ); - } - } - } - - - var kx13States = kx13Context.CmsStates.AsNoTracking(); - foreach (var kx13CmsState in kx13States) - { - var kxpStateInfo = StateInfoProvider.ProviderObject.Get(kx13CmsState.StateName); - - if (kxpStateInfo != null) // do not update when exists - { - continue; - } - - var mapped = _stateMapper.Map(kx13CmsState, null); - _protocol.MappedTarget(mapped); - - if (mapped is (var stateInfo, var newInstance) { Success: true }) - { - try - { - StateInfoProvider.ProviderObject.Set(stateInfo); - - _protocol.Success(kx13CmsState, stateInfo, mapped); - _logger.LogEntitySetAction(newInstance, stateInfo); - - _primaryKeyMappingContext.SetMapping(r => r.StateId, kx13CmsState.StateId, stateInfo.StateID); - } - catch (Exception exception) - { - _logger.LogEntitySetError(exception, newInstance, stateInfo); - _protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) - .NeedsManualAction() - .WithIdentityPrint(stateInfo) - ); - } - } - } - } -} \ No newline at end of file +using CMS.Globalization; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.Common.Abstractions; +using Migration.Toolkit.Common.MigrationProtocol; +using Migration.Toolkit.Core.KX13.Contexts; +using Migration.Toolkit.KX13.Context; +using Migration.Toolkit.KXP.Api; + +namespace Migration.Toolkit.Core.KX13.Services; + +public class CountryMigrator( + ILogger logger, + IDbContextFactory kx13ContextFactory, + PrimaryKeyMappingContext primaryKeyMappingContext, + IProtocol protocol, + IEntityMapper countryMapper, + IEntityMapper stateMapper, + KxpApiInitializer kxpApiInitializer) +{ + public void MigrateCountriesAndStates() + { + if (!kxpApiInitializer.EnsureApiIsInitialized()) + { + throw new InvalidOperationException("Falied to initialize kentico API. Please check configuration."); + } + + var kx13Context = kx13ContextFactory.CreateDbContext(); + + var kx13Countries = kx13Context.CmsCountries.AsNoTracking(); + foreach (var kx13CmsCountry in kx13Countries) + { + var kxpCountryInfo = CountryInfoProvider.ProviderObject.Get(kx13CmsCountry.CountryName); + + if (kxpCountryInfo != null) // do not update when exists + { + continue; + } + + var mapped = countryMapper.Map(kx13CmsCountry, null); + protocol.MappedTarget(mapped); + + if (mapped is (var countryInfo, var newInstance) { Success: true }) + { + try + { + CountryInfoProvider.ProviderObject.Set(countryInfo); + + protocol.Success(kx13CmsCountry, countryInfo, mapped); + logger.LogEntitySetAction(newInstance, countryInfo); + + primaryKeyMappingContext.SetMapping(r => r.CountryId, kx13CmsCountry.CountryId, countryInfo.CountryID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, countryInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(countryInfo) + ); + } + } + } + + + var kx13States = kx13Context.CmsStates.AsNoTracking(); + foreach (var kx13CmsState in kx13States) + { + var kxpStateInfo = StateInfoProvider.ProviderObject.Get(kx13CmsState.StateName); + + if (kxpStateInfo != null) // do not update when exists + { + continue; + } + + var mapped = stateMapper.Map(kx13CmsState, null); + protocol.MappedTarget(mapped); + + if (mapped is (var stateInfo, var newInstance) { Success: true }) + { + try + { + StateInfoProvider.ProviderObject.Set(stateInfo); + + protocol.Success(kx13CmsState, stateInfo, mapped); + logger.LogEntitySetAction(newInstance, stateInfo); + + primaryKeyMappingContext.SetMapping(r => r.StateId, kx13CmsState.StateId, stateInfo.StateID); + } + catch (Exception exception) + { + logger.LogEntitySetError(exception, newInstance, stateInfo); + protocol.Append(HandbookReferences.ErrorCreatingTargetInstance(exception) + .NeedsManualAction() + .WithIdentityPrint(stateInfo) + ); + } + } + } + } +} diff --git a/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs index e92620c7..614235e5 100644 --- a/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX13/Services/IPrimaryKeyLocatorService.cs @@ -1,11 +1,11 @@ -namespace Migration.Toolkit.Core.KX13.Services; - -using System.Linq.Expressions; - -public record SourceTargetKeyMapping(int SourceId, int TargetId); - -public interface IPrimaryKeyLocatorService -{ - bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); - IEnumerable SelectAll(Expression> keyNameSelector); -} \ No newline at end of file +using System.Linq.Expressions; + +namespace Migration.Toolkit.Core.KX13.Services; + +public record SourceTargetKeyMapping(int SourceId, int TargetId); + +public interface IPrimaryKeyLocatorService +{ + bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId); + IEnumerable SelectAll(Expression> keyNameSelector); +} diff --git a/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs index 0fed9fd0..bcf356fa 100644 --- a/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX13/Services/KeyLocatorService.cs @@ -1,122 +1,108 @@ -namespace Migration.Toolkit.Core.KX13.Services; - -using System.Linq.Expressions; -using System.Runtime.CompilerServices; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.KX13.Context; -using Migration.Toolkit.KXP.Context; - -public class KeyLocatorService -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _kx13ContextFactory; - - public KeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx13ContextFactory - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _kx13ContextFactory = kx13ContextFactory; - } - - public bool TryLocate( - Expression> sourceKeySelector, - Expression> targetKeySelector, - Expression> sourceGuidSelector, - Expression> targetGuidSelector, - object? sourceKey, out TTargetKey targetId - ) where TSource : class where TTarget : class - { - using var kxpContext = _kxpContextFactory.CreateDbContext(); - using var kx13Context = _kx13ContextFactory.CreateDbContext(); - - var sourceType = typeof(TSource); - Unsafe.SkipInit(out targetId); - - try - { - if (sourceKey is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - sourceKeySelector.Body, - Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); - var kx13Guid = kx13Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); - - var param = Expression.Parameter(typeof(TTarget), "t"); - var member = targetGuidSelector.Body as MemberExpression; - if (member == null) - { - throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); - } - var targetEquals = Expression.Equal( - Expression.MakeMemberAccess(param, member.Member), - Expression.Constant(kx13Guid, typeof(Guid)) - ); - var targetPredicate = Expression.Lambda>(targetEquals, param); - - var query = kxpContext.Set().Where(targetPredicate); - var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); - targetId = query.Select(selector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - _logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); - return false; - } - finally - { - if (!targetId?.Equals(default) ?? false) - { - _logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); - } - } - } - - public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) - where T : class - { - using var kx13Context = _kx13ContextFactory.CreateDbContext(); - - var type = typeof(T); - Unsafe.SkipInit(out guid); - - try - { - if (key is null) - { - return false; - } - - var sourceEquals = Expression.Equal( - keySelector.Body, - Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) - ); - var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); - guid = kx13Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); - return true; - } - catch (InvalidOperationException ioex) - { - _logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); - return false; - } - finally - { - if (!guid?.Equals(default) ?? false) - { - _logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); - } - } - } -} \ No newline at end of file +using System.Linq.Expressions; +using System.Runtime.CompilerServices; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.KX13.Context; +using Migration.Toolkit.KXP.Context; + +namespace Migration.Toolkit.Core.KX13.Services; + +public class KeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx13ContextFactory) +{ + public bool TryLocate( + Expression> sourceKeySelector, + Expression> targetKeySelector, + Expression> sourceGuidSelector, + Expression> targetGuidSelector, + object? sourceKey, out TTargetKey targetId + ) where TSource : class where TTarget : class + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx13Context = kx13ContextFactory.CreateDbContext(); + + var sourceType = typeof(TSource); + Unsafe.SkipInit(out targetId); + + try + { + if (sourceKey is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + sourceKeySelector.Body, + Expression.Convert(Expression.Constant(sourceKey, sourceKey.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, sourceKeySelector.Parameters[0]); + var kx13Guid = kx13Context.Set().Where(sourcePredicate).Select(sourceGuidSelector).Single(); + + var param = Expression.Parameter(typeof(TTarget), "t"); + var member = targetGuidSelector.Body as MemberExpression ?? throw new InvalidOperationException($"Expression SHALL NOT be other than member expression, expression: {targetGuidSelector}"); + var targetEquals = Expression.Equal( + Expression.MakeMemberAccess(param, member.Member), + Expression.Constant(kx13Guid, typeof(Guid)) + ); + var targetPredicate = Expression.Lambda>(targetEquals, param); + + var query = kxpContext.Set().Where(targetPredicate); + var selector = Expression.Lambda>(targetKeySelector.Body, targetKeySelector.Parameters[0]); + targetId = query.Select(selector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceKey, ioex.Message); + return false; + } + finally + { + if (!targetId?.Equals(default) ?? false) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceKey, targetId); + } + } + } + + public bool TryGetSourceGuid(Expression> keySelector, Expression> guidSelector, object? key, out Guid? guid) + where T : class + { + using var kx13Context = kx13ContextFactory.CreateDbContext(); + + var type = typeof(T); + Unsafe.SkipInit(out guid); + + try + { + if (key is null) + { + return false; + } + + var sourceEquals = Expression.Equal( + keySelector.Body, + Expression.Convert(Expression.Constant(key, key.GetType()), typeof(object)) + ); + var sourcePredicate = Expression.Lambda>(sourceEquals, keySelector.Parameters[0]); + guid = kx13Context.Set().Where(sourcePredicate).Select(guidSelector).Single(); + return true; + } + catch (InvalidOperationException ioex) + { + logger.LogWarning("Guid locator {SourceFullType} primary key: {Key} failed, {Message}", type.FullName, key, ioex.Message); + return false; + } + finally + { + if (!guid?.Equals(default) ?? false) + { + logger.LogTrace("Guid locator {SourceFullType} primary key: {Key} located {Guid}", type.FullName, key, guid); + } + } + } +} diff --git a/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs b/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs index f19f4595..bf93b7eb 100644 --- a/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs +++ b/Migration.Toolkit.Core.KX13/Services/PrimaryKeyLocatorService.cs @@ -1,260 +1,218 @@ -namespace Migration.Toolkit.Core.KX13.Services; - -using System.Linq.Expressions; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Services; -using Migration.Toolkit.KXP.Context; - -public class PrimaryKeyLocatorService : IPrimaryKeyLocatorService -{ - private readonly ILogger _logger; - private readonly IDbContextFactory _kxpContextFactory; - private readonly IDbContextFactory _kx13ContextFactory; - - public PrimaryKeyLocatorService( - ILogger logger, - IDbContextFactory kxpContextFactory, - IDbContextFactory kx13ContextFactory - ) - { - _logger = logger; - _kxpContextFactory = kxpContextFactory; - _kx13ContextFactory = kx13ContextFactory; - } - - private class KeyEqualityComparerWithLambda : IEqualityComparer - { - private readonly Func _equalityComparer; - - public KeyEqualityComparerWithLambda(Func equalityComparer) - { - _equalityComparer = equalityComparer; - } - - public bool Equals(T? x, T? y) => _equalityComparer.Invoke(x, y); - - public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; - } - - private record CmsUserKey(Guid UserGuid, string UserName); - - public IEnumerable SelectAll(Expression> keyNameSelector) - { - using var kxpContext = _kxpContextFactory.CreateDbContext(); - using var kx13Context = _kx13ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - var memberName = keyNameSelector.GetMemberName(); - - _logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); - - if (sourceType == typeof(Toolkit.KX13.Models.CmsUser) && memberName == nameof(KX13M.CmsUser.UserId)) - { - var sourceUsers = kx13Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); - var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); - - var result = sourceUsers.Join(targetUsers, - a => new CmsUserKey(a.UserGuid, a.UserName), - b => new CmsUserKey(b.UserGuid, b.UserName), - (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), - new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(Toolkit.KX13.Models.OmContact) && memberName == nameof(KX13M.OmContact.ContactId)) - { - var source = kx13Context.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - var target = kxpContext.OmContacts - .OrderBy(c => c.ContactCreated) - .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); - - var result = source.Join(target, - a => a.ContactGuid, - b => b.ContactGuid, - (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsTree) && memberName == nameof(KX13M.CmsTree.NodeId)) - { - var source = kx13Context.CmsTrees.Select(x => new { x.NodeId, x.NodeGuid }).ToList(); - var target = kxpContext.CmsChannels.Select(x => new { x.ChannelId, x.ChannelGuid }).ToList(); - - var result = source.Join(target, - a => a.NodeGuid, - b => b.ChannelGuid, - (a, b) => new SourceTargetKeyMapping(a.NodeId, b.ChannelId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsState) && memberName == nameof(KX13M.CmsState.StateId)) - { - var source = kx13Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); - - var result = source.Join(target, - a => a.StateName, - b => b.StateName, - (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsCountry) && memberName == nameof(KX13M.CmsCountry.CountryId)) - { - var source = kx13Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); - - var result = source.Join(target, - a => a.CountryName, - b => b.CountryName, - (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) - ); - - foreach (var resultingMapping in result) - { - yield return resultingMapping; - } - - yield break; - } - - throw new NotImplementedException(); - } - - public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) - { - using var kxpContext = _kxpContextFactory.CreateDbContext(); - using var kx13Context = _kx13ContextFactory.CreateDbContext(); - - var sourceType = typeof(T); - targetId = -1; - try - { - if (sourceType == typeof(KX13M.CmsResource)) - { - var kx13Guid = kx13Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); - targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == kx13Guid).Select(x => x.ResourceId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsClass)) - { - var kx13Guid = kx13Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); - targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == kx13Guid).Select(x => x.ClassId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsUser)) - { - var kx13User = kx13Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); - targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == kx13User.UserGuid || x.UserName == kx13User.UserName).Select(x => x.UserId).Single(); - return true; - } - - if (sourceType == typeof(KX13M.CmsRole)) - { - var kx13User = kx13Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); - targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == kx13User.RoleGuid).Select(x => x.RoleId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsSite)) - { - var kx13Guid = kx13Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); - targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == kx13Guid).Select(x => x.ChannelId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsState)) - { - var kx13CodeName = kx13Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); - targetId = kxpContext.CmsStates.Where(x => x.StateName == kx13CodeName).Select(x => x.StateId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsCountry)) - { - var kx13CodeName = kx13Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); - targetId = kxpContext.CmsCountries.Where(x => x.CountryName == kx13CodeName).Select(x => x.CountryId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.KX13.Models.OmContactStatus)) - { - var kx13Guid = kx13Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); - targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == kx13Guid).Select(x => x.ContactStatusId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.KX13.Models.OmContact)) - { - var kx13Guid = kx13Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); - targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == kx13Guid).Select(x => x.ContactId).Single(); - return true; - } - - if (sourceType == typeof(Toolkit.KX13.Models.CmsTree)) - { - // careful - cms.root will have different guid - var kx13Guid = kx13Context.CmsTrees.Where(c => c.NodeId == sourceId).Select(x => x.NodeGuid).Single(); - targetId = kxpContext.CmsWebPageItems.Where(x => x.WebPageItemGuid == kx13Guid).Select(x => x.WebPageItemId).Single(); - return true; - } - } - catch (InvalidOperationException ioex) - { - if (ioex.Message.StartsWith("Sequence contains no elements")) - { - _logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - else - { - _logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); - } - return false; - } - finally - { - if (targetId != -1) - { - _logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); - } - } - - _logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); - targetId = -1; - return false; - } -} \ No newline at end of file +using System.Linq.Expressions; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; +using Migration.Toolkit.KX13.Context; +using Migration.Toolkit.KXP.Context; + +namespace Migration.Toolkit.Core.KX13.Services; + +public class PrimaryKeyLocatorService( + ILogger logger, + IDbContextFactory kxpContextFactory, + IDbContextFactory kx13ContextFactory) + : IPrimaryKeyLocatorService +{ + public IEnumerable SelectAll(Expression> keyNameSelector) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx13Context = kx13ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + string memberName = keyNameSelector.GetMemberName(); + + logger.LogTrace("Preload of entity {Entity} member {MemberName} mapping requested", sourceType.Name, memberName); + + if (sourceType == typeof(KX13M.CmsUser) && memberName == nameof(KX13M.CmsUser.UserId)) + { + var sourceUsers = kx13Context.CmsUsers.Select(x => new { x.UserId, x.UserGuid, x.UserName }).ToList(); + var targetUsers = kxpContext.CmsUsers.Select(x => new { x.UserId, x.UserName, x.UserGuid }).ToList(); + + var result = sourceUsers.Join(targetUsers, + a => new CmsUserKey(a.UserGuid, a.UserName), + b => new CmsUserKey(b.UserGuid, b.UserName), + (a, b) => new SourceTargetKeyMapping(a.UserId, b.UserId), + new KeyEqualityComparerWithLambda((ak, bk) => (ak?.UserGuid == bk?.UserGuid || ak?.UserName == bk?.UserName) && ak != null && bk != null) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX13M.OmContact) && memberName == nameof(KX13M.OmContact.ContactId)) + { + var source = kx13Context.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + var target = kxpContext.OmContacts + .OrderBy(c => c.ContactCreated) + .Select(x => new { x.ContactId, x.ContactGuid }).ToList(); + + var result = source.Join(target, + a => a.ContactGuid, + b => b.ContactGuid, + (a, b) => new SourceTargetKeyMapping(a.ContactId, b.ContactId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX13M.CmsState) && memberName == nameof(KX13M.CmsState.StateId)) + { + var source = kx13Context.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + var target = kxpContext.CmsStates.Select(x => new { x.StateId, x.StateName }).ToList(); + + var result = source.Join(target, + a => a.StateName, + b => b.StateName, + (a, b) => new SourceTargetKeyMapping(a.StateId, b.StateId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + if (sourceType == typeof(KX13M.CmsCountry) && memberName == nameof(KX13M.CmsCountry.CountryId)) + { + var source = kx13Context.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + var target = kxpContext.CmsCountries.Select(x => new { x.CountryId, x.CountryName }).ToList(); + + var result = source.Join(target, + a => a.CountryName, + b => b.CountryName, + (a, b) => new SourceTargetKeyMapping(a.CountryId, b.CountryId) + ); + + foreach (var resultingMapping in result) + { + yield return resultingMapping; + } + + yield break; + } + + throw new NotImplementedException(); + } + + public bool TryLocate(Expression> keyNameSelector, int sourceId, out int targetId) + { + using var kxpContext = kxpContextFactory.CreateDbContext(); + using var kx13Context = kx13ContextFactory.CreateDbContext(); + + var sourceType = typeof(T); + targetId = -1; + try + { + if (sourceType == typeof(KX13M.CmsResource)) + { + var kx13Guid = kx13Context.CmsResources.Where(c => c.ResourceId == sourceId).Select(x => x.ResourceGuid).Single(); + targetId = kxpContext.CmsResources.Where(x => x.ResourceGuid == kx13Guid).Select(x => x.ResourceId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsClass)) + { + var kx13Guid = kx13Context.CmsClasses.Where(c => c.ClassId == sourceId).Select(x => x.ClassGuid).Single(); + targetId = kxpContext.CmsClasses.Where(x => x.ClassGuid == kx13Guid).Select(x => x.ClassId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsUser)) + { + var kx13User = kx13Context.CmsUsers.Where(c => c.UserId == sourceId).Select(x => new { x.UserGuid, x.UserName }).Single(); + targetId = kxpContext.CmsUsers.Where(x => x.UserGuid == kx13User.UserGuid || x.UserName == kx13User.UserName).Select(x => x.UserId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsRole)) + { + var kx13User = kx13Context.CmsRoles.Where(c => c.RoleId == sourceId).Select(x => new { x.RoleGuid }).Single(); + targetId = kxpContext.CmsRoles.Where(x => x.RoleGuid == kx13User.RoleGuid).Select(x => x.RoleId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsSite)) + { + var kx13Guid = kx13Context.CmsSites.Where(c => c.SiteId == sourceId).Select(x => x.SiteGuid).Single(); + targetId = kxpContext.CmsChannels.Where(x => x.ChannelGuid == kx13Guid).Select(x => x.ChannelId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsState)) + { + string kx13CodeName = kx13Context.CmsStates.Where(c => c.StateId == sourceId).Select(x => x.StateName).Single(); + targetId = kxpContext.CmsStates.Where(x => x.StateName == kx13CodeName).Select(x => x.StateId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.CmsCountry)) + { + string kx13CodeName = kx13Context.CmsCountries.Where(c => c.CountryId == sourceId).Select(x => x.CountryName).Single(); + targetId = kxpContext.CmsCountries.Where(x => x.CountryName == kx13CodeName).Select(x => x.CountryId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.OmContactStatus)) + { + string kx13Guid = kx13Context.OmContactStatuses.Where(c => c.ContactStatusId == sourceId).Select(x => x.ContactStatusName).Single(); + targetId = kxpContext.OmContactStatuses.Where(x => x.ContactStatusName == kx13Guid).Select(x => x.ContactStatusId).Single(); + return true; + } + + if (sourceType == typeof(KX13M.OmContact)) + { + var kx13Guid = kx13Context.OmContacts.Where(c => c.ContactId == sourceId).Select(x => x.ContactGuid).Single(); + targetId = kxpContext.OmContacts.Where(x => x.ContactGuid == kx13Guid).Select(x => x.ContactId).Single(); + return true; + } + } + catch (InvalidOperationException ioex) + { + if (ioex.Message.StartsWith("Sequence contains no elements")) + { + logger.LogDebug("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + else + { + logger.LogWarning("Mapping {SourceFullType} primary key: {SourceId} failed, {Message}", sourceType.FullName, sourceId, ioex.Message); + } + + return false; + } + finally + { + if (targetId != -1) + { + logger.LogTrace("Mapping {SourceFullType} primary key: {SourceId} to {TargetId}", sourceType.FullName, sourceId, targetId); + } + } + + logger.LogError("Mapping {SourceFullType} primary key is not supported", sourceType.FullName); + targetId = -1; + return false; + } + + private class KeyEqualityComparerWithLambda(Func equalityComparer) : IEqualityComparer + { + public bool Equals(T? x, T? y) => equalityComparer.Invoke(x, y); + + public int GetHashCode(T obj) => obj?.GetHashCode() ?? 0; + } + + private record CmsUserKey(Guid UserGuid, string UserName); +} diff --git a/Migration.Toolkit.Core.KX13/Services/TableReflectionService.cs b/Migration.Toolkit.Core.KX13/Services/TableReflectionService.cs deleted file mode 100644 index c58881ce..00000000 --- a/Migration.Toolkit.Core.KX13/Services/TableReflectionService.cs +++ /dev/null @@ -1,44 +0,0 @@ -namespace Migration.Toolkit.Core.KX13.Services; - -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common.Helpers; - -public class TableReflectionService -{ - private readonly ILogger _logger; - private readonly Dictionary _tableNameLookup; - - public TableReflectionService(ILogger logger) - { - _logger = logger; - var (_, tableNameLookup) = typeof(Toolkit.KX13.Context.KX13Context).Assembly.GetTypes().Aggregate(( - nameLookup: new Dictionary(), - tableNameLookup: new Dictionary() - ), (lookups, type) => - { - var rh = new ReflectionHelper(type); - - if (rh.GetFirstAttributeOrNull()?.Name is { } tableName && !string.IsNullOrWhiteSpace(tableName)) - { - lookups.tableNameLookup[tableName] = type; - lookups.nameLookup[type.Name] = type; - } - - return lookups; - }); - - this._tableNameLookup = tableNameLookup; - } - - public Type GetSourceTableTypeByTableName(string tableName) - { - if (!_tableNameLookup.ContainsKey(tableName)) - { - var joinedKeys = string.Join(", ", _tableNameLookup.Keys); - _logger.LogError("Invalid table name, use one of following: {TableNames}", joinedKeys); - throw new KeyNotFoundException($"Invalid table name, use one of following: {joinedKeys}"); - } - return _tableNameLookup[tableName]; - } -} \ No newline at end of file diff --git a/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs b/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs index a6c6af79..dd57923a 100644 --- a/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs +++ b/Migration.Toolkit.K11/Auxiliary/Kx13FormControls.cs @@ -1,233 +1,234 @@ -// ReSharper disable InconsistentNaming -namespace Migration.Toolkit.K11.Auxiliary; - -public class Kx12FormControls -{ - public class UserControlForText - { - public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; - public const string ActivityTypeSelector = "ActivityTypeSelector"; - public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; - public const string Selectalternativeform = "selectalternativeform"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string AssemblyClassSelector = "AssemblyClassSelector"; - public const string Fieldselector = "fieldselector"; - public const string BizFormSelector = "BizFormSelector"; - public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; - public const string CampaignSelector = "CampaignSelector"; - public const string CategorySelector = "CategorySelector"; - public const string ClassFieldSelector = "ClassFieldSelector"; - public const string ClassFields = "Class_fields"; - public const string CodeName = "CodeName"; - public const string CodeNameWithPrefix = "CodeNameWithPrefix"; - public const string Selectcolor = "selectcolor"; - public const string Columns = "Columns"; - public const string ConnectionStringSelector = "Connection_string_selector"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CountrySelector = "countrySelector"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectculture = "selectculture"; - public const string CultureSelectorForSettings = "CultureSelectorForSettings"; - public const string CurrencySelector = "currencySelector"; - public const string CustomTableItemSelector = "CustomTableItemSelector"; - public const string CustomTableSelector = "CustomTableSelector"; - public const string Selectcolumns = "selectcolumns"; - public const string DepartmentSelector = "DepartmentSelector"; - public const string DropDownListControl = "DropDownListControl"; - public const string DueDateSelector = "Due_date_selector"; - public const string Emailinput = "emailinput"; - public const string EmailTemplateSelector = "Email_template_selector"; - public const string EmailTemplateTypeSelector = "Email_template_type_selector"; - public const string EncodingTextBox = "EncodingTextBox"; - public const string EncryptedPassword = "EncryptedPassword"; - public const string EnumSelector = "EnumSelector"; - public const string EventLogTypeSelector = "EventLogTypeSelector"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string FontIconSelector = "FontIconSelector"; - public const string FormFieldSelector = "FormFieldSelector"; - public const string FormPassword = "FormPassword"; - public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; - public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; - public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; - public const string GoToExternalUrl = "Go_to_external_URL"; - public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; - public const string Html5Input = "HTML5Input"; - public const string IconSelector = "IconSelector"; - public const string InternalStatusSelector = "InternalStatusSelector"; - public const string Internationalphone = "internationalphone"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LicenseSelector = "LicenseSelector"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string ListBoxControl = "ListBoxControl"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; - public const string MacroAnyAllSelector = "MacroAnyAllSelector"; - public const string MacroDateOperator = "Macro_date_operator"; - public const string MacroEditor = "MacroEditor"; - public const string MacroEqualityOperator = "MacroEqualityOperator"; - public const string MacroNegationOperator = "MacroNegationOperator"; - public const string MacroNumericOperator = "Macro_numeric_operator"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MacroTextOperator = "Macro_text_operator"; - public const string MacroType = "MacroType"; - public const string ManufacturerSelector = "ManufacturerSelector"; - public const string MediaLibrarySelector = "MediaLibrarySelector"; - public const string MediaSelectionControl = "MediaSelectionControl"; - public const string MembershipSelector = "MembershipSelector"; - public const string MetafileUploaderControl = "MetafileUploaderControl"; - public const string ModuleSelector = "ModuleSelector"; - public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; - public const string MultipleChoiceControl = "MultipleChoiceControl"; - public const string RoleCheckboxSelector = "RoleCheckboxSelector"; - public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; - public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; - public const string MultipleUserSelector = "MultipleUserSelector"; - public const string NewsletterSelector = "NewsletterSelector"; - public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; - public const string NumericUpDown = "NumericUpDown"; - public const string ObjectColumnSelector = "ObjectColumnSelector"; - public const string ObjectSelector = "ObjectSelector"; - public const string ObjectTransformation = "ObjectTransformation"; - public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; - public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; - public const string OrderBy = "OrderBy"; - public const string OrderStatusSelector = "OrderStatusSelector"; - public const string DocumentCultureFilter = "DocumentCultureFilter"; - public const string PageLayoutCode = "Page_layout_code"; - public const string Selectdocument = "selectdocument"; - public const string PageTemplateLevels = "PageTemplateLevels"; - public const string Selectpagetemplate = "selectpagetemplate"; - public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; - public const string Selectclassnames = "selectclassnames"; - public const string Password = "Password"; - public const string PasswordStrength = "PasswordStrength"; - public const string PasswordConfirmator = "PasswordConfirmator"; - public const string Selectpath = "selectpath"; - public const string PaymentSelector = "paymentSelector"; - public const string ProductImageSelector = "ProductImageSelector"; - public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string ProductTypeSelector = "ProductTypeSelector"; - public const string PublicStatusSelector = "PublicStatusSelector"; - public const string Selectquery = "selectquery"; - public const string RadioButtonsControl = "RadioButtonsControl"; - public const string AgeRangeSelector = "AgeRangeSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string Relationshipconfiguration = "relationshipconfiguration"; - public const string SelectRelationshipName = "SelectRelationshipName"; - public const string ReportSelectorDropDown = "ReportSelectorDropDown"; - public const string RoleSelector = "RoleSelector"; - public const string SearchClassNameSelector = "SearchClassNameSelector"; - public const string SearchIndexSelector = "SearchIndexSelector"; - public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; - public const string SelectCmsVersion = "SelectCMSVersion"; - public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointListSelector = "SharePointListSelector"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string ShippingSelector = "shippingSelector"; - public const string ShippingServiceSelector = "ShippingServiceSelector"; - public const string Selectsinglepath = "selectsinglepath"; - public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; - public const string SiteContentCulture = "SiteContentCulture"; - public const string SiteCultureSelector = "SiteCultureSelector"; - public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; - public const string Selectsite = "selectsite"; - public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; - public const string SkuSelector = "SKUSelector"; - public const string StopWordsSelector = "StopWordsSelector"; - public const string SupplierSelector = "SupplierSelector"; - public const string SupportedCultureSelector = "SupportedCultureSelector"; - public const string TableConversionSettings = "TableConversionSettings"; - public const string TagGroupSelector = "TagGroupSelector"; - public const string TagSelector = "TagSelector"; - public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; - public const string TextboxDoubleValidator = "Textbox_double_validator"; - public const string TimeZoneSelector = "TimeZoneSelector"; - public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; - public const string ToggleButton = "ToggleButton"; - public const string Selecttransformation = "selecttransformation"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string Usphone = "usphone"; - public const string Uszipcode = "uszipcode"; - public const string UiCultureSelector = "UICultureSelector"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string UrlChecker = "UrlChecker"; - public const string UrlSelector = "URLSelector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string UserName = "UserName"; - public const string UserNameSelector = "UserNameSelector"; - public const string UserSelector = "UserSelector"; - public const string ValiditySelector = "ValiditySelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; - } - - public class UserControlForLongText - { - public const string AbTestConversionSelector = "ABTestConversionSelector"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string BbEditorControl = "BBEditorControl"; - public const string CacheDependencies = "CacheDependencies"; - public const string ClassFields = "Class_fields"; - public const string Columns = "Columns"; - public const string ConditionBuilder = "ConditionBuilder"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectcolumns = "selectcolumns"; - public const string DropDownListControl = "DropDownListControl"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string Html5Input = "HTML5Input"; - public const string AutoResizeConfiguration = "AutoResizeConfiguration"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroEditor = "MacroEditor"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionsSelector = "OptionsSelector"; - public const string OrderBy = "OrderBy"; - public const string PageLayoutCode = "Page_layout_code"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string ReportGraphSelector = "ReportGraphSelector"; - public const string ReportTableSelector = "ReportTableSelector"; - public const string ReportValueSelector = "ReportValueSelector"; - public const string HtmlAreaControl = "HtmlAreaControl"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string TagSelector = "TagSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - } -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.K11.Auxiliary; + +public class Kx12FormControls +{ + public class UserControlForText + { + public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; + public const string ActivityTypeSelector = "ActivityTypeSelector"; + public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; + public const string Selectalternativeform = "selectalternativeform"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string AssemblyClassSelector = "AssemblyClassSelector"; + public const string Fieldselector = "fieldselector"; + public const string BizFormSelector = "BizFormSelector"; + public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; + public const string CampaignSelector = "CampaignSelector"; + public const string CategorySelector = "CategorySelector"; + public const string ClassFieldSelector = "ClassFieldSelector"; + public const string ClassFields = "Class_fields"; + public const string CodeName = "CodeName"; + public const string CodeNameWithPrefix = "CodeNameWithPrefix"; + public const string Selectcolor = "selectcolor"; + public const string Columns = "Columns"; + public const string ConnectionStringSelector = "Connection_string_selector"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CountrySelector = "countrySelector"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectculture = "selectculture"; + public const string CultureSelectorForSettings = "CultureSelectorForSettings"; + public const string CurrencySelector = "currencySelector"; + public const string CustomTableItemSelector = "CustomTableItemSelector"; + public const string CustomTableSelector = "CustomTableSelector"; + public const string Selectcolumns = "selectcolumns"; + public const string DepartmentSelector = "DepartmentSelector"; + public const string DropDownListControl = "DropDownListControl"; + public const string DueDateSelector = "Due_date_selector"; + public const string Emailinput = "emailinput"; + public const string EmailTemplateSelector = "Email_template_selector"; + public const string EmailTemplateTypeSelector = "Email_template_type_selector"; + public const string EncodingTextBox = "EncodingTextBox"; + public const string EncryptedPassword = "EncryptedPassword"; + public const string EnumSelector = "EnumSelector"; + public const string EventLogTypeSelector = "EventLogTypeSelector"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string FontIconSelector = "FontIconSelector"; + public const string FormFieldSelector = "FormFieldSelector"; + public const string FormPassword = "FormPassword"; + public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; + public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; + public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; + public const string GoToExternalUrl = "Go_to_external_URL"; + public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; + public const string Html5Input = "HTML5Input"; + public const string IconSelector = "IconSelector"; + public const string InternalStatusSelector = "InternalStatusSelector"; + public const string Internationalphone = "internationalphone"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LicenseSelector = "LicenseSelector"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string ListBoxControl = "ListBoxControl"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; + public const string MacroAnyAllSelector = "MacroAnyAllSelector"; + public const string MacroDateOperator = "Macro_date_operator"; + public const string MacroEditor = "MacroEditor"; + public const string MacroEqualityOperator = "MacroEqualityOperator"; + public const string MacroNegationOperator = "MacroNegationOperator"; + public const string MacroNumericOperator = "Macro_numeric_operator"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MacroTextOperator = "Macro_text_operator"; + public const string MacroType = "MacroType"; + public const string ManufacturerSelector = "ManufacturerSelector"; + public const string MediaLibrarySelector = "MediaLibrarySelector"; + public const string MediaSelectionControl = "MediaSelectionControl"; + public const string MembershipSelector = "MembershipSelector"; + public const string MetafileUploaderControl = "MetafileUploaderControl"; + public const string ModuleSelector = "ModuleSelector"; + public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; + public const string MultipleChoiceControl = "MultipleChoiceControl"; + public const string RoleCheckboxSelector = "RoleCheckboxSelector"; + public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; + public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; + public const string MultipleUserSelector = "MultipleUserSelector"; + public const string NewsletterSelector = "NewsletterSelector"; + public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; + public const string NumericUpDown = "NumericUpDown"; + public const string ObjectColumnSelector = "ObjectColumnSelector"; + public const string ObjectSelector = "ObjectSelector"; + public const string ObjectTransformation = "ObjectTransformation"; + public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; + public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; + public const string OrderBy = "OrderBy"; + public const string OrderStatusSelector = "OrderStatusSelector"; + public const string DocumentCultureFilter = "DocumentCultureFilter"; + public const string PageLayoutCode = "Page_layout_code"; + public const string Selectdocument = "selectdocument"; + public const string PageTemplateLevels = "PageTemplateLevels"; + public const string Selectpagetemplate = "selectpagetemplate"; + public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; + public const string Selectclassnames = "selectclassnames"; + public const string Password = "Password"; + public const string PasswordStrength = "PasswordStrength"; + public const string PasswordConfirmator = "PasswordConfirmator"; + public const string Selectpath = "selectpath"; + public const string PaymentSelector = "paymentSelector"; + public const string ProductImageSelector = "ProductImageSelector"; + public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string ProductTypeSelector = "ProductTypeSelector"; + public const string PublicStatusSelector = "PublicStatusSelector"; + public const string Selectquery = "selectquery"; + public const string RadioButtonsControl = "RadioButtonsControl"; + public const string AgeRangeSelector = "AgeRangeSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string Relationshipconfiguration = "relationshipconfiguration"; + public const string SelectRelationshipName = "SelectRelationshipName"; + public const string ReportSelectorDropDown = "ReportSelectorDropDown"; + public const string RoleSelector = "RoleSelector"; + public const string SearchClassNameSelector = "SearchClassNameSelector"; + public const string SearchIndexSelector = "SearchIndexSelector"; + public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; + public const string SelectCmsVersion = "SelectCMSVersion"; + public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointListSelector = "SharePointListSelector"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string ShippingSelector = "shippingSelector"; + public const string ShippingServiceSelector = "ShippingServiceSelector"; + public const string Selectsinglepath = "selectsinglepath"; + public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; + public const string SiteContentCulture = "SiteContentCulture"; + public const string SiteCultureSelector = "SiteCultureSelector"; + public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; + public const string Selectsite = "selectsite"; + public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; + public const string SkuSelector = "SKUSelector"; + public const string StopWordsSelector = "StopWordsSelector"; + public const string SupplierSelector = "SupplierSelector"; + public const string SupportedCultureSelector = "SupportedCultureSelector"; + public const string TableConversionSettings = "TableConversionSettings"; + public const string TagGroupSelector = "TagGroupSelector"; + public const string TagSelector = "TagSelector"; + public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; + public const string TextboxDoubleValidator = "Textbox_double_validator"; + public const string TimeZoneSelector = "TimeZoneSelector"; + public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; + public const string ToggleButton = "ToggleButton"; + public const string Selecttransformation = "selecttransformation"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string Usphone = "usphone"; + public const string Uszipcode = "uszipcode"; + public const string UiCultureSelector = "UICultureSelector"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string UrlChecker = "UrlChecker"; + public const string UrlSelector = "URLSelector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string UserName = "UserName"; + public const string UserNameSelector = "UserNameSelector"; + public const string UserSelector = "UserSelector"; + public const string ValiditySelector = "ValiditySelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; + } + + public class UserControlForLongText + { + public const string AbTestConversionSelector = "ABTestConversionSelector"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string BbEditorControl = "BBEditorControl"; + public const string CacheDependencies = "CacheDependencies"; + public const string ClassFields = "Class_fields"; + public const string Columns = "Columns"; + public const string ConditionBuilder = "ConditionBuilder"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectcolumns = "selectcolumns"; + public const string DropDownListControl = "DropDownListControl"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string Html5Input = "HTML5Input"; + public const string AutoResizeConfiguration = "AutoResizeConfiguration"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroEditor = "MacroEditor"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionsSelector = "OptionsSelector"; + public const string OrderBy = "OrderBy"; + public const string PageLayoutCode = "Page_layout_code"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string ReportGraphSelector = "ReportGraphSelector"; + public const string ReportTableSelector = "ReportTableSelector"; + public const string ReportValueSelector = "ReportValueSelector"; + public const string HtmlAreaControl = "HtmlAreaControl"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string TagSelector = "TagSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + } +} diff --git a/Migration.Toolkit.K11/Context/K11Context.cs b/Migration.Toolkit.K11/Context/K11Context.cs index d52af77e..d1a1e893 100644 --- a/Migration.Toolkit.K11/Context/K11Context.cs +++ b/Migration.Toolkit.K11/Context/K11Context.cs @@ -1,5760 +1,5550 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.K11.Models; - -namespace Migration.Toolkit.K11; - -public partial class K11Context : DbContext -{ - public K11Context() - { - } - - public K11Context(DbContextOptions options) - : base(options) - { - } - - public virtual DbSet AnalyticsCampaigns { get; set; } - - public virtual DbSet AnalyticsCampaignAssets { get; set; } - - public virtual DbSet AnalyticsCampaignAssetUrls { get; set; } - - public virtual DbSet AnalyticsCampaignConversions { get; set; } - - public virtual DbSet AnalyticsCampaignConversionHits { get; set; } - - public virtual DbSet AnalyticsCampaignObjectives { get; set; } - - public virtual DbSet AnalyticsConversions { get; set; } - - public virtual DbSet AnalyticsDayHits { get; set; } - - public virtual DbSet AnalyticsExitPages { get; set; } - - public virtual DbSet AnalyticsHourHits { get; set; } - - public virtual DbSet AnalyticsMonthHits { get; set; } - - public virtual DbSet AnalyticsStatistics { get; set; } - - public virtual DbSet AnalyticsWeekHits { get; set; } - - public virtual DbSet AnalyticsYearHits { get; set; } - - public virtual DbSet BadWordsWords { get; set; } - - public virtual DbSet BlogComments { get; set; } - - public virtual DbSet BlogPostSubscriptions { get; set; } - - public virtual DbSet BoardBoards { get; set; } - - public virtual DbSet BoardMessages { get; set; } - - public virtual DbSet BoardSubscriptions { get; set; } - - public virtual DbSet ChatInitiatedChatRequests { get; set; } - - public virtual DbSet ChatMessages { get; set; } - - public virtual DbSet ChatNotifications { get; set; } - - public virtual DbSet ChatOnlineSupports { get; set; } - - public virtual DbSet ChatOnlineUsers { get; set; } - - public virtual DbSet ChatPopupWindowSettings { get; set; } - - public virtual DbSet ChatRooms { get; set; } - - public virtual DbSet ChatRoomUsers { get; set; } - - public virtual DbSet ChatSupportCannedResponses { get; set; } - - public virtual DbSet ChatSupportTakenRooms { get; set; } - - public virtual DbSet ChatUsers { get; set; } - - public virtual DbSet CiFileMetadata { get; set; } - - public virtual DbSet CiMigrations { get; set; } - - public virtual DbSet CmsAbuseReports { get; set; } - - public virtual DbSet CmsAcls { get; set; } - - public virtual DbSet CmsAclitems { get; set; } - - public virtual DbSet CmsAlternativeForms { get; set; } - - public virtual DbSet CmsAttachments { get; set; } - - public virtual DbSet CmsAttachmentHistories { get; set; } - - public virtual DbSet CmsAutomationHistories { get; set; } - - public virtual DbSet CmsAutomationStates { get; set; } - - public virtual DbSet CmsAvatars { get; set; } - - public virtual DbSet CmsBadges { get; set; } - - public virtual DbSet CmsBannedIps { get; set; } - - public virtual DbSet CmsBanners { get; set; } - - public virtual DbSet CmsBannerCategories { get; set; } - - public virtual DbSet CmsCategories { get; set; } - - public virtual DbSet CmsClasses { get; set; } - - public virtual DbSet CmsConsents { get; set; } - - public virtual DbSet CmsConsentAgreements { get; set; } - - public virtual DbSet CmsConsentArchives { get; set; } - - public virtual DbSet CmsCountries { get; set; } - - public virtual DbSet CmsCssStylesheets { get; set; } - - public virtual DbSet CmsCultures { get; set; } - - public virtual DbSet CmsDeviceProfiles { get; set; } - - public virtual DbSet CmsDeviceProfileLayouts { get; set; } - - public virtual DbSet CmsDocuments { get; set; } - - public virtual DbSet CmsDocumentAliases { get; set; } - - public virtual DbSet CmsDocumentTypeScopes { get; set; } - - public virtual DbSet CmsEmails { get; set; } - - public virtual DbSet CmsEmailAttachments { get; set; } - - public virtual DbSet CmsEmailTemplates { get; set; } - - public virtual DbSet CmsEmailUsers { get; set; } - - public virtual DbSet CmsEventLogs { get; set; } - - public virtual DbSet CmsExternalLogins { get; set; } - - public virtual DbSet CmsForms { get; set; } - - public virtual DbSet CmsFormUserControls { get; set; } - - public virtual DbSet CmsHelpTopics { get; set; } - - public virtual DbSet CmsLayouts { get; set; } - - public virtual DbSet CmsLicenseKeys { get; set; } - - public virtual DbSet CmsMacroIdentities { get; set; } - - public virtual DbSet CmsMacroRules { get; set; } - - public virtual DbSet CmsMemberships { get; set; } - - public virtual DbSet CmsMembershipUsers { get; set; } - - public virtual DbSet CmsMetaFiles { get; set; } - - public virtual DbSet CmsModuleLicenseKeys { get; set; } - - public virtual DbSet CmsModuleUsageCounters { get; set; } - - public virtual DbSet CmsObjectSettings { get; set; } - - public virtual DbSet CmsObjectVersionHistories { get; set; } - - public virtual DbSet CmsObjectWorkflowTriggers { get; set; } - - public virtual DbSet CmsOpenIdusers { get; set; } - - public virtual DbSet CmsPageTemplates { get; set; } - - public virtual DbSet CmsPageTemplateCategories { get; set; } - - public virtual DbSet CmsPageTemplateScopes { get; set; } - - public virtual DbSet CmsPermissions { get; set; } - - public virtual DbSet CmsPersonalizations { get; set; } - - public virtual DbSet CmsQueries { get; set; } - - public virtual DbSet CmsRelationships { get; set; } - - public virtual DbSet CmsRelationshipNames { get; set; } - - public virtual DbSet CmsResources { get; set; } - - public virtual DbSet CmsResourceLibraries { get; set; } - - public virtual DbSet CmsResourceStrings { get; set; } - - public virtual DbSet CmsResourceTranslations { get; set; } - - public virtual DbSet CmsRoles { get; set; } - - public virtual DbSet CmsScheduledTasks { get; set; } - - public virtual DbSet CmsSearchEngines { get; set; } - - public virtual DbSet CmsSearchIndices { get; set; } - - public virtual DbSet CmsSearchTasks { get; set; } - - public virtual DbSet CmsSearchTaskAzures { get; set; } - - public virtual DbSet CmsSessions { get; set; } - - public virtual DbSet CmsSettingsCategories { get; set; } - - public virtual DbSet CmsSettingsKeys { get; set; } - - public virtual DbSet CmsSites { get; set; } - - public virtual DbSet CmsSiteDomainAliases { get; set; } - - public virtual DbSet CmsSmtpservers { get; set; } - - public virtual DbSet CmsStates { get; set; } - - public virtual DbSet CmsTags { get; set; } - - public virtual DbSet CmsTagGroups { get; set; } - - public virtual DbSet CmsTemplateDeviceLayouts { get; set; } - - public virtual DbSet CmsTimeZones { get; set; } - - public virtual DbSet CmsTransformations { get; set; } - - public virtual DbSet CmsTranslationServices { get; set; } - - public virtual DbSet CmsTranslationSubmissions { get; set; } - - public virtual DbSet CmsTranslationSubmissionItems { get; set; } - - public virtual DbSet CmsTrees { get; set; } - - public virtual DbSet CmsUielements { get; set; } - - public virtual DbSet CmsUsers { get; set; } - - public virtual DbSet CmsUserCultures { get; set; } - - public virtual DbSet CmsUserMacroIdentities { get; set; } - - public virtual DbSet CmsUserRoles { get; set; } - - public virtual DbSet CmsUserSettings { get; set; } - - public virtual DbSet CmsUserSites { get; set; } - - public virtual DbSet CmsVersionHistories { get; set; } - - public virtual DbSet CmsWebFarmServers { get; set; } - - public virtual DbSet CmsWebFarmServerLogs { get; set; } - - public virtual DbSet CmsWebFarmServerMonitorings { get; set; } - - public virtual DbSet CmsWebFarmServerTasks { get; set; } - - public virtual DbSet CmsWebFarmTasks { get; set; } - - public virtual DbSet CmsWebParts { get; set; } - - public virtual DbSet CmsWebPartCategories { get; set; } - - public virtual DbSet CmsWebPartContainers { get; set; } - - public virtual DbSet CmsWebPartLayouts { get; set; } - - public virtual DbSet CmsWebTemplates { get; set; } - - public virtual DbSet CmsWidgets { get; set; } - - public virtual DbSet CmsWidgetCategories { get; set; } - - public virtual DbSet CmsWidgetRoles { get; set; } - - public virtual DbSet CmsWorkflows { get; set; } - - public virtual DbSet CmsWorkflowActions { get; set; } - - public virtual DbSet CmsWorkflowHistories { get; set; } - - public virtual DbSet CmsWorkflowScopes { get; set; } - - public virtual DbSet CmsWorkflowSteps { get; set; } - - public virtual DbSet CmsWorkflowStepRoles { get; set; } - - public virtual DbSet CmsWorkflowStepUsers { get; set; } - - public virtual DbSet CmsWorkflowTransitions { get; set; } - - public virtual DbSet ComAddresses { get; set; } - - public virtual DbSet ComBrands { get; set; } - - public virtual DbSet ComCarriers { get; set; } - - public virtual DbSet ComCollections { get; set; } - - public virtual DbSet ComCouponCodes { get; set; } - - public virtual DbSet ComCurrencies { get; set; } - - public virtual DbSet ComCurrencyExchangeRates { get; set; } - - public virtual DbSet ComCustomers { get; set; } - - public virtual DbSet ComCustomerCreditHistories { get; set; } - - public virtual DbSet ComDepartments { get; set; } - - public virtual DbSet ComDiscounts { get; set; } - - public virtual DbSet ComExchangeTables { get; set; } - - public virtual DbSet ComGiftCards { get; set; } - - public virtual DbSet ComGiftCardCouponCodes { get; set; } - - public virtual DbSet ComInternalStatuses { get; set; } - - public virtual DbSet ComManufacturers { get; set; } - - public virtual DbSet ComMultiBuyCouponCodes { get; set; } - - public virtual DbSet ComMultiBuyDiscounts { get; set; } - - public virtual DbSet ComMultiBuyDiscountBrands { get; set; } - - public virtual DbSet ComMultiBuyDiscountCollections { get; set; } - - public virtual DbSet ComMultiBuyDiscountTrees { get; set; } - - public virtual DbSet ComOptionCategories { get; set; } - - public virtual DbSet ComOrders { get; set; } - - public virtual DbSet ComOrderAddresses { get; set; } - - public virtual DbSet ComOrderItems { get; set; } - - public virtual DbSet ComOrderItemSkufiles { get; set; } - - public virtual DbSet ComOrderStatuses { get; set; } - - public virtual DbSet ComOrderStatusUsers { get; set; } - - public virtual DbSet ComPaymentOptions { get; set; } - - public virtual DbSet ComPublicStatuses { get; set; } - - public virtual DbSet ComShippingCosts { get; set; } - - public virtual DbSet ComShippingOptions { get; set; } - - public virtual DbSet ComShoppingCarts { get; set; } - - public virtual DbSet ComShoppingCartCouponCodes { get; set; } - - public virtual DbSet ComShoppingCartSkus { get; set; } - - public virtual DbSet ComSkus { get; set; } - - public virtual DbSet ComSkufiles { get; set; } - - public virtual DbSet ComSkuoptionCategories { get; set; } - - public virtual DbSet ComSuppliers { get; set; } - - public virtual DbSet ComTaxClasses { get; set; } - - public virtual DbSet ComTaxClassCountries { get; set; } - - public virtual DbSet ComTaxClassStates { get; set; } - - public virtual DbSet ComVolumeDiscounts { get; set; } - - public virtual DbSet ComWishlists { get; set; } - - public virtual DbSet CommunityFriends { get; set; } - - public virtual DbSet CommunityGroups { get; set; } - - public virtual DbSet CommunityGroupMembers { get; set; } - - public virtual DbSet CommunityGroupRolePermissions { get; set; } - - public virtual DbSet CommunityInvitations { get; set; } - - public virtual DbSet ContentArticles { get; set; } - - public virtual DbSet ContentBlogs { get; set; } - - public virtual DbSet ContentBlogMonths { get; set; } - - public virtual DbSet ContentBlogPosts { get; set; } - - public virtual DbSet ContentBookingEvents { get; set; } - - public virtual DbSet ContentCellphones { get; set; } - - public virtual DbSet ContentEbooks { get; set; } - - public virtual DbSet ContentEvents { get; set; } - - public virtual DbSet ContentFaqs { get; set; } - - public virtual DbSet ContentFiles { get; set; } - - public virtual DbSet ContentHeadlineBanners { get; set; } - - public virtual DbSet ContentImageGalleries { get; set; } - - public virtual DbSet ContentJobs { get; set; } - - public virtual DbSet ContentKbarticles { get; set; } - - public virtual DbSet ContentLaptops { get; set; } - - public virtual DbSet ContentMenuItems { get; set; } - - public virtual DbSet ContentNews { get; set; } - - public virtual DbSet ContentOffices { get; set; } - - public virtual DbSet ContentPressReleases { get; set; } - - public virtual DbSet ContentProducts { get; set; } - - public virtual DbSet ContentSimpleArticles { get; set; } - - public virtual DbSet ContentSmartphones { get; set; } - - public virtual DbSet ContentSoftwares { get; set; } - - public virtual DbSet CustomtableSampleTables { get; set; } - - public virtual DbSet DancingGoatArticles { get; set; } - - public virtual DbSet DancingGoatBrewers { get; set; } - - public virtual DbSet DancingGoatCaves { get; set; } - - public virtual DbSet DancingGoatCities { get; set; } - - public virtual DbSet DancingGoatCoffees { get; set; } - - public virtual DbSet DancingGoatEbooks { get; set; } - - public virtual DbSet DancingGoatElectricGrinders { get; set; } - - public virtual DbSet DancingGoatFilterPacks { get; set; } - - public virtual DbSet DancingGoatGrinders { get; set; } - - public virtual DbSet DancingGoatMemberships { get; set; } - - public virtual DbSet DancingGoatOffices { get; set; } - - public virtual DbSet DancingGoatPartnerCaves { get; set; } - - public virtual DbSet DancingGoatTablewares { get; set; } - - public virtual DbSet EcommerceCheckoutSteps { get; set; } - - public virtual DbSet EcommerceCheckoutWizards { get; set; } - - public virtual DbSet EventsAttendees { get; set; } - - public virtual DbSet ExportHistories { get; set; } - - public virtual DbSet ExportTasks { get; set; } - - public virtual DbSet FormContactUs { get; set; } - - public virtual DbSet FormDancingGoatBusinessCustomerRegistrations { get; set; } - - public virtual DbSet FormDancingGoatContactUs { get; set; } - - public virtual DbSet FormDancingGoatMachineRentals { get; set; } - - public virtual DbSet FormDancingGoatTryFreeSamples { get; set; } - - public virtual DbSet FormEcommerceSiteGeneralQuestions { get; set; } - - public virtual DbSet FormEcommerceSiteProductQuestions { get; set; } - - public virtual DbSet ForumsAttachments { get; set; } - - public virtual DbSet ForumsForums { get; set; } - - public virtual DbSet ForumsForumGroups { get; set; } - - public virtual DbSet ForumsForumPosts { get; set; } - - public virtual DbSet ForumsForumRoles { get; set; } - - public virtual DbSet ForumsForumSubscriptions { get; set; } - - public virtual DbSet ForumsUserFavorites { get; set; } - - public virtual DbSet IntegrationConnectors { get; set; } - - public virtual DbSet IntegrationSyncLogs { get; set; } - - public virtual DbSet IntegrationSynchronizations { get; set; } - - public virtual DbSet IntegrationTasks { get; set; } - - public virtual DbSet IntranetPortalDepartments { get; set; } - - public virtual DbSet IntranetPortalWorkingEnvironments { get; set; } - - public virtual DbSet MediaFiles { get; set; } - - public virtual DbSet MediaLibraries { get; set; } - - public virtual DbSet MediaLibraryRolePermissions { get; set; } - - public virtual DbSet MessagingMessages { get; set; } - - public virtual DbSet NewsletterAbtests { get; set; } - - public virtual DbSet NewsletterClickedLinks { get; set; } - - public virtual DbSet NewsletterEmails { get; set; } - - public virtual DbSet NewsletterEmailTemplates { get; set; } - - public virtual DbSet NewsletterEmailWidgets { get; set; } - - public virtual DbSet NewsletterEmailWidgetTemplates { get; set; } - - public virtual DbSet NewsletterIssueContactGroups { get; set; } - - public virtual DbSet NewsletterLinks { get; set; } - - public virtual DbSet NewsletterNewsletters { get; set; } - - public virtual DbSet NewsletterNewsletterIssues { get; set; } - - public virtual DbSet NewsletterOpenedEmails { get; set; } - - public virtual DbSet NewsletterSubscribers { get; set; } - - public virtual DbSet NewsletterSubscriberNewsletters { get; set; } - - public virtual DbSet NewsletterUnsubscriptions { get; set; } - - public virtual DbSet NotificationGateways { get; set; } - - public virtual DbSet NotificationSubscriptions { get; set; } - - public virtual DbSet NotificationTemplates { get; set; } - - public virtual DbSet NotificationTemplateTexts { get; set; } - - public virtual DbSet OmAbtests { get; set; } - - public virtual DbSet OmAbvariants { get; set; } - - public virtual DbSet OmAccounts { get; set; } - - public virtual DbSet OmAccountContacts { get; set; } - - public virtual DbSet OmAccountStatuses { get; set; } - - public virtual DbSet OmActivities { get; set; } - - public virtual DbSet OmActivityRecalculationQueues { get; set; } - - public virtual DbSet OmActivityTypes { get; set; } - - public virtual DbSet OmContacts { get; set; } - - public virtual DbSet OmContactChangeRecalculationQueues { get; set; } - - public virtual DbSet OmContactGroups { get; set; } - - public virtual DbSet OmContactGroupMembers { get; set; } - - public virtual DbSet OmContactRoles { get; set; } - - public virtual DbSet OmContactStatuses { get; set; } - - public virtual DbSet OmMemberships { get; set; } - - public virtual DbSet OmMvtcombinations { get; set; } - - public virtual DbSet OmMvtests { get; set; } - - public virtual DbSet OmMvtvariants { get; set; } - - public virtual DbSet OmPersonalizationVariants { get; set; } - - public virtual DbSet OmRules { get; set; } - - public virtual DbSet OmScores { get; set; } - - public virtual DbSet OmScoreContactRules { get; set; } - - public virtual DbSet OmVisitorToContacts { get; set; } - - public virtual DbSet PersonasPersonas { get; set; } - - public virtual DbSet PersonasPersonaContactHistories { get; set; } - - public virtual DbSet PersonasPersonaNodes { get; set; } - - public virtual DbSet PollsPolls { get; set; } - - public virtual DbSet PollsPollAnswers { get; set; } - - public virtual DbSet ReportingReports { get; set; } - - public virtual DbSet ReportingReportCategories { get; set; } - - public virtual DbSet ReportingReportGraphs { get; set; } - - public virtual DbSet ReportingReportSubscriptions { get; set; } - - public virtual DbSet ReportingReportTables { get; set; } - - public virtual DbSet ReportingReportValues { get; set; } - - public virtual DbSet ReportingSavedGraphs { get; set; } - - public virtual DbSet ReportingSavedReports { get; set; } - - public virtual DbSet SharePointSharePointConnections { get; set; } - - public virtual DbSet SharePointSharePointFiles { get; set; } - - public virtual DbSet SharePointSharePointLibraries { get; set; } - - public virtual DbSet SmFacebookAccounts { get; set; } - - public virtual DbSet SmFacebookApplications { get; set; } - - public virtual DbSet SmFacebookPosts { get; set; } - - public virtual DbSet SmInsights { get; set; } - - public virtual DbSet SmInsightHitDays { get; set; } - - public virtual DbSet SmInsightHitMonths { get; set; } - - public virtual DbSet SmInsightHitWeeks { get; set; } - - public virtual DbSet SmInsightHitYears { get; set; } - - public virtual DbSet SmLinkedInAccounts { get; set; } - - public virtual DbSet SmLinkedInApplications { get; set; } - - public virtual DbSet SmLinkedInPosts { get; set; } - - public virtual DbSet SmTwitterAccounts { get; set; } - - public virtual DbSet SmTwitterApplications { get; set; } - - public virtual DbSet SmTwitterPosts { get; set; } - - public virtual DbSet StagingServers { get; set; } - - public virtual DbSet StagingSynchronizations { get; set; } - - public virtual DbSet StagingTasks { get; set; } - - public virtual DbSet StagingTaskGroups { get; set; } - - public virtual DbSet StagingTaskGroupTasks { get; set; } - - public virtual DbSet StagingTaskGroupUsers { get; set; } - - public virtual DbSet StagingTaskUsers { get; set; } - - public virtual DbSet StorecontentBooks { get; set; } - - public virtual DbSet StorecontentCellPhones { get; set; } - - public virtual DbSet StorecontentComputers { get; set; } - - public virtual DbSet StorecontentCups { get; set; } - - public virtual DbSet StorecontentLaptops { get; set; } - - public virtual DbSet StorecontentMediaPlayers { get; set; } - - public virtual DbSet StorecontentPants { get; set; } - - public virtual DbSet StorecontentPerfumes { get; set; } - - public virtual DbSet StorecontentShoes { get; set; } - - public virtual DbSet StorecontentTablets { get; set; } - - public virtual DbSet StorecontentTshirts { get; set; } - - public virtual DbSet StorecontentTvs { get; set; } - - public virtual DbSet StorecontentWatches { get; set; } - - public virtual DbSet TempFiles { get; set; } - - public virtual DbSet ViewBoardsBoardMessageJoineds { get; set; } - - public virtual DbSet ViewCmsAclitemItemsAndOperators { get; set; } - - public virtual DbSet ViewCmsObjectVersionHistoryUserJoineds { get; set; } - - public virtual DbSet ViewCmsPageTemplateCategoryPageTemplateJoineds { get; set; } - - public virtual DbSet ViewCmsRelationshipJoineds { get; set; } - - public virtual DbSet ViewCmsResourceStringJoineds { get; set; } - - public virtual DbSet ViewCmsResourceTranslatedJoineds { get; set; } - - public virtual DbSet ViewCmsRoleResourcePermissionJoineds { get; set; } - - public virtual DbSet ViewCmsSiteDocumentCounts { get; set; } - - public virtual DbSet ViewCmsSiteRoleResourceUielementJoineds { get; set; } - - public virtual DbSet ViewCmsTreeJoineds { get; set; } - - public virtual DbSet ViewCmsUsers { get; set; } - - public virtual DbSet ViewCmsUserDocuments { get; set; } - - public virtual DbSet ViewCmsUserRoleJoineds { get; set; } - - public virtual DbSet ViewCmsUserRoleMembershipRoles { get; set; } - - public virtual DbSet ViewCmsUserRoleMembershipRoleValidOnlyJoineds { get; set; } - - public virtual DbSet ViewCmsUserSettingsRoleJoineds { get; set; } - - public virtual DbSet ViewCmsWebPartCategoryWebpartJoineds { get; set; } - - public virtual DbSet ViewCmsWidgetCategoryWidgetJoineds { get; set; } - - public virtual DbSet ViewComSkuoptionCategoryOptionCategoryJoineds { get; set; } - - public virtual DbSet ViewCommunityFriendFriends { get; set; } - - public virtual DbSet ViewCommunityFriendRequestedFriends { get; set; } - - public virtual DbSet ViewCommunityGroups { get; set; } - - public virtual DbSet ViewCommunityMembers { get; set; } - - public virtual DbSet ViewForumsGroupForumPostJoineds { get; set; } - - public virtual DbSet ViewIntegrationTaskJoineds { get; set; } - - public virtual DbSet ViewMembershipMembershipUserJoineds { get; set; } - - public virtual DbSet ViewMessagingContactLists { get; set; } - - public virtual DbSet ViewMessagingIgnoreLists { get; set; } - - public virtual DbSet ViewNewsletterSubscriptionsJoineds { get; set; } - - public virtual DbSet ViewOmAccountContactAccountJoineds { get; set; } - - public virtual DbSet ViewOmAccountContactContactJoineds { get; set; } - - public virtual DbSet ViewOmAccountJoineds { get; set; } - - public virtual DbSet ViewOmContactGroupMemberAccountJoineds { get; set; } - - public virtual DbSet ViewOmContactGroupMemberContactJoineds { get; set; } - - public virtual DbSet ViewPollAnswerCounts { get; set; } - - public virtual DbSet ViewReportingCategoryReportJoineds { get; set; } - - - - - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CampaignName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CampaignScheduledTask).WithMany(p => p.AnalyticsCampaigns).HasConstraintName("FK_Analytics_Campaign_CampaignScheduledTaskID_ScheduledTask"); - - entity.HasOne(d => d.CampaignSite).WithMany(p => p.AnalyticsCampaigns) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_Campaign_StatisticsSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignAssetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CampaignAssetType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignAssetCampaign).WithMany(p => p.AnalyticsCampaignAssets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignAsset_CampaignAssetCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignAssetUrlPageTitle).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignAssetUrlTarget).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignAssetUrlCampaignAsset).WithMany(p => p.AnalyticsCampaignAssetUrls) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID_Analytics_CampaignAsset"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignConversionActivityType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignConversionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignConversionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CampaignConversionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignConversionCampaign).WithMany(p => p.AnalyticsCampaignConversions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignConversion_CampaignConversionCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignConversionHitsSourceName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignConversionHitsConversion).WithMany(p => p.AnalyticsCampaignConversionHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID_Analytics_CampaignConversion"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignObjectiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.CampaignObjectiveCampaignConversion).WithMany(p => p.AnalyticsCampaignObjectives) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID_Analytics_CampaignConversion"); - - entity.HasOne(d => d.CampaignObjectiveCampaign).WithOne(p => p.AnalyticsCampaignObjective) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ConversionId).HasName("PK_CMS_Conversion"); - - entity.HasOne(d => d.ConversionSite).WithMany(p => p.AnalyticsConversions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_Conversion_ConversionSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_DayHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsDayHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_DayHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_HourHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsHourHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_HourHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_MonthHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsMonthHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_MonthHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StatisticsId).IsClustered(false); - - entity.HasIndex(e => e.StatisticsCode, "IX_Analytics_Statistics_StatisticsCode_StatisticsSiteID_StatisticsObjectID_StatisticsObjectCulture").IsClustered(); - - entity.Property(e => e.StatisticsCode).HasDefaultValueSql("('')"); - entity.Property(e => e.StatisticsObjectCulture).HasDefaultValueSql("(N'')"); - entity.Property(e => e.StatisticsObjectName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.StatisticsSite).WithMany(p => p.AnalyticsStatistics).HasConstraintName("FK_Analytics_Statistics_StatisticsSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_WeekHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsWeekHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_WeekHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_YearHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsYearHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_YearHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WordId).IsClustered(false); - - entity.HasIndex(e => e.WordExpression, "IX_BadWords_Word_WordExpression").IsClustered(); - - entity.Property(e => e.WordExpression).HasDefaultValueSql("(N'')"); - - entity.HasMany(d => d.Cultures).WithMany(p => p.Words) - .UsingEntity>( - "BadWordsWordCulture", - r => r.HasOne().WithMany() - .HasForeignKey("CultureId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_BadWords_WordCulture_CultureID_CMS_Culture"), - l => l.HasOne().WithMany() - .HasForeignKey("WordId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_BadWords_WordCulture_WordID_BadWords_Word"), - j => - { - j.HasKey("WordId", "CultureId"); - j.ToTable("BadWords_WordCulture"); - j.HasIndex(new[] { "CultureId" }, "IX_BadWords_WordCulture_CultureID"); - j.IndexerProperty("WordId").HasColumnName("WordID"); - j.IndexerProperty("CultureId").HasColumnName("CultureID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CommentId).IsClustered(false); - - entity.HasIndex(e => e.CommentDate, "IX_Blog_Comment_CommentDate") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.CommentApproved).HasDefaultValueSql("((0))"); - entity.Property(e => e.CommentIsSpam).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CommentApprovedByUser).WithMany(p => p.BlogCommentCommentApprovedByUsers).HasConstraintName("FK_Blog_Comment_CommentApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.CommentPostDocument).WithMany(p => p.BlogComments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Blog_Comment_CommentPostDocumentID_CMS_Document"); - - entity.HasOne(d => d.CommentUser).WithMany(p => p.BlogCommentCommentUsers).HasConstraintName("FK_Blog_Comment_CommentUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SubscriptionPostDocument).WithMany(p => p.BlogPostSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Blog_PostSubscription_SubscriptionPostDocumentID_CMS_Document"); - - entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.BlogPostSubscriptions).HasConstraintName("FK_Blog_PostSubscription_SubscriptionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BoardName).HasDefaultValueSql("('')"); - entity.Property(e => e.BoardRequireEmails).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.BoardDocument).WithMany(p => p.BoardBoards) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Board_BoardDocumentID_CMS_Document"); - - entity.HasOne(d => d.BoardGroup).WithMany(p => p.BoardBoards).HasConstraintName("FK_Board_Board_BoardGroupID_Community_Group"); - - entity.HasOne(d => d.BoardSite).WithMany(p => p.BoardBoards) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Board_BoardSiteID_CMS_Site"); - - entity.HasOne(d => d.BoardUser).WithMany(p => p.BoardBoards).HasConstraintName("FK_Board_Board_BoardUserID_CMS_User"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Boards) - .UsingEntity>( - "BoardRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Role_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("BoardId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Role_BoardID_Board_Board"), - j => - { - j.HasKey("BoardId", "RoleId"); - j.ToTable("Board_Role"); - j.HasIndex(new[] { "RoleId" }, "IX_Board_Role_RoleID"); - j.IndexerProperty("BoardId").HasColumnName("BoardID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - - entity.HasMany(d => d.Users).WithMany(p => p.Boards) - .UsingEntity>( - "BoardModerator", - r => r.HasOne().WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Moderator_UserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("BoardId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Moderator_BoardID_Board_Board"), - j => - { - j.HasKey("BoardId", "UserId"); - j.ToTable("Board_Moderator"); - j.HasIndex(new[] { "UserId" }, "IX_Board_Moderator_UserID"); - j.IndexerProperty("BoardId").HasColumnName("BoardID"); - j.IndexerProperty("UserId").HasColumnName("UserID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MessageId).IsClustered(false); - - entity.HasIndex(e => e.MessageInserted, "IX_Board_Message_MessageInserted") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.MessageEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MessageInserted).HasDefaultValueSql("('8/26/2008 12:14:50 PM')"); - entity.Property(e => e.MessageLastModified).HasDefaultValueSql("('8/26/2008 12:15:04 PM')"); - entity.Property(e => e.MessageText).HasDefaultValueSql("('')"); - entity.Property(e => e.MessageUrl).HasDefaultValueSql("('')"); - entity.Property(e => e.MessageUserInfo).HasDefaultValueSql("('')"); - entity.Property(e => e.MessageUserName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.MessageApprovedByUser).WithMany(p => p.BoardMessageMessageApprovedByUsers).HasConstraintName("FK_Board_Message_MessageApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.MessageBoard).WithMany(p => p.BoardMessagesNavigation) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Message_MessageBoardID_Board_Board"); - - entity.HasOne(d => d.MessageUser).WithMany(p => p.BoardMessageMessageUsers).HasConstraintName("FK_Board_Message_MessageUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubscriptionEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SubscriptionBoard).WithMany(p => p.BoardSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Subscription_SubscriptionBoardID_Board_Board"); - - entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.BoardSubscriptions).HasConstraintName("FK_Board_Subscription_SubscriptionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.InitiatedChatRequestState).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.InitiatedChatRequestInitiatorChatUser).WithMany(p => p.ChatInitiatedChatRequests) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_InitiatedChatRequest_Chat_User"); - - entity.HasOne(d => d.InitiatedChatRequestRoom).WithOne(p => p.ChatInitiatedChatRequest) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_InitiatedChatRequest_Chat_Room"); - - entity.HasOne(d => d.InitiatedChatRequestUser).WithMany(p => p.ChatInitiatedChatRequests).HasConstraintName("FK_Chat_InitiatedChatRequest_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatMessageId).HasName("PK_CMS_ChatMessage"); - - entity.Property(e => e.ChatMessageCreatedWhen).HasDefaultValueSql("('7/25/2011 2:47:18 PM')"); - entity.Property(e => e.ChatMessageIpaddress).HasDefaultValueSql("('')"); - entity.Property(e => e.ChatMessageLastModified).HasDefaultValueSql("('8/3/2011 11:24:54 AM')"); - entity.Property(e => e.ChatMessageText).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ChatMessageRecipient).WithMany(p => p.ChatMessageChatMessageRecipients).HasConstraintName("FK_Chat_Message_Chat_User_Recipient"); - - entity.HasOne(d => d.ChatMessageRoom).WithMany(p => p.ChatMessages) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_Message_Chat_Room"); - - entity.HasOne(d => d.ChatMessageUser).WithMany(p => p.ChatMessageChatMessageUsers).HasConstraintName("FK_Chat_Message_Chat_User_Sender"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatNotificationId).HasName("PK_CMS_ChatNotification"); - - entity.HasOne(d => d.ChatNotificationReceiver).WithMany(p => p.ChatNotificationChatNotificationReceivers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_Notification_Chat_User_Receiver"); - - entity.HasOne(d => d.ChatNotificationRoom).WithMany(p => p.ChatNotifications).HasConstraintName("FK_Chat_Notification_Chat_Room"); - - entity.HasOne(d => d.ChatNotificationSender).WithMany(p => p.ChatNotificationChatNotificationSenders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_Notification_Chat_User_Sender"); - - entity.HasOne(d => d.ChatNotificationSite).WithMany(p => p.ChatNotifications).HasConstraintName("FK_Chat_Notification_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ChatOnlineSupportChatUser).WithMany(p => p.ChatOnlineSupports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_OnlineSupport_Chat_User"); - - entity.HasOne(d => d.ChatOnlineSupportSite).WithMany(p => p.ChatOnlineSupports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_OnlineSupport_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ChatOnlineUserChatUser).WithMany(p => p.ChatOnlineUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_OnlineUser_Chat_User"); - - entity.HasOne(d => d.ChatOnlineUserSite).WithMany(p => p.ChatOnlineUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_OnlineUser_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatRoomId).HasName("PK_CMS_ChatRoom"); - - entity.Property(e => e.ChatRoomDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ChatRoomLastModification).HasDefaultValueSql("('10/19/2011 12:16:33 PM')"); - entity.Property(e => e.ChatRoomPrivateStateLastModification).HasDefaultValueSql("('1/30/2012 4:36:47 PM')"); - - entity.HasOne(d => d.ChatRoomCreatedByChatUser).WithMany(p => p.ChatRooms).HasConstraintName("FK_Chat_Room_Chat_User"); - - entity.HasOne(d => d.ChatRoomSite).WithMany(p => p.ChatRooms).HasConstraintName("FK_Chat_Room_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatRoomUserId).HasName("PK_CMS_ChatRoomUser"); - - entity.Property(e => e.ChatRoomUserLastModification).HasDefaultValueSql("('11/10/2011 3:29:00 PM')"); - - entity.HasOne(d => d.ChatRoomUserChatUser).WithMany(p => p.ChatRoomUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_RoomUser_Chat_User"); - - entity.HasOne(d => d.ChatRoomUserRoom).WithMany(p => p.ChatRoomUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_RoomUser_Chat_Room"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatSupportCannedResponseId).HasName("PK_CMS_ChatSupportCannedResponse"); - - entity.Property(e => e.ChatSupportCannedResponseTagName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ChatSupportCannedResponseChatUser).WithMany(p => p.ChatSupportCannedResponses).HasConstraintName("FK_Chat_SupportCannedResponse_Chat_User"); - - entity.HasOne(d => d.ChatSupportCannedResponseSite).WithMany(p => p.ChatSupportCannedResponses).HasConstraintName("FK_Chat_SupportCannedResponse_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatSupportTakenRoomId).HasName("PK_Chat_SupportTakenRooms"); - - entity.Property(e => e.ChatSupportTakenRoomLastModification).HasDefaultValueSql("('4/16/2012 5:11:30 PM')"); - - entity.HasOne(d => d.ChatSupportTakenRoomChatUser).WithMany(p => p.ChatSupportTakenRooms).HasConstraintName("FK_Chat_SupportTakenRoom_Chat_User"); - - entity.HasOne(d => d.ChatSupportTakenRoomRoom).WithMany(p => p.ChatSupportTakenRooms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_SupportTakenRoom_Chat_Room"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatUserId).HasName("PK_CMS_ChatUser"); - - entity.Property(e => e.ChatUserLastModification).HasDefaultValueSql("('2/20/2012 2:02:00 PM')"); - entity.Property(e => e.ChatUserNickname).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ChatUserUser).WithMany(p => p.ChatUsers).HasConstraintName("FK_Chat_User_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FileLocation).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ReportId).IsClustered(false); - - entity.HasIndex(e => e.ReportWhen, "IX_CMS_AbuseReport_ReportWhen") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.ReportComment).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportCulture).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportTitle).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportUrl).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportWhen).HasDefaultValueSql("('9/11/2008 4:32:15 PM')"); - - entity.HasOne(d => d.ReportSite).WithMany(p => p.CmsAbuseReports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AbuseReport_ReportSiteID_CMS_Site"); - - entity.HasOne(d => d.ReportUser).WithMany(p => p.CmsAbuseReports).HasConstraintName("FK_CMS_AbuseReport_ReportUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AclinheritedAcls).HasDefaultValueSql("('')"); - entity.Property(e => e.AcllastModified).HasDefaultValueSql("('10/30/2008 9:17:31 AM')"); - - entity.HasOne(d => d.Aclsite).WithMany(p => p.CmsAcls).HasConstraintName("FK_CMS_ACL_ACLSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Acl).WithMany(p => p.CmsAclitems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ACLItem_ACLID_CMS_ACL"); - - entity.HasOne(d => d.LastModifiedByUser).WithMany(p => p.CmsAclitemLastModifiedByUsers).HasConstraintName("FK_CMS_ACLItem_LastModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsAclitems).HasConstraintName("FK_CMS_ACLItem_RoleID_CMS_Role"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsAclitemUsers).HasConstraintName("FK_CMS_ACLItem_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormHideNewParentFields).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FormClass).WithMany(p => p.CmsAlternativeFormFormClasses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AlternativeForm_FormClassID_CMS_Class"); - - entity.HasOne(d => d.FormCoupledClass).WithMany(p => p.CmsAlternativeFormFormCoupledClasses).HasConstraintName("FK_CMS_AlternativeForm_FormCoupledClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AttachmentId).IsClustered(false); - - entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName, e.AttachmentIsUnsorted, e.AttachmentOrder }, "IX_CMS_Attachment_AttachmentDocumentID_AttachmentIsUnsorted_AttachmentName_AttachmentOrder").IsClustered(); - - entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_Attachment_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") - .IsUnique() - .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); - - entity.HasOne(d => d.AttachmentDocument).WithMany(p => p.CmsAttachments).HasConstraintName("FK_CMS_Attachment_AttachmentDocumentID_CMS_Document"); - - entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Attachment_AttachmentSiteID_CMS_Site"); - - entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_Attachment_AttachmentVariantParentID_CMS_Attachment"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AttachmentHistoryId).IsClustered(false); - - entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName }, "IX_CMS_AttachmentHistory_AttachmentDocumentID_AttachmentName").IsClustered(); - - entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_AttachmentHistory_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") - .IsUnique() - .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); - - entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachmentHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentHistory_AttachmentSiteID_CMS_Site"); - - entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_AttachmentHistory_AttachmentVariantParentID_CMS_AttachmentHistory"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); - entity.Property(e => e.HistoryStepDisplayName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.HistoryApprovedByUser).WithMany(p => p.CmsAutomationHistories).HasConstraintName("FK_CMS_AutomationHistory_HistoryApprovedByUserID"); - - entity.HasOne(d => d.HistoryState).WithMany(p => p.CmsAutomationHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationHistory_HistoryStateID"); - - entity.HasOne(d => d.HistoryStep).WithMany(p => p.CmsAutomationHistoryHistorySteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryStepID"); - - entity.HasOne(d => d.HistoryTargetStep).WithMany(p => p.CmsAutomationHistoryHistoryTargetSteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryTargetStepID"); - - entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsAutomationHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationHistory_HistoryWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.StateSite).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateSiteID_CMS_Site"); - - entity.HasOne(d => d.StateStep).WithMany(p => p.CmsAutomationStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationState_StateStepID"); - - entity.HasOne(d => d.StateUser).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateUserID_CMS_User"); - - entity.HasOne(d => d.StateWorkflow).WithMany(p => p.CmsAutomationStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationState_StateWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AvatarId).IsClustered(false); - - entity.HasIndex(e => e.AvatarName, "IX_CMS_Avatar_AvatarName").IsClustered(); - - entity.Property(e => e.DefaultFemaleUserAvatar).HasDefaultValueSql("((0))"); - entity.Property(e => e.DefaultGroupAvatar).HasDefaultValueSql("((0))"); - entity.Property(e => e.DefaultMaleUserAvatar).HasDefaultValueSql("((0))"); - entity.Property(e => e.DefaultUserAvatar).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.BadgeId).IsClustered(false); - - entity.HasIndex(e => e.BadgeTopLimit, "IX_CMS_Badge_BadgeTopLimit") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.BadgeDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.BadgeLastModified).HasDefaultValueSql("('9/25/2008 5:07:55 PM')"); - entity.Property(e => e.BadgeName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IpaddressId).IsClustered(false); - - entity.HasIndex(e => new { e.Ipaddress, e.IpaddressSiteId }, "IX_CMS_BannedIP_IPAddressSiteID_IPAddress").IsClustered(); - - entity.Property(e => e.IpaddressBanEnabled).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.IpaddressSite).WithMany(p => p.CmsBannedIps).HasConstraintName("FK_CMS_BannedIP_IPAddressSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BannerContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BannerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.BannerEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.BannerLastModified).HasDefaultValueSql("('1/1/1970 12:00:00 AM')"); - entity.Property(e => e.BannerName).HasDefaultValueSql("('')"); - entity.Property(e => e.BannerType).HasDefaultValueSql("((2))"); - entity.Property(e => e.BannerWeight).HasDefaultValueSql("((5))"); - - entity.HasOne(d => d.BannerCategory).WithMany(p => p.CmsBanners) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Banner_CMS_BannerCategory"); - - entity.HasOne(d => d.BannerSite).WithMany(p => p.CmsBanners).HasConstraintName("FK_CMS_Banner_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.BannerCategoryId).HasName("PK__CMS_BannerCategory"); - - entity.Property(e => e.BannerCategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.BannerCategoryEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.BannerCategoryLastModified).HasDefaultValueSql("('1/1/1970 12:00:00 AM')"); - entity.Property(e => e.BannerCategoryName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.BannerCategorySite).WithMany(p => p.CmsBannerCategories).HasConstraintName("FK_CMS_BannerCategory_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_CMS_Category_CategoryDisplayName_CategoryEnabled").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.CategorySite).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategorySiteID_CMS_Site"); - - entity.HasOne(d => d.CategoryUser).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategoryUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ClassId).IsClustered(false); - - entity.HasIndex(e => new { e.ClassId, e.ClassName, e.ClassDisplayName }, "IX_CMS_Class_ClassID_ClassName_ClassDisplayName").IsClustered(); - - entity.Property(e => e.ClassIsContentOnly).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ClassDefaultPageTemplate).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassDefaultPageTemplateID_CMS_PageTemplate"); - - entity.HasOne(d => d.ClassPageTemplateCategory).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassPageTemplateCategoryID_CMS_PageTemplateCategory"); - - entity.HasOne(d => d.ClassResource).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassResourceID_CMS_Resource"); - - entity.HasMany(d => d.ChildClasses).WithMany(p => p.ParentClasses) - .UsingEntity>( - "CmsAllowedChildClass", - r => r.HasOne().WithMany() - .HasForeignKey("ChildClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ParentClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), - j => - { - j.HasKey("ParentClassId", "ChildClassId"); - j.ToTable("CMS_AllowedChildClasses"); - j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); - j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); - j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); - }); - - entity.HasMany(d => d.ParentClasses).WithMany(p => p.ChildClasses) - .UsingEntity>( - "CmsAllowedChildClass", - r => r.HasOne().WithMany() - .HasForeignKey("ParentClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ChildClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), - j => - { - j.HasKey("ParentClassId", "ChildClassId"); - j.ToTable("CMS_AllowedChildClasses"); - j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); - j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); - j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); - }); - - entity.HasMany(d => d.Sites).WithMany(p => p.Classes) - .UsingEntity>( - "CmsClassSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Class_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Class_ClassID_CMS_Class"), - j => - { - j.HasKey("ClassId", "SiteId"); - j.ToTable("CMS_ClassSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_ClassSite_SiteID"); - j.IndexerProperty("ClassId").HasColumnName("ClassID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ConsentName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentAgreementTime).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ConsentAgreementConsent).WithMany(p => p.CmsConsentAgreements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementConsentID_CMS_Consent"); - - entity.HasOne(d => d.ConsentAgreementContact).WithMany(p => p.CmsConsentAgreements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementContactID_OM_Contact"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentArchiveContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentArchiveHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentArchiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ConsentArchiveConsent).WithMany(p => p.CmsConsentArchives) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentArchive_ConsentArchiveConsentID_CMS_Consent"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CountryId).IsClustered(false); - - entity.HasIndex(e => e.CountryDisplayName, "IX_CMS_Country_CountryDisplayName").IsClustered(); - - entity.Property(e => e.CountryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CountryLastModified).HasDefaultValueSql("('11/14/2013 1:43:04 PM')"); - entity.Property(e => e.CountryName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StylesheetId).IsClustered(false); - - entity.HasIndex(e => e.StylesheetDisplayName, "IX_CMS_CssStylesheet_StylesheetDisplayName").IsClustered(); - - entity.Property(e => e.StylesheetDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.StylesheetDynamicLanguage).HasDefaultValueSql("('plaincss')"); - entity.Property(e => e.StylesheetName).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Stylesheets) - .UsingEntity>( - "CmsCssStylesheetSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_CssStylesheetSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("StylesheetId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_CssStylesheetSite_StylesheetID_CMS_CssStylesheet"), - j => - { - j.HasKey("StylesheetId", "SiteId"); - j.ToTable("CMS_CssStylesheetSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_CssStylesheetSite_SiteID"); - j.IndexerProperty("StylesheetId").HasColumnName("StylesheetID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CultureId).IsClustered(false); - - entity.HasIndex(e => e.CultureName, "IX_CMS_Culture_CultureName").IsClustered(); - - entity.Property(e => e.CultureIsUiculture).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ProfileEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ProfileName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.DeviceProfile).WithMany(p => p.CmsDeviceProfileLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DeviceProfileLayout_DeviceProfileID_CMS_DeviceProfile"); - - entity.HasOne(d => d.SourceLayout).WithMany(p => p.CmsDeviceProfileLayoutSourceLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DeviceProfileLayout_SourceLayoutID_CMS_Layout"); - - entity.HasOne(d => d.TargetLayout).WithMany(p => p.CmsDeviceProfileLayoutTargetLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DeviceProfileLayout_TargetLayoutID_CMS_Layout"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DocumentCanBePublished).HasDefaultValueSql("((1))"); - entity.Property(e => e.DocumentInheritsStylesheet).HasDefaultValueSql("((1))"); - entity.Property(e => e.DocumentMenuRedirectToFirstChild).HasDefaultValueSql("((0))"); - entity.Property(e => e.DocumentUseCustomExtensions).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.DocumentCheckedOutByUser).WithMany(p => p.CmsDocumentDocumentCheckedOutByUsers).HasConstraintName("FK_CMS_Document_DocumentCheckedOutByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentCheckedOutVersionHistory).WithMany(p => p.CmsDocumentDocumentCheckedOutVersionHistories).HasConstraintName("FK_CMS_Document_DocumentCheckedOutVersionHistoryID_CMS_VersionHistory"); - - entity.HasOne(d => d.DocumentCreatedByUser).WithMany(p => p.CmsDocumentDocumentCreatedByUsers).HasConstraintName("FK_CMS_Document_DocumentCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentModifiedByUser).WithMany(p => p.CmsDocumentDocumentModifiedByUsers).HasConstraintName("FK_CMS_Document_DocumentModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentNode).WithMany(p => p.CmsDocuments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Document_DocumentNodeID_CMS_Tree"); - - entity.HasOne(d => d.DocumentPageTemplate).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentPageTemplateID_CMS_Template"); - - entity.HasOne(d => d.DocumentPublishedVersionHistory).WithMany(p => p.CmsDocumentDocumentPublishedVersionHistories).HasConstraintName("FK_CMS_Document_DocumentPublishedVersionHistoryID_CMS_VersionHistory"); - - entity.HasOne(d => d.DocumentStylesheet).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentStylesheetID_CMS_CssStylesheet"); - - entity.HasOne(d => d.DocumentTagGroup).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentTagGroupID_CMS_TagGroup"); - - entity.HasOne(d => d.DocumentWorkflowStep).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentWorkflowStepID_CMS_WorkflowStep"); - - entity.HasMany(d => d.Categories).WithMany(p => p.Documents) - .UsingEntity>( - "CmsDocumentCategory", - r => r.HasOne().WithMany() - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentCategory_CategoryID_CMS_Category"), - l => l.HasOne().WithMany() - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentCategory_DocumentID_CMS_Document"), - j => - { - j.HasKey("DocumentId", "CategoryId"); - j.ToTable("CMS_DocumentCategory"); - j.HasIndex(new[] { "CategoryId" }, "IX_CMS_DocumentCategory_CategoryID"); - j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); - j.IndexerProperty("CategoryId").HasColumnName("CategoryID"); - }); - - entity.HasMany(d => d.Tags).WithMany(p => p.Documents) - .UsingEntity>( - "CmsDocumentTag", - r => r.HasOne().WithMany() - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTag_TagID_CMS_Tag"), - l => l.HasOne().WithMany() - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTag_DocumentID_CMS_Document"), - j => - { - j.HasKey("DocumentId", "TagId"); - j.ToTable("CMS_DocumentTag"); - j.HasIndex(new[] { "TagId" }, "IX_CMS_DocumentTag_TagID"); - j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); - j.IndexerProperty("TagId").HasColumnName("TagID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AliasId).IsClustered(false); - - entity.HasIndex(e => e.AliasUrlpath, "IX_CMS_DocumentAlias_AliasURLPath").IsClustered(); - - entity.Property(e => e.AliasCulture).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AliasExtensions).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AliasLastModified).HasDefaultValueSql("('10/22/2008 12:55:43 PM')"); - entity.Property(e => e.AliasUrlpath).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AliasNode).WithMany(p => p.CmsDocumentAliases) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentAlias_AliasNodeID_CMS_Tree"); - - entity.HasOne(d => d.AliasSite).WithMany(p => p.CmsDocumentAliases) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentAlias_AliasSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ScopeId).IsClustered(false); - - entity.HasIndex(e => e.ScopePath, "IX_CMS_DocumentTypeScope_ScopePath").IsClustered(); - - entity.Property(e => e.ScopeAllowAbvariant).HasDefaultValueSql("((0))"); - entity.Property(e => e.ScopeAllowAllTypes).HasDefaultValueSql("((0))"); - entity.Property(e => e.ScopeAllowLinks).HasDefaultValueSql("((0))"); - entity.Property(e => e.ScopeLastModified).HasDefaultValueSql("('4/30/2013 2:47:21 PM')"); - entity.Property(e => e.ScopePath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsDocumentTypeScopes).HasConstraintName("FK_CMS_DocumentTypeScope_ScopeSiteID_CMS_Site"); - - entity.HasMany(d => d.Classes).WithMany(p => p.Scopes) - .UsingEntity>( - "CmsDocumentTypeScopeClass", - r => r.HasOne().WithMany() - .HasForeignKey("ClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ScopeId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ScopeID_CMS_DocumentTypeScope"), - j => - { - j.HasKey("ScopeId", "ClassId"); - j.ToTable("CMS_DocumentTypeScopeClass"); - j.HasIndex(new[] { "ClassId" }, "IX_CMS_DocumentTypeScopeClass_ClassID"); - j.IndexerProperty("ScopeId").HasColumnName("ScopeID"); - j.IndexerProperty("ClassId").HasColumnName("ClassID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailFrom).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailIsMass).HasDefaultValueSql("((1))"); - entity.Property(e => e.EmailLastModified).HasDefaultValueSql("('6/17/2016 10:11:21 AM')"); - entity.Property(e => e.EmailSubject).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Attachments).WithMany(p => p.Emails) - .UsingEntity>( - "CmsAttachmentForEmail", - r => r.HasOne().WithMany() - .HasForeignKey("AttachmentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentForEmail_AttachmentID_CMS_EmailAttachment"), - l => l.HasOne().WithMany() - .HasForeignKey("EmailId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentForEmail_EmailID_CMS_Email"), - j => - { - j.HasKey("EmailId", "AttachmentId"); - j.ToTable("CMS_AttachmentForEmail"); - j.HasIndex(new[] { "AttachmentId" }, "IX_CMS_AttachmentForEmail_AttachmentID"); - j.IndexerProperty("EmailId").HasColumnName("EmailID"); - j.IndexerProperty("AttachmentId").HasColumnName("AttachmentID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.EmailTemplateId).IsClustered(false); - - entity.HasIndex(e => e.EmailTemplateDisplayName, "IX_CMS_EmailTemplate_EmailTemplateDisplayName").IsClustered(); - - entity.Property(e => e.EmailTemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.EmailTemplateName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailTemplateSite).WithMany(p => p.CmsEmailTemplates).HasConstraintName("FK_CMS_Email_EmailTemplateSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Email).WithMany(p => p.CmsEmailUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_EmailUser_EmailID_CMS_Email"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsEmailUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_EmailUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DocumentName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventMachineName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventTime).HasDefaultValueSql("('4/21/2015 8:21:43 AM')"); - entity.Property(e => e.EventType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventUrl).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventUrlReferrer).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Ipaddress).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Source).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.User).WithMany(p => p.CmsExternalLogins) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ExternalLogin_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.FormId).IsClustered(false); - - entity.HasIndex(e => e.FormDisplayName, "IX_CMS_Form_FormDisplayName").IsClustered(); - - entity.Property(e => e.FormConfirmationEmailSubject).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormEmailAttachUploadedDocs).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormLastModified).HasDefaultValueSql("('9/17/2012 1:37:08 PM')"); - entity.Property(e => e.FormLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.FormName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormSubmitButtonText).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.FormClass).WithMany(p => p.CmsForms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Form_FormClassID_CMS_Class"); - - entity.HasOne(d => d.FormSite).WithMany(p => p.CmsForms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Form_FormSiteID_CMS_Site"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Forms) - .UsingEntity>( - "CmsFormRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_FormRole_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("FormId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_FormRole_FormID_CMS_Form"), - j => - { - j.HasKey("FormId", "RoleId"); - j.ToTable("CMS_FormRole"); - j.HasIndex(new[] { "RoleId" }, "IX_CMS_FormRole_RoleID"); - j.IndexerProperty("FormId").HasColumnName("FormID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.UserControlId).IsClustered(false); - - entity.HasIndex(e => e.UserControlDisplayName, "IX_CMS_FormUserControl_UserControlDisplayName").IsClustered(); - - entity.Property(e => e.UserControlIsSystem).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserControlPriority).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserControlShowInCustomTables).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.UserControlParent).WithMany(p => p.InverseUserControlParent).HasConstraintName("FK_CMS_FormUserControl_UserControlParentID_CMS_FormUserControl"); - - entity.HasOne(d => d.UserControlResource).WithMany(p => p.CmsFormUserControls).HasConstraintName("FK_CMS_FormUserControl_UserControlResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HelpTopicLink).HasDefaultValueSql("(N'')"); - entity.Property(e => e.HelpTopicName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.HelpTopicUielement).WithMany(p => p.CmsHelpTopics) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_HelpTopic_HelpTopicUIElementID_CMS_UIElement"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LayoutCode).HasDefaultValueSql("('')"); - entity.Property(e => e.LayoutCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.LayoutDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LayoutIconClass).HasDefaultValueSql("(N'icon-layout')"); - entity.Property(e => e.LayoutIsConvertible).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.LicenseKeyId).IsClustered(false); - - entity.HasIndex(e => e.LicenseDomain, "IX_CMS_LicenseKey_LicenseDomain").IsClustered(); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.MacroIdentityName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.MacroIdentityEffectiveUser).WithMany(p => p.CmsMacroIdentities).HasConstraintName("FK_CMS_MacroIdentity_MacroIdentityEffectiveUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MacroRuleCondition).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MacroRuleDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.MacroRuleEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MacroRuleIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.MacroRuleLastModified).HasDefaultValueSql("('5/1/2012 8:46:33 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.MembershipSite).WithMany(p => p.CmsMemberships).HasConstraintName("FK_CMS_Membership_MembershipSiteID_CMS_Site"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Memberships) - .UsingEntity>( - "CmsMembershipRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipRole_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("MembershipId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipRole_MembershipID_CMS_Membership"), - j => - { - j.HasKey("MembershipId", "RoleId"); - j.ToTable("CMS_MembershipRole"); - j.HasIndex(new[] { "RoleId" }, "IX_CMS_MembershipRole_RoleID"); - j.IndexerProperty("MembershipId").HasColumnName("MembershipID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Membership).WithMany(p => p.CmsMembershipUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipUser_MembershipID_CMS_Membership"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsMembershipUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MetaFileId).IsClustered(false); - - entity.HasIndex(e => new { e.MetaFileObjectType, e.MetaFileObjectId, e.MetaFileGroupName }, "IX_CMS_Metafile_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName").IsClustered(); - - entity.HasOne(d => d.MetaFileSite).WithMany(p => p.CmsMetaFiles).HasConstraintName("FK_CMS_MetaFile_MetaFileSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ModuleLicenseKeyLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ModuleLicenseKeyLicense).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ModuleLicenseKeyResource).WithMany(p => p.CmsModuleLicenseKeys) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ModuleUsageCounterName, "IX_CMS_ModuleUsageCounter_ModuleUsageCounterName") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.ModuleUsageCounterId).ValueGeneratedOnAdd(); - entity.Property(e => e.ModuleUsageCounterName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ObjectSettingsObjectType).HasDefaultValueSql("('')"); - entity.Property(e => e.ObjectWorkflowSendEmails).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ObjectCheckedOutByUser).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutByUserID_CMS_User"); - - entity.HasOne(d => d.ObjectCheckedOutVersionHistory).WithMany(p => p.CmsObjectSettingObjectCheckedOutVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID_CMS_ObjectVersionHistory"); - - entity.HasOne(d => d.ObjectPublishedVersionHistory).WithMany(p => p.CmsObjectSettingObjectPublishedVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectPublishedVersionHistoryID_CMS_ObjectVersionHistory"); - - entity.HasOne(d => d.ObjectWorkflowStep).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectWorkflowStepID_CMS_WorkflowStep"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.VersionId) - .HasName("PK_CMS_ObjectVersionHistory_VersionID") - .IsClustered(false); - - entity.HasIndex(e => new { e.VersionObjectType, e.VersionObjectId, e.VersionId }, "PK_CMS_ObjectVersionHistory") - .IsUnique() - .IsDescending(false, false, true) - .IsClustered(); - - entity.Property(e => e.VersionNumber).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionDeletedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionModifiedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionModifiedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionObjectSite).WithMany(p => p.CmsObjectVersionHistories).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionObjectSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TriggerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TriggerObjectType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TriggerWorkflow).WithMany(p => p.CmsObjectWorkflowTriggers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ObjectWorkflowTrigger_TriggerWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.OpenId).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsOpenIdusers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_OpenIDUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PageTemplateId).IsClustered(false); - - entity.HasIndex(e => e.PageTemplateCategoryId, "IX_CMS_PageTemplate_PageTemplateCategoryID").IsClustered(); - - entity.Property(e => e.PageTemplateCloneAsAdHoc).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.PageTemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.PageTemplateForAllPages).HasDefaultValueSql("((1))"); - entity.Property(e => e.PageTemplateIconClass).HasDefaultValueSql("(N'icon-layout')"); - entity.Property(e => e.PageTemplateIsLayout).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateIsReusable).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateShowAsMasterTemplate).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateType).HasDefaultValueSql("(N'portal')"); - - entity.HasOne(d => d.PageTemplateCategory).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateCategoryID_CMS_PageTemplateCategory"); - - entity.HasOne(d => d.PageTemplateLayoutNavigation).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateLayoutID_CMS_Layout"); - - entity.HasOne(d => d.PageTemplateSite).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateSiteID_CMS_Site"); - - entity.HasMany(d => d.Sites).WithMany(p => p.PageTemplates) - .UsingEntity>( - "CmsPageTemplateSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageTemplateSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("PageTemplateId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageTemplateSite_PageTemplateID_CMS_PageTemplate"), - j => - { - j.HasKey("PageTemplateId", "SiteId"); - j.ToTable("CMS_PageTemplateSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_PageTemplateSite_SiteID"); - j.IndexerProperty("PageTemplateId").HasColumnName("PageTemplateID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_CMS_PageTemplateCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryChildCount).HasDefaultValueSql("((0))"); - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryTemplateChildCount).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_PageTemplateCategory_CategoryParentID_CMS_PageTemplateCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PageTemplateScopeId).IsClustered(false); - - entity.HasIndex(e => e.PageTemplateScopePath, "IX_CMS_PageTemplateScope_PageTemplateScopePath").IsClustered(); - - entity.Property(e => e.PageTemplateScopeLastModified).HasDefaultValueSql("('2/22/2010 9:30:07 AM')"); - entity.Property(e => e.PageTemplateScopePath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.PageTemplateScopeClass).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeClassID_CMS_Class"); - - entity.HasOne(d => d.PageTemplateScopeCulture).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeCultureID_CMS_Culture"); - - entity.HasOne(d => d.PageTemplateScopeSite).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeSiteID_CMS_Site"); - - entity.HasOne(d => d.PageTemplateScopeTemplate).WithMany(p => p.CmsPageTemplateScopes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeTemplateID_CMS_PageTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PermissionDisplayInMatrix).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.Class).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ClassID_CMS_Class"); - - entity.HasOne(d => d.Resource).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PersonalizationId).IsClustered(false); - - entity.HasIndex(e => e.PersonalizationDocumentId, "IX_CMS_Personalization_PersonalizationUserID_PersonalizationDocumentID").IsClustered(); - - entity.Property(e => e.PersonalizationLastModified).HasDefaultValueSql("('9/2/2008 5:36:59 PM')"); - - entity.HasOne(d => d.PersonalizationDocument).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationDocumentID_CMS_Document"); - - entity.HasOne(d => d.PersonalizationSite).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationSiteID_CMS_Site"); - - entity.HasOne(d => d.PersonalizationUser).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.QueryIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.QueryName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.Class).WithMany(p => p.CmsQueries).HasConstraintName("FK_CMS_Query_ClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.LeftNode).WithMany(p => p.CmsRelationshipLeftNodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_LeftNodeID_CMS_Tree"); - - entity.HasOne(d => d.RelationshipName).WithMany(p => p.CmsRelationships) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_RelationshipNameID_CMS_RelationshipName"); - - entity.HasOne(d => d.RightNode).WithMany(p => p.CmsRelationshipRightNodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_RightNodeID_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.RelationshipDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.RelationshipName).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Sites).WithMany(p => p.RelationshipNames) - .UsingEntity>( - "CmsRelationshipNameSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RelationshipNameSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("RelationshipNameId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RelationshipNameSite_RelationshipNameID_CMS_RelationshipName"), - j => - { - j.HasKey("RelationshipNameId", "SiteId"); - j.ToTable("CMS_RelationshipNameSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_RelationshipNameSite_SiteID"); - j.IndexerProperty("RelationshipNameId").HasColumnName("RelationshipNameID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ResourceId).IsClustered(false); - - entity.HasIndex(e => e.ResourceDisplayName, "IX_CMS_Resource_ResourceDisplayName").IsClustered(); - - entity.Property(e => e.ResourceHasFiles).HasDefaultValueSql("((0))"); - entity.Property(e => e.ResourceInstallationState).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ResourceInstalledVersion).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ShowInDevelopment).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Resources) - .UsingEntity>( - "CmsResourceSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ResourceId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceSite_ResourceID_CMS_Resource"), - j => - { - j.HasKey("ResourceId", "SiteId"); - j.ToTable("CMS_ResourceSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_ResourceSite_SiteID"); - j.IndexerProperty("ResourceId").HasColumnName("ResourceID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ResourceLibraryPath).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ResourceLibraryResource).WithMany(p => p.CmsResourceLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceLibrary_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TranslationCulture).WithMany(p => p.CmsResourceTranslations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceTranslation_TranslationCultureID_CMS_Culture"); - - entity.HasOne(d => d.TranslationString).WithMany(p => p.CmsResourceTranslations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceTranslation_TranslationStringID_CMS_ResourceString"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.RoleId).IsClustered(false); - - entity.HasIndex(e => new { e.SiteId, e.RoleName, e.RoleDisplayName }, "IX_CMS_Role_SiteID_RoleName_RoleDisplayName").IsClustered(); - - entity.HasOne(d => d.RoleGroup).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_RoleGroupID_Community_Group"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_SiteID_CMS_SiteID"); - - entity.HasMany(d => d.Elements).WithMany(p => p.Roles) - .UsingEntity>( - "CmsRoleApplication", - r => r.HasOne().WithMany() - .HasForeignKey("ElementId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleApplication_CMS_UIElement"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleApplication_CMS_Role"), - j => - { - j.HasKey("RoleId", "ElementId"); - j.ToTable("CMS_RoleApplication"); - j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleApplication"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("ElementId").HasColumnName("ElementID"); - }); - - entity.HasMany(d => d.ElementsNavigation).WithMany(p => p.RolesNavigation) - .UsingEntity>( - "CmsRoleUielement", - r => r.HasOne().WithMany() - .HasForeignKey("ElementId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleUIElement_ElementID_CMS_UIElement"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleUIElement_RoleID_CMS_Role"), - j => - { - j.HasKey("RoleId", "ElementId"); - j.ToTable("CMS_RoleUIElement"); - j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleUIElement_ElementID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("ElementId").HasColumnName("ElementID"); - }); - - entity.HasMany(d => d.Permissions).WithMany(p => p.Roles) - .UsingEntity>( - "CmsRolePermission", - r => r.HasOne().WithMany() - .HasForeignKey("PermissionId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RolePermission_PermissionID_CMS_Permission"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RolePermission_RoleID_CMS_Role"), - j => - { - j.HasKey("RoleId", "PermissionId"); - j.ToTable("CMS_RolePermission"); - j.HasIndex(new[] { "PermissionId" }, "IX_CMS_RolePermission_PermissionID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("PermissionId").HasColumnName("PermissionID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskAllowExternalService).HasDefaultValueSql("((0))"); - entity.Property(e => e.TaskExecutingServerName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.TaskResource).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskResourceID_CMS_Resource"); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskSiteID_CMS_Site"); - - entity.HasOne(d => d.TaskUser).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IndexId).IsClustered(false); - - entity.HasIndex(e => e.IndexDisplayName, "IX_CMS_SearchIndex_IndexDisplayName").IsClustered(); - - entity.Property(e => e.IndexProvider).HasDefaultValueSql("(N'')"); - entity.Property(e => e.IndexType).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.IndexCultures).WithMany(p => p.Indices) - .UsingEntity>( - "CmsSearchIndexCulture", - r => r.HasOne().WithMany() - .HasForeignKey("IndexCultureId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexCulture_IndexCultureID_CMS_Culture"), - l => l.HasOne().WithMany() - .HasForeignKey("IndexId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexCulture_IndexID_CMS_SearchIndex"), - j => - { - j.HasKey("IndexId", "IndexCultureId"); - j.ToTable("CMS_SearchIndexCulture"); - j.HasIndex(new[] { "IndexCultureId" }, "IX_CMS_SearchIndexCulture_IndexCultureID"); - j.IndexerProperty("IndexId").HasColumnName("IndexID"); - j.IndexerProperty("IndexCultureId").HasColumnName("IndexCultureID"); - }); - - entity.HasMany(d => d.IndexSites).WithMany(p => p.Indices) - .UsingEntity>( - "CmsSearchIndexSite", - r => r.HasOne().WithMany() - .HasForeignKey("IndexSiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexSite_IndexSiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("IndexId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexSite_IndexID_CMS_SearchIndex"), - j => - { - j.HasKey("IndexId", "IndexSiteId"); - j.ToTable("CMS_SearchIndexSite"); - j.HasIndex(new[] { "IndexSiteId" }, "IX_CMS_SearchIndexSite_IndexSiteID"); - j.IndexerProperty("IndexId").HasColumnName("IndexID"); - j.IndexerProperty("IndexSiteId").HasColumnName("IndexSiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SearchTaskId).IsClustered(false); - - entity.HasIndex(e => new { e.SearchTaskPriority, e.SearchTaskStatus, e.SearchTaskServerName }, "IX_CMS_SearchTask_SearchTaskPriority_SearchTaskStatus_SearchTaskServerName") - .IsDescending(true, false, false) - .IsClustered(); - - entity.Property(e => e.SearchTaskCreated).HasDefaultValueSql("('4/15/2009 11:23:52 AM')"); - entity.Property(e => e.SearchTaskStatus).HasDefaultValueSql("('')"); - entity.Property(e => e.SearchTaskType).HasDefaultValueSql("('')"); - entity.Property(e => e.SearchTaskValue).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SearchTaskAzureAdditionalData).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SearchTaskAzureCreated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.SearchTaskAzureType).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SessionExpires).HasDefaultValueSql("('9/9/2008 3:45:44 PM')"); - entity.Property(e => e.SessionIdentificator).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SessionLastActive).HasDefaultValueSql("('9/9/2008 3:44:26 PM')"); - - entity.HasOne(d => d.SessionSite).WithMany(p => p.CmsSessions).HasConstraintName("FK_CMS_Session_SessionSiteID_CMS_Site"); - - entity.HasOne(d => d.SessionUser).WithMany(p => p.CmsSessions).HasConstraintName("FK_CMS_Session_SessionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryOrder, "IX_CMS_SettingsCategory_CategoryOrder").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.CategoryIsGroup).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_SettingsCategory_CMS_SettingsCategory1"); - - entity.HasOne(d => d.CategoryResource).WithMany(p => p.CmsSettingsCategories).HasConstraintName("FK_CMS_SettingsCategory_CategoryResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.KeyDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.KeyExplanationText).HasDefaultValueSql("(N'')"); - entity.Property(e => e.KeyIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyIsGlobal).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyIsHidden).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyName).HasDefaultValueSql("('')"); - entity.Property(e => e.KeyType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.KeyCategory).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_KeyCategoryID_CMS_SettingsCategory"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SiteId).IsClustered(false); - - entity.HasIndex(e => e.SiteDisplayName, "IX_CMS_Site_SiteDisplayName").IsClustered(); - - entity.Property(e => e.SiteDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.SiteDomainName).HasDefaultValueSql("('')"); - entity.Property(e => e.SiteName).HasDefaultValueSql("('')"); - entity.Property(e => e.SiteStatus).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.SiteDefaultEditorStylesheetNavigation).WithMany(p => p.CmsSiteSiteDefaultEditorStylesheetNavigations).HasConstraintName("FK_CMS_Site_SiteDefaultEditorStylesheet_CMS_CssStylesheet"); - - entity.HasOne(d => d.SiteDefaultStylesheet).WithMany(p => p.CmsSiteSiteDefaultStylesheets).HasConstraintName("FK_CMS_Site_SiteDefaultStylesheetID_CMS_CssStylesheet"); - - entity.HasMany(d => d.Cultures).WithMany(p => p.Sites) - .UsingEntity>( - "CmsSiteCulture", - r => r.HasOne().WithMany() - .HasForeignKey("CultureId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteCulture_CultureID_CMS_Culture"), - l => l.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteCulture_SiteID_CMS_Site"), - j => - { - j.HasKey("SiteId", "CultureId"); - j.ToTable("CMS_SiteCulture"); - j.HasIndex(new[] { "CultureId" }, "IX_CMS_SiteCulture_CultureID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - j.IndexerProperty("CultureId").HasColumnName("CultureID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SiteDomainAliasName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsSiteDomainAliases) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteDomainAlias_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ServerDeliveryMethod).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Servers) - .UsingEntity>( - "CmsSmtpserverSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SMTPServerSite_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SMTPServerSite_CMS_SMTPServer"), - j => - { - j.HasKey("ServerId", "SiteId"); - j.ToTable("CMS_SMTPServerSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_SMTPServerSite_SiteID"); - j.IndexerProperty("ServerId").HasColumnName("ServerID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StateId).IsClustered(false); - - entity.HasIndex(e => e.StateDisplayName, "IX_CMS_State_CountryID_StateDisplayName").IsClustered(); - - entity.Property(e => e.StateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.StateName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.Country).WithMany(p => p.CmsStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_State_CountryID_CMS_Country"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TagId).IsClustered(false); - - entity.HasIndex(e => e.TagName, "IX_CMS_Tag_TagName").IsClustered(); - - entity.HasOne(d => d.TagGroup).WithMany(p => p.CmsTags) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tag_TagGroupID_CMS_TagGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TagGroupId).IsClustered(false); - - entity.HasIndex(e => e.TagGroupDisplayName, "IX_CMS_TagGroup_TagGroupDisplayName").IsClustered(); - - entity.Property(e => e.TagGroupDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TagGroupName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TagGroupSite).WithMany(p => p.CmsTagGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TagGroup_TagGroupSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LayoutLastModified).HasDefaultValueSql("('7/31/2012 12:10:49 PM')"); - - entity.HasOne(d => d.Layout).WithMany(p => p.CmsTemplateDeviceLayouts).HasConstraintName("FK_CMS_TemplateDeviceLayout_LayoutID_CMS_Layout"); - - entity.HasOne(d => d.PageTemplate).WithMany(p => p.CmsTemplateDeviceLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TemplateDeviceLayout_PageTemplateID_CMS_PageTemplate"); - - entity.HasOne(d => d.Profile).WithMany(p => p.CmsTemplateDeviceLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TemplateDeviceLayout_ProfileID_CMS_DeviceProfile"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TimeZoneId).IsClustered(false); - - entity.HasIndex(e => e.TimeZoneDisplayName, "IX_CMS_TimeZone_TimeZoneDisplayName").IsClustered(); - - entity.Property(e => e.TimeZoneDaylight).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TransformationId).IsClustered(false); - - entity.HasIndex(e => new { e.TransformationClassId, e.TransformationName }, "IX_CMS_Transformation_TransformationClassID_TransformationName").IsClustered(); - - entity.Property(e => e.TransformationCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TransformationIsHierarchical).HasDefaultValueSql("((0))"); - entity.Property(e => e.TransformationName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TransformationType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.TransformationClass).WithMany(p => p.CmsTransformations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Transformation_TransformationClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TranslationServiceGenerateTargetTag).HasDefaultValueSql("((0))"); - entity.Property(e => e.TranslationServiceSupportsCancel).HasDefaultValueSql("((0))"); - entity.Property(e => e.TranslationServiceSupportsStatusUpdate).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubmissionTargetCulture).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SubmissionService).WithMany(p => p.CmsTranslationSubmissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TranslationSubmission_CMS_TranslationService"); - - entity.HasOne(d => d.SubmissionSubmittedByUser).WithMany(p => p.CmsTranslationSubmissions).HasConstraintName("FK_CMS_TranslationSubmission_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SubmissionItemSubmission).WithMany(p => p.CmsTranslationSubmissionItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TranslationSubmissionItem_CMS_TranslationSubmission"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.NodeAllowCacheInFileSystem).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeHasChildren).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeHasLinks).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeInheritPageTemplate).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeTemplateForAllCultures).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.NodeAcl).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeACLID_CMS_ACL"); - - entity.HasOne(d => d.NodeClass).WithMany(p => p.CmsTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tree_NodeClassID_CMS_Class"); - - entity.HasOne(d => d.NodeGroup).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeGroupID_Community_Group"); - - entity.HasOne(d => d.NodeLinkedNode).WithMany(p => p.InverseNodeLinkedNode).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeID_CMS_Tree"); - - entity.HasOne(d => d.NodeLinkedNodeSite).WithMany(p => p.CmsTreeNodeLinkedNodeSites).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeSiteID_CMS_Site"); - - entity.HasOne(d => d.NodeOriginalNode).WithMany(p => p.InverseNodeOriginalNode).HasConstraintName("FK_CMS_Tree_NodeOriginalNodeID_CMS_Tree"); - - entity.HasOne(d => d.NodeOwnerNavigation).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeOwner_CMS_User"); - - entity.HasOne(d => d.NodeParent).WithMany(p => p.InverseNodeParent).HasConstraintName("FK_CMS_Tree_NodeParentID_CMS_Tree"); - - entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsTreeNodeSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tree_NodeSiteID_CMS_Site"); - - entity.HasOne(d => d.NodeSku).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeSKUID_COM_SKU"); - - entity.HasOne(d => d.NodeTemplate).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeTemplateID_CMS_PageTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ElementId).IsClustered(false); - - entity.HasIndex(e => new { e.ElementResourceId, e.ElementLevel, e.ElementParentId, e.ElementOrder, e.ElementCaption }, "IX_CMS_UIElement_ElementResourceID_ElementLevel_ElementParentID_ElementOrder_ElementCaption").IsClustered(); - - entity.Property(e => e.ElementCheckModuleReadPermission).HasDefaultValueSql("((1))"); - entity.Property(e => e.ElementIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementIsGlobalApplication).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementIsMenu).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ElementSize).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ElementPageTemplate).WithMany(p => p.CmsUielements).HasConstraintName("FK_CMS_UIElement_ElementPageTemplateID_CMS_PageTemplate"); - - entity.HasOne(d => d.ElementParent).WithMany(p => p.InverseElementParent).HasConstraintName("FK_CMS_UIElement_ElementParentID_CMS_UIElement"); - - entity.HasOne(d => d.ElementResource).WithMany(p => p.CmsUielements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UIElement_ElementResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserIsDomain).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserIsExternal).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserIsHidden).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserName).HasDefaultValueSql("('')"); - entity.Property(e => e.UserPassword).HasDefaultValueSql("(N'')"); - - entity.HasMany(d => d.ContactListContactUsers).WithMany(p => p.ContactListUsers) - .UsingEntity>( - "MessagingContactList", - r => r.HasOne().WithMany() - .HasForeignKey("ContactListContactUserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Messaging_ContactList_ContactListContactUserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("ContactListUserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Messaging_ContactList_ContactListUserID_CMS_User"), - j => - { - j.HasKey("ContactListUserId", "ContactListContactUserId"); - j.ToTable("Messaging_ContactList"); - j.HasIndex(new[] { "ContactListContactUserId" }, "IX_Messaging_ContactList_ContactListContactUserID"); - j.IndexerProperty("ContactListUserId").HasColumnName("ContactListUserID"); - j.IndexerProperty("ContactListContactUserId").HasColumnName("ContactListContactUserID"); - }); - - entity.HasMany(d => d.ContactListUsers).WithMany(p => p.ContactListContactUsers) - .UsingEntity>( - "MessagingContactList", - r => r.HasOne().WithMany() - .HasForeignKey("ContactListUserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Messaging_ContactList_ContactListUserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("ContactListContactUserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Messaging_ContactList_ContactListContactUserID_CMS_User"), - j => - { - j.HasKey("ContactListUserId", "ContactListContactUserId"); - j.ToTable("Messaging_ContactList"); - j.HasIndex(new[] { "ContactListContactUserId" }, "IX_Messaging_ContactList_ContactListContactUserID"); - j.IndexerProperty("ContactListUserId").HasColumnName("ContactListUserID"); - j.IndexerProperty("ContactListContactUserId").HasColumnName("ContactListContactUserID"); - }); - - entity.HasMany(d => d.Forums).WithMany(p => p.Users) - .UsingEntity>( - "ForumsForumModerator", - r => r.HasOne().WithMany() - .HasForeignKey("ForumId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumModerators_ForumID_Forums_Forum"), - l => l.HasOne().WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumModerators_UserID_CMS_User"), - j => - { - j.HasKey("UserId", "ForumId"); - j.ToTable("Forums_ForumModerators"); - j.HasIndex(new[] { "ForumId" }, "IX_Forums_ForumModerators_ForumID"); - j.IndexerProperty("UserId").HasColumnName("UserID"); - j.IndexerProperty("ForumId").HasColumnName("ForumID"); - }); - - entity.HasMany(d => d.IgnoreListIgnoredUsers).WithMany(p => p.IgnoreListUsers) - .UsingEntity>( - "MessagingIgnoreList", - r => r.HasOne().WithMany() - .HasForeignKey("IgnoreListIgnoredUserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Messaging_IgnoreList_IgnoreListIgnoredUserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("IgnoreListUserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Messaging_IgnoreList_IgnoreListUserID_CMS_User"), - j => - { - j.HasKey("IgnoreListUserId", "IgnoreListIgnoredUserId"); - j.ToTable("Messaging_IgnoreList"); - j.HasIndex(new[] { "IgnoreListIgnoredUserId" }, "IX_Messaging_IgnoreList_IgnoreListIgnoredUserID"); - j.IndexerProperty("IgnoreListUserId").HasColumnName("IgnoreListUserID"); - j.IndexerProperty("IgnoreListIgnoredUserId").HasColumnName("IgnoreListIgnoredUserID"); - }); - - entity.HasMany(d => d.IgnoreListUsers).WithMany(p => p.IgnoreListIgnoredUsers) - .UsingEntity>( - "MessagingIgnoreList", - r => r.HasOne().WithMany() - .HasForeignKey("IgnoreListUserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Messaging_IgnoreList_IgnoreListUserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("IgnoreListIgnoredUserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Messaging_IgnoreList_IgnoreListIgnoredUserID_CMS_User"), - j => - { - j.HasKey("IgnoreListUserId", "IgnoreListIgnoredUserId"); - j.ToTable("Messaging_IgnoreList"); - j.HasIndex(new[] { "IgnoreListIgnoredUserId" }, "IX_Messaging_IgnoreList_IgnoreListIgnoredUserID"); - j.IndexerProperty("IgnoreListUserId").HasColumnName("IgnoreListUserID"); - j.IndexerProperty("IgnoreListIgnoredUserId").HasColumnName("IgnoreListIgnoredUserID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Culture).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_CultureID_CMS_Culture"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_SiteID_CMS_Site"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserMacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.UserMacroIdentityMacroIdentity).WithMany(p => p.CmsUserMacroIdentities).HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID_CMS_MacroIdentity"); - - entity.HasOne(d => d.UserMacroIdentityUser).WithOne(p => p.CmsUserMacroIdentity) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Role).WithMany(p => p.CmsUserRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserRole_RoleID_CMS_Role"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserRole_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserAccountLockReason).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserInvalidLogOnAttempts).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserWaitingForApproval).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.UserActivatedByUser).WithMany(p => p.CmsUserSettingUserActivatedByUsers).HasConstraintName("FK_CMS_UserSettings_UserActivatedByUserID_CMS_User"); - - entity.HasOne(d => d.UserAvatar).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserAvatarID_CMS_Avatar"); - - entity.HasOne(d => d.UserBadge).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserBadgeID_CMS_Badge"); - - entity.HasOne(d => d.UserSettingsUser).WithMany(p => p.CmsUserSettingUserSettingsUsers) - .HasPrincipalKey(p => p.UserGuid) - .HasForeignKey(d => d.UserSettingsUserGuid) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserGUID_CMS_User"); - - entity.HasOne(d => d.UserSettingsUserNavigation).WithOne(p => p.CmsUserSettingUserSettingsUserNavigation) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserID_CMS_User"); - - entity.HasOne(d => d.UserTimeZone).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserTimeZoneID_CMS_TimeZone"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Site).WithMany(p => p.CmsUserSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSite_SiteID_CMS_Site"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSite_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.VersionHistoryId).IsClustered(false); - - entity.HasIndex(e => e.DocumentId, "IX_CMS_VersionHistory_DocumentID").IsClustered(); - - entity.Property(e => e.DocumentNamePath).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ModifiedByUser).WithMany(p => p.CmsVersionHistoryModifiedByUsers).HasConstraintName("FK_CMS_VersionHistory_ModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsVersionHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionHistory_NodeSiteID_CMS_Site"); - - entity.HasOne(d => d.VersionClass).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionClassID_CMS_Class"); - - entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_VersionHistory_DeletedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionWorkflow).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowID_CMS_Workflow"); - - entity.HasOne(d => d.VersionWorkflowStep).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowStepID_CMS_WorkflowStep"); - - entity.HasMany(d => d.AttachmentHistories).WithMany(p => p.VersionHistories) - .UsingEntity>( - "CmsVersionAttachment", - r => r.HasOne().WithMany() - .HasForeignKey("AttachmentHistoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionAttachment_AttachmentHistoryID_CMS_AttachmentHistory"), - l => l.HasOne().WithMany() - .HasForeignKey("VersionHistoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionAttachment_VersionHistoryID_CMS_VersionHistory"), - j => - { - j.HasKey("VersionHistoryId", "AttachmentHistoryId"); - j.ToTable("CMS_VersionAttachment"); - j.HasIndex(new[] { "AttachmentHistoryId" }, "IX_CMS_VersionAttachment_AttachmentHistoryID"); - j.IndexerProperty("VersionHistoryId").HasColumnName("VersionHistoryID"); - j.IndexerProperty("AttachmentHistoryId").HasColumnName("AttachmentHistoryID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ServerId).IsClustered(false); - - entity.HasIndex(e => e.ServerDisplayName, "IX_CMS_WebFarmServer_ServerDisplayName").IsClustered(); - - entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ServerLastModified).HasDefaultValueSql("('9/17/2013 12:18:06 PM')"); - entity.Property(e => e.ServerName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LogCode).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Server).WithMany(p => p.CmsWebFarmServerTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer"); - - entity.HasOne(d => d.Task).WithMany(p => p.CmsWebFarmServerTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebFarmServerTask_TaskID_CMS_WebFarmTask"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskGuid).HasDefaultValueSql("('00000000-0000-0000-0000-000000000000')"); - entity.Property(e => e.TaskIsMemory).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.WebPartDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartFileName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.WebPartName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartProperties).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartSkipInsertProperties).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.WebPartCategory).WithMany(p => p.CmsWebParts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPart_WebPartCategoryID_CMS_WebPartCategory"); - - entity.HasOne(d => d.WebPartParent).WithMany(p => p.InverseWebPartParent).HasConstraintName("FK_CMS_WebPart_WebPartParentID_CMS_WebPart"); - - entity.HasOne(d => d.WebPartResource).WithMany(p => p.CmsWebParts).HasConstraintName("FK_CMS_WebPart_WebPartResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_CMS_WebPartCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_WebPartCategory_CategoryParentID_CMS_WebPartCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ContainerId).IsClustered(false); - - entity.HasIndex(e => e.ContainerDisplayName, "IX_CMS_WebPartContainer_ContainerDisplayName").IsClustered(); - - entity.Property(e => e.ContainerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContainerName).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Containers) - .UsingEntity>( - "CmsWebPartContainerSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartContainerSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ContainerId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartContainerSite_ContainerID_CMS_WebPartContainer"), - j => - { - j.HasKey("ContainerId", "SiteId"); - j.ToTable("CMS_WebPartContainerSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_WebPartContainerSite_SiteID"); - j.IndexerProperty("ContainerId").HasColumnName("ContainerID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WebPartLayoutId).IsClustered(false); - - entity.HasIndex(e => new { e.WebPartLayoutWebPartId, e.WebPartLayoutCodeName }, "IX_CMS_WebPartLayout_WebPartLayoutWebPartID_WebPartLayoutCodeName").IsClustered(); - - entity.Property(e => e.WebPartLayoutCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebPartLayoutDisplayName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.WebPartLayoutWebPart).WithMany(p => p.CmsWebPartLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartLayout_WebPartLayoutWebPartID_CMS_WebPart"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WebTemplateId).IsClustered(false); - - entity.HasIndex(e => e.WebTemplateOrder, "IX_CMS_WebTemplate_WebTemplateOrder").IsClustered(); - - entity.Property(e => e.WebTemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebTemplateFileName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebTemplateLicenses).HasDefaultValueSql("('')"); - entity.Property(e => e.WebTemplateName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebTemplateOrder).HasDefaultValueSql("((99999))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WidgetId).IsClustered(false); - - entity.HasIndex(e => new { e.WidgetCategoryId, e.WidgetDisplayName }, "IX_CMS_Widget_WidgetCategoryID_WidgetDisplayName").IsClustered(); - - entity.Property(e => e.WidgetSecurity).HasDefaultValueSql("((2))"); - - entity.HasOne(d => d.WidgetCategory).WithMany(p => p.CmsWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Widget_WidgetCategoryID_CMS_WidgetCategory"); - - entity.HasOne(d => d.WidgetLayout).WithMany(p => p.CmsWidgets).HasConstraintName("FK_CMS_Widget_WidgetLayoutID_CMS_WebPartLayout"); - - entity.HasOne(d => d.WidgetWebPart).WithMany(p => p.CmsWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Widget_WidgetWebPartID_CMS_WebPart"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WidgetCategoryId).IsClustered(false); - - entity.HasIndex(e => e.WidgetCategoryPath, "IX_CMS_WidgetCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.WidgetCategoryParent).WithMany(p => p.InverseWidgetCategoryParent).HasConstraintName("FK_CMS_WidgetCategory_WidgetCategoryParentID_CMS_WidgetCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Permission).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_RoleID_CMS_Role"); - - entity.HasOne(d => d.Widget).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_WidgetID_CMS_Widget"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowId).IsClustered(false); - - entity.HasIndex(e => e.WorkflowDisplayName, "IX_CMS_Workflow_WorkflowDisplayName").IsClustered(); - - entity.Property(e => e.WorkflowAutoPublishChanges).HasDefaultValueSql("((0))"); - entity.Property(e => e.WorkflowDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.WorkflowEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowName).HasDefaultValueSql("('')"); - entity.Property(e => e.WorkflowSendApproveEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendArchiveEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendPublishEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendReadyForApprovalEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendRejectEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowUseCheckinCheckout).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Users).WithMany(p => p.Workflows) - .UsingEntity>( - "CmsWorkflowUser", - r => r.HasOne().WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowUser_UserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowUser_WorkflowID_CMS_Workflow"), - j => - { - j.HasKey("WorkflowId", "UserId").HasName("PK_CMS_WorkflowUser_1"); - j.ToTable("CMS_WorkflowUser"); - j.HasIndex(new[] { "UserId" }, "IX_CMS_WorkflowUser_UserID"); - j.IndexerProperty("WorkflowId").HasColumnName("WorkflowID"); - j.IndexerProperty("UserId").HasColumnName("UserID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ActionEnabled).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ActionResource).WithMany(p => p.CmsWorkflowActions).HasConstraintName("FK_CMS_WorkflowAction_ActionResourceID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ApprovedByUser).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_ApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_HistoryWorkflowID_CMS_Workflow"); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowHistorySteps).HasConstraintName("FK_CMS_WorkflowHistory_StepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TargetStep).WithMany(p => p.CmsWorkflowHistoryTargetSteps).HasConstraintName("FK_CMS_WorkflowHistory_TargetStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.VersionHistory).WithMany(p => p.CmsWorkflowHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowHistory_VersionHistoryID_CMS_VersionHistory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ScopeId).IsClustered(false); - - entity.HasIndex(e => e.ScopeStartingPath, "IX_CMS_WorkflowScope_ScopeStartingPath").IsClustered(); - - entity.HasOne(d => d.ScopeClass).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeClassID_CMS_Class"); - - entity.HasOne(d => d.ScopeCulture).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeCultureID_CMS_Culture"); - - entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsWorkflowScopes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowScope_ScopeSiteID_CMS_Site"); - - entity.HasOne(d => d.ScopeWorkflow).WithMany(p => p.CmsWorkflowScopes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowScope_ScopeWorkflowID_CMS_WorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.StepAllowPublish).HasDefaultValueSql("((0))"); - entity.Property(e => e.StepAllowReject).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.StepAction).WithMany(p => p.CmsWorkflowSteps).HasConstraintName("FK_CMS_WorkflowStep_StepActionID"); - - entity.HasOne(d => d.StepWorkflow).WithMany(p => p.CmsWorkflowSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStep_StepWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowStepRoleId).IsClustered(false); - - entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.RoleId }, "IX_CMS_WorkflowStepRoles_StepID_StepSourcePointGUID_RoleID") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsWorkflowStepRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepRoles_RoleID_CMS_Role"); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepRoles_StepID_CMS_WorkflowStep"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowStepUserId).IsClustered(false); - - entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.UserId }, "IX_CMS_WorkflowStepUser_StepID_StepSourcePointGUID_UserID") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepUser_StepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsWorkflowStepUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TransitionEndStep).WithMany(p => p.CmsWorkflowTransitionTransitionEndSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionEndStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TransitionStartStep).WithMany(p => p.CmsWorkflowTransitionTransitionStartSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionStartStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TransitionWorkflow).WithMany(p => p.CmsWorkflowTransitions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionWorkflowID_CMS_Workflow"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AddressId).HasName("PK_COM_CustomerAdress"); - - entity.Property(e => e.AddressCity).HasDefaultValueSql("('')"); - entity.Property(e => e.AddressLastModified).HasDefaultValueSql("('10/18/2012 3:39:07 PM')"); - entity.Property(e => e.AddressLine1).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AddressName).HasDefaultValueSql("('')"); - entity.Property(e => e.AddressPersonalName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AddressZip).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Address_AddressCountryID_CMS_Country"); - - entity.HasOne(d => d.AddressCustomer).WithMany(p => p.ComAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Address_AddressCustomerID_COM_Customer"); - - entity.HasOne(d => d.AddressState).WithMany(p => p.ComAddresses).HasConstraintName("FK_COM_Address_AddressStateID_CMS_State"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BrandDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BrandEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.BrandLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.BrandName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.BrandSite).WithMany(p => p.ComBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Brand_BrandSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CarrierAssemblyName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierClassName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierLastModified).HasDefaultValueSql("('9/22/2014 3:00:14 PM')"); - entity.Property(e => e.CarrierName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CarrierSite).WithMany(p => p.ComCarriers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Carrier_CarrierSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CollectionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CollectionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.CollectionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CollectionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CollectionSite).WithMany(p => p.ComCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Collection_CollectionSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CouponCodeCode).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CouponCodeDiscount).WithMany(p => p.ComCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CouponCode_CouponCodeDiscountID_COM_Discount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CurrencyCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyFormatString).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CurrencySite).WithMany(p => p.ComCurrencies).HasConstraintName("FK_COM_Currency_CurrencySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ExchangeRateToCurrency).WithMany(p => p.ComCurrencyExchangeRates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID_COM_Currency"); - - entity.HasOne(d => d.ExchangeTable).WithMany(p => p.ComCurrencyExchangeRates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeTableID_COM_ExchangeTable"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.CustomerCompany, "IX_COM_Customer_CustomerCompany") - .HasFilter("([CustomerCompany] IS NOT NULL)") - .HasFillFactor(90); - - entity.HasOne(d => d.CustomerSite).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerSiteID_CMS_Site"); - - entity.HasOne(d => d.CustomerUser).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EventCreditLastModified).HasDefaultValueSql("('9/26/2012 12:21:38 PM')"); - entity.Property(e => e.EventDate).HasDefaultValueSql("('9/27/2012 2:48:56 PM')"); - entity.Property(e => e.EventName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.EventCustomer).WithMany(p => p.ComCustomerCreditHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CustomerCreditHistory_EventCustomerID_COM_Customer"); - - entity.HasOne(d => d.EventSite).WithMany(p => p.ComCustomerCreditHistories).HasConstraintName("FK_COM_CustomerCreditHistory_EventSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.DepartmentId).IsClustered(false); - - entity.HasIndex(e => e.DepartmentDisplayName, "IX_COM_Department_DepartmentDisplayName").IsClustered(); - - entity.Property(e => e.DepartmentDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.DepartmentName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.DepartmentDefaultTaxClass).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentDefaultTaxClassID_COM_TaxClass"); - - entity.HasOne(d => d.DepartmentSite).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); - entity.Property(e => e.DiscountApplyTo).HasDefaultValueSql("('Order')"); - entity.Property(e => e.DiscountDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.DiscountEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.DiscountOrder).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.DiscountSite).WithMany(p => p.ComDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Discount_DiscountSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ExchangeTableId).IsClustered(false); - - entity.HasIndex(e => new { e.ExchangeTableValidFrom, e.ExchangeTableValidTo }, "IX_COM_ExchangeTable_ExchangeTableValidFrom_ExchangeTableValidTo") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.ExchangeTableDisplayName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ExchangeTableSite).WithMany(p => p.ComExchangeTables).HasConstraintName("FK_COM_ExchangeTable_ExchangeTableSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.GiftCardCustomerRestriction).HasDefaultValueSql("(N'enum1')"); - entity.Property(e => e.GiftCardDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GiftCardEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.GiftCardLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.GiftCardName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.GiftCardSite).WithMany(p => p.ComGiftCards) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_GiftCard_GiftCardSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.GiftCardCouponCodeCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GiftCardCouponCodeLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.GiftCardCouponCodeGiftCard).WithMany(p => p.ComGiftCardCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_GiftCardCouponCode_GiftCardCouponCodeGiftCardID_COM_GiftCard"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.InternalStatusId).IsClustered(false); - - entity.HasIndex(e => new { e.InternalStatusDisplayName, e.InternalStatusEnabled }, "IX_COM_InternalStatus_InternalStatusDisplayName_InternalStatusEnabled").IsClustered(); - - entity.Property(e => e.InternalStatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.InternalStatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.InternalStatusLastModified).HasDefaultValueSql("('9/20/2012 2:45:44 PM')"); - entity.Property(e => e.InternalStatusName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.InternalStatusSite).WithMany(p => p.ComInternalStatuses).HasConstraintName("FK_COM_InternalStatus_InternalStatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ManufacturerId).IsClustered(false); - - entity.HasIndex(e => new { e.ManufacturerDisplayName, e.ManufacturerEnabled }, "IX_COM_Manufacturer_ManufacturerDisplayName_ManufacturerEnabled").IsClustered(); - - entity.Property(e => e.ManufacturerDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ManufacturerEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ManufacturerLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ManufacturerSite).WithMany(p => p.ComManufacturers).HasConstraintName("FK_COM_Manufacturer_ManufacturerSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MultiBuyCouponCodeCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MultiBuyCouponCodeUseCount).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.MultiBuyCouponCodeMultiBuyDiscount).WithMany(p => p.ComMultiBuyCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MultiBuyDiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountAutoAddEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountCustomerRestriction).HasDefaultValueSql("(N'All')"); - entity.Property(e => e.MultiBuyDiscountEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountIsFlat).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountMinimumBuyCount).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountUsesCoupons).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.MultiBuyDiscountApplyToSku).WithMany(p => p.ComMultiBuyDiscounts).HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID_COM_SKU"); - - entity.HasOne(d => d.MultiBuyDiscountSite).WithMany(p => p.ComMultiBuyDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountSiteID_CMS_Site"); - - entity.HasMany(d => d.Departments).WithMany(p => p.MultiBuyDiscounts) - .UsingEntity>( - "ComMultiBuyDiscountDepartment", - r => r.HasOne().WithMany() - .HasForeignKey("DepartmentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_DepartmentID_COM_Department"), - l => l.HasOne().WithMany() - .HasForeignKey("MultiBuyDiscountId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_MultiBuyDiscountID_COM_MultiBuyDiscount"), - j => - { - j.HasKey("MultiBuyDiscountId", "DepartmentId"); - j.ToTable("COM_MultiBuyDiscountDepartment"); - j.HasIndex(new[] { "DepartmentId" }, "IX_COM_MultiBuyDiscountDepartment_DepartmentID"); - j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); - j.IndexerProperty("DepartmentId").HasColumnName("DepartmentID"); - }); - - entity.HasMany(d => d.Skus).WithMany(p => p.MultiBuyDiscounts) - .UsingEntity>( - "ComMultiBuyDiscountSku", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountSKU_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("MultiBuyDiscountId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountSKU_MultiBuyDiscountID_COM_MultiBuyDiscount"), - j => - { - j.HasKey("MultiBuyDiscountId", "Skuid"); - j.ToTable("COM_MultiBuyDiscountSKU"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_MultiBuyDiscountSKU_SKUID"); - j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BrandIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Brand).WithMany(p => p.ComMultiBuyDiscountBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountBrand_BrandID_COM_Brand"); - - entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountBrand_MultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CollectionIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Collection).WithMany(p => p.ComMultiBuyDiscountCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountCollection_CollectionID_COM_Collection"); - - entity.HasOne(d => d.MultibuyDiscount).WithMany(p => p.ComMultiBuyDiscountCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountCollection_MultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.NodeIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountTree_MultiBuyDiscountID_COM_MultiBuyDiscount"); - - entity.HasOne(d => d.Node).WithMany(p => p.ComMultiBuyDiscountTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountTree_NodeID_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_COM_OptionCategory_CategoryDisplayName_CategoryEnabled").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CategoryDisplayPrice).HasDefaultValueSql("((1))"); - entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.CategoryName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CategorySelectionType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CategorySite).WithMany(p => p.ComOptionCategories).HasConstraintName("FK_COM_OptionCategory_CategorySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.OrderBillingAddress).WithMany(p => p.ComOrderOrderBillingAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Order_OrderBillingAddressID_COM_OrderAdress"); - - entity.HasOne(d => d.OrderCompanyAddress).WithMany(p => p.ComOrderOrderCompanyAddresses).HasConstraintName("FK_COM_Order_OrderCompanyAddressID_COM_OrderAddress"); - - entity.HasOne(d => d.OrderCreatedByUser).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.OrderCurrency).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCurrencyID_COM_Currency"); - - entity.HasOne(d => d.OrderCustomer).WithMany(p => p.ComOrders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Order_OrderCustomerID_COM_Customer"); - - entity.HasOne(d => d.OrderPaymentOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderPaymentOptionID_COM_PaymentOption"); - - entity.HasOne(d => d.OrderShippingAddress).WithMany(p => p.ComOrderOrderShippingAddresses).HasConstraintName("FK_COM_Order_OrderShippingAddressID_COM_OrderAddress"); - - entity.HasOne(d => d.OrderShippingOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderShippingOptionID_COM_ShippingOption"); - - entity.HasOne(d => d.OrderSite).WithMany(p => p.ComOrders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Order_OrderSiteID_CMS_Site"); - - entity.HasOne(d => d.OrderStatus).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderStatusID_COM_Status"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComOrderAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderAddress_AddressCountryID_CMS_Country"); - - entity.HasOne(d => d.AddressState).WithMany(p => p.ComOrderAddresses).HasConstraintName("FK_COM_OrderAddress_AddressStateID_CMS_State"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.OrderItemOrder).WithMany(p => p.ComOrderItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItem_OrderItemOrderID_COM_Order"); - - entity.HasOne(d => d.OrderItemSku).WithMany(p => p.ComOrderItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItem_OrderItemSKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.File).WithMany(p => p.ComOrderItemSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItemSKUFile_COM_SKUFile"); - - entity.HasOne(d => d.OrderItem).WithMany(p => p.ComOrderItemSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItemSKUFile_COM_OrderItem"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.StatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.StatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.StatusName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.StatusSendNotification).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.StatusSite).WithMany(p => p.ComOrderStatuses).HasConstraintName("FK_COM_OrderStatus_StatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ChangedByUser).WithMany(p => p.ComOrderStatusUsers).HasConstraintName("FK_COM_OrderStatusUser_ChangedByUserID_CMS_User"); - - entity.HasOne(d => d.FromStatus).WithMany(p => p.ComOrderStatusUserFromStatuses).HasConstraintName("FK_COM_OrderStatusUser_FromStatusID_COM_Status"); - - entity.HasOne(d => d.Order).WithMany(p => p.ComOrderStatusUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderStatusUser_OrderID_COM_Order"); - - entity.HasOne(d => d.ToStatus).WithMany(p => p.ComOrderStatusUserToStatuses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderStatusUser_ToStatusID_COM_Status"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PaymentOptionId).IsClustered(false); - - entity.HasIndex(e => new { e.PaymentOptionSiteId, e.PaymentOptionDisplayName, e.PaymentOptionEnabled }, "IX_COM_PaymentOption_PaymentOptionSiteID_PaymentOptionDisplayName_PaymentOptionEnabled").IsClustered(); - - entity.Property(e => e.PaymentOptionAllowIfNoShipping).HasDefaultValueSql("((0))"); - entity.Property(e => e.PaymentOptionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PaymentOptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PaymentOptionLastModified).HasDefaultValueSql("('9/27/2012 4:18:26 PM')"); - entity.Property(e => e.PaymentOptionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PaymentOptionAuthorizedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionAuthorizedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID_COM_OrderStatus"); - - entity.HasOne(d => d.PaymentOptionFailedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionFailedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionFailedOrderStatusID_COM_OrderStatus"); - - entity.HasOne(d => d.PaymentOptionSite).WithMany(p => p.ComPaymentOptions).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSiteID_CMS_Site"); - - entity.HasOne(d => d.PaymentOptionSucceededOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionSucceededOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSucceededOrderStatusID_COM_OrderStatus"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PublicStatusId).IsClustered(false); - - entity.HasIndex(e => new { e.PublicStatusDisplayName, e.PublicStatusEnabled }, "IX_COM_PublicStatus_PublicStatusDisplayName_PublicStatusEnabled").IsClustered(); - - entity.Property(e => e.PublicStatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PublicStatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PublicStatusName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PublicStatusSite).WithMany(p => p.ComPublicStatuses).HasConstraintName("FK_COM_PublicStatus_PublicStatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ShippingCostId).HasName("PK__COM_ShippingCost"); - - entity.HasOne(d => d.ShippingCostShippingOption).WithMany(p => p.ComShippingCosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShippingCost_ShippingCostShippingOptionID_COM_ShippingOption"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ShippingOptionId).IsClustered(false); - - entity.HasIndex(e => e.ShippingOptionDisplayName, "IX_COM_ShippingOptionDisplayName").IsClustered(); - - entity.Property(e => e.ShippingOptionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ShippingOptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ShippingOptionLastModified).HasDefaultValueSql("('9/26/2012 12:44:18 PM')"); - entity.Property(e => e.ShippingOptionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ShippingOptionCarrier).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionCarrierID_COM_Carrier"); - - entity.HasOne(d => d.ShippingOptionSite).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionSiteID_CMS_Site"); - - entity.HasOne(d => d.ShippingOptionTaxClass).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionTaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ShoppingCartBillingAddress).WithMany(p => p.ComShoppingCartShoppingCartBillingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartBillingAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartCompanyAddress).WithMany(p => p.ComShoppingCartShoppingCartCompanyAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCompanyAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartCurrency).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCurrencyID_COM_Currency"); - - entity.HasOne(d => d.ShoppingCartCustomer).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCustomerID_COM_Customer"); - - entity.HasOne(d => d.ShoppingCartPaymentOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartPaymentOptionID_COM_PaymentOption"); - - entity.HasOne(d => d.ShoppingCartShippingAddress).WithMany(p => p.ComShoppingCartShoppingCartShippingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartShippingOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingOptionID_COM_ShippingOption"); - - entity.HasOne(d => d.ShoppingCartSite).WithMany(p => p.ComShoppingCarts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCart_ShoppingCartSiteID_CMS_Site"); - - entity.HasOne(d => d.ShoppingCartUser).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CouponCode).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartCouponCode_ShoppingCartID_COM_ShoppingCart"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CartItemAutoAddedUnits).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartSkus) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartSKU_ShoppingCartID_COM_ShoppingCart"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComShoppingCartSkus) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartSKU_SKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.Skunumber, "IX_COM_SKU_SKUNumber") - .HasFilter("([SKUNumber] IS NOT NULL)") - .HasFillFactor(90); - - entity.Property(e => e.SkubundleInventoryType).HasDefaultValueSql("('REMOVEBUNDLE')"); - entity.Property(e => e.SkuconversionValue).HasDefaultValueSql("('0')"); - entity.Property(e => e.Skuenabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.Skuname).HasDefaultValueSql("('')"); - entity.Property(e => e.SkusellOnlyAvailable).HasDefaultValueSql("((0))"); - entity.Property(e => e.SkutrackInventory).HasDefaultValueSql("(N'ByProduct')"); - - entity.HasOne(d => d.Skubrand).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUBrandID_COM_Brand"); - - entity.HasOne(d => d.Skucollection).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUCollectionID_COM_Collection"); - - entity.HasOne(d => d.Skudepartment).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUDepartmentID_COM_Department"); - - entity.HasOne(d => d.SkuinternalStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUInternalStatusID_COM_InternalStatus"); - - entity.HasOne(d => d.Skumanufacturer).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUManufacturerID_COM_Manifacturer"); - - entity.HasOne(d => d.SkuoptionCategory).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUOptionCategoryID_COM_OptionCategory"); - - entity.HasOne(d => d.SkuparentSku).WithMany(p => p.InverseSkuparentSku).HasConstraintName("FK_COM_SKU_SKUParentSKUID_COM_SKU"); - - entity.HasOne(d => d.SkupublicStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUPublicStatusID_COM_PublicStatus"); - - entity.HasOne(d => d.Skusite).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSiteID_CMS_Site"); - - entity.HasOne(d => d.Skusupplier).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSupplierID_COM_Supplier"); - - entity.HasOne(d => d.SkutaxClass).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUTaxClass_COM_TaxClass"); - - entity.HasMany(d => d.Bundles).WithMany(p => p.Skus) - .UsingEntity>( - "ComBundle", - r => r.HasOne().WithMany() - .HasForeignKey("BundleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), - j => - { - j.HasKey("BundleId", "Skuid"); - j.ToTable("COM_Bundle"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); - j.IndexerProperty("BundleId").HasColumnName("BundleID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.OptionSkus).WithMany(p => p.SkusNavigation) - .UsingEntity>( - "ComSkuallowedOption", - r => r.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), - j => - { - j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); - j.ToTable("COM_SKUAllowedOption"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.OptionSkusNavigation).WithMany(p => p.VariantSkus) - .UsingEntity>( - "ComVariantOption", - r => r.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("VariantSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), - j => - { - j.HasKey("VariantSkuid", "OptionSkuid"); - j.ToTable("COM_VariantOption"); - j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); - j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - }); - - entity.HasMany(d => d.Skus).WithMany(p => p.Bundles) - .UsingEntity>( - "ComBundle", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("BundleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), - j => - { - j.HasKey("BundleId", "Skuid"); - j.ToTable("COM_Bundle"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); - j.IndexerProperty("BundleId").HasColumnName("BundleID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.SkusNavigation).WithMany(p => p.OptionSkus) - .UsingEntity>( - "ComSkuallowedOption", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), - j => - { - j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); - j.ToTable("COM_SKUAllowedOption"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.VariantSkus).WithMany(p => p.OptionSkusNavigation) - .UsingEntity>( - "ComVariantOption", - r => r.HasOne().WithMany() - .HasForeignKey("VariantSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), - j => - { - j.HasKey("VariantSkuid", "OptionSkuid"); - j.ToTable("COM_VariantOption"); - j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); - j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.FileSku).WithMany(p => p.ComSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUFile_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Category).WithMany(p => p.ComSkuoptionCategories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOptionCategory_CategoryID_COM_OptionCategory"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComSkuoptionCategories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOptionCategory_SKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SupplierId).IsClustered(false); - - entity.HasIndex(e => new { e.SupplierDisplayName, e.SupplierEnabled }, "IX_COM_Supplier_SupplierDisplayName_SupplierEnabled").IsClustered(); - - entity.Property(e => e.SupplierDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.SupplierEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.SupplierLastModified).HasDefaultValueSql("('9/21/2012 12:34:09 PM')"); - - entity.HasOne(d => d.SupplierSite).WithMany(p => p.ComSuppliers).HasConstraintName("FK_COM_Supplier_SupplierSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TaxClassId).IsClustered(false); - - entity.HasIndex(e => e.TaxClassDisplayName, "IX_COM_TaxClass_TaxClassDisplayName").IsClustered(); - - entity.Property(e => e.TaxClassDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TaxClassLastModified).HasDefaultValueSql("('9/20/2012 1:31:27 PM')"); - entity.Property(e => e.TaxClassName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TaxClassZeroIfIdsupplied).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.TaxClassSite).WithMany(p => p.ComTaxClasses).HasConstraintName("FK_COM_TaxClass_TaxClassSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Country).WithMany(p => p.ComTaxClassCountries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxCategoryCountry_CountryID_CMS_Country"); - - entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassCountries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxCategoryCountry_TaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.State).WithMany(p => p.ComTaxClassStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxClassState_StateID_CMS_State"); - - entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxClassState_TaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.VolumeDiscountSku).WithMany(p => p.ComVolumeDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VolumeDiscount_VolumeDiscountSKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Site).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_SiteID_CMS_Site"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_SKUID_COM_SKU"); - - entity.HasOne(d => d.User).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.FriendApprovedByNavigation).WithMany(p => p.CommunityFriendFriendApprovedByNavigations).HasConstraintName("FK_CMS_Friend_FriendApprovedBy_CMS_User"); - - entity.HasOne(d => d.FriendRejectedByNavigation).WithMany(p => p.CommunityFriendFriendRejectedByNavigations).HasConstraintName("FK_CMS_Friend_FriendRejectedBy_CMS_User"); - - entity.HasOne(d => d.FriendRequestedUser).WithMany(p => p.CommunityFriendFriendRequestedUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Friend_FriendRequestedUserID_CMS_User"); - - entity.HasOne(d => d.FriendUser).WithMany(p => p.CommunityFriendFriendUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Friend_FriendUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.GroupId).IsClustered(false); - - entity.HasIndex(e => new { e.GroupSiteId, e.GroupDisplayName }, "IX_Community_Group_GroupDisplayName").IsClustered(); - - entity.Property(e => e.GroupApproved).HasDefaultValueSql("((0))"); - entity.Property(e => e.GroupCreatedWhen).HasDefaultValueSql("('10/21/2008 10:17:56 AM')"); - entity.Property(e => e.GroupSecurity).HasDefaultValueSql("((444))"); - entity.Property(e => e.GroupSendJoinLeaveNotification).HasDefaultValueSql("((1))"); - entity.Property(e => e.GroupSendWaitingForApprovalNotification).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.GroupApprovedByUser).WithMany(p => p.CommunityGroupGroupApprovedByUsers).HasConstraintName("FK_Community_Group_GroupApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.GroupAvatar).WithMany(p => p.CommunityGroups).HasConstraintName("FK_Community_Group_GroupAvatarID_CMS_Avatar"); - - entity.HasOne(d => d.GroupCreatedByUser).WithMany(p => p.CommunityGroupGroupCreatedByUsers).HasConstraintName("FK_Community_Group_GroupCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.GroupSite).WithMany(p => p.CommunityGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Community_Group_GroupSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MemberId).IsClustered(false); - - entity.HasIndex(e => e.MemberJoined, "IX_Community_GroupMember_MemberJoined") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.MemberStatus).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.MemberApprovedByUser).WithMany(p => p.CommunityGroupMemberMemberApprovedByUsers).HasConstraintName("FK_Community_GroupMember_MemberApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.MemberGroup).WithMany(p => p.CommunityGroupMembers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Community_GroupMember_MemberGroupID_Community_Group"); - - entity.HasOne(d => d.MemberInvitedByUser).WithMany(p => p.CommunityGroupMemberMemberInvitedByUsers).HasConstraintName("FK_Community_GroupMember_MemberInvitedByUserID_CMS_User"); - - entity.HasOne(d => d.MemberUser).WithMany(p => p.CommunityGroupMemberMemberUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Community_GroupMember_MemberUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Group).WithMany(p => p.CommunityGroupRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_community_GroupRolePermission_GroupID_Community_Group"); - - entity.HasOne(d => d.Permission).WithMany(p => p.CommunityGroupRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_community_GroupRolePermission_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.CommunityGroupRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_community_GroupRolePermission_RoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.InvitationId).HasName("PK_Community_GroupInvitation"); - - entity.HasOne(d => d.InvitationGroup).WithMany(p => p.CommunityInvitations).HasConstraintName("FK_Community_GroupInvitation_InvitationGroupID_Community_Group"); - - entity.HasOne(d => d.InvitedByUser).WithMany(p => p.CommunityInvitationInvitedByUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Community_GroupInvitation_InvitedByUserID_CMS_User"); - - entity.HasOne(d => d.InvitedUser).WithMany(p => p.CommunityInvitationInvitedUsers).HasConstraintName("FK_Community_GroupInvitation_InvitedUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ArticleName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BlogAllowAnonymousComments).HasDefaultValueSql("((1))"); - entity.Property(e => e.BlogDescription).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BlogEnableOptIn).HasDefaultValueSql("((-1))"); - entity.Property(e => e.BlogEnableSubscriptions).HasDefaultValueSql("((0))"); - entity.Property(e => e.BlogName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BlogOpenCommentsFor).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BlogRequireEmails).HasDefaultValueSql("((0))"); - entity.Property(e => e.BlogSendOptInConfirmation).HasDefaultValueSql("((-1))"); - entity.Property(e => e.BlogUseCaptchaforComments).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BlogMonthName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BlogMonthStartingDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BlogLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.BlogPostAllowComments).HasDefaultValueSql("((1))"); - entity.Property(e => e.BlogPostBody).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BlogPostDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.BlogPostTitle).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EventAllDay).HasDefaultValueSql("((0))"); - entity.Property(e => e.EventAllowRegistrationOverCapacity).HasDefaultValueSql("((0))"); - entity.Property(e => e.EventLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.EventName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Cell3G).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellBluetooth).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellCamera).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellEdge).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellGprs).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellHscsd).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellIrDa).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellJava).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellMp3).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellWiFi).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EventName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Faqanswer).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Faqquestion).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HeadlineBannerDescription).HasDefaultValueSql("(N'')"); - entity.Property(e => e.HeadlineBannerDocumentUrl).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.GalleryName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.JobName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ArticleAppliesTo).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ArticleName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ArticleSummary).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ArticleText).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LaptopBluetooth).HasDefaultValueSql("((1))"); - entity.Property(e => e.LaptopInfraport).HasDefaultValueSql("((1))"); - entity.Property(e => e.LaptopWirelessLan).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MenuItemName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.NewsReleaseDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.NewsSummary).HasDefaultValueSql("(N'')"); - entity.Property(e => e.NewsTitle).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.OfficeIsHeadquarters).HasDefaultValueSql("((0))"); - entity.Property(e => e.OfficeName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PressReleaseDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.PressReleaseSummary).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PressReleaseText).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PressReleaseTitle).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ArticleText).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ArticleTitle).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SmartphoneGps).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ItemText).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ArticleSummary).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ArticleText).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ArticleTitle).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CafeCity).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CafeCountry).HasDefaultValueSql("(N'USA')"); - entity.Property(e => e.CafeIsAlsoAroastery).HasDefaultValueSql("((0))"); - entity.Property(e => e.CafeIsPartner).HasDefaultValueSql("((0))"); - entity.Property(e => e.CafePhone).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CafeStreet).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CafeZipCode).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CityName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CoffeeCountry).HasDefaultValueSql("(N'USA')"); - entity.Property(e => e.CoffeeProcessing).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CoffeeVariety).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.OfficeCity).HasDefaultValueSql("(N'')"); - entity.Property(e => e.OfficeCodeName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.OfficeCountry).HasDefaultValueSql("(N'')"); - entity.Property(e => e.OfficeEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.OfficeName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.OfficePhone).HasDefaultValueSql("(N'')"); - entity.Property(e => e.OfficeStreet).HasDefaultValueSql("(N'')"); - entity.Property(e => e.OfficeZipCode).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PartnerCafeName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PartnerCafeStreet).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PartnerCafeZipCode).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.StepName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AttendeeId).IsClustered(false); - - entity.HasIndex(e => new { e.AttendeeEmail, e.AttendeeFirstName, e.AttendeeLastName }, "IX_Events_Attendee_AttendeeEmail_AttendeeFirstName_AttendeeLastName").IsClustered(); - - entity.Property(e => e.AttendeeEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AttendeeFirstName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AttendeeLastModified).HasDefaultValueSql("('1/20/2015 8:52:25 AM')"); - entity.Property(e => e.AttendeeLastName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AttendeePhone).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AttendeeEventNode).WithMany(p => p.EventsAttendees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Events_Attendee_AttendeeEventNodeID_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ExportId).IsClustered(false); - - entity.HasIndex(e => e.ExportDateTime, "IX_Export_History_ExportDateTime") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.ExportFileName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ExportSite).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportSiteID_CMS_Site"); - - entity.HasOne(d => d.ExportUser).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskSite).WithMany(p => p.ExportTasks).HasConstraintName("FK_Export_Task_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Email).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FirstName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.LastName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Message).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PhoneNumber).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BecomePartner).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CompanyName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Email).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FirstName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.LastName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.UserEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.UserMessage).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Email).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.Machine).HasDefaultValueSql("(N'')"); - entity.Property(e => e.RentalPeriod).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.Address).HasDefaultValueSql("(N'')"); - entity.Property(e => e.City).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Country).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailAddress).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FirstName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.LastName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Zipcode).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.GeneralQuestionEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GeneralQuestionText).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ProductQuestionEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ProductQuestionProduct).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ProductQuestionText).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AttachmentPost).WithMany(p => p.ForumsAttachments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_Attachment_AttachmentPostID_Forums_ForumPost"); - - entity.HasOne(d => d.AttachmentSite).WithMany(p => p.ForumsAttachments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_Attachment_AttachmentSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ForumId).IsClustered(false); - - entity.HasIndex(e => new { e.ForumGroupId, e.ForumOrder }, "IX_Forums_Forum_ForumGroupID_ForumOrder").IsClustered(); - - entity.Property(e => e.ForumImageMaxSideSize).HasDefaultValueSql("((400))"); - entity.Property(e => e.ForumIsAnswerLimit).HasDefaultValueSql("((5))"); - entity.Property(e => e.ForumIsLocked).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ForumCommunityGroup).WithMany(p => p.ForumsForums).HasConstraintName("FK_Forums_Forum_ForumCommunityGroupID_Community_Group"); - - entity.HasOne(d => d.ForumDocument).WithMany(p => p.ForumsForums).HasConstraintName("FK_Forums_Forum_ForumDocumentID_CMS_Document"); - - entity.HasOne(d => d.ForumGroup).WithMany(p => p.ForumsForums) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_Forum_ForumGroupID_Forums_ForumGroup"); - - entity.HasOne(d => d.ForumSite).WithMany(p => p.ForumsForums) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_Forum_ForumSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.GroupId).IsClustered(false); - - entity.HasIndex(e => new { e.GroupSiteId, e.GroupOrder }, "IX_Forums_ForumGroup_GroupSiteID_GroupOrder").IsClustered(); - - entity.Property(e => e.GroupHtmleditor).HasDefaultValueSql("((0))"); - entity.Property(e => e.GroupImageMaxSideSize).HasDefaultValueSql("((400))"); - entity.Property(e => e.GroupLastModified).HasDefaultValueSql("('11/6/2013 2:43:02 PM')"); - entity.Property(e => e.GroupName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GroupUseCaptcha).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.GroupGroup).WithMany(p => p.ForumsForumGroups).HasConstraintName("FK_Forums_ForumGroup_GroupGroupID_Community_Group"); - - entity.HasOne(d => d.GroupSite).WithMany(p => p.ForumsForumGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumGroup_GroupSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PostId).IsClustered(false); - - entity.HasIndex(e => e.PostIdpath, "IX_Forums_ForumPost_PostIDPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.PostAttachmentCount).HasDefaultValueSql("((0))"); - entity.Property(e => e.PostIsLocked).HasDefaultValueSql("((0))"); - entity.Property(e => e.PostQuestionSolved).HasDefaultValueSql("((0))"); - entity.Property(e => e.PostUserName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.PostApprovedByUser).WithMany(p => p.ForumsForumPostPostApprovedByUsers).HasConstraintName("FK_Forums_ForumPost_PostApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.PostForum).WithMany(p => p.ForumsForumPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumPost_PostForumID_Forums_Forum"); - - entity.HasOne(d => d.PostParent).WithMany(p => p.InversePostParent).HasConstraintName("FK_Forums_ForumPost_PostParentID_Forums_ForumPost"); - - entity.HasOne(d => d.PostUser).WithMany(p => p.ForumsForumPostPostUsers).HasConstraintName("FK_Forums_ForumPost_PostUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Forum).WithMany(p => p.ForumsForumRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumRoles_ForumID_Forums_Forum"); - - entity.HasOne(d => d.Permission).WithMany(p => p.ForumsForumRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumRoles_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.ForumsForumRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumRoles_RoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SubscriptionId).IsClustered(false); - - entity.HasIndex(e => new { e.SubscriptionEmail, e.SubscriptionForumId }, "IX_Forums_ForumSubscription_SubscriptionForumID_SubscriptionEmail").IsClustered(); - - entity.HasOne(d => d.SubscriptionForum).WithMany(p => p.ForumsForumSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumSubscription_SubscriptionForumID_Forums_Forum"); - - entity.HasOne(d => d.SubscriptionPost).WithMany(p => p.ForumsForumSubscriptions).HasConstraintName("FK_Forums_ForumSubscription_SubscriptionPostID_Forums_ForumPost"); - - entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.ForumsForumSubscriptions).HasConstraintName("FK_Forums_ForumSubscription_SubscriptionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FavoriteLastModified).HasDefaultValueSql("('12/4/2008 3:23:57 PM')"); - - entity.HasOne(d => d.Forum).WithMany(p => p.ForumsUserFavorites).HasConstraintName("FK_Forums_UserFavorites_ForumID_Forums_Forum"); - - entity.HasOne(d => d.Post).WithMany(p => p.ForumsUserFavorites).HasConstraintName("FK_Forums_UserFavorites_PostID_Forums_ForumPost"); - - entity.HasOne(d => d.Site).WithMany(p => p.ForumsUserFavorites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_UserFavorites_SiteID_CMS_Site"); - - entity.HasOne(d => d.User).WithMany(p => p.ForumsUserFavorites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_UserFavorites_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ConnectorId).IsClustered(false); - - entity.HasIndex(e => e.ConnectorDisplayName, "IX_Integration_Connector_ConnectorDisplayName").IsClustered(); - - entity.Property(e => e.ConnectorEnabled).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SyncLogSynchronization).WithMany(p => p.IntegrationSyncLogs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_SyncLog_SyncLogSynchronizationID_Integration_Synchronization"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SynchronizationConnector).WithMany(p => p.IntegrationSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_Synchronization_SynchronizationConnectorID_Integration_Connector"); - - entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.IntegrationSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_Synchronization_SynchronizationTaskID_Integration_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TaskId).IsClustered(false); - - entity.HasIndex(e => e.TaskNodeAliasPath, "IX_Integration_Task_TaskNodeAliasPath").IsClustered(); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.IntegrationTasks).HasConstraintName("FK_IntegrationTask_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DepartmentName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.OfficeSatisfaction).HasDefaultValueSql("(N'Neutral')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.FileId).IsClustered(false); - - entity.HasIndex(e => e.FilePath, "IX_Media_File_FilePath").IsClustered(); - - entity.Property(e => e.FileCreatedWhen).HasDefaultValueSql("('11/11/2008 4:10:00 PM')"); - entity.Property(e => e.FileModifiedWhen).HasDefaultValueSql("('11/11/2008 4:11:15 PM')"); - entity.Property(e => e.FileTitle).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FileCreatedByUser).WithMany(p => p.MediaFileFileCreatedByUsers).HasConstraintName("FK_Media_File_FileCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.FileLibrary).WithMany(p => p.MediaFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_File_FileLibraryID_Media_Library"); - - entity.HasOne(d => d.FileModifiedByUser).WithMany(p => p.MediaFileFileModifiedByUsers).HasConstraintName("FK_Media_File_FileModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.FileSite).WithMany(p => p.MediaFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_File_FileSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.LibraryId).IsClustered(false); - - entity.HasIndex(e => new { e.LibrarySiteId, e.LibraryDisplayName }, "IX_Media_Library_LibraryDisplayName").IsClustered(); - - entity.Property(e => e.LibraryName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.LibraryGroup).WithMany(p => p.MediaLibraries).HasConstraintName("FK_Media_Library_LibraryGroupID_Community_Group"); - - entity.HasOne(d => d.LibrarySite).WithMany(p => p.MediaLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_Library_LibrarySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Library).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_LibraryID_Media_Library"); - - entity.HasOne(d => d.Permission).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_RoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MessageId).IsClustered(false); - - entity.HasIndex(e => new { e.MessageRecipientUserId, e.MessageSent, e.MessageRecipientDeleted }, "IX_Messaging_Message_MessageRecipientUserID_MessageSent_MessageRecipientDeleted") - .IsDescending(false, true, false) - .IsClustered(); - - entity.Property(e => e.MessageRecipientNickName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MessageSenderNickName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MessageSubject).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.MessageRecipientUser).WithMany(p => p.MessagingMessageMessageRecipientUsers).HasConstraintName("FK_Messaging_Message_MessageRecipientUserID_CMS_User"); - - entity.HasOne(d => d.MessageSenderUser).WithMany(p => p.MessagingMessageMessageSenderUsers).HasConstraintName("FK_Messaging_Message_MessageSenderUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TestLastModified).HasDefaultValueSql("('12/5/2011 4:56:38 PM')"); - - entity.HasOne(d => d.TestIssue).WithOne(p => p.NewsletterAbtestTestIssue) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_ABTest_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.TestWinnerIssue).WithMany(p => p.NewsletterAbtestTestWinnerIssues).HasConstraintName("FK_Newsletter_ABTest_TestWinnerIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.TestWinnerScheduledTask).WithMany(p => p.NewsletterAbtests).HasConstraintName("FK_Newsletter_ABTest_TestWinnerScheduledTaskID_CMS_ScheduledTask"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ClickedLinkEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ClickedLinkNewsletterLink).WithMany(p => p.NewsletterClickedLinks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_ClickedLink_Newsletter_Link"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.EmailNewsletterIssue).WithMany(p => p.NewsletterEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Emails_EmailNewsletterIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.EmailSite).WithMany(p => p.NewsletterEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Emails_EmailSiteID_CMS_Site"); - - entity.HasOne(d => d.EmailSubscriber).WithMany(p => p.NewsletterEmails).HasConstraintName("FK_Newsletter_Emails_EmailSubscriberID_Newsletter_Subscriber"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TemplateId).IsClustered(false); - - entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateDisplayName").IsClustered(); - - entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TemplateIconClass).HasDefaultValueSql("(N'icon-accordion')"); - entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); - entity.Property(e => e.TemplateType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TemplateSite).WithMany(p => p.NewsletterEmailTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplate_TemplateSiteID_CMS_Site"); - - entity.HasMany(d => d.Newsletters).WithMany(p => p.Templates) - .UsingEntity>( - "NewsletterEmailTemplateNewsletter", - r => r.HasOne().WithMany() - .HasForeignKey("NewsletterId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_Newsletter"), - l => l.HasOne().WithMany() - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_EmailTemplate"), - j => - { - j.HasKey("TemplateId", "NewsletterId"); - j.ToTable("Newsletter_EmailTemplateNewsletter"); - j.HasIndex(new[] { "NewsletterId" }, "IX_Newsletter_EmailTemplateNewsletter_NewsletterID"); - j.IndexerProperty("TemplateId").HasColumnName("TemplateID"); - j.IndexerProperty("NewsletterId").HasColumnName("NewsletterID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailWidgetDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailWidgetIconCssClass).HasDefaultValueSql("(N'icon-cogwheel-square')"); - entity.Property(e => e.EmailWidgetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.EmailWidgetName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailWidgetSite).WithMany(p => p.NewsletterEmailWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidget_EmailWidgetSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.EmailWidget).WithMany(p => p.NewsletterEmailWidgetTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_EmailWidgetID_Newsletter_EmailWidget"); - - entity.HasOne(d => d.Template).WithMany(p => p.NewsletterEmailWidgetTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_TemplateID_Newsletter_EmailTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContactGroup).WithMany(p => p.NewsletterIssueContactGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_IssueContactGroup_ContactGroupID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.LinkIssue).WithMany(p => p.NewsletterLinks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Link_Newsletter_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.NewsletterId).IsClustered(false); - - entity.HasIndex(e => new { e.NewsletterSiteId, e.NewsletterDisplayName }, "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterDisplayName").IsClustered(); - - entity.Property(e => e.NewsletterDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterEnableOptIn).HasDefaultValueSql("((0))"); - entity.Property(e => e.NewsletterLastModified).HasDefaultValueSql("('3/13/2015 2:53:28 PM')"); - entity.Property(e => e.NewsletterLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.NewsletterName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterSendOptInConfirmation).HasDefaultValueSql("((0))"); - entity.Property(e => e.NewsletterSenderEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.NewsletterSenderName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterSource).HasDefaultValueSql("(N'T')"); - entity.Property(e => e.NewsletterTrackClickedLinks).HasDefaultValueSql("((1))"); - entity.Property(e => e.NewsletterTrackOpenEmails).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.NewsletterDynamicScheduledTask).WithMany(p => p.NewsletterNewsletters).HasConstraintName("FK_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID_CMS_ScheduledTask"); - - entity.HasOne(d => d.NewsletterOptInTemplate).WithMany(p => p.NewsletterNewsletterNewsletterOptInTemplates).HasConstraintName("FK_Newsletter_Newsletter_NewsletterOptInTemplateID_EmailTemplate"); - - entity.HasOne(d => d.NewsletterSite).WithMany(p => p.NewsletterNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Newsletter_NewsletterSiteID_CMS_Site"); - - entity.HasOne(d => d.NewsletterUnsubscriptionTemplate).WithMany(p => p.NewsletterNewsletterNewsletterUnsubscriptionTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID_Newsletter_EmailTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.IssueDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.IssueSubject).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.IssueNewsletter).WithMany(p => p.NewsletterNewsletterIssues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueNewsletterID_Newsletter_Newsletter"); - - entity.HasOne(d => d.IssueSite).WithMany(p => p.NewsletterNewsletterIssues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueSiteID_CMS_Site"); - - entity.HasOne(d => d.IssueTemplate).WithMany(p => p.NewsletterNewsletterIssues).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueTemplateID_Newsletter_EmailTemplate"); - - entity.HasOne(d => d.IssueVariantOfIssue).WithMany(p => p.InverseIssueVariantOfIssue).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueVariantOfIssue_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.OpenedEmailEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.OpenedEmailIssue).WithMany(p => p.NewsletterOpenedEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_OpenedEmail_OpenedEmailIssueID_Newsletter_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SubscriberId).IsClustered(false); - - entity.HasIndex(e => new { e.SubscriberSiteId, e.SubscriberFullName }, "IX_Newsletter_Subscriber_SubscriberSiteID_SubscriberFullName").IsClustered(); - - entity.Property(e => e.SubscriberType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SubscriberSite).WithMany(p => p.NewsletterSubscribers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Subscriber_SubscriberSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubscriptionApproved).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Newsletter).WithMany(p => p.NewsletterSubscriberNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_SubscriberNewsletter_NewsletterID_Newsletter_Newsletter"); - - entity.HasOne(d => d.Subscriber).WithMany(p => p.NewsletterSubscriberNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_SubscriberNewsletter_SubscriberID_Newsletter_Subscriber"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UnsubscriptionEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.UnsubscriptionFromIssue).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionFromIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.UnsubscriptionNewsletter).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionNewsletterID_Newsletter_Newsletter"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.GatewayId).IsClustered(false); - - entity.HasIndex(e => e.GatewayDisplayName, "IX_Notification_Gateway_GatewayDisplayName").IsClustered(); - - entity.Property(e => e.GatewayAssemblyName).HasDefaultValueSql("('')"); - entity.Property(e => e.GatewayClassName).HasDefaultValueSql("('')"); - entity.Property(e => e.GatewayDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.GatewayEnabled).HasDefaultValueSql("((0))"); - entity.Property(e => e.GatewayName).HasDefaultValueSql("('')"); - entity.Property(e => e.GatewaySupportsEmail).HasDefaultValueSql("((0))"); - entity.Property(e => e.GatewaySupportsHtmltext).HasDefaultValueSql("((0))"); - entity.Property(e => e.GatewaySupportsPlainText).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubscriptionEventDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.SubscriptionSiteId).HasDefaultValueSql("((0))"); - entity.Property(e => e.SubscriptionUseHtml).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.SubscriptionGateway).WithMany(p => p.NotificationSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_Subscription_SubscriptionGatewayID_Notification_Gateway"); - - entity.HasOne(d => d.SubscriptionSite).WithMany(p => p.NotificationSubscriptions).HasConstraintName("FK_Notification_Subscription_SubscriptionSiteID_CMS_Site"); - - entity.HasOne(d => d.SubscriptionTemplate).WithMany(p => p.NotificationSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_Subscription_SubscriptionTemplateID_Notification_Template"); - - entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.NotificationSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_Subscription_SubscriptionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TemplateId).IsClustered(false); - - entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Notification_Template_TemplateSiteID_TemplateDisplayName").IsClustered(); - - entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TemplateSite).WithMany(p => p.NotificationTemplates).HasConstraintName("FK_Notification_Template_TemplateSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Gateway).WithMany(p => p.NotificationTemplateTexts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_TemplateText_GatewayID_Notification_Gateway"); - - entity.HasOne(d => d.Template).WithMany(p => p.NotificationTemplateTexts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_TemplateText_TemplateID_Notification_Template"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AbtestDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.AbtestIncludedTraffic).HasDefaultValueSql("((100))"); - entity.Property(e => e.AbtestName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AbtestOriginalPage).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AbtestSite).WithMany(p => p.OmAbtests) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABTest_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AbvariantDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.AbvariantName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AbvariantSite).WithMany(p => p.OmAbvariants) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABVariant_CMS_Site"); - - entity.HasOne(d => d.AbvariantTest).WithMany(p => p.OmAbvariants) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABVariant_ABVariantTestID_OM_ABTest"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AccountCountry).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_Country"); - - entity.HasOne(d => d.AccountOwnerUser).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_User"); - - entity.HasOne(d => d.AccountPrimaryContact).WithMany(p => p.OmAccountAccountPrimaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_PrimaryContact"); - - entity.HasOne(d => d.AccountSecondaryContact).WithMany(p => p.OmAccountAccountSecondaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_SecondaryContact"); - - entity.HasOne(d => d.AccountState).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_State"); - - entity.HasOne(d => d.AccountStatus).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_OM_AccountStatus"); - - entity.HasOne(d => d.AccountSubsidiaryOf).WithMany(p => p.InverseAccountSubsidiaryOf).HasConstraintName("FK_OM_Account_OM_Account_SubsidiaryOf"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Account).WithMany(p => p.OmAccountContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_AccountContact_OM_Account"); - - entity.HasOne(d => d.Contact).WithMany(p => p.OmAccountContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_AccountContact_OM_Contact"); - - entity.HasOne(d => d.ContactRole).WithMany(p => p.OmAccountContacts).HasConstraintName("FK_OM_AccountContact_OM_ContactRole"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ActivityCampaign, "IX_OM_Activity_ActivityCampaign") - .HasFilter("([ActivityCampaign] IS NOT NULL)") - .HasFillFactor(90); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ActivityTypeEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ActivityTypeIsCustom).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactCreated).HasDefaultValueSql("('5/3/2011 10:51:13 AM')"); - entity.Property(e => e.ContactMonitored).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactSalesForceLeadReplicationDisabled).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactSalesForceLeadReplicationRequired).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ContactCountry).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_Country"); - - entity.HasOne(d => d.ContactOwnerUser).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_User"); - - entity.HasOne(d => d.ContactState).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_State"); - - entity.HasOne(d => d.ContactStatus).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_OM_ContactStatus"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ContactGroupId).HasName("PK_CMS_ContactGroup"); - - entity.Property(e => e.ContactGroupName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactGroupMemberFromCondition).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactGroupMemberFromManual).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ContactGroupMemberContactGroup).WithMany(p => p.OmContactGroupMembers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ContactGroupMembers_OM_ContactGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactRoleDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContactRoleName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactStatusDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContactStatusName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Contact).WithMany(p => p.OmMemberships) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_Membership_OM_Contact"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MvtcombinationIsDefault).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Mvtvariants).WithMany(p => p.Mvtcombinations) - .UsingEntity>( - "OmMvtcombinationVariation", - r => r.HasOne().WithMany() - .HasForeignKey("MvtvariantId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_MVTCombinationVariation_OM_MVTVariant"), - l => l.HasOne().WithMany() - .HasForeignKey("MvtcombinationId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_MVTCombinationVariation_OM_MVTCombination"), - j => - { - j.HasKey("MvtcombinationId", "MvtvariantId"); - j.ToTable("OM_MVTCombinationVariation"); - j.HasIndex(new[] { "MvtvariantId" }, "IX_OM_MVTCombinationVariation_MVTVariantID"); - j.IndexerProperty("MvtcombinationId").HasColumnName("MVTCombinationID"); - j.IndexerProperty("MvtvariantId").HasColumnName("MVTVariantID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MvtestDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.MvtestName).HasDefaultValueSql("('')"); - entity.Property(e => e.MvtestPage).HasDefaultValueSql("('')"); - entity.Property(e => e.MvtestTargetConversionType).HasDefaultValueSql("('TOTAL')"); - - entity.HasOne(d => d.MvtestSite).WithMany(p => p.OmMvtests) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_MVTest_MVTestSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MvtvariantEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MvtvariantName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.MvtvariantPageTemplate).WithMany(p => p.OmMvtvariants) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_MVTVariant_MVTVariantPageTemplateID_CMS_PageTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.VariantDisplayCondition).HasDefaultValueSql("('')"); - entity.Property(e => e.VariantDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.VariantEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.VariantName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.VariantDocument).WithMany(p => p.OmPersonalizationVariants).HasConstraintName("FK_OM_PersonalizationVariant_VariantDocumentID_CMS_Document"); - - entity.HasOne(d => d.VariantPageTemplate).WithMany(p => p.OmPersonalizationVariants) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_PersonalizationVariant_VariantPageTemplateID_CMS_PageTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.RuleDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.RuleName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); - entity.Property(e => e.RuleType).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.RuleScore).WithMany(p => p.OmRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_Rule_OM_Score"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Contact).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Contact"); - - entity.HasOne(d => d.Rule).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Rule"); - - entity.HasOne(d => d.Score).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Score"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.VisitorToContactContact).WithMany(p => p.OmVisitorToContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_VisitorToContact_OM_Contact_Cascade"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PersonaDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PersonaEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PersonaName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); - entity.Property(e => e.PersonaPointsThreshold).HasDefaultValueSql("((100))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PersonaContactHistoryDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.PersonaContactHistoryPersona).WithMany(p => p.PersonasPersonaContactHistories).HasConstraintName("FK_Personas_PersonaContactHistory_Personas_Persona"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Node).WithMany(p => p.PersonasPersonaNodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Personas_PersonaNode_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PollId).IsClustered(false); - - entity.HasIndex(e => new { e.PollSiteId, e.PollDisplayName }, "IX_Polls_Poll_PollSiteID_PollDisplayName").IsClustered(); - - entity.Property(e => e.PollCodeName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PollDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PollQuestion).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PollResponseMessage).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PollTitle).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PollGroup).WithMany(p => p.PollsPolls).HasConstraintName("FK_Polls_Poll_PollGroupID_Community_Group"); - - entity.HasOne(d => d.PollSite).WithMany(p => p.PollsPolls).HasConstraintName("FK_Polls_Poll_PollSiteID_CMS_Site"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Polls) - .UsingEntity>( - "PollsPollRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollRoles_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("PollId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollRoles_PollID_Polls_Poll"), - j => - { - j.HasKey("PollId", "RoleId"); - j.ToTable("Polls_PollRoles"); - j.HasIndex(new[] { "RoleId" }, "IX_Polls_PollRoles_RoleID"); - j.IndexerProperty("PollId").HasColumnName("PollID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - - entity.HasMany(d => d.Sites).WithMany(p => p.Polls) - .UsingEntity>( - "PollsPollSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("PollId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollSite_PollID_Polls_Poll"), - j => - { - j.HasKey("PollId", "SiteId"); - j.ToTable("Polls_PollSite"); - j.HasIndex(new[] { "SiteId" }, "IX_Polls_PollSite_SiteID"); - j.IndexerProperty("PollId").HasColumnName("PollID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AnswerId).IsClustered(false); - - entity.HasIndex(e => new { e.AnswerOrder, e.AnswerPollId, e.AnswerEnabled }, "IX_Polls_PollAnswer_AnswerPollID_AnswerOrder_AnswerEnabled").IsClustered(); - - entity.Property(e => e.AnswerHideForm).HasDefaultValueSql("((0))"); - entity.Property(e => e.AnswerText).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AnswerPoll).WithMany(p => p.PollsPollAnswers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollAnswer_AnswerPollID_Polls_Poll"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ReportId).IsClustered(false); - - entity.HasIndex(e => new { e.ReportDisplayName, e.ReportCategoryId }, "IX_Reporting_Report_ReportCategoryID_ReportDisplayName").IsClustered(); - - entity.Property(e => e.ReportAccess).HasDefaultValueSql("((1))"); - entity.Property(e => e.ReportDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportEnableSubscription).HasDefaultValueSql("((0))"); - entity.Property(e => e.ReportName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ReportCategory).WithMany(p => p.ReportingReports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_Report_ReportCategoryID_Reporting_ReportCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_Reporting_ReportCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_Reporting_ReportCategory_CategoryID_Reporting_ReportCategory_ParentCategoryID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.GraphReport).WithMany(p => p.ReportingReportGraphs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportGraph_GraphReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ReportSubscriptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ReportSubscriptionInterval).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportSubscriptionLastModified).HasDefaultValueSql("('3/9/2012 11:17:19 AM')"); - entity.Property(e => e.ReportSubscriptionOnlyNonEmpty).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ReportSubscriptionGraph).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionGraphID_Reporting_ReportGraph"); - - entity.HasOne(d => d.ReportSubscriptionReport).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionReportID_Reporting_Report"); - - entity.HasOne(d => d.ReportSubscriptionSite).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionSiteID_CMS_Site"); - - entity.HasOne(d => d.ReportSubscriptionTable).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionTableID_Reporting_ReportTable"); - - entity.HasOne(d => d.ReportSubscriptionUser).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionUserID_CMS_User"); - - entity.HasOne(d => d.ReportSubscriptionValue).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionValueID_Reporting_ReportValue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TableReport).WithMany(p => p.ReportingReportTables) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportTable_TableReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ValueReport).WithMany(p => p.ReportingReportValues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportValue_ValueReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SavedGraphSavedReport).WithMany(p => p.ReportingSavedGraphs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_SavedGraph_SavedGraphSavedReportID_Reporting_SavedReport"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SavedReportId).IsClustered(false); - - entity.HasIndex(e => new { e.SavedReportReportId, e.SavedReportDate }, "IX_Reporting_SavedReport_SavedReportReportID_SavedReportDate") - .IsDescending(false, true) - .IsClustered(); - - entity.HasOne(d => d.SavedReportCreatedByUser).WithMany(p => p.ReportingSavedReports).HasConstraintName("FK_Reporting_SavedReport_SavedReportCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.SavedReportReport).WithMany(p => p.ReportingSavedReports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_SavedReport_SavedReportReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SharePointConnectionAuthMode).HasDefaultValueSql("(N'default')"); - entity.Property(e => e.SharePointConnectionSharePointVersion).HasDefaultValueSql("(N'sp2010')"); - - entity.HasOne(d => d.SharePointConnectionSite).WithMany(p => p.SharePointSharePointConnections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointConnection_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SharePointFileEtag).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileExtension).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileMimeType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileServerRelativeUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SharePointFileSharePointLibrary).WithMany(p => p.SharePointSharePointFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointFile_SharePoint_SharePointLibrary"); - - entity.HasOne(d => d.SharePointFileSite).WithMany(p => p.SharePointSharePointFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointFile_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SharePointLibraryDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibraryLastModified).HasDefaultValueSql("('10/3/2014 2:45:04 PM')"); - entity.Property(e => e.SharePointLibraryListTitle).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibraryName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibrarySharePointConnectionId).HasDefaultValueSql("((0))"); - entity.Property(e => e.SharePointLibrarySynchronizationPeriod).HasDefaultValueSql("((720))"); - - entity.HasOne(d => d.SharePointLibrarySharePointConnection).WithMany(p => p.SharePointSharePointLibraries).HasConstraintName("FK_SharePoint_SharePointLibrary_SharePoint_SharePointConnection"); - - entity.HasOne(d => d.SharePointLibrarySite).WithMany(p => p.SharePointSharePointLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointLibrary_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookAccountPageAccessToken).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookAccountPageId).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FacebookAccountFacebookApplication).WithMany(p => p.SmFacebookAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookAccount_SM_FacebookApplication"); - - entity.HasOne(d => d.FacebookAccountSite).WithMany(p => p.SmFacebookAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookAccount_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookApplicationConsumerKey).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookApplicationConsumerSecret).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookApplicationLastModified).HasDefaultValueSql("('5/28/2013 1:02:36 PM')"); - - entity.HasOne(d => d.FacebookApplicationSite).WithMany(p => p.SmFacebookApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookPostIsCreatedByUser).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.FacebookPostFacebookAccount).WithMany(p => p.SmFacebookPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookPost_SM_FacebookAccount"); - - entity.HasOne(d => d.FacebookPostSite).WithMany(p => p.SmFacebookPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookPost_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.InsightExternalId).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitDays).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitMonths).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitWeeks).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitYears).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInAccountAccessToken).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountAccessTokenSecret).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountProfileId).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInApplicationConsumerKey).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationConsumerSecret).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.LinkedInApplicationSite).WithMany(p => p.SmLinkedInApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInPostComment).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInPostIsCreatedByUser).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.LinkedInPostLinkedInAccount).WithMany(p => p.SmLinkedInPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInPost_SM_LinkedInAccount"); - - entity.HasOne(d => d.LinkedInPostSite).WithMany(p => p.SmLinkedInPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInPost_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterAccountAccessToken).HasDefaultValueSql("('')"); - entity.Property(e => e.TwitterAccountAccessTokenSecret).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterAccountSite).WithMany(p => p.SmTwitterAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterAccount_CMS_Site"); - - entity.HasOne(d => d.TwitterAccountTwitterApplication).WithMany(p => p.SmTwitterAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterAccount_SM_TwitterApplication"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterApplicationConsumerKey).HasDefaultValueSql("('')"); - entity.Property(e => e.TwitterApplicationConsumerSecret).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterApplicationSite).WithMany(p => p.SmTwitterApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterPostIsCreatedByUser).HasDefaultValueSql("((1))"); - entity.Property(e => e.TwitterPostText).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterPostSite).WithMany(p => p.SmTwitterPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterPost_CMS_Site"); - - entity.HasOne(d => d.TwitterPostTwitterAccount).WithMany(p => p.SmTwitterPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterPost_SM_TwitterAccount"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ServerId).IsClustered(false); - - entity.HasIndex(e => new { e.ServerSiteId, e.ServerDisplayName }, "IX_Staging_Server_ServerSiteID_ServerDisplayName").IsClustered(); - - entity.Property(e => e.ServerAuthentication).HasDefaultValueSql("('USERNAME')"); - entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ServerEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ServerName).HasDefaultValueSql("('')"); - entity.Property(e => e.ServerUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ServerSite).WithMany(p => p.StagingServers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Server_ServerSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SynchronizationServer).WithMany(p => p.StagingSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Synchronization_SynchronizationServerID_Staging_Server"); - - entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.StagingSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Synchronization_SynchronizationTaskID_Staging_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskServers).HasDefaultValueSql("('null')"); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.StagingTasks).HasConstraintName("FK_Staging_Task_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskGroupCodeName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupTask_Staging_TaskGroup"); - - entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskGroupTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupTask_Staging_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupUser_Staging_TaskGroup"); - - entity.HasOne(d => d.User).WithOne(p => p.StagingTaskGroupUser) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupUser_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskUser_StagingTask"); - - entity.HasOne(d => d.User).WithMany(p => p.StagingTaskUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskUser_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CellPhone3G).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellPhoneBluetooth).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellPhoneEdge).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellPhoneGprs).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellPhoneGps).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellPhoneHscsd).HasDefaultValueSql("((0))"); - entity.Property(e => e.CellPhoneIrDa).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LaptopBluetooth).HasDefaultValueSql("((0))"); - entity.Property(e => e.LaptopWebcam).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MediaPlayerRadio).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TabletBluetooth).HasDefaultValueSql("((0))"); - entity.Property(e => e.TabletGps).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileDirectory).HasDefaultValueSql("('')"); - entity.Property(e => e.FileExtension).HasDefaultValueSql("('')"); - entity.Property(e => e.FileLastModified).HasDefaultValueSql("('6/29/2010 1:57:54 PM')"); - entity.Property(e => e.FileMimeType).HasDefaultValueSql("('')"); - entity.Property(e => e.FileName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Boards_BoardMessage_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ACLItem_ItemsAndOperators"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ObjectVersionHistoryUser_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_PageTemplateCategoryPageTemplate_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Relationship_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ResourceString_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ResourceTranslated_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_RoleResourcePermission_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Site_DocumentCount"); - - entity.Property(e => e.SiteId).ValueGeneratedOnAdd(); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_SiteRoleResourceUIElement_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Tree_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserDocuments"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRole_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRoleMembershipRole"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRole_MembershipRole_ValidOnly_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserSettingsRole_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_WebPartCategoryWebpart_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_WidgetCategoryWidget_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_COM_SKUOptionCategory_OptionCategory_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Community_Friend_Friends"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Community_Friend_RequestedFriends"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Community_Group"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Community_Member"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Forums_GroupForumPost_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Integration_Task_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Membership_MembershipUser_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Messaging_ContactList"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Messaging_IgnoreList"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Newsletter_Subscriptions_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_AccountContact_AccountJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_AccountContact_ContactJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_Account_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_ContactGroupMember_AccountJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_ContactGroupMember_ContactJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Poll_AnswerCount"); - - entity.Property(e => e.PollId).ValueGeneratedOnAdd(); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Reporting_CategoryReport_Joined"); - }); - - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; + +using Migration.Toolkit.K11.Models; + +namespace Migration.Toolkit.K11; + +public partial class K11Context : DbContext +{ + public K11Context() + { + } + + public K11Context(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet AnalyticsCampaigns { get; set; } + + public virtual DbSet AnalyticsCampaignAssets { get; set; } + + public virtual DbSet AnalyticsCampaignAssetUrls { get; set; } + + public virtual DbSet AnalyticsCampaignConversions { get; set; } + + public virtual DbSet AnalyticsCampaignConversionHits { get; set; } + + public virtual DbSet AnalyticsCampaignObjectives { get; set; } + + public virtual DbSet AnalyticsConversions { get; set; } + + public virtual DbSet AnalyticsDayHits { get; set; } + + public virtual DbSet AnalyticsExitPages { get; set; } + + public virtual DbSet AnalyticsHourHits { get; set; } + + public virtual DbSet AnalyticsMonthHits { get; set; } + + public virtual DbSet AnalyticsStatistics { get; set; } + + public virtual DbSet AnalyticsWeekHits { get; set; } + + public virtual DbSet AnalyticsYearHits { get; set; } + + public virtual DbSet BadWordsWords { get; set; } + + public virtual DbSet BlogComments { get; set; } + + public virtual DbSet BlogPostSubscriptions { get; set; } + + public virtual DbSet BoardBoards { get; set; } + + public virtual DbSet BoardMessages { get; set; } + + public virtual DbSet BoardSubscriptions { get; set; } + + public virtual DbSet ChatInitiatedChatRequests { get; set; } + + public virtual DbSet ChatMessages { get; set; } + + public virtual DbSet ChatNotifications { get; set; } + + public virtual DbSet ChatOnlineSupports { get; set; } + + public virtual DbSet ChatOnlineUsers { get; set; } + + public virtual DbSet ChatPopupWindowSettings { get; set; } + + public virtual DbSet ChatRooms { get; set; } + + public virtual DbSet ChatRoomUsers { get; set; } + + public virtual DbSet ChatSupportCannedResponses { get; set; } + + public virtual DbSet ChatSupportTakenRooms { get; set; } + + public virtual DbSet ChatUsers { get; set; } + + public virtual DbSet CiFileMetadata { get; set; } + + public virtual DbSet CiMigrations { get; set; } + + public virtual DbSet CmsAbuseReports { get; set; } + + public virtual DbSet CmsAcls { get; set; } + + public virtual DbSet CmsAclitems { get; set; } + + public virtual DbSet CmsAlternativeForms { get; set; } + + public virtual DbSet CmsAttachments { get; set; } + + public virtual DbSet CmsAttachmentHistories { get; set; } + + public virtual DbSet CmsAutomationHistories { get; set; } + + public virtual DbSet CmsAutomationStates { get; set; } + + public virtual DbSet CmsAvatars { get; set; } + + public virtual DbSet CmsBadges { get; set; } + + public virtual DbSet CmsBannedIps { get; set; } + + public virtual DbSet CmsBanners { get; set; } + + public virtual DbSet CmsBannerCategories { get; set; } + + public virtual DbSet CmsCategories { get; set; } + + public virtual DbSet CmsClasses { get; set; } + + public virtual DbSet CmsConsents { get; set; } + + public virtual DbSet CmsConsentAgreements { get; set; } + + public virtual DbSet CmsConsentArchives { get; set; } + + public virtual DbSet CmsCountries { get; set; } + + public virtual DbSet CmsCssStylesheets { get; set; } + + public virtual DbSet CmsCultures { get; set; } + + public virtual DbSet CmsDeviceProfiles { get; set; } + + public virtual DbSet CmsDeviceProfileLayouts { get; set; } + + public virtual DbSet CmsDocuments { get; set; } + + public virtual DbSet CmsDocumentAliases { get; set; } + + public virtual DbSet CmsDocumentTypeScopes { get; set; } + + public virtual DbSet CmsEmails { get; set; } + + public virtual DbSet CmsEmailAttachments { get; set; } + + public virtual DbSet CmsEmailTemplates { get; set; } + + public virtual DbSet CmsEmailUsers { get; set; } + + public virtual DbSet CmsEventLogs { get; set; } + + public virtual DbSet CmsExternalLogins { get; set; } + + public virtual DbSet CmsForms { get; set; } + + public virtual DbSet CmsFormUserControls { get; set; } + + public virtual DbSet CmsHelpTopics { get; set; } + + public virtual DbSet CmsLayouts { get; set; } + + public virtual DbSet CmsLicenseKeys { get; set; } + + public virtual DbSet CmsMacroIdentities { get; set; } + + public virtual DbSet CmsMacroRules { get; set; } + + public virtual DbSet CmsMemberships { get; set; } + + public virtual DbSet CmsMembershipUsers { get; set; } + + public virtual DbSet CmsMetaFiles { get; set; } + + public virtual DbSet CmsModuleLicenseKeys { get; set; } + + public virtual DbSet CmsModuleUsageCounters { get; set; } + + public virtual DbSet CmsObjectSettings { get; set; } + + public virtual DbSet CmsObjectVersionHistories { get; set; } + + public virtual DbSet CmsObjectWorkflowTriggers { get; set; } + + public virtual DbSet CmsOpenIdusers { get; set; } + + public virtual DbSet CmsPageTemplates { get; set; } + + public virtual DbSet CmsPageTemplateCategories { get; set; } + + public virtual DbSet CmsPageTemplateScopes { get; set; } + + public virtual DbSet CmsPermissions { get; set; } + + public virtual DbSet CmsPersonalizations { get; set; } + + public virtual DbSet CmsQueries { get; set; } + + public virtual DbSet CmsRelationships { get; set; } + + public virtual DbSet CmsRelationshipNames { get; set; } + + public virtual DbSet CmsResources { get; set; } + + public virtual DbSet CmsResourceLibraries { get; set; } + + public virtual DbSet CmsResourceStrings { get; set; } + + public virtual DbSet CmsResourceTranslations { get; set; } + + public virtual DbSet CmsRoles { get; set; } + + public virtual DbSet CmsScheduledTasks { get; set; } + + public virtual DbSet CmsSearchEngines { get; set; } + + public virtual DbSet CmsSearchIndices { get; set; } + + public virtual DbSet CmsSearchTasks { get; set; } + + public virtual DbSet CmsSearchTaskAzures { get; set; } + + public virtual DbSet CmsSessions { get; set; } + + public virtual DbSet CmsSettingsCategories { get; set; } + + public virtual DbSet CmsSettingsKeys { get; set; } + + public virtual DbSet CmsSites { get; set; } + + public virtual DbSet CmsSiteDomainAliases { get; set; } + + public virtual DbSet CmsSmtpservers { get; set; } + + public virtual DbSet CmsStates { get; set; } + + public virtual DbSet CmsTags { get; set; } + + public virtual DbSet CmsTagGroups { get; set; } + + public virtual DbSet CmsTemplateDeviceLayouts { get; set; } + + public virtual DbSet CmsTimeZones { get; set; } + + public virtual DbSet CmsTransformations { get; set; } + + public virtual DbSet CmsTranslationServices { get; set; } + + public virtual DbSet CmsTranslationSubmissions { get; set; } + + public virtual DbSet CmsTranslationSubmissionItems { get; set; } + + public virtual DbSet CmsTrees { get; set; } + + public virtual DbSet CmsUielements { get; set; } + + public virtual DbSet CmsUsers { get; set; } + + public virtual DbSet CmsUserCultures { get; set; } + + public virtual DbSet CmsUserMacroIdentities { get; set; } + + public virtual DbSet CmsUserRoles { get; set; } + + public virtual DbSet CmsUserSettings { get; set; } + + public virtual DbSet CmsUserSites { get; set; } + + public virtual DbSet CmsVersionHistories { get; set; } + + public virtual DbSet CmsWebFarmServers { get; set; } + + public virtual DbSet CmsWebFarmServerLogs { get; set; } + + public virtual DbSet CmsWebFarmServerMonitorings { get; set; } + + public virtual DbSet CmsWebFarmServerTasks { get; set; } + + public virtual DbSet CmsWebFarmTasks { get; set; } + + public virtual DbSet CmsWebParts { get; set; } + + public virtual DbSet CmsWebPartCategories { get; set; } + + public virtual DbSet CmsWebPartContainers { get; set; } + + public virtual DbSet CmsWebPartLayouts { get; set; } + + public virtual DbSet CmsWebTemplates { get; set; } + + public virtual DbSet CmsWidgets { get; set; } + + public virtual DbSet CmsWidgetCategories { get; set; } + + public virtual DbSet CmsWidgetRoles { get; set; } + + public virtual DbSet CmsWorkflows { get; set; } + + public virtual DbSet CmsWorkflowActions { get; set; } + + public virtual DbSet CmsWorkflowHistories { get; set; } + + public virtual DbSet CmsWorkflowScopes { get; set; } + + public virtual DbSet CmsWorkflowSteps { get; set; } + + public virtual DbSet CmsWorkflowStepRoles { get; set; } + + public virtual DbSet CmsWorkflowStepUsers { get; set; } + + public virtual DbSet CmsWorkflowTransitions { get; set; } + + public virtual DbSet ComAddresses { get; set; } + + public virtual DbSet ComBrands { get; set; } + + public virtual DbSet ComCarriers { get; set; } + + public virtual DbSet ComCollections { get; set; } + + public virtual DbSet ComCouponCodes { get; set; } + + public virtual DbSet ComCurrencies { get; set; } + + public virtual DbSet ComCurrencyExchangeRates { get; set; } + + public virtual DbSet ComCustomers { get; set; } + + public virtual DbSet ComCustomerCreditHistories { get; set; } + + public virtual DbSet ComDepartments { get; set; } + + public virtual DbSet ComDiscounts { get; set; } + + public virtual DbSet ComExchangeTables { get; set; } + + public virtual DbSet ComGiftCards { get; set; } + + public virtual DbSet ComGiftCardCouponCodes { get; set; } + + public virtual DbSet ComInternalStatuses { get; set; } + + public virtual DbSet ComManufacturers { get; set; } + + public virtual DbSet ComMultiBuyCouponCodes { get; set; } + + public virtual DbSet ComMultiBuyDiscounts { get; set; } + + public virtual DbSet ComMultiBuyDiscountBrands { get; set; } + + public virtual DbSet ComMultiBuyDiscountCollections { get; set; } + + public virtual DbSet ComMultiBuyDiscountTrees { get; set; } + + public virtual DbSet ComOptionCategories { get; set; } + + public virtual DbSet ComOrders { get; set; } + + public virtual DbSet ComOrderAddresses { get; set; } + + public virtual DbSet ComOrderItems { get; set; } + + public virtual DbSet ComOrderItemSkufiles { get; set; } + + public virtual DbSet ComOrderStatuses { get; set; } + + public virtual DbSet ComOrderStatusUsers { get; set; } + + public virtual DbSet ComPaymentOptions { get; set; } + + public virtual DbSet ComPublicStatuses { get; set; } + + public virtual DbSet ComShippingCosts { get; set; } + + public virtual DbSet ComShippingOptions { get; set; } + + public virtual DbSet ComShoppingCarts { get; set; } + + public virtual DbSet ComShoppingCartCouponCodes { get; set; } + + public virtual DbSet ComShoppingCartSkus { get; set; } + + public virtual DbSet ComSkus { get; set; } + + public virtual DbSet ComSkufiles { get; set; } + + public virtual DbSet ComSkuoptionCategories { get; set; } + + public virtual DbSet ComSuppliers { get; set; } + + public virtual DbSet ComTaxClasses { get; set; } + + public virtual DbSet ComTaxClassCountries { get; set; } + + public virtual DbSet ComTaxClassStates { get; set; } + + public virtual DbSet ComVolumeDiscounts { get; set; } + + public virtual DbSet ComWishlists { get; set; } + + public virtual DbSet CommunityFriends { get; set; } + + public virtual DbSet CommunityGroups { get; set; } + + public virtual DbSet CommunityGroupMembers { get; set; } + + public virtual DbSet CommunityGroupRolePermissions { get; set; } + + public virtual DbSet CommunityInvitations { get; set; } + + public virtual DbSet ContentArticles { get; set; } + + public virtual DbSet ContentBlogs { get; set; } + + public virtual DbSet ContentBlogMonths { get; set; } + + public virtual DbSet ContentBlogPosts { get; set; } + + public virtual DbSet ContentBookingEvents { get; set; } + + public virtual DbSet ContentCellphones { get; set; } + + public virtual DbSet ContentEbooks { get; set; } + + public virtual DbSet ContentEvents { get; set; } + + public virtual DbSet ContentFaqs { get; set; } + + public virtual DbSet ContentFiles { get; set; } + + public virtual DbSet ContentHeadlineBanners { get; set; } + + public virtual DbSet ContentImageGalleries { get; set; } + + public virtual DbSet ContentJobs { get; set; } + + public virtual DbSet ContentKbarticles { get; set; } + + public virtual DbSet ContentLaptops { get; set; } + + public virtual DbSet ContentMenuItems { get; set; } + + public virtual DbSet ContentNews { get; set; } + + public virtual DbSet ContentOffices { get; set; } + + public virtual DbSet ContentPressReleases { get; set; } + + public virtual DbSet ContentProducts { get; set; } + + public virtual DbSet ContentSimpleArticles { get; set; } + + public virtual DbSet ContentSmartphones { get; set; } + + public virtual DbSet ContentSoftwares { get; set; } + + public virtual DbSet CustomtableSampleTables { get; set; } + + public virtual DbSet DancingGoatArticles { get; set; } + + public virtual DbSet DancingGoatBrewers { get; set; } + + public virtual DbSet DancingGoatCaves { get; set; } + + public virtual DbSet DancingGoatCities { get; set; } + + public virtual DbSet DancingGoatCoffees { get; set; } + + public virtual DbSet DancingGoatEbooks { get; set; } + + public virtual DbSet DancingGoatElectricGrinders { get; set; } + + public virtual DbSet DancingGoatFilterPacks { get; set; } + + public virtual DbSet DancingGoatGrinders { get; set; } + + public virtual DbSet DancingGoatMemberships { get; set; } + + public virtual DbSet DancingGoatOffices { get; set; } + + public virtual DbSet DancingGoatPartnerCaves { get; set; } + + public virtual DbSet DancingGoatTablewares { get; set; } + + public virtual DbSet EcommerceCheckoutSteps { get; set; } + + public virtual DbSet EcommerceCheckoutWizards { get; set; } + + public virtual DbSet EventsAttendees { get; set; } + + public virtual DbSet ExportHistories { get; set; } + + public virtual DbSet ExportTasks { get; set; } + + public virtual DbSet FormContactUs { get; set; } + + public virtual DbSet FormDancingGoatBusinessCustomerRegistrations { get; set; } + + public virtual DbSet FormDancingGoatContactUs { get; set; } + + public virtual DbSet FormDancingGoatMachineRentals { get; set; } + + public virtual DbSet FormDancingGoatTryFreeSamples { get; set; } + + public virtual DbSet FormEcommerceSiteGeneralQuestions { get; set; } + + public virtual DbSet FormEcommerceSiteProductQuestions { get; set; } + + public virtual DbSet ForumsAttachments { get; set; } + + public virtual DbSet ForumsForums { get; set; } + + public virtual DbSet ForumsForumGroups { get; set; } + + public virtual DbSet ForumsForumPosts { get; set; } + + public virtual DbSet ForumsForumRoles { get; set; } + + public virtual DbSet ForumsForumSubscriptions { get; set; } + + public virtual DbSet ForumsUserFavorites { get; set; } + + public virtual DbSet IntegrationConnectors { get; set; } + + public virtual DbSet IntegrationSyncLogs { get; set; } + + public virtual DbSet IntegrationSynchronizations { get; set; } + + public virtual DbSet IntegrationTasks { get; set; } + + public virtual DbSet IntranetPortalDepartments { get; set; } + + public virtual DbSet IntranetPortalWorkingEnvironments { get; set; } + + public virtual DbSet MediaFiles { get; set; } + + public virtual DbSet MediaLibraries { get; set; } + + public virtual DbSet MediaLibraryRolePermissions { get; set; } + + public virtual DbSet MessagingMessages { get; set; } + + public virtual DbSet NewsletterAbtests { get; set; } + + public virtual DbSet NewsletterClickedLinks { get; set; } + + public virtual DbSet NewsletterEmails { get; set; } + + public virtual DbSet NewsletterEmailTemplates { get; set; } + + public virtual DbSet NewsletterEmailWidgets { get; set; } + + public virtual DbSet NewsletterEmailWidgetTemplates { get; set; } + + public virtual DbSet NewsletterIssueContactGroups { get; set; } + + public virtual DbSet NewsletterLinks { get; set; } + + public virtual DbSet NewsletterNewsletters { get; set; } + + public virtual DbSet NewsletterNewsletterIssues { get; set; } + + public virtual DbSet NewsletterOpenedEmails { get; set; } + + public virtual DbSet NewsletterSubscribers { get; set; } + + public virtual DbSet NewsletterSubscriberNewsletters { get; set; } + + public virtual DbSet NewsletterUnsubscriptions { get; set; } + + public virtual DbSet NotificationGateways { get; set; } + + public virtual DbSet NotificationSubscriptions { get; set; } + + public virtual DbSet NotificationTemplates { get; set; } + + public virtual DbSet NotificationTemplateTexts { get; set; } + + public virtual DbSet OmAbtests { get; set; } + + public virtual DbSet OmAbvariants { get; set; } + + public virtual DbSet OmAccounts { get; set; } + + public virtual DbSet OmAccountContacts { get; set; } + + public virtual DbSet OmAccountStatuses { get; set; } + + public virtual DbSet OmActivities { get; set; } + + public virtual DbSet OmActivityRecalculationQueues { get; set; } + + public virtual DbSet OmActivityTypes { get; set; } + + public virtual DbSet OmContacts { get; set; } + + public virtual DbSet OmContactChangeRecalculationQueues { get; set; } + + public virtual DbSet OmContactGroups { get; set; } + + public virtual DbSet OmContactGroupMembers { get; set; } + + public virtual DbSet OmContactRoles { get; set; } + + public virtual DbSet OmContactStatuses { get; set; } + + public virtual DbSet OmMemberships { get; set; } + + public virtual DbSet OmMvtcombinations { get; set; } + + public virtual DbSet OmMvtests { get; set; } + + public virtual DbSet OmMvtvariants { get; set; } + + public virtual DbSet OmPersonalizationVariants { get; set; } + + public virtual DbSet OmRules { get; set; } + + public virtual DbSet OmScores { get; set; } + + public virtual DbSet OmScoreContactRules { get; set; } + + public virtual DbSet OmVisitorToContacts { get; set; } + + public virtual DbSet PersonasPersonas { get; set; } + + public virtual DbSet PersonasPersonaContactHistories { get; set; } + + public virtual DbSet PersonasPersonaNodes { get; set; } + + public virtual DbSet PollsPolls { get; set; } + + public virtual DbSet PollsPollAnswers { get; set; } + + public virtual DbSet ReportingReports { get; set; } + + public virtual DbSet ReportingReportCategories { get; set; } + + public virtual DbSet ReportingReportGraphs { get; set; } + + public virtual DbSet ReportingReportSubscriptions { get; set; } + + public virtual DbSet ReportingReportTables { get; set; } + + public virtual DbSet ReportingReportValues { get; set; } + + public virtual DbSet ReportingSavedGraphs { get; set; } + + public virtual DbSet ReportingSavedReports { get; set; } + + public virtual DbSet SharePointSharePointConnections { get; set; } + + public virtual DbSet SharePointSharePointFiles { get; set; } + + public virtual DbSet SharePointSharePointLibraries { get; set; } + + public virtual DbSet SmFacebookAccounts { get; set; } + + public virtual DbSet SmFacebookApplications { get; set; } + + public virtual DbSet SmFacebookPosts { get; set; } + + public virtual DbSet SmInsights { get; set; } + + public virtual DbSet SmInsightHitDays { get; set; } + + public virtual DbSet SmInsightHitMonths { get; set; } + + public virtual DbSet SmInsightHitWeeks { get; set; } + + public virtual DbSet SmInsightHitYears { get; set; } + + public virtual DbSet SmLinkedInAccounts { get; set; } + + public virtual DbSet SmLinkedInApplications { get; set; } + + public virtual DbSet SmLinkedInPosts { get; set; } + + public virtual DbSet SmTwitterAccounts { get; set; } + + public virtual DbSet SmTwitterApplications { get; set; } + + public virtual DbSet SmTwitterPosts { get; set; } + + public virtual DbSet StagingServers { get; set; } + + public virtual DbSet StagingSynchronizations { get; set; } + + public virtual DbSet StagingTasks { get; set; } + + public virtual DbSet StagingTaskGroups { get; set; } + + public virtual DbSet StagingTaskGroupTasks { get; set; } + + public virtual DbSet StagingTaskGroupUsers { get; set; } + + public virtual DbSet StagingTaskUsers { get; set; } + + public virtual DbSet StorecontentBooks { get; set; } + + public virtual DbSet StorecontentCellPhones { get; set; } + + public virtual DbSet StorecontentComputers { get; set; } + + public virtual DbSet StorecontentCups { get; set; } + + public virtual DbSet StorecontentLaptops { get; set; } + + public virtual DbSet StorecontentMediaPlayers { get; set; } + + public virtual DbSet StorecontentPants { get; set; } + + public virtual DbSet StorecontentPerfumes { get; set; } + + public virtual DbSet StorecontentShoes { get; set; } + + public virtual DbSet StorecontentTablets { get; set; } + + public virtual DbSet StorecontentTshirts { get; set; } + + public virtual DbSet StorecontentTvs { get; set; } + + public virtual DbSet StorecontentWatches { get; set; } + + public virtual DbSet TempFiles { get; set; } + + public virtual DbSet ViewBoardsBoardMessageJoineds { get; set; } + + public virtual DbSet ViewCmsAclitemItemsAndOperators { get; set; } + + public virtual DbSet ViewCmsObjectVersionHistoryUserJoineds { get; set; } + + public virtual DbSet ViewCmsPageTemplateCategoryPageTemplateJoineds { get; set; } + + public virtual DbSet ViewCmsRelationshipJoineds { get; set; } + + public virtual DbSet ViewCmsResourceStringJoineds { get; set; } + + public virtual DbSet ViewCmsResourceTranslatedJoineds { get; set; } + + public virtual DbSet ViewCmsRoleResourcePermissionJoineds { get; set; } + + public virtual DbSet ViewCmsSiteDocumentCounts { get; set; } + + public virtual DbSet ViewCmsSiteRoleResourceUielementJoineds { get; set; } + + public virtual DbSet ViewCmsTreeJoineds { get; set; } + + public virtual DbSet ViewCmsUsers { get; set; } + + public virtual DbSet ViewCmsUserDocuments { get; set; } + + public virtual DbSet ViewCmsUserRoleJoineds { get; set; } + + public virtual DbSet ViewCmsUserRoleMembershipRoles { get; set; } + + public virtual DbSet ViewCmsUserRoleMembershipRoleValidOnlyJoineds { get; set; } + + public virtual DbSet ViewCmsUserSettingsRoleJoineds { get; set; } + + public virtual DbSet ViewCmsWebPartCategoryWebpartJoineds { get; set; } + + public virtual DbSet ViewCmsWidgetCategoryWidgetJoineds { get; set; } + + public virtual DbSet ViewComSkuoptionCategoryOptionCategoryJoineds { get; set; } + + public virtual DbSet ViewCommunityFriendFriends { get; set; } + + public virtual DbSet ViewCommunityFriendRequestedFriends { get; set; } + + public virtual DbSet ViewCommunityGroups { get; set; } + + public virtual DbSet ViewCommunityMembers { get; set; } + + public virtual DbSet ViewForumsGroupForumPostJoineds { get; set; } + + public virtual DbSet ViewIntegrationTaskJoineds { get; set; } + + public virtual DbSet ViewMembershipMembershipUserJoineds { get; set; } + + public virtual DbSet ViewMessagingContactLists { get; set; } + + public virtual DbSet ViewMessagingIgnoreLists { get; set; } + + public virtual DbSet ViewNewsletterSubscriptionsJoineds { get; set; } + + public virtual DbSet ViewOmAccountContactAccountJoineds { get; set; } + + public virtual DbSet ViewOmAccountContactContactJoineds { get; set; } + + public virtual DbSet ViewOmAccountJoineds { get; set; } + + public virtual DbSet ViewOmContactGroupMemberAccountJoineds { get; set; } + + public virtual DbSet ViewOmContactGroupMemberContactJoineds { get; set; } + + public virtual DbSet ViewPollAnswerCounts { get; set; } + + public virtual DbSet ViewReportingCategoryReportJoineds { get; set; } + + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CampaignName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CampaignScheduledTask).WithMany(p => p.AnalyticsCampaigns).HasConstraintName("FK_Analytics_Campaign_CampaignScheduledTaskID_ScheduledTask"); + + entity.HasOne(d => d.CampaignSite).WithMany(p => p.AnalyticsCampaigns) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_Campaign_StatisticsSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignAssetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CampaignAssetType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignAssetCampaign).WithMany(p => p.AnalyticsCampaignAssets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignAsset_CampaignAssetCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignAssetUrlPageTitle).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignAssetUrlTarget).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignAssetUrlCampaignAsset).WithMany(p => p.AnalyticsCampaignAssetUrls) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID_Analytics_CampaignAsset"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignConversionActivityType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignConversionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignConversionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CampaignConversionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignConversionCampaign).WithMany(p => p.AnalyticsCampaignConversions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignConversion_CampaignConversionCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignConversionHitsSourceName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignConversionHitsConversion).WithMany(p => p.AnalyticsCampaignConversionHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID_Analytics_CampaignConversion"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignObjectiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.CampaignObjectiveCampaignConversion).WithMany(p => p.AnalyticsCampaignObjectives) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID_Analytics_CampaignConversion"); + + entity.HasOne(d => d.CampaignObjectiveCampaign).WithOne(p => p.AnalyticsCampaignObjective) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ConversionId).HasName("PK_CMS_Conversion"); + + entity.HasOne(d => d.ConversionSite).WithMany(p => p.AnalyticsConversions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_Conversion_ConversionSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_DayHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsDayHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_DayHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_HourHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsHourHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_HourHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_MonthHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsMonthHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_MonthHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StatisticsId).IsClustered(false); + + entity.HasIndex(e => e.StatisticsCode, "IX_Analytics_Statistics_StatisticsCode_StatisticsSiteID_StatisticsObjectID_StatisticsObjectCulture").IsClustered(); + + entity.Property(e => e.StatisticsCode).HasDefaultValueSql("('')"); + entity.Property(e => e.StatisticsObjectCulture).HasDefaultValueSql("(N'')"); + entity.Property(e => e.StatisticsObjectName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.StatisticsSite).WithMany(p => p.AnalyticsStatistics).HasConstraintName("FK_Analytics_Statistics_StatisticsSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_WeekHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsWeekHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_WeekHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_YearHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsYearHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_YearHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WordId).IsClustered(false); + + entity.HasIndex(e => e.WordExpression, "IX_BadWords_Word_WordExpression").IsClustered(); + + entity.Property(e => e.WordExpression).HasDefaultValueSql("(N'')"); + + entity.HasMany(d => d.Cultures).WithMany(p => p.Words) + .UsingEntity>( + "BadWordsWordCulture", + r => r.HasOne().WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_BadWords_WordCulture_CultureID_CMS_Culture"), + l => l.HasOne().WithMany() + .HasForeignKey("WordId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_BadWords_WordCulture_WordID_BadWords_Word"), + j => + { + j.HasKey("WordId", "CultureId"); + j.ToTable("BadWords_WordCulture"); + j.HasIndex(new[] { "CultureId" }, "IX_BadWords_WordCulture_CultureID"); + j.IndexerProperty("WordId").HasColumnName("WordID"); + j.IndexerProperty("CultureId").HasColumnName("CultureID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CommentId).IsClustered(false); + + entity.HasIndex(e => e.CommentDate, "IX_Blog_Comment_CommentDate") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.CommentApproved).HasDefaultValueSql("((0))"); + entity.Property(e => e.CommentIsSpam).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.CommentApprovedByUser).WithMany(p => p.BlogCommentCommentApprovedByUsers).HasConstraintName("FK_Blog_Comment_CommentApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.CommentPostDocument).WithMany(p => p.BlogComments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Blog_Comment_CommentPostDocumentID_CMS_Document"); + + entity.HasOne(d => d.CommentUser).WithMany(p => p.BlogCommentCommentUsers).HasConstraintName("FK_Blog_Comment_CommentUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SubscriptionPostDocument).WithMany(p => p.BlogPostSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Blog_PostSubscription_SubscriptionPostDocumentID_CMS_Document"); + + entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.BlogPostSubscriptions).HasConstraintName("FK_Blog_PostSubscription_SubscriptionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BoardName).HasDefaultValueSql("('')"); + entity.Property(e => e.BoardRequireEmails).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.BoardDocument).WithMany(p => p.BoardBoards) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Board_BoardDocumentID_CMS_Document"); + + entity.HasOne(d => d.BoardGroup).WithMany(p => p.BoardBoards).HasConstraintName("FK_Board_Board_BoardGroupID_Community_Group"); + + entity.HasOne(d => d.BoardSite).WithMany(p => p.BoardBoards) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Board_BoardSiteID_CMS_Site"); + + entity.HasOne(d => d.BoardUser).WithMany(p => p.BoardBoards).HasConstraintName("FK_Board_Board_BoardUserID_CMS_User"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Boards) + .UsingEntity>( + "BoardRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Role_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("BoardId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Role_BoardID_Board_Board"), + j => + { + j.HasKey("BoardId", "RoleId"); + j.ToTable("Board_Role"); + j.HasIndex(new[] { "RoleId" }, "IX_Board_Role_RoleID"); + j.IndexerProperty("BoardId").HasColumnName("BoardID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + + entity.HasMany(d => d.Users).WithMany(p => p.Boards) + .UsingEntity>( + "BoardModerator", + r => r.HasOne().WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Moderator_UserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("BoardId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Moderator_BoardID_Board_Board"), + j => + { + j.HasKey("BoardId", "UserId"); + j.ToTable("Board_Moderator"); + j.HasIndex(new[] { "UserId" }, "IX_Board_Moderator_UserID"); + j.IndexerProperty("BoardId").HasColumnName("BoardID"); + j.IndexerProperty("UserId").HasColumnName("UserID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MessageId).IsClustered(false); + + entity.HasIndex(e => e.MessageInserted, "IX_Board_Message_MessageInserted") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.MessageEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MessageInserted).HasDefaultValueSql("('8/26/2008 12:14:50 PM')"); + entity.Property(e => e.MessageLastModified).HasDefaultValueSql("('8/26/2008 12:15:04 PM')"); + entity.Property(e => e.MessageText).HasDefaultValueSql("('')"); + entity.Property(e => e.MessageUrl).HasDefaultValueSql("('')"); + entity.Property(e => e.MessageUserInfo).HasDefaultValueSql("('')"); + entity.Property(e => e.MessageUserName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.MessageApprovedByUser).WithMany(p => p.BoardMessageMessageApprovedByUsers).HasConstraintName("FK_Board_Message_MessageApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.MessageBoard).WithMany(p => p.BoardMessagesNavigation) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Message_MessageBoardID_Board_Board"); + + entity.HasOne(d => d.MessageUser).WithMany(p => p.BoardMessageMessageUsers).HasConstraintName("FK_Board_Message_MessageUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubscriptionEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SubscriptionBoard).WithMany(p => p.BoardSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Subscription_SubscriptionBoardID_Board_Board"); + + entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.BoardSubscriptions).HasConstraintName("FK_Board_Subscription_SubscriptionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.InitiatedChatRequestState).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.InitiatedChatRequestInitiatorChatUser).WithMany(p => p.ChatInitiatedChatRequests) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_InitiatedChatRequest_Chat_User"); + + entity.HasOne(d => d.InitiatedChatRequestRoom).WithOne(p => p.ChatInitiatedChatRequest) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_InitiatedChatRequest_Chat_Room"); + + entity.HasOne(d => d.InitiatedChatRequestUser).WithMany(p => p.ChatInitiatedChatRequests).HasConstraintName("FK_Chat_InitiatedChatRequest_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatMessageId).HasName("PK_CMS_ChatMessage"); + + entity.Property(e => e.ChatMessageCreatedWhen).HasDefaultValueSql("('7/25/2011 2:47:18 PM')"); + entity.Property(e => e.ChatMessageIpaddress).HasDefaultValueSql("('')"); + entity.Property(e => e.ChatMessageLastModified).HasDefaultValueSql("('8/3/2011 11:24:54 AM')"); + entity.Property(e => e.ChatMessageText).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ChatMessageRecipient).WithMany(p => p.ChatMessageChatMessageRecipients).HasConstraintName("FK_Chat_Message_Chat_User_Recipient"); + + entity.HasOne(d => d.ChatMessageRoom).WithMany(p => p.ChatMessages) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_Message_Chat_Room"); + + entity.HasOne(d => d.ChatMessageUser).WithMany(p => p.ChatMessageChatMessageUsers).HasConstraintName("FK_Chat_Message_Chat_User_Sender"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatNotificationId).HasName("PK_CMS_ChatNotification"); + + entity.HasOne(d => d.ChatNotificationReceiver).WithMany(p => p.ChatNotificationChatNotificationReceivers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_Notification_Chat_User_Receiver"); + + entity.HasOne(d => d.ChatNotificationRoom).WithMany(p => p.ChatNotifications).HasConstraintName("FK_Chat_Notification_Chat_Room"); + + entity.HasOne(d => d.ChatNotificationSender).WithMany(p => p.ChatNotificationChatNotificationSenders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_Notification_Chat_User_Sender"); + + entity.HasOne(d => d.ChatNotificationSite).WithMany(p => p.ChatNotifications).HasConstraintName("FK_Chat_Notification_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ChatOnlineSupportChatUser).WithMany(p => p.ChatOnlineSupports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_OnlineSupport_Chat_User"); + + entity.HasOne(d => d.ChatOnlineSupportSite).WithMany(p => p.ChatOnlineSupports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_OnlineSupport_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ChatOnlineUserChatUser).WithMany(p => p.ChatOnlineUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_OnlineUser_Chat_User"); + + entity.HasOne(d => d.ChatOnlineUserSite).WithMany(p => p.ChatOnlineUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_OnlineUser_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatRoomId).HasName("PK_CMS_ChatRoom"); + + entity.Property(e => e.ChatRoomDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ChatRoomLastModification).HasDefaultValueSql("('10/19/2011 12:16:33 PM')"); + entity.Property(e => e.ChatRoomPrivateStateLastModification).HasDefaultValueSql("('1/30/2012 4:36:47 PM')"); + + entity.HasOne(d => d.ChatRoomCreatedByChatUser).WithMany(p => p.ChatRooms).HasConstraintName("FK_Chat_Room_Chat_User"); + + entity.HasOne(d => d.ChatRoomSite).WithMany(p => p.ChatRooms).HasConstraintName("FK_Chat_Room_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatRoomUserId).HasName("PK_CMS_ChatRoomUser"); + + entity.Property(e => e.ChatRoomUserLastModification).HasDefaultValueSql("('11/10/2011 3:29:00 PM')"); + + entity.HasOne(d => d.ChatRoomUserChatUser).WithMany(p => p.ChatRoomUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_RoomUser_Chat_User"); + + entity.HasOne(d => d.ChatRoomUserRoom).WithMany(p => p.ChatRoomUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_RoomUser_Chat_Room"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatSupportCannedResponseId).HasName("PK_CMS_ChatSupportCannedResponse"); + + entity.Property(e => e.ChatSupportCannedResponseTagName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ChatSupportCannedResponseChatUser).WithMany(p => p.ChatSupportCannedResponses).HasConstraintName("FK_Chat_SupportCannedResponse_Chat_User"); + + entity.HasOne(d => d.ChatSupportCannedResponseSite).WithMany(p => p.ChatSupportCannedResponses).HasConstraintName("FK_Chat_SupportCannedResponse_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatSupportTakenRoomId).HasName("PK_Chat_SupportTakenRooms"); + + entity.Property(e => e.ChatSupportTakenRoomLastModification).HasDefaultValueSql("('4/16/2012 5:11:30 PM')"); + + entity.HasOne(d => d.ChatSupportTakenRoomChatUser).WithMany(p => p.ChatSupportTakenRooms).HasConstraintName("FK_Chat_SupportTakenRoom_Chat_User"); + + entity.HasOne(d => d.ChatSupportTakenRoomRoom).WithMany(p => p.ChatSupportTakenRooms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_SupportTakenRoom_Chat_Room"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatUserId).HasName("PK_CMS_ChatUser"); + + entity.Property(e => e.ChatUserLastModification).HasDefaultValueSql("('2/20/2012 2:02:00 PM')"); + entity.Property(e => e.ChatUserNickname).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ChatUserUser).WithMany(p => p.ChatUsers).HasConstraintName("FK_Chat_User_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FileHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FileLocation).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ReportId).IsClustered(false); + + entity.HasIndex(e => e.ReportWhen, "IX_CMS_AbuseReport_ReportWhen") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.ReportComment).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportCulture).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportTitle).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportUrl).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportWhen).HasDefaultValueSql("('9/11/2008 4:32:15 PM')"); + + entity.HasOne(d => d.ReportSite).WithMany(p => p.CmsAbuseReports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AbuseReport_ReportSiteID_CMS_Site"); + + entity.HasOne(d => d.ReportUser).WithMany(p => p.CmsAbuseReports).HasConstraintName("FK_CMS_AbuseReport_ReportUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AclinheritedAcls).HasDefaultValueSql("('')"); + entity.Property(e => e.AcllastModified).HasDefaultValueSql("('10/30/2008 9:17:31 AM')"); + + entity.HasOne(d => d.Aclsite).WithMany(p => p.CmsAcls).HasConstraintName("FK_CMS_ACL_ACLSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Acl).WithMany(p => p.CmsAclitems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ACLItem_ACLID_CMS_ACL"); + + entity.HasOne(d => d.LastModifiedByUser).WithMany(p => p.CmsAclitemLastModifiedByUsers).HasConstraintName("FK_CMS_ACLItem_LastModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsAclitems).HasConstraintName("FK_CMS_ACLItem_RoleID_CMS_Role"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsAclitemUsers).HasConstraintName("FK_CMS_ACLItem_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormHideNewParentFields).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FormClass).WithMany(p => p.CmsAlternativeFormFormClasses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AlternativeForm_FormClassID_CMS_Class"); + + entity.HasOne(d => d.FormCoupledClass).WithMany(p => p.CmsAlternativeFormFormCoupledClasses).HasConstraintName("FK_CMS_AlternativeForm_FormCoupledClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AttachmentId).IsClustered(false); + + entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName, e.AttachmentIsUnsorted, e.AttachmentOrder }, "IX_CMS_Attachment_AttachmentDocumentID_AttachmentIsUnsorted_AttachmentName_AttachmentOrder").IsClustered(); + + entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_Attachment_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") + .IsUnique() + .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); + + entity.HasOne(d => d.AttachmentDocument).WithMany(p => p.CmsAttachments).HasConstraintName("FK_CMS_Attachment_AttachmentDocumentID_CMS_Document"); + + entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Attachment_AttachmentSiteID_CMS_Site"); + + entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_Attachment_AttachmentVariantParentID_CMS_Attachment"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AttachmentHistoryId).IsClustered(false); + + entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName }, "IX_CMS_AttachmentHistory_AttachmentDocumentID_AttachmentName").IsClustered(); + + entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_AttachmentHistory_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") + .IsUnique() + .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); + + entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachmentHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentHistory_AttachmentSiteID_CMS_Site"); + + entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_AttachmentHistory_AttachmentVariantParentID_CMS_AttachmentHistory"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); + entity.Property(e => e.HistoryStepDisplayName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.HistoryApprovedByUser).WithMany(p => p.CmsAutomationHistories).HasConstraintName("FK_CMS_AutomationHistory_HistoryApprovedByUserID"); + + entity.HasOne(d => d.HistoryState).WithMany(p => p.CmsAutomationHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationHistory_HistoryStateID"); + + entity.HasOne(d => d.HistoryStep).WithMany(p => p.CmsAutomationHistoryHistorySteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryStepID"); + + entity.HasOne(d => d.HistoryTargetStep).WithMany(p => p.CmsAutomationHistoryHistoryTargetSteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryTargetStepID"); + + entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsAutomationHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationHistory_HistoryWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.StateSite).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateSiteID_CMS_Site"); + + entity.HasOne(d => d.StateStep).WithMany(p => p.CmsAutomationStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationState_StateStepID"); + + entity.HasOne(d => d.StateUser).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateUserID_CMS_User"); + + entity.HasOne(d => d.StateWorkflow).WithMany(p => p.CmsAutomationStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationState_StateWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AvatarId).IsClustered(false); + + entity.HasIndex(e => e.AvatarName, "IX_CMS_Avatar_AvatarName").IsClustered(); + + entity.Property(e => e.DefaultFemaleUserAvatar).HasDefaultValueSql("((0))"); + entity.Property(e => e.DefaultGroupAvatar).HasDefaultValueSql("((0))"); + entity.Property(e => e.DefaultMaleUserAvatar).HasDefaultValueSql("((0))"); + entity.Property(e => e.DefaultUserAvatar).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.BadgeId).IsClustered(false); + + entity.HasIndex(e => e.BadgeTopLimit, "IX_CMS_Badge_BadgeTopLimit") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.BadgeDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.BadgeLastModified).HasDefaultValueSql("('9/25/2008 5:07:55 PM')"); + entity.Property(e => e.BadgeName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IpaddressId).IsClustered(false); + + entity.HasIndex(e => new { e.Ipaddress, e.IpaddressSiteId }, "IX_CMS_BannedIP_IPAddressSiteID_IPAddress").IsClustered(); + + entity.Property(e => e.IpaddressBanEnabled).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.IpaddressSite).WithMany(p => p.CmsBannedIps).HasConstraintName("FK_CMS_BannedIP_IPAddressSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BannerContent).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BannerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.BannerEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.BannerLastModified).HasDefaultValueSql("('1/1/1970 12:00:00 AM')"); + entity.Property(e => e.BannerName).HasDefaultValueSql("('')"); + entity.Property(e => e.BannerType).HasDefaultValueSql("((2))"); + entity.Property(e => e.BannerWeight).HasDefaultValueSql("((5))"); + + entity.HasOne(d => d.BannerCategory).WithMany(p => p.CmsBanners) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Banner_CMS_BannerCategory"); + + entity.HasOne(d => d.BannerSite).WithMany(p => p.CmsBanners).HasConstraintName("FK_CMS_Banner_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.BannerCategoryId).HasName("PK__CMS_BannerCategory"); + + entity.Property(e => e.BannerCategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.BannerCategoryEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.BannerCategoryLastModified).HasDefaultValueSql("('1/1/1970 12:00:00 AM')"); + entity.Property(e => e.BannerCategoryName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.BannerCategorySite).WithMany(p => p.CmsBannerCategories).HasConstraintName("FK_CMS_BannerCategory_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_CMS_Category_CategoryDisplayName_CategoryEnabled").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.CategorySite).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategorySiteID_CMS_Site"); + + entity.HasOne(d => d.CategoryUser).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategoryUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ClassId).IsClustered(false); + + entity.HasIndex(e => new { e.ClassId, e.ClassName, e.ClassDisplayName }, "IX_CMS_Class_ClassID_ClassName_ClassDisplayName").IsClustered(); + + entity.Property(e => e.ClassIsContentOnly).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ClassDefaultPageTemplate).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassDefaultPageTemplateID_CMS_PageTemplate"); + + entity.HasOne(d => d.ClassPageTemplateCategory).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassPageTemplateCategoryID_CMS_PageTemplateCategory"); + + entity.HasOne(d => d.ClassResource).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassResourceID_CMS_Resource"); + + entity.HasMany(d => d.ChildClasses).WithMany(p => p.ParentClasses) + .UsingEntity>( + "CmsAllowedChildClass", + r => r.HasOne().WithMany() + .HasForeignKey("ChildClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ParentClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), + j => + { + j.HasKey("ParentClassId", "ChildClassId"); + j.ToTable("CMS_AllowedChildClasses"); + j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); + j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); + j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); + }); + + entity.HasMany(d => d.ParentClasses).WithMany(p => p.ChildClasses) + .UsingEntity>( + "CmsAllowedChildClass", + r => r.HasOne().WithMany() + .HasForeignKey("ParentClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ChildClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), + j => + { + j.HasKey("ParentClassId", "ChildClassId"); + j.ToTable("CMS_AllowedChildClasses"); + j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); + j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); + j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); + }); + + entity.HasMany(d => d.Sites).WithMany(p => p.Classes) + .UsingEntity>( + "CmsClassSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Class_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Class_ClassID_CMS_Class"), + j => + { + j.HasKey("ClassId", "SiteId"); + j.ToTable("CMS_ClassSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_ClassSite_SiteID"); + j.IndexerProperty("ClassId").HasColumnName("ClassID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentContent).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.ConsentName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentAgreementTime).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ConsentAgreementConsent).WithMany(p => p.CmsConsentAgreements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementConsentID_CMS_Consent"); + + entity.HasOne(d => d.ConsentAgreementContact).WithMany(p => p.CmsConsentAgreements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementContactID_OM_Contact"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentArchiveContent).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentArchiveHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentArchiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ConsentArchiveConsent).WithMany(p => p.CmsConsentArchives) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentArchive_ConsentArchiveConsentID_CMS_Consent"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CountryId).IsClustered(false); + + entity.HasIndex(e => e.CountryDisplayName, "IX_CMS_Country_CountryDisplayName").IsClustered(); + + entity.Property(e => e.CountryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CountryLastModified).HasDefaultValueSql("('11/14/2013 1:43:04 PM')"); + entity.Property(e => e.CountryName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StylesheetId).IsClustered(false); + + entity.HasIndex(e => e.StylesheetDisplayName, "IX_CMS_CssStylesheet_StylesheetDisplayName").IsClustered(); + + entity.Property(e => e.StylesheetDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.StylesheetDynamicLanguage).HasDefaultValueSql("('plaincss')"); + entity.Property(e => e.StylesheetName).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Stylesheets) + .UsingEntity>( + "CmsCssStylesheetSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_CssStylesheetSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("StylesheetId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_CssStylesheetSite_StylesheetID_CMS_CssStylesheet"), + j => + { + j.HasKey("StylesheetId", "SiteId"); + j.ToTable("CMS_CssStylesheetSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_CssStylesheetSite_SiteID"); + j.IndexerProperty("StylesheetId").HasColumnName("StylesheetID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CultureId).IsClustered(false); + + entity.HasIndex(e => e.CultureName, "IX_CMS_Culture_CultureName").IsClustered(); + + entity.Property(e => e.CultureIsUiculture).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ProfileEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ProfileName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.DeviceProfile).WithMany(p => p.CmsDeviceProfileLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DeviceProfileLayout_DeviceProfileID_CMS_DeviceProfile"); + + entity.HasOne(d => d.SourceLayout).WithMany(p => p.CmsDeviceProfileLayoutSourceLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DeviceProfileLayout_SourceLayoutID_CMS_Layout"); + + entity.HasOne(d => d.TargetLayout).WithMany(p => p.CmsDeviceProfileLayoutTargetLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DeviceProfileLayout_TargetLayoutID_CMS_Layout"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DocumentCanBePublished).HasDefaultValueSql("((1))"); + entity.Property(e => e.DocumentInheritsStylesheet).HasDefaultValueSql("((1))"); + entity.Property(e => e.DocumentMenuRedirectToFirstChild).HasDefaultValueSql("((0))"); + entity.Property(e => e.DocumentUseCustomExtensions).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.DocumentCheckedOutByUser).WithMany(p => p.CmsDocumentDocumentCheckedOutByUsers).HasConstraintName("FK_CMS_Document_DocumentCheckedOutByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentCheckedOutVersionHistory).WithMany(p => p.CmsDocumentDocumentCheckedOutVersionHistories).HasConstraintName("FK_CMS_Document_DocumentCheckedOutVersionHistoryID_CMS_VersionHistory"); + + entity.HasOne(d => d.DocumentCreatedByUser).WithMany(p => p.CmsDocumentDocumentCreatedByUsers).HasConstraintName("FK_CMS_Document_DocumentCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentModifiedByUser).WithMany(p => p.CmsDocumentDocumentModifiedByUsers).HasConstraintName("FK_CMS_Document_DocumentModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentNode).WithMany(p => p.CmsDocuments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Document_DocumentNodeID_CMS_Tree"); + + entity.HasOne(d => d.DocumentPageTemplate).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentPageTemplateID_CMS_Template"); + + entity.HasOne(d => d.DocumentPublishedVersionHistory).WithMany(p => p.CmsDocumentDocumentPublishedVersionHistories).HasConstraintName("FK_CMS_Document_DocumentPublishedVersionHistoryID_CMS_VersionHistory"); + + entity.HasOne(d => d.DocumentStylesheet).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentStylesheetID_CMS_CssStylesheet"); + + entity.HasOne(d => d.DocumentTagGroup).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentTagGroupID_CMS_TagGroup"); + + entity.HasOne(d => d.DocumentWorkflowStep).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentWorkflowStepID_CMS_WorkflowStep"); + + entity.HasMany(d => d.Categories).WithMany(p => p.Documents) + .UsingEntity>( + "CmsDocumentCategory", + r => r.HasOne().WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentCategory_CategoryID_CMS_Category"), + l => l.HasOne().WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentCategory_DocumentID_CMS_Document"), + j => + { + j.HasKey("DocumentId", "CategoryId"); + j.ToTable("CMS_DocumentCategory"); + j.HasIndex(new[] { "CategoryId" }, "IX_CMS_DocumentCategory_CategoryID"); + j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); + j.IndexerProperty("CategoryId").HasColumnName("CategoryID"); + }); + + entity.HasMany(d => d.Tags).WithMany(p => p.Documents) + .UsingEntity>( + "CmsDocumentTag", + r => r.HasOne().WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTag_TagID_CMS_Tag"), + l => l.HasOne().WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTag_DocumentID_CMS_Document"), + j => + { + j.HasKey("DocumentId", "TagId"); + j.ToTable("CMS_DocumentTag"); + j.HasIndex(new[] { "TagId" }, "IX_CMS_DocumentTag_TagID"); + j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); + j.IndexerProperty("TagId").HasColumnName("TagID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AliasId).IsClustered(false); + + entity.HasIndex(e => e.AliasUrlpath, "IX_CMS_DocumentAlias_AliasURLPath").IsClustered(); + + entity.Property(e => e.AliasCulture).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AliasExtensions).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AliasLastModified).HasDefaultValueSql("('10/22/2008 12:55:43 PM')"); + entity.Property(e => e.AliasUrlpath).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AliasNode).WithMany(p => p.CmsDocumentAliases) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentAlias_AliasNodeID_CMS_Tree"); + + entity.HasOne(d => d.AliasSite).WithMany(p => p.CmsDocumentAliases) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentAlias_AliasSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ScopeId).IsClustered(false); + + entity.HasIndex(e => e.ScopePath, "IX_CMS_DocumentTypeScope_ScopePath").IsClustered(); + + entity.Property(e => e.ScopeAllowAbvariant).HasDefaultValueSql("((0))"); + entity.Property(e => e.ScopeAllowAllTypes).HasDefaultValueSql("((0))"); + entity.Property(e => e.ScopeAllowLinks).HasDefaultValueSql("((0))"); + entity.Property(e => e.ScopeLastModified).HasDefaultValueSql("('4/30/2013 2:47:21 PM')"); + entity.Property(e => e.ScopePath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsDocumentTypeScopes).HasConstraintName("FK_CMS_DocumentTypeScope_ScopeSiteID_CMS_Site"); + + entity.HasMany(d => d.Classes).WithMany(p => p.Scopes) + .UsingEntity>( + "CmsDocumentTypeScopeClass", + r => r.HasOne().WithMany() + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ScopeID_CMS_DocumentTypeScope"), + j => + { + j.HasKey("ScopeId", "ClassId"); + j.ToTable("CMS_DocumentTypeScopeClass"); + j.HasIndex(new[] { "ClassId" }, "IX_CMS_DocumentTypeScopeClass_ClassID"); + j.IndexerProperty("ScopeId").HasColumnName("ScopeID"); + j.IndexerProperty("ClassId").HasColumnName("ClassID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailFrom).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EmailIsMass).HasDefaultValueSql("((1))"); + entity.Property(e => e.EmailLastModified).HasDefaultValueSql("('6/17/2016 10:11:21 AM')"); + entity.Property(e => e.EmailSubject).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Attachments).WithMany(p => p.Emails) + .UsingEntity>( + "CmsAttachmentForEmail", + r => r.HasOne().WithMany() + .HasForeignKey("AttachmentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentForEmail_AttachmentID_CMS_EmailAttachment"), + l => l.HasOne().WithMany() + .HasForeignKey("EmailId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentForEmail_EmailID_CMS_Email"), + j => + { + j.HasKey("EmailId", "AttachmentId"); + j.ToTable("CMS_AttachmentForEmail"); + j.HasIndex(new[] { "AttachmentId" }, "IX_CMS_AttachmentForEmail_AttachmentID"); + j.IndexerProperty("EmailId").HasColumnName("EmailID"); + j.IndexerProperty("AttachmentId").HasColumnName("AttachmentID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.EmailTemplateId).IsClustered(false); + + entity.HasIndex(e => e.EmailTemplateDisplayName, "IX_CMS_EmailTemplate_EmailTemplateDisplayName").IsClustered(); + + entity.Property(e => e.EmailTemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.EmailTemplateName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.EmailTemplateSite).WithMany(p => p.CmsEmailTemplates).HasConstraintName("FK_CMS_Email_EmailTemplateSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Email).WithMany(p => p.CmsEmailUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_EmailUser_EmailID_CMS_Email"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsEmailUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_EmailUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DocumentName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventMachineName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventTime).HasDefaultValueSql("('4/21/2015 8:21:43 AM')"); + entity.Property(e => e.EventType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventUrl).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventUrlReferrer).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Ipaddress).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Source).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.User).WithMany(p => p.CmsExternalLogins) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ExternalLogin_UserID_CMS_User")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FormId).IsClustered(false); + + entity.HasIndex(e => e.FormDisplayName, "IX_CMS_Form_FormDisplayName").IsClustered(); + + entity.Property(e => e.FormConfirmationEmailSubject).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormEmailAttachUploadedDocs).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormLastModified).HasDefaultValueSql("('9/17/2012 1:37:08 PM')"); + entity.Property(e => e.FormLogActivity).HasDefaultValueSql("((1))"); + entity.Property(e => e.FormName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormSubmitButtonText).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.FormClass).WithMany(p => p.CmsForms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Form_FormClassID_CMS_Class"); + + entity.HasOne(d => d.FormSite).WithMany(p => p.CmsForms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Form_FormSiteID_CMS_Site"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Forms) + .UsingEntity>( + "CmsFormRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_FormRole_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("FormId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_FormRole_FormID_CMS_Form"), + j => + { + j.HasKey("FormId", "RoleId"); + j.ToTable("CMS_FormRole"); + j.HasIndex(new[] { "RoleId" }, "IX_CMS_FormRole_RoleID"); + j.IndexerProperty("FormId").HasColumnName("FormID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.UserControlId).IsClustered(false); + + entity.HasIndex(e => e.UserControlDisplayName, "IX_CMS_FormUserControl_UserControlDisplayName").IsClustered(); + + entity.Property(e => e.UserControlIsSystem).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserControlPriority).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserControlShowInCustomTables).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.UserControlParent).WithMany(p => p.InverseUserControlParent).HasConstraintName("FK_CMS_FormUserControl_UserControlParentID_CMS_FormUserControl"); + + entity.HasOne(d => d.UserControlResource).WithMany(p => p.CmsFormUserControls).HasConstraintName("FK_CMS_FormUserControl_UserControlResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HelpTopicLink).HasDefaultValueSql("(N'')"); + entity.Property(e => e.HelpTopicName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.HelpTopicUielement).WithMany(p => p.CmsHelpTopics) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_HelpTopic_HelpTopicUIElementID_CMS_UIElement"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LayoutCode).HasDefaultValueSql("('')"); + entity.Property(e => e.LayoutCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.LayoutDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LayoutIconClass).HasDefaultValueSql("(N'icon-layout')"); + entity.Property(e => e.LayoutIsConvertible).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LicenseKeyId).IsClustered(false); + + entity.HasIndex(e => e.LicenseDomain, "IX_CMS_LicenseKey_LicenseDomain").IsClustered(); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.MacroIdentityName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.MacroIdentityEffectiveUser).WithMany(p => p.CmsMacroIdentities).HasConstraintName("FK_CMS_MacroIdentity_MacroIdentityEffectiveUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MacroRuleCondition).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MacroRuleDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.MacroRuleEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MacroRuleIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.MacroRuleLastModified).HasDefaultValueSql("('5/1/2012 8:46:33 AM')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.MembershipSite).WithMany(p => p.CmsMemberships).HasConstraintName("FK_CMS_Membership_MembershipSiteID_CMS_Site"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Memberships) + .UsingEntity>( + "CmsMembershipRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipRole_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("MembershipId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipRole_MembershipID_CMS_Membership"), + j => + { + j.HasKey("MembershipId", "RoleId"); + j.ToTable("CMS_MembershipRole"); + j.HasIndex(new[] { "RoleId" }, "IX_CMS_MembershipRole_RoleID"); + j.IndexerProperty("MembershipId").HasColumnName("MembershipID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Membership).WithMany(p => p.CmsMembershipUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipUser_MembershipID_CMS_Membership"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsMembershipUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MetaFileId).IsClustered(false); + + entity.HasIndex(e => new { e.MetaFileObjectType, e.MetaFileObjectId, e.MetaFileGroupName }, "IX_CMS_Metafile_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName").IsClustered(); + + entity.HasOne(d => d.MetaFileSite).WithMany(p => p.CmsMetaFiles).HasConstraintName("FK_CMS_MetaFile_MetaFileSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ModuleLicenseKeyLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.ModuleLicenseKeyLicense).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ModuleLicenseKeyResource).WithMany(p => p.CmsModuleLicenseKeys) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.ModuleUsageCounterName, "IX_CMS_ModuleUsageCounter_ModuleUsageCounterName") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.ModuleUsageCounterId).ValueGeneratedOnAdd(); + entity.Property(e => e.ModuleUsageCounterName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ObjectSettingsObjectType).HasDefaultValueSql("('')"); + entity.Property(e => e.ObjectWorkflowSendEmails).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.ObjectCheckedOutByUser).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutByUserID_CMS_User"); + + entity.HasOne(d => d.ObjectCheckedOutVersionHistory).WithMany(p => p.CmsObjectSettingObjectCheckedOutVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID_CMS_ObjectVersionHistory"); + + entity.HasOne(d => d.ObjectPublishedVersionHistory).WithMany(p => p.CmsObjectSettingObjectPublishedVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectPublishedVersionHistoryID_CMS_ObjectVersionHistory"); + + entity.HasOne(d => d.ObjectWorkflowStep).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectWorkflowStepID_CMS_WorkflowStep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.VersionId) + .HasName("PK_CMS_ObjectVersionHistory_VersionID") + .IsClustered(false); + + entity.HasIndex(e => new { e.VersionObjectType, e.VersionObjectId, e.VersionId }, "PK_CMS_ObjectVersionHistory") + .IsUnique() + .IsDescending(false, false, true) + .IsClustered(); + + entity.Property(e => e.VersionNumber).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionDeletedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionModifiedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionModifiedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionObjectSite).WithMany(p => p.CmsObjectVersionHistories).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionObjectSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TriggerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TriggerObjectType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TriggerWorkflow).WithMany(p => p.CmsObjectWorkflowTriggers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ObjectWorkflowTrigger_TriggerWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.OpenId).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsOpenIdusers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_OpenIDUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PageTemplateId).IsClustered(false); + + entity.HasIndex(e => e.PageTemplateCategoryId, "IX_CMS_PageTemplate_PageTemplateCategoryID").IsClustered(); + + entity.Property(e => e.PageTemplateCloneAsAdHoc).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.PageTemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.PageTemplateForAllPages).HasDefaultValueSql("((1))"); + entity.Property(e => e.PageTemplateIconClass).HasDefaultValueSql("(N'icon-layout')"); + entity.Property(e => e.PageTemplateIsLayout).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateIsReusable).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateShowAsMasterTemplate).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateType).HasDefaultValueSql("(N'portal')"); + + entity.HasOne(d => d.PageTemplateCategory).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateCategoryID_CMS_PageTemplateCategory"); + + entity.HasOne(d => d.PageTemplateLayoutNavigation).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateLayoutID_CMS_Layout"); + + entity.HasOne(d => d.PageTemplateSite).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateSiteID_CMS_Site"); + + entity.HasMany(d => d.Sites).WithMany(p => p.PageTemplates) + .UsingEntity>( + "CmsPageTemplateSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageTemplateSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("PageTemplateId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageTemplateSite_PageTemplateID_CMS_PageTemplate"), + j => + { + j.HasKey("PageTemplateId", "SiteId"); + j.ToTable("CMS_PageTemplateSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_PageTemplateSite_SiteID"); + j.IndexerProperty("PageTemplateId").HasColumnName("PageTemplateID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_CMS_PageTemplateCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryChildCount).HasDefaultValueSql("((0))"); + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryTemplateChildCount).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_PageTemplateCategory_CategoryParentID_CMS_PageTemplateCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PageTemplateScopeId).IsClustered(false); + + entity.HasIndex(e => e.PageTemplateScopePath, "IX_CMS_PageTemplateScope_PageTemplateScopePath").IsClustered(); + + entity.Property(e => e.PageTemplateScopeLastModified).HasDefaultValueSql("('2/22/2010 9:30:07 AM')"); + entity.Property(e => e.PageTemplateScopePath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.PageTemplateScopeClass).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeClassID_CMS_Class"); + + entity.HasOne(d => d.PageTemplateScopeCulture).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeCultureID_CMS_Culture"); + + entity.HasOne(d => d.PageTemplateScopeSite).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeSiteID_CMS_Site"); + + entity.HasOne(d => d.PageTemplateScopeTemplate).WithMany(p => p.CmsPageTemplateScopes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeTemplateID_CMS_PageTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PermissionDisplayInMatrix).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.Class).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ClassID_CMS_Class"); + + entity.HasOne(d => d.Resource).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PersonalizationId).IsClustered(false); + + entity.HasIndex(e => e.PersonalizationDocumentId, "IX_CMS_Personalization_PersonalizationUserID_PersonalizationDocumentID").IsClustered(); + + entity.Property(e => e.PersonalizationLastModified).HasDefaultValueSql("('9/2/2008 5:36:59 PM')"); + + entity.HasOne(d => d.PersonalizationDocument).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationDocumentID_CMS_Document"); + + entity.HasOne(d => d.PersonalizationSite).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationSiteID_CMS_Site"); + + entity.HasOne(d => d.PersonalizationUser).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.QueryIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.QueryName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.Class).WithMany(p => p.CmsQueries).HasConstraintName("FK_CMS_Query_ClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.LeftNode).WithMany(p => p.CmsRelationshipLeftNodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_LeftNodeID_CMS_Tree"); + + entity.HasOne(d => d.RelationshipName).WithMany(p => p.CmsRelationships) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_RelationshipNameID_CMS_RelationshipName"); + + entity.HasOne(d => d.RightNode).WithMany(p => p.CmsRelationshipRightNodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_RightNodeID_CMS_Tree"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.RelationshipDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.RelationshipName).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Sites).WithMany(p => p.RelationshipNames) + .UsingEntity>( + "CmsRelationshipNameSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RelationshipNameSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("RelationshipNameId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RelationshipNameSite_RelationshipNameID_CMS_RelationshipName"), + j => + { + j.HasKey("RelationshipNameId", "SiteId"); + j.ToTable("CMS_RelationshipNameSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_RelationshipNameSite_SiteID"); + j.IndexerProperty("RelationshipNameId").HasColumnName("RelationshipNameID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ResourceId).IsClustered(false); + + entity.HasIndex(e => e.ResourceDisplayName, "IX_CMS_Resource_ResourceDisplayName").IsClustered(); + + entity.Property(e => e.ResourceHasFiles).HasDefaultValueSql("((0))"); + entity.Property(e => e.ResourceInstallationState).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ResourceInstalledVersion).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ShowInDevelopment).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Resources) + .UsingEntity>( + "CmsResourceSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ResourceId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceSite_ResourceID_CMS_Resource"), + j => + { + j.HasKey("ResourceId", "SiteId"); + j.ToTable("CMS_ResourceSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_ResourceSite_SiteID"); + j.IndexerProperty("ResourceId").HasColumnName("ResourceID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ResourceLibraryPath).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ResourceLibraryResource).WithMany(p => p.CmsResourceLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceLibrary_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TranslationCulture).WithMany(p => p.CmsResourceTranslations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceTranslation_TranslationCultureID_CMS_Culture"); + + entity.HasOne(d => d.TranslationString).WithMany(p => p.CmsResourceTranslations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceTranslation_TranslationStringID_CMS_ResourceString"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.RoleId).IsClustered(false); + + entity.HasIndex(e => new { e.SiteId, e.RoleName, e.RoleDisplayName }, "IX_CMS_Role_SiteID_RoleName_RoleDisplayName").IsClustered(); + + entity.HasOne(d => d.RoleGroup).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_RoleGroupID_Community_Group"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_SiteID_CMS_SiteID"); + + entity.HasMany(d => d.Elements).WithMany(p => p.Roles) + .UsingEntity>( + "CmsRoleApplication", + r => r.HasOne().WithMany() + .HasForeignKey("ElementId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleApplication_CMS_UIElement"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleApplication_CMS_Role"), + j => + { + j.HasKey("RoleId", "ElementId"); + j.ToTable("CMS_RoleApplication"); + j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleApplication"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("ElementId").HasColumnName("ElementID"); + }); + + entity.HasMany(d => d.ElementsNavigation).WithMany(p => p.RolesNavigation) + .UsingEntity>( + "CmsRoleUielement", + r => r.HasOne().WithMany() + .HasForeignKey("ElementId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleUIElement_ElementID_CMS_UIElement"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleUIElement_RoleID_CMS_Role"), + j => + { + j.HasKey("RoleId", "ElementId"); + j.ToTable("CMS_RoleUIElement"); + j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleUIElement_ElementID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("ElementId").HasColumnName("ElementID"); + }); + + entity.HasMany(d => d.Permissions).WithMany(p => p.Roles) + .UsingEntity>( + "CmsRolePermission", + r => r.HasOne().WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RolePermission_PermissionID_CMS_Permission"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RolePermission_RoleID_CMS_Role"), + j => + { + j.HasKey("RoleId", "PermissionId"); + j.ToTable("CMS_RolePermission"); + j.HasIndex(new[] { "PermissionId" }, "IX_CMS_RolePermission_PermissionID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("PermissionId").HasColumnName("PermissionID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskAllowExternalService).HasDefaultValueSql("((0))"); + entity.Property(e => e.TaskExecutingServerName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.TaskResource).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskResourceID_CMS_Resource"); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskSiteID_CMS_Site"); + + entity.HasOne(d => d.TaskUser).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IndexId).IsClustered(false); + + entity.HasIndex(e => e.IndexDisplayName, "IX_CMS_SearchIndex_IndexDisplayName").IsClustered(); + + entity.Property(e => e.IndexProvider).HasDefaultValueSql("(N'')"); + entity.Property(e => e.IndexType).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.IndexCultures).WithMany(p => p.Indices) + .UsingEntity>( + "CmsSearchIndexCulture", + r => r.HasOne().WithMany() + .HasForeignKey("IndexCultureId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexCulture_IndexCultureID_CMS_Culture"), + l => l.HasOne().WithMany() + .HasForeignKey("IndexId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexCulture_IndexID_CMS_SearchIndex"), + j => + { + j.HasKey("IndexId", "IndexCultureId"); + j.ToTable("CMS_SearchIndexCulture"); + j.HasIndex(new[] { "IndexCultureId" }, "IX_CMS_SearchIndexCulture_IndexCultureID"); + j.IndexerProperty("IndexId").HasColumnName("IndexID"); + j.IndexerProperty("IndexCultureId").HasColumnName("IndexCultureID"); + }); + + entity.HasMany(d => d.IndexSites).WithMany(p => p.Indices) + .UsingEntity>( + "CmsSearchIndexSite", + r => r.HasOne().WithMany() + .HasForeignKey("IndexSiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexSite_IndexSiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("IndexId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexSite_IndexID_CMS_SearchIndex"), + j => + { + j.HasKey("IndexId", "IndexSiteId"); + j.ToTable("CMS_SearchIndexSite"); + j.HasIndex(new[] { "IndexSiteId" }, "IX_CMS_SearchIndexSite_IndexSiteID"); + j.IndexerProperty("IndexId").HasColumnName("IndexID"); + j.IndexerProperty("IndexSiteId").HasColumnName("IndexSiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SearchTaskId).IsClustered(false); + + entity.HasIndex(e => new { e.SearchTaskPriority, e.SearchTaskStatus, e.SearchTaskServerName }, "IX_CMS_SearchTask_SearchTaskPriority_SearchTaskStatus_SearchTaskServerName") + .IsDescending(true, false, false) + .IsClustered(); + + entity.Property(e => e.SearchTaskCreated).HasDefaultValueSql("('4/15/2009 11:23:52 AM')"); + entity.Property(e => e.SearchTaskStatus).HasDefaultValueSql("('')"); + entity.Property(e => e.SearchTaskType).HasDefaultValueSql("('')"); + entity.Property(e => e.SearchTaskValue).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SearchTaskAzureAdditionalData).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SearchTaskAzureCreated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.SearchTaskAzureType).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SessionExpires).HasDefaultValueSql("('9/9/2008 3:45:44 PM')"); + entity.Property(e => e.SessionIdentificator).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SessionLastActive).HasDefaultValueSql("('9/9/2008 3:44:26 PM')"); + + entity.HasOne(d => d.SessionSite).WithMany(p => p.CmsSessions).HasConstraintName("FK_CMS_Session_SessionSiteID_CMS_Site"); + + entity.HasOne(d => d.SessionUser).WithMany(p => p.CmsSessions).HasConstraintName("FK_CMS_Session_SessionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryOrder, "IX_CMS_SettingsCategory_CategoryOrder").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.CategoryIsGroup).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_SettingsCategory_CMS_SettingsCategory1"); + + entity.HasOne(d => d.CategoryResource).WithMany(p => p.CmsSettingsCategories).HasConstraintName("FK_CMS_SettingsCategory_CategoryResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.KeyDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.KeyExplanationText).HasDefaultValueSql("(N'')"); + entity.Property(e => e.KeyIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyIsGlobal).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyIsHidden).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyName).HasDefaultValueSql("('')"); + entity.Property(e => e.KeyType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.KeyCategory).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_KeyCategoryID_CMS_SettingsCategory"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_SiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SiteId).IsClustered(false); + + entity.HasIndex(e => e.SiteDisplayName, "IX_CMS_Site_SiteDisplayName").IsClustered(); + + entity.Property(e => e.SiteDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.SiteDomainName).HasDefaultValueSql("('')"); + entity.Property(e => e.SiteName).HasDefaultValueSql("('')"); + entity.Property(e => e.SiteStatus).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.SiteDefaultEditorStylesheetNavigation).WithMany(p => p.CmsSiteSiteDefaultEditorStylesheetNavigations).HasConstraintName("FK_CMS_Site_SiteDefaultEditorStylesheet_CMS_CssStylesheet"); + + entity.HasOne(d => d.SiteDefaultStylesheet).WithMany(p => p.CmsSiteSiteDefaultStylesheets).HasConstraintName("FK_CMS_Site_SiteDefaultStylesheetID_CMS_CssStylesheet"); + + entity.HasMany(d => d.Cultures).WithMany(p => p.Sites) + .UsingEntity>( + "CmsSiteCulture", + r => r.HasOne().WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteCulture_CultureID_CMS_Culture"), + l => l.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteCulture_SiteID_CMS_Site"), + j => + { + j.HasKey("SiteId", "CultureId"); + j.ToTable("CMS_SiteCulture"); + j.HasIndex(new[] { "CultureId" }, "IX_CMS_SiteCulture_CultureID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + j.IndexerProperty("CultureId").HasColumnName("CultureID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SiteDomainAliasName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsSiteDomainAliases) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteDomainAlias_SiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ServerDeliveryMethod).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Servers) + .UsingEntity>( + "CmsSmtpserverSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SMTPServerSite_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ServerId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SMTPServerSite_CMS_SMTPServer"), + j => + { + j.HasKey("ServerId", "SiteId"); + j.ToTable("CMS_SMTPServerSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_SMTPServerSite_SiteID"); + j.IndexerProperty("ServerId").HasColumnName("ServerID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StateId).IsClustered(false); + + entity.HasIndex(e => e.StateDisplayName, "IX_CMS_State_CountryID_StateDisplayName").IsClustered(); + + entity.Property(e => e.StateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.StateName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.Country).WithMany(p => p.CmsStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_State_CountryID_CMS_Country"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TagId).IsClustered(false); + + entity.HasIndex(e => e.TagName, "IX_CMS_Tag_TagName").IsClustered(); + + entity.HasOne(d => d.TagGroup).WithMany(p => p.CmsTags) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tag_TagGroupID_CMS_TagGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TagGroupId).IsClustered(false); + + entity.HasIndex(e => e.TagGroupDisplayName, "IX_CMS_TagGroup_TagGroupDisplayName").IsClustered(); + + entity.Property(e => e.TagGroupDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TagGroupName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TagGroupSite).WithMany(p => p.CmsTagGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TagGroup_TagGroupSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LayoutLastModified).HasDefaultValueSql("('7/31/2012 12:10:49 PM')"); + + entity.HasOne(d => d.Layout).WithMany(p => p.CmsTemplateDeviceLayouts).HasConstraintName("FK_CMS_TemplateDeviceLayout_LayoutID_CMS_Layout"); + + entity.HasOne(d => d.PageTemplate).WithMany(p => p.CmsTemplateDeviceLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TemplateDeviceLayout_PageTemplateID_CMS_PageTemplate"); + + entity.HasOne(d => d.Profile).WithMany(p => p.CmsTemplateDeviceLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TemplateDeviceLayout_ProfileID_CMS_DeviceProfile"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TimeZoneId).IsClustered(false); + + entity.HasIndex(e => e.TimeZoneDisplayName, "IX_CMS_TimeZone_TimeZoneDisplayName").IsClustered(); + + entity.Property(e => e.TimeZoneDaylight).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TransformationId).IsClustered(false); + + entity.HasIndex(e => new { e.TransformationClassId, e.TransformationName }, "IX_CMS_Transformation_TransformationClassID_TransformationName").IsClustered(); + + entity.Property(e => e.TransformationCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TransformationIsHierarchical).HasDefaultValueSql("((0))"); + entity.Property(e => e.TransformationName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TransformationType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.TransformationClass).WithMany(p => p.CmsTransformations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Transformation_TransformationClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TranslationServiceGenerateTargetTag).HasDefaultValueSql("((0))"); + entity.Property(e => e.TranslationServiceSupportsCancel).HasDefaultValueSql("((0))"); + entity.Property(e => e.TranslationServiceSupportsStatusUpdate).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubmissionTargetCulture).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SubmissionService).WithMany(p => p.CmsTranslationSubmissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TranslationSubmission_CMS_TranslationService"); + + entity.HasOne(d => d.SubmissionSubmittedByUser).WithMany(p => p.CmsTranslationSubmissions).HasConstraintName("FK_CMS_TranslationSubmission_CMS_User"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SubmissionItemSubmission).WithMany(p => p.CmsTranslationSubmissionItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TranslationSubmissionItem_CMS_TranslationSubmission")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.NodeAllowCacheInFileSystem).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeHasChildren).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeHasLinks).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeInheritPageTemplate).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeTemplateForAllCultures).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.NodeAcl).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeACLID_CMS_ACL"); + + entity.HasOne(d => d.NodeClass).WithMany(p => p.CmsTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tree_NodeClassID_CMS_Class"); + + entity.HasOne(d => d.NodeGroup).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeGroupID_Community_Group"); + + entity.HasOne(d => d.NodeLinkedNode).WithMany(p => p.InverseNodeLinkedNode).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeID_CMS_Tree"); + + entity.HasOne(d => d.NodeLinkedNodeSite).WithMany(p => p.CmsTreeNodeLinkedNodeSites).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeSiteID_CMS_Site"); + + entity.HasOne(d => d.NodeOriginalNode).WithMany(p => p.InverseNodeOriginalNode).HasConstraintName("FK_CMS_Tree_NodeOriginalNodeID_CMS_Tree"); + + entity.HasOne(d => d.NodeOwnerNavigation).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeOwner_CMS_User"); + + entity.HasOne(d => d.NodeParent).WithMany(p => p.InverseNodeParent).HasConstraintName("FK_CMS_Tree_NodeParentID_CMS_Tree"); + + entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsTreeNodeSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tree_NodeSiteID_CMS_Site"); + + entity.HasOne(d => d.NodeSku).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeSKUID_COM_SKU"); + + entity.HasOne(d => d.NodeTemplate).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeTemplateID_CMS_PageTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ElementId).IsClustered(false); + + entity.HasIndex(e => new + { + e.ElementResourceId, + e.ElementLevel, + e.ElementParentId, + e.ElementOrder, + e.ElementCaption + }, "IX_CMS_UIElement_ElementResourceID_ElementLevel_ElementParentID_ElementOrder_ElementCaption").IsClustered(); + + entity.Property(e => e.ElementCheckModuleReadPermission).HasDefaultValueSql("((1))"); + entity.Property(e => e.ElementIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementIsGlobalApplication).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementIsMenu).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ElementSize).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ElementPageTemplate).WithMany(p => p.CmsUielements).HasConstraintName("FK_CMS_UIElement_ElementPageTemplateID_CMS_PageTemplate"); + + entity.HasOne(d => d.ElementParent).WithMany(p => p.InverseElementParent).HasConstraintName("FK_CMS_UIElement_ElementParentID_CMS_UIElement"); + + entity.HasOne(d => d.ElementResource).WithMany(p => p.CmsUielements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UIElement_ElementResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserIsDomain).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserIsExternal).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserIsHidden).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserName).HasDefaultValueSql("('')"); + entity.Property(e => e.UserPassword).HasDefaultValueSql("(N'')"); + + entity.HasMany(d => d.ContactListContactUsers).WithMany(p => p.ContactListUsers) + .UsingEntity>( + "MessagingContactList", + r => r.HasOne().WithMany() + .HasForeignKey("ContactListContactUserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Messaging_ContactList_ContactListContactUserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("ContactListUserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Messaging_ContactList_ContactListUserID_CMS_User"), + j => + { + j.HasKey("ContactListUserId", "ContactListContactUserId"); + j.ToTable("Messaging_ContactList"); + j.HasIndex(new[] { "ContactListContactUserId" }, "IX_Messaging_ContactList_ContactListContactUserID"); + j.IndexerProperty("ContactListUserId").HasColumnName("ContactListUserID"); + j.IndexerProperty("ContactListContactUserId").HasColumnName("ContactListContactUserID"); + }); + + entity.HasMany(d => d.ContactListUsers).WithMany(p => p.ContactListContactUsers) + .UsingEntity>( + "MessagingContactList", + r => r.HasOne().WithMany() + .HasForeignKey("ContactListUserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Messaging_ContactList_ContactListUserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("ContactListContactUserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Messaging_ContactList_ContactListContactUserID_CMS_User"), + j => + { + j.HasKey("ContactListUserId", "ContactListContactUserId"); + j.ToTable("Messaging_ContactList"); + j.HasIndex(new[] { "ContactListContactUserId" }, "IX_Messaging_ContactList_ContactListContactUserID"); + j.IndexerProperty("ContactListUserId").HasColumnName("ContactListUserID"); + j.IndexerProperty("ContactListContactUserId").HasColumnName("ContactListContactUserID"); + }); + + entity.HasMany(d => d.Forums).WithMany(p => p.Users) + .UsingEntity>( + "ForumsForumModerator", + r => r.HasOne().WithMany() + .HasForeignKey("ForumId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumModerators_ForumID_Forums_Forum"), + l => l.HasOne().WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumModerators_UserID_CMS_User"), + j => + { + j.HasKey("UserId", "ForumId"); + j.ToTable("Forums_ForumModerators"); + j.HasIndex(new[] { "ForumId" }, "IX_Forums_ForumModerators_ForumID"); + j.IndexerProperty("UserId").HasColumnName("UserID"); + j.IndexerProperty("ForumId").HasColumnName("ForumID"); + }); + + entity.HasMany(d => d.IgnoreListIgnoredUsers).WithMany(p => p.IgnoreListUsers) + .UsingEntity>( + "MessagingIgnoreList", + r => r.HasOne().WithMany() + .HasForeignKey("IgnoreListIgnoredUserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Messaging_IgnoreList_IgnoreListIgnoredUserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("IgnoreListUserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Messaging_IgnoreList_IgnoreListUserID_CMS_User"), + j => + { + j.HasKey("IgnoreListUserId", "IgnoreListIgnoredUserId"); + j.ToTable("Messaging_IgnoreList"); + j.HasIndex(new[] { "IgnoreListIgnoredUserId" }, "IX_Messaging_IgnoreList_IgnoreListIgnoredUserID"); + j.IndexerProperty("IgnoreListUserId").HasColumnName("IgnoreListUserID"); + j.IndexerProperty("IgnoreListIgnoredUserId").HasColumnName("IgnoreListIgnoredUserID"); + }); + + entity.HasMany(d => d.IgnoreListUsers).WithMany(p => p.IgnoreListIgnoredUsers) + .UsingEntity>( + "MessagingIgnoreList", + r => r.HasOne().WithMany() + .HasForeignKey("IgnoreListUserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Messaging_IgnoreList_IgnoreListUserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("IgnoreListIgnoredUserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Messaging_IgnoreList_IgnoreListIgnoredUserID_CMS_User"), + j => + { + j.HasKey("IgnoreListUserId", "IgnoreListIgnoredUserId"); + j.ToTable("Messaging_IgnoreList"); + j.HasIndex(new[] { "IgnoreListIgnoredUserId" }, "IX_Messaging_IgnoreList_IgnoreListIgnoredUserID"); + j.IndexerProperty("IgnoreListUserId").HasColumnName("IgnoreListUserID"); + j.IndexerProperty("IgnoreListIgnoredUserId").HasColumnName("IgnoreListIgnoredUserID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Culture).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_CultureID_CMS_Culture"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_SiteID_CMS_Site"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserMacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.UserMacroIdentityMacroIdentity).WithMany(p => p.CmsUserMacroIdentities).HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID_CMS_MacroIdentity"); + + entity.HasOne(d => d.UserMacroIdentityUser).WithOne(p => p.CmsUserMacroIdentity) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Role).WithMany(p => p.CmsUserRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserRole_RoleID_CMS_Role"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserRole_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserAccountLockReason).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserInvalidLogOnAttempts).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserWaitingForApproval).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.UserActivatedByUser).WithMany(p => p.CmsUserSettingUserActivatedByUsers).HasConstraintName("FK_CMS_UserSettings_UserActivatedByUserID_CMS_User"); + + entity.HasOne(d => d.UserAvatar).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserAvatarID_CMS_Avatar"); + + entity.HasOne(d => d.UserBadge).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserBadgeID_CMS_Badge"); + + entity.HasOne(d => d.UserSettingsUser).WithMany(p => p.CmsUserSettingUserSettingsUsers) + .HasPrincipalKey(p => p.UserGuid) + .HasForeignKey(d => d.UserSettingsUserGuid) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserGUID_CMS_User"); + + entity.HasOne(d => d.UserSettingsUserNavigation).WithOne(p => p.CmsUserSettingUserSettingsUserNavigation) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserID_CMS_User"); + + entity.HasOne(d => d.UserTimeZone).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserTimeZoneID_CMS_TimeZone"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Site).WithMany(p => p.CmsUserSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSite_SiteID_CMS_Site"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSite_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.VersionHistoryId).IsClustered(false); + + entity.HasIndex(e => e.DocumentId, "IX_CMS_VersionHistory_DocumentID").IsClustered(); + + entity.Property(e => e.DocumentNamePath).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ModifiedByUser).WithMany(p => p.CmsVersionHistoryModifiedByUsers).HasConstraintName("FK_CMS_VersionHistory_ModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsVersionHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionHistory_NodeSiteID_CMS_Site"); + + entity.HasOne(d => d.VersionClass).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionClassID_CMS_Class"); + + entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_VersionHistory_DeletedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionWorkflow).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowID_CMS_Workflow"); + + entity.HasOne(d => d.VersionWorkflowStep).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowStepID_CMS_WorkflowStep"); + + entity.HasMany(d => d.AttachmentHistories).WithMany(p => p.VersionHistories) + .UsingEntity>( + "CmsVersionAttachment", + r => r.HasOne().WithMany() + .HasForeignKey("AttachmentHistoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionAttachment_AttachmentHistoryID_CMS_AttachmentHistory"), + l => l.HasOne().WithMany() + .HasForeignKey("VersionHistoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionAttachment_VersionHistoryID_CMS_VersionHistory"), + j => + { + j.HasKey("VersionHistoryId", "AttachmentHistoryId"); + j.ToTable("CMS_VersionAttachment"); + j.HasIndex(new[] { "AttachmentHistoryId" }, "IX_CMS_VersionAttachment_AttachmentHistoryID"); + j.IndexerProperty("VersionHistoryId").HasColumnName("VersionHistoryID"); + j.IndexerProperty("AttachmentHistoryId").HasColumnName("AttachmentHistoryID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ServerId).IsClustered(false); + + entity.HasIndex(e => e.ServerDisplayName, "IX_CMS_WebFarmServer_ServerDisplayName").IsClustered(); + + entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ServerLastModified).HasDefaultValueSql("('9/17/2013 12:18:06 PM')"); + entity.Property(e => e.ServerName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.LogCode).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Server).WithMany(p => p.CmsWebFarmServerTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer"); + + entity.HasOne(d => d.Task).WithMany(p => p.CmsWebFarmServerTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebFarmServerTask_TaskID_CMS_WebFarmTask"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskGuid).HasDefaultValueSql("('00000000-0000-0000-0000-000000000000')"); + entity.Property(e => e.TaskIsMemory).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.WebPartDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartFileName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.WebPartName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartProperties).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartSkipInsertProperties).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.WebPartCategory).WithMany(p => p.CmsWebParts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPart_WebPartCategoryID_CMS_WebPartCategory"); + + entity.HasOne(d => d.WebPartParent).WithMany(p => p.InverseWebPartParent).HasConstraintName("FK_CMS_WebPart_WebPartParentID_CMS_WebPart"); + + entity.HasOne(d => d.WebPartResource).WithMany(p => p.CmsWebParts).HasConstraintName("FK_CMS_WebPart_WebPartResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_CMS_WebPartCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_WebPartCategory_CategoryParentID_CMS_WebPartCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ContainerId).IsClustered(false); + + entity.HasIndex(e => e.ContainerDisplayName, "IX_CMS_WebPartContainer_ContainerDisplayName").IsClustered(); + + entity.Property(e => e.ContainerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContainerName).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Containers) + .UsingEntity>( + "CmsWebPartContainerSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartContainerSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ContainerId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartContainerSite_ContainerID_CMS_WebPartContainer"), + j => + { + j.HasKey("ContainerId", "SiteId"); + j.ToTable("CMS_WebPartContainerSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_WebPartContainerSite_SiteID"); + j.IndexerProperty("ContainerId").HasColumnName("ContainerID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WebPartLayoutId).IsClustered(false); + + entity.HasIndex(e => new { e.WebPartLayoutWebPartId, e.WebPartLayoutCodeName }, "IX_CMS_WebPartLayout_WebPartLayoutWebPartID_WebPartLayoutCodeName").IsClustered(); + + entity.Property(e => e.WebPartLayoutCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebPartLayoutDisplayName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.WebPartLayoutWebPart).WithMany(p => p.CmsWebPartLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartLayout_WebPartLayoutWebPartID_CMS_WebPart"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WebTemplateId).IsClustered(false); + + entity.HasIndex(e => e.WebTemplateOrder, "IX_CMS_WebTemplate_WebTemplateOrder").IsClustered(); + + entity.Property(e => e.WebTemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebTemplateFileName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebTemplateLicenses).HasDefaultValueSql("('')"); + entity.Property(e => e.WebTemplateName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebTemplateOrder).HasDefaultValueSql("((99999))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WidgetId).IsClustered(false); + + entity.HasIndex(e => new { e.WidgetCategoryId, e.WidgetDisplayName }, "IX_CMS_Widget_WidgetCategoryID_WidgetDisplayName").IsClustered(); + + entity.Property(e => e.WidgetSecurity).HasDefaultValueSql("((2))"); + + entity.HasOne(d => d.WidgetCategory).WithMany(p => p.CmsWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Widget_WidgetCategoryID_CMS_WidgetCategory"); + + entity.HasOne(d => d.WidgetLayout).WithMany(p => p.CmsWidgets).HasConstraintName("FK_CMS_Widget_WidgetLayoutID_CMS_WebPartLayout"); + + entity.HasOne(d => d.WidgetWebPart).WithMany(p => p.CmsWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Widget_WidgetWebPartID_CMS_WebPart"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WidgetCategoryId).IsClustered(false); + + entity.HasIndex(e => e.WidgetCategoryPath, "IX_CMS_WidgetCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.WidgetCategoryParent).WithMany(p => p.InverseWidgetCategoryParent).HasConstraintName("FK_CMS_WidgetCategory_WidgetCategoryParentID_CMS_WidgetCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Permission).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_RoleID_CMS_Role"); + + entity.HasOne(d => d.Widget).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_WidgetID_CMS_Widget"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowId).IsClustered(false); + + entity.HasIndex(e => e.WorkflowDisplayName, "IX_CMS_Workflow_WorkflowDisplayName").IsClustered(); + + entity.Property(e => e.WorkflowAutoPublishChanges).HasDefaultValueSql("((0))"); + entity.Property(e => e.WorkflowDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.WorkflowEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowName).HasDefaultValueSql("('')"); + entity.Property(e => e.WorkflowSendApproveEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendArchiveEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendPublishEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendReadyForApprovalEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendRejectEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowUseCheckinCheckout).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Users).WithMany(p => p.Workflows) + .UsingEntity>( + "CmsWorkflowUser", + r => r.HasOne().WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowUser_UserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("WorkflowId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowUser_WorkflowID_CMS_Workflow"), + j => + { + j.HasKey("WorkflowId", "UserId").HasName("PK_CMS_WorkflowUser_1"); + j.ToTable("CMS_WorkflowUser"); + j.HasIndex(new[] { "UserId" }, "IX_CMS_WorkflowUser_UserID"); + j.IndexerProperty("WorkflowId").HasColumnName("WorkflowID"); + j.IndexerProperty("UserId").HasColumnName("UserID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ActionEnabled).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.ActionResource).WithMany(p => p.CmsWorkflowActions).HasConstraintName("FK_CMS_WorkflowAction_ActionResourceID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ApprovedByUser).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_ApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_HistoryWorkflowID_CMS_Workflow"); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowHistorySteps).HasConstraintName("FK_CMS_WorkflowHistory_StepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TargetStep).WithMany(p => p.CmsWorkflowHistoryTargetSteps).HasConstraintName("FK_CMS_WorkflowHistory_TargetStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.VersionHistory).WithMany(p => p.CmsWorkflowHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowHistory_VersionHistoryID_CMS_VersionHistory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ScopeId).IsClustered(false); + + entity.HasIndex(e => e.ScopeStartingPath, "IX_CMS_WorkflowScope_ScopeStartingPath").IsClustered(); + + entity.HasOne(d => d.ScopeClass).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeClassID_CMS_Class"); + + entity.HasOne(d => d.ScopeCulture).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeCultureID_CMS_Culture"); + + entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsWorkflowScopes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowScope_ScopeSiteID_CMS_Site"); + + entity.HasOne(d => d.ScopeWorkflow).WithMany(p => p.CmsWorkflowScopes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowScope_ScopeWorkflowID_CMS_WorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.StepAllowPublish).HasDefaultValueSql("((0))"); + entity.Property(e => e.StepAllowReject).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.StepAction).WithMany(p => p.CmsWorkflowSteps).HasConstraintName("FK_CMS_WorkflowStep_StepActionID"); + + entity.HasOne(d => d.StepWorkflow).WithMany(p => p.CmsWorkflowSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStep_StepWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowStepRoleId).IsClustered(false); + + entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.RoleId }, "IX_CMS_WorkflowStepRoles_StepID_StepSourcePointGUID_RoleID") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsWorkflowStepRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepRoles_RoleID_CMS_Role"); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepRoles_StepID_CMS_WorkflowStep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowStepUserId).IsClustered(false); + + entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.UserId }, "IX_CMS_WorkflowStepUser_StepID_StepSourcePointGUID_UserID") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepUser_StepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsWorkflowStepUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TransitionEndStep).WithMany(p => p.CmsWorkflowTransitionTransitionEndSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionEndStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TransitionStartStep).WithMany(p => p.CmsWorkflowTransitionTransitionStartSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionStartStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TransitionWorkflow).WithMany(p => p.CmsWorkflowTransitions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionWorkflowID_CMS_Workflow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AddressId).HasName("PK_COM_CustomerAdress"); + + entity.Property(e => e.AddressCity).HasDefaultValueSql("('')"); + entity.Property(e => e.AddressLastModified).HasDefaultValueSql("('10/18/2012 3:39:07 PM')"); + entity.Property(e => e.AddressLine1).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AddressName).HasDefaultValueSql("('')"); + entity.Property(e => e.AddressPersonalName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AddressZip).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Address_AddressCountryID_CMS_Country"); + + entity.HasOne(d => d.AddressCustomer).WithMany(p => p.ComAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Address_AddressCustomerID_COM_Customer"); + + entity.HasOne(d => d.AddressState).WithMany(p => p.ComAddresses).HasConstraintName("FK_COM_Address_AddressStateID_CMS_State"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BrandDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BrandEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.BrandLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.BrandName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.BrandSite).WithMany(p => p.ComBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Brand_BrandSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CarrierAssemblyName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierClassName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierLastModified).HasDefaultValueSql("('9/22/2014 3:00:14 PM')"); + entity.Property(e => e.CarrierName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CarrierSite).WithMany(p => p.ComCarriers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Carrier_CarrierSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CollectionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CollectionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.CollectionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CollectionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CollectionSite).WithMany(p => p.ComCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Collection_CollectionSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CouponCodeCode).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CouponCodeDiscount).WithMany(p => p.ComCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CouponCode_CouponCodeDiscountID_COM_Discount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CurrencyCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyFormatString).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CurrencySite).WithMany(p => p.ComCurrencies).HasConstraintName("FK_COM_Currency_CurrencySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ExchangeRateToCurrency).WithMany(p => p.ComCurrencyExchangeRates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID_COM_Currency"); + + entity.HasOne(d => d.ExchangeTable).WithMany(p => p.ComCurrencyExchangeRates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeTableID_COM_ExchangeTable"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.CustomerCompany, "IX_COM_Customer_CustomerCompany") + .HasFilter("([CustomerCompany] IS NOT NULL)") + .HasFillFactor(90); + + entity.HasOne(d => d.CustomerSite).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerSiteID_CMS_Site"); + + entity.HasOne(d => d.CustomerUser).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EventCreditLastModified).HasDefaultValueSql("('9/26/2012 12:21:38 PM')"); + entity.Property(e => e.EventDate).HasDefaultValueSql("('9/27/2012 2:48:56 PM')"); + entity.Property(e => e.EventName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.EventCustomer).WithMany(p => p.ComCustomerCreditHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CustomerCreditHistory_EventCustomerID_COM_Customer"); + + entity.HasOne(d => d.EventSite).WithMany(p => p.ComCustomerCreditHistories).HasConstraintName("FK_COM_CustomerCreditHistory_EventSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.DepartmentId).IsClustered(false); + + entity.HasIndex(e => e.DepartmentDisplayName, "IX_COM_Department_DepartmentDisplayName").IsClustered(); + + entity.Property(e => e.DepartmentDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.DepartmentName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.DepartmentDefaultTaxClass).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentDefaultTaxClassID_COM_TaxClass"); + + entity.HasOne(d => d.DepartmentSite).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); + entity.Property(e => e.DiscountApplyTo).HasDefaultValueSql("('Order')"); + entity.Property(e => e.DiscountDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.DiscountEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.DiscountOrder).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.DiscountSite).WithMany(p => p.ComDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Discount_DiscountSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ExchangeTableId).IsClustered(false); + + entity.HasIndex(e => new { e.ExchangeTableValidFrom, e.ExchangeTableValidTo }, "IX_COM_ExchangeTable_ExchangeTableValidFrom_ExchangeTableValidTo") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.ExchangeTableDisplayName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ExchangeTableSite).WithMany(p => p.ComExchangeTables).HasConstraintName("FK_COM_ExchangeTable_ExchangeTableSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.GiftCardCustomerRestriction).HasDefaultValueSql("(N'enum1')"); + entity.Property(e => e.GiftCardDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GiftCardEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.GiftCardLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.GiftCardName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.GiftCardSite).WithMany(p => p.ComGiftCards) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_GiftCard_GiftCardSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.GiftCardCouponCodeCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GiftCardCouponCodeLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.GiftCardCouponCodeGiftCard).WithMany(p => p.ComGiftCardCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_GiftCardCouponCode_GiftCardCouponCodeGiftCardID_COM_GiftCard"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.InternalStatusId).IsClustered(false); + + entity.HasIndex(e => new { e.InternalStatusDisplayName, e.InternalStatusEnabled }, "IX_COM_InternalStatus_InternalStatusDisplayName_InternalStatusEnabled").IsClustered(); + + entity.Property(e => e.InternalStatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.InternalStatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.InternalStatusLastModified).HasDefaultValueSql("('9/20/2012 2:45:44 PM')"); + entity.Property(e => e.InternalStatusName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.InternalStatusSite).WithMany(p => p.ComInternalStatuses).HasConstraintName("FK_COM_InternalStatus_InternalStatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ManufacturerId).IsClustered(false); + + entity.HasIndex(e => new { e.ManufacturerDisplayName, e.ManufacturerEnabled }, "IX_COM_Manufacturer_ManufacturerDisplayName_ManufacturerEnabled").IsClustered(); + + entity.Property(e => e.ManufacturerDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ManufacturerEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ManufacturerLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ManufacturerSite).WithMany(p => p.ComManufacturers).HasConstraintName("FK_COM_Manufacturer_ManufacturerSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MultiBuyCouponCodeCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MultiBuyCouponCodeUseCount).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.MultiBuyCouponCodeMultiBuyDiscount).WithMany(p => p.ComMultiBuyCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MultiBuyDiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountAutoAddEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountCustomerRestriction).HasDefaultValueSql("(N'All')"); + entity.Property(e => e.MultiBuyDiscountEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountIsFlat).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountMinimumBuyCount).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountUsesCoupons).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.MultiBuyDiscountApplyToSku).WithMany(p => p.ComMultiBuyDiscounts).HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID_COM_SKU"); + + entity.HasOne(d => d.MultiBuyDiscountSite).WithMany(p => p.ComMultiBuyDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountSiteID_CMS_Site"); + + entity.HasMany(d => d.Departments).WithMany(p => p.MultiBuyDiscounts) + .UsingEntity>( + "ComMultiBuyDiscountDepartment", + r => r.HasOne().WithMany() + .HasForeignKey("DepartmentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_DepartmentID_COM_Department"), + l => l.HasOne().WithMany() + .HasForeignKey("MultiBuyDiscountId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_MultiBuyDiscountID_COM_MultiBuyDiscount"), + j => + { + j.HasKey("MultiBuyDiscountId", "DepartmentId"); + j.ToTable("COM_MultiBuyDiscountDepartment"); + j.HasIndex(new[] { "DepartmentId" }, "IX_COM_MultiBuyDiscountDepartment_DepartmentID"); + j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); + j.IndexerProperty("DepartmentId").HasColumnName("DepartmentID"); + }); + + entity.HasMany(d => d.Skus).WithMany(p => p.MultiBuyDiscounts) + .UsingEntity>( + "ComMultiBuyDiscountSku", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountSKU_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("MultiBuyDiscountId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountSKU_MultiBuyDiscountID_COM_MultiBuyDiscount"), + j => + { + j.HasKey("MultiBuyDiscountId", "Skuid"); + j.ToTable("COM_MultiBuyDiscountSKU"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_MultiBuyDiscountSKU_SKUID"); + j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BrandIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Brand).WithMany(p => p.ComMultiBuyDiscountBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountBrand_BrandID_COM_Brand"); + + entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountBrand_MultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CollectionIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Collection).WithMany(p => p.ComMultiBuyDiscountCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountCollection_CollectionID_COM_Collection"); + + entity.HasOne(d => d.MultibuyDiscount).WithMany(p => p.ComMultiBuyDiscountCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountCollection_MultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.NodeIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountTree_MultiBuyDiscountID_COM_MultiBuyDiscount"); + + entity.HasOne(d => d.Node).WithMany(p => p.ComMultiBuyDiscountTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountTree_NodeID_CMS_Tree"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_COM_OptionCategory_CategoryDisplayName_CategoryEnabled").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CategoryDisplayPrice).HasDefaultValueSql("((1))"); + entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.CategoryName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CategorySelectionType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CategorySite).WithMany(p => p.ComOptionCategories).HasConstraintName("FK_COM_OptionCategory_CategorySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.OrderBillingAddress).WithMany(p => p.ComOrderOrderBillingAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Order_OrderBillingAddressID_COM_OrderAdress"); + + entity.HasOne(d => d.OrderCompanyAddress).WithMany(p => p.ComOrderOrderCompanyAddresses).HasConstraintName("FK_COM_Order_OrderCompanyAddressID_COM_OrderAddress"); + + entity.HasOne(d => d.OrderCreatedByUser).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.OrderCurrency).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCurrencyID_COM_Currency"); + + entity.HasOne(d => d.OrderCustomer).WithMany(p => p.ComOrders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Order_OrderCustomerID_COM_Customer"); + + entity.HasOne(d => d.OrderPaymentOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderPaymentOptionID_COM_PaymentOption"); + + entity.HasOne(d => d.OrderShippingAddress).WithMany(p => p.ComOrderOrderShippingAddresses).HasConstraintName("FK_COM_Order_OrderShippingAddressID_COM_OrderAddress"); + + entity.HasOne(d => d.OrderShippingOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderShippingOptionID_COM_ShippingOption"); + + entity.HasOne(d => d.OrderSite).WithMany(p => p.ComOrders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Order_OrderSiteID_CMS_Site"); + + entity.HasOne(d => d.OrderStatus).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderStatusID_COM_Status"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComOrderAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderAddress_AddressCountryID_CMS_Country"); + + entity.HasOne(d => d.AddressState).WithMany(p => p.ComOrderAddresses).HasConstraintName("FK_COM_OrderAddress_AddressStateID_CMS_State"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.OrderItemOrder).WithMany(p => p.ComOrderItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItem_OrderItemOrderID_COM_Order"); + + entity.HasOne(d => d.OrderItemSku).WithMany(p => p.ComOrderItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItem_OrderItemSKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.File).WithMany(p => p.ComOrderItemSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItemSKUFile_COM_SKUFile"); + + entity.HasOne(d => d.OrderItem).WithMany(p => p.ComOrderItemSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItemSKUFile_COM_OrderItem"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.StatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.StatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.StatusName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.StatusSendNotification).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.StatusSite).WithMany(p => p.ComOrderStatuses).HasConstraintName("FK_COM_OrderStatus_StatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ChangedByUser).WithMany(p => p.ComOrderStatusUsers).HasConstraintName("FK_COM_OrderStatusUser_ChangedByUserID_CMS_User"); + + entity.HasOne(d => d.FromStatus).WithMany(p => p.ComOrderStatusUserFromStatuses).HasConstraintName("FK_COM_OrderStatusUser_FromStatusID_COM_Status"); + + entity.HasOne(d => d.Order).WithMany(p => p.ComOrderStatusUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderStatusUser_OrderID_COM_Order"); + + entity.HasOne(d => d.ToStatus).WithMany(p => p.ComOrderStatusUserToStatuses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderStatusUser_ToStatusID_COM_Status"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PaymentOptionId).IsClustered(false); + + entity.HasIndex(e => new { e.PaymentOptionSiteId, e.PaymentOptionDisplayName, e.PaymentOptionEnabled }, "IX_COM_PaymentOption_PaymentOptionSiteID_PaymentOptionDisplayName_PaymentOptionEnabled").IsClustered(); + + entity.Property(e => e.PaymentOptionAllowIfNoShipping).HasDefaultValueSql("((0))"); + entity.Property(e => e.PaymentOptionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PaymentOptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PaymentOptionLastModified).HasDefaultValueSql("('9/27/2012 4:18:26 PM')"); + entity.Property(e => e.PaymentOptionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PaymentOptionAuthorizedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionAuthorizedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID_COM_OrderStatus"); + + entity.HasOne(d => d.PaymentOptionFailedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionFailedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionFailedOrderStatusID_COM_OrderStatus"); + + entity.HasOne(d => d.PaymentOptionSite).WithMany(p => p.ComPaymentOptions).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSiteID_CMS_Site"); + + entity.HasOne(d => d.PaymentOptionSucceededOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionSucceededOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSucceededOrderStatusID_COM_OrderStatus"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PublicStatusId).IsClustered(false); + + entity.HasIndex(e => new { e.PublicStatusDisplayName, e.PublicStatusEnabled }, "IX_COM_PublicStatus_PublicStatusDisplayName_PublicStatusEnabled").IsClustered(); + + entity.Property(e => e.PublicStatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PublicStatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PublicStatusName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PublicStatusSite).WithMany(p => p.ComPublicStatuses).HasConstraintName("FK_COM_PublicStatus_PublicStatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ShippingCostId).HasName("PK__COM_ShippingCost"); + + entity.HasOne(d => d.ShippingCostShippingOption).WithMany(p => p.ComShippingCosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShippingCost_ShippingCostShippingOptionID_COM_ShippingOption"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ShippingOptionId).IsClustered(false); + + entity.HasIndex(e => e.ShippingOptionDisplayName, "IX_COM_ShippingOptionDisplayName").IsClustered(); + + entity.Property(e => e.ShippingOptionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ShippingOptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ShippingOptionLastModified).HasDefaultValueSql("('9/26/2012 12:44:18 PM')"); + entity.Property(e => e.ShippingOptionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ShippingOptionCarrier).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionCarrierID_COM_Carrier"); + + entity.HasOne(d => d.ShippingOptionSite).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionSiteID_CMS_Site"); + + entity.HasOne(d => d.ShippingOptionTaxClass).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionTaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ShoppingCartBillingAddress).WithMany(p => p.ComShoppingCartShoppingCartBillingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartBillingAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartCompanyAddress).WithMany(p => p.ComShoppingCartShoppingCartCompanyAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCompanyAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartCurrency).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCurrencyID_COM_Currency"); + + entity.HasOne(d => d.ShoppingCartCustomer).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCustomerID_COM_Customer"); + + entity.HasOne(d => d.ShoppingCartPaymentOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartPaymentOptionID_COM_PaymentOption"); + + entity.HasOne(d => d.ShoppingCartShippingAddress).WithMany(p => p.ComShoppingCartShoppingCartShippingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartShippingOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingOptionID_COM_ShippingOption"); + + entity.HasOne(d => d.ShoppingCartSite).WithMany(p => p.ComShoppingCarts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCart_ShoppingCartSiteID_CMS_Site"); + + entity.HasOne(d => d.ShoppingCartUser).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CouponCode).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartCouponCode_ShoppingCartID_COM_ShoppingCart"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CartItemAutoAddedUnits).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartSkus) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartSKU_ShoppingCartID_COM_ShoppingCart"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComShoppingCartSkus) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartSKU_SKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.Skunumber, "IX_COM_SKU_SKUNumber") + .HasFilter("([SKUNumber] IS NOT NULL)") + .HasFillFactor(90); + + entity.Property(e => e.SkubundleInventoryType).HasDefaultValueSql("('REMOVEBUNDLE')"); + entity.Property(e => e.SkuconversionValue).HasDefaultValueSql("('0')"); + entity.Property(e => e.Skuenabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.Skuname).HasDefaultValueSql("('')"); + entity.Property(e => e.SkusellOnlyAvailable).HasDefaultValueSql("((0))"); + entity.Property(e => e.SkutrackInventory).HasDefaultValueSql("(N'ByProduct')"); + + entity.HasOne(d => d.Skubrand).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUBrandID_COM_Brand"); + + entity.HasOne(d => d.Skucollection).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUCollectionID_COM_Collection"); + + entity.HasOne(d => d.Skudepartment).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUDepartmentID_COM_Department"); + + entity.HasOne(d => d.SkuinternalStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUInternalStatusID_COM_InternalStatus"); + + entity.HasOne(d => d.Skumanufacturer).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUManufacturerID_COM_Manifacturer"); + + entity.HasOne(d => d.SkuoptionCategory).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUOptionCategoryID_COM_OptionCategory"); + + entity.HasOne(d => d.SkuparentSku).WithMany(p => p.InverseSkuparentSku).HasConstraintName("FK_COM_SKU_SKUParentSKUID_COM_SKU"); + + entity.HasOne(d => d.SkupublicStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUPublicStatusID_COM_PublicStatus"); + + entity.HasOne(d => d.Skusite).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSiteID_CMS_Site"); + + entity.HasOne(d => d.Skusupplier).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSupplierID_COM_Supplier"); + + entity.HasOne(d => d.SkutaxClass).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUTaxClass_COM_TaxClass"); + + entity.HasMany(d => d.Bundles).WithMany(p => p.Skus) + .UsingEntity>( + "ComBundle", + r => r.HasOne().WithMany() + .HasForeignKey("BundleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), + j => + { + j.HasKey("BundleId", "Skuid"); + j.ToTable("COM_Bundle"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); + j.IndexerProperty("BundleId").HasColumnName("BundleID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.OptionSkus).WithMany(p => p.SkusNavigation) + .UsingEntity>( + "ComSkuallowedOption", + r => r.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), + j => + { + j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); + j.ToTable("COM_SKUAllowedOption"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.OptionSkusNavigation).WithMany(p => p.VariantSkus) + .UsingEntity>( + "ComVariantOption", + r => r.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("VariantSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), + j => + { + j.HasKey("VariantSkuid", "OptionSkuid"); + j.ToTable("COM_VariantOption"); + j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); + j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + }); + + entity.HasMany(d => d.Skus).WithMany(p => p.Bundles) + .UsingEntity>( + "ComBundle", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("BundleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), + j => + { + j.HasKey("BundleId", "Skuid"); + j.ToTable("COM_Bundle"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); + j.IndexerProperty("BundleId").HasColumnName("BundleID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.SkusNavigation).WithMany(p => p.OptionSkus) + .UsingEntity>( + "ComSkuallowedOption", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), + j => + { + j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); + j.ToTable("COM_SKUAllowedOption"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.VariantSkus).WithMany(p => p.OptionSkusNavigation) + .UsingEntity>( + "ComVariantOption", + r => r.HasOne().WithMany() + .HasForeignKey("VariantSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), + j => + { + j.HasKey("VariantSkuid", "OptionSkuid"); + j.ToTable("COM_VariantOption"); + j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); + j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + }); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.FileSku).WithMany(p => p.ComSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUFile_COM_SKU")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Category).WithMany(p => p.ComSkuoptionCategories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOptionCategory_CategoryID_COM_OptionCategory"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComSkuoptionCategories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOptionCategory_SKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SupplierId).IsClustered(false); + + entity.HasIndex(e => new { e.SupplierDisplayName, e.SupplierEnabled }, "IX_COM_Supplier_SupplierDisplayName_SupplierEnabled").IsClustered(); + + entity.Property(e => e.SupplierDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.SupplierEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.SupplierLastModified).HasDefaultValueSql("('9/21/2012 12:34:09 PM')"); + + entity.HasOne(d => d.SupplierSite).WithMany(p => p.ComSuppliers).HasConstraintName("FK_COM_Supplier_SupplierSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TaxClassId).IsClustered(false); + + entity.HasIndex(e => e.TaxClassDisplayName, "IX_COM_TaxClass_TaxClassDisplayName").IsClustered(); + + entity.Property(e => e.TaxClassDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TaxClassLastModified).HasDefaultValueSql("('9/20/2012 1:31:27 PM')"); + entity.Property(e => e.TaxClassName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TaxClassZeroIfIdsupplied).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.TaxClassSite).WithMany(p => p.ComTaxClasses).HasConstraintName("FK_COM_TaxClass_TaxClassSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Country).WithMany(p => p.ComTaxClassCountries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxCategoryCountry_CountryID_CMS_Country"); + + entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassCountries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxCategoryCountry_TaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.State).WithMany(p => p.ComTaxClassStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxClassState_StateID_CMS_State"); + + entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxClassState_TaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.VolumeDiscountSku).WithMany(p => p.ComVolumeDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VolumeDiscount_VolumeDiscountSKUID_COM_SKU")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Site).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_SiteID_CMS_Site"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_SKUID_COM_SKU"); + + entity.HasOne(d => d.User).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.FriendApprovedByNavigation).WithMany(p => p.CommunityFriendFriendApprovedByNavigations).HasConstraintName("FK_CMS_Friend_FriendApprovedBy_CMS_User"); + + entity.HasOne(d => d.FriendRejectedByNavigation).WithMany(p => p.CommunityFriendFriendRejectedByNavigations).HasConstraintName("FK_CMS_Friend_FriendRejectedBy_CMS_User"); + + entity.HasOne(d => d.FriendRequestedUser).WithMany(p => p.CommunityFriendFriendRequestedUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Friend_FriendRequestedUserID_CMS_User"); + + entity.HasOne(d => d.FriendUser).WithMany(p => p.CommunityFriendFriendUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Friend_FriendUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GroupId).IsClustered(false); + + entity.HasIndex(e => new { e.GroupSiteId, e.GroupDisplayName }, "IX_Community_Group_GroupDisplayName").IsClustered(); + + entity.Property(e => e.GroupApproved).HasDefaultValueSql("((0))"); + entity.Property(e => e.GroupCreatedWhen).HasDefaultValueSql("('10/21/2008 10:17:56 AM')"); + entity.Property(e => e.GroupSecurity).HasDefaultValueSql("((444))"); + entity.Property(e => e.GroupSendJoinLeaveNotification).HasDefaultValueSql("((1))"); + entity.Property(e => e.GroupSendWaitingForApprovalNotification).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.GroupApprovedByUser).WithMany(p => p.CommunityGroupGroupApprovedByUsers).HasConstraintName("FK_Community_Group_GroupApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.GroupAvatar).WithMany(p => p.CommunityGroups).HasConstraintName("FK_Community_Group_GroupAvatarID_CMS_Avatar"); + + entity.HasOne(d => d.GroupCreatedByUser).WithMany(p => p.CommunityGroupGroupCreatedByUsers).HasConstraintName("FK_Community_Group_GroupCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.GroupSite).WithMany(p => p.CommunityGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Community_Group_GroupSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MemberId).IsClustered(false); + + entity.HasIndex(e => e.MemberJoined, "IX_Community_GroupMember_MemberJoined") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.MemberStatus).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.MemberApprovedByUser).WithMany(p => p.CommunityGroupMemberMemberApprovedByUsers).HasConstraintName("FK_Community_GroupMember_MemberApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.MemberGroup).WithMany(p => p.CommunityGroupMembers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Community_GroupMember_MemberGroupID_Community_Group"); + + entity.HasOne(d => d.MemberInvitedByUser).WithMany(p => p.CommunityGroupMemberMemberInvitedByUsers).HasConstraintName("FK_Community_GroupMember_MemberInvitedByUserID_CMS_User"); + + entity.HasOne(d => d.MemberUser).WithMany(p => p.CommunityGroupMemberMemberUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Community_GroupMember_MemberUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Group).WithMany(p => p.CommunityGroupRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_community_GroupRolePermission_GroupID_Community_Group"); + + entity.HasOne(d => d.Permission).WithMany(p => p.CommunityGroupRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_community_GroupRolePermission_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.CommunityGroupRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_community_GroupRolePermission_RoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.InvitationId).HasName("PK_Community_GroupInvitation"); + + entity.HasOne(d => d.InvitationGroup).WithMany(p => p.CommunityInvitations).HasConstraintName("FK_Community_GroupInvitation_InvitationGroupID_Community_Group"); + + entity.HasOne(d => d.InvitedByUser).WithMany(p => p.CommunityInvitationInvitedByUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Community_GroupInvitation_InvitedByUserID_CMS_User"); + + entity.HasOne(d => d.InvitedUser).WithMany(p => p.CommunityInvitationInvitedUsers).HasConstraintName("FK_Community_GroupInvitation_InvitedUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.ArticleName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BlogAllowAnonymousComments).HasDefaultValueSql("((1))"); + entity.Property(e => e.BlogDescription).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BlogEnableOptIn).HasDefaultValueSql("((-1))"); + entity.Property(e => e.BlogEnableSubscriptions).HasDefaultValueSql("((0))"); + entity.Property(e => e.BlogName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BlogOpenCommentsFor).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BlogRequireEmails).HasDefaultValueSql("((0))"); + entity.Property(e => e.BlogSendOptInConfirmation).HasDefaultValueSql("((-1))"); + entity.Property(e => e.BlogUseCaptchaforComments).HasDefaultValueSql("((1))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BlogMonthName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BlogMonthStartingDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BlogLogActivity).HasDefaultValueSql("((1))"); + entity.Property(e => e.BlogPostAllowComments).HasDefaultValueSql("((1))"); + entity.Property(e => e.BlogPostBody).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BlogPostDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.BlogPostTitle).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EventAllDay).HasDefaultValueSql("((0))"); + entity.Property(e => e.EventAllowRegistrationOverCapacity).HasDefaultValueSql("((0))"); + entity.Property(e => e.EventLogActivity).HasDefaultValueSql("((1))"); + entity.Property(e => e.EventName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.Cell3G).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellBluetooth).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellCamera).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellEdge).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellGprs).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellHscsd).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellIrDa).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellJava).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellMp3).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellWiFi).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.EventName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.Faqanswer).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Faqquestion).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.FileName).HasDefaultValueSql("('')")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HeadlineBannerDescription).HasDefaultValueSql("(N'')"); + entity.Property(e => e.HeadlineBannerDocumentUrl).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.GalleryName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => entity.Property(e => e.JobName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ArticleAppliesTo).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ArticleName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ArticleSummary).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ArticleText).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LaptopBluetooth).HasDefaultValueSql("((1))"); + entity.Property(e => e.LaptopInfraport).HasDefaultValueSql("((1))"); + entity.Property(e => e.LaptopWirelessLan).HasDefaultValueSql("((1))"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.MenuItemName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.NewsReleaseDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.NewsSummary).HasDefaultValueSql("(N'')"); + entity.Property(e => e.NewsTitle).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.OfficeIsHeadquarters).HasDefaultValueSql("((0))"); + entity.Property(e => e.OfficeName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PressReleaseDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.PressReleaseSummary).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PressReleaseText).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PressReleaseTitle).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ArticleText).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ArticleTitle).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.SmartphoneGps).HasDefaultValueSql("((0))")); + + modelBuilder.Entity(entity => entity.Property(e => e.ItemText).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ArticleSummary).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ArticleText).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ArticleTitle).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CafeCity).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CafeCountry).HasDefaultValueSql("(N'USA')"); + entity.Property(e => e.CafeIsAlsoAroastery).HasDefaultValueSql("((0))"); + entity.Property(e => e.CafeIsPartner).HasDefaultValueSql("((0))"); + entity.Property(e => e.CafePhone).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CafeStreet).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CafeZipCode).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.CityName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CoffeeCountry).HasDefaultValueSql("(N'USA')"); + entity.Property(e => e.CoffeeProcessing).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CoffeeVariety).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.OfficeCity).HasDefaultValueSql("(N'')"); + entity.Property(e => e.OfficeCodeName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.OfficeCountry).HasDefaultValueSql("(N'')"); + entity.Property(e => e.OfficeEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.OfficeName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.OfficePhone).HasDefaultValueSql("(N'')"); + entity.Property(e => e.OfficeStreet).HasDefaultValueSql("(N'')"); + entity.Property(e => e.OfficeZipCode).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PartnerCafeName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PartnerCafeStreet).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PartnerCafeZipCode).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.StepName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AttendeeId).IsClustered(false); + + entity.HasIndex(e => new { e.AttendeeEmail, e.AttendeeFirstName, e.AttendeeLastName }, "IX_Events_Attendee_AttendeeEmail_AttendeeFirstName_AttendeeLastName").IsClustered(); + + entity.Property(e => e.AttendeeEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AttendeeFirstName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AttendeeLastModified).HasDefaultValueSql("('1/20/2015 8:52:25 AM')"); + entity.Property(e => e.AttendeeLastName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AttendeePhone).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AttendeeEventNode).WithMany(p => p.EventsAttendees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Events_Attendee_AttendeeEventNodeID_CMS_Tree"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ExportId).IsClustered(false); + + entity.HasIndex(e => e.ExportDateTime, "IX_Export_History_ExportDateTime") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.ExportFileName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ExportSite).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportSiteID_CMS_Site"); + + entity.HasOne(d => d.ExportUser).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.TaskSite).WithMany(p => p.ExportTasks).HasConstraintName("FK_Export_Task_TaskSiteID_CMS_Site")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.Email).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FirstName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.LastName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Message).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PhoneNumber).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BecomePartner).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CompanyName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Email).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FirstName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.LastName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.UserEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.UserMessage).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.Email).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.Machine).HasDefaultValueSql("(N'')"); + entity.Property(e => e.RentalPeriod).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.Address).HasDefaultValueSql("(N'')"); + entity.Property(e => e.City).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Country).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EmailAddress).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FirstName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.LastName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Zipcode).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.GeneralQuestionEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GeneralQuestionText).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.ProductQuestionEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ProductQuestionProduct).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ProductQuestionText).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AttachmentPost).WithMany(p => p.ForumsAttachments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_Attachment_AttachmentPostID_Forums_ForumPost"); + + entity.HasOne(d => d.AttachmentSite).WithMany(p => p.ForumsAttachments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_Attachment_AttachmentSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ForumId).IsClustered(false); + + entity.HasIndex(e => new { e.ForumGroupId, e.ForumOrder }, "IX_Forums_Forum_ForumGroupID_ForumOrder").IsClustered(); + + entity.Property(e => e.ForumImageMaxSideSize).HasDefaultValueSql("((400))"); + entity.Property(e => e.ForumIsAnswerLimit).HasDefaultValueSql("((5))"); + entity.Property(e => e.ForumIsLocked).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ForumCommunityGroup).WithMany(p => p.ForumsForums).HasConstraintName("FK_Forums_Forum_ForumCommunityGroupID_Community_Group"); + + entity.HasOne(d => d.ForumDocument).WithMany(p => p.ForumsForums).HasConstraintName("FK_Forums_Forum_ForumDocumentID_CMS_Document"); + + entity.HasOne(d => d.ForumGroup).WithMany(p => p.ForumsForums) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_Forum_ForumGroupID_Forums_ForumGroup"); + + entity.HasOne(d => d.ForumSite).WithMany(p => p.ForumsForums) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_Forum_ForumSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GroupId).IsClustered(false); + + entity.HasIndex(e => new { e.GroupSiteId, e.GroupOrder }, "IX_Forums_ForumGroup_GroupSiteID_GroupOrder").IsClustered(); + + entity.Property(e => e.GroupHtmleditor).HasDefaultValueSql("((0))"); + entity.Property(e => e.GroupImageMaxSideSize).HasDefaultValueSql("((400))"); + entity.Property(e => e.GroupLastModified).HasDefaultValueSql("('11/6/2013 2:43:02 PM')"); + entity.Property(e => e.GroupName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GroupUseCaptcha).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.GroupGroup).WithMany(p => p.ForumsForumGroups).HasConstraintName("FK_Forums_ForumGroup_GroupGroupID_Community_Group"); + + entity.HasOne(d => d.GroupSite).WithMany(p => p.ForumsForumGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumGroup_GroupSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PostId).IsClustered(false); + + entity.HasIndex(e => e.PostIdpath, "IX_Forums_ForumPost_PostIDPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.PostAttachmentCount).HasDefaultValueSql("((0))"); + entity.Property(e => e.PostIsLocked).HasDefaultValueSql("((0))"); + entity.Property(e => e.PostQuestionSolved).HasDefaultValueSql("((0))"); + entity.Property(e => e.PostUserName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.PostApprovedByUser).WithMany(p => p.ForumsForumPostPostApprovedByUsers).HasConstraintName("FK_Forums_ForumPost_PostApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.PostForum).WithMany(p => p.ForumsForumPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumPost_PostForumID_Forums_Forum"); + + entity.HasOne(d => d.PostParent).WithMany(p => p.InversePostParent).HasConstraintName("FK_Forums_ForumPost_PostParentID_Forums_ForumPost"); + + entity.HasOne(d => d.PostUser).WithMany(p => p.ForumsForumPostPostUsers).HasConstraintName("FK_Forums_ForumPost_PostUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Forum).WithMany(p => p.ForumsForumRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumRoles_ForumID_Forums_Forum"); + + entity.HasOne(d => d.Permission).WithMany(p => p.ForumsForumRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumRoles_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.ForumsForumRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumRoles_RoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SubscriptionId).IsClustered(false); + + entity.HasIndex(e => new { e.SubscriptionEmail, e.SubscriptionForumId }, "IX_Forums_ForumSubscription_SubscriptionForumID_SubscriptionEmail").IsClustered(); + + entity.HasOne(d => d.SubscriptionForum).WithMany(p => p.ForumsForumSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumSubscription_SubscriptionForumID_Forums_Forum"); + + entity.HasOne(d => d.SubscriptionPost).WithMany(p => p.ForumsForumSubscriptions).HasConstraintName("FK_Forums_ForumSubscription_SubscriptionPostID_Forums_ForumPost"); + + entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.ForumsForumSubscriptions).HasConstraintName("FK_Forums_ForumSubscription_SubscriptionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FavoriteLastModified).HasDefaultValueSql("('12/4/2008 3:23:57 PM')"); + + entity.HasOne(d => d.Forum).WithMany(p => p.ForumsUserFavorites).HasConstraintName("FK_Forums_UserFavorites_ForumID_Forums_Forum"); + + entity.HasOne(d => d.Post).WithMany(p => p.ForumsUserFavorites).HasConstraintName("FK_Forums_UserFavorites_PostID_Forums_ForumPost"); + + entity.HasOne(d => d.Site).WithMany(p => p.ForumsUserFavorites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_UserFavorites_SiteID_CMS_Site"); + + entity.HasOne(d => d.User).WithMany(p => p.ForumsUserFavorites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_UserFavorites_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ConnectorId).IsClustered(false); + + entity.HasIndex(e => e.ConnectorDisplayName, "IX_Integration_Connector_ConnectorDisplayName").IsClustered(); + + entity.Property(e => e.ConnectorEnabled).HasDefaultValueSql("((1))"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SyncLogSynchronization).WithMany(p => p.IntegrationSyncLogs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_SyncLog_SyncLogSynchronizationID_Integration_Synchronization")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SynchronizationConnector).WithMany(p => p.IntegrationSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_Synchronization_SynchronizationConnectorID_Integration_Connector"); + + entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.IntegrationSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_Synchronization_SynchronizationTaskID_Integration_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TaskId).IsClustered(false); + + entity.HasIndex(e => e.TaskNodeAliasPath, "IX_Integration_Task_TaskNodeAliasPath").IsClustered(); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.IntegrationTasks).HasConstraintName("FK_IntegrationTask_TaskSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.DepartmentName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormInserted).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.FormUpdated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.OfficeSatisfaction).HasDefaultValueSql("(N'Neutral')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FileId).IsClustered(false); + + entity.HasIndex(e => e.FilePath, "IX_Media_File_FilePath").IsClustered(); + + entity.Property(e => e.FileCreatedWhen).HasDefaultValueSql("('11/11/2008 4:10:00 PM')"); + entity.Property(e => e.FileModifiedWhen).HasDefaultValueSql("('11/11/2008 4:11:15 PM')"); + entity.Property(e => e.FileTitle).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FileCreatedByUser).WithMany(p => p.MediaFileFileCreatedByUsers).HasConstraintName("FK_Media_File_FileCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.FileLibrary).WithMany(p => p.MediaFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_File_FileLibraryID_Media_Library"); + + entity.HasOne(d => d.FileModifiedByUser).WithMany(p => p.MediaFileFileModifiedByUsers).HasConstraintName("FK_Media_File_FileModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.FileSite).WithMany(p => p.MediaFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_File_FileSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LibraryId).IsClustered(false); + + entity.HasIndex(e => new { e.LibrarySiteId, e.LibraryDisplayName }, "IX_Media_Library_LibraryDisplayName").IsClustered(); + + entity.Property(e => e.LibraryName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.LibraryGroup).WithMany(p => p.MediaLibraries).HasConstraintName("FK_Media_Library_LibraryGroupID_Community_Group"); + + entity.HasOne(d => d.LibrarySite).WithMany(p => p.MediaLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_Library_LibrarySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Library).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_LibraryID_Media_Library"); + + entity.HasOne(d => d.Permission).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_RoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MessageId).IsClustered(false); + + entity.HasIndex(e => new { e.MessageRecipientUserId, e.MessageSent, e.MessageRecipientDeleted }, "IX_Messaging_Message_MessageRecipientUserID_MessageSent_MessageRecipientDeleted") + .IsDescending(false, true, false) + .IsClustered(); + + entity.Property(e => e.MessageRecipientNickName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MessageSenderNickName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MessageSubject).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.MessageRecipientUser).WithMany(p => p.MessagingMessageMessageRecipientUsers).HasConstraintName("FK_Messaging_Message_MessageRecipientUserID_CMS_User"); + + entity.HasOne(d => d.MessageSenderUser).WithMany(p => p.MessagingMessageMessageSenderUsers).HasConstraintName("FK_Messaging_Message_MessageSenderUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TestLastModified).HasDefaultValueSql("('12/5/2011 4:56:38 PM')"); + + entity.HasOne(d => d.TestIssue).WithOne(p => p.NewsletterAbtestTestIssue) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_ABTest_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.TestWinnerIssue).WithMany(p => p.NewsletterAbtestTestWinnerIssues).HasConstraintName("FK_Newsletter_ABTest_TestWinnerIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.TestWinnerScheduledTask).WithMany(p => p.NewsletterAbtests).HasConstraintName("FK_Newsletter_ABTest_TestWinnerScheduledTaskID_CMS_ScheduledTask"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ClickedLinkEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ClickedLinkNewsletterLink).WithMany(p => p.NewsletterClickedLinks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_ClickedLink_Newsletter_Link"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailNewsletterIssue).WithMany(p => p.NewsletterEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Emails_EmailNewsletterIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.EmailSite).WithMany(p => p.NewsletterEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Emails_EmailSiteID_CMS_Site"); + + entity.HasOne(d => d.EmailSubscriber).WithMany(p => p.NewsletterEmails).HasConstraintName("FK_Newsletter_Emails_EmailSubscriberID_Newsletter_Subscriber"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TemplateId).IsClustered(false); + + entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateDisplayName").IsClustered(); + + entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TemplateIconClass).HasDefaultValueSql("(N'icon-accordion')"); + entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); + entity.Property(e => e.TemplateType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TemplateSite).WithMany(p => p.NewsletterEmailTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplate_TemplateSiteID_CMS_Site"); + + entity.HasMany(d => d.Newsletters).WithMany(p => p.Templates) + .UsingEntity>( + "NewsletterEmailTemplateNewsletter", + r => r.HasOne().WithMany() + .HasForeignKey("NewsletterId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_Newsletter"), + l => l.HasOne().WithMany() + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_EmailTemplate"), + j => + { + j.HasKey("TemplateId", "NewsletterId"); + j.ToTable("Newsletter_EmailTemplateNewsletter"); + j.HasIndex(new[] { "NewsletterId" }, "IX_Newsletter_EmailTemplateNewsletter_NewsletterID"); + j.IndexerProperty("TemplateId").HasColumnName("TemplateID"); + j.IndexerProperty("NewsletterId").HasColumnName("NewsletterID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailWidgetDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EmailWidgetIconCssClass).HasDefaultValueSql("(N'icon-cogwheel-square')"); + entity.Property(e => e.EmailWidgetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.EmailWidgetName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.EmailWidgetSite).WithMany(p => p.NewsletterEmailWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidget_EmailWidgetSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailWidget).WithMany(p => p.NewsletterEmailWidgetTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_EmailWidgetID_Newsletter_EmailWidget"); + + entity.HasOne(d => d.Template).WithMany(p => p.NewsletterEmailWidgetTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_TemplateID_Newsletter_EmailTemplate"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.ContactGroup).WithMany(p => p.NewsletterIssueContactGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_IssueContactGroup_ContactGroupID")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.LinkIssue).WithMany(p => p.NewsletterLinks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Link_Newsletter_NewsletterIssue")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.NewsletterId).IsClustered(false); + + entity.HasIndex(e => new { e.NewsletterSiteId, e.NewsletterDisplayName }, "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterDisplayName").IsClustered(); + + entity.Property(e => e.NewsletterDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterEnableOptIn).HasDefaultValueSql("((0))"); + entity.Property(e => e.NewsletterLastModified).HasDefaultValueSql("('3/13/2015 2:53:28 PM')"); + entity.Property(e => e.NewsletterLogActivity).HasDefaultValueSql("((1))"); + entity.Property(e => e.NewsletterName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterSendOptInConfirmation).HasDefaultValueSql("((0))"); + entity.Property(e => e.NewsletterSenderEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.NewsletterSenderName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterSource).HasDefaultValueSql("(N'T')"); + entity.Property(e => e.NewsletterTrackClickedLinks).HasDefaultValueSql("((1))"); + entity.Property(e => e.NewsletterTrackOpenEmails).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.NewsletterDynamicScheduledTask).WithMany(p => p.NewsletterNewsletters).HasConstraintName("FK_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID_CMS_ScheduledTask"); + + entity.HasOne(d => d.NewsletterOptInTemplate).WithMany(p => p.NewsletterNewsletterNewsletterOptInTemplates).HasConstraintName("FK_Newsletter_Newsletter_NewsletterOptInTemplateID_EmailTemplate"); + + entity.HasOne(d => d.NewsletterSite).WithMany(p => p.NewsletterNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Newsletter_NewsletterSiteID_CMS_Site"); + + entity.HasOne(d => d.NewsletterUnsubscriptionTemplate).WithMany(p => p.NewsletterNewsletterNewsletterUnsubscriptionTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID_Newsletter_EmailTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.IssueDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.IssueSubject).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.IssueNewsletter).WithMany(p => p.NewsletterNewsletterIssues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueNewsletterID_Newsletter_Newsletter"); + + entity.HasOne(d => d.IssueSite).WithMany(p => p.NewsletterNewsletterIssues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueSiteID_CMS_Site"); + + entity.HasOne(d => d.IssueTemplate).WithMany(p => p.NewsletterNewsletterIssues).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueTemplateID_Newsletter_EmailTemplate"); + + entity.HasOne(d => d.IssueVariantOfIssue).WithMany(p => p.InverseIssueVariantOfIssue).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueVariantOfIssue_NewsletterIssue"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.OpenedEmailEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.OpenedEmailIssue).WithMany(p => p.NewsletterOpenedEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_OpenedEmail_OpenedEmailIssueID_Newsletter_NewsletterIssue"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SubscriberId).IsClustered(false); + + entity.HasIndex(e => new { e.SubscriberSiteId, e.SubscriberFullName }, "IX_Newsletter_Subscriber_SubscriberSiteID_SubscriberFullName").IsClustered(); + + entity.Property(e => e.SubscriberType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SubscriberSite).WithMany(p => p.NewsletterSubscribers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Subscriber_SubscriberSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubscriptionApproved).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Newsletter).WithMany(p => p.NewsletterSubscriberNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_SubscriberNewsletter_NewsletterID_Newsletter_Newsletter"); + + entity.HasOne(d => d.Subscriber).WithMany(p => p.NewsletterSubscriberNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_SubscriberNewsletter_SubscriberID_Newsletter_Subscriber"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UnsubscriptionEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.UnsubscriptionFromIssue).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionFromIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.UnsubscriptionNewsletter).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionNewsletterID_Newsletter_Newsletter"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GatewayId).IsClustered(false); + + entity.HasIndex(e => e.GatewayDisplayName, "IX_Notification_Gateway_GatewayDisplayName").IsClustered(); + + entity.Property(e => e.GatewayAssemblyName).HasDefaultValueSql("('')"); + entity.Property(e => e.GatewayClassName).HasDefaultValueSql("('')"); + entity.Property(e => e.GatewayDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.GatewayEnabled).HasDefaultValueSql("((0))"); + entity.Property(e => e.GatewayName).HasDefaultValueSql("('')"); + entity.Property(e => e.GatewaySupportsEmail).HasDefaultValueSql("((0))"); + entity.Property(e => e.GatewaySupportsHtmltext).HasDefaultValueSql("((0))"); + entity.Property(e => e.GatewaySupportsPlainText).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubscriptionEventDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.SubscriptionSiteId).HasDefaultValueSql("((0))"); + entity.Property(e => e.SubscriptionUseHtml).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.SubscriptionGateway).WithMany(p => p.NotificationSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_Subscription_SubscriptionGatewayID_Notification_Gateway"); + + entity.HasOne(d => d.SubscriptionSite).WithMany(p => p.NotificationSubscriptions).HasConstraintName("FK_Notification_Subscription_SubscriptionSiteID_CMS_Site"); + + entity.HasOne(d => d.SubscriptionTemplate).WithMany(p => p.NotificationSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_Subscription_SubscriptionTemplateID_Notification_Template"); + + entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.NotificationSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_Subscription_SubscriptionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TemplateId).IsClustered(false); + + entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Notification_Template_TemplateSiteID_TemplateDisplayName").IsClustered(); + + entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TemplateSite).WithMany(p => p.NotificationTemplates).HasConstraintName("FK_Notification_Template_TemplateSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Gateway).WithMany(p => p.NotificationTemplateTexts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_TemplateText_GatewayID_Notification_Gateway"); + + entity.HasOne(d => d.Template).WithMany(p => p.NotificationTemplateTexts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_TemplateText_TemplateID_Notification_Template"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AbtestDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.AbtestIncludedTraffic).HasDefaultValueSql("((100))"); + entity.Property(e => e.AbtestName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AbtestOriginalPage).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AbtestSite).WithMany(p => p.OmAbtests) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABTest_SiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AbvariantDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.AbvariantName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AbvariantSite).WithMany(p => p.OmAbvariants) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABVariant_CMS_Site"); + + entity.HasOne(d => d.AbvariantTest).WithMany(p => p.OmAbvariants) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABVariant_ABVariantTestID_OM_ABTest"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AccountCountry).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_Country"); + + entity.HasOne(d => d.AccountOwnerUser).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_User"); + + entity.HasOne(d => d.AccountPrimaryContact).WithMany(p => p.OmAccountAccountPrimaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_PrimaryContact"); + + entity.HasOne(d => d.AccountSecondaryContact).WithMany(p => p.OmAccountAccountSecondaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_SecondaryContact"); + + entity.HasOne(d => d.AccountState).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_State"); + + entity.HasOne(d => d.AccountStatus).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_OM_AccountStatus"); + + entity.HasOne(d => d.AccountSubsidiaryOf).WithMany(p => p.InverseAccountSubsidiaryOf).HasConstraintName("FK_OM_Account_OM_Account_SubsidiaryOf"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Account).WithMany(p => p.OmAccountContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_AccountContact_OM_Account"); + + entity.HasOne(d => d.Contact).WithMany(p => p.OmAccountContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_AccountContact_OM_Contact"); + + entity.HasOne(d => d.ContactRole).WithMany(p => p.OmAccountContacts).HasConstraintName("FK_OM_AccountContact_OM_ContactRole"); + }); + + modelBuilder.Entity(entity => entity.HasIndex(e => e.ActivityCampaign, "IX_OM_Activity_ActivityCampaign") + .HasFilter("([ActivityCampaign] IS NOT NULL)") + .HasFillFactor(90)); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ActivityTypeEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ActivityTypeIsCustom).HasDefaultValueSql("((1))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactCreated).HasDefaultValueSql("('5/3/2011 10:51:13 AM')"); + entity.Property(e => e.ContactMonitored).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactSalesForceLeadReplicationDisabled).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactSalesForceLeadReplicationRequired).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ContactCountry).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_Country"); + + entity.HasOne(d => d.ContactOwnerUser).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_User"); + + entity.HasOne(d => d.ContactState).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_State"); + + entity.HasOne(d => d.ContactStatus).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_OM_ContactStatus"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ContactGroupId).HasName("PK_CMS_ContactGroup"); + + entity.Property(e => e.ContactGroupName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactGroupMemberFromCondition).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactGroupMemberFromManual).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ContactGroupMemberContactGroup).WithMany(p => p.OmContactGroupMembers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ContactGroupMembers_OM_ContactGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactRoleDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContactRoleName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactStatusDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContactStatusName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.Contact).WithMany(p => p.OmMemberships) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_Membership_OM_Contact")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MvtcombinationIsDefault).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Mvtvariants).WithMany(p => p.Mvtcombinations) + .UsingEntity>( + "OmMvtcombinationVariation", + r => r.HasOne().WithMany() + .HasForeignKey("MvtvariantId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_MVTCombinationVariation_OM_MVTVariant"), + l => l.HasOne().WithMany() + .HasForeignKey("MvtcombinationId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_MVTCombinationVariation_OM_MVTCombination"), + j => + { + j.HasKey("MvtcombinationId", "MvtvariantId"); + j.ToTable("OM_MVTCombinationVariation"); + j.HasIndex(new[] { "MvtvariantId" }, "IX_OM_MVTCombinationVariation_MVTVariantID"); + j.IndexerProperty("MvtcombinationId").HasColumnName("MVTCombinationID"); + j.IndexerProperty("MvtvariantId").HasColumnName("MVTVariantID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MvtestDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.MvtestName).HasDefaultValueSql("('')"); + entity.Property(e => e.MvtestPage).HasDefaultValueSql("('')"); + entity.Property(e => e.MvtestTargetConversionType).HasDefaultValueSql("('TOTAL')"); + + entity.HasOne(d => d.MvtestSite).WithMany(p => p.OmMvtests) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_MVTest_MVTestSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MvtvariantEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MvtvariantName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.MvtvariantPageTemplate).WithMany(p => p.OmMvtvariants) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_MVTVariant_MVTVariantPageTemplateID_CMS_PageTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.VariantDisplayCondition).HasDefaultValueSql("('')"); + entity.Property(e => e.VariantDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.VariantEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.VariantName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.VariantDocument).WithMany(p => p.OmPersonalizationVariants).HasConstraintName("FK_OM_PersonalizationVariant_VariantDocumentID_CMS_Document"); + + entity.HasOne(d => d.VariantPageTemplate).WithMany(p => p.OmPersonalizationVariants) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_PersonalizationVariant_VariantPageTemplateID_CMS_PageTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.RuleDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.RuleName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); + entity.Property(e => e.RuleType).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.RuleScore).WithMany(p => p.OmRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_Rule_OM_Score"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Contact).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Contact"); + + entity.HasOne(d => d.Rule).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Rule"); + + entity.HasOne(d => d.Score).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Score"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.VisitorToContactContact).WithMany(p => p.OmVisitorToContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_VisitorToContact_OM_Contact_Cascade")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PersonaDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PersonaEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PersonaName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); + entity.Property(e => e.PersonaPointsThreshold).HasDefaultValueSql("((100))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PersonaContactHistoryDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.PersonaContactHistoryPersona).WithMany(p => p.PersonasPersonaContactHistories).HasConstraintName("FK_Personas_PersonaContactHistory_Personas_Persona"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.Node).WithMany(p => p.PersonasPersonaNodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Personas_PersonaNode_CMS_Tree")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PollId).IsClustered(false); + + entity.HasIndex(e => new { e.PollSiteId, e.PollDisplayName }, "IX_Polls_Poll_PollSiteID_PollDisplayName").IsClustered(); + + entity.Property(e => e.PollCodeName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PollDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PollQuestion).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PollResponseMessage).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PollTitle).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PollGroup).WithMany(p => p.PollsPolls).HasConstraintName("FK_Polls_Poll_PollGroupID_Community_Group"); + + entity.HasOne(d => d.PollSite).WithMany(p => p.PollsPolls).HasConstraintName("FK_Polls_Poll_PollSiteID_CMS_Site"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Polls) + .UsingEntity>( + "PollsPollRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollRoles_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("PollId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollRoles_PollID_Polls_Poll"), + j => + { + j.HasKey("PollId", "RoleId"); + j.ToTable("Polls_PollRoles"); + j.HasIndex(new[] { "RoleId" }, "IX_Polls_PollRoles_RoleID"); + j.IndexerProperty("PollId").HasColumnName("PollID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + + entity.HasMany(d => d.Sites).WithMany(p => p.Polls) + .UsingEntity>( + "PollsPollSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("PollId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollSite_PollID_Polls_Poll"), + j => + { + j.HasKey("PollId", "SiteId"); + j.ToTable("Polls_PollSite"); + j.HasIndex(new[] { "SiteId" }, "IX_Polls_PollSite_SiteID"); + j.IndexerProperty("PollId").HasColumnName("PollID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AnswerId).IsClustered(false); + + entity.HasIndex(e => new { e.AnswerOrder, e.AnswerPollId, e.AnswerEnabled }, "IX_Polls_PollAnswer_AnswerPollID_AnswerOrder_AnswerEnabled").IsClustered(); + + entity.Property(e => e.AnswerHideForm).HasDefaultValueSql("((0))"); + entity.Property(e => e.AnswerText).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AnswerPoll).WithMany(p => p.PollsPollAnswers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollAnswer_AnswerPollID_Polls_Poll"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ReportId).IsClustered(false); + + entity.HasIndex(e => new { e.ReportDisplayName, e.ReportCategoryId }, "IX_Reporting_Report_ReportCategoryID_ReportDisplayName").IsClustered(); + + entity.Property(e => e.ReportAccess).HasDefaultValueSql("((1))"); + entity.Property(e => e.ReportDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportEnableSubscription).HasDefaultValueSql("((0))"); + entity.Property(e => e.ReportName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ReportCategory).WithMany(p => p.ReportingReports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_Report_ReportCategoryID_Reporting_ReportCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_Reporting_ReportCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_Reporting_ReportCategory_CategoryID_Reporting_ReportCategory_ParentCategoryID"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.GraphReport).WithMany(p => p.ReportingReportGraphs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportGraph_GraphReportID_Reporting_Report")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ReportSubscriptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ReportSubscriptionInterval).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportSubscriptionLastModified).HasDefaultValueSql("('3/9/2012 11:17:19 AM')"); + entity.Property(e => e.ReportSubscriptionOnlyNonEmpty).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.ReportSubscriptionGraph).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionGraphID_Reporting_ReportGraph"); + + entity.HasOne(d => d.ReportSubscriptionReport).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionReportID_Reporting_Report"); + + entity.HasOne(d => d.ReportSubscriptionSite).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionSiteID_CMS_Site"); + + entity.HasOne(d => d.ReportSubscriptionTable).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionTableID_Reporting_ReportTable"); + + entity.HasOne(d => d.ReportSubscriptionUser).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionUserID_CMS_User"); + + entity.HasOne(d => d.ReportSubscriptionValue).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionValueID_Reporting_ReportValue"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.TableReport).WithMany(p => p.ReportingReportTables) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportTable_TableReportID_Reporting_Report")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.ValueReport).WithMany(p => p.ReportingReportValues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportValue_ValueReportID_Reporting_Report")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SavedGraphSavedReport).WithMany(p => p.ReportingSavedGraphs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_SavedGraph_SavedGraphSavedReportID_Reporting_SavedReport")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SavedReportId).IsClustered(false); + + entity.HasIndex(e => new { e.SavedReportReportId, e.SavedReportDate }, "IX_Reporting_SavedReport_SavedReportReportID_SavedReportDate") + .IsDescending(false, true) + .IsClustered(); + + entity.HasOne(d => d.SavedReportCreatedByUser).WithMany(p => p.ReportingSavedReports).HasConstraintName("FK_Reporting_SavedReport_SavedReportCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.SavedReportReport).WithMany(p => p.ReportingSavedReports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_SavedReport_SavedReportReportID_Reporting_Report"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SharePointConnectionAuthMode).HasDefaultValueSql("(N'default')"); + entity.Property(e => e.SharePointConnectionSharePointVersion).HasDefaultValueSql("(N'sp2010')"); + + entity.HasOne(d => d.SharePointConnectionSite).WithMany(p => p.SharePointSharePointConnections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointConnection_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SharePointFileEtag).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileExtension).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileMimeType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileServerRelativeUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SharePointFileSharePointLibrary).WithMany(p => p.SharePointSharePointFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointFile_SharePoint_SharePointLibrary"); + + entity.HasOne(d => d.SharePointFileSite).WithMany(p => p.SharePointSharePointFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointFile_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SharePointLibraryDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibraryLastModified).HasDefaultValueSql("('10/3/2014 2:45:04 PM')"); + entity.Property(e => e.SharePointLibraryListTitle).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibraryName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibrarySharePointConnectionId).HasDefaultValueSql("((0))"); + entity.Property(e => e.SharePointLibrarySynchronizationPeriod).HasDefaultValueSql("((720))"); + + entity.HasOne(d => d.SharePointLibrarySharePointConnection).WithMany(p => p.SharePointSharePointLibraries).HasConstraintName("FK_SharePoint_SharePointLibrary_SharePoint_SharePointConnection"); + + entity.HasOne(d => d.SharePointLibrarySite).WithMany(p => p.SharePointSharePointLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointLibrary_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookAccountPageAccessToken).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookAccountPageId).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FacebookAccountFacebookApplication).WithMany(p => p.SmFacebookAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookAccount_SM_FacebookApplication"); + + entity.HasOne(d => d.FacebookAccountSite).WithMany(p => p.SmFacebookAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookAccount_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookApplicationConsumerKey).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookApplicationConsumerSecret).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookApplicationLastModified).HasDefaultValueSql("('5/28/2013 1:02:36 PM')"); + + entity.HasOne(d => d.FacebookApplicationSite).WithMany(p => p.SmFacebookApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookPostIsCreatedByUser).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.FacebookPostFacebookAccount).WithMany(p => p.SmFacebookPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookPost_SM_FacebookAccount"); + + entity.HasOne(d => d.FacebookPostSite).WithMany(p => p.SmFacebookPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookPost_CMS_Site"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.InsightExternalId).HasDefaultValueSql("('')")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitDays).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitMonths).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitWeeks).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitYears).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInAccountAccessToken).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountAccessTokenSecret).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountProfileId).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInApplicationConsumerKey).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationConsumerSecret).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.LinkedInApplicationSite).WithMany(p => p.SmLinkedInApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInPostComment).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInPostIsCreatedByUser).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.LinkedInPostLinkedInAccount).WithMany(p => p.SmLinkedInPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInPost_SM_LinkedInAccount"); + + entity.HasOne(d => d.LinkedInPostSite).WithMany(p => p.SmLinkedInPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInPost_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterAccountAccessToken).HasDefaultValueSql("('')"); + entity.Property(e => e.TwitterAccountAccessTokenSecret).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterAccountSite).WithMany(p => p.SmTwitterAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterAccount_CMS_Site"); + + entity.HasOne(d => d.TwitterAccountTwitterApplication).WithMany(p => p.SmTwitterAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterAccount_SM_TwitterApplication"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterApplicationConsumerKey).HasDefaultValueSql("('')"); + entity.Property(e => e.TwitterApplicationConsumerSecret).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterApplicationSite).WithMany(p => p.SmTwitterApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterPostIsCreatedByUser).HasDefaultValueSql("((1))"); + entity.Property(e => e.TwitterPostText).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterPostSite).WithMany(p => p.SmTwitterPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterPost_CMS_Site"); + + entity.HasOne(d => d.TwitterPostTwitterAccount).WithMany(p => p.SmTwitterPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterPost_SM_TwitterAccount"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ServerId).IsClustered(false); + + entity.HasIndex(e => new { e.ServerSiteId, e.ServerDisplayName }, "IX_Staging_Server_ServerSiteID_ServerDisplayName").IsClustered(); + + entity.Property(e => e.ServerAuthentication).HasDefaultValueSql("('USERNAME')"); + entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ServerEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ServerName).HasDefaultValueSql("('')"); + entity.Property(e => e.ServerUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ServerSite).WithMany(p => p.StagingServers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Server_ServerSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SynchronizationServer).WithMany(p => p.StagingSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Synchronization_SynchronizationServerID_Staging_Server"); + + entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.StagingSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Synchronization_SynchronizationTaskID_Staging_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskServers).HasDefaultValueSql("('null')"); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.StagingTasks).HasConstraintName("FK_Staging_Task_TaskSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.TaskGroupCodeName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupTask_Staging_TaskGroup"); + + entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskGroupTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupTask_Staging_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupUser_Staging_TaskGroup"); + + entity.HasOne(d => d.User).WithOne(p => p.StagingTaskGroupUser) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupUser_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskUser_StagingTask"); + + entity.HasOne(d => d.User).WithMany(p => p.StagingTaskUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskUser_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CellPhone3G).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellPhoneBluetooth).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellPhoneEdge).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellPhoneGprs).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellPhoneGps).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellPhoneHscsd).HasDefaultValueSql("((0))"); + entity.Property(e => e.CellPhoneIrDa).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LaptopBluetooth).HasDefaultValueSql("((0))"); + entity.Property(e => e.LaptopWebcam).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.MediaPlayerRadio).HasDefaultValueSql("((0))")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TabletBluetooth).HasDefaultValueSql("((0))"); + entity.Property(e => e.TabletGps).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FileDirectory).HasDefaultValueSql("('')"); + entity.Property(e => e.FileExtension).HasDefaultValueSql("('')"); + entity.Property(e => e.FileLastModified).HasDefaultValueSql("('6/29/2010 1:57:54 PM')"); + entity.Property(e => e.FileMimeType).HasDefaultValueSql("('')"); + entity.Property(e => e.FileName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => entity.ToView("View_Boards_BoardMessage_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ACLItem_ItemsAndOperators")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ObjectVersionHistoryUser_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_PageTemplateCategoryPageTemplate_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_Relationship_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ResourceString_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ResourceTranslated_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_RoleResourcePermission_Joined")); + + modelBuilder.Entity(entity => + { + entity.ToView("View_CMS_Site_DocumentCount"); + + entity.Property(e => e.SiteId).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_SiteRoleResourceUIElement_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_Tree_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_User")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserDocuments")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRole_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRoleMembershipRole")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRole_MembershipRole_ValidOnly_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserSettingsRole_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_WebPartCategoryWebpart_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_WidgetCategoryWidget_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_COM_SKUOptionCategory_OptionCategory_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Community_Friend_Friends")); + + modelBuilder.Entity(entity => entity.ToView("View_Community_Friend_RequestedFriends")); + + modelBuilder.Entity(entity => entity.ToView("View_Community_Group")); + + modelBuilder.Entity(entity => entity.ToView("View_Community_Member")); + + modelBuilder.Entity(entity => entity.ToView("View_Forums_GroupForumPost_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Integration_Task_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Membership_MembershipUser_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Messaging_ContactList")); + + modelBuilder.Entity(entity => entity.ToView("View_Messaging_IgnoreList")); + + modelBuilder.Entity(entity => entity.ToView("View_Newsletter_Subscriptions_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_AccountContact_AccountJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_AccountContact_ContactJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_Account_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_ContactGroupMember_AccountJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_ContactGroupMember_ContactJoined")); + + modelBuilder.Entity(entity => + { + entity.ToView("View_Poll_AnswerCount"); + + entity.Property(e => e.PollId).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(entity => entity.ToView("View_Reporting_CategoryReport_Joined")); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); +} diff --git a/Migration.Toolkit.K11/ContextCustomizations.cs b/Migration.Toolkit.K11/ContextCustomizations.cs index 4aedb9eb..25ac319f 100644 --- a/Migration.Toolkit.K11/ContextCustomizations.cs +++ b/Migration.Toolkit.K11/ContextCustomizations.cs @@ -1,14 +1,14 @@ -namespace Migration.Toolkit.K11; - -using Microsoft.EntityFrameworkCore; - -public partial class K11Context -{ - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - optionsBuilder - .EnableDetailedErrors() - .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); - base.OnConfiguring(optionsBuilder); - } -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11; + +public partial class K11Context +{ + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder + .EnableDetailedErrors() + .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); + base.OnConfiguring(optionsBuilder); + } +} diff --git a/Migration.Toolkit.K11/DependencyInjectionExtensions.cs b/Migration.Toolkit.K11/DependencyInjectionExtensions.cs index 787ccdff..6d084f69 100644 --- a/Migration.Toolkit.K11/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.K11/DependencyInjectionExtensions.cs @@ -1,14 +1,15 @@ -namespace Migration.Toolkit.K11; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseK11DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) - { - services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); - return services; - } -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.K11; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseK11DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) + { + services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); + return services; + } +} diff --git a/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj b/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj index ddc08f7f..d22120b8 100644 --- a/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj +++ b/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj @@ -16,23 +16,23 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + diff --git a/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj.DotSettings b/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj.DotSettings index 1ae77f88..809d6630 100644 --- a/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj.DotSettings +++ b/Migration.Toolkit.K11/Migration.Toolkit.K11.csproj.DotSettings @@ -1,2 +1,5 @@ - - True \ No newline at end of file + + True \ No newline at end of file diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs index 31732672..3fba4e53 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaign.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_Campaign")] -[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] -[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] -public partial class AnalyticsCampaign -{ - [Key] - [Column("CampaignID")] - public int CampaignId { get; set; } - - [StringLength(200)] - public string CampaignName { get; set; } = null!; - - [StringLength(100)] - public string CampaignDisplayName { get; set; } = null!; - - public string? CampaignDescription { get; set; } - - [Column("CampaignSiteID")] - public int CampaignSiteId { get; set; } - - public DateTime? CampaignOpenFrom { get; set; } - - public DateTime? CampaignOpenTo { get; set; } - - [Column("CampaignGUID")] - public Guid CampaignGuid { get; set; } - - public DateTime CampaignLastModified { get; set; } - - [Column("CampaignUTMCode")] - [StringLength(200)] - public string? CampaignUtmcode { get; set; } - - public DateTime? CampaignCalculatedTo { get; set; } - - [Column("CampaignScheduledTaskID")] - public int? CampaignScheduledTaskId { get; set; } - - public int? CampaignVisitors { get; set; } - - [InverseProperty("CampaignAssetCampaign")] - public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); - - [InverseProperty("CampaignConversionCampaign")] - public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaign")] - public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } - - [ForeignKey("CampaignScheduledTaskId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } - - [ForeignKey("CampaignSiteId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsSite CampaignSite { get; set; } = null!; - - [InverseProperty("FacebookPostCampaign")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInPostCampaign")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterPostCampaign")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_Campaign")] +[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] +[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] +public class AnalyticsCampaign +{ + [Key] + [Column("CampaignID")] + public int CampaignId { get; set; } + + [StringLength(200)] + public string CampaignName { get; set; } = null!; + + [StringLength(100)] + public string CampaignDisplayName { get; set; } = null!; + + public string? CampaignDescription { get; set; } + + [Column("CampaignSiteID")] + public int CampaignSiteId { get; set; } + + public DateTime? CampaignOpenFrom { get; set; } + + public DateTime? CampaignOpenTo { get; set; } + + [Column("CampaignGUID")] + public Guid CampaignGuid { get; set; } + + public DateTime CampaignLastModified { get; set; } + + [Column("CampaignUTMCode")] + [StringLength(200)] + public string? CampaignUtmcode { get; set; } + + public DateTime? CampaignCalculatedTo { get; set; } + + [Column("CampaignScheduledTaskID")] + public int? CampaignScheduledTaskId { get; set; } + + public int? CampaignVisitors { get; set; } + + [InverseProperty("CampaignAssetCampaign")] + public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); + + [InverseProperty("CampaignConversionCampaign")] + public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaign")] + public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } + + [ForeignKey("CampaignScheduledTaskId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } + + [ForeignKey("CampaignSiteId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsSite CampaignSite { get; set; } = null!; + + [InverseProperty("FacebookPostCampaign")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInPostCampaign")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterPostCampaign")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs index 9177f72e..33864ec2 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignAsset.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignAsset")] -[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] -public partial class AnalyticsCampaignAsset -{ - [Key] - [Column("CampaignAssetID")] - public int CampaignAssetId { get; set; } - - public Guid CampaignAssetGuid { get; set; } - - public DateTime CampaignAssetLastModified { get; set; } - - public Guid CampaignAssetAssetGuid { get; set; } - - [Column("CampaignAssetCampaignID")] - public int CampaignAssetCampaignId { get; set; } - - [StringLength(200)] - public string CampaignAssetType { get; set; } = null!; - - [InverseProperty("CampaignAssetUrlCampaignAsset")] - public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); - - [ForeignKey("CampaignAssetCampaignId")] - [InverseProperty("AnalyticsCampaignAssets")] - public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_CampaignAsset")] +[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] +public class AnalyticsCampaignAsset +{ + [Key] + [Column("CampaignAssetID")] + public int CampaignAssetId { get; set; } + + public Guid CampaignAssetGuid { get; set; } + + public DateTime CampaignAssetLastModified { get; set; } + + public Guid CampaignAssetAssetGuid { get; set; } + + [Column("CampaignAssetCampaignID")] + public int CampaignAssetCampaignId { get; set; } + + [StringLength(200)] + public string CampaignAssetType { get; set; } = null!; + + [InverseProperty("CampaignAssetUrlCampaignAsset")] + public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); + + [ForeignKey("CampaignAssetCampaignId")] + [InverseProperty("AnalyticsCampaignAssets")] + public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs index 51619545..c761d09f 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignAssetUrl.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignAssetUrl")] -[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] -public partial class AnalyticsCampaignAssetUrl -{ - [Key] - [Column("CampaignAssetUrlID")] - public int CampaignAssetUrlId { get; set; } - - public Guid CampaignAssetUrlGuid { get; set; } - - public string CampaignAssetUrlTarget { get; set; } = null!; - - [StringLength(200)] - public string CampaignAssetUrlPageTitle { get; set; } = null!; - - [Column("CampaignAssetUrlCampaignAssetID")] - public int CampaignAssetUrlCampaignAssetId { get; set; } - - [ForeignKey("CampaignAssetUrlCampaignAssetId")] - [InverseProperty("AnalyticsCampaignAssetUrls")] - public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_CampaignAssetUrl")] +[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] +public class AnalyticsCampaignAssetUrl +{ + [Key] + [Column("CampaignAssetUrlID")] + public int CampaignAssetUrlId { get; set; } + + public Guid CampaignAssetUrlGuid { get; set; } + + public string CampaignAssetUrlTarget { get; set; } = null!; + + [StringLength(200)] + public string CampaignAssetUrlPageTitle { get; set; } = null!; + + [Column("CampaignAssetUrlCampaignAssetID")] + public int CampaignAssetUrlCampaignAssetId { get; set; } + + [ForeignKey("CampaignAssetUrlCampaignAssetId")] + [InverseProperty("AnalyticsCampaignAssetUrls")] + public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs index 63684a30..20584e86 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversion.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignConversion")] -[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] -public partial class AnalyticsCampaignConversion -{ - [Key] - [Column("CampaignConversionID")] - public int CampaignConversionId { get; set; } - - public Guid CampaignConversionGuid { get; set; } - - public DateTime CampaignConversionLastModified { get; set; } - - [StringLength(100)] - public string CampaignConversionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string CampaignConversionName { get; set; } = null!; - - [Column("CampaignConversionCampaignID")] - public int CampaignConversionCampaignId { get; set; } - - public int CampaignConversionOrder { get; set; } - - [StringLength(250)] - public string CampaignConversionActivityType { get; set; } = null!; - - public int CampaignConversionHits { get; set; } - - [Column("CampaignConversionItemID")] - public int? CampaignConversionItemId { get; set; } - - public double CampaignConversionValue { get; set; } - - public bool CampaignConversionIsFunnelStep { get; set; } - - [Column("CampaignConversionURL")] - public string? CampaignConversionUrl { get; set; } - - [InverseProperty("CampaignConversionHitsConversion")] - public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaignConversion")] - public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); - - [ForeignKey("CampaignConversionCampaignId")] - [InverseProperty("AnalyticsCampaignConversions")] - public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_CampaignConversion")] +[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] +public class AnalyticsCampaignConversion +{ + [Key] + [Column("CampaignConversionID")] + public int CampaignConversionId { get; set; } + + public Guid CampaignConversionGuid { get; set; } + + public DateTime CampaignConversionLastModified { get; set; } + + [StringLength(100)] + public string CampaignConversionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string CampaignConversionName { get; set; } = null!; + + [Column("CampaignConversionCampaignID")] + public int CampaignConversionCampaignId { get; set; } + + public int CampaignConversionOrder { get; set; } + + [StringLength(250)] + public string CampaignConversionActivityType { get; set; } = null!; + + public int CampaignConversionHits { get; set; } + + [Column("CampaignConversionItemID")] + public int? CampaignConversionItemId { get; set; } + + public double CampaignConversionValue { get; set; } + + public bool CampaignConversionIsFunnelStep { get; set; } + + [Column("CampaignConversionURL")] + public string? CampaignConversionUrl { get; set; } + + [InverseProperty("CampaignConversionHitsConversion")] + public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaignConversion")] + public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); + + [ForeignKey("CampaignConversionCampaignId")] + [InverseProperty("AnalyticsCampaignConversions")] + public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs index 38d71506..099bf03e 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignConversionHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignConversionHits")] -[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] -public partial class AnalyticsCampaignConversionHit -{ - [Key] - [Column("CampaignConversionHitsID")] - public int CampaignConversionHitsId { get; set; } - - [Column("CampaignConversionHitsConversionID")] - public int CampaignConversionHitsConversionId { get; set; } - - public int CampaignConversionHitsCount { get; set; } - - [StringLength(200)] - public string CampaignConversionHitsSourceName { get; set; } = null!; - - [StringLength(200)] - public string? CampaignConversionHitsContentName { get; set; } - - [ForeignKey("CampaignConversionHitsConversionId")] - [InverseProperty("AnalyticsCampaignConversionHits")] - public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_CampaignConversionHits")] +[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] +public class AnalyticsCampaignConversionHit +{ + [Key] + [Column("CampaignConversionHitsID")] + public int CampaignConversionHitsId { get; set; } + + [Column("CampaignConversionHitsConversionID")] + public int CampaignConversionHitsConversionId { get; set; } + + public int CampaignConversionHitsCount { get; set; } + + [StringLength(200)] + public string CampaignConversionHitsSourceName { get; set; } = null!; + + [StringLength(200)] + public string? CampaignConversionHitsContentName { get; set; } + + [ForeignKey("CampaignConversionHitsConversionId")] + [InverseProperty("AnalyticsCampaignConversionHits")] + public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs index 9e10951e..3206023e 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsCampaignObjective.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_CampaignObjective")] -[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] -[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] -public partial class AnalyticsCampaignObjective -{ - [Key] - [Column("CampaignObjectiveID")] - public int CampaignObjectiveId { get; set; } - - public Guid CampaignObjectiveGuid { get; set; } - - public DateTime CampaignObjectiveLastModified { get; set; } - - [Column("CampaignObjectiveCampaignID")] - public int CampaignObjectiveCampaignId { get; set; } - - public int? CampaignObjectiveValue { get; set; } - - [Column("CampaignObjectiveCampaignConversionID")] - public int CampaignObjectiveCampaignConversionId { get; set; } - - [ForeignKey("CampaignObjectiveCampaignId")] - [InverseProperty("AnalyticsCampaignObjective")] - public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; - - [ForeignKey("CampaignObjectiveCampaignConversionId")] - [InverseProperty("AnalyticsCampaignObjectives")] - public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_CampaignObjective")] +[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] +[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] +public class AnalyticsCampaignObjective +{ + [Key] + [Column("CampaignObjectiveID")] + public int CampaignObjectiveId { get; set; } + + public Guid CampaignObjectiveGuid { get; set; } + + public DateTime CampaignObjectiveLastModified { get; set; } + + [Column("CampaignObjectiveCampaignID")] + public int CampaignObjectiveCampaignId { get; set; } + + public int? CampaignObjectiveValue { get; set; } + + [Column("CampaignObjectiveCampaignConversionID")] + public int CampaignObjectiveCampaignConversionId { get; set; } + + [ForeignKey("CampaignObjectiveCampaignId")] + [InverseProperty("AnalyticsCampaignObjective")] + public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; + + [ForeignKey("CampaignObjectiveCampaignConversionId")] + [InverseProperty("AnalyticsCampaignObjectives")] + public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsConversion.cs b/Migration.Toolkit.K11/Models/AnalyticsConversion.cs index 477f1893..e2e278ae 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsConversion.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsConversion.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_Conversion")] -[Index("ConversionSiteId", Name = "IX_Analytics_Conversion_ConversionSiteID")] -public partial class AnalyticsConversion -{ - [Key] - [Column("ConversionID")] - public int ConversionId { get; set; } - - [StringLength(200)] - public string ConversionName { get; set; } = null!; - - [StringLength(200)] - public string ConversionDisplayName { get; set; } = null!; - - public string? ConversionDescription { get; set; } - - [Column("ConversionGUID")] - public Guid ConversionGuid { get; set; } - - public DateTime ConversionLastModified { get; set; } - - [Column("ConversionSiteID")] - public int ConversionSiteId { get; set; } - - [ForeignKey("ConversionSiteId")] - [InverseProperty("AnalyticsConversions")] - public virtual CmsSite ConversionSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_Conversion")] +[Index("ConversionSiteId", Name = "IX_Analytics_Conversion_ConversionSiteID")] +public class AnalyticsConversion +{ + [Key] + [Column("ConversionID")] + public int ConversionId { get; set; } + + [StringLength(200)] + public string ConversionName { get; set; } = null!; + + [StringLength(200)] + public string ConversionDisplayName { get; set; } = null!; + + public string? ConversionDescription { get; set; } + + [Column("ConversionGUID")] + public Guid ConversionGuid { get; set; } + + public DateTime ConversionLastModified { get; set; } + + [Column("ConversionSiteID")] + public int ConversionSiteId { get; set; } + + [ForeignKey("ConversionSiteId")] + [InverseProperty("AnalyticsConversions")] + public virtual CmsSite ConversionSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs b/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs index dc664db0..9caadb12 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsDayHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_DayHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] -public partial class AnalyticsDayHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsDayHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_DayHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] +public class AnalyticsDayHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsDayHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs b/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs index 7039d8b6..4ab7e995 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsExitPage.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_ExitPages")] -[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] -public partial class AnalyticsExitPage -{ - [Key] - [StringLength(200)] - public string SessionIdentificator { get; set; } = null!; - - [Column("ExitPageNodeID")] - public int ExitPageNodeId { get; set; } - - public DateTime ExitPageLastModified { get; set; } - - [Column("ExitPageSiteID")] - public int ExitPageSiteId { get; set; } - - [StringLength(10)] - public string? ExitPageCulture { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_ExitPages")] +[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] +public class AnalyticsExitPage +{ + [Key] + [StringLength(200)] + public string SessionIdentificator { get; set; } = null!; + + [Column("ExitPageNodeID")] + public int ExitPageNodeId { get; set; } + + public DateTime ExitPageLastModified { get; set; } + + [Column("ExitPageSiteID")] + public int ExitPageSiteId { get; set; } + + [StringLength(10)] + public string? ExitPageCulture { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs b/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs index 39be47ba..59209520 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsHourHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_HourHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] -public partial class AnalyticsHourHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsHourHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_HourHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] +public class AnalyticsHourHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsHourHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs index 0679ebaa..876ac3b0 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsMonthHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_MonthHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] -public partial class AnalyticsMonthHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsMonthHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_MonthHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] +public class AnalyticsMonthHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsMonthHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs b/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs index 8b2d9d9d..2f14d45f 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsStatistic.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_Statistics")] -[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] -public partial class AnalyticsStatistic -{ - [Key] - [Column("StatisticsID")] - public int StatisticsId { get; set; } - - [Column("StatisticsSiteID")] - public int? StatisticsSiteId { get; set; } - - [StringLength(400)] - public string StatisticsCode { get; set; } = null!; - - [StringLength(450)] - public string? StatisticsObjectName { get; set; } - - [Column("StatisticsObjectID")] - public int? StatisticsObjectId { get; set; } - - [StringLength(10)] - public string? StatisticsObjectCulture { get; set; } - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsDayHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsHourHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsYearHits { get; set; } = new List(); - - [ForeignKey("StatisticsSiteId")] - [InverseProperty("AnalyticsStatistics")] - public virtual CmsSite? StatisticsSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_Statistics")] +[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] +public class AnalyticsStatistic +{ + [Key] + [Column("StatisticsID")] + public int StatisticsId { get; set; } + + [Column("StatisticsSiteID")] + public int? StatisticsSiteId { get; set; } + + [StringLength(400)] + public string StatisticsCode { get; set; } = null!; + + [StringLength(450)] + public string? StatisticsObjectName { get; set; } + + [Column("StatisticsObjectID")] + public int? StatisticsObjectId { get; set; } + + [StringLength(10)] + public string? StatisticsObjectCulture { get; set; } + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsDayHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsHourHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsYearHits { get; set; } = new List(); + + [ForeignKey("StatisticsSiteId")] + [InverseProperty("AnalyticsStatistics")] + public virtual CmsSite? StatisticsSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs index 4d1d278e..8bfa3d90 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsWeekHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_WeekHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] -public partial class AnalyticsWeekHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsWeekHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_WeekHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] +public class AnalyticsWeekHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsWeekHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs b/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs index 69d6ff6d..90d2f195 100644 --- a/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs +++ b/Migration.Toolkit.K11/Models/AnalyticsYearHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Analytics_YearHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] -public partial class AnalyticsYearHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsYearHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Analytics_YearHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] +public class AnalyticsYearHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsYearHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/BadWordsWord.cs b/Migration.Toolkit.K11/Models/BadWordsWord.cs index 7163c9c1..a0eb4123 100644 --- a/Migration.Toolkit.K11/Models/BadWordsWord.cs +++ b/Migration.Toolkit.K11/Models/BadWordsWord.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("BadWords_Word")] -[Index("WordIsGlobal", Name = "IX_BadWords_Word_WordIsGlobal")] -public partial class BadWordsWord -{ - [Key] - [Column("WordID")] - public int WordId { get; set; } - - [Column("WordGUID")] - public Guid WordGuid { get; set; } - - public DateTime WordLastModified { get; set; } - - [StringLength(200)] - public string WordExpression { get; set; } = null!; - - [StringLength(200)] - public string? WordReplacement { get; set; } - - public int? WordAction { get; set; } - - public bool WordIsGlobal { get; set; } - - public bool WordIsRegularExpression { get; set; } - - public bool? WordMatchWholeWord { get; set; } - - [ForeignKey("WordId")] - [InverseProperty("Words")] - public virtual ICollection Cultures { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("BadWords_Word")] +[Index("WordIsGlobal", Name = "IX_BadWords_Word_WordIsGlobal")] +public class BadWordsWord +{ + [Key] + [Column("WordID")] + public int WordId { get; set; } + + [Column("WordGUID")] + public Guid WordGuid { get; set; } + + public DateTime WordLastModified { get; set; } + + [StringLength(200)] + public string WordExpression { get; set; } = null!; + + [StringLength(200)] + public string? WordReplacement { get; set; } + + public int? WordAction { get; set; } + + public bool WordIsGlobal { get; set; } + + public bool WordIsRegularExpression { get; set; } + + public bool? WordMatchWholeWord { get; set; } + + [ForeignKey("WordId")] + [InverseProperty("Words")] + public virtual ICollection Cultures { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/BlogComment.cs b/Migration.Toolkit.K11/Models/BlogComment.cs index 1b9b2165..34e39327 100644 --- a/Migration.Toolkit.K11/Models/BlogComment.cs +++ b/Migration.Toolkit.K11/Models/BlogComment.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Blog_Comment")] -[Index("CommentApprovedByUserId", Name = "IX_Blog_Comment_CommentApprovedByUserID")] -[Index("CommentPostDocumentId", Name = "IX_Blog_Comment_CommentPostDocumentID")] -[Index("CommentUserId", Name = "IX_Blog_Comment_CommentUserID")] -public partial class BlogComment -{ - [Key] - [Column("CommentID")] - public int CommentId { get; set; } - - [StringLength(200)] - public string CommentUserName { get; set; } = null!; - - [Column("CommentUserID")] - public int? CommentUserId { get; set; } - - [StringLength(450)] - public string? CommentUrl { get; set; } - - public string CommentText { get; set; } = null!; - - [Column("CommentApprovedByUserID")] - public int? CommentApprovedByUserId { get; set; } - - [Column("CommentPostDocumentID")] - public int CommentPostDocumentId { get; set; } - - public DateTime CommentDate { get; set; } - - public bool? CommentIsSpam { get; set; } - - public bool? CommentApproved { get; set; } - - [StringLength(254)] - public string? CommentEmail { get; set; } - - public string? CommentInfo { get; set; } - - [Column("CommentGUID")] - public Guid CommentGuid { get; set; } - - [ForeignKey("CommentApprovedByUserId")] - [InverseProperty("BlogCommentCommentApprovedByUsers")] - public virtual CmsUser? CommentApprovedByUser { get; set; } - - [ForeignKey("CommentPostDocumentId")] - [InverseProperty("BlogComments")] - public virtual CmsDocument CommentPostDocument { get; set; } = null!; - - [ForeignKey("CommentUserId")] - [InverseProperty("BlogCommentCommentUsers")] - public virtual CmsUser? CommentUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Blog_Comment")] +[Index("CommentApprovedByUserId", Name = "IX_Blog_Comment_CommentApprovedByUserID")] +[Index("CommentPostDocumentId", Name = "IX_Blog_Comment_CommentPostDocumentID")] +[Index("CommentUserId", Name = "IX_Blog_Comment_CommentUserID")] +public class BlogComment +{ + [Key] + [Column("CommentID")] + public int CommentId { get; set; } + + [StringLength(200)] + public string CommentUserName { get; set; } = null!; + + [Column("CommentUserID")] + public int? CommentUserId { get; set; } + + [StringLength(450)] + public string? CommentUrl { get; set; } + + public string CommentText { get; set; } = null!; + + [Column("CommentApprovedByUserID")] + public int? CommentApprovedByUserId { get; set; } + + [Column("CommentPostDocumentID")] + public int CommentPostDocumentId { get; set; } + + public DateTime CommentDate { get; set; } + + public bool? CommentIsSpam { get; set; } + + public bool? CommentApproved { get; set; } + + [StringLength(254)] + public string? CommentEmail { get; set; } + + public string? CommentInfo { get; set; } + + [Column("CommentGUID")] + public Guid CommentGuid { get; set; } + + [ForeignKey("CommentApprovedByUserId")] + [InverseProperty("BlogCommentCommentApprovedByUsers")] + public virtual CmsUser? CommentApprovedByUser { get; set; } + + [ForeignKey("CommentPostDocumentId")] + [InverseProperty("BlogComments")] + public virtual CmsDocument CommentPostDocument { get; set; } = null!; + + [ForeignKey("CommentUserId")] + [InverseProperty("BlogCommentCommentUsers")] + public virtual CmsUser? CommentUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/BlogPostSubscription.cs b/Migration.Toolkit.K11/Models/BlogPostSubscription.cs index 479eab31..55f91b43 100644 --- a/Migration.Toolkit.K11/Models/BlogPostSubscription.cs +++ b/Migration.Toolkit.K11/Models/BlogPostSubscription.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Blog_PostSubscription")] -[Index("SubscriptionPostDocumentId", Name = "IX_Blog_PostSubscription_SubscriptionPostDocumentID")] -[Index("SubscriptionUserId", Name = "IX_Blog_PostSubscription_SubscriptionUserID")] -public partial class BlogPostSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionPostDocumentID")] - public int SubscriptionPostDocumentId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string? SubscriptionEmail { get; set; } - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionPostDocumentId")] - [InverseProperty("BlogPostSubscriptions")] - public virtual CmsDocument SubscriptionPostDocument { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("BlogPostSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Blog_PostSubscription")] +[Index("SubscriptionPostDocumentId", Name = "IX_Blog_PostSubscription_SubscriptionPostDocumentID")] +[Index("SubscriptionUserId", Name = "IX_Blog_PostSubscription_SubscriptionUserID")] +public class BlogPostSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionPostDocumentID")] + public int SubscriptionPostDocumentId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string? SubscriptionEmail { get; set; } + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionPostDocumentId")] + [InverseProperty("BlogPostSubscriptions")] + public virtual CmsDocument SubscriptionPostDocument { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("BlogPostSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/BoardBoard.cs b/Migration.Toolkit.K11/Models/BoardBoard.cs index 6793f1a3..b503a47a 100644 --- a/Migration.Toolkit.K11/Models/BoardBoard.cs +++ b/Migration.Toolkit.K11/Models/BoardBoard.cs @@ -1,117 +1,116 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Board_Board")] -[Index("BoardDocumentId", "BoardName", Name = "IX_Board_Board_BoardDocumentID_BoardName", IsUnique = true)] -[Index("BoardGroupId", "BoardName", Name = "IX_Board_Board_BoardGroupID_BoardName")] -[Index("BoardSiteId", Name = "IX_Board_Board_BoardSiteID")] -[Index("BoardUserId", "BoardName", Name = "IX_Board_Board_BoardUserID_BoardName")] -public partial class BoardBoard -{ - [Key] - [Column("BoardID")] - public int BoardId { get; set; } - - [StringLength(250)] - public string BoardName { get; set; } = null!; - - [StringLength(250)] - public string BoardDisplayName { get; set; } = null!; - - public string BoardDescription { get; set; } = null!; - - public bool BoardOpened { get; set; } - - public DateTime? BoardOpenedFrom { get; set; } - - public DateTime? BoardOpenedTo { get; set; } - - public bool BoardEnabled { get; set; } - - public int BoardAccess { get; set; } - - public bool BoardModerated { get; set; } - - public bool BoardUseCaptcha { get; set; } - - public int BoardMessages { get; set; } - - public DateTime BoardLastModified { get; set; } - - [Column("BoardGUID")] - public Guid BoardGuid { get; set; } - - [Column("BoardDocumentID")] - public int BoardDocumentId { get; set; } - - [Column("BoardUserID")] - public int? BoardUserId { get; set; } - - [Column("BoardGroupID")] - public int? BoardGroupId { get; set; } - - public DateTime? BoardLastMessageTime { get; set; } - - [StringLength(250)] - public string? BoardLastMessageUserName { get; set; } - - [Column("BoardUnsubscriptionURL")] - [StringLength(450)] - public string? BoardUnsubscriptionUrl { get; set; } - - public bool? BoardRequireEmails { get; set; } - - [Column("BoardSiteID")] - public int BoardSiteId { get; set; } - - public bool BoardEnableSubscriptions { get; set; } - - [Column("BoardBaseURL")] - [StringLength(450)] - public string? BoardBaseUrl { get; set; } - - public bool? BoardLogActivity { get; set; } - - public bool? BoardEnableOptIn { get; set; } - - public bool? BoardSendOptInConfirmation { get; set; } - - [Column("BoardOptInApprovalURL")] - [StringLength(450)] - public string? BoardOptInApprovalUrl { get; set; } - - [ForeignKey("BoardDocumentId")] - [InverseProperty("BoardBoards")] - public virtual CmsDocument BoardDocument { get; set; } = null!; - - [ForeignKey("BoardGroupId")] - [InverseProperty("BoardBoards")] - public virtual CommunityGroup? BoardGroup { get; set; } - - [InverseProperty("MessageBoard")] - public virtual ICollection BoardMessagesNavigation { get; set; } = new List(); - - [ForeignKey("BoardSiteId")] - [InverseProperty("BoardBoards")] - public virtual CmsSite BoardSite { get; set; } = null!; - - [InverseProperty("SubscriptionBoard")] - public virtual ICollection BoardSubscriptions { get; set; } = new List(); - - [ForeignKey("BoardUserId")] - [InverseProperty("BoardBoards")] - public virtual CmsUser? BoardUser { get; set; } - - [ForeignKey("BoardId")] - [InverseProperty("Boards")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("BoardId")] - [InverseProperty("Boards")] - public virtual ICollection Users { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Board_Board")] +[Index("BoardDocumentId", "BoardName", Name = "IX_Board_Board_BoardDocumentID_BoardName", IsUnique = true)] +[Index("BoardGroupId", "BoardName", Name = "IX_Board_Board_BoardGroupID_BoardName")] +[Index("BoardSiteId", Name = "IX_Board_Board_BoardSiteID")] +[Index("BoardUserId", "BoardName", Name = "IX_Board_Board_BoardUserID_BoardName")] +public class BoardBoard +{ + [Key] + [Column("BoardID")] + public int BoardId { get; set; } + + [StringLength(250)] + public string BoardName { get; set; } = null!; + + [StringLength(250)] + public string BoardDisplayName { get; set; } = null!; + + public string BoardDescription { get; set; } = null!; + + public bool BoardOpened { get; set; } + + public DateTime? BoardOpenedFrom { get; set; } + + public DateTime? BoardOpenedTo { get; set; } + + public bool BoardEnabled { get; set; } + + public int BoardAccess { get; set; } + + public bool BoardModerated { get; set; } + + public bool BoardUseCaptcha { get; set; } + + public int BoardMessages { get; set; } + + public DateTime BoardLastModified { get; set; } + + [Column("BoardGUID")] + public Guid BoardGuid { get; set; } + + [Column("BoardDocumentID")] + public int BoardDocumentId { get; set; } + + [Column("BoardUserID")] + public int? BoardUserId { get; set; } + + [Column("BoardGroupID")] + public int? BoardGroupId { get; set; } + + public DateTime? BoardLastMessageTime { get; set; } + + [StringLength(250)] + public string? BoardLastMessageUserName { get; set; } + + [Column("BoardUnsubscriptionURL")] + [StringLength(450)] + public string? BoardUnsubscriptionUrl { get; set; } + + public bool? BoardRequireEmails { get; set; } + + [Column("BoardSiteID")] + public int BoardSiteId { get; set; } + + public bool BoardEnableSubscriptions { get; set; } + + [Column("BoardBaseURL")] + [StringLength(450)] + public string? BoardBaseUrl { get; set; } + + public bool? BoardLogActivity { get; set; } + + public bool? BoardEnableOptIn { get; set; } + + public bool? BoardSendOptInConfirmation { get; set; } + + [Column("BoardOptInApprovalURL")] + [StringLength(450)] + public string? BoardOptInApprovalUrl { get; set; } + + [ForeignKey("BoardDocumentId")] + [InverseProperty("BoardBoards")] + public virtual CmsDocument BoardDocument { get; set; } = null!; + + [ForeignKey("BoardGroupId")] + [InverseProperty("BoardBoards")] + public virtual CommunityGroup? BoardGroup { get; set; } + + [InverseProperty("MessageBoard")] + public virtual ICollection BoardMessagesNavigation { get; set; } = new List(); + + [ForeignKey("BoardSiteId")] + [InverseProperty("BoardBoards")] + public virtual CmsSite BoardSite { get; set; } = null!; + + [InverseProperty("SubscriptionBoard")] + public virtual ICollection BoardSubscriptions { get; set; } = new List(); + + [ForeignKey("BoardUserId")] + [InverseProperty("BoardBoards")] + public virtual CmsUser? BoardUser { get; set; } + + [ForeignKey("BoardId")] + [InverseProperty("Boards")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("BoardId")] + [InverseProperty("Boards")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/BoardMessage.cs b/Migration.Toolkit.K11/Models/BoardMessage.cs index 6e18c76d..fdd15932 100644 --- a/Migration.Toolkit.K11/Models/BoardMessage.cs +++ b/Migration.Toolkit.K11/Models/BoardMessage.cs @@ -1,70 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Board_Message")] -[Index("MessageApprovedByUserId", Name = "IX_Board_Message_MessageApprovedByUserID")] -[Index("MessageApproved", "MessageIsSpam", Name = "IX_Board_Message_MessageApproved_MessageIsSpam")] -[Index("MessageBoardId", "MessageGuid", Name = "IX_Board_Message_MessageBoardID_MessageGUID", IsUnique = true)] -[Index("MessageUserId", Name = "IX_Board_Message_MessageUserID")] -public partial class BoardMessage -{ - [Key] - [Column("MessageID")] - public int MessageId { get; set; } - - [StringLength(250)] - public string MessageUserName { get; set; } = null!; - - public string MessageText { get; set; } = null!; - - [StringLength(254)] - public string MessageEmail { get; set; } = null!; - - [Column("MessageURL")] - [StringLength(450)] - public string MessageUrl { get; set; } = null!; - - public bool MessageIsSpam { get; set; } - - [Column("MessageBoardID")] - public int MessageBoardId { get; set; } - - public bool MessageApproved { get; set; } - - [Column("MessageApprovedByUserID")] - public int? MessageApprovedByUserId { get; set; } - - [Column("MessageUserID")] - public int? MessageUserId { get; set; } - - public string MessageUserInfo { get; set; } = null!; - - [Column("MessageAvatarGUID")] - public Guid? MessageAvatarGuid { get; set; } - - public DateTime MessageInserted { get; set; } - - public DateTime MessageLastModified { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public double? MessageRatingValue { get; set; } - - [ForeignKey("MessageApprovedByUserId")] - [InverseProperty("BoardMessageMessageApprovedByUsers")] - public virtual CmsUser? MessageApprovedByUser { get; set; } - - [ForeignKey("MessageBoardId")] - [InverseProperty("BoardMessagesNavigation")] - public virtual BoardBoard MessageBoard { get; set; } = null!; - - [ForeignKey("MessageUserId")] - [InverseProperty("BoardMessageMessageUsers")] - public virtual CmsUser? MessageUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Board_Message")] +[Index("MessageApprovedByUserId", Name = "IX_Board_Message_MessageApprovedByUserID")] +[Index("MessageApproved", "MessageIsSpam", Name = "IX_Board_Message_MessageApproved_MessageIsSpam")] +[Index("MessageBoardId", "MessageGuid", Name = "IX_Board_Message_MessageBoardID_MessageGUID", IsUnique = true)] +[Index("MessageUserId", Name = "IX_Board_Message_MessageUserID")] +public class BoardMessage +{ + [Key] + [Column("MessageID")] + public int MessageId { get; set; } + + [StringLength(250)] + public string MessageUserName { get; set; } = null!; + + public string MessageText { get; set; } = null!; + + [StringLength(254)] + public string MessageEmail { get; set; } = null!; + + [Column("MessageURL")] + [StringLength(450)] + public string MessageUrl { get; set; } = null!; + + public bool MessageIsSpam { get; set; } + + [Column("MessageBoardID")] + public int MessageBoardId { get; set; } + + public bool MessageApproved { get; set; } + + [Column("MessageApprovedByUserID")] + public int? MessageApprovedByUserId { get; set; } + + [Column("MessageUserID")] + public int? MessageUserId { get; set; } + + public string MessageUserInfo { get; set; } = null!; + + [Column("MessageAvatarGUID")] + public Guid? MessageAvatarGuid { get; set; } + + public DateTime MessageInserted { get; set; } + + public DateTime MessageLastModified { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public double? MessageRatingValue { get; set; } + + [ForeignKey("MessageApprovedByUserId")] + [InverseProperty("BoardMessageMessageApprovedByUsers")] + public virtual CmsUser? MessageApprovedByUser { get; set; } + + [ForeignKey("MessageBoardId")] + [InverseProperty("BoardMessagesNavigation")] + public virtual BoardBoard MessageBoard { get; set; } = null!; + + [ForeignKey("MessageUserId")] + [InverseProperty("BoardMessageMessageUsers")] + public virtual CmsUser? MessageUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/BoardSubscription.cs b/Migration.Toolkit.K11/Models/BoardSubscription.cs index 55d1d347..957ac986 100644 --- a/Migration.Toolkit.K11/Models/BoardSubscription.cs +++ b/Migration.Toolkit.K11/Models/BoardSubscription.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Board_Subscription")] -[Index("SubscriptionBoardId", Name = "IX_Board_Subscription_SubscriptionBoardID")] -[Index("SubscriptionUserId", Name = "IX_Board_Subscription_SubscriptionUserID")] -public partial class BoardSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionBoardID")] - public int SubscriptionBoardId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string SubscriptionEmail { get; set; } = null!; - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionBoardId")] - [InverseProperty("BoardSubscriptions")] - public virtual BoardBoard SubscriptionBoard { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("BoardSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Board_Subscription")] +[Index("SubscriptionBoardId", Name = "IX_Board_Subscription_SubscriptionBoardID")] +[Index("SubscriptionUserId", Name = "IX_Board_Subscription_SubscriptionUserID")] +public class BoardSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionBoardID")] + public int SubscriptionBoardId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string SubscriptionEmail { get; set; } = null!; + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionBoardId")] + [InverseProperty("BoardSubscriptions")] + public virtual BoardBoard SubscriptionBoard { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("BoardSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs b/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs index a0cedf2a..10cb8084 100644 --- a/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs +++ b/Migration.Toolkit.K11/Models/ChatInitiatedChatRequest.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_InitiatedChatRequest")] -[Index("InitiatedChatRequestInitiatorChatUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestInitiatorChatUserID")] -[Index("InitiatedChatRequestUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestUserID")] -[Index("InitiatedChatRequestRoomId", Name = "UQ_Chat_InitiatedChatRequest_RoomID", IsUnique = true)] -[Index("InitiatedChatRequestUserId", "InitiatedChatRequestContactId", Name = "UQ_Chat_InitiatedChatRequest_UserIDContactID", IsUnique = true)] -public partial class ChatInitiatedChatRequest -{ - [Key] - [Column("InitiatedChatRequestID")] - public int InitiatedChatRequestId { get; set; } - - [Column("InitiatedChatRequestUserID")] - public int? InitiatedChatRequestUserId { get; set; } - - [Column("InitiatedChatRequestContactID")] - public int? InitiatedChatRequestContactId { get; set; } - - [Column("InitiatedChatRequestRoomID")] - public int InitiatedChatRequestRoomId { get; set; } - - public int InitiatedChatRequestState { get; set; } - - [StringLength(100)] - public string InitiatedChatRequestInitiatorName { get; set; } = null!; - - [Column("InitiatedChatRequestInitiatorChatUserID")] - public int InitiatedChatRequestInitiatorChatUserId { get; set; } - - public DateTime InitiatedChatRequestLastModification { get; set; } - - [ForeignKey("InitiatedChatRequestInitiatorChatUserId")] - [InverseProperty("ChatInitiatedChatRequests")] - public virtual ChatUser InitiatedChatRequestInitiatorChatUser { get; set; } = null!; - - [ForeignKey("InitiatedChatRequestRoomId")] - [InverseProperty("ChatInitiatedChatRequest")] - public virtual ChatRoom InitiatedChatRequestRoom { get; set; } = null!; - - [ForeignKey("InitiatedChatRequestUserId")] - [InverseProperty("ChatInitiatedChatRequests")] - public virtual CmsUser? InitiatedChatRequestUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_InitiatedChatRequest")] +[Index("InitiatedChatRequestInitiatorChatUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestInitiatorChatUserID")] +[Index("InitiatedChatRequestUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestUserID")] +[Index("InitiatedChatRequestRoomId", Name = "UQ_Chat_InitiatedChatRequest_RoomID", IsUnique = true)] +[Index("InitiatedChatRequestUserId", "InitiatedChatRequestContactId", Name = "UQ_Chat_InitiatedChatRequest_UserIDContactID", IsUnique = true)] +public class ChatInitiatedChatRequest +{ + [Key] + [Column("InitiatedChatRequestID")] + public int InitiatedChatRequestId { get; set; } + + [Column("InitiatedChatRequestUserID")] + public int? InitiatedChatRequestUserId { get; set; } + + [Column("InitiatedChatRequestContactID")] + public int? InitiatedChatRequestContactId { get; set; } + + [Column("InitiatedChatRequestRoomID")] + public int InitiatedChatRequestRoomId { get; set; } + + public int InitiatedChatRequestState { get; set; } + + [StringLength(100)] + public string InitiatedChatRequestInitiatorName { get; set; } = null!; + + [Column("InitiatedChatRequestInitiatorChatUserID")] + public int InitiatedChatRequestInitiatorChatUserId { get; set; } + + public DateTime InitiatedChatRequestLastModification { get; set; } + + [ForeignKey("InitiatedChatRequestInitiatorChatUserId")] + [InverseProperty("ChatInitiatedChatRequests")] + public virtual ChatUser InitiatedChatRequestInitiatorChatUser { get; set; } = null!; + + [ForeignKey("InitiatedChatRequestRoomId")] + [InverseProperty("ChatInitiatedChatRequest")] + public virtual ChatRoom InitiatedChatRequestRoom { get; set; } = null!; + + [ForeignKey("InitiatedChatRequestUserId")] + [InverseProperty("ChatInitiatedChatRequests")] + public virtual CmsUser? InitiatedChatRequestUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ChatMessage.cs b/Migration.Toolkit.K11/Models/ChatMessage.cs index b3efe25a..cce343d8 100644 --- a/Migration.Toolkit.K11/Models/ChatMessage.cs +++ b/Migration.Toolkit.K11/Models/ChatMessage.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_Message")] -[Index("ChatMessageLastModified", Name = "IX_Chat_Message_ChatMessageLastModified")] -[Index("ChatMessageRecipientId", Name = "IX_Chat_Message_ChatMessageRecipientID")] -[Index("ChatMessageRoomId", Name = "IX_Chat_Message_ChatMessageRoomID")] -[Index("ChatMessageSystemMessageType", Name = "IX_Chat_Message_ChatMessageSystemMessageType")] -[Index("ChatMessageUserId", Name = "IX_Chat_Message_ChatMessageUserID")] -public partial class ChatMessage -{ - [Key] - [Column("ChatMessageID")] - public int ChatMessageId { get; set; } - - public DateTime ChatMessageCreatedWhen { get; set; } - - [Column("ChatMessageIPAddress")] - public string ChatMessageIpaddress { get; set; } = null!; - - [Column("ChatMessageUserID")] - public int? ChatMessageUserId { get; set; } - - [Column("ChatMessageRoomID")] - public int ChatMessageRoomId { get; set; } - - public bool ChatMessageRejected { get; set; } - - public DateTime ChatMessageLastModified { get; set; } - - public string ChatMessageText { get; set; } = null!; - - public int ChatMessageSystemMessageType { get; set; } - - [Column("ChatMessageRecipientID")] - public int? ChatMessageRecipientId { get; set; } - - [ForeignKey("ChatMessageRecipientId")] - [InverseProperty("ChatMessageChatMessageRecipients")] - public virtual ChatUser? ChatMessageRecipient { get; set; } - - [ForeignKey("ChatMessageRoomId")] - [InverseProperty("ChatMessages")] - public virtual ChatRoom ChatMessageRoom { get; set; } = null!; - - [ForeignKey("ChatMessageUserId")] - [InverseProperty("ChatMessageChatMessageUsers")] - public virtual ChatUser? ChatMessageUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_Message")] +[Index("ChatMessageLastModified", Name = "IX_Chat_Message_ChatMessageLastModified")] +[Index("ChatMessageRecipientId", Name = "IX_Chat_Message_ChatMessageRecipientID")] +[Index("ChatMessageRoomId", Name = "IX_Chat_Message_ChatMessageRoomID")] +[Index("ChatMessageSystemMessageType", Name = "IX_Chat_Message_ChatMessageSystemMessageType")] +[Index("ChatMessageUserId", Name = "IX_Chat_Message_ChatMessageUserID")] +public class ChatMessage +{ + [Key] + [Column("ChatMessageID")] + public int ChatMessageId { get; set; } + + public DateTime ChatMessageCreatedWhen { get; set; } + + [Column("ChatMessageIPAddress")] + public string ChatMessageIpaddress { get; set; } = null!; + + [Column("ChatMessageUserID")] + public int? ChatMessageUserId { get; set; } + + [Column("ChatMessageRoomID")] + public int ChatMessageRoomId { get; set; } + + public bool ChatMessageRejected { get; set; } + + public DateTime ChatMessageLastModified { get; set; } + + public string ChatMessageText { get; set; } = null!; + + public int ChatMessageSystemMessageType { get; set; } + + [Column("ChatMessageRecipientID")] + public int? ChatMessageRecipientId { get; set; } + + [ForeignKey("ChatMessageRecipientId")] + [InverseProperty("ChatMessageChatMessageRecipients")] + public virtual ChatUser? ChatMessageRecipient { get; set; } + + [ForeignKey("ChatMessageRoomId")] + [InverseProperty("ChatMessages")] + public virtual ChatRoom ChatMessageRoom { get; set; } = null!; + + [ForeignKey("ChatMessageUserId")] + [InverseProperty("ChatMessageChatMessageUsers")] + public virtual ChatUser? ChatMessageUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ChatNotification.cs b/Migration.Toolkit.K11/Models/ChatNotification.cs index 00bd6f6a..41409dc6 100644 --- a/Migration.Toolkit.K11/Models/ChatNotification.cs +++ b/Migration.Toolkit.K11/Models/ChatNotification.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_Notification")] -[Index("ChatNotificationReceiverId", Name = "IX_Chat_Notification_ChatNotificationReceiverID")] -[Index("ChatNotificationRoomId", Name = "IX_Chat_Notification_ChatNotificationRoomID")] -[Index("ChatNotificationSenderId", Name = "IX_Chat_Notification_ChatNotificationSenderID")] -[Index("ChatNotificationSiteId", Name = "IX_Chat_Notification_ChatNotificationSiteID")] -public partial class ChatNotification -{ - [Key] - [Column("ChatNotificationID")] - public int ChatNotificationId { get; set; } - - [Column("ChatNotificationSenderID")] - public int ChatNotificationSenderId { get; set; } - - [Column("ChatNotificationReceiverID")] - public int ChatNotificationReceiverId { get; set; } - - public bool ChatNotificationIsRead { get; set; } - - public int ChatNotificationType { get; set; } - - [Column("ChatNotificationRoomID")] - public int? ChatNotificationRoomId { get; set; } - - public DateTime ChatNotificationSendDateTime { get; set; } - - public DateTime? ChatNotificationReadDateTime { get; set; } - - [Column("ChatNotificationSiteID")] - public int? ChatNotificationSiteId { get; set; } - - [ForeignKey("ChatNotificationReceiverId")] - [InverseProperty("ChatNotificationChatNotificationReceivers")] - public virtual ChatUser ChatNotificationReceiver { get; set; } = null!; - - [ForeignKey("ChatNotificationRoomId")] - [InverseProperty("ChatNotifications")] - public virtual ChatRoom? ChatNotificationRoom { get; set; } - - [ForeignKey("ChatNotificationSenderId")] - [InverseProperty("ChatNotificationChatNotificationSenders")] - public virtual ChatUser ChatNotificationSender { get; set; } = null!; - - [ForeignKey("ChatNotificationSiteId")] - [InverseProperty("ChatNotifications")] - public virtual CmsSite? ChatNotificationSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_Notification")] +[Index("ChatNotificationReceiverId", Name = "IX_Chat_Notification_ChatNotificationReceiverID")] +[Index("ChatNotificationRoomId", Name = "IX_Chat_Notification_ChatNotificationRoomID")] +[Index("ChatNotificationSenderId", Name = "IX_Chat_Notification_ChatNotificationSenderID")] +[Index("ChatNotificationSiteId", Name = "IX_Chat_Notification_ChatNotificationSiteID")] +public class ChatNotification +{ + [Key] + [Column("ChatNotificationID")] + public int ChatNotificationId { get; set; } + + [Column("ChatNotificationSenderID")] + public int ChatNotificationSenderId { get; set; } + + [Column("ChatNotificationReceiverID")] + public int ChatNotificationReceiverId { get; set; } + + public bool ChatNotificationIsRead { get; set; } + + public int ChatNotificationType { get; set; } + + [Column("ChatNotificationRoomID")] + public int? ChatNotificationRoomId { get; set; } + + public DateTime ChatNotificationSendDateTime { get; set; } + + public DateTime? ChatNotificationReadDateTime { get; set; } + + [Column("ChatNotificationSiteID")] + public int? ChatNotificationSiteId { get; set; } + + [ForeignKey("ChatNotificationReceiverId")] + [InverseProperty("ChatNotificationChatNotificationReceivers")] + public virtual ChatUser ChatNotificationReceiver { get; set; } = null!; + + [ForeignKey("ChatNotificationRoomId")] + [InverseProperty("ChatNotifications")] + public virtual ChatRoom? ChatNotificationRoom { get; set; } + + [ForeignKey("ChatNotificationSenderId")] + [InverseProperty("ChatNotificationChatNotificationSenders")] + public virtual ChatUser ChatNotificationSender { get; set; } = null!; + + [ForeignKey("ChatNotificationSiteId")] + [InverseProperty("ChatNotifications")] + public virtual CmsSite? ChatNotificationSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs b/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs index 85df890f..854c42d5 100644 --- a/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs +++ b/Migration.Toolkit.K11/Models/ChatOnlineSupport.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_OnlineSupport")] -[Index("ChatOnlineSupportChatUserId", Name = "IX_Chat_OnlineSupport_ChatOnlineSupportChatUserID")] -[Index("ChatOnlineSupportSiteId", Name = "IX_Chat_OnlineSupport_SiteID")] -[Index("ChatOnlineSupportChatUserId", "ChatOnlineSupportSiteId", Name = "UQ_Chat_OnlineSupport_ChatUserID-SiteID", IsUnique = true)] -public partial class ChatOnlineSupport -{ - [Key] - [Column("ChatOnlineSupportID")] - public int ChatOnlineSupportId { get; set; } - - [Column("ChatOnlineSupportChatUserID")] - public int ChatOnlineSupportChatUserId { get; set; } - - public DateTime ChatOnlineSupportLastChecking { get; set; } - - [Column("ChatOnlineSupportSiteID")] - public int ChatOnlineSupportSiteId { get; set; } - - [StringLength(50)] - public string? ChatOnlineSupportToken { get; set; } - - [ForeignKey("ChatOnlineSupportChatUserId")] - [InverseProperty("ChatOnlineSupports")] - public virtual ChatUser ChatOnlineSupportChatUser { get; set; } = null!; - - [ForeignKey("ChatOnlineSupportSiteId")] - [InverseProperty("ChatOnlineSupports")] - public virtual CmsSite ChatOnlineSupportSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_OnlineSupport")] +[Index("ChatOnlineSupportChatUserId", Name = "IX_Chat_OnlineSupport_ChatOnlineSupportChatUserID")] +[Index("ChatOnlineSupportSiteId", Name = "IX_Chat_OnlineSupport_SiteID")] +[Index("ChatOnlineSupportChatUserId", "ChatOnlineSupportSiteId", Name = "UQ_Chat_OnlineSupport_ChatUserID-SiteID", IsUnique = true)] +public class ChatOnlineSupport +{ + [Key] + [Column("ChatOnlineSupportID")] + public int ChatOnlineSupportId { get; set; } + + [Column("ChatOnlineSupportChatUserID")] + public int ChatOnlineSupportChatUserId { get; set; } + + public DateTime ChatOnlineSupportLastChecking { get; set; } + + [Column("ChatOnlineSupportSiteID")] + public int ChatOnlineSupportSiteId { get; set; } + + [StringLength(50)] + public string? ChatOnlineSupportToken { get; set; } + + [ForeignKey("ChatOnlineSupportChatUserId")] + [InverseProperty("ChatOnlineSupports")] + public virtual ChatUser ChatOnlineSupportChatUser { get; set; } = null!; + + [ForeignKey("ChatOnlineSupportSiteId")] + [InverseProperty("ChatOnlineSupports")] + public virtual CmsSite ChatOnlineSupportSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ChatOnlineUser.cs b/Migration.Toolkit.K11/Models/ChatOnlineUser.cs index 7efb7537..7f576433 100644 --- a/Migration.Toolkit.K11/Models/ChatOnlineUser.cs +++ b/Migration.Toolkit.K11/Models/ChatOnlineUser.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_OnlineUser")] -[Index("ChatOnlineUserChatUserId", Name = "IX_Chat_OnlineUser_ChatOnlineUserChatUserID")] -[Index("ChatOnlineUserSiteId", Name = "IX_Chat_OnlineUser_SiteID")] -[Index("ChatOnlineUserChatUserId", "ChatOnlineUserSiteId", Name = "UQ_Chat_OnlineUser_SiteID-ChatUserID", IsUnique = true)] -public partial class ChatOnlineUser -{ - [Key] - [Column("ChatOnlineUserID")] - public int ChatOnlineUserId { get; set; } - - [Column("ChatOnlineUserSiteID")] - public int ChatOnlineUserSiteId { get; set; } - - public DateTime? ChatOnlineUserLastChecking { get; set; } - - [Column("ChatOnlineUserChatUserID")] - public int ChatOnlineUserChatUserId { get; set; } - - public DateTime? ChatOnlineUserJoinTime { get; set; } - - public DateTime? ChatOnlineUserLeaveTime { get; set; } - - [StringLength(50)] - public string? ChatOnlineUserToken { get; set; } - - public bool ChatOnlineUserIsHidden { get; set; } - - [ForeignKey("ChatOnlineUserChatUserId")] - [InverseProperty("ChatOnlineUsers")] - public virtual ChatUser ChatOnlineUserChatUser { get; set; } = null!; - - [ForeignKey("ChatOnlineUserSiteId")] - [InverseProperty("ChatOnlineUsers")] - public virtual CmsSite ChatOnlineUserSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_OnlineUser")] +[Index("ChatOnlineUserChatUserId", Name = "IX_Chat_OnlineUser_ChatOnlineUserChatUserID")] +[Index("ChatOnlineUserSiteId", Name = "IX_Chat_OnlineUser_SiteID")] +[Index("ChatOnlineUserChatUserId", "ChatOnlineUserSiteId", Name = "UQ_Chat_OnlineUser_SiteID-ChatUserID", IsUnique = true)] +public class ChatOnlineUser +{ + [Key] + [Column("ChatOnlineUserID")] + public int ChatOnlineUserId { get; set; } + + [Column("ChatOnlineUserSiteID")] + public int ChatOnlineUserSiteId { get; set; } + + public DateTime? ChatOnlineUserLastChecking { get; set; } + + [Column("ChatOnlineUserChatUserID")] + public int ChatOnlineUserChatUserId { get; set; } + + public DateTime? ChatOnlineUserJoinTime { get; set; } + + public DateTime? ChatOnlineUserLeaveTime { get; set; } + + [StringLength(50)] + public string? ChatOnlineUserToken { get; set; } + + public bool ChatOnlineUserIsHidden { get; set; } + + [ForeignKey("ChatOnlineUserChatUserId")] + [InverseProperty("ChatOnlineUsers")] + public virtual ChatUser ChatOnlineUserChatUser { get; set; } = null!; + + [ForeignKey("ChatOnlineUserSiteId")] + [InverseProperty("ChatOnlineUsers")] + public virtual CmsSite ChatOnlineUserSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs b/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs index c795ecfe..6ac944bd 100644 --- a/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs +++ b/Migration.Toolkit.K11/Models/ChatPopupWindowSetting.cs @@ -1,29 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_PopupWindowSettings")] -public partial class ChatPopupWindowSetting -{ - [Key] - [Column("ChatPopupWindowSettingsID")] - public int ChatPopupWindowSettingsId { get; set; } - - [StringLength(255)] - public string MessageTransformationName { get; set; } = null!; - - [StringLength(255)] - public string ErrorTransformationName { get; set; } = null!; - - [StringLength(255)] - public string ErrorClearTransformationName { get; set; } = null!; - - [StringLength(255)] - public string UserTransformationName { get; set; } = null!; - - public int ChatPopupWindowSettingsHashCode { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_PopupWindowSettings")] +public class ChatPopupWindowSetting +{ + [Key] + [Column("ChatPopupWindowSettingsID")] + public int ChatPopupWindowSettingsId { get; set; } + + [StringLength(255)] + public string MessageTransformationName { get; set; } = null!; + + [StringLength(255)] + public string ErrorTransformationName { get; set; } = null!; + + [StringLength(255)] + public string ErrorClearTransformationName { get; set; } = null!; + + [StringLength(255)] + public string UserTransformationName { get; set; } = null!; + + public int ChatPopupWindowSettingsHashCode { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ChatRoom.cs b/Migration.Toolkit.K11/Models/ChatRoom.cs index c2ee0ba4..0918d696 100644 --- a/Migration.Toolkit.K11/Models/ChatRoom.cs +++ b/Migration.Toolkit.K11/Models/ChatRoom.cs @@ -1,81 +1,80 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_Room")] -[Index("ChatRoomCreatedByChatUserId", Name = "IX_Chat_Room_ChatRoomCreatedByChatUserID")] -[Index("ChatRoomEnabled", Name = "IX_Chat_Room_Enabled")] -[Index("ChatRoomIsSupport", Name = "IX_Chat_Room_IsSupport")] -[Index("ChatRoomSiteId", Name = "IX_Chat_Room_SiteID")] -public partial class ChatRoom -{ - [Key] - [Column("ChatRoomID")] - public int ChatRoomId { get; set; } - - [StringLength(100)] - public string ChatRoomName { get; set; } = null!; - - [StringLength(100)] - public string ChatRoomDisplayName { get; set; } = null!; - - [Column("ChatRoomSiteID")] - public int? ChatRoomSiteId { get; set; } - - public bool ChatRoomEnabled { get; set; } - - public bool ChatRoomPrivate { get; set; } - - public bool ChatRoomAllowAnonym { get; set; } - - public DateTime ChatRoomCreatedWhen { get; set; } - - [StringLength(100)] - public string? ChatRoomPassword { get; set; } - - [Column("ChatRoomCreatedByChatUserID")] - public int? ChatRoomCreatedByChatUserId { get; set; } - - public bool ChatRoomIsSupport { get; set; } - - public bool ChatRoomIsOneToOne { get; set; } - - [StringLength(500)] - public string? ChatRoomDescription { get; set; } - - public DateTime ChatRoomLastModification { get; set; } - - public DateTime? ChatRoomScheduledToDelete { get; set; } - - public DateTime ChatRoomPrivateStateLastModification { get; set; } - - [Column("ChatRoomGUID")] - public Guid ChatRoomGuid { get; set; } - - [InverseProperty("InitiatedChatRequestRoom")] - public virtual ChatInitiatedChatRequest? ChatInitiatedChatRequest { get; set; } - - [InverseProperty("ChatMessageRoom")] - public virtual ICollection ChatMessages { get; set; } = new List(); - - [InverseProperty("ChatNotificationRoom")] - public virtual ICollection ChatNotifications { get; set; } = new List(); - - [ForeignKey("ChatRoomCreatedByChatUserId")] - [InverseProperty("ChatRooms")] - public virtual ChatUser? ChatRoomCreatedByChatUser { get; set; } - - [ForeignKey("ChatRoomSiteId")] - [InverseProperty("ChatRooms")] - public virtual CmsSite? ChatRoomSite { get; set; } - - [InverseProperty("ChatRoomUserRoom")] - public virtual ICollection ChatRoomUsers { get; set; } = new List(); - - [InverseProperty("ChatSupportTakenRoomRoom")] - public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_Room")] +[Index("ChatRoomCreatedByChatUserId", Name = "IX_Chat_Room_ChatRoomCreatedByChatUserID")] +[Index("ChatRoomEnabled", Name = "IX_Chat_Room_Enabled")] +[Index("ChatRoomIsSupport", Name = "IX_Chat_Room_IsSupport")] +[Index("ChatRoomSiteId", Name = "IX_Chat_Room_SiteID")] +public class ChatRoom +{ + [Key] + [Column("ChatRoomID")] + public int ChatRoomId { get; set; } + + [StringLength(100)] + public string ChatRoomName { get; set; } = null!; + + [StringLength(100)] + public string ChatRoomDisplayName { get; set; } = null!; + + [Column("ChatRoomSiteID")] + public int? ChatRoomSiteId { get; set; } + + public bool ChatRoomEnabled { get; set; } + + public bool ChatRoomPrivate { get; set; } + + public bool ChatRoomAllowAnonym { get; set; } + + public DateTime ChatRoomCreatedWhen { get; set; } + + [StringLength(100)] + public string? ChatRoomPassword { get; set; } + + [Column("ChatRoomCreatedByChatUserID")] + public int? ChatRoomCreatedByChatUserId { get; set; } + + public bool ChatRoomIsSupport { get; set; } + + public bool ChatRoomIsOneToOne { get; set; } + + [StringLength(500)] + public string? ChatRoomDescription { get; set; } + + public DateTime ChatRoomLastModification { get; set; } + + public DateTime? ChatRoomScheduledToDelete { get; set; } + + public DateTime ChatRoomPrivateStateLastModification { get; set; } + + [Column("ChatRoomGUID")] + public Guid ChatRoomGuid { get; set; } + + [InverseProperty("InitiatedChatRequestRoom")] + public virtual ChatInitiatedChatRequest? ChatInitiatedChatRequest { get; set; } + + [InverseProperty("ChatMessageRoom")] + public virtual ICollection ChatMessages { get; set; } = new List(); + + [InverseProperty("ChatNotificationRoom")] + public virtual ICollection ChatNotifications { get; set; } = new List(); + + [ForeignKey("ChatRoomCreatedByChatUserId")] + [InverseProperty("ChatRooms")] + public virtual ChatUser? ChatRoomCreatedByChatUser { get; set; } + + [ForeignKey("ChatRoomSiteId")] + [InverseProperty("ChatRooms")] + public virtual CmsSite? ChatRoomSite { get; set; } + + [InverseProperty("ChatRoomUserRoom")] + public virtual ICollection ChatRoomUsers { get; set; } = new List(); + + [InverseProperty("ChatSupportTakenRoomRoom")] + public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ChatRoomUser.cs b/Migration.Toolkit.K11/Models/ChatRoomUser.cs index 88e9c9f2..9d07f5eb 100644 --- a/Migration.Toolkit.K11/Models/ChatRoomUser.cs +++ b/Migration.Toolkit.K11/Models/ChatRoomUser.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_RoomUser")] -[Index("ChatRoomUserChatUserId", Name = "IX_Chat_RoomUser_ChatRoomUserChatUserID")] -[Index("ChatRoomUserRoomId", Name = "IX_Chat_RoomUser_ChatRoomUserRoomID")] -[Index("ChatRoomUserRoomId", "ChatRoomUserChatUserId", Name = "UQ_Chat_RoomUser_RoomID-ChatUserID", IsUnique = true)] -public partial class ChatRoomUser -{ - [Key] - [Column("ChatRoomUserID")] - public int ChatRoomUserId { get; set; } - - [Column("ChatRoomUserRoomID")] - public int ChatRoomUserRoomId { get; set; } - - [Column("ChatRoomUserChatUserID")] - public int ChatRoomUserChatUserId { get; set; } - - public DateTime? ChatRoomUserLastChecking { get; set; } - - public DateTime? ChatRoomUserKickExpiration { get; set; } - - public DateTime? ChatRoomUserJoinTime { get; set; } - - public DateTime? ChatRoomUserLeaveTime { get; set; } - - public int ChatRoomUserAdminLevel { get; set; } - - public DateTime ChatRoomUserLastModification { get; set; } - - [ForeignKey("ChatRoomUserChatUserId")] - [InverseProperty("ChatRoomUsers")] - public virtual ChatUser ChatRoomUserChatUser { get; set; } = null!; - - [ForeignKey("ChatRoomUserRoomId")] - [InverseProperty("ChatRoomUsers")] - public virtual ChatRoom ChatRoomUserRoom { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_RoomUser")] +[Index("ChatRoomUserChatUserId", Name = "IX_Chat_RoomUser_ChatRoomUserChatUserID")] +[Index("ChatRoomUserRoomId", Name = "IX_Chat_RoomUser_ChatRoomUserRoomID")] +[Index("ChatRoomUserRoomId", "ChatRoomUserChatUserId", Name = "UQ_Chat_RoomUser_RoomID-ChatUserID", IsUnique = true)] +public class ChatRoomUser +{ + [Key] + [Column("ChatRoomUserID")] + public int ChatRoomUserId { get; set; } + + [Column("ChatRoomUserRoomID")] + public int ChatRoomUserRoomId { get; set; } + + [Column("ChatRoomUserChatUserID")] + public int ChatRoomUserChatUserId { get; set; } + + public DateTime? ChatRoomUserLastChecking { get; set; } + + public DateTime? ChatRoomUserKickExpiration { get; set; } + + public DateTime? ChatRoomUserJoinTime { get; set; } + + public DateTime? ChatRoomUserLeaveTime { get; set; } + + public int ChatRoomUserAdminLevel { get; set; } + + public DateTime ChatRoomUserLastModification { get; set; } + + [ForeignKey("ChatRoomUserChatUserId")] + [InverseProperty("ChatRoomUsers")] + public virtual ChatUser ChatRoomUserChatUser { get; set; } = null!; + + [ForeignKey("ChatRoomUserRoomId")] + [InverseProperty("ChatRoomUsers")] + public virtual ChatRoom ChatRoomUserRoom { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs b/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs index ce0233be..43f665f0 100644 --- a/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs +++ b/Migration.Toolkit.K11/Models/ChatSupportCannedResponse.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_SupportCannedResponse")] -[Index("ChatSupportCannedResponseChatUserId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseChatUserID")] -[Index("ChatSupportCannedResponseSiteId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseSiteID")] -public partial class ChatSupportCannedResponse -{ - [Key] - [Column("ChatSupportCannedResponseID")] - public int ChatSupportCannedResponseId { get; set; } - - [Column("ChatSupportCannedResponseChatUserID")] - public int? ChatSupportCannedResponseChatUserId { get; set; } - - [StringLength(500)] - public string ChatSupportCannedResponseText { get; set; } = null!; - - [StringLength(50)] - public string ChatSupportCannedResponseTagName { get; set; } = null!; - - [Column("ChatSupportCannedResponseSiteID")] - public int? ChatSupportCannedResponseSiteId { get; set; } - - [StringLength(100)] - public string ChatSupportCannedResponseName { get; set; } = null!; - - [ForeignKey("ChatSupportCannedResponseChatUserId")] - [InverseProperty("ChatSupportCannedResponses")] - public virtual ChatUser? ChatSupportCannedResponseChatUser { get; set; } - - [ForeignKey("ChatSupportCannedResponseSiteId")] - [InverseProperty("ChatSupportCannedResponses")] - public virtual CmsSite? ChatSupportCannedResponseSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_SupportCannedResponse")] +[Index("ChatSupportCannedResponseChatUserId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseChatUserID")] +[Index("ChatSupportCannedResponseSiteId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseSiteID")] +public class ChatSupportCannedResponse +{ + [Key] + [Column("ChatSupportCannedResponseID")] + public int ChatSupportCannedResponseId { get; set; } + + [Column("ChatSupportCannedResponseChatUserID")] + public int? ChatSupportCannedResponseChatUserId { get; set; } + + [StringLength(500)] + public string ChatSupportCannedResponseText { get; set; } = null!; + + [StringLength(50)] + public string ChatSupportCannedResponseTagName { get; set; } = null!; + + [Column("ChatSupportCannedResponseSiteID")] + public int? ChatSupportCannedResponseSiteId { get; set; } + + [StringLength(100)] + public string ChatSupportCannedResponseName { get; set; } = null!; + + [ForeignKey("ChatSupportCannedResponseChatUserId")] + [InverseProperty("ChatSupportCannedResponses")] + public virtual ChatUser? ChatSupportCannedResponseChatUser { get; set; } + + [ForeignKey("ChatSupportCannedResponseSiteId")] + [InverseProperty("ChatSupportCannedResponses")] + public virtual CmsSite? ChatSupportCannedResponseSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs b/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs index c4cd93d3..835aa29e 100644 --- a/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs +++ b/Migration.Toolkit.K11/Models/ChatSupportTakenRoom.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_SupportTakenRoom")] -[Index("ChatSupportTakenRoomChatUserId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomChatUserID")] -[Index("ChatSupportTakenRoomRoomId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomRoomID")] -public partial class ChatSupportTakenRoom -{ - [Key] - [Column("ChatSupportTakenRoomID")] - public int ChatSupportTakenRoomId { get; set; } - - [Column("ChatSupportTakenRoomChatUserID")] - public int? ChatSupportTakenRoomChatUserId { get; set; } - - [Column("ChatSupportTakenRoomRoomID")] - public int ChatSupportTakenRoomRoomId { get; set; } - - public DateTime? ChatSupportTakenRoomResolvedDateTime { get; set; } - - public DateTime ChatSupportTakenRoomLastModification { get; set; } - - [ForeignKey("ChatSupportTakenRoomChatUserId")] - [InverseProperty("ChatSupportTakenRooms")] - public virtual ChatUser? ChatSupportTakenRoomChatUser { get; set; } - - [ForeignKey("ChatSupportTakenRoomRoomId")] - [InverseProperty("ChatSupportTakenRooms")] - public virtual ChatRoom ChatSupportTakenRoomRoom { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_SupportTakenRoom")] +[Index("ChatSupportTakenRoomChatUserId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomChatUserID")] +[Index("ChatSupportTakenRoomRoomId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomRoomID")] +public class ChatSupportTakenRoom +{ + [Key] + [Column("ChatSupportTakenRoomID")] + public int ChatSupportTakenRoomId { get; set; } + + [Column("ChatSupportTakenRoomChatUserID")] + public int? ChatSupportTakenRoomChatUserId { get; set; } + + [Column("ChatSupportTakenRoomRoomID")] + public int ChatSupportTakenRoomRoomId { get; set; } + + public DateTime? ChatSupportTakenRoomResolvedDateTime { get; set; } + + public DateTime ChatSupportTakenRoomLastModification { get; set; } + + [ForeignKey("ChatSupportTakenRoomChatUserId")] + [InverseProperty("ChatSupportTakenRooms")] + public virtual ChatUser? ChatSupportTakenRoomChatUser { get; set; } + + [ForeignKey("ChatSupportTakenRoomRoomId")] + [InverseProperty("ChatSupportTakenRooms")] + public virtual ChatRoom ChatSupportTakenRoomRoom { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ChatUser.cs b/Migration.Toolkit.K11/Models/ChatUser.cs index 8404d617..9bf37481 100644 --- a/Migration.Toolkit.K11/Models/ChatUser.cs +++ b/Migration.Toolkit.K11/Models/ChatUser.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Chat_User")] -[Index("ChatUserUserId", Name = "IX_Chat_User_UserID")] -public partial class ChatUser -{ - [Key] - [Column("ChatUserID")] - public int ChatUserId { get; set; } - - [Column("ChatUserUserID")] - public int? ChatUserUserId { get; set; } - - [StringLength(50)] - public string ChatUserNickname { get; set; } = null!; - - public DateTime ChatUserLastModification { get; set; } - - [InverseProperty("InitiatedChatRequestInitiatorChatUser")] - public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); - - [InverseProperty("ChatMessageRecipient")] - public virtual ICollection ChatMessageChatMessageRecipients { get; set; } = new List(); - - [InverseProperty("ChatMessageUser")] - public virtual ICollection ChatMessageChatMessageUsers { get; set; } = new List(); - - [InverseProperty("ChatNotificationReceiver")] - public virtual ICollection ChatNotificationChatNotificationReceivers { get; set; } = new List(); - - [InverseProperty("ChatNotificationSender")] - public virtual ICollection ChatNotificationChatNotificationSenders { get; set; } = new List(); - - [InverseProperty("ChatOnlineSupportChatUser")] - public virtual ICollection ChatOnlineSupports { get; set; } = new List(); - - [InverseProperty("ChatOnlineUserChatUser")] - public virtual ICollection ChatOnlineUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomUserChatUser")] - public virtual ICollection ChatRoomUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomCreatedByChatUser")] - public virtual ICollection ChatRooms { get; set; } = new List(); - - [InverseProperty("ChatSupportCannedResponseChatUser")] - public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); - - [InverseProperty("ChatSupportTakenRoomChatUser")] - public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); - - [ForeignKey("ChatUserUserId")] - [InverseProperty("ChatUsers")] - public virtual CmsUser? ChatUserUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Chat_User")] +[Index("ChatUserUserId", Name = "IX_Chat_User_UserID")] +public class ChatUser +{ + [Key] + [Column("ChatUserID")] + public int ChatUserId { get; set; } + + [Column("ChatUserUserID")] + public int? ChatUserUserId { get; set; } + + [StringLength(50)] + public string ChatUserNickname { get; set; } = null!; + + public DateTime ChatUserLastModification { get; set; } + + [InverseProperty("InitiatedChatRequestInitiatorChatUser")] + public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); + + [InverseProperty("ChatMessageRecipient")] + public virtual ICollection ChatMessageChatMessageRecipients { get; set; } = new List(); + + [InverseProperty("ChatMessageUser")] + public virtual ICollection ChatMessageChatMessageUsers { get; set; } = new List(); + + [InverseProperty("ChatNotificationReceiver")] + public virtual ICollection ChatNotificationChatNotificationReceivers { get; set; } = new List(); + + [InverseProperty("ChatNotificationSender")] + public virtual ICollection ChatNotificationChatNotificationSenders { get; set; } = new List(); + + [InverseProperty("ChatOnlineSupportChatUser")] + public virtual ICollection ChatOnlineSupports { get; set; } = new List(); + + [InverseProperty("ChatOnlineUserChatUser")] + public virtual ICollection ChatOnlineUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomUserChatUser")] + public virtual ICollection ChatRoomUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomCreatedByChatUser")] + public virtual ICollection ChatRooms { get; set; } = new List(); + + [InverseProperty("ChatSupportCannedResponseChatUser")] + public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); + + [InverseProperty("ChatSupportTakenRoomChatUser")] + public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); + + [ForeignKey("ChatUserUserId")] + [InverseProperty("ChatUsers")] + public virtual CmsUser? ChatUserUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CiFileMetadatum.cs b/Migration.Toolkit.K11/Models/CiFileMetadatum.cs index 1f13cab5..4a16d282 100644 --- a/Migration.Toolkit.K11/Models/CiFileMetadatum.cs +++ b/Migration.Toolkit.K11/Models/CiFileMetadatum.cs @@ -1,22 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CI_FileMetadata")] -[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] -public partial class CiFileMetadatum -{ - [Key] - [Column("FileMetadataID")] - public int FileMetadataId { get; set; } - - [StringLength(260)] - public string FileLocation { get; set; } = null!; - - [StringLength(32)] - public string FileHash { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CI_FileMetadata")] +[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] +public class CiFileMetadatum +{ + [Key] + [Column("FileMetadataID")] + public int FileMetadataId { get; set; } + + [StringLength(260)] + public string FileLocation { get; set; } = null!; + + [StringLength(32)] + public string FileHash { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CiMigration.cs b/Migration.Toolkit.K11/Models/CiMigration.cs index d2a67e2c..085aca53 100644 --- a/Migration.Toolkit.K11/Models/CiMigration.cs +++ b/Migration.Toolkit.K11/Models/CiMigration.cs @@ -1,24 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CI_Migration")] -[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] -public partial class CiMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CI_Migration")] +[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] +public class CiMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsAbuseReport.cs b/Migration.Toolkit.K11/Models/CmsAbuseReport.cs index 7b69bfc6..0e7baf6d 100644 --- a/Migration.Toolkit.K11/Models/CmsAbuseReport.cs +++ b/Migration.Toolkit.K11/Models/CmsAbuseReport.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AbuseReport")] -[Index("ReportSiteId", Name = "IX_CMS_AbuseReport_ReportSiteID")] -[Index("ReportStatus", Name = "IX_CMS_AbuseReport_ReportStatus")] -[Index("ReportUserId", Name = "IX_CMS_AbuseReport_ReportUserID")] -public partial class CmsAbuseReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - [StringLength(100)] - public string? ReportTitle { get; set; } - - [Column("ReportURL")] - [StringLength(1000)] - public string ReportUrl { get; set; } = null!; - - [StringLength(50)] - public string ReportCulture { get; set; } = null!; - - [Column("ReportObjectID")] - public int? ReportObjectId { get; set; } - - [StringLength(100)] - public string? ReportObjectType { get; set; } - - public string ReportComment { get; set; } = null!; - - [Column("ReportUserID")] - public int? ReportUserId { get; set; } - - public DateTime ReportWhen { get; set; } - - public int ReportStatus { get; set; } - - [Column("ReportSiteID")] - public int ReportSiteId { get; set; } - - [ForeignKey("ReportSiteId")] - [InverseProperty("CmsAbuseReports")] - public virtual CmsSite ReportSite { get; set; } = null!; - - [ForeignKey("ReportUserId")] - [InverseProperty("CmsAbuseReports")] - public virtual CmsUser? ReportUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_AbuseReport")] +[Index("ReportSiteId", Name = "IX_CMS_AbuseReport_ReportSiteID")] +[Index("ReportStatus", Name = "IX_CMS_AbuseReport_ReportStatus")] +[Index("ReportUserId", Name = "IX_CMS_AbuseReport_ReportUserID")] +public class CmsAbuseReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + [StringLength(100)] + public string? ReportTitle { get; set; } + + [Column("ReportURL")] + [StringLength(1000)] + public string ReportUrl { get; set; } = null!; + + [StringLength(50)] + public string ReportCulture { get; set; } = null!; + + [Column("ReportObjectID")] + public int? ReportObjectId { get; set; } + + [StringLength(100)] + public string? ReportObjectType { get; set; } + + public string ReportComment { get; set; } = null!; + + [Column("ReportUserID")] + public int? ReportUserId { get; set; } + + public DateTime ReportWhen { get; set; } + + public int ReportStatus { get; set; } + + [Column("ReportSiteID")] + public int ReportSiteId { get; set; } + + [ForeignKey("ReportSiteId")] + [InverseProperty("CmsAbuseReports")] + public virtual CmsSite ReportSite { get; set; } = null!; + + [ForeignKey("ReportUserId")] + [InverseProperty("CmsAbuseReports")] + public virtual CmsUser? ReportUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsAcl.cs b/Migration.Toolkit.K11/Models/CmsAcl.cs index 3d5ae6b2..35c133d1 100644 --- a/Migration.Toolkit.K11/Models/CmsAcl.cs +++ b/Migration.Toolkit.K11/Models/CmsAcl.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ACL")] -[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] -[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] -public partial class CmsAcl -{ - [Key] - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("ACLInheritedACLs")] - public string AclinheritedAcls { get; set; } = null!; - - [Column("ACLGUID")] - public Guid Aclguid { get; set; } - - [Column("ACLLastModified")] - public DateTime AcllastModified { get; set; } - - [Column("ACLSiteID")] - public int? AclsiteId { get; set; } - - [ForeignKey("AclsiteId")] - [InverseProperty("CmsAcls")] - public virtual CmsSite? Aclsite { get; set; } - - [InverseProperty("Acl")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("NodeAcl")] - public virtual ICollection CmsTrees { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ACL")] +[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] +[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] +public class CmsAcl +{ + [Key] + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("ACLInheritedACLs")] + public string AclinheritedAcls { get; set; } = null!; + + [Column("ACLGUID")] + public Guid Aclguid { get; set; } + + [Column("ACLLastModified")] + public DateTime AcllastModified { get; set; } + + [Column("ACLSiteID")] + public int? AclsiteId { get; set; } + + [ForeignKey("AclsiteId")] + [InverseProperty("CmsAcls")] + public virtual CmsSite? Aclsite { get; set; } + + [InverseProperty("Acl")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("NodeAcl")] + public virtual ICollection CmsTrees { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsAclitem.cs b/Migration.Toolkit.K11/Models/CmsAclitem.cs index 0ea69873..871d5e8c 100644 --- a/Migration.Toolkit.K11/Models/CmsAclitem.cs +++ b/Migration.Toolkit.K11/Models/CmsAclitem.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ACLItem")] -[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] -[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] -[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] -[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] -public partial class CmsAclitem -{ - [Key] - [Column("ACLItemID")] - public int AclitemId { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - public DateTime LastModified { get; set; } - - [Column("LastModifiedByUserID")] - public int? LastModifiedByUserId { get; set; } - - [Column("ACLItemGUID")] - public Guid AclitemGuid { get; set; } - - [ForeignKey("Aclid")] - [InverseProperty("CmsAclitems")] - public virtual CmsAcl Acl { get; set; } = null!; - - [ForeignKey("LastModifiedByUserId")] - [InverseProperty("CmsAclitemLastModifiedByUsers")] - public virtual CmsUser? LastModifiedByUser { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsAclitems")] - public virtual CmsRole? Role { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsAclitemUsers")] - public virtual CmsUser? User { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ACLItem")] +[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] +[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] +[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] +[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] +public class CmsAclitem +{ + [Key] + [Column("ACLItemID")] + public int AclitemId { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + public DateTime LastModified { get; set; } + + [Column("LastModifiedByUserID")] + public int? LastModifiedByUserId { get; set; } + + [Column("ACLItemGUID")] + public Guid AclitemGuid { get; set; } + + [ForeignKey("Aclid")] + [InverseProperty("CmsAclitems")] + public virtual CmsAcl Acl { get; set; } = null!; + + [ForeignKey("LastModifiedByUserId")] + [InverseProperty("CmsAclitemLastModifiedByUsers")] + public virtual CmsUser? LastModifiedByUser { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsAclitems")] + public virtual CmsRole? Role { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsAclitemUsers")] + public virtual CmsUser? User { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs b/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs index 93e9f7c4..46de00aa 100644 --- a/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs +++ b/Migration.Toolkit.K11/Models/CmsAlternativeForm.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AlternativeForm")] -[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] -[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] -public partial class CmsAlternativeForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(50)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public string? FormDefinition { get; set; } - - public string? FormLayout { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Column("FormCoupledClassID")] - public int? FormCoupledClassId { get; set; } - - public bool? FormHideNewParentFields { get; set; } - - [StringLength(50)] - public string? FormLayoutType { get; set; } - - [Column("FormVersionGUID")] - [StringLength(50)] - public string? FormVersionGuid { get; set; } - - [StringLength(400)] - public string? FormCustomizedColumns { get; set; } - - public bool? FormIsCustom { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsAlternativeFormFormClasses")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormCoupledClassId")] - [InverseProperty("CmsAlternativeFormFormCoupledClasses")] - public virtual CmsClass? FormCoupledClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_AlternativeForm")] +[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] +[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] +public class CmsAlternativeForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(50)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public string? FormDefinition { get; set; } + + public string? FormLayout { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Column("FormCoupledClassID")] + public int? FormCoupledClassId { get; set; } + + public bool? FormHideNewParentFields { get; set; } + + [StringLength(50)] + public string? FormLayoutType { get; set; } + + [Column("FormVersionGUID")] + [StringLength(50)] + public string? FormVersionGuid { get; set; } + + [StringLength(400)] + public string? FormCustomizedColumns { get; set; } + + public bool? FormIsCustom { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsAlternativeFormFormClasses")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormCoupledClassId")] + [InverseProperty("CmsAlternativeFormFormCoupledClasses")] + public virtual CmsClass? FormCoupledClass { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsAttachment.cs b/Migration.Toolkit.K11/Models/CmsAttachment.cs index 027fbda8..8e2dec6a 100644 --- a/Migration.Toolkit.K11/Models/CmsAttachment.cs +++ b/Migration.Toolkit.K11/Models/CmsAttachment.cs @@ -1,91 +1,90 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Attachment")] -[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] -[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] -public partial class CmsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int? AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [Column("AttachmentFormGUID")] - public Guid? AttachmentFormGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentDocumentId")] - [InverseProperty("CmsAttachments")] - public virtual CmsDocument? AttachmentDocument { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachment? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Attachment")] +[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] +[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] +public class CmsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int? AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [Column("AttachmentFormGUID")] + public Guid? AttachmentFormGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentDocumentId")] + [InverseProperty("CmsAttachments")] + public virtual CmsDocument? AttachmentDocument { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachment? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs index 0f092767..b20400d7 100644 --- a/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsAttachmentHistory.cs @@ -1,90 +1,89 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AttachmentHistory")] -[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] -public partial class CmsAttachmentHistory -{ - [Key] - [Column("AttachmentHistoryID")] - public int AttachmentHistoryId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public DateTime? AttachmentLastModified { get; set; } - - [Column("AttachmentHistoryGUID")] - public Guid AttachmentHistoryGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachmentHistories")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); - - [ForeignKey("AttachmentHistoryId")] - [InverseProperty("AttachmentHistories")] - public virtual ICollection VersionHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_AttachmentHistory")] +[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] +public class CmsAttachmentHistory +{ + [Key] + [Column("AttachmentHistoryID")] + public int AttachmentHistoryId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public DateTime? AttachmentLastModified { get; set; } + + [Column("AttachmentHistoryGUID")] + public Guid AttachmentHistoryGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachmentHistories")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); + + [ForeignKey("AttachmentHistoryId")] + [InverseProperty("AttachmentHistories")] + public virtual ICollection VersionHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs b/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs index fe34b84a..88e0534c 100644 --- a/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsAutomationHistory.cs @@ -1,82 +1,81 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AutomationHistory")] -[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] -[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] -[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] -[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] -[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] -[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] -public partial class CmsAutomationHistory -{ - [Key] - [Column("HistoryID")] - public int HistoryId { get; set; } - - [Column("HistoryStepID")] - public int? HistoryStepId { get; set; } - - [StringLength(440)] - public string? HistoryStepName { get; set; } - - [StringLength(450)] - public string HistoryStepDisplayName { get; set; } = null!; - - public int? HistoryStepType { get; set; } - - [Column("HistoryTargetStepID")] - public int? HistoryTargetStepId { get; set; } - - [StringLength(440)] - public string? HistoryTargetStepName { get; set; } - - [StringLength(450)] - public string? HistoryTargetStepDisplayName { get; set; } - - public int? HistoryTargetStepType { get; set; } - - [Column("HistoryApprovedByUserID")] - public int? HistoryApprovedByUserId { get; set; } - - public DateTime? HistoryApprovedWhen { get; set; } - - public string? HistoryComment { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - public bool HistoryWasRejected { get; set; } - - [Column("HistoryStateID")] - public int HistoryStateId { get; set; } - - [ForeignKey("HistoryApprovedByUserId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsUser? HistoryApprovedByUser { get; set; } - - [ForeignKey("HistoryStateId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsAutomationState HistoryState { get; set; } = null!; - - [ForeignKey("HistoryStepId")] - [InverseProperty("CmsAutomationHistoryHistorySteps")] - public virtual CmsWorkflowStep? HistoryStep { get; set; } - - [ForeignKey("HistoryTargetStepId")] - [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] - public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_AutomationHistory")] +[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] +[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] +[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] +[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] +[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] +[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] +public class CmsAutomationHistory +{ + [Key] + [Column("HistoryID")] + public int HistoryId { get; set; } + + [Column("HistoryStepID")] + public int? HistoryStepId { get; set; } + + [StringLength(440)] + public string? HistoryStepName { get; set; } + + [StringLength(450)] + public string HistoryStepDisplayName { get; set; } = null!; + + public int? HistoryStepType { get; set; } + + [Column("HistoryTargetStepID")] + public int? HistoryTargetStepId { get; set; } + + [StringLength(440)] + public string? HistoryTargetStepName { get; set; } + + [StringLength(450)] + public string? HistoryTargetStepDisplayName { get; set; } + + public int? HistoryTargetStepType { get; set; } + + [Column("HistoryApprovedByUserID")] + public int? HistoryApprovedByUserId { get; set; } + + public DateTime? HistoryApprovedWhen { get; set; } + + public string? HistoryComment { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + public bool HistoryWasRejected { get; set; } + + [Column("HistoryStateID")] + public int HistoryStateId { get; set; } + + [ForeignKey("HistoryApprovedByUserId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsUser? HistoryApprovedByUser { get; set; } + + [ForeignKey("HistoryStateId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsAutomationState HistoryState { get; set; } = null!; + + [ForeignKey("HistoryStepId")] + [InverseProperty("CmsAutomationHistoryHistorySteps")] + public virtual CmsWorkflowStep? HistoryStep { get; set; } + + [ForeignKey("HistoryTargetStepId")] + [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] + public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsAutomationState.cs b/Migration.Toolkit.K11/Models/CmsAutomationState.cs index 7e92a9f6..6bf7e4ab 100644 --- a/Migration.Toolkit.K11/Models/CmsAutomationState.cs +++ b/Migration.Toolkit.K11/Models/CmsAutomationState.cs @@ -1,71 +1,70 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_AutomationState")] -[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] -[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] -[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] -[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] -[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] -public partial class CmsAutomationState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [Column("StateStepID")] - public int StateStepId { get; set; } - - [Column("StateObjectID")] - public int StateObjectId { get; set; } - - [StringLength(100)] - public string StateObjectType { get; set; } = null!; - - [StringLength(450)] - public string? StateActionStatus { get; set; } - - public DateTime? StateCreated { get; set; } - - public DateTime? StateLastModified { get; set; } - - [Column("StateWorkflowID")] - public int StateWorkflowId { get; set; } - - public int? StateStatus { get; set; } - - [Column("StateSiteID")] - public int? StateSiteId { get; set; } - - [Column("StateUserID")] - public int? StateUserId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public string? StateCustomData { get; set; } - - [InverseProperty("HistoryState")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [ForeignKey("StateSiteId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsSite? StateSite { get; set; } - - [ForeignKey("StateStepId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflowStep StateStep { get; set; } = null!; - - [ForeignKey("StateUserId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsUser? StateUser { get; set; } - - [ForeignKey("StateWorkflowId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflow StateWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_AutomationState")] +[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] +[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] +[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] +[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] +[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] +public class CmsAutomationState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [Column("StateStepID")] + public int StateStepId { get; set; } + + [Column("StateObjectID")] + public int StateObjectId { get; set; } + + [StringLength(100)] + public string StateObjectType { get; set; } = null!; + + [StringLength(450)] + public string? StateActionStatus { get; set; } + + public DateTime? StateCreated { get; set; } + + public DateTime? StateLastModified { get; set; } + + [Column("StateWorkflowID")] + public int StateWorkflowId { get; set; } + + public int? StateStatus { get; set; } + + [Column("StateSiteID")] + public int? StateSiteId { get; set; } + + [Column("StateUserID")] + public int? StateUserId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public string? StateCustomData { get; set; } + + [InverseProperty("HistoryState")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [ForeignKey("StateSiteId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsSite? StateSite { get; set; } + + [ForeignKey("StateStepId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflowStep StateStep { get; set; } = null!; + + [ForeignKey("StateUserId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsUser? StateUser { get; set; } + + [ForeignKey("StateWorkflowId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflow StateWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsAvatar.cs b/Migration.Toolkit.K11/Models/CmsAvatar.cs index d077e2ed..bfd2b907 100644 --- a/Migration.Toolkit.K11/Models/CmsAvatar.cs +++ b/Migration.Toolkit.K11/Models/CmsAvatar.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Avatar")] -[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] -[Index("AvatarType", "AvatarIsCustom", Name = "IX_CMS_Avatar_AvatarType_AvatarIsCustom")] -public partial class CmsAvatar -{ - [Key] - [Column("AvatarID")] - public int AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } - - [StringLength(200)] - public string AvatarFileName { get; set; } = null!; - - [StringLength(10)] - public string AvatarFileExtension { get; set; } = null!; - - public byte[]? AvatarBinary { get; set; } - - [StringLength(50)] - public string AvatarType { get; set; } = null!; - - public bool AvatarIsCustom { get; set; } - - [Column("AvatarGUID")] - public Guid AvatarGuid { get; set; } - - public DateTime AvatarLastModified { get; set; } - - [StringLength(100)] - public string AvatarMimeType { get; set; } = null!; - - public int AvatarFileSize { get; set; } - - public int? AvatarImageHeight { get; set; } - - public int? AvatarImageWidth { get; set; } - - public bool? DefaultMaleUserAvatar { get; set; } - - public bool? DefaultFemaleUserAvatar { get; set; } - - public bool? DefaultGroupAvatar { get; set; } - - public bool? DefaultUserAvatar { get; set; } - - [InverseProperty("UserAvatar")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); - - [InverseProperty("GroupAvatar")] - public virtual ICollection CommunityGroups { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Avatar")] +[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] +[Index("AvatarType", "AvatarIsCustom", Name = "IX_CMS_Avatar_AvatarType_AvatarIsCustom")] +public class CmsAvatar +{ + [Key] + [Column("AvatarID")] + public int AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } + + [StringLength(200)] + public string AvatarFileName { get; set; } = null!; + + [StringLength(10)] + public string AvatarFileExtension { get; set; } = null!; + + public byte[]? AvatarBinary { get; set; } + + [StringLength(50)] + public string AvatarType { get; set; } = null!; + + public bool AvatarIsCustom { get; set; } + + [Column("AvatarGUID")] + public Guid AvatarGuid { get; set; } + + public DateTime AvatarLastModified { get; set; } + + [StringLength(100)] + public string AvatarMimeType { get; set; } = null!; + + public int AvatarFileSize { get; set; } + + public int? AvatarImageHeight { get; set; } + + public int? AvatarImageWidth { get; set; } + + public bool? DefaultMaleUserAvatar { get; set; } + + public bool? DefaultFemaleUserAvatar { get; set; } + + public bool? DefaultGroupAvatar { get; set; } + + public bool? DefaultUserAvatar { get; set; } + + [InverseProperty("UserAvatar")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); + + [InverseProperty("GroupAvatar")] + public virtual ICollection CommunityGroups { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsBadge.cs b/Migration.Toolkit.K11/Models/CmsBadge.cs index 52a391eb..c3178605 100644 --- a/Migration.Toolkit.K11/Models/CmsBadge.cs +++ b/Migration.Toolkit.K11/Models/CmsBadge.cs @@ -1,37 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Badge")] -public partial class CmsBadge -{ - [Key] - [Column("BadgeID")] - public int BadgeId { get; set; } - - [StringLength(100)] - public string BadgeName { get; set; } = null!; - - [StringLength(200)] - public string BadgeDisplayName { get; set; } = null!; - - [Column("BadgeImageURL")] - [StringLength(200)] - public string? BadgeImageUrl { get; set; } - - public bool BadgeIsAutomatic { get; set; } - - public int? BadgeTopLimit { get; set; } - - [Column("BadgeGUID")] - public Guid BadgeGuid { get; set; } - - public DateTime BadgeLastModified { get; set; } - - [InverseProperty("UserBadge")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Badge")] +public class CmsBadge +{ + [Key] + [Column("BadgeID")] + public int BadgeId { get; set; } + + [StringLength(100)] + public string BadgeName { get; set; } = null!; + + [StringLength(200)] + public string BadgeDisplayName { get; set; } = null!; + + [Column("BadgeImageURL")] + [StringLength(200)] + public string? BadgeImageUrl { get; set; } + + public bool BadgeIsAutomatic { get; set; } + + public int? BadgeTopLimit { get; set; } + + [Column("BadgeGUID")] + public Guid BadgeGuid { get; set; } + + public DateTime BadgeLastModified { get; set; } + + [InverseProperty("UserBadge")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsBannedIp.cs b/Migration.Toolkit.K11/Models/CmsBannedIp.cs index 295fe964..cbf0c498 100644 --- a/Migration.Toolkit.K11/Models/CmsBannedIp.cs +++ b/Migration.Toolkit.K11/Models/CmsBannedIp.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_BannedIP")] -[Index("IpaddressSiteId", Name = "IX_CMS_BannedIP_IPAddressSiteID")] -public partial class CmsBannedIp -{ - [Key] - [Column("IPAddressID")] - public int IpaddressId { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string Ipaddress { get; set; } = null!; - - [Column("IPAddressRegular")] - [StringLength(200)] - public string IpaddressRegular { get; set; } = null!; - - [Column("IPAddressAllowed")] - public bool IpaddressAllowed { get; set; } - - [Column("IPAddressAllowOverride")] - public bool IpaddressAllowOverride { get; set; } - - [Column("IPAddressBanReason")] - [StringLength(450)] - public string? IpaddressBanReason { get; set; } - - [Column("IPAddressBanType")] - [StringLength(100)] - public string IpaddressBanType { get; set; } = null!; - - [Column("IPAddressBanEnabled")] - public bool? IpaddressBanEnabled { get; set; } - - [Column("IPAddressSiteID")] - public int? IpaddressSiteId { get; set; } - - [Column("IPAddressGUID")] - public Guid IpaddressGuid { get; set; } - - [Column("IPAddressLastModified")] - public DateTime IpaddressLastModified { get; set; } - - [ForeignKey("IpaddressSiteId")] - [InverseProperty("CmsBannedIps")] - public virtual CmsSite? IpaddressSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_BannedIP")] +[Index("IpaddressSiteId", Name = "IX_CMS_BannedIP_IPAddressSiteID")] +public class CmsBannedIp +{ + [Key] + [Column("IPAddressID")] + public int IpaddressId { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string Ipaddress { get; set; } = null!; + + [Column("IPAddressRegular")] + [StringLength(200)] + public string IpaddressRegular { get; set; } = null!; + + [Column("IPAddressAllowed")] + public bool IpaddressAllowed { get; set; } + + [Column("IPAddressAllowOverride")] + public bool IpaddressAllowOverride { get; set; } + + [Column("IPAddressBanReason")] + [StringLength(450)] + public string? IpaddressBanReason { get; set; } + + [Column("IPAddressBanType")] + [StringLength(100)] + public string IpaddressBanType { get; set; } = null!; + + [Column("IPAddressBanEnabled")] + public bool? IpaddressBanEnabled { get; set; } + + [Column("IPAddressSiteID")] + public int? IpaddressSiteId { get; set; } + + [Column("IPAddressGUID")] + public Guid IpaddressGuid { get; set; } + + [Column("IPAddressLastModified")] + public DateTime IpaddressLastModified { get; set; } + + [ForeignKey("IpaddressSiteId")] + [InverseProperty("CmsBannedIps")] + public virtual CmsSite? IpaddressSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsBanner.cs b/Migration.Toolkit.K11/Models/CmsBanner.cs index 643453b7..29f7987c 100644 --- a/Migration.Toolkit.K11/Models/CmsBanner.cs +++ b/Migration.Toolkit.K11/Models/CmsBanner.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Banner")] -[Index("BannerCategoryId", Name = "IX_CMS_Banner_BannerCategoryID")] -[Index("BannerSiteId", Name = "IX_CMS_Banner_BannerSiteID")] -public partial class CmsBanner -{ - [Key] - [Column("BannerID")] - public int BannerId { get; set; } - - [StringLength(256)] - public string BannerName { get; set; } = null!; - - [StringLength(256)] - public string BannerDisplayName { get; set; } = null!; - - [Column("BannerCategoryID")] - public int BannerCategoryId { get; set; } - - [Required] - public bool? BannerEnabled { get; set; } - - public DateTime? BannerFrom { get; set; } - - public DateTime? BannerTo { get; set; } - - public Guid BannerGuid { get; set; } - - public DateTime BannerLastModified { get; set; } - - public int BannerType { get; set; } - - [Column("BannerURL")] - [StringLength(2083)] - public string BannerUrl { get; set; } = null!; - - public bool BannerBlank { get; set; } - - public double BannerWeight { get; set; } - - public int? BannerHitsLeft { get; set; } - - public int? BannerClicksLeft { get; set; } - - [Column("BannerSiteID")] - public int? BannerSiteId { get; set; } - - public string BannerContent { get; set; } = null!; - - [ForeignKey("BannerCategoryId")] - [InverseProperty("CmsBanners")] - public virtual CmsBannerCategory BannerCategory { get; set; } = null!; - - [ForeignKey("BannerSiteId")] - [InverseProperty("CmsBanners")] - public virtual CmsSite? BannerSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Banner")] +[Index("BannerCategoryId", Name = "IX_CMS_Banner_BannerCategoryID")] +[Index("BannerSiteId", Name = "IX_CMS_Banner_BannerSiteID")] +public class CmsBanner +{ + [Key] + [Column("BannerID")] + public int BannerId { get; set; } + + [StringLength(256)] + public string BannerName { get; set; } = null!; + + [StringLength(256)] + public string BannerDisplayName { get; set; } = null!; + + [Column("BannerCategoryID")] + public int BannerCategoryId { get; set; } + + [Required] + public bool? BannerEnabled { get; set; } + + public DateTime? BannerFrom { get; set; } + + public DateTime? BannerTo { get; set; } + + public Guid BannerGuid { get; set; } + + public DateTime BannerLastModified { get; set; } + + public int BannerType { get; set; } + + [Column("BannerURL")] + [StringLength(2083)] + public string BannerUrl { get; set; } = null!; + + public bool BannerBlank { get; set; } + + public double BannerWeight { get; set; } + + public int? BannerHitsLeft { get; set; } + + public int? BannerClicksLeft { get; set; } + + [Column("BannerSiteID")] + public int? BannerSiteId { get; set; } + + public string BannerContent { get; set; } = null!; + + [ForeignKey("BannerCategoryId")] + [InverseProperty("CmsBanners")] + public virtual CmsBannerCategory BannerCategory { get; set; } = null!; + + [ForeignKey("BannerSiteId")] + [InverseProperty("CmsBanners")] + public virtual CmsSite? BannerSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsBannerCategory.cs b/Migration.Toolkit.K11/Models/CmsBannerCategory.cs index 0e2e78ee..e025cdb7 100644 --- a/Migration.Toolkit.K11/Models/CmsBannerCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsBannerCategory.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_BannerCategory")] -[Index("BannerCategoryName", "BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategoryName_BannerCategorySiteID", IsUnique = true)] -[Index("BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategorySiteID")] -public partial class CmsBannerCategory -{ - [Key] - [Column("BannerCategoryID")] - public int BannerCategoryId { get; set; } - - [StringLength(100)] - public string BannerCategoryName { get; set; } = null!; - - [StringLength(200)] - public string BannerCategoryDisplayName { get; set; } = null!; - - [Column("BannerCategorySiteID")] - public int? BannerCategorySiteId { get; set; } - - public Guid BannerCategoryGuid { get; set; } - - public DateTime BannerCategoryLastModified { get; set; } - - [Required] - public bool? BannerCategoryEnabled { get; set; } - - [ForeignKey("BannerCategorySiteId")] - [InverseProperty("CmsBannerCategories")] - public virtual CmsSite? BannerCategorySite { get; set; } - - [InverseProperty("BannerCategory")] - public virtual ICollection CmsBanners { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_BannerCategory")] +[Index("BannerCategoryName", "BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategoryName_BannerCategorySiteID", IsUnique = true)] +[Index("BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategorySiteID")] +public class CmsBannerCategory +{ + [Key] + [Column("BannerCategoryID")] + public int BannerCategoryId { get; set; } + + [StringLength(100)] + public string BannerCategoryName { get; set; } = null!; + + [StringLength(200)] + public string BannerCategoryDisplayName { get; set; } = null!; + + [Column("BannerCategorySiteID")] + public int? BannerCategorySiteId { get; set; } + + public Guid BannerCategoryGuid { get; set; } + + public DateTime BannerCategoryLastModified { get; set; } + + [Required] + public bool? BannerCategoryEnabled { get; set; } + + [ForeignKey("BannerCategorySiteId")] + [InverseProperty("CmsBannerCategories")] + public virtual CmsSite? BannerCategorySite { get; set; } + + [InverseProperty("BannerCategory")] + public virtual ICollection CmsBanners { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsCategory.cs b/Migration.Toolkit.K11/Models/CmsCategory.cs index ca74561e..959e3e66 100644 --- a/Migration.Toolkit.K11/Models/CmsCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsCategory.cs @@ -1,67 +1,66 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Category")] -[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] -[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] -public partial class CmsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(250)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(250)] - public string? CategoryName { get; set; } - - public string? CategoryDescription { get; set; } - - public int? CategoryCount { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryUserID")] - public int? CategoryUserId { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - [StringLength(1500)] - public string? CategoryNamePath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryOrder { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("CmsCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [ForeignKey("CategoryUserId")] - [InverseProperty("CmsCategories")] - public virtual CmsUser? CategoryUser { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("Categories")] - public virtual ICollection Documents { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Category")] +[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] +[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] +public class CmsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(250)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(250)] + public string? CategoryName { get; set; } + + public string? CategoryDescription { get; set; } + + public int? CategoryCount { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryUserID")] + public int? CategoryUserId { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + [StringLength(1500)] + public string? CategoryNamePath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryOrder { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("CmsCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [ForeignKey("CategoryUserId")] + [InverseProperty("CmsCategories")] + public virtual CmsUser? CategoryUser { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("Categories")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsClass.cs b/Migration.Toolkit.K11/Models/CmsClass.cs index ee945ecf..4f2a9a8f 100644 --- a/Migration.Toolkit.K11/Models/CmsClass.cs +++ b/Migration.Toolkit.K11/Models/CmsClass.cs @@ -1,221 +1,220 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Class")] -[Index("ClassDefaultPageTemplateId", Name = "IX_CMS_Class_ClassDefaultPageTemplateID")] -[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] -[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] -[Index("ClassPageTemplateCategoryId", Name = "IX_CMS_Class_ClassPageTemplateCategoryID")] -[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] -[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] -public partial class CmsClass -{ - [Key] - [Column("ClassID")] - public int ClassId { get; set; } - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - public bool ClassUsesVersioning { get; set; } - - public bool ClassIsDocumentType { get; set; } - - public bool ClassIsCoupledClass { get; set; } - - public string ClassXmlSchema { get; set; } = null!; - - public string ClassFormDefinition { get; set; } = null!; - - [StringLength(450)] - public string? ClassEditingPageUrl { get; set; } - - [StringLength(450)] - public string? ClassListPageUrl { get; set; } - - [StringLength(100)] - public string ClassNodeNameSource { get; set; } = null!; - - [StringLength(100)] - public string? ClassTableName { get; set; } - - [StringLength(450)] - public string? ClassViewPageUrl { get; set; } - - [StringLength(450)] - public string? ClassPreviewPageUrl { get; set; } - - public string? ClassFormLayout { get; set; } - - [StringLength(450)] - public string? ClassNewPageUrl { get; set; } - - public bool? ClassShowAsSystemTable { get; set; } - - public bool? ClassUsePublishFromTo { get; set; } - - public bool? ClassShowTemplateSelection { get; set; } - - [Column("ClassSKUMappings")] - public string? ClassSkumappings { get; set; } - - public bool? ClassIsMenuItemType { get; set; } - - [StringLength(100)] - public string? ClassNodeAliasSource { get; set; } - - [Column("ClassDefaultPageTemplateID")] - public int? ClassDefaultPageTemplateId { get; set; } - - public DateTime ClassLastModified { get; set; } - - [Column("ClassGUID")] - public Guid ClassGuid { get; set; } - - [Column("ClassCreateSKU")] - public bool? ClassCreateSku { get; set; } - - public bool? ClassIsProduct { get; set; } - - public bool ClassIsCustomTable { get; set; } - - [StringLength(1000)] - public string? ClassShowColumns { get; set; } - - [StringLength(200)] - public string? ClassSearchTitleColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchContentColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchImageColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchCreationDateColumn { get; set; } - - public string? ClassSearchSettings { get; set; } - - [Column("ClassInheritsFromClassID")] - public int? ClassInheritsFromClassId { get; set; } - - public bool? ClassSearchEnabled { get; set; } - - [Column("ClassSKUDefaultDepartmentName")] - [StringLength(200)] - public string? ClassSkudefaultDepartmentName { get; set; } - - [Column("ClassSKUDefaultDepartmentID")] - public int? ClassSkudefaultDepartmentId { get; set; } - - public string? ClassContactMapping { get; set; } - - public bool? ClassContactOverwriteEnabled { get; set; } - - [Column("ClassSKUDefaultProductType")] - [StringLength(50)] - public string? ClassSkudefaultProductType { get; set; } - - [StringLength(100)] - public string? ClassConnectionString { get; set; } - - public bool? ClassIsProductSection { get; set; } - - [Column("ClassPageTemplateCategoryID")] - public int? ClassPageTemplateCategoryId { get; set; } - - [StringLength(50)] - public string? ClassFormLayoutType { get; set; } - - [Column("ClassVersionGUID")] - [StringLength(50)] - public string? ClassVersionGuid { get; set; } - - [StringLength(100)] - public string? ClassDefaultObjectType { get; set; } - - public bool? ClassIsForm { get; set; } - - [Column("ClassResourceID")] - public int? ClassResourceId { get; set; } - - [StringLength(400)] - public string? ClassCustomizedColumns { get; set; } - - public string? ClassCodeGenerationSettings { get; set; } - - [StringLength(200)] - public string? ClassIconClass { get; set; } - - public bool? ClassIsContentOnly { get; set; } - - [Column("ClassURLPattern")] - [StringLength(200)] - public string? ClassUrlpattern { get; set; } - - [ForeignKey("ClassDefaultPageTemplateId")] - [InverseProperty("CmsClasses")] - public virtual CmsPageTemplate? ClassDefaultPageTemplate { get; set; } - - [ForeignKey("ClassPageTemplateCategoryId")] - [InverseProperty("CmsClasses")] - public virtual CmsPageTemplateCategory? ClassPageTemplateCategory { get; set; } - - [ForeignKey("ClassResourceId")] - [InverseProperty("CmsClasses")] - public virtual CmsResource? ClassResource { get; set; } - - [InverseProperty("FormClass")] - public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); - - [InverseProperty("FormCoupledClass")] - public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); - - [InverseProperty("FormClass")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeClass")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsQueries { get; set; } = new List(); - - [InverseProperty("TransformationClass")] - public virtual ICollection CmsTransformations { get; set; } = new List(); - - [InverseProperty("NodeClass")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("VersionClass")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeClass")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("ParentClassId")] - [InverseProperty("ParentClasses")] - public virtual ICollection ChildClasses { get; set; } = new List(); - - [ForeignKey("ChildClassId")] - [InverseProperty("ChildClasses")] - public virtual ICollection ParentClasses { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Scopes { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Class")] +[Index("ClassDefaultPageTemplateId", Name = "IX_CMS_Class_ClassDefaultPageTemplateID")] +[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] +[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] +[Index("ClassPageTemplateCategoryId", Name = "IX_CMS_Class_ClassPageTemplateCategoryID")] +[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] +[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] +public class CmsClass +{ + [Key] + [Column("ClassID")] + public int ClassId { get; set; } + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + public bool ClassUsesVersioning { get; set; } + + public bool ClassIsDocumentType { get; set; } + + public bool ClassIsCoupledClass { get; set; } + + public string ClassXmlSchema { get; set; } = null!; + + public string ClassFormDefinition { get; set; } = null!; + + [StringLength(450)] + public string? ClassEditingPageUrl { get; set; } + + [StringLength(450)] + public string? ClassListPageUrl { get; set; } + + [StringLength(100)] + public string ClassNodeNameSource { get; set; } = null!; + + [StringLength(100)] + public string? ClassTableName { get; set; } + + [StringLength(450)] + public string? ClassViewPageUrl { get; set; } + + [StringLength(450)] + public string? ClassPreviewPageUrl { get; set; } + + public string? ClassFormLayout { get; set; } + + [StringLength(450)] + public string? ClassNewPageUrl { get; set; } + + public bool? ClassShowAsSystemTable { get; set; } + + public bool? ClassUsePublishFromTo { get; set; } + + public bool? ClassShowTemplateSelection { get; set; } + + [Column("ClassSKUMappings")] + public string? ClassSkumappings { get; set; } + + public bool? ClassIsMenuItemType { get; set; } + + [StringLength(100)] + public string? ClassNodeAliasSource { get; set; } + + [Column("ClassDefaultPageTemplateID")] + public int? ClassDefaultPageTemplateId { get; set; } + + public DateTime ClassLastModified { get; set; } + + [Column("ClassGUID")] + public Guid ClassGuid { get; set; } + + [Column("ClassCreateSKU")] + public bool? ClassCreateSku { get; set; } + + public bool? ClassIsProduct { get; set; } + + public bool ClassIsCustomTable { get; set; } + + [StringLength(1000)] + public string? ClassShowColumns { get; set; } + + [StringLength(200)] + public string? ClassSearchTitleColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchContentColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchImageColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchCreationDateColumn { get; set; } + + public string? ClassSearchSettings { get; set; } + + [Column("ClassInheritsFromClassID")] + public int? ClassInheritsFromClassId { get; set; } + + public bool? ClassSearchEnabled { get; set; } + + [Column("ClassSKUDefaultDepartmentName")] + [StringLength(200)] + public string? ClassSkudefaultDepartmentName { get; set; } + + [Column("ClassSKUDefaultDepartmentID")] + public int? ClassSkudefaultDepartmentId { get; set; } + + public string? ClassContactMapping { get; set; } + + public bool? ClassContactOverwriteEnabled { get; set; } + + [Column("ClassSKUDefaultProductType")] + [StringLength(50)] + public string? ClassSkudefaultProductType { get; set; } + + [StringLength(100)] + public string? ClassConnectionString { get; set; } + + public bool? ClassIsProductSection { get; set; } + + [Column("ClassPageTemplateCategoryID")] + public int? ClassPageTemplateCategoryId { get; set; } + + [StringLength(50)] + public string? ClassFormLayoutType { get; set; } + + [Column("ClassVersionGUID")] + [StringLength(50)] + public string? ClassVersionGuid { get; set; } + + [StringLength(100)] + public string? ClassDefaultObjectType { get; set; } + + public bool? ClassIsForm { get; set; } + + [Column("ClassResourceID")] + public int? ClassResourceId { get; set; } + + [StringLength(400)] + public string? ClassCustomizedColumns { get; set; } + + public string? ClassCodeGenerationSettings { get; set; } + + [StringLength(200)] + public string? ClassIconClass { get; set; } + + public bool? ClassIsContentOnly { get; set; } + + [Column("ClassURLPattern")] + [StringLength(200)] + public string? ClassUrlpattern { get; set; } + + [ForeignKey("ClassDefaultPageTemplateId")] + [InverseProperty("CmsClasses")] + public virtual CmsPageTemplate? ClassDefaultPageTemplate { get; set; } + + [ForeignKey("ClassPageTemplateCategoryId")] + [InverseProperty("CmsClasses")] + public virtual CmsPageTemplateCategory? ClassPageTemplateCategory { get; set; } + + [ForeignKey("ClassResourceId")] + [InverseProperty("CmsClasses")] + public virtual CmsResource? ClassResource { get; set; } + + [InverseProperty("FormClass")] + public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); + + [InverseProperty("FormCoupledClass")] + public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); + + [InverseProperty("FormClass")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeClass")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsQueries { get; set; } = new List(); + + [InverseProperty("TransformationClass")] + public virtual ICollection CmsTransformations { get; set; } = new List(); + + [InverseProperty("NodeClass")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("VersionClass")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeClass")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("ParentClassId")] + [InverseProperty("ParentClasses")] + public virtual ICollection ChildClasses { get; set; } = new List(); + + [ForeignKey("ChildClassId")] + [InverseProperty("ChildClasses")] + public virtual ICollection ParentClasses { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Scopes { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsConsent.cs b/Migration.Toolkit.K11/Models/CmsConsent.cs index 9435edf0..a2ac73d6 100644 --- a/Migration.Toolkit.K11/Models/CmsConsent.cs +++ b/Migration.Toolkit.K11/Models/CmsConsent.cs @@ -1,36 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Consent")] -public partial class CmsConsent -{ - [Key] - [Column("ConsentID")] - public int ConsentId { get; set; } - - [StringLength(200)] - public string ConsentDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ConsentName { get; set; } = null!; - - public string ConsentContent { get; set; } = null!; - - public Guid ConsentGuid { get; set; } - - public DateTime ConsentLastModified { get; set; } - - [StringLength(100)] - public string ConsentHash { get; set; } = null!; - - [InverseProperty("ConsentAgreementConsent")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [InverseProperty("ConsentArchiveConsent")] - public virtual ICollection CmsConsentArchives { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Consent")] +public class CmsConsent +{ + [Key] + [Column("ConsentID")] + public int ConsentId { get; set; } + + [StringLength(200)] + public string ConsentDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ConsentName { get; set; } = null!; + + public string ConsentContent { get; set; } = null!; + + public Guid ConsentGuid { get; set; } + + public DateTime ConsentLastModified { get; set; } + + [StringLength(100)] + public string ConsentHash { get; set; } = null!; + + [InverseProperty("ConsentAgreementConsent")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [InverseProperty("ConsentArchiveConsent")] + public virtual ICollection CmsConsentArchives { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs b/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs index 3e83ac93..dc4cbb76 100644 --- a/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs +++ b/Migration.Toolkit.K11/Models/CmsConsentAgreement.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ConsentAgreement")] -[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] -public partial class CmsConsentAgreement -{ - [Key] - [Column("ConsentAgreementID")] - public int ConsentAgreementId { get; set; } - - public Guid ConsentAgreementGuid { get; set; } - - public bool ConsentAgreementRevoked { get; set; } - - [Column("ConsentAgreementContactID")] - public int ConsentAgreementContactId { get; set; } - - [Column("ConsentAgreementConsentID")] - public int ConsentAgreementConsentId { get; set; } - - [StringLength(100)] - public string? ConsentAgreementConsentHash { get; set; } - - public DateTime ConsentAgreementTime { get; set; } - - [ForeignKey("ConsentAgreementConsentId")] - [InverseProperty("CmsConsentAgreements")] - public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; - - [ForeignKey("ConsentAgreementContactId")] - [InverseProperty("CmsConsentAgreements")] - public virtual OmContact ConsentAgreementContact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ConsentAgreement")] +[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] +public class CmsConsentAgreement +{ + [Key] + [Column("ConsentAgreementID")] + public int ConsentAgreementId { get; set; } + + public Guid ConsentAgreementGuid { get; set; } + + public bool ConsentAgreementRevoked { get; set; } + + [Column("ConsentAgreementContactID")] + public int ConsentAgreementContactId { get; set; } + + [Column("ConsentAgreementConsentID")] + public int ConsentAgreementConsentId { get; set; } + + [StringLength(100)] + public string? ConsentAgreementConsentHash { get; set; } + + public DateTime ConsentAgreementTime { get; set; } + + [ForeignKey("ConsentAgreementConsentId")] + [InverseProperty("CmsConsentAgreements")] + public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; + + [ForeignKey("ConsentAgreementContactId")] + [InverseProperty("CmsConsentAgreements")] + public virtual OmContact ConsentAgreementContact { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsConsentArchive.cs b/Migration.Toolkit.K11/Models/CmsConsentArchive.cs index 08ec5ffd..b992e507 100644 --- a/Migration.Toolkit.K11/Models/CmsConsentArchive.cs +++ b/Migration.Toolkit.K11/Models/CmsConsentArchive.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ConsentArchive")] -[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] -public partial class CmsConsentArchive -{ - [Key] - [Column("ConsentArchiveID")] - public int ConsentArchiveId { get; set; } - - public Guid ConsentArchiveGuid { get; set; } - - public DateTime ConsentArchiveLastModified { get; set; } - - [Column("ConsentArchiveConsentID")] - public int ConsentArchiveConsentId { get; set; } - - [StringLength(100)] - public string ConsentArchiveHash { get; set; } = null!; - - public string ConsentArchiveContent { get; set; } = null!; - - [ForeignKey("ConsentArchiveConsentId")] - [InverseProperty("CmsConsentArchives")] - public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ConsentArchive")] +[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] +public class CmsConsentArchive +{ + [Key] + [Column("ConsentArchiveID")] + public int ConsentArchiveId { get; set; } + + public Guid ConsentArchiveGuid { get; set; } + + public DateTime ConsentArchiveLastModified { get; set; } + + [Column("ConsentArchiveConsentID")] + public int ConsentArchiveConsentId { get; set; } + + [StringLength(100)] + public string ConsentArchiveHash { get; set; } = null!; + + public string ConsentArchiveContent { get; set; } = null!; + + [ForeignKey("ConsentArchiveConsentId")] + [InverseProperty("CmsConsentArchives")] + public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsCountry.cs b/Migration.Toolkit.K11/Models/CmsCountry.cs index ad76454c..3b2f55fd 100644 --- a/Migration.Toolkit.K11/Models/CmsCountry.cs +++ b/Migration.Toolkit.K11/Models/CmsCountry.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Country")] -public partial class CmsCountry -{ - [Key] - [Column("CountryID")] - public int CountryId { get; set; } - - [StringLength(200)] - public string CountryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CountryName { get; set; } = null!; - - [Column("CountryGUID")] - public Guid CountryGuid { get; set; } - - public DateTime CountryLastModified { get; set; } - - [StringLength(2)] - public string? CountryTwoLetterCode { get; set; } - - [StringLength(3)] - public string? CountryThreeLetterCode { get; set; } - - [InverseProperty("Country")] - public virtual ICollection CmsStates { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("Country")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("AccountCountry")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactCountry")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Country")] +public class CmsCountry +{ + [Key] + [Column("CountryID")] + public int CountryId { get; set; } + + [StringLength(200)] + public string CountryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CountryName { get; set; } = null!; + + [Column("CountryGUID")] + public Guid CountryGuid { get; set; } + + public DateTime CountryLastModified { get; set; } + + [StringLength(2)] + public string? CountryTwoLetterCode { get; set; } + + [StringLength(3)] + public string? CountryThreeLetterCode { get; set; } + + [InverseProperty("Country")] + public virtual ICollection CmsStates { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("Country")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("AccountCountry")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactCountry")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs b/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs index 24f7af4d..cd23995a 100644 --- a/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs +++ b/Migration.Toolkit.K11/Models/CmsCssStylesheet.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_CssStylesheet")] -[Index("StylesheetName", Name = "IX_CMS_CssStylesheet_StylesheetName")] -public partial class CmsCssStylesheet -{ - [Key] - [Column("StylesheetID")] - public int StylesheetId { get; set; } - - [StringLength(200)] - public string StylesheetDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StylesheetName { get; set; } = null!; - - public string? StylesheetText { get; set; } - - [Column("StylesheetVersionGUID")] - public Guid? StylesheetVersionGuid { get; set; } - - [Column("StylesheetGUID")] - public Guid? StylesheetGuid { get; set; } - - public DateTime StylesheetLastModified { get; set; } - - public string? StylesheetDynamicCode { get; set; } - - [StringLength(200)] - public string? StylesheetDynamicLanguage { get; set; } - - [InverseProperty("DocumentStylesheet")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("SiteDefaultEditorStylesheetNavigation")] - public virtual ICollection CmsSiteSiteDefaultEditorStylesheetNavigations { get; set; } = new List(); - - [InverseProperty("SiteDefaultStylesheet")] - public virtual ICollection CmsSiteSiteDefaultStylesheets { get; set; } = new List(); - - [ForeignKey("StylesheetId")] - [InverseProperty("Stylesheets")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_CssStylesheet")] +[Index("StylesheetName", Name = "IX_CMS_CssStylesheet_StylesheetName")] +public class CmsCssStylesheet +{ + [Key] + [Column("StylesheetID")] + public int StylesheetId { get; set; } + + [StringLength(200)] + public string StylesheetDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StylesheetName { get; set; } = null!; + + public string? StylesheetText { get; set; } + + [Column("StylesheetVersionGUID")] + public Guid? StylesheetVersionGuid { get; set; } + + [Column("StylesheetGUID")] + public Guid? StylesheetGuid { get; set; } + + public DateTime StylesheetLastModified { get; set; } + + public string? StylesheetDynamicCode { get; set; } + + [StringLength(200)] + public string? StylesheetDynamicLanguage { get; set; } + + [InverseProperty("DocumentStylesheet")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("SiteDefaultEditorStylesheetNavigation")] + public virtual ICollection CmsSiteSiteDefaultEditorStylesheetNavigations { get; set; } = new List(); + + [InverseProperty("SiteDefaultStylesheet")] + public virtual ICollection CmsSiteSiteDefaultStylesheets { get; set; } = new List(); + + [ForeignKey("StylesheetId")] + [InverseProperty("Stylesheets")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsCulture.cs b/Migration.Toolkit.K11/Models/CmsCulture.cs index 1167a4b8..863d3f3f 100644 --- a/Migration.Toolkit.K11/Models/CmsCulture.cs +++ b/Migration.Toolkit.K11/Models/CmsCulture.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Culture")] -[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] -[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] -public partial class CmsCulture -{ - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; - - [StringLength(200)] - public string CultureShortName { get; set; } = null!; - - [Column("CultureGUID")] - public Guid CultureGuid { get; set; } - - public DateTime CultureLastModified { get; set; } - - [StringLength(100)] - public string? CultureAlias { get; set; } - - [Column("CultureIsUICulture")] - public bool? CultureIsUiculture { get; set; } - - [InverseProperty("PageTemplateScopeCulture")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("TranslationCulture")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); - - [InverseProperty("Culture")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("ScopeCulture")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("IndexCultureId")] - [InverseProperty("IndexCultures")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Sites { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Words { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Culture")] +[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] +[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] +public class CmsCulture +{ + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; + + [StringLength(200)] + public string CultureShortName { get; set; } = null!; + + [Column("CultureGUID")] + public Guid CultureGuid { get; set; } + + public DateTime CultureLastModified { get; set; } + + [StringLength(100)] + public string? CultureAlias { get; set; } + + [Column("CultureIsUICulture")] + public bool? CultureIsUiculture { get; set; } + + [InverseProperty("PageTemplateScopeCulture")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("TranslationCulture")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); + + [InverseProperty("Culture")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("ScopeCulture")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("IndexCultureId")] + [InverseProperty("IndexCultures")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Sites { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Words { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs b/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs index c1b8f32b..2058d624 100644 --- a/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs +++ b/Migration.Toolkit.K11/Models/CmsDeviceProfile.cs @@ -1,45 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_DeviceProfile")] -public partial class CmsDeviceProfile -{ - [Key] - [Column("ProfileID")] - public int ProfileId { get; set; } - - [StringLength(100)] - public string ProfileName { get; set; } = null!; - - [StringLength(200)] - public string ProfileDisplayName { get; set; } = null!; - - public int? ProfileOrder { get; set; } - - public string? ProfileMacro { get; set; } - - public string? ProfileUserAgents { get; set; } - - [Required] - public bool? ProfileEnabled { get; set; } - - public int? ProfilePreviewWidth { get; set; } - - public int? ProfilePreviewHeight { get; set; } - - [Column("ProfileGUID")] - public Guid? ProfileGuid { get; set; } - - public DateTime? ProfileLastModified { get; set; } - - [InverseProperty("DeviceProfile")] - public virtual ICollection CmsDeviceProfileLayouts { get; set; } = new List(); - - [InverseProperty("Profile")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_DeviceProfile")] +public class CmsDeviceProfile +{ + [Key] + [Column("ProfileID")] + public int ProfileId { get; set; } + + [StringLength(100)] + public string ProfileName { get; set; } = null!; + + [StringLength(200)] + public string ProfileDisplayName { get; set; } = null!; + + public int? ProfileOrder { get; set; } + + public string? ProfileMacro { get; set; } + + public string? ProfileUserAgents { get; set; } + + [Required] + public bool? ProfileEnabled { get; set; } + + public int? ProfilePreviewWidth { get; set; } + + public int? ProfilePreviewHeight { get; set; } + + [Column("ProfileGUID")] + public Guid? ProfileGuid { get; set; } + + public DateTime? ProfileLastModified { get; set; } + + [InverseProperty("DeviceProfile")] + public virtual ICollection CmsDeviceProfileLayouts { get; set; } = new List(); + + [InverseProperty("Profile")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs b/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs index c408085f..4d512c47 100644 --- a/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs +++ b/Migration.Toolkit.K11/Models/CmsDeviceProfileLayout.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_DeviceProfileLayout")] -[Index("DeviceProfileId", Name = "IX_CMS_DeviceProfileLayout_DeviceProfileID")] -[Index("SourceLayoutId", Name = "IX_CMS_DeviceProfileLayout_SourceLayoutID")] -[Index("TargetLayoutId", Name = "IX_CMS_DeviceProfileLayout_TargetLayoutID")] -public partial class CmsDeviceProfileLayout -{ - [Key] - [Column("DeviceProfileLayoutID")] - public int DeviceProfileLayoutId { get; set; } - - [Column("DeviceProfileID")] - public int DeviceProfileId { get; set; } - - [Column("SourceLayoutID")] - public int SourceLayoutId { get; set; } - - [Column("TargetLayoutID")] - public int TargetLayoutId { get; set; } - - [Column("DeviceProfileLayoutGUID")] - public Guid DeviceProfileLayoutGuid { get; set; } - - public DateTime DeviceProfileLayoutLastModified { get; set; } - - [ForeignKey("DeviceProfileId")] - [InverseProperty("CmsDeviceProfileLayouts")] - public virtual CmsDeviceProfile DeviceProfile { get; set; } = null!; - - [ForeignKey("SourceLayoutId")] - [InverseProperty("CmsDeviceProfileLayoutSourceLayouts")] - public virtual CmsLayout SourceLayout { get; set; } = null!; - - [ForeignKey("TargetLayoutId")] - [InverseProperty("CmsDeviceProfileLayoutTargetLayouts")] - public virtual CmsLayout TargetLayout { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_DeviceProfileLayout")] +[Index("DeviceProfileId", Name = "IX_CMS_DeviceProfileLayout_DeviceProfileID")] +[Index("SourceLayoutId", Name = "IX_CMS_DeviceProfileLayout_SourceLayoutID")] +[Index("TargetLayoutId", Name = "IX_CMS_DeviceProfileLayout_TargetLayoutID")] +public class CmsDeviceProfileLayout +{ + [Key] + [Column("DeviceProfileLayoutID")] + public int DeviceProfileLayoutId { get; set; } + + [Column("DeviceProfileID")] + public int DeviceProfileId { get; set; } + + [Column("SourceLayoutID")] + public int SourceLayoutId { get; set; } + + [Column("TargetLayoutID")] + public int TargetLayoutId { get; set; } + + [Column("DeviceProfileLayoutGUID")] + public Guid DeviceProfileLayoutGuid { get; set; } + + public DateTime DeviceProfileLayoutLastModified { get; set; } + + [ForeignKey("DeviceProfileId")] + [InverseProperty("CmsDeviceProfileLayouts")] + public virtual CmsDeviceProfile DeviceProfile { get; set; } = null!; + + [ForeignKey("SourceLayoutId")] + [InverseProperty("CmsDeviceProfileLayoutSourceLayouts")] + public virtual CmsLayout SourceLayout { get; set; } = null!; + + [ForeignKey("TargetLayoutId")] + [InverseProperty("CmsDeviceProfileLayoutTargetLayouts")] + public virtual CmsLayout TargetLayout { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsDocument.cs b/Migration.Toolkit.K11/Models/CmsDocument.cs index 512ffa56..256cf015 100644 --- a/Migration.Toolkit.K11/Models/CmsDocument.cs +++ b/Migration.Toolkit.K11/Models/CmsDocument.cs @@ -1,284 +1,283 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Document")] -[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] -[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] -[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] -[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] -[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] -[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] -[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] -[Index("DocumentPageTemplateId", Name = "IX_CMS_Document_DocumentPageTemplateID")] -[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] -[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] -[Index("DocumentUrlPath", Name = "IX_CMS_Document_DocumentUrlPath_DocumentID_DocumentNodeID")] -[Index("DocumentWildcardRule", "DocumentPriority", Name = "IX_CMS_Document_DocumentWildcardRule_DocumentPriority")] -[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] -public partial class CmsDocument -{ - [Key] - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - public string? DocumentUrlPath { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public bool DocumentShowInSiteMap { get; set; } - - public bool DocumentMenuItemHideInNavigation { get; set; } - - [StringLength(200)] - public string? DocumentMenuCaption { get; set; } - - [StringLength(100)] - public string? DocumentMenuStyle { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImage { get; set; } - - [Column("DocumentPageTemplateID")] - public int? DocumentPageTemplateId { get; set; } - - [StringLength(450)] - public string? DocumentMenuJavascript { get; set; } - - [StringLength(450)] - public string? DocumentMenuRedirectUrl { get; set; } - - public bool? DocumentUseNamePathForUrlPath { get; set; } - - [Column("DocumentStylesheetID")] - public int? DocumentStylesheetId { get; set; } - - public string? DocumentContent { get; set; } - - [StringLength(100)] - public string? DocumentMenuClass { get; set; } - - [StringLength(200)] - public string? DocumentMenuStyleHighlighted { get; set; } - - [StringLength(100)] - public string? DocumentMenuClassHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImageHighlighted { get; set; } - - public bool? DocumentMenuItemInactive { get; set; } - - public string? DocumentCustomData { get; set; } - - [StringLength(100)] - public string? DocumentExtensions { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - [StringLength(440)] - public string? DocumentWildcardRule { get; set; } - - public string? DocumentWebParts { get; set; } - - public double? DocumentRatingValue { get; set; } - - public int? DocumentRatings { get; set; } - - public int? DocumentPriority { get; set; } - - [StringLength(50)] - public string? DocumentType { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentUseCustomExtensions { get; set; } - - public string? DocumentGroupWebParts { get; set; } - - public bool? DocumentCheckedOutAutomatically { get; set; } - - [StringLength(200)] - public string? DocumentTrackConversionName { get; set; } - - [StringLength(100)] - public string? DocumentConversionValue { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [StringLength(32)] - public string? DocumentHash { get; set; } - - public bool? DocumentLogVisitActivity { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - [StringLength(100)] - public string? DocumentSitemapSettings { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool? DocumentMenuRedirectToFirstChild { get; set; } - - [Required] - public bool? DocumentCanBePublished { get; set; } - - [Required] - public bool? DocumentInheritsStylesheet { get; set; } - - [InverseProperty("CommentPostDocument")] - public virtual ICollection BlogComments { get; set; } = new List(); - - [InverseProperty("SubscriptionPostDocument")] - public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); - - [InverseProperty("BoardDocument")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("AttachmentDocument")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("PersonalizationDocument")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [ForeignKey("DocumentCheckedOutByUserId")] - [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] - public virtual CmsUser? DocumentCheckedOutByUser { get; set; } - - [ForeignKey("DocumentCheckedOutVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] - public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } - - [ForeignKey("DocumentCreatedByUserId")] - [InverseProperty("CmsDocumentDocumentCreatedByUsers")] - public virtual CmsUser? DocumentCreatedByUser { get; set; } - - [ForeignKey("DocumentModifiedByUserId")] - [InverseProperty("CmsDocumentDocumentModifiedByUsers")] - public virtual CmsUser? DocumentModifiedByUser { get; set; } - - [ForeignKey("DocumentNodeId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTree DocumentNode { get; set; } = null!; - - [ForeignKey("DocumentPageTemplateId")] - [InverseProperty("CmsDocuments")] - public virtual CmsPageTemplate? DocumentPageTemplate { get; set; } - - [ForeignKey("DocumentPublishedVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] - public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } - - [ForeignKey("DocumentStylesheetId")] - [InverseProperty("CmsDocuments")] - public virtual CmsCssStylesheet? DocumentStylesheet { get; set; } - - [ForeignKey("DocumentTagGroupId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTagGroup? DocumentTagGroup { get; set; } - - [ForeignKey("DocumentWorkflowStepId")] - [InverseProperty("CmsDocuments")] - public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } - - [InverseProperty("ForumDocument")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [InverseProperty("VariantDocument")] - public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Categories { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Tags { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Document")] +[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] +[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] +[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] +[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] +[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] +[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] +[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] +[Index("DocumentPageTemplateId", Name = "IX_CMS_Document_DocumentPageTemplateID")] +[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] +[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] +[Index("DocumentUrlPath", Name = "IX_CMS_Document_DocumentUrlPath_DocumentID_DocumentNodeID")] +[Index("DocumentWildcardRule", "DocumentPriority", Name = "IX_CMS_Document_DocumentWildcardRule_DocumentPriority")] +[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] +public class CmsDocument +{ + [Key] + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + public string? DocumentUrlPath { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public bool DocumentShowInSiteMap { get; set; } + + public bool DocumentMenuItemHideInNavigation { get; set; } + + [StringLength(200)] + public string? DocumentMenuCaption { get; set; } + + [StringLength(100)] + public string? DocumentMenuStyle { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImage { get; set; } + + [Column("DocumentPageTemplateID")] + public int? DocumentPageTemplateId { get; set; } + + [StringLength(450)] + public string? DocumentMenuJavascript { get; set; } + + [StringLength(450)] + public string? DocumentMenuRedirectUrl { get; set; } + + public bool? DocumentUseNamePathForUrlPath { get; set; } + + [Column("DocumentStylesheetID")] + public int? DocumentStylesheetId { get; set; } + + public string? DocumentContent { get; set; } + + [StringLength(100)] + public string? DocumentMenuClass { get; set; } + + [StringLength(200)] + public string? DocumentMenuStyleHighlighted { get; set; } + + [StringLength(100)] + public string? DocumentMenuClassHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImageHighlighted { get; set; } + + public bool? DocumentMenuItemInactive { get; set; } + + public string? DocumentCustomData { get; set; } + + [StringLength(100)] + public string? DocumentExtensions { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + [StringLength(440)] + public string? DocumentWildcardRule { get; set; } + + public string? DocumentWebParts { get; set; } + + public double? DocumentRatingValue { get; set; } + + public int? DocumentRatings { get; set; } + + public int? DocumentPriority { get; set; } + + [StringLength(50)] + public string? DocumentType { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentUseCustomExtensions { get; set; } + + public string? DocumentGroupWebParts { get; set; } + + public bool? DocumentCheckedOutAutomatically { get; set; } + + [StringLength(200)] + public string? DocumentTrackConversionName { get; set; } + + [StringLength(100)] + public string? DocumentConversionValue { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [StringLength(32)] + public string? DocumentHash { get; set; } + + public bool? DocumentLogVisitActivity { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + [StringLength(100)] + public string? DocumentSitemapSettings { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool? DocumentMenuRedirectToFirstChild { get; set; } + + [Required] + public bool? DocumentCanBePublished { get; set; } + + [Required] + public bool? DocumentInheritsStylesheet { get; set; } + + [InverseProperty("CommentPostDocument")] + public virtual ICollection BlogComments { get; set; } = new List(); + + [InverseProperty("SubscriptionPostDocument")] + public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); + + [InverseProperty("BoardDocument")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("AttachmentDocument")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("PersonalizationDocument")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [ForeignKey("DocumentCheckedOutByUserId")] + [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] + public virtual CmsUser? DocumentCheckedOutByUser { get; set; } + + [ForeignKey("DocumentCheckedOutVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] + public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } + + [ForeignKey("DocumentCreatedByUserId")] + [InverseProperty("CmsDocumentDocumentCreatedByUsers")] + public virtual CmsUser? DocumentCreatedByUser { get; set; } + + [ForeignKey("DocumentModifiedByUserId")] + [InverseProperty("CmsDocumentDocumentModifiedByUsers")] + public virtual CmsUser? DocumentModifiedByUser { get; set; } + + [ForeignKey("DocumentNodeId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTree DocumentNode { get; set; } = null!; + + [ForeignKey("DocumentPageTemplateId")] + [InverseProperty("CmsDocuments")] + public virtual CmsPageTemplate? DocumentPageTemplate { get; set; } + + [ForeignKey("DocumentPublishedVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] + public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } + + [ForeignKey("DocumentStylesheetId")] + [InverseProperty("CmsDocuments")] + public virtual CmsCssStylesheet? DocumentStylesheet { get; set; } + + [ForeignKey("DocumentTagGroupId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTagGroup? DocumentTagGroup { get; set; } + + [ForeignKey("DocumentWorkflowStepId")] + [InverseProperty("CmsDocuments")] + public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } + + [InverseProperty("ForumDocument")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [InverseProperty("VariantDocument")] + public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Categories { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Tags { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs b/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs index bc7e018d..ed43edf4 100644 --- a/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs +++ b/Migration.Toolkit.K11/Models/CmsDocumentAlias.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_DocumentAlias")] -[Index("AliasNodeId", Name = "IX_CMS_DocumentAlias_AliasNodeID")] -[Index("AliasSiteId", Name = "IX_CMS_DocumentAlias_AliasSiteID")] -[Index("AliasWildcardRule", "AliasPriority", Name = "IX_CMS_DocumentAlias_AliasWildcardRule_AliasPriority")] -[Index("AliasCulture", Name = "IX_CMS_Document_AliasCulture")] -public partial class CmsDocumentAlias -{ - [Key] - [Column("AliasID")] - public int AliasId { get; set; } - - [Column("AliasNodeID")] - public int AliasNodeId { get; set; } - - [StringLength(20)] - public string? AliasCulture { get; set; } - - [Column("AliasURLPath")] - public string? AliasUrlpath { get; set; } - - [StringLength(100)] - public string? AliasExtensions { get; set; } - - [StringLength(440)] - public string? AliasWildcardRule { get; set; } - - public int? AliasPriority { get; set; } - - [Column("AliasGUID")] - public Guid? AliasGuid { get; set; } - - public DateTime AliasLastModified { get; set; } - - [Column("AliasSiteID")] - public int AliasSiteId { get; set; } - - [StringLength(50)] - public string? AliasActionMode { get; set; } - - [ForeignKey("AliasNodeId")] - [InverseProperty("CmsDocumentAliases")] - public virtual CmsTree AliasNode { get; set; } = null!; - - [ForeignKey("AliasSiteId")] - [InverseProperty("CmsDocumentAliases")] - public virtual CmsSite AliasSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_DocumentAlias")] +[Index("AliasNodeId", Name = "IX_CMS_DocumentAlias_AliasNodeID")] +[Index("AliasSiteId", Name = "IX_CMS_DocumentAlias_AliasSiteID")] +[Index("AliasWildcardRule", "AliasPriority", Name = "IX_CMS_DocumentAlias_AliasWildcardRule_AliasPriority")] +[Index("AliasCulture", Name = "IX_CMS_Document_AliasCulture")] +public class CmsDocumentAlias +{ + [Key] + [Column("AliasID")] + public int AliasId { get; set; } + + [Column("AliasNodeID")] + public int AliasNodeId { get; set; } + + [StringLength(20)] + public string? AliasCulture { get; set; } + + [Column("AliasURLPath")] + public string? AliasUrlpath { get; set; } + + [StringLength(100)] + public string? AliasExtensions { get; set; } + + [StringLength(440)] + public string? AliasWildcardRule { get; set; } + + public int? AliasPriority { get; set; } + + [Column("AliasGUID")] + public Guid? AliasGuid { get; set; } + + public DateTime AliasLastModified { get; set; } + + [Column("AliasSiteID")] + public int AliasSiteId { get; set; } + + [StringLength(50)] + public string? AliasActionMode { get; set; } + + [ForeignKey("AliasNodeId")] + [InverseProperty("CmsDocumentAliases")] + public virtual CmsTree AliasNode { get; set; } = null!; + + [ForeignKey("AliasSiteId")] + [InverseProperty("CmsDocumentAliases")] + public virtual CmsSite AliasSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs index 0b1d2c7b..5d2bc026 100644 --- a/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs +++ b/Migration.Toolkit.K11/Models/CmsDocumentTypeScope.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_DocumentTypeScope")] -[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] -public partial class CmsDocumentTypeScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopePath { get; set; } = null!; - - [Column("ScopeSiteID")] - public int? ScopeSiteId { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeGUID")] - public Guid? ScopeGuid { get; set; } - - public bool? ScopeIncludeChildren { get; set; } - - public bool? ScopeAllowAllTypes { get; set; } - - public bool? ScopeAllowLinks { get; set; } - - [Column("ScopeAllowABVariant")] - public bool? ScopeAllowAbvariant { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsDocumentTypeScopes")] - public virtual CmsSite? ScopeSite { get; set; } - - [ForeignKey("ScopeId")] - [InverseProperty("Scopes")] - public virtual ICollection Classes { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_DocumentTypeScope")] +[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] +public class CmsDocumentTypeScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopePath { get; set; } = null!; + + [Column("ScopeSiteID")] + public int? ScopeSiteId { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeGUID")] + public Guid? ScopeGuid { get; set; } + + public bool? ScopeIncludeChildren { get; set; } + + public bool? ScopeAllowAllTypes { get; set; } + + public bool? ScopeAllowLinks { get; set; } + + [Column("ScopeAllowABVariant")] + public bool? ScopeAllowAbvariant { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsDocumentTypeScopes")] + public virtual CmsSite? ScopeSite { get; set; } + + [ForeignKey("ScopeId")] + [InverseProperty("Scopes")] + public virtual ICollection Classes { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsEmail.cs b/Migration.Toolkit.K11/Models/CmsEmail.cs index a4aa4acd..d45a5b4c 100644 --- a/Migration.Toolkit.K11/Models/CmsEmail.cs +++ b/Migration.Toolkit.K11/Models/CmsEmail.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Email")] -[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] -public partial class CmsEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [StringLength(254)] - public string EmailFrom { get; set; } = null!; - - [StringLength(998)] - public string? EmailTo { get; set; } - - [StringLength(998)] - public string? EmailCc { get; set; } - - [StringLength(998)] - public string? EmailBcc { get; set; } - - [StringLength(450)] - public string EmailSubject { get; set; } = null!; - - public string? EmailBody { get; set; } - - public string? EmailPlainTextBody { get; set; } - - public int EmailFormat { get; set; } - - public int EmailPriority { get; set; } - - [Column("EmailSiteID")] - public int? EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - public DateTime EmailLastModified { get; set; } - - public int? EmailStatus { get; set; } - - public bool? EmailIsMass { get; set; } - - [StringLength(254)] - public string? EmailReplyTo { get; set; } - - public string? EmailHeaders { get; set; } - - public DateTime? EmailCreated { get; set; } - - [InverseProperty("Email")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [ForeignKey("EmailId")] - [InverseProperty("Emails")] - public virtual ICollection Attachments { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Email")] +[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] +public class CmsEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [StringLength(254)] + public string EmailFrom { get; set; } = null!; + + [StringLength(998)] + public string? EmailTo { get; set; } + + [StringLength(998)] + public string? EmailCc { get; set; } + + [StringLength(998)] + public string? EmailBcc { get; set; } + + [StringLength(450)] + public string EmailSubject { get; set; } = null!; + + public string? EmailBody { get; set; } + + public string? EmailPlainTextBody { get; set; } + + public int EmailFormat { get; set; } + + public int EmailPriority { get; set; } + + [Column("EmailSiteID")] + public int? EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + public DateTime EmailLastModified { get; set; } + + public int? EmailStatus { get; set; } + + public bool? EmailIsMass { get; set; } + + [StringLength(254)] + public string? EmailReplyTo { get; set; } + + public string? EmailHeaders { get; set; } + + public DateTime? EmailCreated { get; set; } + + [InverseProperty("Email")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [ForeignKey("EmailId")] + [InverseProperty("Emails")] + public virtual ICollection Attachments { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs b/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs index cd02b37f..b05aa408 100644 --- a/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs +++ b/Migration.Toolkit.K11/Models/CmsEmailAttachment.cs @@ -1,44 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_EmailAttachment")] -public partial class CmsEmailAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[] AttachmentBinary { get; set; } = null!; - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [Column("AttachmentContentID")] - [StringLength(255)] - public string? AttachmentContentId { get; set; } - - [Column("AttachmentSiteID")] - public int? AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentId")] - [InverseProperty("Attachments")] - public virtual ICollection Emails { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_EmailAttachment")] +public class CmsEmailAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[] AttachmentBinary { get; set; } = null!; + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [Column("AttachmentContentID")] + [StringLength(255)] + public string? AttachmentContentId { get; set; } + + [Column("AttachmentSiteID")] + public int? AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentId")] + [InverseProperty("Attachments")] + public virtual ICollection Emails { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs b/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs index 94b12736..92d44981 100644 --- a/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs +++ b/Migration.Toolkit.K11/Models/CmsEmailTemplate.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_EmailTemplate")] -[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] -[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] -public partial class CmsEmailTemplate -{ - [Key] - [Column("EmailTemplateID")] - public int EmailTemplateId { get; set; } - - [StringLength(200)] - public string EmailTemplateName { get; set; } = null!; - - [StringLength(200)] - public string EmailTemplateDisplayName { get; set; } = null!; - - public string? EmailTemplateText { get; set; } - - [Column("EmailTemplateSiteID")] - public int? EmailTemplateSiteId { get; set; } - - [Column("EmailTemplateGUID")] - public Guid EmailTemplateGuid { get; set; } - - public DateTime EmailTemplateLastModified { get; set; } - - public string? EmailTemplatePlainText { get; set; } - - [StringLength(250)] - public string? EmailTemplateSubject { get; set; } - - [StringLength(254)] - public string? EmailTemplateFrom { get; set; } - - [StringLength(998)] - public string? EmailTemplateCc { get; set; } - - [StringLength(998)] - public string? EmailTemplateBcc { get; set; } - - [StringLength(100)] - public string? EmailTemplateType { get; set; } - - public string? EmailTemplateDescription { get; set; } - - [StringLength(254)] - public string? EmailTemplateReplyTo { get; set; } - - [ForeignKey("EmailTemplateSiteId")] - [InverseProperty("CmsEmailTemplates")] - public virtual CmsSite? EmailTemplateSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_EmailTemplate")] +[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] +[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] +public class CmsEmailTemplate +{ + [Key] + [Column("EmailTemplateID")] + public int EmailTemplateId { get; set; } + + [StringLength(200)] + public string EmailTemplateName { get; set; } = null!; + + [StringLength(200)] + public string EmailTemplateDisplayName { get; set; } = null!; + + public string? EmailTemplateText { get; set; } + + [Column("EmailTemplateSiteID")] + public int? EmailTemplateSiteId { get; set; } + + [Column("EmailTemplateGUID")] + public Guid EmailTemplateGuid { get; set; } + + public DateTime EmailTemplateLastModified { get; set; } + + public string? EmailTemplatePlainText { get; set; } + + [StringLength(250)] + public string? EmailTemplateSubject { get; set; } + + [StringLength(254)] + public string? EmailTemplateFrom { get; set; } + + [StringLength(998)] + public string? EmailTemplateCc { get; set; } + + [StringLength(998)] + public string? EmailTemplateBcc { get; set; } + + [StringLength(100)] + public string? EmailTemplateType { get; set; } + + public string? EmailTemplateDescription { get; set; } + + [StringLength(254)] + public string? EmailTemplateReplyTo { get; set; } + + [ForeignKey("EmailTemplateSiteId")] + [InverseProperty("CmsEmailTemplates")] + public virtual CmsSite? EmailTemplateSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsEmailUser.cs b/Migration.Toolkit.K11/Models/CmsEmailUser.cs index 21b5fdb8..f3f40e12 100644 --- a/Migration.Toolkit.K11/Models/CmsEmailUser.cs +++ b/Migration.Toolkit.K11/Models/CmsEmailUser.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("EmailId", "UserId")] -[Table("CMS_EmailUser")] -[Index("Status", Name = "IX_CMS_EmailUser_Status")] -[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] -public partial class CmsEmailUser -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Key] - [Column("UserID")] - public int UserId { get; set; } - - public string? LastSendResult { get; set; } - - public DateTime? LastSendAttempt { get; set; } - - public int? Status { get; set; } - - [ForeignKey("EmailId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsEmail Email { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("EmailId", "UserId")] +[Table("CMS_EmailUser")] +[Index("Status", Name = "IX_CMS_EmailUser_Status")] +[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] +public class CmsEmailUser +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Key] + [Column("UserID")] + public int UserId { get; set; } + + public string? LastSendResult { get; set; } + + public DateTime? LastSendAttempt { get; set; } + + public int? Status { get; set; } + + [ForeignKey("EmailId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsEmail Email { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsEventLog.cs b/Migration.Toolkit.K11/Models/CmsEventLog.cs index 4a0de4ff..f31c98fb 100644 --- a/Migration.Toolkit.K11/Models/CmsEventLog.cs +++ b/Migration.Toolkit.K11/Models/CmsEventLog.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_EventLog")] -[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] -public partial class CmsEventLog -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(5)] - public string EventType { get; set; } = null!; - - public DateTime EventTime { get; set; } - - [StringLength(100)] - public string Source { get; set; } = null!; - - [StringLength(100)] - public string EventCode { get; set; } = null!; - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(250)] - public string? UserName { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string? Ipaddress { get; set; } - - [Column("NodeID")] - public int? NodeId { get; set; } - - [StringLength(100)] - public string? DocumentName { get; set; } - - public string? EventDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - public string? EventUrl { get; set; } - - [StringLength(100)] - public string? EventMachineName { get; set; } - - public string? EventUserAgent { get; set; } - - public string? EventUrlReferrer { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_EventLog")] +[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] +public class CmsEventLog +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(5)] + public string EventType { get; set; } = null!; + + public DateTime EventTime { get; set; } + + [StringLength(100)] + public string Source { get; set; } = null!; + + [StringLength(100)] + public string EventCode { get; set; } = null!; + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(250)] + public string? UserName { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string? Ipaddress { get; set; } + + [Column("NodeID")] + public int? NodeId { get; set; } + + [StringLength(100)] + public string? DocumentName { get; set; } + + public string? EventDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + public string? EventUrl { get; set; } + + [StringLength(100)] + public string? EventMachineName { get; set; } + + public string? EventUserAgent { get; set; } + + public string? EventUrlReferrer { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsExternalLogin.cs b/Migration.Toolkit.K11/Models/CmsExternalLogin.cs index 08f25e1a..6d7073b0 100644 --- a/Migration.Toolkit.K11/Models/CmsExternalLogin.cs +++ b/Migration.Toolkit.K11/Models/CmsExternalLogin.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ExternalLogin")] -[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] -public partial class CmsExternalLogin -{ - [Key] - [Column("ExternalLoginID")] - public int ExternalLoginId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(200)] - public string? LoginProvider { get; set; } - - [StringLength(200)] - public string? IdentityKey { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsExternalLogins")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ExternalLogin")] +[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] +public class CmsExternalLogin +{ + [Key] + [Column("ExternalLoginID")] + public int ExternalLoginId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(200)] + public string? LoginProvider { get; set; } + + [StringLength(200)] + public string? IdentityKey { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsExternalLogins")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsForm.cs b/Migration.Toolkit.K11/Models/CmsForm.cs index 43bf1dfb..cb04e0bf 100644 --- a/Migration.Toolkit.K11/Models/CmsForm.cs +++ b/Migration.Toolkit.K11/Models/CmsForm.cs @@ -1,91 +1,90 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Form")] -[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] -[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] -public partial class CmsForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(100)] - public string FormName { get; set; } = null!; - - [StringLength(998)] - public string? FormSendToEmail { get; set; } - - [StringLength(254)] - public string? FormSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormEmailSubject { get; set; } - - public string? FormEmailTemplate { get; set; } - - public bool? FormEmailAttachUploadedDocs { get; set; } - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public int FormItems { get; set; } - - public string? FormReportFields { get; set; } - - [StringLength(400)] - public string? FormRedirectToUrl { get; set; } - - public string? FormDisplayText { get; set; } - - public bool FormClearAfterSave { get; set; } - - [StringLength(400)] - public string? FormSubmitButtonText { get; set; } - - [Column("FormSiteID")] - public int FormSiteId { get; set; } - - [StringLength(254)] - public string? FormConfirmationEmailField { get; set; } - - public string? FormConfirmationTemplate { get; set; } - - [StringLength(254)] - public string? FormConfirmationSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormConfirmationEmailSubject { get; set; } - - public int? FormAccess { get; set; } - - [StringLength(255)] - public string? FormSubmitButtonImage { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - public bool? FormLogActivity { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsForms")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormSiteId")] - [InverseProperty("CmsForms")] - public virtual CmsSite FormSite { get; set; } = null!; - - [ForeignKey("FormId")] - [InverseProperty("Forms")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Form")] +[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] +[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] +public class CmsForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(100)] + public string FormName { get; set; } = null!; + + [StringLength(998)] + public string? FormSendToEmail { get; set; } + + [StringLength(254)] + public string? FormSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormEmailSubject { get; set; } + + public string? FormEmailTemplate { get; set; } + + public bool? FormEmailAttachUploadedDocs { get; set; } + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public int FormItems { get; set; } + + public string? FormReportFields { get; set; } + + [StringLength(400)] + public string? FormRedirectToUrl { get; set; } + + public string? FormDisplayText { get; set; } + + public bool FormClearAfterSave { get; set; } + + [StringLength(400)] + public string? FormSubmitButtonText { get; set; } + + [Column("FormSiteID")] + public int FormSiteId { get; set; } + + [StringLength(254)] + public string? FormConfirmationEmailField { get; set; } + + public string? FormConfirmationTemplate { get; set; } + + [StringLength(254)] + public string? FormConfirmationSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormConfirmationEmailSubject { get; set; } + + public int? FormAccess { get; set; } + + [StringLength(255)] + public string? FormSubmitButtonImage { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + public bool? FormLogActivity { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsForms")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormSiteId")] + [InverseProperty("CmsForms")] + public virtual CmsSite FormSite { get; set; } = null!; + + [ForeignKey("FormId")] + [InverseProperty("Forms")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsFormUserControl.cs b/Migration.Toolkit.K11/Models/CmsFormUserControl.cs index 3b010661..29aac7a2 100644 --- a/Migration.Toolkit.K11/Models/CmsFormUserControl.cs +++ b/Migration.Toolkit.K11/Models/CmsFormUserControl.cs @@ -1,109 +1,108 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_FormUserControl")] -[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] -[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] -[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] -public partial class CmsFormUserControl -{ - [Key] - [Column("UserControlID")] - public int UserControlId { get; set; } - - [StringLength(200)] - public string UserControlDisplayName { get; set; } = null!; - - [StringLength(200)] - public string UserControlCodeName { get; set; } = null!; - - [StringLength(400)] - public string UserControlFileName { get; set; } = null!; - - public bool UserControlForText { get; set; } - - public bool UserControlForLongText { get; set; } - - public bool UserControlForInteger { get; set; } - - public bool UserControlForDecimal { get; set; } - - public bool UserControlForDateTime { get; set; } - - public bool UserControlForBoolean { get; set; } - - public bool UserControlForFile { get; set; } - - public bool UserControlShowInBizForms { get; set; } - - [StringLength(50)] - public string UserControlDefaultDataType { get; set; } = null!; - - public int? UserControlDefaultDataTypeSize { get; set; } - - public bool? UserControlShowInDocumentTypes { get; set; } - - public bool? UserControlShowInSystemTables { get; set; } - - public bool? UserControlShowInWebParts { get; set; } - - public bool? UserControlShowInReports { get; set; } - - [Column("UserControlGUID")] - public Guid UserControlGuid { get; set; } - - public DateTime UserControlLastModified { get; set; } - - public bool UserControlForGuid { get; set; } - - public bool? UserControlShowInCustomTables { get; set; } - - public bool UserControlForVisibility { get; set; } - - public string? UserControlParameters { get; set; } - - public bool UserControlForDocAttachments { get; set; } - - [Column("UserControlResourceID")] - public int? UserControlResourceId { get; set; } - - public int? UserControlType { get; set; } - - [Column("UserControlParentID")] - public int? UserControlParentId { get; set; } - - public string? UserControlDescription { get; set; } - - [Column("UserControlThumbnailGUID")] - public Guid? UserControlThumbnailGuid { get; set; } - - public int? UserControlPriority { get; set; } - - public bool? UserControlIsSystem { get; set; } - - public bool UserControlForBinary { get; set; } - - public bool UserControlForDocRelationships { get; set; } - - [StringLength(200)] - public string? UserControlAssemblyName { get; set; } - - [StringLength(200)] - public string? UserControlClassName { get; set; } - - [InverseProperty("UserControlParent")] - public virtual ICollection InverseUserControlParent { get; set; } = new List(); - - [ForeignKey("UserControlParentId")] - [InverseProperty("InverseUserControlParent")] - public virtual CmsFormUserControl? UserControlParent { get; set; } - - [ForeignKey("UserControlResourceId")] - [InverseProperty("CmsFormUserControls")] - public virtual CmsResource? UserControlResource { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_FormUserControl")] +[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] +[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] +[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] +public class CmsFormUserControl +{ + [Key] + [Column("UserControlID")] + public int UserControlId { get; set; } + + [StringLength(200)] + public string UserControlDisplayName { get; set; } = null!; + + [StringLength(200)] + public string UserControlCodeName { get; set; } = null!; + + [StringLength(400)] + public string UserControlFileName { get; set; } = null!; + + public bool UserControlForText { get; set; } + + public bool UserControlForLongText { get; set; } + + public bool UserControlForInteger { get; set; } + + public bool UserControlForDecimal { get; set; } + + public bool UserControlForDateTime { get; set; } + + public bool UserControlForBoolean { get; set; } + + public bool UserControlForFile { get; set; } + + public bool UserControlShowInBizForms { get; set; } + + [StringLength(50)] + public string UserControlDefaultDataType { get; set; } = null!; + + public int? UserControlDefaultDataTypeSize { get; set; } + + public bool? UserControlShowInDocumentTypes { get; set; } + + public bool? UserControlShowInSystemTables { get; set; } + + public bool? UserControlShowInWebParts { get; set; } + + public bool? UserControlShowInReports { get; set; } + + [Column("UserControlGUID")] + public Guid UserControlGuid { get; set; } + + public DateTime UserControlLastModified { get; set; } + + public bool UserControlForGuid { get; set; } + + public bool? UserControlShowInCustomTables { get; set; } + + public bool UserControlForVisibility { get; set; } + + public string? UserControlParameters { get; set; } + + public bool UserControlForDocAttachments { get; set; } + + [Column("UserControlResourceID")] + public int? UserControlResourceId { get; set; } + + public int? UserControlType { get; set; } + + [Column("UserControlParentID")] + public int? UserControlParentId { get; set; } + + public string? UserControlDescription { get; set; } + + [Column("UserControlThumbnailGUID")] + public Guid? UserControlThumbnailGuid { get; set; } + + public int? UserControlPriority { get; set; } + + public bool? UserControlIsSystem { get; set; } + + public bool UserControlForBinary { get; set; } + + public bool UserControlForDocRelationships { get; set; } + + [StringLength(200)] + public string? UserControlAssemblyName { get; set; } + + [StringLength(200)] + public string? UserControlClassName { get; set; } + + [InverseProperty("UserControlParent")] + public virtual ICollection InverseUserControlParent { get; set; } = new List(); + + [ForeignKey("UserControlParentId")] + [InverseProperty("InverseUserControlParent")] + public virtual CmsFormUserControl? UserControlParent { get; set; } + + [ForeignKey("UserControlResourceId")] + [InverseProperty("CmsFormUserControls")] + public virtual CmsResource? UserControlResource { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsHelpTopic.cs b/Migration.Toolkit.K11/Models/CmsHelpTopic.cs index 2509c3c5..5d4f41e6 100644 --- a/Migration.Toolkit.K11/Models/CmsHelpTopic.cs +++ b/Migration.Toolkit.K11/Models/CmsHelpTopic.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_HelpTopic")] -[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] -public partial class CmsHelpTopic -{ - [Key] - [Column("HelpTopicID")] - public int HelpTopicId { get; set; } - - [Column("HelpTopicUIElementID")] - public int HelpTopicUielementId { get; set; } - - [StringLength(200)] - public string HelpTopicName { get; set; } = null!; - - [StringLength(1023)] - public string HelpTopicLink { get; set; } = null!; - - public DateTime HelpTopicLastModified { get; set; } - - [Column("HelpTopicGUID")] - public Guid HelpTopicGuid { get; set; } - - public int? HelpTopicOrder { get; set; } - - [ForeignKey("HelpTopicUielementId")] - [InverseProperty("CmsHelpTopics")] - public virtual CmsUielement HelpTopicUielement { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_HelpTopic")] +[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] +public class CmsHelpTopic +{ + [Key] + [Column("HelpTopicID")] + public int HelpTopicId { get; set; } + + [Column("HelpTopicUIElementID")] + public int HelpTopicUielementId { get; set; } + + [StringLength(200)] + public string HelpTopicName { get; set; } = null!; + + [StringLength(1023)] + public string HelpTopicLink { get; set; } = null!; + + public DateTime HelpTopicLastModified { get; set; } + + [Column("HelpTopicGUID")] + public Guid HelpTopicGuid { get; set; } + + public int? HelpTopicOrder { get; set; } + + [ForeignKey("HelpTopicUielementId")] + [InverseProperty("CmsHelpTopics")] + public virtual CmsUielement HelpTopicUielement { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsLayout.cs b/Migration.Toolkit.K11/Models/CmsLayout.cs index df548bae..92d32c2e 100644 --- a/Migration.Toolkit.K11/Models/CmsLayout.cs +++ b/Migration.Toolkit.K11/Models/CmsLayout.cs @@ -1,63 +1,62 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Layout")] -[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] -public partial class CmsLayout -{ - [Key] - [Column("LayoutID")] - public int LayoutId { get; set; } - - [StringLength(100)] - public string LayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string LayoutDisplayName { get; set; } = null!; - - public string? LayoutDescription { get; set; } - - public string LayoutCode { get; set; } = null!; - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - [Column("LayoutThumbnailGUID")] - public Guid? LayoutThumbnailGuid { get; set; } - - public int? LayoutZoneCount { get; set; } - - public bool? LayoutIsConvertible { get; set; } - - [StringLength(200)] - public string? LayoutIconClass { get; set; } - - [InverseProperty("SourceLayout")] - public virtual ICollection CmsDeviceProfileLayoutSourceLayouts { get; set; } = new List(); - - [InverseProperty("TargetLayout")] - public virtual ICollection CmsDeviceProfileLayoutTargetLayouts { get; set; } = new List(); - - [InverseProperty("PageTemplateLayoutNavigation")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("Layout")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Layout")] +[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] +public class CmsLayout +{ + [Key] + [Column("LayoutID")] + public int LayoutId { get; set; } + + [StringLength(100)] + public string LayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string LayoutDisplayName { get; set; } = null!; + + public string? LayoutDescription { get; set; } + + public string LayoutCode { get; set; } = null!; + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + [Column("LayoutThumbnailGUID")] + public Guid? LayoutThumbnailGuid { get; set; } + + public int? LayoutZoneCount { get; set; } + + public bool? LayoutIsConvertible { get; set; } + + [StringLength(200)] + public string? LayoutIconClass { get; set; } + + [InverseProperty("SourceLayout")] + public virtual ICollection CmsDeviceProfileLayoutSourceLayouts { get; set; } = new List(); + + [InverseProperty("TargetLayout")] + public virtual ICollection CmsDeviceProfileLayoutTargetLayouts { get; set; } = new List(); + + [InverseProperty("PageTemplateLayoutNavigation")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("Layout")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsLicenseKey.cs b/Migration.Toolkit.K11/Models/CmsLicenseKey.cs index 94678e71..c76e52fa 100644 --- a/Migration.Toolkit.K11/Models/CmsLicenseKey.cs +++ b/Migration.Toolkit.K11/Models/CmsLicenseKey.cs @@ -1,28 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_LicenseKey")] -public partial class CmsLicenseKey -{ - [Key] - [Column("LicenseKeyID")] - public int LicenseKeyId { get; set; } - - [StringLength(255)] - public string? LicenseDomain { get; set; } - - public string? LicenseKey { get; set; } - - [StringLength(200)] - public string? LicenseEdition { get; set; } - - [StringLength(200)] - public string? LicenseExpiration { get; set; } - - public int? LicenseServers { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_LicenseKey")] +public class CmsLicenseKey +{ + [Key] + [Column("LicenseKeyID")] + public int LicenseKeyId { get; set; } + + [StringLength(255)] + public string? LicenseDomain { get; set; } + + public string? LicenseKey { get; set; } + + [StringLength(200)] + public string? LicenseEdition { get; set; } + + [StringLength(200)] + public string? LicenseExpiration { get; set; } + + public int? LicenseServers { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs b/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs index 5402518b..489275b4 100644 --- a/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs +++ b/Migration.Toolkit.K11/Models/CmsMacroIdentity.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_MacroIdentity")] -[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] -public partial class CmsMacroIdentity -{ - [Key] - [Column("MacroIdentityID")] - public int MacroIdentityId { get; set; } - - public Guid MacroIdentityGuid { get; set; } - - public DateTime MacroIdentityLastModified { get; set; } - - [StringLength(200)] - public string MacroIdentityName { get; set; } = null!; - - [Column("MacroIdentityEffectiveUserID")] - public int? MacroIdentityEffectiveUserId { get; set; } - - [InverseProperty("UserMacroIdentityMacroIdentity")] - public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); - - [ForeignKey("MacroIdentityEffectiveUserId")] - [InverseProperty("CmsMacroIdentities")] - public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_MacroIdentity")] +[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] +public class CmsMacroIdentity +{ + [Key] + [Column("MacroIdentityID")] + public int MacroIdentityId { get; set; } + + public Guid MacroIdentityGuid { get; set; } + + public DateTime MacroIdentityLastModified { get; set; } + + [StringLength(200)] + public string MacroIdentityName { get; set; } = null!; + + [Column("MacroIdentityEffectiveUserID")] + public int? MacroIdentityEffectiveUserId { get; set; } + + [InverseProperty("UserMacroIdentityMacroIdentity")] + public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); + + [ForeignKey("MacroIdentityEffectiveUserId")] + [InverseProperty("CmsMacroIdentities")] + public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsMacroRule.cs b/Migration.Toolkit.K11/Models/CmsMacroRule.cs index 19f98f64..b70d0fe2 100644 --- a/Migration.Toolkit.K11/Models/CmsMacroRule.cs +++ b/Migration.Toolkit.K11/Models/CmsMacroRule.cs @@ -1,48 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_MacroRule")] -public partial class CmsMacroRule -{ - [Key] - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [StringLength(200)] - public string MacroRuleName { get; set; } = null!; - - [StringLength(1000)] - public string MacroRuleText { get; set; } = null!; - - public string? MacroRuleParameters { get; set; } - - [StringLength(100)] - public string? MacroRuleResourceName { get; set; } - - public DateTime MacroRuleLastModified { get; set; } - - [Column("MacroRuleGUID")] - public Guid MacroRuleGuid { get; set; } - - public string MacroRuleCondition { get; set; } = null!; - - [StringLength(500)] - public string MacroRuleDisplayName { get; set; } = null!; - - public bool? MacroRuleIsCustom { get; set; } - - public bool MacroRuleRequiresContext { get; set; } - - [StringLength(450)] - public string? MacroRuleDescription { get; set; } - - [StringLength(2500)] - public string? MacroRuleRequiredData { get; set; } - - public bool? MacroRuleEnabled { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_MacroRule")] +public class CmsMacroRule +{ + [Key] + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [StringLength(200)] + public string MacroRuleName { get; set; } = null!; + + [StringLength(1000)] + public string MacroRuleText { get; set; } = null!; + + public string? MacroRuleParameters { get; set; } + + [StringLength(100)] + public string? MacroRuleResourceName { get; set; } + + public DateTime MacroRuleLastModified { get; set; } + + [Column("MacroRuleGUID")] + public Guid MacroRuleGuid { get; set; } + + public string MacroRuleCondition { get; set; } = null!; + + [StringLength(500)] + public string MacroRuleDisplayName { get; set; } = null!; + + public bool? MacroRuleIsCustom { get; set; } + + public bool MacroRuleRequiresContext { get; set; } + + [StringLength(450)] + public string? MacroRuleDescription { get; set; } + + [StringLength(2500)] + public string? MacroRuleRequiredData { get; set; } + + public bool? MacroRuleEnabled { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsMembership.cs b/Migration.Toolkit.K11/Models/CmsMembership.cs index 76779403..30eae764 100644 --- a/Migration.Toolkit.K11/Models/CmsMembership.cs +++ b/Migration.Toolkit.K11/Models/CmsMembership.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Membership")] -[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] -public partial class CmsMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [StringLength(200)] - public string MembershipName { get; set; } = null!; - - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - public string? MembershipDescription { get; set; } - - public DateTime MembershipLastModified { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } - - [InverseProperty("Membership")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [ForeignKey("MembershipSiteId")] - [InverseProperty("CmsMemberships")] - public virtual CmsSite? MembershipSite { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("Memberships")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Membership")] +[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] +public class CmsMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [StringLength(200)] + public string MembershipName { get; set; } = null!; + + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + public string? MembershipDescription { get; set; } + + public DateTime MembershipLastModified { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } + + [InverseProperty("Membership")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [ForeignKey("MembershipSiteId")] + [InverseProperty("CmsMemberships")] + public virtual CmsSite? MembershipSite { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("Memberships")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsMembershipUser.cs b/Migration.Toolkit.K11/Models/CmsMembershipUser.cs index fb1faf38..881f9625 100644 --- a/Migration.Toolkit.K11/Models/CmsMembershipUser.cs +++ b/Migration.Toolkit.K11/Models/CmsMembershipUser.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_MembershipUser")] -[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] -[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] -public partial class CmsMembershipUser -{ - [Key] - [Column("MembershipUserID")] - public int MembershipUserId { get; set; } - - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } - - public bool? SendNotification { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsMembership Membership { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_MembershipUser")] +[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] +[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] +public class CmsMembershipUser +{ + [Key] + [Column("MembershipUserID")] + public int MembershipUserId { get; set; } + + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } + + public bool? SendNotification { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsMembership Membership { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsMetaFile.cs b/Migration.Toolkit.K11/Models/CmsMetaFile.cs index fcc82227..f970ced2 100644 --- a/Migration.Toolkit.K11/Models/CmsMetaFile.cs +++ b/Migration.Toolkit.K11/Models/CmsMetaFile.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_MetaFile")] -[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] -[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] -public partial class CmsMetaFile -{ - [Key] - [Column("MetaFileID")] - public int MetaFileId { get; set; } - - [Column("MetaFileObjectID")] - public int MetaFileObjectId { get; set; } - - [StringLength(100)] - public string MetaFileObjectType { get; set; } = null!; - - [StringLength(100)] - public string? MetaFileGroupName { get; set; } - - [StringLength(250)] - public string MetaFileName { get; set; } = null!; - - [StringLength(50)] - public string MetaFileExtension { get; set; } = null!; - - public int MetaFileSize { get; set; } - - [StringLength(100)] - public string MetaFileMimeType { get; set; } = null!; - - public byte[]? MetaFileBinary { get; set; } - - public int? MetaFileImageWidth { get; set; } - - public int? MetaFileImageHeight { get; set; } - - [Column("MetaFileGUID")] - public Guid MetaFileGuid { get; set; } - - public DateTime MetaFileLastModified { get; set; } - - [Column("MetaFileSiteID")] - public int? MetaFileSiteId { get; set; } - - [StringLength(250)] - public string? MetaFileTitle { get; set; } - - public string? MetaFileDescription { get; set; } - - public string? MetaFileCustomData { get; set; } - - [ForeignKey("MetaFileSiteId")] - [InverseProperty("CmsMetaFiles")] - public virtual CmsSite? MetaFileSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_MetaFile")] +[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] +[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] +public class CmsMetaFile +{ + [Key] + [Column("MetaFileID")] + public int MetaFileId { get; set; } + + [Column("MetaFileObjectID")] + public int MetaFileObjectId { get; set; } + + [StringLength(100)] + public string MetaFileObjectType { get; set; } = null!; + + [StringLength(100)] + public string? MetaFileGroupName { get; set; } + + [StringLength(250)] + public string MetaFileName { get; set; } = null!; + + [StringLength(50)] + public string MetaFileExtension { get; set; } = null!; + + public int MetaFileSize { get; set; } + + [StringLength(100)] + public string MetaFileMimeType { get; set; } = null!; + + public byte[]? MetaFileBinary { get; set; } + + public int? MetaFileImageWidth { get; set; } + + public int? MetaFileImageHeight { get; set; } + + [Column("MetaFileGUID")] + public Guid MetaFileGuid { get; set; } + + public DateTime MetaFileLastModified { get; set; } + + [Column("MetaFileSiteID")] + public int? MetaFileSiteId { get; set; } + + [StringLength(250)] + public string? MetaFileTitle { get; set; } + + public string? MetaFileDescription { get; set; } + + public string? MetaFileCustomData { get; set; } + + [ForeignKey("MetaFileSiteId")] + [InverseProperty("CmsMetaFiles")] + public virtual CmsSite? MetaFileSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs index 14c06f8b..536a283a 100644 --- a/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs +++ b/Migration.Toolkit.K11/Models/CmsModuleLicenseKey.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ModuleLicenseKey")] -[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] -public partial class CmsModuleLicenseKey -{ - [Key] - [Column("ModuleLicenseKeyID")] - public int ModuleLicenseKeyId { get; set; } - - public Guid ModuleLicenseKeyGuid { get; set; } - - public DateTime ModuleLicenseKeyLastModified { get; set; } - - public string ModuleLicenseKeyLicense { get; set; } = null!; - - [Column("ModuleLicenseKeyResourceID")] - public int ModuleLicenseKeyResourceId { get; set; } - - [ForeignKey("ModuleLicenseKeyResourceId")] - [InverseProperty("CmsModuleLicenseKeys")] - public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ModuleLicenseKey")] +[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] +public class CmsModuleLicenseKey +{ + [Key] + [Column("ModuleLicenseKeyID")] + public int ModuleLicenseKeyId { get; set; } + + public Guid ModuleLicenseKeyGuid { get; set; } + + public DateTime ModuleLicenseKeyLastModified { get; set; } + + public string ModuleLicenseKeyLicense { get; set; } = null!; + + [Column("ModuleLicenseKeyResourceID")] + public int ModuleLicenseKeyResourceId { get; set; } + + [ForeignKey("ModuleLicenseKeyResourceId")] + [InverseProperty("CmsModuleLicenseKeys")] + public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs index 5d92d286..72c95a11 100644 --- a/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs +++ b/Migration.Toolkit.K11/Models/CmsModuleUsageCounter.cs @@ -1,20 +1,19 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -[Table("CMS_ModuleUsageCounter")] -public partial class CmsModuleUsageCounter -{ - [Column("ModuleUsageCounterID")] - public int ModuleUsageCounterId { get; set; } - - [StringLength(200)] - public string ModuleUsageCounterName { get; set; } = null!; - - public long ModuleUsageCounterValue { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +[Table("CMS_ModuleUsageCounter")] +public class CmsModuleUsageCounter +{ + [Column("ModuleUsageCounterID")] + public int ModuleUsageCounterId { get; set; } + + [StringLength(200)] + public string ModuleUsageCounterName { get; set; } = null!; + + public long ModuleUsageCounterValue { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsObjectSetting.cs b/Migration.Toolkit.K11/Models/CmsObjectSetting.cs index ff800c0e..ead49e19 100644 --- a/Migration.Toolkit.K11/Models/CmsObjectSetting.cs +++ b/Migration.Toolkit.K11/Models/CmsObjectSetting.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ObjectSettings")] -[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] -[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] -[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] -[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] -[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] -public partial class CmsObjectSetting -{ - [Key] - [Column("ObjectSettingsID")] - public int ObjectSettingsId { get; set; } - - public string? ObjectTags { get; set; } - - [Column("ObjectCheckedOutByUserID")] - public int? ObjectCheckedOutByUserId { get; set; } - - public DateTime? ObjectCheckedOutWhen { get; set; } - - [Column("ObjectCheckedOutVersionHistoryID")] - public int? ObjectCheckedOutVersionHistoryId { get; set; } - - [Column("ObjectWorkflowStepID")] - public int? ObjectWorkflowStepId { get; set; } - - [Column("ObjectPublishedVersionHistoryID")] - public int? ObjectPublishedVersionHistoryId { get; set; } - - [Column("ObjectSettingsObjectID")] - public int ObjectSettingsObjectId { get; set; } - - [StringLength(100)] - public string ObjectSettingsObjectType { get; set; } = null!; - - public string? ObjectComments { get; set; } - - public bool? ObjectWorkflowSendEmails { get; set; } - - [ForeignKey("ObjectCheckedOutByUserId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsUser? ObjectCheckedOutByUser { get; set; } - - [ForeignKey("ObjectCheckedOutVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } - - [ForeignKey("ObjectPublishedVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } - - [ForeignKey("ObjectWorkflowStepId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ObjectSettings")] +[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] +[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] +[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] +[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] +[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] +public class CmsObjectSetting +{ + [Key] + [Column("ObjectSettingsID")] + public int ObjectSettingsId { get; set; } + + public string? ObjectTags { get; set; } + + [Column("ObjectCheckedOutByUserID")] + public int? ObjectCheckedOutByUserId { get; set; } + + public DateTime? ObjectCheckedOutWhen { get; set; } + + [Column("ObjectCheckedOutVersionHistoryID")] + public int? ObjectCheckedOutVersionHistoryId { get; set; } + + [Column("ObjectWorkflowStepID")] + public int? ObjectWorkflowStepId { get; set; } + + [Column("ObjectPublishedVersionHistoryID")] + public int? ObjectPublishedVersionHistoryId { get; set; } + + [Column("ObjectSettingsObjectID")] + public int ObjectSettingsObjectId { get; set; } + + [StringLength(100)] + public string ObjectSettingsObjectType { get; set; } = null!; + + public string? ObjectComments { get; set; } + + public bool? ObjectWorkflowSendEmails { get; set; } + + [ForeignKey("ObjectCheckedOutByUserId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsUser? ObjectCheckedOutByUser { get; set; } + + [ForeignKey("ObjectCheckedOutVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } + + [ForeignKey("ObjectPublishedVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } + + [ForeignKey("ObjectWorkflowStepId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs index 544e37fe..228272a5 100644 --- a/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsObjectVersionHistory.cs @@ -1,73 +1,72 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ObjectVersionHistory")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] -[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] -public partial class CmsObjectVersionHistory -{ - [Key] - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [InverseProperty("ObjectCheckedOutVersionHistory")] - public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("ObjectPublishedVersionHistory")] - public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionModifiedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] - public virtual CmsUser? VersionModifiedByUser { get; set; } - - [ForeignKey("VersionObjectSiteId")] - [InverseProperty("CmsObjectVersionHistories")] - public virtual CmsSite? VersionObjectSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ObjectVersionHistory")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] +[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] +public class CmsObjectVersionHistory +{ + [Key] + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [InverseProperty("ObjectCheckedOutVersionHistory")] + public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("ObjectPublishedVersionHistory")] + public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionModifiedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] + public virtual CmsUser? VersionModifiedByUser { get; set; } + + [ForeignKey("VersionObjectSiteId")] + [InverseProperty("CmsObjectVersionHistories")] + public virtual CmsSite? VersionObjectSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs index 39fa1d50..e9c82c73 100644 --- a/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs +++ b/Migration.Toolkit.K11/Models/CmsObjectWorkflowTrigger.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ObjectWorkflowTrigger")] -[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] -public partial class CmsObjectWorkflowTrigger -{ - [Key] - [Column("TriggerID")] - public int TriggerId { get; set; } - - [Column("TriggerGUID")] - public Guid TriggerGuid { get; set; } - - public DateTime TriggerLastModified { get; set; } - - public int TriggerType { get; set; } - - public string? TriggerMacroCondition { get; set; } - - [Column("TriggerWorkflowID")] - public int TriggerWorkflowId { get; set; } - - [StringLength(450)] - public string TriggerDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TriggerObjectType { get; set; } = null!; - - public string? TriggerParameters { get; set; } - - [StringLength(100)] - public string? TriggerTargetObjectType { get; set; } - - [Column("TriggerTargetObjectID")] - public int? TriggerTargetObjectId { get; set; } - - [ForeignKey("TriggerWorkflowId")] - [InverseProperty("CmsObjectWorkflowTriggers")] - public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ObjectWorkflowTrigger")] +[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] +public class CmsObjectWorkflowTrigger +{ + [Key] + [Column("TriggerID")] + public int TriggerId { get; set; } + + [Column("TriggerGUID")] + public Guid TriggerGuid { get; set; } + + public DateTime TriggerLastModified { get; set; } + + public int TriggerType { get; set; } + + public string? TriggerMacroCondition { get; set; } + + [Column("TriggerWorkflowID")] + public int TriggerWorkflowId { get; set; } + + [StringLength(450)] + public string TriggerDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TriggerObjectType { get; set; } = null!; + + public string? TriggerParameters { get; set; } + + [StringLength(100)] + public string? TriggerTargetObjectType { get; set; } + + [Column("TriggerTargetObjectID")] + public int? TriggerTargetObjectId { get; set; } + + [ForeignKey("TriggerWorkflowId")] + [InverseProperty("CmsObjectWorkflowTriggers")] + public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsOpenIduser.cs b/Migration.Toolkit.K11/Models/CmsOpenIduser.cs index 6bc7962b..ba85fce2 100644 --- a/Migration.Toolkit.K11/Models/CmsOpenIduser.cs +++ b/Migration.Toolkit.K11/Models/CmsOpenIduser.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_OpenIDUser")] -[Index("OpenId", Name = "IX_CMS_OpenIDUser_OpenID")] -[Index("UserId", Name = "IX_CMS_OpenIDUser_UserID")] -public partial class CmsOpenIduser -{ - [Key] - [Column("OpenIDUserID")] - public int OpenIduserId { get; set; } - - [Column("OpenID")] - public string OpenId { get; set; } = null!; - - [Column("OpenIDProviderURL")] - [StringLength(450)] - public string? OpenIdproviderUrl { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsOpenIdusers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_OpenIDUser")] +[Index("OpenId", Name = "IX_CMS_OpenIDUser_OpenID")] +[Index("UserId", Name = "IX_CMS_OpenIDUser_UserID")] +public class CmsOpenIduser +{ + [Key] + [Column("OpenIDUserID")] + public int OpenIduserId { get; set; } + + [Column("OpenID")] + public string OpenId { get; set; } = null!; + + [Column("OpenIDProviderURL")] + [StringLength(450)] + public string? OpenIdproviderUrl { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsOpenIdusers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplate.cs b/Migration.Toolkit.K11/Models/CmsPageTemplate.cs index 2edf0752..4b16497d 100644 --- a/Migration.Toolkit.K11/Models/CmsPageTemplate.cs +++ b/Migration.Toolkit.K11/Models/CmsPageTemplate.cs @@ -1,142 +1,141 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_PageTemplate")] -[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] -[Index("PageTemplateIsReusable", "PageTemplateForAllPages", "PageTemplateShowAsMasterTemplate", Name = "IX_CMS_PageTemplate_PageTemplateIsReusable_PageTemplateForAllPages_PageTemplateShowAsMasterTemplate")] -[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] -[Index("PageTemplateSiteId", "PageTemplateCodeName", "PageTemplateGuid", Name = "IX_CMS_PageTemplate_PageTemplateSiteID_PageTemplateCodeName_PageTemplateGUID")] -public partial class CmsPageTemplate -{ - [Key] - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [StringLength(200)] - public string PageTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PageTemplateCodeName { get; set; } = null!; - - public string? PageTemplateDescription { get; set; } - - [StringLength(400)] - public string? PageTemplateFile { get; set; } - - [Column("PageTemplateCategoryID")] - public int? PageTemplateCategoryId { get; set; } - - [Column("PageTemplateLayoutID")] - public int? PageTemplateLayoutId { get; set; } - - public string? PageTemplateWebParts { get; set; } - - public bool? PageTemplateIsReusable { get; set; } - - public bool? PageTemplateShowAsMasterTemplate { get; set; } - - [StringLength(200)] - public string? PageTemplateInheritPageLevels { get; set; } - - public string? PageTemplateLayout { get; set; } - - [Column("PageTemplateVersionGUID")] - [StringLength(200)] - public string? PageTemplateVersionGuid { get; set; } - - public string? PageTemplateHeader { get; set; } - - [Column("PageTemplateGUID")] - public Guid PageTemplateGuid { get; set; } - - public DateTime PageTemplateLastModified { get; set; } - - [Column("PageTemplateSiteID")] - public int? PageTemplateSiteId { get; set; } - - public bool? PageTemplateForAllPages { get; set; } - - [StringLength(10)] - public string PageTemplateType { get; set; } = null!; - - [StringLength(50)] - public string? PageTemplateLayoutType { get; set; } - - [Column("PageTemplateCSS")] - public string? PageTemplateCss { get; set; } - - public bool? PageTemplateIsAllowedForProductSection { get; set; } - - public bool? PageTemplateInheritParentHeader { get; set; } - - public bool? PageTemplateAllowInheritHeader { get; set; } - - [Column("PageTemplateThumbnailGUID")] - public Guid? PageTemplateThumbnailGuid { get; set; } - - public bool? PageTemplateCloneAsAdHoc { get; set; } - - [StringLength(200)] - public string? PageTemplateDefaultController { get; set; } - - [StringLength(200)] - public string? PageTemplateDefaultAction { get; set; } - - [Column("PageTemplateNodeGUID")] - public Guid? PageTemplateNodeGuid { get; set; } - - [Column("PageTemplateMasterPageTemplateID")] - public int? PageTemplateMasterPageTemplateId { get; set; } - - public string? PageTemplateProperties { get; set; } - - public bool? PageTemplateIsLayout { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } - - [InverseProperty("ClassDefaultPageTemplate")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("DocumentPageTemplate")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeTemplate")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("PageTemplate")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); - - [InverseProperty("NodeTemplate")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("ElementPageTemplate")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("MvtvariantPageTemplate")] - public virtual ICollection OmMvtvariants { get; set; } = new List(); - - [InverseProperty("VariantPageTemplate")] - public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); - - [ForeignKey("PageTemplateCategoryId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } - - [ForeignKey("PageTemplateLayoutId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } - - [ForeignKey("PageTemplateSiteId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsSite? PageTemplateSite { get; set; } - - [ForeignKey("PageTemplateId")] - [InverseProperty("PageTemplates")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_PageTemplate")] +[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] +[Index("PageTemplateIsReusable", "PageTemplateForAllPages", "PageTemplateShowAsMasterTemplate", Name = "IX_CMS_PageTemplate_PageTemplateIsReusable_PageTemplateForAllPages_PageTemplateShowAsMasterTemplate")] +[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] +[Index("PageTemplateSiteId", "PageTemplateCodeName", "PageTemplateGuid", Name = "IX_CMS_PageTemplate_PageTemplateSiteID_PageTemplateCodeName_PageTemplateGUID")] +public class CmsPageTemplate +{ + [Key] + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [StringLength(200)] + public string PageTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PageTemplateCodeName { get; set; } = null!; + + public string? PageTemplateDescription { get; set; } + + [StringLength(400)] + public string? PageTemplateFile { get; set; } + + [Column("PageTemplateCategoryID")] + public int? PageTemplateCategoryId { get; set; } + + [Column("PageTemplateLayoutID")] + public int? PageTemplateLayoutId { get; set; } + + public string? PageTemplateWebParts { get; set; } + + public bool? PageTemplateIsReusable { get; set; } + + public bool? PageTemplateShowAsMasterTemplate { get; set; } + + [StringLength(200)] + public string? PageTemplateInheritPageLevels { get; set; } + + public string? PageTemplateLayout { get; set; } + + [Column("PageTemplateVersionGUID")] + [StringLength(200)] + public string? PageTemplateVersionGuid { get; set; } + + public string? PageTemplateHeader { get; set; } + + [Column("PageTemplateGUID")] + public Guid PageTemplateGuid { get; set; } + + public DateTime PageTemplateLastModified { get; set; } + + [Column("PageTemplateSiteID")] + public int? PageTemplateSiteId { get; set; } + + public bool? PageTemplateForAllPages { get; set; } + + [StringLength(10)] + public string PageTemplateType { get; set; } = null!; + + [StringLength(50)] + public string? PageTemplateLayoutType { get; set; } + + [Column("PageTemplateCSS")] + public string? PageTemplateCss { get; set; } + + public bool? PageTemplateIsAllowedForProductSection { get; set; } + + public bool? PageTemplateInheritParentHeader { get; set; } + + public bool? PageTemplateAllowInheritHeader { get; set; } + + [Column("PageTemplateThumbnailGUID")] + public Guid? PageTemplateThumbnailGuid { get; set; } + + public bool? PageTemplateCloneAsAdHoc { get; set; } + + [StringLength(200)] + public string? PageTemplateDefaultController { get; set; } + + [StringLength(200)] + public string? PageTemplateDefaultAction { get; set; } + + [Column("PageTemplateNodeGUID")] + public Guid? PageTemplateNodeGuid { get; set; } + + [Column("PageTemplateMasterPageTemplateID")] + public int? PageTemplateMasterPageTemplateId { get; set; } + + public string? PageTemplateProperties { get; set; } + + public bool? PageTemplateIsLayout { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } + + [InverseProperty("ClassDefaultPageTemplate")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("DocumentPageTemplate")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeTemplate")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("PageTemplate")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); + + [InverseProperty("NodeTemplate")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("ElementPageTemplate")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("MvtvariantPageTemplate")] + public virtual ICollection OmMvtvariants { get; set; } = new List(); + + [InverseProperty("VariantPageTemplate")] + public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); + + [ForeignKey("PageTemplateCategoryId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } + + [ForeignKey("PageTemplateLayoutId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } + + [ForeignKey("PageTemplateSiteId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsSite? PageTemplateSite { get; set; } + + [ForeignKey("PageTemplateId")] + [InverseProperty("PageTemplates")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs index b3cfb553..25919b65 100644 --- a/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsPageTemplateCategory.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_PageTemplateCategory")] -[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] -[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] -public partial class CmsPageTemplateCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(200)] - public string? CategoryName { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public string? CategoryPath { get; set; } - - public int? CategoryLevel { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsPageTemplateCategory? CategoryParent { get; set; } - - [InverseProperty("ClassPageTemplateCategory")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("PageTemplateCategory")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_PageTemplateCategory")] +[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] +[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] +public class CmsPageTemplateCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(200)] + public string? CategoryName { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public string? CategoryPath { get; set; } + + public int? CategoryLevel { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsPageTemplateCategory? CategoryParent { get; set; } + + [InverseProperty("ClassPageTemplateCategory")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("PageTemplateCategory")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs b/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs index 465891c0..78e20b05 100644 --- a/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs +++ b/Migration.Toolkit.K11/Models/CmsPageTemplateScope.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_PageTemplateScope")] -[Index("PageTemplateScopeClassId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeClassID")] -[Index("PageTemplateScopeCultureId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeCultureID")] -[Index("PageTemplateScopeLevels", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeLevels")] -[Index("PageTemplateScopeSiteId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeSiteID")] -[Index("PageTemplateScopeTemplateId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeTemplateID")] -public partial class CmsPageTemplateScope -{ - [Key] - [Column("PageTemplateScopeID")] - public int PageTemplateScopeId { get; set; } - - public string PageTemplateScopePath { get; set; } = null!; - - public string? PageTemplateScopeLevels { get; set; } - - [Column("PageTemplateScopeCultureID")] - public int? PageTemplateScopeCultureId { get; set; } - - [Column("PageTemplateScopeClassID")] - public int? PageTemplateScopeClassId { get; set; } - - [Column("PageTemplateScopeTemplateID")] - public int PageTemplateScopeTemplateId { get; set; } - - [Column("PageTemplateScopeSiteID")] - public int? PageTemplateScopeSiteId { get; set; } - - public DateTime PageTemplateScopeLastModified { get; set; } - - [Column("PageTemplateScopeGUID")] - public Guid PageTemplateScopeGuid { get; set; } - - [ForeignKey("PageTemplateScopeClassId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsClass? PageTemplateScopeClass { get; set; } - - [ForeignKey("PageTemplateScopeCultureId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsCulture? PageTemplateScopeCulture { get; set; } - - [ForeignKey("PageTemplateScopeSiteId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsSite? PageTemplateScopeSite { get; set; } - - [ForeignKey("PageTemplateScopeTemplateId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsPageTemplate PageTemplateScopeTemplate { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_PageTemplateScope")] +[Index("PageTemplateScopeClassId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeClassID")] +[Index("PageTemplateScopeCultureId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeCultureID")] +[Index("PageTemplateScopeLevels", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeLevels")] +[Index("PageTemplateScopeSiteId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeSiteID")] +[Index("PageTemplateScopeTemplateId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeTemplateID")] +public class CmsPageTemplateScope +{ + [Key] + [Column("PageTemplateScopeID")] + public int PageTemplateScopeId { get; set; } + + public string PageTemplateScopePath { get; set; } = null!; + + public string? PageTemplateScopeLevels { get; set; } + + [Column("PageTemplateScopeCultureID")] + public int? PageTemplateScopeCultureId { get; set; } + + [Column("PageTemplateScopeClassID")] + public int? PageTemplateScopeClassId { get; set; } + + [Column("PageTemplateScopeTemplateID")] + public int PageTemplateScopeTemplateId { get; set; } + + [Column("PageTemplateScopeSiteID")] + public int? PageTemplateScopeSiteId { get; set; } + + public DateTime PageTemplateScopeLastModified { get; set; } + + [Column("PageTemplateScopeGUID")] + public Guid PageTemplateScopeGuid { get; set; } + + [ForeignKey("PageTemplateScopeClassId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsClass? PageTemplateScopeClass { get; set; } + + [ForeignKey("PageTemplateScopeCultureId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsCulture? PageTemplateScopeCulture { get; set; } + + [ForeignKey("PageTemplateScopeSiteId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsSite? PageTemplateScopeSite { get; set; } + + [ForeignKey("PageTemplateScopeTemplateId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsPageTemplate PageTemplateScopeTemplate { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsPermission.cs b/Migration.Toolkit.K11/Models/CmsPermission.cs index 74584270..c09423ed 100644 --- a/Migration.Toolkit.K11/Models/CmsPermission.cs +++ b/Migration.Toolkit.K11/Models/CmsPermission.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Permission")] -[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] -[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] -public partial class CmsPermission -{ - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [StringLength(100)] - public string PermissionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("ClassID")] - public int? ClassId { get; set; } - - [Column("ResourceID")] - public int? ResourceId { get; set; } - - [Column("PermissionGUID")] - public Guid PermissionGuid { get; set; } - - public DateTime PermissionLastModified { get; set; } - - public string? PermissionDescription { get; set; } - - public bool? PermissionDisplayInMatrix { get; set; } - - public int? PermissionOrder { get; set; } - - public bool? PermissionEditableByGlobalAdmin { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsPermissions")] - public virtual CmsClass? Class { get; set; } - - [InverseProperty("Permission")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("CmsPermissions")] - public virtual CmsResource? Resource { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("Permissions")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Permission")] +[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] +[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] +public class CmsPermission +{ + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [StringLength(100)] + public string PermissionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("ClassID")] + public int? ClassId { get; set; } + + [Column("ResourceID")] + public int? ResourceId { get; set; } + + [Column("PermissionGUID")] + public Guid PermissionGuid { get; set; } + + public DateTime PermissionLastModified { get; set; } + + public string? PermissionDescription { get; set; } + + public bool? PermissionDisplayInMatrix { get; set; } + + public int? PermissionOrder { get; set; } + + public bool? PermissionEditableByGlobalAdmin { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsPermissions")] + public virtual CmsClass? Class { get; set; } + + [InverseProperty("Permission")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("CmsPermissions")] + public virtual CmsResource? Resource { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("Permissions")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsPersonalization.cs b/Migration.Toolkit.K11/Models/CmsPersonalization.cs index 924d6bf2..5e99f210 100644 --- a/Migration.Toolkit.K11/Models/CmsPersonalization.cs +++ b/Migration.Toolkit.K11/Models/CmsPersonalization.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Personalization")] -[Index("PersonalizationId", "PersonalizationUserId", "PersonalizationDocumentId", "PersonalizationDashboardName", Name = "IX_CMS_Personalization_PersonalizationID_PersonalizationUserID_PersonalizationDocumentID_PersonalizationDashboardName", IsUnique = true)] -[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] -[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] -public partial class CmsPersonalization -{ - [Key] - [Column("PersonalizationID")] - public int PersonalizationId { get; set; } - - [Column("PersonalizationGUID")] - public Guid PersonalizationGuid { get; set; } - - public DateTime PersonalizationLastModified { get; set; } - - [Column("PersonalizationUserID")] - public int? PersonalizationUserId { get; set; } - - [Column("PersonalizationDocumentID")] - public int? PersonalizationDocumentId { get; set; } - - public string? PersonalizationWebParts { get; set; } - - [StringLength(200)] - public string? PersonalizationDashboardName { get; set; } - - [Column("PersonalizationSiteID")] - public int? PersonalizationSiteId { get; set; } - - [ForeignKey("PersonalizationDocumentId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsDocument? PersonalizationDocument { get; set; } - - [ForeignKey("PersonalizationSiteId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsSite? PersonalizationSite { get; set; } - - [ForeignKey("PersonalizationUserId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsUser? PersonalizationUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Personalization")] +[Index("PersonalizationId", "PersonalizationUserId", "PersonalizationDocumentId", "PersonalizationDashboardName", Name = "IX_CMS_Personalization_PersonalizationID_PersonalizationUserID_PersonalizationDocumentID_PersonalizationDashboardName", + IsUnique = true)] +[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] +[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] +public class CmsPersonalization +{ + [Key] + [Column("PersonalizationID")] + public int PersonalizationId { get; set; } + + [Column("PersonalizationGUID")] + public Guid PersonalizationGuid { get; set; } + + public DateTime PersonalizationLastModified { get; set; } + + [Column("PersonalizationUserID")] + public int? PersonalizationUserId { get; set; } + + [Column("PersonalizationDocumentID")] + public int? PersonalizationDocumentId { get; set; } + + public string? PersonalizationWebParts { get; set; } + + [StringLength(200)] + public string? PersonalizationDashboardName { get; set; } + + [Column("PersonalizationSiteID")] + public int? PersonalizationSiteId { get; set; } + + [ForeignKey("PersonalizationDocumentId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsDocument? PersonalizationDocument { get; set; } + + [ForeignKey("PersonalizationSiteId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsSite? PersonalizationSite { get; set; } + + [ForeignKey("PersonalizationUserId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsUser? PersonalizationUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsQuery.cs b/Migration.Toolkit.K11/Models/CmsQuery.cs index 5632ca1c..27d89fbc 100644 --- a/Migration.Toolkit.K11/Models/CmsQuery.cs +++ b/Migration.Toolkit.K11/Models/CmsQuery.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Query")] -[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] -public partial class CmsQuery -{ - [Key] - [Column("QueryID")] - public int QueryId { get; set; } - - [StringLength(100)] - public string QueryName { get; set; } = null!; - - [Column("QueryTypeID")] - public int QueryTypeId { get; set; } - - public string QueryText { get; set; } = null!; - - public bool QueryRequiresTransaction { get; set; } - - [Column("ClassID")] - public int? ClassId { get; set; } - - public bool QueryIsLocked { get; set; } - - public DateTime QueryLastModified { get; set; } - - [Column("QueryGUID")] - public Guid QueryGuid { get; set; } - - public bool? QueryIsCustom { get; set; } - - [StringLength(100)] - public string? QueryConnectionString { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsQueries")] - public virtual CmsClass? Class { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Query")] +[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] +public class CmsQuery +{ + [Key] + [Column("QueryID")] + public int QueryId { get; set; } + + [StringLength(100)] + public string QueryName { get; set; } = null!; + + [Column("QueryTypeID")] + public int QueryTypeId { get; set; } + + public string QueryText { get; set; } = null!; + + public bool QueryRequiresTransaction { get; set; } + + [Column("ClassID")] + public int? ClassId { get; set; } + + public bool QueryIsLocked { get; set; } + + public DateTime QueryLastModified { get; set; } + + [Column("QueryGUID")] + public Guid QueryGuid { get; set; } + + public bool? QueryIsCustom { get; set; } + + [StringLength(100)] + public string? QueryConnectionString { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsQueries")] + public virtual CmsClass? Class { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsRelationship.cs b/Migration.Toolkit.K11/Models/CmsRelationship.cs index 6ab0f8cc..2fb77c4c 100644 --- a/Migration.Toolkit.K11/Models/CmsRelationship.cs +++ b/Migration.Toolkit.K11/Models/CmsRelationship.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Relationship")] -[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] -[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] -[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] -public partial class CmsRelationship -{ - [Key] - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - public string? RelationshipCustomData { get; set; } - - public int? RelationshipOrder { get; set; } - - public bool? RelationshipIsAdHoc { get; set; } - - [ForeignKey("LeftNodeId")] - [InverseProperty("CmsRelationshipLeftNodes")] - public virtual CmsTree LeftNode { get; set; } = null!; - - [ForeignKey("RelationshipNameId")] - [InverseProperty("CmsRelationships")] - public virtual CmsRelationshipName RelationshipName { get; set; } = null!; - - [ForeignKey("RightNodeId")] - [InverseProperty("CmsRelationshipRightNodes")] - public virtual CmsTree RightNode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Relationship")] +[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] +[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] +[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] +public class CmsRelationship +{ + [Key] + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + public string? RelationshipCustomData { get; set; } + + public int? RelationshipOrder { get; set; } + + public bool? RelationshipIsAdHoc { get; set; } + + [ForeignKey("LeftNodeId")] + [InverseProperty("CmsRelationshipLeftNodes")] + public virtual CmsTree LeftNode { get; set; } = null!; + + [ForeignKey("RelationshipNameId")] + [InverseProperty("CmsRelationships")] + public virtual CmsRelationshipName RelationshipName { get; set; } = null!; + + [ForeignKey("RightNodeId")] + [InverseProperty("CmsRelationshipRightNodes")] + public virtual CmsTree RightNode { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsRelationshipName.cs b/Migration.Toolkit.K11/Models/CmsRelationshipName.cs index 5edf9012..110e22c3 100644 --- a/Migration.Toolkit.K11/Models/CmsRelationshipName.cs +++ b/Migration.Toolkit.K11/Models/CmsRelationshipName.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_RelationshipName")] -[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] -[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] -public partial class CmsRelationshipName -{ - [Key] - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - public string? RelationshipAllowedObjects { get; set; } - - [Column("RelationshipGUID")] - public Guid RelationshipGuid { get; set; } - - public DateTime RelationshipLastModified { get; set; } - - public bool? RelationshipNameIsAdHoc { get; set; } - - [InverseProperty("RelationshipName")] - public virtual ICollection CmsRelationships { get; set; } = new List(); - - [ForeignKey("RelationshipNameId")] - [InverseProperty("RelationshipNames")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_RelationshipName")] +[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] +[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] +public class CmsRelationshipName +{ + [Key] + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + public string? RelationshipAllowedObjects { get; set; } + + [Column("RelationshipGUID")] + public Guid RelationshipGuid { get; set; } + + public DateTime RelationshipLastModified { get; set; } + + public bool? RelationshipNameIsAdHoc { get; set; } + + [InverseProperty("RelationshipName")] + public virtual ICollection CmsRelationships { get; set; } = new List(); + + [ForeignKey("RelationshipNameId")] + [InverseProperty("RelationshipNames")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsResource.cs b/Migration.Toolkit.K11/Models/CmsResource.cs index 27ddef4c..f65dd291 100644 --- a/Migration.Toolkit.K11/Models/CmsResource.cs +++ b/Migration.Toolkit.K11/Models/CmsResource.cs @@ -1,85 +1,84 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Resource")] -[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] -public partial class CmsResource -{ - [Key] - [Column("ResourceID")] - public int ResourceId { get; set; } - - [StringLength(100)] - public string ResourceDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - public string? ResourceDescription { get; set; } - - public bool? ShowInDevelopment { get; set; } - - [Column("ResourceURL")] - [StringLength(1000)] - public string? ResourceUrl { get; set; } - - [Column("ResourceGUID")] - public Guid ResourceGuid { get; set; } - - public DateTime ResourceLastModified { get; set; } - - public bool? ResourceIsInDevelopment { get; set; } - - public bool? ResourceHasFiles { get; set; } - - [StringLength(200)] - public string? ResourceVersion { get; set; } - - [StringLength(200)] - public string? ResourceAuthor { get; set; } - - [StringLength(50)] - public string? ResourceInstallationState { get; set; } - - [StringLength(50)] - public string? ResourceInstalledVersion { get; set; } - - [InverseProperty("ClassResource")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("UserControlResource")] - public virtual ICollection CmsFormUserControls { get; set; } = new List(); - - [InverseProperty("ModuleLicenseKeyResource")] - public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); - - [InverseProperty("Resource")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("ResourceLibraryResource")] - public virtual ICollection CmsResourceLibraries { get; set; } = new List(); - - [InverseProperty("TaskResource")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("CategoryResource")] - public virtual ICollection CmsSettingsCategories { get; set; } = new List(); - - [InverseProperty("ElementResource")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("WebPartResource")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("ActionResource")] - public virtual ICollection CmsWorkflowActions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("Resources")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Resource")] +[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] +public class CmsResource +{ + [Key] + [Column("ResourceID")] + public int ResourceId { get; set; } + + [StringLength(100)] + public string ResourceDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + public string? ResourceDescription { get; set; } + + public bool? ShowInDevelopment { get; set; } + + [Column("ResourceURL")] + [StringLength(1000)] + public string? ResourceUrl { get; set; } + + [Column("ResourceGUID")] + public Guid ResourceGuid { get; set; } + + public DateTime ResourceLastModified { get; set; } + + public bool? ResourceIsInDevelopment { get; set; } + + public bool? ResourceHasFiles { get; set; } + + [StringLength(200)] + public string? ResourceVersion { get; set; } + + [StringLength(200)] + public string? ResourceAuthor { get; set; } + + [StringLength(50)] + public string? ResourceInstallationState { get; set; } + + [StringLength(50)] + public string? ResourceInstalledVersion { get; set; } + + [InverseProperty("ClassResource")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("UserControlResource")] + public virtual ICollection CmsFormUserControls { get; set; } = new List(); + + [InverseProperty("ModuleLicenseKeyResource")] + public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); + + [InverseProperty("Resource")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("ResourceLibraryResource")] + public virtual ICollection CmsResourceLibraries { get; set; } = new List(); + + [InverseProperty("TaskResource")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("CategoryResource")] + public virtual ICollection CmsSettingsCategories { get; set; } = new List(); + + [InverseProperty("ElementResource")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("WebPartResource")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("ActionResource")] + public virtual ICollection CmsWorkflowActions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("Resources")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs b/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs index 27ff7b32..76616e36 100644 --- a/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs +++ b/Migration.Toolkit.K11/Models/CmsResourceLibrary.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ResourceLibrary")] -[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] -public partial class CmsResourceLibrary -{ - [Key] - [Column("ResourceLibraryID")] - public int ResourceLibraryId { get; set; } - - [Column("ResourceLibraryResourceID")] - public int ResourceLibraryResourceId { get; set; } - - [StringLength(200)] - public string ResourceLibraryPath { get; set; } = null!; - - [ForeignKey("ResourceLibraryResourceId")] - [InverseProperty("CmsResourceLibraries")] - public virtual CmsResource ResourceLibraryResource { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ResourceLibrary")] +[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] +public class CmsResourceLibrary +{ + [Key] + [Column("ResourceLibraryID")] + public int ResourceLibraryId { get; set; } + + [Column("ResourceLibraryResourceID")] + public int ResourceLibraryResourceId { get; set; } + + [StringLength(200)] + public string ResourceLibraryPath { get; set; } = null!; + + [ForeignKey("ResourceLibraryResourceId")] + [InverseProperty("CmsResourceLibraries")] + public virtual CmsResource ResourceLibraryResource { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsResourceString.cs b/Migration.Toolkit.K11/Models/CmsResourceString.cs index 8f7916c9..a9e11cf1 100644 --- a/Migration.Toolkit.K11/Models/CmsResourceString.cs +++ b/Migration.Toolkit.K11/Models/CmsResourceString.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ResourceString")] -[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] -public partial class CmsResourceString -{ - [Key] - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("StringGUID")] - public Guid StringGuid { get; set; } - - [InverseProperty("TranslationString")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ResourceString")] +[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] +public class CmsResourceString +{ + [Key] + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("StringGUID")] + public Guid StringGuid { get; set; } + + [InverseProperty("TranslationString")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs b/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs index 9c3033dd..e5adb900 100644 --- a/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs +++ b/Migration.Toolkit.K11/Models/CmsResourceTranslation.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ResourceTranslation")] -[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] -[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] -public partial class CmsResourceTranslation -{ - [Key] - [Column("TranslationID")] - public int TranslationId { get; set; } - - [Column("TranslationStringID")] - public int TranslationStringId { get; set; } - - public string? TranslationText { get; set; } - - [Column("TranslationCultureID")] - public int TranslationCultureId { get; set; } - - [ForeignKey("TranslationCultureId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsCulture TranslationCulture { get; set; } = null!; - - [ForeignKey("TranslationStringId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsResourceString TranslationString { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ResourceTranslation")] +[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] +[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] +public class CmsResourceTranslation +{ + [Key] + [Column("TranslationID")] + public int TranslationId { get; set; } + + [Column("TranslationStringID")] + public int TranslationStringId { get; set; } + + public string? TranslationText { get; set; } + + [Column("TranslationCultureID")] + public int TranslationCultureId { get; set; } + + [ForeignKey("TranslationCultureId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsCulture TranslationCulture { get; set; } = null!; + + [ForeignKey("TranslationStringId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsResourceString TranslationString { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsRole.cs b/Migration.Toolkit.K11/Models/CmsRole.cs index 4f4b1c69..f1fce13d 100644 --- a/Migration.Toolkit.K11/Models/CmsRole.cs +++ b/Migration.Toolkit.K11/Models/CmsRole.cs @@ -1,98 +1,97 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Role")] -[Index("RoleGroupId", Name = "IX_CMS_Role_RoleGroupID")] -[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] -[Index("SiteId", "RoleName", "RoleGroupId", Name = "IX_CMS_Role_SiteID_RoleName_RoleGroupID", IsUnique = true)] -public partial class CmsRole -{ - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - public DateTime RoleLastModified { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - public bool? RoleIsGroupAdministrator { get; set; } - - public bool? RoleIsDomain { get; set; } - - [InverseProperty("Role")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("RoleGroupId")] - [InverseProperty("CmsRoles")] - public virtual CommunityGroup? RoleGroup { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsRoles")] - public virtual CmsSite? Site { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Boards { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Elements { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("RolesNavigation")] - public virtual ICollection ElementsNavigation { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Forms { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Memberships { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Permissions { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Polls { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Role")] +[Index("RoleGroupId", Name = "IX_CMS_Role_RoleGroupID")] +[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] +[Index("SiteId", "RoleName", "RoleGroupId", Name = "IX_CMS_Role_SiteID_RoleName_RoleGroupID", IsUnique = true)] +public class CmsRole +{ + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + public DateTime RoleLastModified { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + public bool? RoleIsGroupAdministrator { get; set; } + + public bool? RoleIsDomain { get; set; } + + [InverseProperty("Role")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("RoleGroupId")] + [InverseProperty("CmsRoles")] + public virtual CommunityGroup? RoleGroup { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsRoles")] + public virtual CmsSite? Site { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Boards { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Elements { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("RolesNavigation")] + public virtual ICollection ElementsNavigation { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Forms { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Memberships { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Permissions { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Polls { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsScheduledTask.cs b/Migration.Toolkit.K11/Models/CmsScheduledTask.cs index 0fc4e7cc..ed21f4ef 100644 --- a/Migration.Toolkit.K11/Models/CmsScheduledTask.cs +++ b/Migration.Toolkit.K11/Models/CmsScheduledTask.cs @@ -1,112 +1,111 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_ScheduledTask")] -[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] -[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] -[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] -[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] -public partial class CmsScheduledTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(200)] - public string TaskName { get; set; } = null!; - - [StringLength(200)] - public string TaskDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TaskAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string? TaskClass { get; set; } - - [StringLength(1000)] - public string TaskInterval { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime? TaskLastRunTime { get; set; } - - public DateTime? TaskNextRunTime { get; set; } - - public string? TaskLastResult { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - public bool? TaskDeleteAfterLastRun { get; set; } - - [StringLength(100)] - public string? TaskServerName { get; set; } - - [Column("TaskGUID")] - public Guid TaskGuid { get; set; } - - public DateTime TaskLastModified { get; set; } - - public int? TaskExecutions { get; set; } - - [Column("TaskResourceID")] - public int? TaskResourceId { get; set; } - - public bool? TaskRunInSeparateThread { get; set; } - - public bool? TaskUseExternalService { get; set; } - - public bool? TaskAllowExternalService { get; set; } - - public DateTime? TaskLastExecutionReset { get; set; } - - [StringLength(400)] - public string? TaskCondition { get; set; } - - public bool? TaskRunIndividually { get; set; } - - [Column("TaskUserID")] - public int? TaskUserId { get; set; } - - public int? TaskType { get; set; } - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [StringLength(200)] - public string? TaskExecutingServerName { get; set; } - - public bool TaskEnabled { get; set; } - - public bool TaskIsRunning { get; set; } - - [InverseProperty("CampaignScheduledTask")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("TestWinnerScheduledTask")] - public virtual ICollection NewsletterAbtests { get; set; } = new List(); - - [InverseProperty("NewsletterDynamicScheduledTask")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [ForeignKey("TaskResourceId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsResource? TaskResource { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsSite? TaskSite { get; set; } - - [ForeignKey("TaskUserId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsUser? TaskUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_ScheduledTask")] +[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] +[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] +[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] +[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] +public class CmsScheduledTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(200)] + public string TaskName { get; set; } = null!; + + [StringLength(200)] + public string TaskDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TaskAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string? TaskClass { get; set; } + + [StringLength(1000)] + public string TaskInterval { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime? TaskLastRunTime { get; set; } + + public DateTime? TaskNextRunTime { get; set; } + + public string? TaskLastResult { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + public bool? TaskDeleteAfterLastRun { get; set; } + + [StringLength(100)] + public string? TaskServerName { get; set; } + + [Column("TaskGUID")] + public Guid TaskGuid { get; set; } + + public DateTime TaskLastModified { get; set; } + + public int? TaskExecutions { get; set; } + + [Column("TaskResourceID")] + public int? TaskResourceId { get; set; } + + public bool? TaskRunInSeparateThread { get; set; } + + public bool? TaskUseExternalService { get; set; } + + public bool? TaskAllowExternalService { get; set; } + + public DateTime? TaskLastExecutionReset { get; set; } + + [StringLength(400)] + public string? TaskCondition { get; set; } + + public bool? TaskRunIndividually { get; set; } + + [Column("TaskUserID")] + public int? TaskUserId { get; set; } + + public int? TaskType { get; set; } + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [StringLength(200)] + public string? TaskExecutingServerName { get; set; } + + public bool TaskEnabled { get; set; } + + public bool TaskIsRunning { get; set; } + + [InverseProperty("CampaignScheduledTask")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("TestWinnerScheduledTask")] + public virtual ICollection NewsletterAbtests { get; set; } = new List(); + + [InverseProperty("NewsletterDynamicScheduledTask")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [ForeignKey("TaskResourceId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsResource? TaskResource { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsSite? TaskSite { get; set; } + + [ForeignKey("TaskUserId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsUser? TaskUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsSearchEngine.cs b/Migration.Toolkit.K11/Models/CmsSearchEngine.cs index 0c5ef343..df011b4c 100644 --- a/Migration.Toolkit.K11/Models/CmsSearchEngine.cs +++ b/Migration.Toolkit.K11/Models/CmsSearchEngine.cs @@ -1,35 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SearchEngine")] -public partial class CmsSearchEngine -{ - [Key] - [Column("SearchEngineID")] - public int SearchEngineId { get; set; } - - [StringLength(200)] - public string SearchEngineDisplayName { get; set; } = null!; - - [StringLength(200)] - public string SearchEngineName { get; set; } = null!; - - [StringLength(450)] - public string SearchEngineDomainRule { get; set; } = null!; - - [StringLength(200)] - public string? SearchEngineKeywordParameter { get; set; } - - [Column("SearchEngineGUID")] - public Guid SearchEngineGuid { get; set; } - - public DateTime SearchEngineLastModified { get; set; } - - [StringLength(200)] - public string? SearchEngineCrawler { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_SearchEngine")] +public class CmsSearchEngine +{ + [Key] + [Column("SearchEngineID")] + public int SearchEngineId { get; set; } + + [StringLength(200)] + public string SearchEngineDisplayName { get; set; } = null!; + + [StringLength(200)] + public string SearchEngineName { get; set; } = null!; + + [StringLength(450)] + public string SearchEngineDomainRule { get; set; } = null!; + + [StringLength(200)] + public string? SearchEngineKeywordParameter { get; set; } + + [Column("SearchEngineGUID")] + public Guid SearchEngineGuid { get; set; } + + public DateTime SearchEngineLastModified { get; set; } + + [StringLength(200)] + public string? SearchEngineCrawler { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsSearchIndex.cs b/Migration.Toolkit.K11/Models/CmsSearchIndex.cs index f6ec1dea..0c585b1a 100644 --- a/Migration.Toolkit.K11/Models/CmsSearchIndex.cs +++ b/Migration.Toolkit.K11/Models/CmsSearchIndex.cs @@ -1,88 +1,85 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SearchIndex")] -public partial class CmsSearchIndex -{ - [Key] - [Column("IndexID")] - public int IndexId { get; set; } - - [StringLength(200)] - public string IndexName { get; set; } = null!; - - [StringLength(200)] - public string IndexDisplayName { get; set; } = null!; - - [StringLength(200)] - public string? IndexAnalyzerType { get; set; } - - public bool IndexIsCommunityGroup { get; set; } - - public string? IndexSettings { get; set; } - - [Column("IndexGUID")] - public Guid IndexGuid { get; set; } - - public DateTime IndexLastModified { get; set; } - - public DateTime? IndexLastRebuildTime { get; set; } - - [StringLength(200)] - public string IndexType { get; set; } = null!; - - [StringLength(200)] - public string? IndexStopWordsFile { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerAssemblyName { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerClassName { get; set; } - - public int? IndexBatchSize { get; set; } - - [StringLength(10)] - public string? IndexStatus { get; set; } - - public DateTime? IndexLastUpdate { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUserName { get; set; } - - [StringLength(200)] - public string? IndexCrawlerFormsUserName { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUserPassword { get; set; } - - [StringLength(200)] - public string? IndexCrawlerDomain { get; set; } - - public bool? IndexIsOutdated { get; set; } - - [StringLength(200)] - public string IndexProvider { get; set; } = null!; - - [StringLength(200)] - public string? IndexSearchServiceName { get; set; } - - [StringLength(200)] - public string? IndexAdminKey { get; set; } - - [StringLength(200)] - public string? IndexQueryKey { get; set; } - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexCultures { get; set; } = new List(); - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexSites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_SearchIndex")] +public class CmsSearchIndex +{ + [Key] + [Column("IndexID")] + public int IndexId { get; set; } + + [StringLength(200)] + public string IndexName { get; set; } = null!; + + [StringLength(200)] + public string IndexDisplayName { get; set; } = null!; + + [StringLength(200)] + public string? IndexAnalyzerType { get; set; } + + public bool IndexIsCommunityGroup { get; set; } + + public string? IndexSettings { get; set; } + + [Column("IndexGUID")] + public Guid IndexGuid { get; set; } + + public DateTime IndexLastModified { get; set; } + + public DateTime? IndexLastRebuildTime { get; set; } + + [StringLength(200)] + public string IndexType { get; set; } = null!; + + [StringLength(200)] + public string? IndexStopWordsFile { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerAssemblyName { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerClassName { get; set; } + + public int? IndexBatchSize { get; set; } + + [StringLength(10)] + public string? IndexStatus { get; set; } + + public DateTime? IndexLastUpdate { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUserName { get; set; } + + [StringLength(200)] + public string? IndexCrawlerFormsUserName { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUserPassword { get; set; } + + [StringLength(200)] + public string? IndexCrawlerDomain { get; set; } + + public bool? IndexIsOutdated { get; set; } + + [StringLength(200)] + public string IndexProvider { get; set; } = null!; + + [StringLength(200)] + public string? IndexSearchServiceName { get; set; } + + [StringLength(200)] + public string? IndexAdminKey { get; set; } + + [StringLength(200)] + public string? IndexQueryKey { get; set; } + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexCultures { get; set; } = new List(); + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexSites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsSearchTask.cs b/Migration.Toolkit.K11/Models/CmsSearchTask.cs index a268f8a5..f9e5d0d9 100644 --- a/Migration.Toolkit.K11/Models/CmsSearchTask.cs +++ b/Migration.Toolkit.K11/Models/CmsSearchTask.cs @@ -1,42 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SearchTask")] -public partial class CmsSearchTask -{ - [Key] - [Column("SearchTaskID")] - public int SearchTaskId { get; set; } - - [StringLength(100)] - public string SearchTaskType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskField { get; set; } - - [StringLength(600)] - public string SearchTaskValue { get; set; } = null!; - - [StringLength(200)] - public string? SearchTaskServerName { get; set; } - - [StringLength(100)] - public string SearchTaskStatus { get; set; } = null!; - - public int SearchTaskPriority { get; set; } - - public DateTime SearchTaskCreated { get; set; } - - public string? SearchTaskErrorMessage { get; set; } - - [Column("SearchTaskRelatedObjectID")] - public int? SearchTaskRelatedObjectId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_SearchTask")] +public class CmsSearchTask +{ + [Key] + [Column("SearchTaskID")] + public int SearchTaskId { get; set; } + + [StringLength(100)] + public string SearchTaskType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskField { get; set; } + + [StringLength(600)] + public string SearchTaskValue { get; set; } = null!; + + [StringLength(200)] + public string? SearchTaskServerName { get; set; } + + [StringLength(100)] + public string SearchTaskStatus { get; set; } = null!; + + public int SearchTaskPriority { get; set; } + + public DateTime SearchTaskCreated { get; set; } + + public string? SearchTaskErrorMessage { get; set; } + + [Column("SearchTaskRelatedObjectID")] + public int? SearchTaskRelatedObjectId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs index da25189f..f81c530d 100644 --- a/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs +++ b/Migration.Toolkit.K11/Models/CmsSearchTaskAzure.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SearchTaskAzure")] -[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] -public partial class CmsSearchTaskAzure -{ - [Key] - [Column("SearchTaskAzureID")] - public int SearchTaskAzureId { get; set; } - - [StringLength(100)] - public string SearchTaskAzureType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskAzureObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskAzureMetadata { get; set; } - - [StringLength(600)] - public string SearchTaskAzureAdditionalData { get; set; } = null!; - - [Column("SearchTaskAzureInitiatorObjectID")] - public int? SearchTaskAzureInitiatorObjectId { get; set; } - - public int SearchTaskAzurePriority { get; set; } - - public string? SearchTaskAzureErrorMessage { get; set; } - - public DateTime SearchTaskAzureCreated { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_SearchTaskAzure")] +[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] +public class CmsSearchTaskAzure +{ + [Key] + [Column("SearchTaskAzureID")] + public int SearchTaskAzureId { get; set; } + + [StringLength(100)] + public string SearchTaskAzureType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskAzureObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskAzureMetadata { get; set; } + + [StringLength(600)] + public string SearchTaskAzureAdditionalData { get; set; } = null!; + + [Column("SearchTaskAzureInitiatorObjectID")] + public int? SearchTaskAzureInitiatorObjectId { get; set; } + + public int SearchTaskAzurePriority { get; set; } + + public string? SearchTaskAzureErrorMessage { get; set; } + + public DateTime SearchTaskAzureCreated { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsSession.cs b/Migration.Toolkit.K11/Models/CmsSession.cs index cb79580f..469aef7a 100644 --- a/Migration.Toolkit.K11/Models/CmsSession.cs +++ b/Migration.Toolkit.K11/Models/CmsSession.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Session")] -[Index("SessionIdentificator", Name = "IX_CMS_Session_SessionIdentificator", IsUnique = true)] -[Index("SessionSiteId", Name = "IX_CMS_Session_SessionSiteID")] -[Index("SessionUserId", Name = "IX_CMS_Session_SessionUserID")] -[Index("SessionUserIsHidden", Name = "IX_CMS_Session_SessionUserIsHidden")] -public partial class CmsSession -{ - [StringLength(50)] - public string SessionIdentificator { get; set; } = null!; - - [Column("SessionUserID")] - public int? SessionUserId { get; set; } - - [StringLength(450)] - public string? SessionLocation { get; set; } - - public DateTime SessionLastActive { get; set; } - - public DateTime? SessionLastLogon { get; set; } - - public DateTime SessionExpires { get; set; } - - public bool SessionExpired { get; set; } - - [Column("SessionSiteID")] - public int? SessionSiteId { get; set; } - - public bool SessionUserIsHidden { get; set; } - - [StringLength(450)] - public string? SessionFullName { get; set; } - - [StringLength(254)] - public string? SessionEmail { get; set; } - - [StringLength(254)] - public string? SessionUserName { get; set; } - - [StringLength(254)] - public string? SessionNickName { get; set; } - - public DateTime? SessionUserCreated { get; set; } - - [Column("SessionContactID")] - public int? SessionContactId { get; set; } - - [Key] - [Column("SessionID")] - public int SessionId { get; set; } - - [ForeignKey("SessionSiteId")] - [InverseProperty("CmsSessions")] - public virtual CmsSite? SessionSite { get; set; } - - [ForeignKey("SessionUserId")] - [InverseProperty("CmsSessions")] - public virtual CmsUser? SessionUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Session")] +[Index("SessionIdentificator", Name = "IX_CMS_Session_SessionIdentificator", IsUnique = true)] +[Index("SessionSiteId", Name = "IX_CMS_Session_SessionSiteID")] +[Index("SessionUserId", Name = "IX_CMS_Session_SessionUserID")] +[Index("SessionUserIsHidden", Name = "IX_CMS_Session_SessionUserIsHidden")] +public class CmsSession +{ + [StringLength(50)] + public string SessionIdentificator { get; set; } = null!; + + [Column("SessionUserID")] + public int? SessionUserId { get; set; } + + [StringLength(450)] + public string? SessionLocation { get; set; } + + public DateTime SessionLastActive { get; set; } + + public DateTime? SessionLastLogon { get; set; } + + public DateTime SessionExpires { get; set; } + + public bool SessionExpired { get; set; } + + [Column("SessionSiteID")] + public int? SessionSiteId { get; set; } + + public bool SessionUserIsHidden { get; set; } + + [StringLength(450)] + public string? SessionFullName { get; set; } + + [StringLength(254)] + public string? SessionEmail { get; set; } + + [StringLength(254)] + public string? SessionUserName { get; set; } + + [StringLength(254)] + public string? SessionNickName { get; set; } + + public DateTime? SessionUserCreated { get; set; } + + [Column("SessionContactID")] + public int? SessionContactId { get; set; } + + [Key] + [Column("SessionID")] + public int SessionId { get; set; } + + [ForeignKey("SessionSiteId")] + [InverseProperty("CmsSessions")] + public virtual CmsSite? SessionSite { get; set; } + + [ForeignKey("SessionUserId")] + [InverseProperty("CmsSessions")] + public virtual CmsUser? SessionUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs b/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs index 0c2b61cb..cae29e42 100644 --- a/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsSettingsCategory.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SettingsCategory")] -[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] -[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] -public partial class CmsSettingsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - public int? CategoryOrder { get; set; } - - [StringLength(100)] - public string? CategoryName { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - [StringLength(200)] - public string? CategoryIconPath { get; set; } - - public bool? CategoryIsGroup { get; set; } - - public bool? CategoryIsCustom { get; set; } - - [Column("CategoryResourceID")] - public int? CategoryResourceId { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsSettingsCategory? CategoryParent { get; set; } - - [ForeignKey("CategoryResourceId")] - [InverseProperty("CmsSettingsCategories")] - public virtual CmsResource? CategoryResource { get; set; } - - [InverseProperty("KeyCategory")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_SettingsCategory")] +[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] +[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] +public class CmsSettingsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + public int? CategoryOrder { get; set; } + + [StringLength(100)] + public string? CategoryName { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + [StringLength(200)] + public string? CategoryIconPath { get; set; } + + public bool? CategoryIsGroup { get; set; } + + public bool? CategoryIsCustom { get; set; } + + [Column("CategoryResourceID")] + public int? CategoryResourceId { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsSettingsCategory? CategoryParent { get; set; } + + [ForeignKey("CategoryResourceId")] + [InverseProperty("CmsSettingsCategories")] + public virtual CmsResource? CategoryResource { get; set; } + + [InverseProperty("KeyCategory")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsSettingsKey.cs b/Migration.Toolkit.K11/Models/CmsSettingsKey.cs index 04c7dd66..8e263b14 100644 --- a/Migration.Toolkit.K11/Models/CmsSettingsKey.cs +++ b/Migration.Toolkit.K11/Models/CmsSettingsKey.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SettingsKey")] -[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] -[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] -public partial class CmsSettingsKey -{ - [Key] - [Column("KeyID")] - public int KeyId { get; set; } - - [StringLength(100)] - public string KeyName { get; set; } = null!; - - [StringLength(200)] - public string KeyDisplayName { get; set; } = null!; - - public string? KeyDescription { get; set; } - - public string? KeyValue { get; set; } - - [StringLength(50)] - public string KeyType { get; set; } = null!; - - [Column("KeyCategoryID")] - public int? KeyCategoryId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("KeyGUID")] - public Guid KeyGuid { get; set; } - - public DateTime KeyLastModified { get; set; } - - public int? KeyOrder { get; set; } - - public string? KeyDefaultValue { get; set; } - - [StringLength(255)] - public string? KeyValidation { get; set; } - - [StringLength(200)] - public string? KeyEditingControlPath { get; set; } - - public bool? KeyIsGlobal { get; set; } - - public bool? KeyIsCustom { get; set; } - - public bool? KeyIsHidden { get; set; } - - public string? KeyFormControlSettings { get; set; } - - public string? KeyExplanationText { get; set; } - - [ForeignKey("KeyCategoryId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSettingsCategory? KeyCategory { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSite? Site { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_SettingsKey")] +[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] +[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] +public class CmsSettingsKey +{ + [Key] + [Column("KeyID")] + public int KeyId { get; set; } + + [StringLength(100)] + public string KeyName { get; set; } = null!; + + [StringLength(200)] + public string KeyDisplayName { get; set; } = null!; + + public string? KeyDescription { get; set; } + + public string? KeyValue { get; set; } + + [StringLength(50)] + public string KeyType { get; set; } = null!; + + [Column("KeyCategoryID")] + public int? KeyCategoryId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("KeyGUID")] + public Guid KeyGuid { get; set; } + + public DateTime KeyLastModified { get; set; } + + public int? KeyOrder { get; set; } + + public string? KeyDefaultValue { get; set; } + + [StringLength(255)] + public string? KeyValidation { get; set; } + + [StringLength(200)] + public string? KeyEditingControlPath { get; set; } + + public bool? KeyIsGlobal { get; set; } + + public bool? KeyIsCustom { get; set; } + + public bool? KeyIsHidden { get; set; } + + public string? KeyFormControlSettings { get; set; } + + public string? KeyExplanationText { get; set; } + + [ForeignKey("KeyCategoryId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSettingsCategory? KeyCategory { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSite? Site { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsSite.cs b/Migration.Toolkit.K11/Models/CmsSite.cs index 7361480f..970b769a 100644 --- a/Migration.Toolkit.K11/Models/CmsSite.cs +++ b/Migration.Toolkit.K11/Models/CmsSite.cs @@ -1,408 +1,407 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Site")] -[Index("SiteDefaultEditorStylesheet", Name = "IX_CMS_Site_SiteDefaultEditorStylesheet")] -[Index("SiteDefaultStylesheetId", Name = "IX_CMS_Site_SiteDefaultStylesheetID")] -[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] -[Index("SiteName", Name = "IX_CMS_Site_SiteName")] -public partial class CmsSite -{ - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [Column("SiteDefaultStylesheetID")] - public int? SiteDefaultStylesheetId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - public int? SiteDefaultEditorStylesheet { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - public bool? SiteIsOffline { get; set; } - - [Column("SiteOfflineRedirectURL")] - [StringLength(400)] - public string? SiteOfflineRedirectUrl { get; set; } - - public string? SiteOfflineMessage { get; set; } - - [Column("SitePresentationURL")] - [StringLength(400)] - public string? SitePresentationUrl { get; set; } - - public bool? SiteIsContentOnly { get; set; } - - [InverseProperty("CampaignSite")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("ConversionSite")] - public virtual ICollection AnalyticsConversions { get; set; } = new List(); - - [InverseProperty("StatisticsSite")] - public virtual ICollection AnalyticsStatistics { get; set; } = new List(); - - [InverseProperty("BoardSite")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("ChatNotificationSite")] - public virtual ICollection ChatNotifications { get; set; } = new List(); - - [InverseProperty("ChatOnlineSupportSite")] - public virtual ICollection ChatOnlineSupports { get; set; } = new List(); - - [InverseProperty("ChatOnlineUserSite")] - public virtual ICollection ChatOnlineUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomSite")] - public virtual ICollection ChatRooms { get; set; } = new List(); - - [InverseProperty("ChatSupportCannedResponseSite")] - public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); - - [InverseProperty("ReportSite")] - public virtual ICollection CmsAbuseReports { get; set; } = new List(); - - [InverseProperty("Aclsite")] - public virtual ICollection CmsAcls { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("StateSite")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("IpaddressSite")] - public virtual ICollection CmsBannedIps { get; set; } = new List(); - - [InverseProperty("BannerCategorySite")] - public virtual ICollection CmsBannerCategories { get; set; } = new List(); - - [InverseProperty("BannerSite")] - public virtual ICollection CmsBanners { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("AliasSite")] - public virtual ICollection CmsDocumentAliases { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); - - [InverseProperty("EmailTemplateSite")] - public virtual ICollection CmsEmailTemplates { get; set; } = new List(); - - [InverseProperty("FormSite")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("MembershipSite")] - public virtual ICollection CmsMemberships { get; set; } = new List(); - - [InverseProperty("MetaFileSite")] - public virtual ICollection CmsMetaFiles { get; set; } = new List(); - - [InverseProperty("VersionObjectSite")] - public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeSite")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("PageTemplateSite")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("PersonalizationSite")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SessionSite")] - public virtual ICollection CmsSessions { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); - - [InverseProperty("TagGroupSite")] - public virtual ICollection CmsTagGroups { get; set; } = new List(); - - [InverseProperty("NodeLinkedNodeSite")] - public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("BrandSite")] - public virtual ICollection ComBrands { get; set; } = new List(); - - [InverseProperty("CarrierSite")] - public virtual ICollection ComCarriers { get; set; } = new List(); - - [InverseProperty("CollectionSite")] - public virtual ICollection ComCollections { get; set; } = new List(); - - [InverseProperty("CurrencySite")] - public virtual ICollection ComCurrencies { get; set; } = new List(); - - [InverseProperty("EventSite")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("CustomerSite")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("DepartmentSite")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("DiscountSite")] - public virtual ICollection ComDiscounts { get; set; } = new List(); - - [InverseProperty("ExchangeTableSite")] - public virtual ICollection ComExchangeTables { get; set; } = new List(); - - [InverseProperty("GiftCardSite")] - public virtual ICollection ComGiftCards { get; set; } = new List(); - - [InverseProperty("InternalStatusSite")] - public virtual ICollection ComInternalStatuses { get; set; } = new List(); - - [InverseProperty("ManufacturerSite")] - public virtual ICollection ComManufacturers { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountSite")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection ComOptionCategories { get; set; } = new List(); - - [InverseProperty("StatusSite")] - public virtual ICollection ComOrderStatuses { get; set; } = new List(); - - [InverseProperty("OrderSite")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionSite")] - public virtual ICollection ComPaymentOptions { get; set; } = new List(); - - [InverseProperty("PublicStatusSite")] - public virtual ICollection ComPublicStatuses { get; set; } = new List(); - - [InverseProperty("ShippingOptionSite")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("ShoppingCartSite")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("Skusite")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("SupplierSite")] - public virtual ICollection ComSuppliers { get; set; } = new List(); - - [InverseProperty("TaxClassSite")] - public virtual ICollection ComTaxClasses { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("GroupSite")] - public virtual ICollection CommunityGroups { get; set; } = new List(); - - [InverseProperty("ExportSite")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection ExportTasks { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection ForumsAttachments { get; set; } = new List(); - - [InverseProperty("GroupSite")] - public virtual ICollection ForumsForumGroups { get; set; } = new List(); - - [InverseProperty("ForumSite")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection IntegrationTasks { get; set; } = new List(); - - [InverseProperty("FileSite")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("LibrarySite")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); - - [InverseProperty("EmailWidgetSite")] - public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); - - [InverseProperty("EmailSite")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("IssueSite")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterSite")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [InverseProperty("SubscriberSite")] - public virtual ICollection NewsletterSubscribers { get; set; } = new List(); - - [InverseProperty("SubscriptionSite")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NotificationTemplates { get; set; } = new List(); - - [InverseProperty("AbtestSite")] - public virtual ICollection OmAbtests { get; set; } = new List(); - - [InverseProperty("AbvariantSite")] - public virtual ICollection OmAbvariants { get; set; } = new List(); - - [InverseProperty("MvtestSite")] - public virtual ICollection OmMvtests { get; set; } = new List(); - - [InverseProperty("PollSite")] - public virtual ICollection PollsPolls { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionSite")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SharePointConnectionSite")] - public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); - - [InverseProperty("SharePointFileSite")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); - - [InverseProperty("SharePointLibrarySite")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); - - [ForeignKey("SiteDefaultEditorStylesheet")] - [InverseProperty("CmsSiteSiteDefaultEditorStylesheetNavigations")] - public virtual CmsCssStylesheet? SiteDefaultEditorStylesheetNavigation { get; set; } - - [ForeignKey("SiteDefaultStylesheetId")] - [InverseProperty("CmsSiteSiteDefaultStylesheets")] - public virtual CmsCssStylesheet? SiteDefaultStylesheet { get; set; } - - [InverseProperty("FacebookAccountSite")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); - - [InverseProperty("FacebookApplicationSite")] - public virtual ICollection SmFacebookApplications { get; set; } = new List(); - - [InverseProperty("FacebookPostSite")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInApplicationSite")] - public virtual ICollection SmLinkedInApplications { get; set; } = new List(); - - [InverseProperty("LinkedInPostSite")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterAccountSite")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [InverseProperty("TwitterApplicationSite")] - public virtual ICollection SmTwitterApplications { get; set; } = new List(); - - [InverseProperty("TwitterPostSite")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [InverseProperty("ServerSite")] - public virtual ICollection StagingServers { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection StagingTasks { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Classes { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Containers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Cultures { get; set; } = new List(); - - [ForeignKey("IndexSiteId")] - [InverseProperty("IndexSites")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection PageTemplates { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Polls { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection RelationshipNames { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Resources { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Servers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Stylesheets { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Site")] +[Index("SiteDefaultEditorStylesheet", Name = "IX_CMS_Site_SiteDefaultEditorStylesheet")] +[Index("SiteDefaultStylesheetId", Name = "IX_CMS_Site_SiteDefaultStylesheetID")] +[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] +[Index("SiteName", Name = "IX_CMS_Site_SiteName")] +public class CmsSite +{ + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [Column("SiteDefaultStylesheetID")] + public int? SiteDefaultStylesheetId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + public int? SiteDefaultEditorStylesheet { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + public bool? SiteIsOffline { get; set; } + + [Column("SiteOfflineRedirectURL")] + [StringLength(400)] + public string? SiteOfflineRedirectUrl { get; set; } + + public string? SiteOfflineMessage { get; set; } + + [Column("SitePresentationURL")] + [StringLength(400)] + public string? SitePresentationUrl { get; set; } + + public bool? SiteIsContentOnly { get; set; } + + [InverseProperty("CampaignSite")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("ConversionSite")] + public virtual ICollection AnalyticsConversions { get; set; } = new List(); + + [InverseProperty("StatisticsSite")] + public virtual ICollection AnalyticsStatistics { get; set; } = new List(); + + [InverseProperty("BoardSite")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("ChatNotificationSite")] + public virtual ICollection ChatNotifications { get; set; } = new List(); + + [InverseProperty("ChatOnlineSupportSite")] + public virtual ICollection ChatOnlineSupports { get; set; } = new List(); + + [InverseProperty("ChatOnlineUserSite")] + public virtual ICollection ChatOnlineUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomSite")] + public virtual ICollection ChatRooms { get; set; } = new List(); + + [InverseProperty("ChatSupportCannedResponseSite")] + public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); + + [InverseProperty("ReportSite")] + public virtual ICollection CmsAbuseReports { get; set; } = new List(); + + [InverseProperty("Aclsite")] + public virtual ICollection CmsAcls { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("StateSite")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("IpaddressSite")] + public virtual ICollection CmsBannedIps { get; set; } = new List(); + + [InverseProperty("BannerCategorySite")] + public virtual ICollection CmsBannerCategories { get; set; } = new List(); + + [InverseProperty("BannerSite")] + public virtual ICollection CmsBanners { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("AliasSite")] + public virtual ICollection CmsDocumentAliases { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); + + [InverseProperty("EmailTemplateSite")] + public virtual ICollection CmsEmailTemplates { get; set; } = new List(); + + [InverseProperty("FormSite")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("MembershipSite")] + public virtual ICollection CmsMemberships { get; set; } = new List(); + + [InverseProperty("MetaFileSite")] + public virtual ICollection CmsMetaFiles { get; set; } = new List(); + + [InverseProperty("VersionObjectSite")] + public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeSite")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("PageTemplateSite")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("PersonalizationSite")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SessionSite")] + public virtual ICollection CmsSessions { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); + + [InverseProperty("TagGroupSite")] + public virtual ICollection CmsTagGroups { get; set; } = new List(); + + [InverseProperty("NodeLinkedNodeSite")] + public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("BrandSite")] + public virtual ICollection ComBrands { get; set; } = new List(); + + [InverseProperty("CarrierSite")] + public virtual ICollection ComCarriers { get; set; } = new List(); + + [InverseProperty("CollectionSite")] + public virtual ICollection ComCollections { get; set; } = new List(); + + [InverseProperty("CurrencySite")] + public virtual ICollection ComCurrencies { get; set; } = new List(); + + [InverseProperty("EventSite")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("CustomerSite")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("DepartmentSite")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("DiscountSite")] + public virtual ICollection ComDiscounts { get; set; } = new List(); + + [InverseProperty("ExchangeTableSite")] + public virtual ICollection ComExchangeTables { get; set; } = new List(); + + [InverseProperty("GiftCardSite")] + public virtual ICollection ComGiftCards { get; set; } = new List(); + + [InverseProperty("InternalStatusSite")] + public virtual ICollection ComInternalStatuses { get; set; } = new List(); + + [InverseProperty("ManufacturerSite")] + public virtual ICollection ComManufacturers { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountSite")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection ComOptionCategories { get; set; } = new List(); + + [InverseProperty("StatusSite")] + public virtual ICollection ComOrderStatuses { get; set; } = new List(); + + [InverseProperty("OrderSite")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionSite")] + public virtual ICollection ComPaymentOptions { get; set; } = new List(); + + [InverseProperty("PublicStatusSite")] + public virtual ICollection ComPublicStatuses { get; set; } = new List(); + + [InverseProperty("ShippingOptionSite")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("ShoppingCartSite")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("Skusite")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("SupplierSite")] + public virtual ICollection ComSuppliers { get; set; } = new List(); + + [InverseProperty("TaxClassSite")] + public virtual ICollection ComTaxClasses { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("GroupSite")] + public virtual ICollection CommunityGroups { get; set; } = new List(); + + [InverseProperty("ExportSite")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection ExportTasks { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection ForumsAttachments { get; set; } = new List(); + + [InverseProperty("GroupSite")] + public virtual ICollection ForumsForumGroups { get; set; } = new List(); + + [InverseProperty("ForumSite")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection IntegrationTasks { get; set; } = new List(); + + [InverseProperty("FileSite")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("LibrarySite")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); + + [InverseProperty("EmailWidgetSite")] + public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); + + [InverseProperty("EmailSite")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("IssueSite")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterSite")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [InverseProperty("SubscriberSite")] + public virtual ICollection NewsletterSubscribers { get; set; } = new List(); + + [InverseProperty("SubscriptionSite")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NotificationTemplates { get; set; } = new List(); + + [InverseProperty("AbtestSite")] + public virtual ICollection OmAbtests { get; set; } = new List(); + + [InverseProperty("AbvariantSite")] + public virtual ICollection OmAbvariants { get; set; } = new List(); + + [InverseProperty("MvtestSite")] + public virtual ICollection OmMvtests { get; set; } = new List(); + + [InverseProperty("PollSite")] + public virtual ICollection PollsPolls { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionSite")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SharePointConnectionSite")] + public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); + + [InverseProperty("SharePointFileSite")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); + + [InverseProperty("SharePointLibrarySite")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); + + [ForeignKey("SiteDefaultEditorStylesheet")] + [InverseProperty("CmsSiteSiteDefaultEditorStylesheetNavigations")] + public virtual CmsCssStylesheet? SiteDefaultEditorStylesheetNavigation { get; set; } + + [ForeignKey("SiteDefaultStylesheetId")] + [InverseProperty("CmsSiteSiteDefaultStylesheets")] + public virtual CmsCssStylesheet? SiteDefaultStylesheet { get; set; } + + [InverseProperty("FacebookAccountSite")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); + + [InverseProperty("FacebookApplicationSite")] + public virtual ICollection SmFacebookApplications { get; set; } = new List(); + + [InverseProperty("FacebookPostSite")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInApplicationSite")] + public virtual ICollection SmLinkedInApplications { get; set; } = new List(); + + [InverseProperty("LinkedInPostSite")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterAccountSite")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [InverseProperty("TwitterApplicationSite")] + public virtual ICollection SmTwitterApplications { get; set; } = new List(); + + [InverseProperty("TwitterPostSite")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [InverseProperty("ServerSite")] + public virtual ICollection StagingServers { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection StagingTasks { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Classes { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Containers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Cultures { get; set; } = new List(); + + [ForeignKey("IndexSiteId")] + [InverseProperty("IndexSites")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection PageTemplates { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Polls { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection RelationshipNames { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Resources { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Servers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Stylesheets { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs index 61970d96..3f4da1db 100644 --- a/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs +++ b/Migration.Toolkit.K11/Models/CmsSiteDomainAlias.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SiteDomainAlias")] -[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] -[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] -public partial class CmsSiteDomainAlias -{ - [Key] - [Column("SiteDomainAliasID")] - public int SiteDomainAliasId { get; set; } - - [StringLength(400)] - public string SiteDomainAliasName { get; set; } = null!; - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteDomainGUID")] - public Guid? SiteDomainGuid { get; set; } - - public DateTime SiteDomainLastModified { get; set; } - - [StringLength(450)] - public string? SiteDomainDefaultAliasPath { get; set; } - - [StringLength(450)] - public string? SiteDomainRedirectUrl { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSiteDomainAliases")] - public virtual CmsSite Site { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_SiteDomainAlias")] +[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] +[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] +public class CmsSiteDomainAlias +{ + [Key] + [Column("SiteDomainAliasID")] + public int SiteDomainAliasId { get; set; } + + [StringLength(400)] + public string SiteDomainAliasName { get; set; } = null!; + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteDomainGUID")] + public Guid? SiteDomainGuid { get; set; } + + public DateTime SiteDomainLastModified { get; set; } + + [StringLength(450)] + public string? SiteDomainDefaultAliasPath { get; set; } + + [StringLength(450)] + public string? SiteDomainRedirectUrl { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSiteDomainAliases")] + public virtual CmsSite Site { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsSmtpserver.cs b/Migration.Toolkit.K11/Models/CmsSmtpserver.cs index 8d51a3ed..b01ef868 100644 --- a/Migration.Toolkit.K11/Models/CmsSmtpserver.cs +++ b/Migration.Toolkit.K11/Models/CmsSmtpserver.cs @@ -1,47 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_SMTPServer")] -public partial class CmsSmtpserver -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(200)] - public string ServerName { get; set; } = null!; - - [StringLength(50)] - public string? ServerUserName { get; set; } - - [StringLength(200)] - public string? ServerPassword { get; set; } - - [Column("ServerUseSSL")] - public bool ServerUseSsl { get; set; } - - public bool ServerEnabled { get; set; } - - public bool ServerIsGlobal { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public int? ServerPriority { get; set; } - - public int? ServerDeliveryMethod { get; set; } - - [StringLength(450)] - public string? ServerPickupDirectory { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("Servers")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_SMTPServer")] +public class CmsSmtpserver +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(200)] + public string ServerName { get; set; } = null!; + + [StringLength(50)] + public string? ServerUserName { get; set; } + + [StringLength(200)] + public string? ServerPassword { get; set; } + + [Column("ServerUseSSL")] + public bool ServerUseSsl { get; set; } + + public bool ServerEnabled { get; set; } + + public bool ServerIsGlobal { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public int? ServerPriority { get; set; } + + public int? ServerDeliveryMethod { get; set; } + + [StringLength(450)] + public string? ServerPickupDirectory { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("Servers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsState.cs b/Migration.Toolkit.K11/Models/CmsState.cs index b0987fcb..62b74e64 100644 --- a/Migration.Toolkit.K11/Models/CmsState.cs +++ b/Migration.Toolkit.K11/Models/CmsState.cs @@ -1,53 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_State")] -[Index("CountryId", Name = "IX_CMS_State_CountryID")] -[Index("StateCode", Name = "IX_CMS_State_StateCode")] -public partial class CmsState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [StringLength(200)] - public string StateDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StateName { get; set; } = null!; - - [StringLength(100)] - public string? StateCode { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public DateTime StateLastModified { get; set; } - - [InverseProperty("AddressState")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressState")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("State")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("CountryId")] - [InverseProperty("CmsStates")] - public virtual CmsCountry Country { get; set; } = null!; - - [InverseProperty("AccountState")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactState")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_State")] +[Index("CountryId", Name = "IX_CMS_State_CountryID")] +[Index("StateCode", Name = "IX_CMS_State_StateCode")] +public class CmsState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [StringLength(200)] + public string StateDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StateName { get; set; } = null!; + + [StringLength(100)] + public string? StateCode { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public DateTime StateLastModified { get; set; } + + [InverseProperty("AddressState")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressState")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("State")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("CountryId")] + [InverseProperty("CmsStates")] + public virtual CmsCountry Country { get; set; } = null!; + + [InverseProperty("AccountState")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactState")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsTag.cs b/Migration.Toolkit.K11/Models/CmsTag.cs index f4158825..f40434af 100644 --- a/Migration.Toolkit.K11/Models/CmsTag.cs +++ b/Migration.Toolkit.K11/Models/CmsTag.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Tag")] -[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] -public partial class CmsTag -{ - [Key] - [Column("TagID")] - public int TagId { get; set; } - - [StringLength(250)] - public string TagName { get; set; } = null!; - - public int TagCount { get; set; } - - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [Column("TagGUID")] - public Guid TagGuid { get; set; } - - [ForeignKey("TagGroupId")] - [InverseProperty("CmsTags")] - public virtual CmsTagGroup TagGroup { get; set; } = null!; - - [ForeignKey("TagId")] - [InverseProperty("Tags")] - public virtual ICollection Documents { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Tag")] +[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] +public class CmsTag +{ + [Key] + [Column("TagID")] + public int TagId { get; set; } + + [StringLength(250)] + public string TagName { get; set; } = null!; + + public int TagCount { get; set; } + + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [Column("TagGUID")] + public Guid TagGuid { get; set; } + + [ForeignKey("TagGroupId")] + [InverseProperty("CmsTags")] + public virtual CmsTagGroup TagGroup { get; set; } = null!; + + [ForeignKey("TagId")] + [InverseProperty("Tags")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsTagGroup.cs b/Migration.Toolkit.K11/Models/CmsTagGroup.cs index d25b80ad..5a1558fd 100644 --- a/Migration.Toolkit.K11/Models/CmsTagGroup.cs +++ b/Migration.Toolkit.K11/Models/CmsTagGroup.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TagGroup")] -[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] -public partial class CmsTagGroup -{ - [Key] - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [StringLength(250)] - public string TagGroupDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TagGroupName { get; set; } = null!; - - public string? TagGroupDescription { get; set; } - - [Column("TagGroupSiteID")] - public int TagGroupSiteId { get; set; } - - public bool TagGroupIsAdHoc { get; set; } - - public DateTime TagGroupLastModified { get; set; } - - [Column("TagGroupGUID")] - public Guid TagGroupGuid { get; set; } - - [InverseProperty("DocumentTagGroup")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("TagGroup")] - public virtual ICollection CmsTags { get; set; } = new List(); - - [ForeignKey("TagGroupSiteId")] - [InverseProperty("CmsTagGroups")] - public virtual CmsSite TagGroupSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_TagGroup")] +[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] +public class CmsTagGroup +{ + [Key] + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [StringLength(250)] + public string TagGroupDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TagGroupName { get; set; } = null!; + + public string? TagGroupDescription { get; set; } + + [Column("TagGroupSiteID")] + public int TagGroupSiteId { get; set; } + + public bool TagGroupIsAdHoc { get; set; } + + public DateTime TagGroupLastModified { get; set; } + + [Column("TagGroupGUID")] + public Guid TagGroupGuid { get; set; } + + [InverseProperty("DocumentTagGroup")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("TagGroup")] + public virtual ICollection CmsTags { get; set; } = new List(); + + [ForeignKey("TagGroupSiteId")] + [InverseProperty("CmsTagGroups")] + public virtual CmsSite TagGroupSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs b/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs index 6bff5704..3a338089 100644 --- a/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs +++ b/Migration.Toolkit.K11/Models/CmsTemplateDeviceLayout.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TemplateDeviceLayout")] -[Index("LayoutId", Name = "IX_CMS_TemplateDeviceLayout_LayoutID")] -[Index("PageTemplateId", "ProfileId", Name = "IX_CMS_TemplateDeviceLayout_PageTemplateID_ProfileID", IsUnique = true)] -[Index("ProfileId", Name = "IX_CMS_TemplateDeviceLayout_ProfileID")] -public partial class CmsTemplateDeviceLayout -{ - [Key] - [Column("TemplateDeviceLayoutID")] - public int TemplateDeviceLayoutId { get; set; } - - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [Column("ProfileID")] - public int ProfileId { get; set; } - - [Column("LayoutID")] - public int? LayoutId { get; set; } - - public string? LayoutCode { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [ForeignKey("LayoutId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsLayout? Layout { get; set; } - - [ForeignKey("PageTemplateId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsPageTemplate PageTemplate { get; set; } = null!; - - [ForeignKey("ProfileId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsDeviceProfile Profile { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_TemplateDeviceLayout")] +[Index("LayoutId", Name = "IX_CMS_TemplateDeviceLayout_LayoutID")] +[Index("PageTemplateId", "ProfileId", Name = "IX_CMS_TemplateDeviceLayout_PageTemplateID_ProfileID", IsUnique = true)] +[Index("ProfileId", Name = "IX_CMS_TemplateDeviceLayout_ProfileID")] +public class CmsTemplateDeviceLayout +{ + [Key] + [Column("TemplateDeviceLayoutID")] + public int TemplateDeviceLayoutId { get; set; } + + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [Column("ProfileID")] + public int ProfileId { get; set; } + + [Column("LayoutID")] + public int? LayoutId { get; set; } + + public string? LayoutCode { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [ForeignKey("LayoutId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsLayout? Layout { get; set; } + + [ForeignKey("PageTemplateId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsPageTemplate PageTemplate { get; set; } = null!; + + [ForeignKey("ProfileId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsDeviceProfile Profile { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsTimeZone.cs b/Migration.Toolkit.K11/Models/CmsTimeZone.cs index f1322ceb..3a34d358 100644 --- a/Migration.Toolkit.K11/Models/CmsTimeZone.cs +++ b/Migration.Toolkit.K11/Models/CmsTimeZone.cs @@ -1,44 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TimeZone")] -public partial class CmsTimeZone -{ - [Key] - [Column("TimeZoneID")] - public int TimeZoneId { get; set; } - - [StringLength(200)] - public string TimeZoneName { get; set; } = null!; - - [StringLength(200)] - public string TimeZoneDisplayName { get; set; } = null!; - - [Column("TimeZoneGMT")] - public double TimeZoneGmt { get; set; } - - public bool? TimeZoneDaylight { get; set; } - - public DateTime TimeZoneRuleStartIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleStartRule { get; set; } = null!; - - public DateTime TimeZoneRuleEndIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleEndRule { get; set; } = null!; - - [Column("TimeZoneGUID")] - public Guid TimeZoneGuid { get; set; } - - public DateTime TimeZoneLastModified { get; set; } - - [InverseProperty("UserTimeZone")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_TimeZone")] +public class CmsTimeZone +{ + [Key] + [Column("TimeZoneID")] + public int TimeZoneId { get; set; } + + [StringLength(200)] + public string TimeZoneName { get; set; } = null!; + + [StringLength(200)] + public string TimeZoneDisplayName { get; set; } = null!; + + [Column("TimeZoneGMT")] + public double TimeZoneGmt { get; set; } + + public bool? TimeZoneDaylight { get; set; } + + public DateTime TimeZoneRuleStartIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleStartRule { get; set; } = null!; + + public DateTime TimeZoneRuleEndIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleEndRule { get; set; } = null!; + + [Column("TimeZoneGUID")] + public Guid TimeZoneGuid { get; set; } + + public DateTime TimeZoneLastModified { get; set; } + + [InverseProperty("UserTimeZone")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsTransformation.cs b/Migration.Toolkit.K11/Models/CmsTransformation.cs index 7283cddc..0a54be63 100644 --- a/Migration.Toolkit.K11/Models/CmsTransformation.cs +++ b/Migration.Toolkit.K11/Models/CmsTransformation.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Transformation")] -[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] -public partial class CmsTransformation -{ - [Key] - [Column("TransformationID")] - public int TransformationId { get; set; } - - [StringLength(100)] - public string TransformationName { get; set; } = null!; - - public string TransformationCode { get; set; } = null!; - - [StringLength(50)] - public string TransformationType { get; set; } = null!; - - [Column("TransformationClassID")] - public int TransformationClassId { get; set; } - - [Column("TransformationVersionGUID")] - [StringLength(50)] - public string? TransformationVersionGuid { get; set; } - - [Column("TransformationGUID")] - public Guid TransformationGuid { get; set; } - - public DateTime TransformationLastModified { get; set; } - - public bool? TransformationIsHierarchical { get; set; } - - [Column("TransformationHierarchicalXML")] - public string? TransformationHierarchicalXml { get; set; } - - [Column("TransformationCSS")] - public string? TransformationCss { get; set; } - - [StringLength(700)] - public string? TransformationPreferredDocument { get; set; } - - [ForeignKey("TransformationClassId")] - [InverseProperty("CmsTransformations")] - public virtual CmsClass TransformationClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Transformation")] +[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] +public class CmsTransformation +{ + [Key] + [Column("TransformationID")] + public int TransformationId { get; set; } + + [StringLength(100)] + public string TransformationName { get; set; } = null!; + + public string TransformationCode { get; set; } = null!; + + [StringLength(50)] + public string TransformationType { get; set; } = null!; + + [Column("TransformationClassID")] + public int TransformationClassId { get; set; } + + [Column("TransformationVersionGUID")] + [StringLength(50)] + public string? TransformationVersionGuid { get; set; } + + [Column("TransformationGUID")] + public Guid TransformationGuid { get; set; } + + public DateTime TransformationLastModified { get; set; } + + public bool? TransformationIsHierarchical { get; set; } + + [Column("TransformationHierarchicalXML")] + public string? TransformationHierarchicalXml { get; set; } + + [Column("TransformationCSS")] + public string? TransformationCss { get; set; } + + [StringLength(700)] + public string? TransformationPreferredDocument { get; set; } + + [ForeignKey("TransformationClassId")] + [InverseProperty("CmsTransformations")] + public virtual CmsClass TransformationClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsTranslationService.cs b/Migration.Toolkit.K11/Models/CmsTranslationService.cs index 29871da0..d5c774ba 100644 --- a/Migration.Toolkit.K11/Models/CmsTranslationService.cs +++ b/Migration.Toolkit.K11/Models/CmsTranslationService.cs @@ -1,54 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TranslationService")] -public partial class CmsTranslationService -{ - [Key] - [Column("TranslationServiceID")] - public int TranslationServiceId { get; set; } - - [StringLength(200)] - public string TranslationServiceAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceClassName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceDisplayName { get; set; } = null!; - - public bool TranslationServiceIsMachine { get; set; } - - public DateTime TranslationServiceLastModified { get; set; } - - [Column("TranslationServiceGUID")] - public Guid TranslationServiceGuid { get; set; } - - public bool TranslationServiceEnabled { get; set; } - - public bool? TranslationServiceSupportsInstructions { get; set; } - - public bool? TranslationServiceSupportsPriority { get; set; } - - public bool? TranslationServiceSupportsDeadline { get; set; } - - public bool? TranslationServiceGenerateTargetTag { get; set; } - - [StringLength(1000)] - public string? TranslationServiceParameter { get; set; } - - public bool? TranslationServiceSupportsStatusUpdate { get; set; } - - public bool? TranslationServiceSupportsCancel { get; set; } - - [InverseProperty("SubmissionService")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_TranslationService")] +public class CmsTranslationService +{ + [Key] + [Column("TranslationServiceID")] + public int TranslationServiceId { get; set; } + + [StringLength(200)] + public string TranslationServiceAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceClassName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceDisplayName { get; set; } = null!; + + public bool TranslationServiceIsMachine { get; set; } + + public DateTime TranslationServiceLastModified { get; set; } + + [Column("TranslationServiceGUID")] + public Guid TranslationServiceGuid { get; set; } + + public bool TranslationServiceEnabled { get; set; } + + public bool? TranslationServiceSupportsInstructions { get; set; } + + public bool? TranslationServiceSupportsPriority { get; set; } + + public bool? TranslationServiceSupportsDeadline { get; set; } + + public bool? TranslationServiceGenerateTargetTag { get; set; } + + [StringLength(1000)] + public string? TranslationServiceParameter { get; set; } + + public bool? TranslationServiceSupportsStatusUpdate { get; set; } + + public bool? TranslationServiceSupportsCancel { get; set; } + + [InverseProperty("SubmissionService")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs index 1fd8c680..6b136a4a 100644 --- a/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs +++ b/Migration.Toolkit.K11/Models/CmsTranslationSubmission.cs @@ -1,76 +1,75 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TranslationSubmission")] -[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] -[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] -public partial class CmsTranslationSubmission -{ - [Key] - [Column("SubmissionID")] - public int SubmissionId { get; set; } - - [StringLength(200)] - public string SubmissionName { get; set; } = null!; - - [StringLength(200)] - public string? SubmissionTicket { get; set; } - - public int SubmissionStatus { get; set; } - - [Column("SubmissionServiceID")] - public int SubmissionServiceId { get; set; } - - [StringLength(10)] - public string SubmissionSourceCulture { get; set; } = null!; - - public string SubmissionTargetCulture { get; set; } = null!; - - public int SubmissionPriority { get; set; } - - public DateTime? SubmissionDeadline { get; set; } - - [StringLength(500)] - public string? SubmissionInstructions { get; set; } - - public DateTime SubmissionLastModified { get; set; } - - [Column("SubmissionGUID")] - public Guid SubmissionGuid { get; set; } - - [Column("SubmissionSiteID")] - public int? SubmissionSiteId { get; set; } - - public double? SubmissionPrice { get; set; } - - public string? SubmissionStatusMessage { get; set; } - - public bool? SubmissionTranslateAttachments { get; set; } - - public int SubmissionItemCount { get; set; } - - public DateTime SubmissionDate { get; set; } - - public int? SubmissionWordCount { get; set; } - - public int? SubmissionCharCount { get; set; } - - [Column("SubmissionSubmittedByUserID")] - public int? SubmissionSubmittedByUserId { get; set; } - - [InverseProperty("SubmissionItemSubmission")] - public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); - - [ForeignKey("SubmissionServiceId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsTranslationService SubmissionService { get; set; } = null!; - - [ForeignKey("SubmissionSubmittedByUserId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsUser? SubmissionSubmittedByUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_TranslationSubmission")] +[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] +[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] +public class CmsTranslationSubmission +{ + [Key] + [Column("SubmissionID")] + public int SubmissionId { get; set; } + + [StringLength(200)] + public string SubmissionName { get; set; } = null!; + + [StringLength(200)] + public string? SubmissionTicket { get; set; } + + public int SubmissionStatus { get; set; } + + [Column("SubmissionServiceID")] + public int SubmissionServiceId { get; set; } + + [StringLength(10)] + public string SubmissionSourceCulture { get; set; } = null!; + + public string SubmissionTargetCulture { get; set; } = null!; + + public int SubmissionPriority { get; set; } + + public DateTime? SubmissionDeadline { get; set; } + + [StringLength(500)] + public string? SubmissionInstructions { get; set; } + + public DateTime SubmissionLastModified { get; set; } + + [Column("SubmissionGUID")] + public Guid SubmissionGuid { get; set; } + + [Column("SubmissionSiteID")] + public int? SubmissionSiteId { get; set; } + + public double? SubmissionPrice { get; set; } + + public string? SubmissionStatusMessage { get; set; } + + public bool? SubmissionTranslateAttachments { get; set; } + + public int SubmissionItemCount { get; set; } + + public DateTime SubmissionDate { get; set; } + + public int? SubmissionWordCount { get; set; } + + public int? SubmissionCharCount { get; set; } + + [Column("SubmissionSubmittedByUserID")] + public int? SubmissionSubmittedByUserId { get; set; } + + [InverseProperty("SubmissionItemSubmission")] + public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); + + [ForeignKey("SubmissionServiceId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsTranslationService SubmissionService { get; set; } = null!; + + [ForeignKey("SubmissionSubmittedByUserId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsUser? SubmissionSubmittedByUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs index 15a7f688..6ded3322 100644 --- a/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs +++ b/Migration.Toolkit.K11/Models/CmsTranslationSubmissionItem.cs @@ -1,58 +1,57 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_TranslationSubmissionItem")] -[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] -public partial class CmsTranslationSubmissionItem -{ - [Key] - [Column("SubmissionItemID")] - public int SubmissionItemId { get; set; } - - [Column("SubmissionItemSubmissionID")] - public int SubmissionItemSubmissionId { get; set; } - - [Column("SubmissionItemSourceXLIFF")] - public string? SubmissionItemSourceXliff { get; set; } - - [Column("SubmissionItemTargetXLIFF")] - public string? SubmissionItemTargetXliff { get; set; } - - [StringLength(100)] - public string SubmissionItemObjectType { get; set; } = null!; - - [Column("SubmissionItemObjectID")] - public int SubmissionItemObjectId { get; set; } - - [Column("SubmissionItemGUID")] - public Guid SubmissionItemGuid { get; set; } - - public DateTime SubmissionItemLastModified { get; set; } - - [StringLength(200)] - public string SubmissionItemName { get; set; } = null!; - - public int? SubmissionItemWordCount { get; set; } - - public int? SubmissionItemCharCount { get; set; } - - public string? SubmissionItemCustomData { get; set; } - - [Column("SubmissionItemTargetObjectID")] - public int SubmissionItemTargetObjectId { get; set; } - - [StringLength(50)] - public string? SubmissionItemType { get; set; } - - [StringLength(10)] - public string? SubmissionItemTargetCulture { get; set; } - - [ForeignKey("SubmissionItemSubmissionId")] - [InverseProperty("CmsTranslationSubmissionItems")] - public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_TranslationSubmissionItem")] +[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] +public class CmsTranslationSubmissionItem +{ + [Key] + [Column("SubmissionItemID")] + public int SubmissionItemId { get; set; } + + [Column("SubmissionItemSubmissionID")] + public int SubmissionItemSubmissionId { get; set; } + + [Column("SubmissionItemSourceXLIFF")] + public string? SubmissionItemSourceXliff { get; set; } + + [Column("SubmissionItemTargetXLIFF")] + public string? SubmissionItemTargetXliff { get; set; } + + [StringLength(100)] + public string SubmissionItemObjectType { get; set; } = null!; + + [Column("SubmissionItemObjectID")] + public int SubmissionItemObjectId { get; set; } + + [Column("SubmissionItemGUID")] + public Guid SubmissionItemGuid { get; set; } + + public DateTime SubmissionItemLastModified { get; set; } + + [StringLength(200)] + public string SubmissionItemName { get; set; } = null!; + + public int? SubmissionItemWordCount { get; set; } + + public int? SubmissionItemCharCount { get; set; } + + public string? SubmissionItemCustomData { get; set; } + + [Column("SubmissionItemTargetObjectID")] + public int SubmissionItemTargetObjectId { get; set; } + + [StringLength(50)] + public string? SubmissionItemType { get; set; } + + [StringLength(10)] + public string? SubmissionItemTargetCulture { get; set; } + + [ForeignKey("SubmissionItemSubmissionId")] + [InverseProperty("CmsTranslationSubmissionItems")] + public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsTree.cs b/Migration.Toolkit.K11/Models/CmsTree.cs index c587b2f9..73dd0958 100644 --- a/Migration.Toolkit.K11/Models/CmsTree.cs +++ b/Migration.Toolkit.K11/Models/CmsTree.cs @@ -1,184 +1,183 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Tree")] -[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] -[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] -[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] -[Index("NodeGroupId", Name = "IX_CMS_Tree_NodeGroupID")] -[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] -[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] -[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] -[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] -[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] -[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] -[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] -[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] -[Index("NodeTemplateId", Name = "IX_CMS_Tree_NodeTemplateID")] -public partial class CmsTree -{ - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - public int? NodeCacheMinutes { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - public string? NodeDocType { get; set; } - - public string? NodeHeadTags { get; set; } - - public string? NodeBodyElementAttributes { get; set; } - - [StringLength(200)] - public string? NodeInheritPageLevels { get; set; } - - [Column("RequiresSSL")] - public int? RequiresSsl { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeGroupID")] - public int? NodeGroupId { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - [Column("NodeTemplateID")] - public int? NodeTemplateId { get; set; } - - public bool? NodeTemplateForAllCultures { get; set; } - - public bool? NodeInheritPageTemplate { get; set; } - - public bool? NodeAllowCacheInFileSystem { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - public bool NodeIsContentOnly { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - public string? NodeBodyScripts { get; set; } - - [InverseProperty("AliasNode")] - public virtual ICollection CmsDocumentAliases { get; set; } = new List(); - - [InverseProperty("DocumentNode")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("LeftNode")] - public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); - - [InverseProperty("RightNode")] - public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); - - [InverseProperty("Node")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [InverseProperty("AttendeeEventNode")] - public virtual ICollection EventsAttendees { get; set; } = new List(); - - [InverseProperty("NodeLinkedNode")] - public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); - - [InverseProperty("NodeOriginalNode")] - public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); - - [InverseProperty("NodeParent")] - public virtual ICollection InverseNodeParent { get; set; } = new List(); - - [ForeignKey("NodeAclid")] - [InverseProperty("CmsTrees")] - public virtual CmsAcl? NodeAcl { get; set; } - - [ForeignKey("NodeClassId")] - [InverseProperty("CmsTrees")] - public virtual CmsClass NodeClass { get; set; } = null!; - - [ForeignKey("NodeGroupId")] - [InverseProperty("CmsTrees")] - public virtual CommunityGroup? NodeGroup { get; set; } - - [ForeignKey("NodeLinkedNodeId")] - [InverseProperty("InverseNodeLinkedNode")] - public virtual CmsTree? NodeLinkedNode { get; set; } - - [ForeignKey("NodeLinkedNodeSiteId")] - [InverseProperty("CmsTreeNodeLinkedNodeSites")] - public virtual CmsSite? NodeLinkedNodeSite { get; set; } - - [ForeignKey("NodeOriginalNodeId")] - [InverseProperty("InverseNodeOriginalNode")] - public virtual CmsTree? NodeOriginalNode { get; set; } - - [ForeignKey("NodeOwner")] - [InverseProperty("CmsTrees")] - public virtual CmsUser? NodeOwnerNavigation { get; set; } - - [ForeignKey("NodeParentId")] - [InverseProperty("InverseNodeParent")] - public virtual CmsTree? NodeParent { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsTreeNodeSites")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("NodeSkuid")] - [InverseProperty("CmsTrees")] - public virtual ComSku? NodeSku { get; set; } - - [ForeignKey("NodeTemplateId")] - [InverseProperty("CmsTrees")] - public virtual CmsPageTemplate? NodeTemplate { get; set; } - - [InverseProperty("Node")] - public virtual ICollection PersonasPersonaNodes { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Tree")] +[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] +[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] +[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] +[Index("NodeGroupId", Name = "IX_CMS_Tree_NodeGroupID")] +[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] +[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] +[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] +[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] +[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] +[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] +[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] +[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] +[Index("NodeTemplateId", Name = "IX_CMS_Tree_NodeTemplateID")] +public class CmsTree +{ + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + public int? NodeCacheMinutes { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + public string? NodeDocType { get; set; } + + public string? NodeHeadTags { get; set; } + + public string? NodeBodyElementAttributes { get; set; } + + [StringLength(200)] + public string? NodeInheritPageLevels { get; set; } + + [Column("RequiresSSL")] + public int? RequiresSsl { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeGroupID")] + public int? NodeGroupId { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + [Column("NodeTemplateID")] + public int? NodeTemplateId { get; set; } + + public bool? NodeTemplateForAllCultures { get; set; } + + public bool? NodeInheritPageTemplate { get; set; } + + public bool? NodeAllowCacheInFileSystem { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + public bool NodeIsContentOnly { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + public string? NodeBodyScripts { get; set; } + + [InverseProperty("AliasNode")] + public virtual ICollection CmsDocumentAliases { get; set; } = new List(); + + [InverseProperty("DocumentNode")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("LeftNode")] + public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); + + [InverseProperty("RightNode")] + public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); + + [InverseProperty("Node")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [InverseProperty("AttendeeEventNode")] + public virtual ICollection EventsAttendees { get; set; } = new List(); + + [InverseProperty("NodeLinkedNode")] + public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); + + [InverseProperty("NodeOriginalNode")] + public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); + + [InverseProperty("NodeParent")] + public virtual ICollection InverseNodeParent { get; set; } = new List(); + + [ForeignKey("NodeAclid")] + [InverseProperty("CmsTrees")] + public virtual CmsAcl? NodeAcl { get; set; } + + [ForeignKey("NodeClassId")] + [InverseProperty("CmsTrees")] + public virtual CmsClass NodeClass { get; set; } = null!; + + [ForeignKey("NodeGroupId")] + [InverseProperty("CmsTrees")] + public virtual CommunityGroup? NodeGroup { get; set; } + + [ForeignKey("NodeLinkedNodeId")] + [InverseProperty("InverseNodeLinkedNode")] + public virtual CmsTree? NodeLinkedNode { get; set; } + + [ForeignKey("NodeLinkedNodeSiteId")] + [InverseProperty("CmsTreeNodeLinkedNodeSites")] + public virtual CmsSite? NodeLinkedNodeSite { get; set; } + + [ForeignKey("NodeOriginalNodeId")] + [InverseProperty("InverseNodeOriginalNode")] + public virtual CmsTree? NodeOriginalNode { get; set; } + + [ForeignKey("NodeOwner")] + [InverseProperty("CmsTrees")] + public virtual CmsUser? NodeOwnerNavigation { get; set; } + + [ForeignKey("NodeParentId")] + [InverseProperty("InverseNodeParent")] + public virtual CmsTree? NodeParent { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsTreeNodeSites")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("NodeSkuid")] + [InverseProperty("CmsTrees")] + public virtual ComSku? NodeSku { get; set; } + + [ForeignKey("NodeTemplateId")] + [InverseProperty("CmsTrees")] + public virtual CmsPageTemplate? NodeTemplate { get; set; } + + [InverseProperty("Node")] + public virtual ICollection PersonasPersonaNodes { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsUielement.cs b/Migration.Toolkit.K11/Models/CmsUielement.cs index 8cfada8a..bc94cf40 100644 --- a/Migration.Toolkit.K11/Models/CmsUielement.cs +++ b/Migration.Toolkit.K11/Models/CmsUielement.cs @@ -1,116 +1,115 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UIElement")] -[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] -[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] -[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] -public partial class CmsUielement -{ - [Key] - [Column("ElementID")] - public int ElementId { get; set; } - - [StringLength(200)] - public string ElementDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(200)] - public string? ElementCaption { get; set; } - - [Column("ElementTargetURL")] - [StringLength(650)] - public string? ElementTargetUrl { get; set; } - - [Column("ElementResourceID")] - public int ElementResourceId { get; set; } - - [Column("ElementParentID")] - public int? ElementParentId { get; set; } - - public int ElementChildCount { get; set; } - - public int? ElementOrder { get; set; } - - public int ElementLevel { get; set; } - - [Column("ElementIDPath")] - [StringLength(450)] - public string ElementIdpath { get; set; } = null!; - - [StringLength(200)] - public string? ElementIconPath { get; set; } - - public bool? ElementIsCustom { get; set; } - - public DateTime ElementLastModified { get; set; } - - [Column("ElementGUID")] - public Guid ElementGuid { get; set; } - - public int? ElementSize { get; set; } - - public string? ElementDescription { get; set; } - - [StringLength(20)] - public string? ElementFromVersion { get; set; } - - [Column("ElementPageTemplateID")] - public int? ElementPageTemplateId { get; set; } - - [StringLength(50)] - public string? ElementType { get; set; } - - public string? ElementProperties { get; set; } - - public bool? ElementIsMenu { get; set; } - - [StringLength(200)] - public string? ElementFeature { get; set; } - - [StringLength(100)] - public string? ElementIconClass { get; set; } - - public bool? ElementIsGlobalApplication { get; set; } - - public bool? ElementCheckModuleReadPermission { get; set; } - - public string? ElementAccessCondition { get; set; } - - public string? ElementVisibilityCondition { get; set; } - - public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } - - [InverseProperty("HelpTopicUielement")] - public virtual ICollection CmsHelpTopics { get; set; } = new List(); - - [ForeignKey("ElementPageTemplateId")] - [InverseProperty("CmsUielements")] - public virtual CmsPageTemplate? ElementPageTemplate { get; set; } - - [ForeignKey("ElementParentId")] - [InverseProperty("InverseElementParent")] - public virtual CmsUielement? ElementParent { get; set; } - - [ForeignKey("ElementResourceId")] - [InverseProperty("CmsUielements")] - public virtual CmsResource ElementResource { get; set; } = null!; - - [InverseProperty("ElementParent")] - public virtual ICollection InverseElementParent { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("Elements")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("ElementsNavigation")] - public virtual ICollection RolesNavigation { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_UIElement")] +[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] +[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] +[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] +public class CmsUielement +{ + [Key] + [Column("ElementID")] + public int ElementId { get; set; } + + [StringLength(200)] + public string ElementDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(200)] + public string? ElementCaption { get; set; } + + [Column("ElementTargetURL")] + [StringLength(650)] + public string? ElementTargetUrl { get; set; } + + [Column("ElementResourceID")] + public int ElementResourceId { get; set; } + + [Column("ElementParentID")] + public int? ElementParentId { get; set; } + + public int ElementChildCount { get; set; } + + public int? ElementOrder { get; set; } + + public int ElementLevel { get; set; } + + [Column("ElementIDPath")] + [StringLength(450)] + public string ElementIdpath { get; set; } = null!; + + [StringLength(200)] + public string? ElementIconPath { get; set; } + + public bool? ElementIsCustom { get; set; } + + public DateTime ElementLastModified { get; set; } + + [Column("ElementGUID")] + public Guid ElementGuid { get; set; } + + public int? ElementSize { get; set; } + + public string? ElementDescription { get; set; } + + [StringLength(20)] + public string? ElementFromVersion { get; set; } + + [Column("ElementPageTemplateID")] + public int? ElementPageTemplateId { get; set; } + + [StringLength(50)] + public string? ElementType { get; set; } + + public string? ElementProperties { get; set; } + + public bool? ElementIsMenu { get; set; } + + [StringLength(200)] + public string? ElementFeature { get; set; } + + [StringLength(100)] + public string? ElementIconClass { get; set; } + + public bool? ElementIsGlobalApplication { get; set; } + + public bool? ElementCheckModuleReadPermission { get; set; } + + public string? ElementAccessCondition { get; set; } + + public string? ElementVisibilityCondition { get; set; } + + public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } + + [InverseProperty("HelpTopicUielement")] + public virtual ICollection CmsHelpTopics { get; set; } = new List(); + + [ForeignKey("ElementPageTemplateId")] + [InverseProperty("CmsUielements")] + public virtual CmsPageTemplate? ElementPageTemplate { get; set; } + + [ForeignKey("ElementParentId")] + [InverseProperty("InverseElementParent")] + public virtual CmsUielement? ElementParent { get; set; } + + [ForeignKey("ElementResourceId")] + [InverseProperty("CmsUielements")] + public virtual CmsResource ElementResource { get; set; } = null!; + + [InverseProperty("ElementParent")] + public virtual ICollection InverseElementParent { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("Elements")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("ElementsNavigation")] + public virtual ICollection RolesNavigation { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsUser.cs b/Migration.Toolkit.K11/Models/CmsUser.cs index 336bafe0..dbba74b9 100644 --- a/Migration.Toolkit.K11/Models/CmsUser.cs +++ b/Migration.Toolkit.K11/Models/CmsUser.cs @@ -1,340 +1,339 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_User")] -[Index("Email", Name = "IX_CMS_User_Email")] -[Index("FullName", Name = "IX_CMS_User_FullName")] -[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] -[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] -[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] -[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] -public partial class CmsUser -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [InverseProperty("CommentApprovedByUser")] - public virtual ICollection BlogCommentCommentApprovedByUsers { get; set; } = new List(); - - [InverseProperty("CommentUser")] - public virtual ICollection BlogCommentCommentUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); - - [InverseProperty("BoardUser")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("MessageApprovedByUser")] - public virtual ICollection BoardMessageMessageApprovedByUsers { get; set; } = new List(); - - [InverseProperty("MessageUser")] - public virtual ICollection BoardMessageMessageUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection BoardSubscriptions { get; set; } = new List(); - - [InverseProperty("InitiatedChatRequestUser")] - public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); - - [InverseProperty("ChatUserUser")] - public virtual ICollection ChatUsers { get; set; } = new List(); - - [InverseProperty("ReportUser")] - public virtual ICollection CmsAbuseReports { get; set; } = new List(); - - [InverseProperty("LastModifiedByUser")] - public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsAclitemUsers { get; set; } = new List(); - - [InverseProperty("HistoryApprovedByUser")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateUser")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("CategoryUser")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("DocumentCheckedOutByUser")] - public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); - - [InverseProperty("DocumentCreatedByUser")] - public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); - - [InverseProperty("DocumentModifiedByUser")] - public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsExternalLogins { get; set; } = new List(); - - [InverseProperty("MacroIdentityEffectiveUser")] - public virtual ICollection CmsMacroIdentities { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [InverseProperty("ObjectCheckedOutByUser")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("VersionModifiedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsOpenIdusers { get; set; } = new List(); - - [InverseProperty("PersonalizationUser")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("TaskUser")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SessionUser")] - public virtual ICollection CmsSessions { get; set; } = new List(); - - [InverseProperty("SubmissionSubmittedByUser")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); - - [InverseProperty("NodeOwnerNavigation")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("UserMacroIdentityUser")] - public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } - - [InverseProperty("User")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("UserActivatedByUser")] - public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); - - [InverseProperty("UserSettingsUserNavigation")] - public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } - - public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("ModifiedByUser")] - public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("ApprovedByUser")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("CustomerUser")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("ChangedByUser")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [InverseProperty("OrderCreatedByUser")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartUser")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("FriendApprovedByNavigation")] - public virtual ICollection CommunityFriendFriendApprovedByNavigations { get; set; } = new List(); - - [InverseProperty("FriendRejectedByNavigation")] - public virtual ICollection CommunityFriendFriendRejectedByNavigations { get; set; } = new List(); - - [InverseProperty("FriendRequestedUser")] - public virtual ICollection CommunityFriendFriendRequestedUsers { get; set; } = new List(); - - [InverseProperty("FriendUser")] - public virtual ICollection CommunityFriendFriendUsers { get; set; } = new List(); - - [InverseProperty("GroupApprovedByUser")] - public virtual ICollection CommunityGroupGroupApprovedByUsers { get; set; } = new List(); - - [InverseProperty("GroupCreatedByUser")] - public virtual ICollection CommunityGroupGroupCreatedByUsers { get; set; } = new List(); - - [InverseProperty("MemberApprovedByUser")] - public virtual ICollection CommunityGroupMemberMemberApprovedByUsers { get; set; } = new List(); - - [InverseProperty("MemberInvitedByUser")] - public virtual ICollection CommunityGroupMemberMemberInvitedByUsers { get; set; } = new List(); - - [InverseProperty("MemberUser")] - public virtual ICollection CommunityGroupMemberMemberUsers { get; set; } = new List(); - - [InverseProperty("InvitedByUser")] - public virtual ICollection CommunityInvitationInvitedByUsers { get; set; } = new List(); - - [InverseProperty("InvitedUser")] - public virtual ICollection CommunityInvitationInvitedUsers { get; set; } = new List(); - - [InverseProperty("ExportUser")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("PostApprovedByUser")] - public virtual ICollection ForumsForumPostPostApprovedByUsers { get; set; } = new List(); - - [InverseProperty("PostUser")] - public virtual ICollection ForumsForumPostPostUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("FileCreatedByUser")] - public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); - - [InverseProperty("FileModifiedByUser")] - public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); - - [InverseProperty("MessageRecipientUser")] - public virtual ICollection MessagingMessageMessageRecipientUsers { get; set; } = new List(); - - [InverseProperty("MessageSenderUser")] - public virtual ICollection MessagingMessageMessageSenderUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("AccountOwnerUser")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactOwnerUser")] - public virtual ICollection OmContacts { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionUser")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SavedReportCreatedByUser")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); - - [InverseProperty("User")] - public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } - - [InverseProperty("User")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Boards { get; set; } = new List(); - - [ForeignKey("ContactListUserId")] - [InverseProperty("ContactListUsers")] - public virtual ICollection ContactListContactUsers { get; set; } = new List(); - - [ForeignKey("ContactListContactUserId")] - [InverseProperty("ContactListContactUsers")] - public virtual ICollection ContactListUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Forums { get; set; } = new List(); - - [ForeignKey("IgnoreListUserId")] - [InverseProperty("IgnoreListUsers")] - public virtual ICollection IgnoreListIgnoredUsers { get; set; } = new List(); - - [ForeignKey("IgnoreListIgnoredUserId")] - [InverseProperty("IgnoreListIgnoredUsers")] - public virtual ICollection IgnoreListUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Workflows { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_User")] +[Index("Email", Name = "IX_CMS_User_Email")] +[Index("FullName", Name = "IX_CMS_User_FullName")] +[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] +[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] +[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] +[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] +public class CmsUser +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [InverseProperty("CommentApprovedByUser")] + public virtual ICollection BlogCommentCommentApprovedByUsers { get; set; } = new List(); + + [InverseProperty("CommentUser")] + public virtual ICollection BlogCommentCommentUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); + + [InverseProperty("BoardUser")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("MessageApprovedByUser")] + public virtual ICollection BoardMessageMessageApprovedByUsers { get; set; } = new List(); + + [InverseProperty("MessageUser")] + public virtual ICollection BoardMessageMessageUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection BoardSubscriptions { get; set; } = new List(); + + [InverseProperty("InitiatedChatRequestUser")] + public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); + + [InverseProperty("ChatUserUser")] + public virtual ICollection ChatUsers { get; set; } = new List(); + + [InverseProperty("ReportUser")] + public virtual ICollection CmsAbuseReports { get; set; } = new List(); + + [InverseProperty("LastModifiedByUser")] + public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsAclitemUsers { get; set; } = new List(); + + [InverseProperty("HistoryApprovedByUser")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateUser")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("CategoryUser")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("DocumentCheckedOutByUser")] + public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); + + [InverseProperty("DocumentCreatedByUser")] + public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); + + [InverseProperty("DocumentModifiedByUser")] + public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsExternalLogins { get; set; } = new List(); + + [InverseProperty("MacroIdentityEffectiveUser")] + public virtual ICollection CmsMacroIdentities { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [InverseProperty("ObjectCheckedOutByUser")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("VersionModifiedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsOpenIdusers { get; set; } = new List(); + + [InverseProperty("PersonalizationUser")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("TaskUser")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SessionUser")] + public virtual ICollection CmsSessions { get; set; } = new List(); + + [InverseProperty("SubmissionSubmittedByUser")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); + + [InverseProperty("NodeOwnerNavigation")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("UserMacroIdentityUser")] + public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } + + [InverseProperty("User")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("UserActivatedByUser")] + public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); + + [InverseProperty("UserSettingsUserNavigation")] + public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } + + public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("ModifiedByUser")] + public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("ApprovedByUser")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("CustomerUser")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("ChangedByUser")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [InverseProperty("OrderCreatedByUser")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartUser")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("FriendApprovedByNavigation")] + public virtual ICollection CommunityFriendFriendApprovedByNavigations { get; set; } = new List(); + + [InverseProperty("FriendRejectedByNavigation")] + public virtual ICollection CommunityFriendFriendRejectedByNavigations { get; set; } = new List(); + + [InverseProperty("FriendRequestedUser")] + public virtual ICollection CommunityFriendFriendRequestedUsers { get; set; } = new List(); + + [InverseProperty("FriendUser")] + public virtual ICollection CommunityFriendFriendUsers { get; set; } = new List(); + + [InverseProperty("GroupApprovedByUser")] + public virtual ICollection CommunityGroupGroupApprovedByUsers { get; set; } = new List(); + + [InverseProperty("GroupCreatedByUser")] + public virtual ICollection CommunityGroupGroupCreatedByUsers { get; set; } = new List(); + + [InverseProperty("MemberApprovedByUser")] + public virtual ICollection CommunityGroupMemberMemberApprovedByUsers { get; set; } = new List(); + + [InverseProperty("MemberInvitedByUser")] + public virtual ICollection CommunityGroupMemberMemberInvitedByUsers { get; set; } = new List(); + + [InverseProperty("MemberUser")] + public virtual ICollection CommunityGroupMemberMemberUsers { get; set; } = new List(); + + [InverseProperty("InvitedByUser")] + public virtual ICollection CommunityInvitationInvitedByUsers { get; set; } = new List(); + + [InverseProperty("InvitedUser")] + public virtual ICollection CommunityInvitationInvitedUsers { get; set; } = new List(); + + [InverseProperty("ExportUser")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("PostApprovedByUser")] + public virtual ICollection ForumsForumPostPostApprovedByUsers { get; set; } = new List(); + + [InverseProperty("PostUser")] + public virtual ICollection ForumsForumPostPostUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("FileCreatedByUser")] + public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); + + [InverseProperty("FileModifiedByUser")] + public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); + + [InverseProperty("MessageRecipientUser")] + public virtual ICollection MessagingMessageMessageRecipientUsers { get; set; } = new List(); + + [InverseProperty("MessageSenderUser")] + public virtual ICollection MessagingMessageMessageSenderUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("AccountOwnerUser")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactOwnerUser")] + public virtual ICollection OmContacts { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionUser")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SavedReportCreatedByUser")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); + + [InverseProperty("User")] + public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } + + [InverseProperty("User")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Boards { get; set; } = new List(); + + [ForeignKey("ContactListUserId")] + [InverseProperty("ContactListUsers")] + public virtual ICollection ContactListContactUsers { get; set; } = new List(); + + [ForeignKey("ContactListContactUserId")] + [InverseProperty("ContactListContactUsers")] + public virtual ICollection ContactListUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Forums { get; set; } = new List(); + + [ForeignKey("IgnoreListUserId")] + [InverseProperty("IgnoreListUsers")] + public virtual ICollection IgnoreListIgnoredUsers { get; set; } = new List(); + + [ForeignKey("IgnoreListIgnoredUserId")] + [InverseProperty("IgnoreListIgnoredUsers")] + public virtual ICollection IgnoreListUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Workflows { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsUserCulture.cs b/Migration.Toolkit.K11/Models/CmsUserCulture.cs index 82ef7693..fb140775 100644 --- a/Migration.Toolkit.K11/Models/CmsUserCulture.cs +++ b/Migration.Toolkit.K11/Models/CmsUserCulture.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("UserId", "CultureId", "SiteId")] -[Table("CMS_UserCulture")] -[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] -[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] -public partial class CmsUserCulture -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("CultureId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsCulture Culture { get; set; } = null!; - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("UserId", "CultureId", "SiteId")] +[Table("CMS_UserCulture")] +[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] +[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] +public class CmsUserCulture +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("CultureId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsCulture Culture { get; set; } = null!; + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs index 400b0abe..4c4a38c2 100644 --- a/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs +++ b/Migration.Toolkit.K11/Models/CmsUserMacroIdentity.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UserMacroIdentity")] -[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] -[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] -public partial class CmsUserMacroIdentity -{ - [Key] - [Column("UserMacroIdentityID")] - public int UserMacroIdentityId { get; set; } - - public DateTime UserMacroIdentityLastModified { get; set; } - - [Column("UserMacroIdentityUserID")] - public int UserMacroIdentityUserId { get; set; } - - [Column("UserMacroIdentityMacroIdentityID")] - public int? UserMacroIdentityMacroIdentityId { get; set; } - - public Guid UserMacroIdentityUserGuid { get; set; } - - [ForeignKey("UserMacroIdentityMacroIdentityId")] - [InverseProperty("CmsUserMacroIdentities")] - public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } - - [ForeignKey("UserMacroIdentityUserId")] - [InverseProperty("CmsUserMacroIdentity")] - public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_UserMacroIdentity")] +[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] +[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] +public class CmsUserMacroIdentity +{ + [Key] + [Column("UserMacroIdentityID")] + public int UserMacroIdentityId { get; set; } + + public DateTime UserMacroIdentityLastModified { get; set; } + + [Column("UserMacroIdentityUserID")] + public int UserMacroIdentityUserId { get; set; } + + [Column("UserMacroIdentityMacroIdentityID")] + public int? UserMacroIdentityMacroIdentityId { get; set; } + + public Guid UserMacroIdentityUserGuid { get; set; } + + [ForeignKey("UserMacroIdentityMacroIdentityId")] + [InverseProperty("CmsUserMacroIdentities")] + public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } + + [ForeignKey("UserMacroIdentityUserId")] + [InverseProperty("CmsUserMacroIdentity")] + public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsUserRole.cs b/Migration.Toolkit.K11/Models/CmsUserRole.cs index 299c1e95..58e47c17 100644 --- a/Migration.Toolkit.K11/Models/CmsUserRole.cs +++ b/Migration.Toolkit.K11/Models/CmsUserRole.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UserRole")] -[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] -[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] -[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] -public partial class CmsUserRole -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Key] - [Column("UserRoleID")] - public int UserRoleId { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_UserRole")] +[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] +[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] +[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] +public class CmsUserRole +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Key] + [Column("UserRoleID")] + public int UserRoleId { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsUserSetting.cs b/Migration.Toolkit.K11/Models/CmsUserSetting.cs index b4b858a4..3ecfd9c1 100644 --- a/Migration.Toolkit.K11/Models/CmsUserSetting.cs +++ b/Migration.Toolkit.K11/Models/CmsUserSetting.cs @@ -1,171 +1,170 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UserSettings")] -[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] -[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] -[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] -[Index("UserBadgeId", Name = "IX_CMS_UserSettings_UserBadgeID")] -[Index("UserFacebookId", Name = "IX_CMS_UserSettings_UserFacebookID")] -[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] -[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] -[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] -[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] -[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] -[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] -[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] -[Index("WindowsLiveId", Name = "IX_CMS_UserSettings_WindowsLiveID")] -public partial class CmsUserSetting -{ - [Key] - [Column("UserSettingsID")] - public int UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - [StringLength(200)] - public string? UserMessagingNotificationEmail { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [ForeignKey("UserActivatedByUserId")] - [InverseProperty("CmsUserSettingUserActivatedByUsers")] - public virtual CmsUser? UserActivatedByUser { get; set; } - - [ForeignKey("UserAvatarId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsAvatar? UserAvatar { get; set; } - - [ForeignKey("UserBadgeId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsBadge? UserBadge { get; set; } - - public virtual CmsUser UserSettingsUser { get; set; } = null!; - - [ForeignKey("UserSettingsUserId")] - [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] - public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; - - [ForeignKey("UserTimeZoneId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsTimeZone? UserTimeZone { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_UserSettings")] +[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] +[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] +[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] +[Index("UserBadgeId", Name = "IX_CMS_UserSettings_UserBadgeID")] +[Index("UserFacebookId", Name = "IX_CMS_UserSettings_UserFacebookID")] +[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] +[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] +[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] +[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] +[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] +[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] +[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] +[Index("WindowsLiveId", Name = "IX_CMS_UserSettings_WindowsLiveID")] +public class CmsUserSetting +{ + [Key] + [Column("UserSettingsID")] + public int UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + [StringLength(200)] + public string? UserMessagingNotificationEmail { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [ForeignKey("UserActivatedByUserId")] + [InverseProperty("CmsUserSettingUserActivatedByUsers")] + public virtual CmsUser? UserActivatedByUser { get; set; } + + [ForeignKey("UserAvatarId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsAvatar? UserAvatar { get; set; } + + [ForeignKey("UserBadgeId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsBadge? UserBadge { get; set; } + + public virtual CmsUser UserSettingsUser { get; set; } = null!; + + [ForeignKey("UserSettingsUserId")] + [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] + public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; + + [ForeignKey("UserTimeZoneId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsTimeZone? UserTimeZone { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsUserSite.cs b/Migration.Toolkit.K11/Models/CmsUserSite.cs index cd67c5ed..dda4568f 100644 --- a/Migration.Toolkit.K11/Models/CmsUserSite.cs +++ b/Migration.Toolkit.K11/Models/CmsUserSite.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_UserSite")] -[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] -[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] -public partial class CmsUserSite -{ - [Key] - [Column("UserSiteID")] - public int UserSiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserSites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserSites")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_UserSite")] +[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] +[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] +public class CmsUserSite +{ + [Key] + [Column("UserSiteID")] + public int UserSiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserSites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserSites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsVersionHistory.cs b/Migration.Toolkit.K11/Models/CmsVersionHistory.cs index 0ac0f7d1..61e910d3 100644 --- a/Migration.Toolkit.K11/Models/CmsVersionHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsVersionHistory.cs @@ -1,117 +1,116 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_VersionHistory")] -[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] -[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] -[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] -[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] -[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] -public partial class CmsVersionHistory -{ - [Key] - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("DocumentID")] - public int? DocumentId { get; set; } - - [StringLength(450)] - public string DocumentNamePath { get; set; } = null!; - - [Column("NodeXML")] - public string NodeXml { get; set; } = null!; - - [Column("ModifiedByUserID")] - public int? ModifiedByUserId { get; set; } - - public DateTime ModifiedWhen { get; set; } - - [StringLength(50)] - public string? VersionNumber { get; set; } - - public string? VersionComment { get; set; } - - public bool ToBePublished { get; set; } - - public DateTime? PublishFrom { get; set; } - - public DateTime? PublishTo { get; set; } - - public DateTime? WasPublishedFrom { get; set; } - - public DateTime? WasPublishedTo { get; set; } - - [StringLength(100)] - public string? VersionDocumentName { get; set; } - - [StringLength(50)] - public string? VersionDocumentType { get; set; } - - [Column("VersionClassID")] - public int? VersionClassId { get; set; } - - [StringLength(450)] - public string? VersionMenuRedirectUrl { get; set; } - - [Column("VersionWorkflowID")] - public int? VersionWorkflowId { get; set; } - - [Column("VersionWorkflowStepID")] - public int? VersionWorkflowStepId { get; set; } - - [StringLength(450)] - public string? VersionNodeAliasPath { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [InverseProperty("DocumentCheckedOutVersionHistory")] - public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("DocumentPublishedVersionHistory")] - public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); - - [InverseProperty("VersionHistory")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [ForeignKey("ModifiedByUserId")] - [InverseProperty("CmsVersionHistoryModifiedByUsers")] - public virtual CmsUser? ModifiedByUser { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("VersionClassId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsClass? VersionClass { get; set; } - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionWorkflowId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflow? VersionWorkflow { get; set; } - - [ForeignKey("VersionWorkflowStepId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("VersionHistories")] - public virtual ICollection AttachmentHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_VersionHistory")] +[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] +[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] +[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] +[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] +[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] +public class CmsVersionHistory +{ + [Key] + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("DocumentID")] + public int? DocumentId { get; set; } + + [StringLength(450)] + public string DocumentNamePath { get; set; } = null!; + + [Column("NodeXML")] + public string NodeXml { get; set; } = null!; + + [Column("ModifiedByUserID")] + public int? ModifiedByUserId { get; set; } + + public DateTime ModifiedWhen { get; set; } + + [StringLength(50)] + public string? VersionNumber { get; set; } + + public string? VersionComment { get; set; } + + public bool ToBePublished { get; set; } + + public DateTime? PublishFrom { get; set; } + + public DateTime? PublishTo { get; set; } + + public DateTime? WasPublishedFrom { get; set; } + + public DateTime? WasPublishedTo { get; set; } + + [StringLength(100)] + public string? VersionDocumentName { get; set; } + + [StringLength(50)] + public string? VersionDocumentType { get; set; } + + [Column("VersionClassID")] + public int? VersionClassId { get; set; } + + [StringLength(450)] + public string? VersionMenuRedirectUrl { get; set; } + + [Column("VersionWorkflowID")] + public int? VersionWorkflowId { get; set; } + + [Column("VersionWorkflowStepID")] + public int? VersionWorkflowStepId { get; set; } + + [StringLength(450)] + public string? VersionNodeAliasPath { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [InverseProperty("DocumentCheckedOutVersionHistory")] + public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("DocumentPublishedVersionHistory")] + public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); + + [InverseProperty("VersionHistory")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [ForeignKey("ModifiedByUserId")] + [InverseProperty("CmsVersionHistoryModifiedByUsers")] + public virtual CmsUser? ModifiedByUser { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("VersionClassId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsClass? VersionClass { get; set; } + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionWorkflowId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflow? VersionWorkflow { get; set; } + + [ForeignKey("VersionWorkflowStepId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("VersionHistories")] + public virtual ICollection AttachmentHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs index a2637962..91666db4 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmServer.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebFarmServer")] -[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] -public partial class CmsWebFarmServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(300)] - public string ServerDisplayName { get; set; } = null!; - - [StringLength(300)] - public string ServerName { get; set; } = null!; - - [Column("ServerGUID")] - public Guid? ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public bool ServerEnabled { get; set; } - - public bool IsExternalWebAppServer { get; set; } - - [InverseProperty("Server")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebFarmServer")] +[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] +public class CmsWebFarmServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(300)] + public string ServerDisplayName { get; set; } = null!; + + [StringLength(300)] + public string ServerName { get; set; } = null!; + + [Column("ServerGUID")] + public Guid? ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public bool ServerEnabled { get; set; } + + public bool IsExternalWebAppServer { get; set; } + + [InverseProperty("Server")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs index f8f5a419..30dbcabd 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmServerLog.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebFarmServerLog")] -public partial class CmsWebFarmServerLog -{ - [Key] - [Column("WebFarmServerLogID")] - public int WebFarmServerLogId { get; set; } - - public DateTime LogTime { get; set; } - - [StringLength(200)] - public string LogCode { get; set; } = null!; - - [Column("ServerID")] - public int ServerId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebFarmServerLog")] +public class CmsWebFarmServerLog +{ + [Key] + [Column("WebFarmServerLogID")] + public int WebFarmServerLogId { get; set; } + + public DateTime LogTime { get; set; } + + [StringLength(200)] + public string LogCode { get; set; } = null!; + + [Column("ServerID")] + public int ServerId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs index 19613450..ff8aef2e 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmServerMonitoring.cs @@ -1,20 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebFarmServerMonitoring")] -public partial class CmsWebFarmServerMonitoring -{ - [Key] - [Column("WebFarmServerMonitoringID")] - public int WebFarmServerMonitoringId { get; set; } - - [Column("ServerID")] - public int ServerId { get; set; } - - public DateTime? ServerPing { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebFarmServerMonitoring")] +public class CmsWebFarmServerMonitoring +{ + [Key] + [Column("WebFarmServerMonitoringID")] + public int WebFarmServerMonitoringId { get; set; } + + [Column("ServerID")] + public int ServerId { get; set; } + + public DateTime? ServerPing { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs index fa5f285d..f728ca5a 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmServerTask.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("ServerId", "TaskId")] -[Table("CMS_WebFarmServerTask")] -[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] -public partial class CmsWebFarmServerTask -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - public string? ErrorMessage { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmServer Server { get; set; } = null!; - - [ForeignKey("TaskId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmTask Task { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("ServerId", "TaskId")] +[Table("CMS_WebFarmServerTask")] +[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] +public class CmsWebFarmServerTask +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + public string? ErrorMessage { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmServer Server { get; set; } = null!; + + [ForeignKey("TaskId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmTask Task { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs b/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs index fd3bd764..57c2561e 100644 --- a/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs +++ b/Migration.Toolkit.K11/Models/CmsWebFarmTask.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebFarmTask")] -[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] -public partial class CmsWebFarmTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - public string? TaskTextData { get; set; } - - public byte[]? TaskBinaryData { get; set; } - - public DateTime? TaskCreated { get; set; } - - public string? TaskTarget { get; set; } - - [StringLength(450)] - public string? TaskMachineName { get; set; } - - [Column("TaskGUID")] - public Guid? TaskGuid { get; set; } - - public bool? TaskIsAnonymous { get; set; } - - public string? TaskErrorMessage { get; set; } - - public bool? TaskIsMemory { get; set; } - - [InverseProperty("Task")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebFarmTask")] +[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] +public class CmsWebFarmTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + public string? TaskTextData { get; set; } + + public byte[]? TaskBinaryData { get; set; } + + public DateTime? TaskCreated { get; set; } + + public string? TaskTarget { get; set; } + + [StringLength(450)] + public string? TaskMachineName { get; set; } + + [Column("TaskGUID")] + public Guid? TaskGuid { get; set; } + + public bool? TaskIsAnonymous { get; set; } + + public string? TaskErrorMessage { get; set; } + + public bool? TaskIsMemory { get; set; } + + [InverseProperty("Task")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsWebPart.cs b/Migration.Toolkit.K11/Models/CmsWebPart.cs index a16cbeee..27399e74 100644 --- a/Migration.Toolkit.K11/Models/CmsWebPart.cs +++ b/Migration.Toolkit.K11/Models/CmsWebPart.cs @@ -1,86 +1,85 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebPart")] -[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] -[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] -[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] -[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] -public partial class CmsWebPart -{ - [Key] - [Column("WebPartID")] - public int WebPartId { get; set; } - - [StringLength(100)] - public string WebPartName { get; set; } = null!; - - [StringLength(100)] - public string WebPartDisplayName { get; set; } = null!; - - public string? WebPartDescription { get; set; } - - [StringLength(100)] - public string WebPartFileName { get; set; } = null!; - - public string WebPartProperties { get; set; } = null!; - - [Column("WebPartCategoryID")] - public int WebPartCategoryId { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - public string? WebPartDocumentation { get; set; } - - [Column("WebPartGUID")] - public Guid WebPartGuid { get; set; } - - public DateTime WebPartLastModified { get; set; } - - public int? WebPartType { get; set; } - - public string? WebPartDefaultValues { get; set; } - - [Column("WebPartResourceID")] - public int? WebPartResourceId { get; set; } - - [Column("WebPartCSS")] - public string? WebPartCss { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } - - [Column("WebPartThumbnailGUID")] - public Guid? WebPartThumbnailGuid { get; set; } - - public string? WebPartDefaultConfiguration { get; set; } - - [StringLength(200)] - public string? WebPartIconClass { get; set; } - - [InverseProperty("WebPartLayoutWebPart")] - public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); - - [InverseProperty("WidgetWebPart")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WebPartParent")] - public virtual ICollection InverseWebPartParent { get; set; } = new List(); - - [ForeignKey("WebPartCategoryId")] - [InverseProperty("CmsWebParts")] - public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; - - [ForeignKey("WebPartParentId")] - [InverseProperty("InverseWebPartParent")] - public virtual CmsWebPart? WebPartParent { get; set; } - - [ForeignKey("WebPartResourceId")] - [InverseProperty("CmsWebParts")] - public virtual CmsResource? WebPartResource { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebPart")] +[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] +[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] +[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] +[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] +public class CmsWebPart +{ + [Key] + [Column("WebPartID")] + public int WebPartId { get; set; } + + [StringLength(100)] + public string WebPartName { get; set; } = null!; + + [StringLength(100)] + public string WebPartDisplayName { get; set; } = null!; + + public string? WebPartDescription { get; set; } + + [StringLength(100)] + public string WebPartFileName { get; set; } = null!; + + public string WebPartProperties { get; set; } = null!; + + [Column("WebPartCategoryID")] + public int WebPartCategoryId { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + public string? WebPartDocumentation { get; set; } + + [Column("WebPartGUID")] + public Guid WebPartGuid { get; set; } + + public DateTime WebPartLastModified { get; set; } + + public int? WebPartType { get; set; } + + public string? WebPartDefaultValues { get; set; } + + [Column("WebPartResourceID")] + public int? WebPartResourceId { get; set; } + + [Column("WebPartCSS")] + public string? WebPartCss { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } + + [Column("WebPartThumbnailGUID")] + public Guid? WebPartThumbnailGuid { get; set; } + + public string? WebPartDefaultConfiguration { get; set; } + + [StringLength(200)] + public string? WebPartIconClass { get; set; } + + [InverseProperty("WebPartLayoutWebPart")] + public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); + + [InverseProperty("WidgetWebPart")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WebPartParent")] + public virtual ICollection InverseWebPartParent { get; set; } = new List(); + + [ForeignKey("WebPartCategoryId")] + [InverseProperty("CmsWebParts")] + public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; + + [ForeignKey("WebPartParentId")] + [InverseProperty("InverseWebPartParent")] + public virtual CmsWebPart? WebPartParent { get; set; } + + [ForeignKey("WebPartResourceId")] + [InverseProperty("CmsWebParts")] + public virtual CmsResource? WebPartResource { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs b/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs index 863ec020..f4e590d0 100644 --- a/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsWebPartCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebPartCategory")] -[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] -public partial class CmsWebPartCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(100)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(100)] - public string CategoryName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsWebPartCategory? CategoryParent { get; set; } - - [InverseProperty("WebPartCategory")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebPartCategory")] +[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] +public class CmsWebPartCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(100)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(100)] + public string CategoryName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsWebPartCategory? CategoryParent { get; set; } + + [InverseProperty("WebPartCategory")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs b/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs index 9a68f93e..cf7d95eb 100644 --- a/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs +++ b/Migration.Toolkit.K11/Models/CmsWebPartContainer.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebPartContainer")] -[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] -public partial class CmsWebPartContainer -{ - [Key] - [Column("ContainerID")] - public int ContainerId { get; set; } - - [StringLength(200)] - public string ContainerDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContainerName { get; set; } = null!; - - public string? ContainerTextBefore { get; set; } - - public string? ContainerTextAfter { get; set; } - - [Column("ContainerGUID")] - public Guid ContainerGuid { get; set; } - - public DateTime ContainerLastModified { get; set; } - - [Column("ContainerCSS")] - public string? ContainerCss { get; set; } - - [ForeignKey("ContainerId")] - [InverseProperty("Containers")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebPartContainer")] +[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] +public class CmsWebPartContainer +{ + [Key] + [Column("ContainerID")] + public int ContainerId { get; set; } + + [StringLength(200)] + public string ContainerDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContainerName { get; set; } = null!; + + public string? ContainerTextBefore { get; set; } + + public string? ContainerTextAfter { get; set; } + + [Column("ContainerGUID")] + public Guid ContainerGuid { get; set; } + + public DateTime ContainerLastModified { get; set; } + + [Column("ContainerCSS")] + public string? ContainerCss { get; set; } + + [ForeignKey("ContainerId")] + [InverseProperty("Containers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs b/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs index 3e7af7c9..a88bb1e6 100644 --- a/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs +++ b/Migration.Toolkit.K11/Models/CmsWebPartLayout.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebPartLayout")] -[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] -public partial class CmsWebPartLayout -{ - [Key] - [Column("WebPartLayoutID")] - public int WebPartLayoutId { get; set; } - - [StringLength(200)] - public string WebPartLayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string WebPartLayoutDisplayName { get; set; } = null!; - - public string? WebPartLayoutDescription { get; set; } - - public string? WebPartLayoutCode { get; set; } - - [Column("WebPartLayoutVersionGUID")] - [StringLength(100)] - public string? WebPartLayoutVersionGuid { get; set; } - - [Column("WebPartLayoutWebPartID")] - public int WebPartLayoutWebPartId { get; set; } - - [Column("WebPartLayoutGUID")] - public Guid WebPartLayoutGuid { get; set; } - - public DateTime WebPartLayoutLastModified { get; set; } - - [Column("WebPartLayoutCSS")] - public string? WebPartLayoutCss { get; set; } - - public bool? WebPartLayoutIsDefault { get; set; } - - [InverseProperty("WidgetLayout")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [ForeignKey("WebPartLayoutWebPartId")] - [InverseProperty("CmsWebPartLayouts")] - public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebPartLayout")] +[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] +public class CmsWebPartLayout +{ + [Key] + [Column("WebPartLayoutID")] + public int WebPartLayoutId { get; set; } + + [StringLength(200)] + public string WebPartLayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string WebPartLayoutDisplayName { get; set; } = null!; + + public string? WebPartLayoutDescription { get; set; } + + public string? WebPartLayoutCode { get; set; } + + [Column("WebPartLayoutVersionGUID")] + [StringLength(100)] + public string? WebPartLayoutVersionGuid { get; set; } + + [Column("WebPartLayoutWebPartID")] + public int WebPartLayoutWebPartId { get; set; } + + [Column("WebPartLayoutGUID")] + public Guid WebPartLayoutGuid { get; set; } + + public DateTime WebPartLayoutLastModified { get; set; } + + [Column("WebPartLayoutCSS")] + public string? WebPartLayoutCss { get; set; } + + public bool? WebPartLayoutIsDefault { get; set; } + + [InverseProperty("WidgetLayout")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [ForeignKey("WebPartLayoutWebPartId")] + [InverseProperty("CmsWebPartLayouts")] + public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWebTemplate.cs b/Migration.Toolkit.K11/Models/CmsWebTemplate.cs index 57ef216f..4a057695 100644 --- a/Migration.Toolkit.K11/Models/CmsWebTemplate.cs +++ b/Migration.Toolkit.K11/Models/CmsWebTemplate.cs @@ -1,41 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WebTemplate")] -public partial class CmsWebTemplate -{ - [Key] - [Column("WebTemplateID")] - public int WebTemplateId { get; set; } - - [StringLength(200)] - public string WebTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WebTemplateFileName { get; set; } = null!; - - public string WebTemplateDescription { get; set; } = null!; - - [Column("WebTemplateGUID")] - public Guid WebTemplateGuid { get; set; } - - public DateTime WebTemplateLastModified { get; set; } - - [StringLength(100)] - public string WebTemplateName { get; set; } = null!; - - public int WebTemplateOrder { get; set; } - - [StringLength(200)] - public string WebTemplateLicenses { get; set; } = null!; - - [Column("WebTemplateThumbnailGUID")] - public Guid? WebTemplateThumbnailGuid { get; set; } - - public string? WebTemplateShortDescription { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WebTemplate")] +public class CmsWebTemplate +{ + [Key] + [Column("WebTemplateID")] + public int WebTemplateId { get; set; } + + [StringLength(200)] + public string WebTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WebTemplateFileName { get; set; } = null!; + + public string WebTemplateDescription { get; set; } = null!; + + [Column("WebTemplateGUID")] + public Guid WebTemplateGuid { get; set; } + + public DateTime WebTemplateLastModified { get; set; } + + [StringLength(100)] + public string WebTemplateName { get; set; } = null!; + + public int WebTemplateOrder { get; set; } + + [StringLength(200)] + public string WebTemplateLicenses { get; set; } = null!; + + [Column("WebTemplateThumbnailGUID")] + public Guid? WebTemplateThumbnailGuid { get; set; } + + public string? WebTemplateShortDescription { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsWidget.cs b/Migration.Toolkit.K11/Models/CmsWidget.cs index f6928baa..eabc6e03 100644 --- a/Migration.Toolkit.K11/Models/CmsWidget.cs +++ b/Migration.Toolkit.K11/Models/CmsWidget.cs @@ -1,84 +1,83 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Widget")] -[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] -[Index("WidgetIsEnabled", "WidgetForGroup", "WidgetForEditor", "WidgetForUser", Name = "IX_CMS_Widget_WidgetIsEnabled_WidgetForGroup_WidgetForEditor_WidgetForUser")] -[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] -[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] -public partial class CmsWidget -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Column("WidgetWebPartID")] - public int WidgetWebPartId { get; set; } - - [StringLength(100)] - public string WidgetDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WidgetName { get; set; } = null!; - - public string? WidgetDescription { get; set; } - - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - public string? WidgetProperties { get; set; } - - public int WidgetSecurity { get; set; } - - [Column("WidgetGUID")] - public Guid WidgetGuid { get; set; } - - public DateTime WidgetLastModified { get; set; } - - public bool WidgetIsEnabled { get; set; } - - public bool WidgetForGroup { get; set; } - - public bool WidgetForEditor { get; set; } - - public bool WidgetForUser { get; set; } - - public bool WidgetForDashboard { get; set; } - - public bool WidgetForInline { get; set; } - - public string? WidgetDocumentation { get; set; } - - public string? WidgetDefaultValues { get; set; } - - [Column("WidgetLayoutID")] - public int? WidgetLayoutId { get; set; } - - public bool? WidgetSkipInsertProperties { get; set; } - - [Column("WidgetThumbnailGUID")] - public Guid? WidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? WidgetIconClass { get; set; } - - [InverseProperty("Widget")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [ForeignKey("WidgetCategoryId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; - - [ForeignKey("WidgetLayoutId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPartLayout? WidgetLayout { get; set; } - - [ForeignKey("WidgetWebPartId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPart WidgetWebPart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Widget")] +[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] +[Index("WidgetIsEnabled", "WidgetForGroup", "WidgetForEditor", "WidgetForUser", Name = "IX_CMS_Widget_WidgetIsEnabled_WidgetForGroup_WidgetForEditor_WidgetForUser")] +[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] +[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] +public class CmsWidget +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Column("WidgetWebPartID")] + public int WidgetWebPartId { get; set; } + + [StringLength(100)] + public string WidgetDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WidgetName { get; set; } = null!; + + public string? WidgetDescription { get; set; } + + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + public string? WidgetProperties { get; set; } + + public int WidgetSecurity { get; set; } + + [Column("WidgetGUID")] + public Guid WidgetGuid { get; set; } + + public DateTime WidgetLastModified { get; set; } + + public bool WidgetIsEnabled { get; set; } + + public bool WidgetForGroup { get; set; } + + public bool WidgetForEditor { get; set; } + + public bool WidgetForUser { get; set; } + + public bool WidgetForDashboard { get; set; } + + public bool WidgetForInline { get; set; } + + public string? WidgetDocumentation { get; set; } + + public string? WidgetDefaultValues { get; set; } + + [Column("WidgetLayoutID")] + public int? WidgetLayoutId { get; set; } + + public bool? WidgetSkipInsertProperties { get; set; } + + [Column("WidgetThumbnailGUID")] + public Guid? WidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? WidgetIconClass { get; set; } + + [InverseProperty("Widget")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [ForeignKey("WidgetCategoryId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; + + [ForeignKey("WidgetLayoutId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPartLayout? WidgetLayout { get; set; } + + [ForeignKey("WidgetWebPartId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPart WidgetWebPart { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs b/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs index b021934f..c986262e 100644 --- a/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs +++ b/Migration.Toolkit.K11/Models/CmsWidgetCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WidgetCategory")] -[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] -public partial class CmsWidgetCategory -{ - [Key] - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - [StringLength(100)] - public string WidgetCategoryName { get; set; } = null!; - - [StringLength(100)] - public string WidgetCategoryDisplayName { get; set; } = null!; - - [Column("WidgetCategoryParentID")] - public int? WidgetCategoryParentId { get; set; } - - public string WidgetCategoryPath { get; set; } = null!; - - public int WidgetCategoryLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [Column("WidgetCategoryGUID")] - public Guid WidgetCategoryGuid { get; set; } - - public DateTime WidgetCategoryLastModified { get; set; } - - [InverseProperty("WidgetCategory")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WidgetCategoryParent")] - public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); - - [ForeignKey("WidgetCategoryParentId")] - [InverseProperty("InverseWidgetCategoryParent")] - public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WidgetCategory")] +[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] +public class CmsWidgetCategory +{ + [Key] + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + [StringLength(100)] + public string WidgetCategoryName { get; set; } = null!; + + [StringLength(100)] + public string WidgetCategoryDisplayName { get; set; } = null!; + + [Column("WidgetCategoryParentID")] + public int? WidgetCategoryParentId { get; set; } + + public string WidgetCategoryPath { get; set; } = null!; + + public int WidgetCategoryLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [Column("WidgetCategoryGUID")] + public Guid WidgetCategoryGuid { get; set; } + + public DateTime WidgetCategoryLastModified { get; set; } + + [InverseProperty("WidgetCategory")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WidgetCategoryParent")] + public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); + + [ForeignKey("WidgetCategoryParentId")] + [InverseProperty("InverseWidgetCategoryParent")] + public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CmsWidgetRole.cs b/Migration.Toolkit.K11/Models/CmsWidgetRole.cs index 1869d660..4f49f70b 100644 --- a/Migration.Toolkit.K11/Models/CmsWidgetRole.cs +++ b/Migration.Toolkit.K11/Models/CmsWidgetRole.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("WidgetId", "RoleId", "PermissionId")] -[Table("CMS_WidgetRole")] -[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] -[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] -public partial class CmsWidgetRole -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("WidgetId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsWidget Widget { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("WidgetId", "RoleId", "PermissionId")] +[Table("CMS_WidgetRole")] +[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] +[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] +public class CmsWidgetRole +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("WidgetId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsWidget Widget { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflow.cs b/Migration.Toolkit.K11/Models/CmsWorkflow.cs index 771e173c..2652ebf3 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflow.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflow.cs @@ -1,96 +1,93 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_Workflow")] -public partial class CmsWorkflow -{ - [Key] - [Column("WorkflowID")] - public int WorkflowId { get; set; } - - public string WorkflowDisplayName { get; set; } = null!; - - [StringLength(450)] - public string WorkflowName { get; set; } = null!; - - [Column("WorkflowGUID")] - public Guid WorkflowGuid { get; set; } - - public DateTime WorkflowLastModified { get; set; } - - public bool? WorkflowAutoPublishChanges { get; set; } - - public bool? WorkflowUseCheckinCheckout { get; set; } - - public int? WorkflowType { get; set; } - - public bool? WorkflowSendEmails { get; set; } - - public bool? WorkflowSendApproveEmails { get; set; } - - public bool? WorkflowSendRejectEmails { get; set; } - - public bool? WorkflowSendPublishEmails { get; set; } - - public bool? WorkflowSendArchiveEmails { get; set; } - - [StringLength(200)] - public string? WorkflowApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowPublishedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowArchivedTemplateName { get; set; } - - public bool? WorkflowSendReadyForApprovalEmails { get; set; } - - [StringLength(200)] - public string? WorkflowReadyForApprovalTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowNotificationTemplateName { get; set; } - - public string? WorkflowAllowedObjects { get; set; } - - public int? WorkflowRecurrenceType { get; set; } - - [Required] - public bool? WorkflowEnabled { get; set; } - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateWorkflow")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TriggerWorkflow")] - public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); - - [InverseProperty("VersionWorkflow")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("ScopeWorkflow")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("StepWorkflow")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); - - [InverseProperty("TransitionWorkflow")] - public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); - - [ForeignKey("WorkflowId")] - [InverseProperty("Workflows")] - public virtual ICollection Users { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_Workflow")] +public class CmsWorkflow +{ + [Key] + [Column("WorkflowID")] + public int WorkflowId { get; set; } + + public string WorkflowDisplayName { get; set; } = null!; + + [StringLength(450)] + public string WorkflowName { get; set; } = null!; + + [Column("WorkflowGUID")] + public Guid WorkflowGuid { get; set; } + + public DateTime WorkflowLastModified { get; set; } + + public bool? WorkflowAutoPublishChanges { get; set; } + + public bool? WorkflowUseCheckinCheckout { get; set; } + + public int? WorkflowType { get; set; } + + public bool? WorkflowSendEmails { get; set; } + + public bool? WorkflowSendApproveEmails { get; set; } + + public bool? WorkflowSendRejectEmails { get; set; } + + public bool? WorkflowSendPublishEmails { get; set; } + + public bool? WorkflowSendArchiveEmails { get; set; } + + [StringLength(200)] + public string? WorkflowApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowPublishedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowArchivedTemplateName { get; set; } + + public bool? WorkflowSendReadyForApprovalEmails { get; set; } + + [StringLength(200)] + public string? WorkflowReadyForApprovalTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowNotificationTemplateName { get; set; } + + public string? WorkflowAllowedObjects { get; set; } + + public int? WorkflowRecurrenceType { get; set; } + + [Required] + public bool? WorkflowEnabled { get; set; } + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateWorkflow")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TriggerWorkflow")] + public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); + + [InverseProperty("VersionWorkflow")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("ScopeWorkflow")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("StepWorkflow")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); + + [InverseProperty("TransitionWorkflow")] + public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); + + [ForeignKey("WorkflowId")] + [InverseProperty("Workflows")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs b/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs index a01b7521..89a981ff 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowAction.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowAction")] -[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] -public partial class CmsWorkflowAction -{ - [Key] - [Column("ActionID")] - public int ActionId { get; set; } - - [StringLength(200)] - public string ActionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ActionName { get; set; } = null!; - - public string? ActionParameters { get; set; } - - public string? ActionDescription { get; set; } - - [StringLength(200)] - public string ActionAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string ActionClass { get; set; } = null!; - - [Column("ActionResourceID")] - public int? ActionResourceId { get; set; } - - [Column("ActionThumbnailGUID")] - public Guid? ActionThumbnailGuid { get; set; } - - [Column("ActionGUID")] - public Guid ActionGuid { get; set; } - - public DateTime ActionLastModified { get; set; } - - [Required] - public bool? ActionEnabled { get; set; } - - public string? ActionAllowedObjects { get; set; } - - [Column("ActionIconGUID")] - public Guid? ActionIconGuid { get; set; } - - public int? ActionWorkflowType { get; set; } - - [StringLength(200)] - public string? ActionIconClass { get; set; } - - [StringLength(200)] - public string? ActionThumbnailClass { get; set; } - - [ForeignKey("ActionResourceId")] - [InverseProperty("CmsWorkflowActions")] - public virtual CmsResource? ActionResource { get; set; } - - [InverseProperty("StepAction")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WorkflowAction")] +[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] +public class CmsWorkflowAction +{ + [Key] + [Column("ActionID")] + public int ActionId { get; set; } + + [StringLength(200)] + public string ActionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ActionName { get; set; } = null!; + + public string? ActionParameters { get; set; } + + public string? ActionDescription { get; set; } + + [StringLength(200)] + public string ActionAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string ActionClass { get; set; } = null!; + + [Column("ActionResourceID")] + public int? ActionResourceId { get; set; } + + [Column("ActionThumbnailGUID")] + public Guid? ActionThumbnailGuid { get; set; } + + [Column("ActionGUID")] + public Guid ActionGuid { get; set; } + + public DateTime ActionLastModified { get; set; } + + [Required] + public bool? ActionEnabled { get; set; } + + public string? ActionAllowedObjects { get; set; } + + [Column("ActionIconGUID")] + public Guid? ActionIconGuid { get; set; } + + public int? ActionWorkflowType { get; set; } + + [StringLength(200)] + public string? ActionIconClass { get; set; } + + [StringLength(200)] + public string? ActionThumbnailClass { get; set; } + + [ForeignKey("ActionResourceId")] + [InverseProperty("CmsWorkflowActions")] + public virtual CmsResource? ActionResource { get; set; } + + [InverseProperty("StepAction")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs index f7d119f0..d1a7d7d5 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowHistory.cs @@ -1,88 +1,87 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowHistory")] -[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] -[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] -[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] -[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] -[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] -[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] -public partial class CmsWorkflowHistory -{ - [Key] - [Column("WorkflowHistoryID")] - public int WorkflowHistoryId { get; set; } - - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("StepID")] - public int? StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [Column("ApprovedByUserID")] - public int? ApprovedByUserId { get; set; } - - public DateTime? ApprovedWhen { get; set; } - - public string? Comment { get; set; } - - public bool WasRejected { get; set; } - - [StringLength(440)] - public string? StepName { get; set; } - - [Column("TargetStepID")] - public int? TargetStepId { get; set; } - - [StringLength(440)] - public string? TargetStepName { get; set; } - - [StringLength(450)] - public string? TargetStepDisplayName { get; set; } - - public int? StepType { get; set; } - - public int? TargetStepType { get; set; } - - [StringLength(100)] - public string? HistoryObjectType { get; set; } - - [Column("HistoryObjectID")] - public int? HistoryObjectId { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int? HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - [ForeignKey("ApprovedByUserId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsUser? ApprovedByUser { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsWorkflow? HistoryWorkflow { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowHistorySteps")] - public virtual CmsWorkflowStep? Step { get; set; } - - [ForeignKey("TargetStepId")] - [InverseProperty("CmsWorkflowHistoryTargetSteps")] - public virtual CmsWorkflowStep? TargetStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsVersionHistory VersionHistory { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WorkflowHistory")] +[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] +[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] +[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] +[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] +[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] +[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] +public class CmsWorkflowHistory +{ + [Key] + [Column("WorkflowHistoryID")] + public int WorkflowHistoryId { get; set; } + + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("StepID")] + public int? StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [Column("ApprovedByUserID")] + public int? ApprovedByUserId { get; set; } + + public DateTime? ApprovedWhen { get; set; } + + public string? Comment { get; set; } + + public bool WasRejected { get; set; } + + [StringLength(440)] + public string? StepName { get; set; } + + [Column("TargetStepID")] + public int? TargetStepId { get; set; } + + [StringLength(440)] + public string? TargetStepName { get; set; } + + [StringLength(450)] + public string? TargetStepDisplayName { get; set; } + + public int? StepType { get; set; } + + public int? TargetStepType { get; set; } + + [StringLength(100)] + public string? HistoryObjectType { get; set; } + + [Column("HistoryObjectID")] + public int? HistoryObjectId { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int? HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + [ForeignKey("ApprovedByUserId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsUser? ApprovedByUser { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsWorkflow? HistoryWorkflow { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowHistorySteps")] + public virtual CmsWorkflowStep? Step { get; set; } + + [ForeignKey("TargetStepId")] + [InverseProperty("CmsWorkflowHistoryTargetSteps")] + public virtual CmsWorkflowStep? TargetStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsVersionHistory VersionHistory { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs b/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs index adc175eb..fc3bbb80 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowScope.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowScope")] -[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] -[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] -[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] -[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] -public partial class CmsWorkflowScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopeStartingPath { get; set; } = null!; - - [Column("ScopeWorkflowID")] - public int ScopeWorkflowId { get; set; } - - [Column("ScopeClassID")] - public int? ScopeClassId { get; set; } - - [Column("ScopeSiteID")] - public int ScopeSiteId { get; set; } - - [Column("ScopeGUID")] - public Guid ScopeGuid { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeCultureID")] - public int? ScopeCultureId { get; set; } - - public bool? ScopeExcludeChildren { get; set; } - - public bool ScopeExcluded { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeClassId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsClass? ScopeClass { get; set; } - - [ForeignKey("ScopeCultureId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsCulture? ScopeCulture { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsSite ScopeSite { get; set; } = null!; - - [ForeignKey("ScopeWorkflowId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WorkflowScope")] +[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] +[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] +[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] +[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] +public class CmsWorkflowScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopeStartingPath { get; set; } = null!; + + [Column("ScopeWorkflowID")] + public int ScopeWorkflowId { get; set; } + + [Column("ScopeClassID")] + public int? ScopeClassId { get; set; } + + [Column("ScopeSiteID")] + public int ScopeSiteId { get; set; } + + [Column("ScopeGUID")] + public Guid ScopeGuid { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeCultureID")] + public int? ScopeCultureId { get; set; } + + public bool? ScopeExcludeChildren { get; set; } + + public bool ScopeExcluded { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeClassId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsClass? ScopeClass { get; set; } + + [ForeignKey("ScopeCultureId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsCulture? ScopeCulture { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsSite ScopeSite { get; set; } = null!; + + [ForeignKey("ScopeWorkflowId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs index 52f448bc..9343f711 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowStep.cs @@ -1,115 +1,114 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowStep")] -[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] -[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] -[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] -[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] -public partial class CmsWorkflowStep -{ - [Key] - [Column("StepID")] - public int StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [StringLength(440)] - public string? StepName { get; set; } - - public int? StepOrder { get; set; } - - [Column("StepWorkflowID")] - public int StepWorkflowId { get; set; } - - [Column("StepGUID")] - public Guid StepGuid { get; set; } - - public DateTime StepLastModified { get; set; } - - public int? StepType { get; set; } - - public bool? StepAllowReject { get; set; } - - public string? StepDefinition { get; set; } - - public int? StepRolesSecurity { get; set; } - - public int? StepUsersSecurity { get; set; } - - [StringLength(200)] - public string? StepApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? StepRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? StepReadyforApprovalTemplateName { get; set; } - - public bool? StepSendApproveEmails { get; set; } - - public bool? StepSendRejectEmails { get; set; } - - public bool? StepSendReadyForApprovalEmails { get; set; } - - public bool? StepSendEmails { get; set; } - - public bool? StepAllowPublish { get; set; } - - [Column("StepActionID")] - public int? StepActionId { get; set; } - - public string? StepActionParameters { get; set; } - - public int? StepWorkflowType { get; set; } - - [InverseProperty("HistoryStep")] - public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); - - [InverseProperty("HistoryTargetStep")] - public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("StateStep")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("DocumentWorkflowStep")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("ObjectWorkflowStep")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionWorkflowStep")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); - - [InverseProperty("TargetStep")] - public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("TransitionEndStep")] - public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); - - [InverseProperty("TransitionStartStep")] - public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); - - [ForeignKey("StepActionId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflowAction? StepAction { get; set; } - - [ForeignKey("StepWorkflowId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflow StepWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WorkflowStep")] +[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] +[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] +[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] +[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] +public class CmsWorkflowStep +{ + [Key] + [Column("StepID")] + public int StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [StringLength(440)] + public string? StepName { get; set; } + + public int? StepOrder { get; set; } + + [Column("StepWorkflowID")] + public int StepWorkflowId { get; set; } + + [Column("StepGUID")] + public Guid StepGuid { get; set; } + + public DateTime StepLastModified { get; set; } + + public int? StepType { get; set; } + + public bool? StepAllowReject { get; set; } + + public string? StepDefinition { get; set; } + + public int? StepRolesSecurity { get; set; } + + public int? StepUsersSecurity { get; set; } + + [StringLength(200)] + public string? StepApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? StepRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? StepReadyforApprovalTemplateName { get; set; } + + public bool? StepSendApproveEmails { get; set; } + + public bool? StepSendRejectEmails { get; set; } + + public bool? StepSendReadyForApprovalEmails { get; set; } + + public bool? StepSendEmails { get; set; } + + public bool? StepAllowPublish { get; set; } + + [Column("StepActionID")] + public int? StepActionId { get; set; } + + public string? StepActionParameters { get; set; } + + public int? StepWorkflowType { get; set; } + + [InverseProperty("HistoryStep")] + public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); + + [InverseProperty("HistoryTargetStep")] + public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("StateStep")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("DocumentWorkflowStep")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("ObjectWorkflowStep")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionWorkflowStep")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); + + [InverseProperty("TargetStep")] + public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("TransitionEndStep")] + public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); + + [InverseProperty("TransitionStartStep")] + public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); + + [ForeignKey("StepActionId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflowAction? StepAction { get; set; } + + [ForeignKey("StepWorkflowId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflow StepWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs index 4881eb00..aa321eff 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowStepRole.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowStepRoles")] -[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] -public partial class CmsWorkflowStepRole -{ - [Key] - [Column("WorkflowStepRoleID")] - public int WorkflowStepRoleId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsWorkflowStep Step { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WorkflowStepRoles")] +[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] +public class CmsWorkflowStepRole +{ + [Key] + [Column("WorkflowStepRoleID")] + public int WorkflowStepRoleId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsWorkflowStep Step { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs index ccc72d21..fd19d9c7 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowStepUser.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowStepUser")] -[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] -public partial class CmsWorkflowStepUser -{ - [Key] - [Column("WorkflowStepUserID")] - public int WorkflowStepUserId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsWorkflowStep Step { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WorkflowStepUser")] +[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] +public class CmsWorkflowStepUser +{ + [Key] + [Column("WorkflowStepUserID")] + public int WorkflowStepUserId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsWorkflowStep Step { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs index 26ac7346..59c0f4ad 100644 --- a/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs +++ b/Migration.Toolkit.K11/Models/CmsWorkflowTransition.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CMS_WorkflowTransition")] -[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] -[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] -[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] -public partial class CmsWorkflowTransition -{ - [Key] - [Column("TransitionID")] - public int TransitionId { get; set; } - - [Column("TransitionStartStepID")] - public int TransitionStartStepId { get; set; } - - [Column("TransitionEndStepID")] - public int TransitionEndStepId { get; set; } - - public int TransitionType { get; set; } - - public DateTime TransitionLastModified { get; set; } - - [Column("TransitionSourcePointGUID")] - public Guid? TransitionSourcePointGuid { get; set; } - - [Column("TransitionWorkflowID")] - public int TransitionWorkflowId { get; set; } - - [ForeignKey("TransitionEndStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] - public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; - - [ForeignKey("TransitionStartStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] - public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; - - [ForeignKey("TransitionWorkflowId")] - [InverseProperty("CmsWorkflowTransitions")] - public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("CMS_WorkflowTransition")] +[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] +[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] +[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] +public class CmsWorkflowTransition +{ + [Key] + [Column("TransitionID")] + public int TransitionId { get; set; } + + [Column("TransitionStartStepID")] + public int TransitionStartStepId { get; set; } + + [Column("TransitionEndStepID")] + public int TransitionEndStepId { get; set; } + + public int TransitionType { get; set; } + + public DateTime TransitionLastModified { get; set; } + + [Column("TransitionSourcePointGUID")] + public Guid? TransitionSourcePointGuid { get; set; } + + [Column("TransitionWorkflowID")] + public int TransitionWorkflowId { get; set; } + + [ForeignKey("TransitionEndStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] + public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; + + [ForeignKey("TransitionStartStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] + public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; + + [ForeignKey("TransitionWorkflowId")] + [InverseProperty("CmsWorkflowTransitions")] + public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComAddress.cs b/Migration.Toolkit.K11/Models/ComAddress.cs index 99fd8020..ae47cbaa 100644 --- a/Migration.Toolkit.K11/Models/ComAddress.cs +++ b/Migration.Toolkit.K11/Models/ComAddress.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Address")] -[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] -[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] -[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] -public partial class ComAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(200)] - public string AddressName { get; set; } = null!; - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCustomerID")] - public int AddressCustomerId { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressCustomerId")] - [InverseProperty("ComAddresses")] - public virtual ComCustomer AddressCustomer { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComAddresses")] - public virtual CmsState? AddressState { get; set; } - - [InverseProperty("ShoppingCartBillingAddress")] - public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartCompanyAddress")] - public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingAddress")] - public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Address")] +[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] +[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] +[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] +public class ComAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(200)] + public string AddressName { get; set; } = null!; + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCustomerID")] + public int AddressCustomerId { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressCustomerId")] + [InverseProperty("ComAddresses")] + public virtual ComCustomer AddressCustomer { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComAddresses")] + public virtual CmsState? AddressState { get; set; } + + [InverseProperty("ShoppingCartBillingAddress")] + public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartCompanyAddress")] + public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingAddress")] + public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComBrand.cs b/Migration.Toolkit.K11/Models/ComBrand.cs index faa33c2b..dec3548c 100644 --- a/Migration.Toolkit.K11/Models/ComBrand.cs +++ b/Migration.Toolkit.K11/Models/ComBrand.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Brand")] -[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] -[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] -public partial class ComBrand -{ - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [StringLength(200)] - public string BrandDisplayName { get; set; } = null!; - - [StringLength(200)] - public string BrandName { get; set; } = null!; - - public string? BrandDescription { get; set; } - - [StringLength(400)] - public string? BrandHomepage { get; set; } - - [Column("BrandThumbnailGUID")] - public Guid? BrandThumbnailGuid { get; set; } - - [Column("BrandSiteID")] - public int BrandSiteId { get; set; } - - [Required] - public bool? BrandEnabled { get; set; } - - public Guid BrandGuid { get; set; } - - public DateTime BrandLastModified { get; set; } - - [ForeignKey("BrandSiteId")] - [InverseProperty("ComBrands")] - public virtual CmsSite BrandSite { get; set; } = null!; - - [InverseProperty("Brand")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("Skubrand")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Brand")] +[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] +[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] +public class ComBrand +{ + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [StringLength(200)] + public string BrandDisplayName { get; set; } = null!; + + [StringLength(200)] + public string BrandName { get; set; } = null!; + + public string? BrandDescription { get; set; } + + [StringLength(400)] + public string? BrandHomepage { get; set; } + + [Column("BrandThumbnailGUID")] + public Guid? BrandThumbnailGuid { get; set; } + + [Column("BrandSiteID")] + public int BrandSiteId { get; set; } + + [Required] + public bool? BrandEnabled { get; set; } + + public Guid BrandGuid { get; set; } + + public DateTime BrandLastModified { get; set; } + + [ForeignKey("BrandSiteId")] + [InverseProperty("ComBrands")] + public virtual CmsSite BrandSite { get; set; } = null!; + + [InverseProperty("Brand")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("Skubrand")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComCarrier.cs b/Migration.Toolkit.K11/Models/ComCarrier.cs index a8cea85c..16eb5fa1 100644 --- a/Migration.Toolkit.K11/Models/ComCarrier.cs +++ b/Migration.Toolkit.K11/Models/ComCarrier.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Carrier")] -[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] -public partial class ComCarrier -{ - [Key] - [Column("CarrierID")] - public int CarrierId { get; set; } - - [StringLength(200)] - public string CarrierDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CarrierName { get; set; } = null!; - - [Column("CarrierSiteID")] - public int CarrierSiteId { get; set; } - - [Column("CarrierGUID")] - public Guid CarrierGuid { get; set; } - - [StringLength(200)] - public string CarrierAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string CarrierClassName { get; set; } = null!; - - public DateTime CarrierLastModified { get; set; } - - [ForeignKey("CarrierSiteId")] - [InverseProperty("ComCarriers")] - public virtual CmsSite CarrierSite { get; set; } = null!; - - [InverseProperty("ShippingOptionCarrier")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Carrier")] +[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] +public class ComCarrier +{ + [Key] + [Column("CarrierID")] + public int CarrierId { get; set; } + + [StringLength(200)] + public string CarrierDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CarrierName { get; set; } = null!; + + [Column("CarrierSiteID")] + public int CarrierSiteId { get; set; } + + [Column("CarrierGUID")] + public Guid CarrierGuid { get; set; } + + [StringLength(200)] + public string CarrierAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string CarrierClassName { get; set; } = null!; + + public DateTime CarrierLastModified { get; set; } + + [ForeignKey("CarrierSiteId")] + [InverseProperty("ComCarriers")] + public virtual CmsSite CarrierSite { get; set; } = null!; + + [InverseProperty("ShippingOptionCarrier")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComCollection.cs b/Migration.Toolkit.K11/Models/ComCollection.cs index 2efb10e1..c0164a89 100644 --- a/Migration.Toolkit.K11/Models/ComCollection.cs +++ b/Migration.Toolkit.K11/Models/ComCollection.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Collection")] -[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] -[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] -public partial class ComCollection -{ - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [StringLength(200)] - public string CollectionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CollectionName { get; set; } = null!; - - public string? CollectionDescription { get; set; } - - [Column("CollectionSiteID")] - public int CollectionSiteId { get; set; } - - [Required] - public bool? CollectionEnabled { get; set; } - - public Guid CollectionGuid { get; set; } - - public DateTime CollectionLastModified { get; set; } - - [ForeignKey("CollectionSiteId")] - [InverseProperty("ComCollections")] - public virtual CmsSite CollectionSite { get; set; } = null!; - - [InverseProperty("Collection")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("Skucollection")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Collection")] +[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] +[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] +public class ComCollection +{ + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [StringLength(200)] + public string CollectionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CollectionName { get; set; } = null!; + + public string? CollectionDescription { get; set; } + + [Column("CollectionSiteID")] + public int CollectionSiteId { get; set; } + + [Required] + public bool? CollectionEnabled { get; set; } + + public Guid CollectionGuid { get; set; } + + public DateTime CollectionLastModified { get; set; } + + [ForeignKey("CollectionSiteId")] + [InverseProperty("ComCollections")] + public virtual CmsSite CollectionSite { get; set; } = null!; + + [InverseProperty("Collection")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("Skucollection")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComCouponCode.cs b/Migration.Toolkit.K11/Models/ComCouponCode.cs index d5f0389f..7909ba15 100644 --- a/Migration.Toolkit.K11/Models/ComCouponCode.cs +++ b/Migration.Toolkit.K11/Models/ComCouponCode.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_CouponCode")] -[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] -public partial class ComCouponCode -{ - [Key] - [Column("CouponCodeID")] - public int CouponCodeId { get; set; } - - [StringLength(200)] - public string CouponCodeCode { get; set; } = null!; - - public int? CouponCodeUseCount { get; set; } - - public int? CouponCodeUseLimit { get; set; } - - [Column("CouponCodeDiscountID")] - public int CouponCodeDiscountId { get; set; } - - public DateTime CouponCodeLastModified { get; set; } - - [Column("CouponCodeGUID")] - public Guid CouponCodeGuid { get; set; } - - [ForeignKey("CouponCodeDiscountId")] - [InverseProperty("ComCouponCodes")] - public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_CouponCode")] +[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] +public class ComCouponCode +{ + [Key] + [Column("CouponCodeID")] + public int CouponCodeId { get; set; } + + [StringLength(200)] + public string CouponCodeCode { get; set; } = null!; + + public int? CouponCodeUseCount { get; set; } + + public int? CouponCodeUseLimit { get; set; } + + [Column("CouponCodeDiscountID")] + public int CouponCodeDiscountId { get; set; } + + public DateTime CouponCodeLastModified { get; set; } + + [Column("CouponCodeGUID")] + public Guid CouponCodeGuid { get; set; } + + [ForeignKey("CouponCodeDiscountId")] + [InverseProperty("ComCouponCodes")] + public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComCurrency.cs b/Migration.Toolkit.K11/Models/ComCurrency.cs index 33b20659..e0aa22c3 100644 --- a/Migration.Toolkit.K11/Models/ComCurrency.cs +++ b/Migration.Toolkit.K11/Models/ComCurrency.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Currency")] -[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] -[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] -public partial class ComCurrency -{ - [Key] - [Column("CurrencyID")] - public int CurrencyId { get; set; } - - [StringLength(200)] - public string CurrencyName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyCode { get; set; } = null!; - - public int? CurrencyRoundTo { get; set; } - - public bool CurrencyEnabled { get; set; } - - [StringLength(200)] - public string CurrencyFormatString { get; set; } = null!; - - public bool CurrencyIsMain { get; set; } - - [Column("CurrencyGUID")] - public Guid? CurrencyGuid { get; set; } - - public DateTime CurrencyLastModified { get; set; } - - [Column("CurrencySiteID")] - public int? CurrencySiteId { get; set; } - - [InverseProperty("ExchangeRateToCurrency")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [InverseProperty("OrderCurrency")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCurrency")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CurrencySiteId")] - [InverseProperty("ComCurrencies")] - public virtual CmsSite? CurrencySite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Currency")] +[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] +[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] +public class ComCurrency +{ + [Key] + [Column("CurrencyID")] + public int CurrencyId { get; set; } + + [StringLength(200)] + public string CurrencyName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyCode { get; set; } = null!; + + public int? CurrencyRoundTo { get; set; } + + public bool CurrencyEnabled { get; set; } + + [StringLength(200)] + public string CurrencyFormatString { get; set; } = null!; + + public bool CurrencyIsMain { get; set; } + + [Column("CurrencyGUID")] + public Guid? CurrencyGuid { get; set; } + + public DateTime CurrencyLastModified { get; set; } + + [Column("CurrencySiteID")] + public int? CurrencySiteId { get; set; } + + [InverseProperty("ExchangeRateToCurrency")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [InverseProperty("OrderCurrency")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCurrency")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CurrencySiteId")] + [InverseProperty("ComCurrencies")] + public virtual CmsSite? CurrencySite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs index 6a09c84c..4fb4ba30 100644 --- a/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs +++ b/Migration.Toolkit.K11/Models/ComCurrencyExchangeRate.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_CurrencyExchangeRate")] -[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] -[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] -public partial class ComCurrencyExchangeRate -{ - [Key] - [Column("ExchagneRateID")] - public int ExchagneRateId { get; set; } - - [Column("ExchangeRateToCurrencyID")] - public int ExchangeRateToCurrencyId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ExchangeRateValue { get; set; } - - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [Column("ExchangeRateGUID")] - public Guid ExchangeRateGuid { get; set; } - - public DateTime ExchangeRateLastModified { get; set; } - - [ForeignKey("ExchangeRateToCurrencyId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; - - [ForeignKey("ExchangeTableId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComExchangeTable ExchangeTable { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_CurrencyExchangeRate")] +[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] +[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] +public class ComCurrencyExchangeRate +{ + [Key] + [Column("ExchagneRateID")] + public int ExchagneRateId { get; set; } + + [Column("ExchangeRateToCurrencyID")] + public int ExchangeRateToCurrencyId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ExchangeRateValue { get; set; } + + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [Column("ExchangeRateGUID")] + public Guid ExchangeRateGuid { get; set; } + + public DateTime ExchangeRateLastModified { get; set; } + + [ForeignKey("ExchangeRateToCurrencyId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; + + [ForeignKey("ExchangeTableId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComExchangeTable ExchangeTable { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComCustomer.cs b/Migration.Toolkit.K11/Models/ComCustomer.cs index cef89bac..3ca9d456 100644 --- a/Migration.Toolkit.K11/Models/ComCustomer.cs +++ b/Migration.Toolkit.K11/Models/ComCustomer.cs @@ -1,79 +1,78 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Customer")] -[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] -[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] -[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] -[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] -[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] -public partial class ComCustomer -{ - [Key] - [Column("CustomerID")] - public int CustomerId { get; set; } - - [StringLength(200)] - public string CustomerFirstName { get; set; } = null!; - - [StringLength(200)] - public string CustomerLastName { get; set; } = null!; - - [StringLength(254)] - public string? CustomerEmail { get; set; } - - [StringLength(26)] - public string? CustomerPhone { get; set; } - - [StringLength(50)] - public string? CustomerFax { get; set; } - - [StringLength(200)] - public string? CustomerCompany { get; set; } - - [Column("CustomerUserID")] - public int? CustomerUserId { get; set; } - - [Column("CustomerGUID")] - public Guid CustomerGuid { get; set; } - - [Column("CustomerTaxRegistrationID")] - [StringLength(50)] - public string? CustomerTaxRegistrationId { get; set; } - - [Column("CustomerOrganizationID")] - [StringLength(50)] - public string? CustomerOrganizationId { get; set; } - - public DateTime CustomerLastModified { get; set; } - - [Column("CustomerSiteID")] - public int? CustomerSiteId { get; set; } - - public DateTime? CustomerCreated { get; set; } - - [InverseProperty("AddressCustomer")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("EventCustomer")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("OrderCustomer")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCustomer")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CustomerSiteId")] - [InverseProperty("ComCustomers")] - public virtual CmsSite? CustomerSite { get; set; } - - [ForeignKey("CustomerUserId")] - [InverseProperty("ComCustomers")] - public virtual CmsUser? CustomerUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Customer")] +[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] +[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] +[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] +[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] +[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] +public class ComCustomer +{ + [Key] + [Column("CustomerID")] + public int CustomerId { get; set; } + + [StringLength(200)] + public string CustomerFirstName { get; set; } = null!; + + [StringLength(200)] + public string CustomerLastName { get; set; } = null!; + + [StringLength(254)] + public string? CustomerEmail { get; set; } + + [StringLength(26)] + public string? CustomerPhone { get; set; } + + [StringLength(50)] + public string? CustomerFax { get; set; } + + [StringLength(200)] + public string? CustomerCompany { get; set; } + + [Column("CustomerUserID")] + public int? CustomerUserId { get; set; } + + [Column("CustomerGUID")] + public Guid CustomerGuid { get; set; } + + [Column("CustomerTaxRegistrationID")] + [StringLength(50)] + public string? CustomerTaxRegistrationId { get; set; } + + [Column("CustomerOrganizationID")] + [StringLength(50)] + public string? CustomerOrganizationId { get; set; } + + public DateTime CustomerLastModified { get; set; } + + [Column("CustomerSiteID")] + public int? CustomerSiteId { get; set; } + + public DateTime? CustomerCreated { get; set; } + + [InverseProperty("AddressCustomer")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("EventCustomer")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("OrderCustomer")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCustomer")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CustomerSiteId")] + [InverseProperty("ComCustomers")] + public virtual CmsSite? CustomerSite { get; set; } + + [ForeignKey("CustomerUserId")] + [InverseProperty("ComCustomers")] + public virtual CmsUser? CustomerUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs index 54870410..7327cf07 100644 --- a/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs +++ b/Migration.Toolkit.K11/Models/ComCustomerCreditHistory.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_CustomerCreditHistory")] -[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] -[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] -public partial class ComCustomerCreditHistory -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(200)] - public string EventName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal EventCreditChange { get; set; } - - public DateTime EventDate { get; set; } - - public string? EventDescription { get; set; } - - [Column("EventCustomerID")] - public int EventCustomerId { get; set; } - - [Column("EventCreditGUID")] - public Guid? EventCreditGuid { get; set; } - - public DateTime EventCreditLastModified { get; set; } - - [Column("EventSiteID")] - public int? EventSiteId { get; set; } - - [ForeignKey("EventCustomerId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual ComCustomer EventCustomer { get; set; } = null!; - - [ForeignKey("EventSiteId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual CmsSite? EventSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_CustomerCreditHistory")] +[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] +[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] +public class ComCustomerCreditHistory +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(200)] + public string EventName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal EventCreditChange { get; set; } + + public DateTime EventDate { get; set; } + + public string? EventDescription { get; set; } + + [Column("EventCustomerID")] + public int EventCustomerId { get; set; } + + [Column("EventCreditGUID")] + public Guid? EventCreditGuid { get; set; } + + public DateTime EventCreditLastModified { get; set; } + + [Column("EventSiteID")] + public int? EventSiteId { get; set; } + + [ForeignKey("EventCustomerId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual ComCustomer EventCustomer { get; set; } = null!; + + [ForeignKey("EventSiteId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual CmsSite? EventSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComDepartment.cs b/Migration.Toolkit.K11/Models/ComDepartment.cs index 22a8f799..164eaea9 100644 --- a/Migration.Toolkit.K11/Models/ComDepartment.cs +++ b/Migration.Toolkit.K11/Models/ComDepartment.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Department")] -[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] -[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] -public partial class ComDepartment -{ - [Key] - [Column("DepartmentID")] - public int DepartmentId { get; set; } - - [StringLength(200)] - public string DepartmentName { get; set; } = null!; - - [StringLength(200)] - public string DepartmentDisplayName { get; set; } = null!; - - [Column("DepartmentDefaultTaxClassID")] - public int? DepartmentDefaultTaxClassId { get; set; } - - [Column("DepartmentGUID")] - public Guid DepartmentGuid { get; set; } - - public DateTime DepartmentLastModified { get; set; } - - [Column("DepartmentSiteID")] - public int? DepartmentSiteId { get; set; } - - [InverseProperty("Skudepartment")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("DepartmentDefaultTaxClassId")] - [InverseProperty("ComDepartments")] - public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } - - [ForeignKey("DepartmentSiteId")] - [InverseProperty("ComDepartments")] - public virtual CmsSite? DepartmentSite { get; set; } - - [ForeignKey("DepartmentId")] - [InverseProperty("Departments")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Department")] +[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] +[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] +public class ComDepartment +{ + [Key] + [Column("DepartmentID")] + public int DepartmentId { get; set; } + + [StringLength(200)] + public string DepartmentName { get; set; } = null!; + + [StringLength(200)] + public string DepartmentDisplayName { get; set; } = null!; + + [Column("DepartmentDefaultTaxClassID")] + public int? DepartmentDefaultTaxClassId { get; set; } + + [Column("DepartmentGUID")] + public Guid DepartmentGuid { get; set; } + + public DateTime DepartmentLastModified { get; set; } + + [Column("DepartmentSiteID")] + public int? DepartmentSiteId { get; set; } + + [InverseProperty("Skudepartment")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("DepartmentDefaultTaxClassId")] + [InverseProperty("ComDepartments")] + public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } + + [ForeignKey("DepartmentSiteId")] + [InverseProperty("ComDepartments")] + public virtual CmsSite? DepartmentSite { get; set; } + + [ForeignKey("DepartmentId")] + [InverseProperty("Departments")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComDiscount.cs b/Migration.Toolkit.K11/Models/ComDiscount.cs index c4b11e11..3a56b090 100644 --- a/Migration.Toolkit.K11/Models/ComDiscount.cs +++ b/Migration.Toolkit.K11/Models/ComDiscount.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Discount")] -[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] -public partial class ComDiscount -{ - [Key] - [Column("DiscountID")] - public int DiscountId { get; set; } - - [StringLength(200)] - public string DiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string DiscountName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal DiscountValue { get; set; } - - [Required] - public bool? DiscountEnabled { get; set; } - - [Column("DiscountGUID")] - public Guid DiscountGuid { get; set; } - - public DateTime DiscountLastModified { get; set; } - - [Column("DiscountSiteID")] - public int DiscountSiteId { get; set; } - - public string? DiscountDescription { get; set; } - - public DateTime? DiscountValidFrom { get; set; } - - public DateTime? DiscountValidTo { get; set; } - - public double DiscountOrder { get; set; } - - public string? DiscountProductCondition { get; set; } - - [StringLength(400)] - public string? DiscountRoles { get; set; } - - [StringLength(200)] - public string? DiscountCustomerRestriction { get; set; } - - public bool DiscountIsFlat { get; set; } - - public string? DiscountCartCondition { get; set; } - - [StringLength(100)] - public string DiscountApplyTo { get; set; } = null!; - - [Required] - public bool? DiscountApplyFurtherDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? DiscountOrderAmount { get; set; } - - public bool DiscountUsesCoupons { get; set; } - - [InverseProperty("CouponCodeDiscount")] - public virtual ICollection ComCouponCodes { get; set; } = new List(); - - [ForeignKey("DiscountSiteId")] - [InverseProperty("ComDiscounts")] - public virtual CmsSite DiscountSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Discount")] +[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] +public class ComDiscount +{ + [Key] + [Column("DiscountID")] + public int DiscountId { get; set; } + + [StringLength(200)] + public string DiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string DiscountName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal DiscountValue { get; set; } + + [Required] + public bool? DiscountEnabled { get; set; } + + [Column("DiscountGUID")] + public Guid DiscountGuid { get; set; } + + public DateTime DiscountLastModified { get; set; } + + [Column("DiscountSiteID")] + public int DiscountSiteId { get; set; } + + public string? DiscountDescription { get; set; } + + public DateTime? DiscountValidFrom { get; set; } + + public DateTime? DiscountValidTo { get; set; } + + public double DiscountOrder { get; set; } + + public string? DiscountProductCondition { get; set; } + + [StringLength(400)] + public string? DiscountRoles { get; set; } + + [StringLength(200)] + public string? DiscountCustomerRestriction { get; set; } + + public bool DiscountIsFlat { get; set; } + + public string? DiscountCartCondition { get; set; } + + [StringLength(100)] + public string DiscountApplyTo { get; set; } = null!; + + [Required] + public bool? DiscountApplyFurtherDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? DiscountOrderAmount { get; set; } + + public bool DiscountUsesCoupons { get; set; } + + [InverseProperty("CouponCodeDiscount")] + public virtual ICollection ComCouponCodes { get; set; } = new List(); + + [ForeignKey("DiscountSiteId")] + [InverseProperty("ComDiscounts")] + public virtual CmsSite DiscountSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComExchangeTable.cs b/Migration.Toolkit.K11/Models/ComExchangeTable.cs index 016aff0c..71e5687a 100644 --- a/Migration.Toolkit.K11/Models/ComExchangeTable.cs +++ b/Migration.Toolkit.K11/Models/ComExchangeTable.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ExchangeTable")] -[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] -public partial class ComExchangeTable -{ - [Key] - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [StringLength(200)] - public string ExchangeTableDisplayName { get; set; } = null!; - - public DateTime? ExchangeTableValidFrom { get; set; } - - public DateTime? ExchangeTableValidTo { get; set; } - - [Column("ExchangeTableGUID")] - public Guid ExchangeTableGuid { get; set; } - - public DateTime ExchangeTableLastModified { get; set; } - - [Column("ExchangeTableSiteID")] - public int? ExchangeTableSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } - - [InverseProperty("ExchangeTable")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [ForeignKey("ExchangeTableSiteId")] - [InverseProperty("ComExchangeTables")] - public virtual CmsSite? ExchangeTableSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_ExchangeTable")] +[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] +public class ComExchangeTable +{ + [Key] + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [StringLength(200)] + public string ExchangeTableDisplayName { get; set; } = null!; + + public DateTime? ExchangeTableValidFrom { get; set; } + + public DateTime? ExchangeTableValidTo { get; set; } + + [Column("ExchangeTableGUID")] + public Guid ExchangeTableGuid { get; set; } + + public DateTime ExchangeTableLastModified { get; set; } + + [Column("ExchangeTableSiteID")] + public int? ExchangeTableSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } + + [InverseProperty("ExchangeTable")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [ForeignKey("ExchangeTableSiteId")] + [InverseProperty("ComExchangeTables")] + public virtual CmsSite? ExchangeTableSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComGiftCard.cs b/Migration.Toolkit.K11/Models/ComGiftCard.cs index 9b61b520..995e3761 100644 --- a/Migration.Toolkit.K11/Models/ComGiftCard.cs +++ b/Migration.Toolkit.K11/Models/ComGiftCard.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_GiftCard")] -[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] -public partial class ComGiftCard -{ - [Key] - [Column("GiftCardID")] - public int GiftCardId { get; set; } - - public Guid GiftCardGuid { get; set; } - - [StringLength(200)] - public string GiftCardDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GiftCardName { get; set; } = null!; - - public string? GiftCardDescription { get; set; } - - [Required] - public bool? GiftCardEnabled { get; set; } - - public DateTime GiftCardLastModified { get; set; } - - [Column("GiftCardSiteID")] - public int GiftCardSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardValue { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? GiftCardMinimumOrderPrice { get; set; } - - public string? GiftCardCartCondition { get; set; } - - public DateTime? GiftCardValidFrom { get; set; } - - public DateTime? GiftCardValidTo { get; set; } - - [StringLength(200)] - public string? GiftCardCustomerRestriction { get; set; } - - [StringLength(400)] - public string? GiftCardRoles { get; set; } - - [InverseProperty("GiftCardCouponCodeGiftCard")] - public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); - - [ForeignKey("GiftCardSiteId")] - [InverseProperty("ComGiftCards")] - public virtual CmsSite GiftCardSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_GiftCard")] +[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] +public class ComGiftCard +{ + [Key] + [Column("GiftCardID")] + public int GiftCardId { get; set; } + + public Guid GiftCardGuid { get; set; } + + [StringLength(200)] + public string GiftCardDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GiftCardName { get; set; } = null!; + + public string? GiftCardDescription { get; set; } + + [Required] + public bool? GiftCardEnabled { get; set; } + + public DateTime GiftCardLastModified { get; set; } + + [Column("GiftCardSiteID")] + public int GiftCardSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardValue { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? GiftCardMinimumOrderPrice { get; set; } + + public string? GiftCardCartCondition { get; set; } + + public DateTime? GiftCardValidFrom { get; set; } + + public DateTime? GiftCardValidTo { get; set; } + + [StringLength(200)] + public string? GiftCardCustomerRestriction { get; set; } + + [StringLength(400)] + public string? GiftCardRoles { get; set; } + + [InverseProperty("GiftCardCouponCodeGiftCard")] + public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); + + [ForeignKey("GiftCardSiteId")] + [InverseProperty("ComGiftCards")] + public virtual CmsSite GiftCardSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs index 63551ba8..01c4b5b5 100644 --- a/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs +++ b/Migration.Toolkit.K11/Models/ComGiftCardCouponCode.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_GiftCardCouponCode")] -[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] -public partial class ComGiftCardCouponCode -{ - [Key] - [Column("GiftCardCouponCodeID")] - public int GiftCardCouponCodeId { get; set; } - - [StringLength(200)] - public string GiftCardCouponCodeCode { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardCouponCodeRemainingValue { get; set; } - - [Column("GiftCardCouponCodeGiftCardID")] - public int GiftCardCouponCodeGiftCardId { get; set; } - - public Guid GiftCardCouponCodeGuid { get; set; } - - public DateTime GiftCardCouponCodeLastModified { get; set; } - - [ForeignKey("GiftCardCouponCodeGiftCardId")] - [InverseProperty("ComGiftCardCouponCodes")] - public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_GiftCardCouponCode")] +[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] +public class ComGiftCardCouponCode +{ + [Key] + [Column("GiftCardCouponCodeID")] + public int GiftCardCouponCodeId { get; set; } + + [StringLength(200)] + public string GiftCardCouponCodeCode { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardCouponCodeRemainingValue { get; set; } + + [Column("GiftCardCouponCodeGiftCardID")] + public int GiftCardCouponCodeGiftCardId { get; set; } + + public Guid GiftCardCouponCodeGuid { get; set; } + + public DateTime GiftCardCouponCodeLastModified { get; set; } + + [ForeignKey("GiftCardCouponCodeGiftCardId")] + [InverseProperty("ComGiftCardCouponCodes")] + public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComInternalStatus.cs b/Migration.Toolkit.K11/Models/ComInternalStatus.cs index 3153a88e..70e133d7 100644 --- a/Migration.Toolkit.K11/Models/ComInternalStatus.cs +++ b/Migration.Toolkit.K11/Models/ComInternalStatus.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_InternalStatus")] -[Index("InternalStatusSiteId", Name = "IX_COM_InternalStatus_InternalStatusSiteID")] -public partial class ComInternalStatus -{ - [Key] - [Column("InternalStatusID")] - public int InternalStatusId { get; set; } - - [StringLength(200)] - public string InternalStatusName { get; set; } = null!; - - [StringLength(200)] - public string InternalStatusDisplayName { get; set; } = null!; - - [Required] - public bool? InternalStatusEnabled { get; set; } - - [Column("InternalStatusGUID")] - public Guid InternalStatusGuid { get; set; } - - public DateTime InternalStatusLastModified { get; set; } - - [Column("InternalStatusSiteID")] - public int? InternalStatusSiteId { get; set; } - - [InverseProperty("SkuinternalStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("InternalStatusSiteId")] - [InverseProperty("ComInternalStatuses")] - public virtual CmsSite? InternalStatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_InternalStatus")] +[Index("InternalStatusSiteId", Name = "IX_COM_InternalStatus_InternalStatusSiteID")] +public class ComInternalStatus +{ + [Key] + [Column("InternalStatusID")] + public int InternalStatusId { get; set; } + + [StringLength(200)] + public string InternalStatusName { get; set; } = null!; + + [StringLength(200)] + public string InternalStatusDisplayName { get; set; } = null!; + + [Required] + public bool? InternalStatusEnabled { get; set; } + + [Column("InternalStatusGUID")] + public Guid InternalStatusGuid { get; set; } + + public DateTime InternalStatusLastModified { get; set; } + + [Column("InternalStatusSiteID")] + public int? InternalStatusSiteId { get; set; } + + [InverseProperty("SkuinternalStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("InternalStatusSiteId")] + [InverseProperty("ComInternalStatuses")] + public virtual CmsSite? InternalStatusSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComManufacturer.cs b/Migration.Toolkit.K11/Models/ComManufacturer.cs index d9e4b7d4..c5805cc3 100644 --- a/Migration.Toolkit.K11/Models/ComManufacturer.cs +++ b/Migration.Toolkit.K11/Models/ComManufacturer.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Manufacturer")] -[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] -public partial class ComManufacturer -{ - [Key] - [Column("ManufacturerID")] - public int ManufacturerId { get; set; } - - [StringLength(200)] - public string ManufacturerDisplayName { get; set; } = null!; - - [StringLength(400)] - public string? ManufactureHomepage { get; set; } - - [Required] - public bool? ManufacturerEnabled { get; set; } - - [Column("ManufacturerGUID")] - public Guid ManufacturerGuid { get; set; } - - public DateTime ManufacturerLastModified { get; set; } - - [Column("ManufacturerSiteID")] - public int? ManufacturerSiteId { get; set; } - - [Column("ManufacturerThumbnailGUID")] - public Guid? ManufacturerThumbnailGuid { get; set; } - - public string? ManufacturerDescription { get; set; } - - [StringLength(200)] - public string? ManufacturerName { get; set; } - - [InverseProperty("Skumanufacturer")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("ManufacturerSiteId")] - [InverseProperty("ComManufacturers")] - public virtual CmsSite? ManufacturerSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Manufacturer")] +[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] +public class ComManufacturer +{ + [Key] + [Column("ManufacturerID")] + public int ManufacturerId { get; set; } + + [StringLength(200)] + public string ManufacturerDisplayName { get; set; } = null!; + + [StringLength(400)] + public string? ManufactureHomepage { get; set; } + + [Required] + public bool? ManufacturerEnabled { get; set; } + + [Column("ManufacturerGUID")] + public Guid ManufacturerGuid { get; set; } + + public DateTime ManufacturerLastModified { get; set; } + + [Column("ManufacturerSiteID")] + public int? ManufacturerSiteId { get; set; } + + [Column("ManufacturerThumbnailGUID")] + public Guid? ManufacturerThumbnailGuid { get; set; } + + public string? ManufacturerDescription { get; set; } + + [StringLength(200)] + public string? ManufacturerName { get; set; } + + [InverseProperty("Skumanufacturer")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("ManufacturerSiteId")] + [InverseProperty("ComManufacturers")] + public virtual CmsSite? ManufacturerSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs index 0df480f2..4a85e6f5 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyCouponCode.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_MultiBuyCouponCode")] -[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] -public partial class ComMultiBuyCouponCode -{ - [Key] - [Column("MultiBuyCouponCodeID")] - public int MultiBuyCouponCodeId { get; set; } - - [StringLength(200)] - public string MultiBuyCouponCodeCode { get; set; } = null!; - - public int? MultiBuyCouponCodeUseLimit { get; set; } - - public int? MultiBuyCouponCodeUseCount { get; set; } - - [Column("MultiBuyCouponCodeMultiBuyDiscountID")] - public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } - - public DateTime MultiBuyCouponCodeLastModified { get; set; } - - [Column("MultiBuyCouponCodeGUID")] - public Guid MultiBuyCouponCodeGuid { get; set; } - - [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] - [InverseProperty("ComMultiBuyCouponCodes")] - public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_MultiBuyCouponCode")] +[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] +public class ComMultiBuyCouponCode +{ + [Key] + [Column("MultiBuyCouponCodeID")] + public int MultiBuyCouponCodeId { get; set; } + + [StringLength(200)] + public string MultiBuyCouponCodeCode { get; set; } = null!; + + public int? MultiBuyCouponCodeUseLimit { get; set; } + + public int? MultiBuyCouponCodeUseCount { get; set; } + + [Column("MultiBuyCouponCodeMultiBuyDiscountID")] + public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } + + public DateTime MultiBuyCouponCodeLastModified { get; set; } + + [Column("MultiBuyCouponCodeGUID")] + public Guid MultiBuyCouponCodeGuid { get; set; } + + [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] + [InverseProperty("ComMultiBuyCouponCodes")] + public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs index 22d90796..181b232e 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyDiscount.cs @@ -1,98 +1,97 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_MultiBuyDiscount")] -[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] -[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] -public partial class ComMultiBuyDiscount -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string MultiBuyDiscountName { get; set; } = null!; - - public string? MultiBuyDiscountDescription { get; set; } - - [Required] - public bool? MultiBuyDiscountEnabled { get; set; } - - [Column("MultiBuyDiscountGUID")] - public Guid MultiBuyDiscountGuid { get; set; } - - public DateTime MultiBuyDiscountLastModified { get; set; } - - [Column("MultiBuyDiscountSiteID")] - public int MultiBuyDiscountSiteId { get; set; } - - [Required] - public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } - - public int MultiBuyDiscountMinimumBuyCount { get; set; } - - public DateTime? MultiBuyDiscountValidFrom { get; set; } - - public DateTime? MultiBuyDiscountValidTo { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; - - [StringLength(400)] - public string? MultiBuyDiscountRoles { get; set; } - - [Column("MultiBuyDiscountApplyToSKUID")] - public int? MultiBuyDiscountApplyToSkuid { get; set; } - - public int? MultiBuyDiscountLimitPerOrder { get; set; } - - public bool? MultiBuyDiscountUsesCoupons { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? MultiBuyDiscountValue { get; set; } - - public bool? MultiBuyDiscountIsFlat { get; set; } - - [Required] - public bool? MultiBuyDiscountAutoAddEnabled { get; set; } - - public int? MultiBuyDiscountPriority { get; set; } - - public bool MultiBuyDiscountIsProductCoupon { get; set; } - - [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] - public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("MultibuyDiscount")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountApplyToSkuid")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } - - [ForeignKey("MultiBuyDiscountSiteId")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Departments { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Skus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_MultiBuyDiscount")] +[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] +[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] +public class ComMultiBuyDiscount +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string MultiBuyDiscountName { get; set; } = null!; + + public string? MultiBuyDiscountDescription { get; set; } + + [Required] + public bool? MultiBuyDiscountEnabled { get; set; } + + [Column("MultiBuyDiscountGUID")] + public Guid MultiBuyDiscountGuid { get; set; } + + public DateTime MultiBuyDiscountLastModified { get; set; } + + [Column("MultiBuyDiscountSiteID")] + public int MultiBuyDiscountSiteId { get; set; } + + [Required] + public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } + + public int MultiBuyDiscountMinimumBuyCount { get; set; } + + public DateTime? MultiBuyDiscountValidFrom { get; set; } + + public DateTime? MultiBuyDiscountValidTo { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; + + [StringLength(400)] + public string? MultiBuyDiscountRoles { get; set; } + + [Column("MultiBuyDiscountApplyToSKUID")] + public int? MultiBuyDiscountApplyToSkuid { get; set; } + + public int? MultiBuyDiscountLimitPerOrder { get; set; } + + public bool? MultiBuyDiscountUsesCoupons { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? MultiBuyDiscountValue { get; set; } + + public bool? MultiBuyDiscountIsFlat { get; set; } + + [Required] + public bool? MultiBuyDiscountAutoAddEnabled { get; set; } + + public int? MultiBuyDiscountPriority { get; set; } + + public bool MultiBuyDiscountIsProductCoupon { get; set; } + + [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] + public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("MultibuyDiscount")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountApplyToSkuid")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } + + [ForeignKey("MultiBuyDiscountSiteId")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Departments { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Skus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs index e73d711e..97f01ede 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountBrand.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("MultiBuyDiscountId", "BrandId")] -[Table("COM_MultiBuyDiscountBrand")] -[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] -public partial class ComMultiBuyDiscountBrand -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [Required] - public bool? BrandIncluded { get; set; } - - [ForeignKey("BrandId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComBrand Brand { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("MultiBuyDiscountId", "BrandId")] +[Table("COM_MultiBuyDiscountBrand")] +[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] +public class ComMultiBuyDiscountBrand +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [Required] + public bool? BrandIncluded { get; set; } + + [ForeignKey("BrandId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComBrand Brand { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs index 091075b8..f1e7fd77 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountCollection.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("MultibuyDiscountId", "CollectionId")] -[Table("COM_MultiBuyDiscountCollection")] -[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] -public partial class ComMultiBuyDiscountCollection -{ - [Key] - [Column("MultibuyDiscountID")] - public int MultibuyDiscountId { get; set; } - - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [Required] - public bool? CollectionIncluded { get; set; } - - [ForeignKey("CollectionId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComCollection Collection { get; set; } = null!; - - [ForeignKey("MultibuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("MultibuyDiscountId", "CollectionId")] +[Table("COM_MultiBuyDiscountCollection")] +[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] +public class ComMultiBuyDiscountCollection +{ + [Key] + [Column("MultibuyDiscountID")] + public int MultibuyDiscountId { get; set; } + + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [Required] + public bool? CollectionIncluded { get; set; } + + [ForeignKey("CollectionId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComCollection Collection { get; set; } = null!; + + [ForeignKey("MultibuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs index b7e03232..c9fe8131 100644 --- a/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs +++ b/Migration.Toolkit.K11/Models/ComMultiBuyDiscountTree.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("MultiBuyDiscountId", "NodeId")] -[Table("COM_MultiBuyDiscountTree")] -[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] -public partial class ComMultiBuyDiscountTree -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [Required] - public bool? NodeIncluded { get; set; } - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; - - [ForeignKey("NodeId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual CmsTree Node { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("MultiBuyDiscountId", "NodeId")] +[Table("COM_MultiBuyDiscountTree")] +[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] +public class ComMultiBuyDiscountTree +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [Required] + public bool? NodeIncluded { get; set; } + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; + + [ForeignKey("NodeId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComOptionCategory.cs b/Migration.Toolkit.K11/Models/ComOptionCategory.cs index 91d1aeff..8b5a29f1 100644 --- a/Migration.Toolkit.K11/Models/ComOptionCategory.cs +++ b/Migration.Toolkit.K11/Models/ComOptionCategory.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OptionCategory")] -[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] -public partial class ComOptionCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("ComOptionCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [InverseProperty("Category")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("SkuoptionCategory")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_OptionCategory")] +[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] +public class ComOptionCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("ComOptionCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [InverseProperty("Category")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("SkuoptionCategory")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComOrder.cs b/Migration.Toolkit.K11/Models/ComOrder.cs index d1657540..bfe094f7 100644 --- a/Migration.Toolkit.K11/Models/ComOrder.cs +++ b/Migration.Toolkit.K11/Models/ComOrder.cs @@ -1,153 +1,152 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Order")] -[Index("OrderBillingAddressId", Name = "IX_COM_Order_OrderBillingAddressID")] -[Index("OrderCompanyAddressId", Name = "IX_COM_Order_OrderCompanyAddressID")] -[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] -[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] -[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] -[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] -[Index("OrderShippingAddressId", Name = "IX_COM_Order_OrderShippingAddressID")] -[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] -[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] -[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] -public partial class ComOrder -{ - [Key] - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("OrderBillingAddressID")] - public int OrderBillingAddressId { get; set; } - - [Column("OrderShippingAddressID")] - public int? OrderShippingAddressId { get; set; } - - [Column("OrderShippingOptionID")] - public int? OrderShippingOptionId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalShipping { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalPrice { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalTax { get; set; } - - public DateTime OrderDate { get; set; } - - [Column("OrderStatusID")] - public int? OrderStatusId { get; set; } - - [Column("OrderCurrencyID")] - public int? OrderCurrencyId { get; set; } - - [Column("OrderCustomerID")] - public int OrderCustomerId { get; set; } - - [Column("OrderCreatedByUserID")] - public int? OrderCreatedByUserId { get; set; } - - public string? OrderNote { get; set; } - - [Column("OrderSiteID")] - public int OrderSiteId { get; set; } - - [Column("OrderPaymentOptionID")] - public int? OrderPaymentOptionId { get; set; } - - public string? OrderInvoice { get; set; } - - [StringLength(200)] - public string? OrderInvoiceNumber { get; set; } - - [Column("OrderCompanyAddressID")] - public int? OrderCompanyAddressId { get; set; } - - [StringLength(100)] - public string? OrderTrackingNumber { get; set; } - - public string? OrderCustomData { get; set; } - - public string? OrderPaymentResult { get; set; } - - [Column("OrderGUID")] - public Guid OrderGuid { get; set; } - - public DateTime OrderLastModified { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalPriceInMainCurrency { get; set; } - - public bool? OrderIsPaid { get; set; } - - [StringLength(10)] - public string? OrderCulture { get; set; } - - public string? OrderDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderGrandTotal { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderGrandTotalInMainCurrency { get; set; } - - public string? OrderOtherPayments { get; set; } - - public string? OrderTaxSummary { get; set; } - - public string? OrderCouponCodes { get; set; } - - [InverseProperty("OrderItemOrder")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Order")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [ForeignKey("OrderBillingAddressId")] - [InverseProperty("ComOrderOrderBillingAddresses")] - public virtual ComOrderAddress OrderBillingAddress { get; set; } = null!; - - [ForeignKey("OrderCompanyAddressId")] - [InverseProperty("ComOrderOrderCompanyAddresses")] - public virtual ComOrderAddress? OrderCompanyAddress { get; set; } - - [ForeignKey("OrderCreatedByUserId")] - [InverseProperty("ComOrders")] - public virtual CmsUser? OrderCreatedByUser { get; set; } - - [ForeignKey("OrderCurrencyId")] - [InverseProperty("ComOrders")] - public virtual ComCurrency? OrderCurrency { get; set; } - - [ForeignKey("OrderCustomerId")] - [InverseProperty("ComOrders")] - public virtual ComCustomer OrderCustomer { get; set; } = null!; - - [ForeignKey("OrderPaymentOptionId")] - [InverseProperty("ComOrders")] - public virtual ComPaymentOption? OrderPaymentOption { get; set; } - - [ForeignKey("OrderShippingAddressId")] - [InverseProperty("ComOrderOrderShippingAddresses")] - public virtual ComOrderAddress? OrderShippingAddress { get; set; } - - [ForeignKey("OrderShippingOptionId")] - [InverseProperty("ComOrders")] - public virtual ComShippingOption? OrderShippingOption { get; set; } - - [ForeignKey("OrderSiteId")] - [InverseProperty("ComOrders")] - public virtual CmsSite OrderSite { get; set; } = null!; - - [ForeignKey("OrderStatusId")] - [InverseProperty("ComOrders")] - public virtual ComOrderStatus? OrderStatus { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Order")] +[Index("OrderBillingAddressId", Name = "IX_COM_Order_OrderBillingAddressID")] +[Index("OrderCompanyAddressId", Name = "IX_COM_Order_OrderCompanyAddressID")] +[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] +[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] +[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] +[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] +[Index("OrderShippingAddressId", Name = "IX_COM_Order_OrderShippingAddressID")] +[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] +[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] +[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] +public class ComOrder +{ + [Key] + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("OrderBillingAddressID")] + public int OrderBillingAddressId { get; set; } + + [Column("OrderShippingAddressID")] + public int? OrderShippingAddressId { get; set; } + + [Column("OrderShippingOptionID")] + public int? OrderShippingOptionId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalShipping { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalPrice { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalTax { get; set; } + + public DateTime OrderDate { get; set; } + + [Column("OrderStatusID")] + public int? OrderStatusId { get; set; } + + [Column("OrderCurrencyID")] + public int? OrderCurrencyId { get; set; } + + [Column("OrderCustomerID")] + public int OrderCustomerId { get; set; } + + [Column("OrderCreatedByUserID")] + public int? OrderCreatedByUserId { get; set; } + + public string? OrderNote { get; set; } + + [Column("OrderSiteID")] + public int OrderSiteId { get; set; } + + [Column("OrderPaymentOptionID")] + public int? OrderPaymentOptionId { get; set; } + + public string? OrderInvoice { get; set; } + + [StringLength(200)] + public string? OrderInvoiceNumber { get; set; } + + [Column("OrderCompanyAddressID")] + public int? OrderCompanyAddressId { get; set; } + + [StringLength(100)] + public string? OrderTrackingNumber { get; set; } + + public string? OrderCustomData { get; set; } + + public string? OrderPaymentResult { get; set; } + + [Column("OrderGUID")] + public Guid OrderGuid { get; set; } + + public DateTime OrderLastModified { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalPriceInMainCurrency { get; set; } + + public bool? OrderIsPaid { get; set; } + + [StringLength(10)] + public string? OrderCulture { get; set; } + + public string? OrderDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderGrandTotal { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderGrandTotalInMainCurrency { get; set; } + + public string? OrderOtherPayments { get; set; } + + public string? OrderTaxSummary { get; set; } + + public string? OrderCouponCodes { get; set; } + + [InverseProperty("OrderItemOrder")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Order")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [ForeignKey("OrderBillingAddressId")] + [InverseProperty("ComOrderOrderBillingAddresses")] + public virtual ComOrderAddress OrderBillingAddress { get; set; } = null!; + + [ForeignKey("OrderCompanyAddressId")] + [InverseProperty("ComOrderOrderCompanyAddresses")] + public virtual ComOrderAddress? OrderCompanyAddress { get; set; } + + [ForeignKey("OrderCreatedByUserId")] + [InverseProperty("ComOrders")] + public virtual CmsUser? OrderCreatedByUser { get; set; } + + [ForeignKey("OrderCurrencyId")] + [InverseProperty("ComOrders")] + public virtual ComCurrency? OrderCurrency { get; set; } + + [ForeignKey("OrderCustomerId")] + [InverseProperty("ComOrders")] + public virtual ComCustomer OrderCustomer { get; set; } = null!; + + [ForeignKey("OrderPaymentOptionId")] + [InverseProperty("ComOrders")] + public virtual ComPaymentOption? OrderPaymentOption { get; set; } + + [ForeignKey("OrderShippingAddressId")] + [InverseProperty("ComOrderOrderShippingAddresses")] + public virtual ComOrderAddress? OrderShippingAddress { get; set; } + + [ForeignKey("OrderShippingOptionId")] + [InverseProperty("ComOrders")] + public virtual ComShippingOption? OrderShippingOption { get; set; } + + [ForeignKey("OrderSiteId")] + [InverseProperty("ComOrders")] + public virtual CmsSite OrderSite { get; set; } = null!; + + [ForeignKey("OrderStatusId")] + [InverseProperty("ComOrders")] + public virtual ComOrderStatus? OrderStatus { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComOrderAddress.cs b/Migration.Toolkit.K11/Models/ComOrderAddress.cs index f330b6af..0347a219 100644 --- a/Migration.Toolkit.K11/Models/ComOrderAddress.cs +++ b/Migration.Toolkit.K11/Models/ComOrderAddress.cs @@ -1,63 +1,62 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderAddress")] -[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] -[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] -public partial class ComOrderAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsState? AddressState { get; set; } - - [InverseProperty("OrderBillingAddress")] - public virtual ICollection ComOrderOrderBillingAddresses { get; set; } = new List(); - - [InverseProperty("OrderCompanyAddress")] - public virtual ICollection ComOrderOrderCompanyAddresses { get; set; } = new List(); - - [InverseProperty("OrderShippingAddress")] - public virtual ICollection ComOrderOrderShippingAddresses { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_OrderAddress")] +[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] +[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] +public class ComOrderAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsState? AddressState { get; set; } + + [InverseProperty("OrderBillingAddress")] + public virtual ICollection ComOrderOrderBillingAddresses { get; set; } = new List(); + + [InverseProperty("OrderCompanyAddress")] + public virtual ICollection ComOrderOrderCompanyAddresses { get; set; } = new List(); + + [InverseProperty("OrderShippingAddress")] + public virtual ICollection ComOrderOrderShippingAddresses { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComOrderItem.cs b/Migration.Toolkit.K11/Models/ComOrderItem.cs index 5b4f96d1..559aab1e 100644 --- a/Migration.Toolkit.K11/Models/ComOrderItem.cs +++ b/Migration.Toolkit.K11/Models/ComOrderItem.cs @@ -1,70 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderItem")] -[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] -[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] -public partial class ComOrderItem -{ - [Key] - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("OrderItemOrderID")] - public int OrderItemOrderId { get; set; } - - [Column("OrderItemSKUID")] - public int OrderItemSkuid { get; set; } - - [Column("OrderItemSKUName")] - [StringLength(450)] - public string OrderItemSkuname { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemUnitPrice { get; set; } - - public int OrderItemUnitCount { get; set; } - - public string? OrderItemCustomData { get; set; } - - public Guid OrderItemGuid { get; set; } - - public Guid? OrderItemParentGuid { get; set; } - - public DateTime OrderItemLastModified { get; set; } - - public DateTime? OrderItemValidTo { get; set; } - - [Column("OrderItemBundleGUID")] - public Guid? OrderItemBundleGuid { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderItemTotalPriceInMainCurrency { get; set; } - - public bool? OrderItemSendNotification { get; set; } - - public string? OrderItemText { get; set; } - - public string? OrderItemProductDiscounts { get; set; } - - public string? OrderItemDiscountSummary { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemTotalPrice { get; set; } - - [InverseProperty("OrderItem")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("OrderItemOrderId")] - [InverseProperty("ComOrderItems")] - public virtual ComOrder OrderItemOrder { get; set; } = null!; - - [ForeignKey("OrderItemSkuid")] - [InverseProperty("ComOrderItems")] - public virtual ComSku OrderItemSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_OrderItem")] +[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] +[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] +public class ComOrderItem +{ + [Key] + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("OrderItemOrderID")] + public int OrderItemOrderId { get; set; } + + [Column("OrderItemSKUID")] + public int OrderItemSkuid { get; set; } + + [Column("OrderItemSKUName")] + [StringLength(450)] + public string OrderItemSkuname { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemUnitPrice { get; set; } + + public int OrderItemUnitCount { get; set; } + + public string? OrderItemCustomData { get; set; } + + public Guid OrderItemGuid { get; set; } + + public Guid? OrderItemParentGuid { get; set; } + + public DateTime OrderItemLastModified { get; set; } + + public DateTime? OrderItemValidTo { get; set; } + + [Column("OrderItemBundleGUID")] + public Guid? OrderItemBundleGuid { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderItemTotalPriceInMainCurrency { get; set; } + + public bool? OrderItemSendNotification { get; set; } + + public string? OrderItemText { get; set; } + + public string? OrderItemProductDiscounts { get; set; } + + public string? OrderItemDiscountSummary { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemTotalPrice { get; set; } + + [InverseProperty("OrderItem")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("OrderItemOrderId")] + [InverseProperty("ComOrderItems")] + public virtual ComOrder OrderItemOrder { get; set; } = null!; + + [ForeignKey("OrderItemSkuid")] + [InverseProperty("ComOrderItems")] + public virtual ComSku OrderItemSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs index 99536797..24a076eb 100644 --- a/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs +++ b/Migration.Toolkit.K11/Models/ComOrderItemSkufile.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderItemSKUFile")] -[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] -[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] -public partial class ComOrderItemSkufile -{ - [Key] - [Column("OrderItemSKUFileID")] - public int OrderItemSkufileId { get; set; } - - public Guid Token { get; set; } - - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("FileID")] - public int FileId { get; set; } - - [ForeignKey("FileId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComSkufile File { get; set; } = null!; - - [ForeignKey("OrderItemId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComOrderItem OrderItem { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_OrderItemSKUFile")] +[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] +[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] +public class ComOrderItemSkufile +{ + [Key] + [Column("OrderItemSKUFileID")] + public int OrderItemSkufileId { get; set; } + + public Guid Token { get; set; } + + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("FileID")] + public int FileId { get; set; } + + [ForeignKey("FileId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComSkufile File { get; set; } = null!; + + [ForeignKey("OrderItemId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComOrderItem OrderItem { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComOrderStatus.cs b/Migration.Toolkit.K11/Models/ComOrderStatus.cs index 8f86b30e..55f9bdc6 100644 --- a/Migration.Toolkit.K11/Models/ComOrderStatus.cs +++ b/Migration.Toolkit.K11/Models/ComOrderStatus.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderStatus")] -[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] -public partial class ComOrderStatus -{ - [Key] - [Column("StatusID")] - public int StatusId { get; set; } - - [StringLength(200)] - public string StatusName { get; set; } = null!; - - [StringLength(200)] - public string StatusDisplayName { get; set; } = null!; - - public int? StatusOrder { get; set; } - - [Required] - public bool? StatusEnabled { get; set; } - - [StringLength(7)] - public string? StatusColor { get; set; } - - [Column("StatusGUID")] - public Guid StatusGuid { get; set; } - - public DateTime StatusLastModified { get; set; } - - public bool? StatusSendNotification { get; set; } - - [Column("StatusSiteID")] - public int? StatusSiteId { get; set; } - - public bool? StatusOrderIsPaid { get; set; } - - [InverseProperty("FromStatus")] - public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); - - [InverseProperty("ToStatus")] - public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); - - [InverseProperty("OrderStatus")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionAuthorizedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionFailedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionSucceededOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); - - [ForeignKey("StatusSiteId")] - [InverseProperty("ComOrderStatuses")] - public virtual CmsSite? StatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_OrderStatus")] +[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] +public class ComOrderStatus +{ + [Key] + [Column("StatusID")] + public int StatusId { get; set; } + + [StringLength(200)] + public string StatusName { get; set; } = null!; + + [StringLength(200)] + public string StatusDisplayName { get; set; } = null!; + + public int? StatusOrder { get; set; } + + [Required] + public bool? StatusEnabled { get; set; } + + [StringLength(7)] + public string? StatusColor { get; set; } + + [Column("StatusGUID")] + public Guid StatusGuid { get; set; } + + public DateTime StatusLastModified { get; set; } + + public bool? StatusSendNotification { get; set; } + + [Column("StatusSiteID")] + public int? StatusSiteId { get; set; } + + public bool? StatusOrderIsPaid { get; set; } + + [InverseProperty("FromStatus")] + public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); + + [InverseProperty("ToStatus")] + public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); + + [InverseProperty("OrderStatus")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionAuthorizedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionFailedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionSucceededOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); + + [ForeignKey("StatusSiteId")] + [InverseProperty("ComOrderStatuses")] + public virtual CmsSite? StatusSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs b/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs index 7ae4be14..0c444db2 100644 --- a/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs +++ b/Migration.Toolkit.K11/Models/ComOrderStatusUser.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_OrderStatusUser")] -[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] -[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] -[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] -[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] -public partial class ComOrderStatusUser -{ - [Key] - [Column("OrderStatusUserID")] - public int OrderStatusUserId { get; set; } - - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("FromStatusID")] - public int? FromStatusId { get; set; } - - [Column("ToStatusID")] - public int ToStatusId { get; set; } - - [Column("ChangedByUserID")] - public int? ChangedByUserId { get; set; } - - public DateTime Date { get; set; } - - public string? Note { get; set; } - - [ForeignKey("ChangedByUserId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual CmsUser? ChangedByUser { get; set; } - - [ForeignKey("FromStatusId")] - [InverseProperty("ComOrderStatusUserFromStatuses")] - public virtual ComOrderStatus? FromStatus { get; set; } - - [ForeignKey("OrderId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual ComOrder Order { get; set; } = null!; - - [ForeignKey("ToStatusId")] - [InverseProperty("ComOrderStatusUserToStatuses")] - public virtual ComOrderStatus ToStatus { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_OrderStatusUser")] +[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] +[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] +[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] +[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] +public class ComOrderStatusUser +{ + [Key] + [Column("OrderStatusUserID")] + public int OrderStatusUserId { get; set; } + + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("FromStatusID")] + public int? FromStatusId { get; set; } + + [Column("ToStatusID")] + public int ToStatusId { get; set; } + + [Column("ChangedByUserID")] + public int? ChangedByUserId { get; set; } + + public DateTime Date { get; set; } + + public string? Note { get; set; } + + [ForeignKey("ChangedByUserId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual CmsUser? ChangedByUser { get; set; } + + [ForeignKey("FromStatusId")] + [InverseProperty("ComOrderStatusUserFromStatuses")] + public virtual ComOrderStatus? FromStatus { get; set; } + + [ForeignKey("OrderId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual ComOrder Order { get; set; } = null!; + + [ForeignKey("ToStatusId")] + [InverseProperty("ComOrderStatusUserToStatuses")] + public virtual ComOrderStatus ToStatus { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComPaymentOption.cs b/Migration.Toolkit.K11/Models/ComPaymentOption.cs index 23f8f5ed..7502dba7 100644 --- a/Migration.Toolkit.K11/Models/ComPaymentOption.cs +++ b/Migration.Toolkit.K11/Models/ComPaymentOption.cs @@ -1,83 +1,82 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_PaymentOption")] -[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] -[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] -[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] -[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] -public partial class ComPaymentOption -{ - [Key] - [Column("PaymentOptionID")] - public int PaymentOptionId { get; set; } - - [StringLength(200)] - public string PaymentOptionName { get; set; } = null!; - - [StringLength(200)] - public string PaymentOptionDisplayName { get; set; } = null!; - - [Required] - public bool? PaymentOptionEnabled { get; set; } - - [Column("PaymentOptionSiteID")] - public int? PaymentOptionSiteId { get; set; } - - [StringLength(500)] - public string? PaymentOptionPaymentGateUrl { get; set; } - - [StringLength(200)] - public string? PaymentOptionAssemblyName { get; set; } - - [StringLength(200)] - public string? PaymentOptionClassName { get; set; } - - [Column("PaymentOptionSucceededOrderStatusID")] - public int? PaymentOptionSucceededOrderStatusId { get; set; } - - [Column("PaymentOptionFailedOrderStatusID")] - public int? PaymentOptionFailedOrderStatusId { get; set; } - - [Column("PaymentOptionGUID")] - public Guid PaymentOptionGuid { get; set; } - - public DateTime PaymentOptionLastModified { get; set; } - - public bool? PaymentOptionAllowIfNoShipping { get; set; } - - [Column("PaymentOptionThumbnailGUID")] - public Guid? PaymentOptionThumbnailGuid { get; set; } - - public string? PaymentOptionDescription { get; set; } - - [Column("PaymentOptionAuthorizedOrderStatusID")] - public int? PaymentOptionAuthorizedOrderStatusId { get; set; } - - [InverseProperty("OrderPaymentOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartPaymentOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionFailedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionSiteId")] - [InverseProperty("ComPaymentOptions")] - public virtual CmsSite? PaymentOptionSite { get; set; } - - [ForeignKey("PaymentOptionSucceededOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_PaymentOption")] +[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] +[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] +[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] +[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] +public class ComPaymentOption +{ + [Key] + [Column("PaymentOptionID")] + public int PaymentOptionId { get; set; } + + [StringLength(200)] + public string PaymentOptionName { get; set; } = null!; + + [StringLength(200)] + public string PaymentOptionDisplayName { get; set; } = null!; + + [Required] + public bool? PaymentOptionEnabled { get; set; } + + [Column("PaymentOptionSiteID")] + public int? PaymentOptionSiteId { get; set; } + + [StringLength(500)] + public string? PaymentOptionPaymentGateUrl { get; set; } + + [StringLength(200)] + public string? PaymentOptionAssemblyName { get; set; } + + [StringLength(200)] + public string? PaymentOptionClassName { get; set; } + + [Column("PaymentOptionSucceededOrderStatusID")] + public int? PaymentOptionSucceededOrderStatusId { get; set; } + + [Column("PaymentOptionFailedOrderStatusID")] + public int? PaymentOptionFailedOrderStatusId { get; set; } + + [Column("PaymentOptionGUID")] + public Guid PaymentOptionGuid { get; set; } + + public DateTime PaymentOptionLastModified { get; set; } + + public bool? PaymentOptionAllowIfNoShipping { get; set; } + + [Column("PaymentOptionThumbnailGUID")] + public Guid? PaymentOptionThumbnailGuid { get; set; } + + public string? PaymentOptionDescription { get; set; } + + [Column("PaymentOptionAuthorizedOrderStatusID")] + public int? PaymentOptionAuthorizedOrderStatusId { get; set; } + + [InverseProperty("OrderPaymentOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartPaymentOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionFailedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionSiteId")] + [InverseProperty("ComPaymentOptions")] + public virtual CmsSite? PaymentOptionSite { get; set; } + + [ForeignKey("PaymentOptionSucceededOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComPublicStatus.cs b/Migration.Toolkit.K11/Models/ComPublicStatus.cs index 2538856c..dcdb6355 100644 --- a/Migration.Toolkit.K11/Models/ComPublicStatus.cs +++ b/Migration.Toolkit.K11/Models/ComPublicStatus.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_PublicStatus")] -[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] -public partial class ComPublicStatus -{ - [Key] - [Column("PublicStatusID")] - public int PublicStatusId { get; set; } - - [StringLength(200)] - public string PublicStatusName { get; set; } = null!; - - [StringLength(200)] - public string PublicStatusDisplayName { get; set; } = null!; - - [Required] - public bool? PublicStatusEnabled { get; set; } - - [Column("PublicStatusGUID")] - public Guid? PublicStatusGuid { get; set; } - - public DateTime PublicStatusLastModified { get; set; } - - [Column("PublicStatusSiteID")] - public int? PublicStatusSiteId { get; set; } - - [InverseProperty("SkupublicStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("PublicStatusSiteId")] - [InverseProperty("ComPublicStatuses")] - public virtual CmsSite? PublicStatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_PublicStatus")] +[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] +public class ComPublicStatus +{ + [Key] + [Column("PublicStatusID")] + public int PublicStatusId { get; set; } + + [StringLength(200)] + public string PublicStatusName { get; set; } = null!; + + [StringLength(200)] + public string PublicStatusDisplayName { get; set; } = null!; + + [Required] + public bool? PublicStatusEnabled { get; set; } + + [Column("PublicStatusGUID")] + public Guid? PublicStatusGuid { get; set; } + + public DateTime PublicStatusLastModified { get; set; } + + [Column("PublicStatusSiteID")] + public int? PublicStatusSiteId { get; set; } + + [InverseProperty("SkupublicStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("PublicStatusSiteId")] + [InverseProperty("ComPublicStatuses")] + public virtual CmsSite? PublicStatusSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComShippingCost.cs b/Migration.Toolkit.K11/Models/ComShippingCost.cs index 0fceb818..c5a3278b 100644 --- a/Migration.Toolkit.K11/Models/ComShippingCost.cs +++ b/Migration.Toolkit.K11/Models/ComShippingCost.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShippingCost")] -[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] -public partial class ComShippingCost -{ - [Key] - [Column("ShippingCostID")] - public int ShippingCostId { get; set; } - - [Column("ShippingCostShippingOptionID")] - public int ShippingCostShippingOptionId { get; set; } - - public double ShippingCostMinWeight { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ShippingCostValue { get; set; } - - [Column("ShippingCostGUID")] - public Guid ShippingCostGuid { get; set; } - - public DateTime ShippingCostLastModified { get; set; } - - [ForeignKey("ShippingCostShippingOptionId")] - [InverseProperty("ComShippingCosts")] - public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_ShippingCost")] +[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] +public class ComShippingCost +{ + [Key] + [Column("ShippingCostID")] + public int ShippingCostId { get; set; } + + [Column("ShippingCostShippingOptionID")] + public int ShippingCostShippingOptionId { get; set; } + + public double ShippingCostMinWeight { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ShippingCostValue { get; set; } + + [Column("ShippingCostGUID")] + public Guid ShippingCostGuid { get; set; } + + public DateTime ShippingCostLastModified { get; set; } + + [ForeignKey("ShippingCostShippingOptionId")] + [InverseProperty("ComShippingCosts")] + public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComShippingOption.cs b/Migration.Toolkit.K11/Models/ComShippingOption.cs index 9081845d..d1b0c564 100644 --- a/Migration.Toolkit.K11/Models/ComShippingOption.cs +++ b/Migration.Toolkit.K11/Models/ComShippingOption.cs @@ -1,70 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShippingOption")] -[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] -[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] -[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] -public partial class ComShippingOption -{ - [Key] - [Column("ShippingOptionID")] - public int ShippingOptionId { get; set; } - - [StringLength(200)] - public string ShippingOptionName { get; set; } = null!; - - [StringLength(200)] - public string ShippingOptionDisplayName { get; set; } = null!; - - [Required] - public bool? ShippingOptionEnabled { get; set; } - - [Column("ShippingOptionSiteID")] - public int? ShippingOptionSiteId { get; set; } - - [Column("ShippingOptionGUID")] - public Guid ShippingOptionGuid { get; set; } - - public DateTime ShippingOptionLastModified { get; set; } - - [Column("ShippingOptionThumbnailGUID")] - public Guid? ShippingOptionThumbnailGuid { get; set; } - - public string? ShippingOptionDescription { get; set; } - - [Column("ShippingOptionCarrierID")] - public int? ShippingOptionCarrierId { get; set; } - - [StringLength(200)] - public string? ShippingOptionCarrierServiceName { get; set; } - - [Column("ShippingOptionTaxClassID")] - public int? ShippingOptionTaxClassId { get; set; } - - [InverseProperty("OrderShippingOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShippingCostShippingOption")] - public virtual ICollection ComShippingCosts { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("ShippingOptionCarrierId")] - [InverseProperty("ComShippingOptions")] - public virtual ComCarrier? ShippingOptionCarrier { get; set; } - - [ForeignKey("ShippingOptionSiteId")] - [InverseProperty("ComShippingOptions")] - public virtual CmsSite? ShippingOptionSite { get; set; } - - [ForeignKey("ShippingOptionTaxClassId")] - [InverseProperty("ComShippingOptions")] - public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_ShippingOption")] +[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] +[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] +[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] +public class ComShippingOption +{ + [Key] + [Column("ShippingOptionID")] + public int ShippingOptionId { get; set; } + + [StringLength(200)] + public string ShippingOptionName { get; set; } = null!; + + [StringLength(200)] + public string ShippingOptionDisplayName { get; set; } = null!; + + [Required] + public bool? ShippingOptionEnabled { get; set; } + + [Column("ShippingOptionSiteID")] + public int? ShippingOptionSiteId { get; set; } + + [Column("ShippingOptionGUID")] + public Guid ShippingOptionGuid { get; set; } + + public DateTime ShippingOptionLastModified { get; set; } + + [Column("ShippingOptionThumbnailGUID")] + public Guid? ShippingOptionThumbnailGuid { get; set; } + + public string? ShippingOptionDescription { get; set; } + + [Column("ShippingOptionCarrierID")] + public int? ShippingOptionCarrierId { get; set; } + + [StringLength(200)] + public string? ShippingOptionCarrierServiceName { get; set; } + + [Column("ShippingOptionTaxClassID")] + public int? ShippingOptionTaxClassId { get; set; } + + [InverseProperty("OrderShippingOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShippingCostShippingOption")] + public virtual ICollection ComShippingCosts { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("ShippingOptionCarrierId")] + [InverseProperty("ComShippingOptions")] + public virtual ComCarrier? ShippingOptionCarrier { get; set; } + + [ForeignKey("ShippingOptionSiteId")] + [InverseProperty("ComShippingOptions")] + public virtual CmsSite? ShippingOptionSite { get; set; } + + [ForeignKey("ShippingOptionTaxClassId")] + [InverseProperty("ComShippingOptions")] + public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComShoppingCart.cs b/Migration.Toolkit.K11/Models/ComShoppingCart.cs index 1947172d..d38a5ed5 100644 --- a/Migration.Toolkit.K11/Models/ComShoppingCart.cs +++ b/Migration.Toolkit.K11/Models/ComShoppingCart.cs @@ -1,107 +1,106 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShoppingCart")] -[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] -[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] -[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] -[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] -[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] -[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] -[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] -[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] -[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] -[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] -[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] -public partial class ComShoppingCart -{ - [Key] - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("ShoppingCartGUID")] - public Guid ShoppingCartGuid { get; set; } - - [Column("ShoppingCartUserID")] - public int? ShoppingCartUserId { get; set; } - - [Column("ShoppingCartSiteID")] - public int ShoppingCartSiteId { get; set; } - - public DateTime ShoppingCartLastUpdate { get; set; } - - [Column("ShoppingCartCurrencyID")] - public int? ShoppingCartCurrencyId { get; set; } - - [Column("ShoppingCartPaymentOptionID")] - public int? ShoppingCartPaymentOptionId { get; set; } - - [Column("ShoppingCartShippingOptionID")] - public int? ShoppingCartShippingOptionId { get; set; } - - [Column("ShoppingCartBillingAddressID")] - public int? ShoppingCartBillingAddressId { get; set; } - - [Column("ShoppingCartShippingAddressID")] - public int? ShoppingCartShippingAddressId { get; set; } - - [Column("ShoppingCartCustomerID")] - public int? ShoppingCartCustomerId { get; set; } - - public string? ShoppingCartNote { get; set; } - - [Column("ShoppingCartCompanyAddressID")] - public int? ShoppingCartCompanyAddressId { get; set; } - - public string? ShoppingCartCustomData { get; set; } - - [Column("ShoppingCartContactID")] - public int? ShoppingCartContactId { get; set; } - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [ForeignKey("ShoppingCartBillingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] - public virtual ComAddress? ShoppingCartBillingAddress { get; set; } - - [ForeignKey("ShoppingCartCompanyAddressId")] - [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] - public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } - - [ForeignKey("ShoppingCartCurrencyId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCurrency? ShoppingCartCurrency { get; set; } - - [ForeignKey("ShoppingCartCustomerId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCustomer? ShoppingCartCustomer { get; set; } - - [ForeignKey("ShoppingCartPaymentOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } - - [ForeignKey("ShoppingCartShippingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] - public virtual ComAddress? ShoppingCartShippingAddress { get; set; } - - [ForeignKey("ShoppingCartShippingOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } - - [ForeignKey("ShoppingCartSiteId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsSite ShoppingCartSite { get; set; } = null!; - - [ForeignKey("ShoppingCartUserId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsUser? ShoppingCartUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_ShoppingCart")] +[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] +[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] +[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] +[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] +[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] +[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] +[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] +[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] +[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] +[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] +[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] +public class ComShoppingCart +{ + [Key] + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("ShoppingCartGUID")] + public Guid ShoppingCartGuid { get; set; } + + [Column("ShoppingCartUserID")] + public int? ShoppingCartUserId { get; set; } + + [Column("ShoppingCartSiteID")] + public int ShoppingCartSiteId { get; set; } + + public DateTime ShoppingCartLastUpdate { get; set; } + + [Column("ShoppingCartCurrencyID")] + public int? ShoppingCartCurrencyId { get; set; } + + [Column("ShoppingCartPaymentOptionID")] + public int? ShoppingCartPaymentOptionId { get; set; } + + [Column("ShoppingCartShippingOptionID")] + public int? ShoppingCartShippingOptionId { get; set; } + + [Column("ShoppingCartBillingAddressID")] + public int? ShoppingCartBillingAddressId { get; set; } + + [Column("ShoppingCartShippingAddressID")] + public int? ShoppingCartShippingAddressId { get; set; } + + [Column("ShoppingCartCustomerID")] + public int? ShoppingCartCustomerId { get; set; } + + public string? ShoppingCartNote { get; set; } + + [Column("ShoppingCartCompanyAddressID")] + public int? ShoppingCartCompanyAddressId { get; set; } + + public string? ShoppingCartCustomData { get; set; } + + [Column("ShoppingCartContactID")] + public int? ShoppingCartContactId { get; set; } + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [ForeignKey("ShoppingCartBillingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] + public virtual ComAddress? ShoppingCartBillingAddress { get; set; } + + [ForeignKey("ShoppingCartCompanyAddressId")] + [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] + public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } + + [ForeignKey("ShoppingCartCurrencyId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCurrency? ShoppingCartCurrency { get; set; } + + [ForeignKey("ShoppingCartCustomerId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCustomer? ShoppingCartCustomer { get; set; } + + [ForeignKey("ShoppingCartPaymentOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } + + [ForeignKey("ShoppingCartShippingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] + public virtual ComAddress? ShoppingCartShippingAddress { get; set; } + + [ForeignKey("ShoppingCartShippingOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } + + [ForeignKey("ShoppingCartSiteId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsSite ShoppingCartSite { get; set; } = null!; + + [ForeignKey("ShoppingCartUserId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsUser? ShoppingCartUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs index ae8fa422..947fb755 100644 --- a/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs +++ b/Migration.Toolkit.K11/Models/ComShoppingCartCouponCode.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShoppingCartCouponCode")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] -public partial class ComShoppingCartCouponCode -{ - [Key] - [Column("ShoppingCartCouponCodeID")] - public int ShoppingCartCouponCodeId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [StringLength(200)] - public string CouponCode { get; set; } = null!; - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartCouponCodes")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_ShoppingCartCouponCode")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] +public class ComShoppingCartCouponCode +{ + [Key] + [Column("ShoppingCartCouponCodeID")] + public int ShoppingCartCouponCodeId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [StringLength(200)] + public string CouponCode { get; set; } = null!; + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartCouponCodes")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs b/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs index 962cb678..3e652dba 100644 --- a/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs +++ b/Migration.Toolkit.K11/Models/ComShoppingCartSku.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_ShoppingCartSKU")] -[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] -public partial class ComShoppingCartSku -{ - [Key] - [Column("CartItemID")] - public int CartItemId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUUnits")] - public int Skuunits { get; set; } - - public string? CartItemCustomData { get; set; } - - public Guid? CartItemGuid { get; set; } - - public Guid? CartItemParentGuid { get; set; } - - public DateTime? CartItemValidTo { get; set; } - - [Column("CartItemBundleGUID")] - public Guid? CartItemBundleGuid { get; set; } - - public string? CartItemText { get; set; } - - public int? CartItemAutoAddedUnits { get; set; } - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComSku Sku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_ShoppingCartSKU")] +[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] +public class ComShoppingCartSku +{ + [Key] + [Column("CartItemID")] + public int CartItemId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUUnits")] + public int Skuunits { get; set; } + + public string? CartItemCustomData { get; set; } + + public Guid? CartItemGuid { get; set; } + + public Guid? CartItemParentGuid { get; set; } + + public DateTime? CartItemValidTo { get; set; } + + [Column("CartItemBundleGUID")] + public Guid? CartItemBundleGuid { get; set; } + + public string? CartItemText { get; set; } + + public int? CartItemAutoAddedUnits { get; set; } + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComSku.cs b/Migration.Toolkit.K11/Models/ComSku.cs index f5136417..42ed7e22 100644 --- a/Migration.Toolkit.K11/Models/ComSku.cs +++ b/Migration.Toolkit.K11/Models/ComSku.cs @@ -1,278 +1,277 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_SKU")] -[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] -[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] -[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] -[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] -[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] -[Index("Skuname", Name = "IX_COM_SKU_SKUName")] -[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] -[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] -[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] -[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] -[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] -[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] -[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] -public partial class ComSku -{ - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUNumber")] - [StringLength(200)] - public string? Skunumber { get; set; } - - [Column("SKUName")] - [StringLength(440)] - public string Skuname { get; set; } = null!; - - [Column("SKUDescription")] - public string? Skudescription { get; set; } - - [Column("SKUPrice", TypeName = "decimal(18, 9)")] - public decimal Skuprice { get; set; } - - [Required] - [Column("SKUEnabled")] - public bool? Skuenabled { get; set; } - - [Column("SKUDepartmentID")] - public int? SkudepartmentId { get; set; } - - [Column("SKUManufacturerID")] - public int? SkumanufacturerId { get; set; } - - [Column("SKUInternalStatusID")] - public int? SkuinternalStatusId { get; set; } - - [Column("SKUPublicStatusID")] - public int? SkupublicStatusId { get; set; } - - [Column("SKUSupplierID")] - public int? SkusupplierId { get; set; } - - [Column("SKUAvailableInDays")] - public int? SkuavailableInDays { get; set; } - - [Column("SKUGUID")] - public Guid Skuguid { get; set; } - - [Column("SKUImagePath")] - [StringLength(450)] - public string? SkuimagePath { get; set; } - - [Column("SKUWeight")] - public double? Skuweight { get; set; } - - [Column("SKUWidth")] - public double? Skuwidth { get; set; } - - [Column("SKUDepth")] - public double? Skudepth { get; set; } - - [Column("SKUHeight")] - public double? Skuheight { get; set; } - - [Column("SKUAvailableItems")] - public int? SkuavailableItems { get; set; } - - [Column("SKUSellOnlyAvailable")] - public bool? SkusellOnlyAvailable { get; set; } - - [Column("SKUCustomData")] - public string? SkucustomData { get; set; } - - [Column("SKUOptionCategoryID")] - public int? SkuoptionCategoryId { get; set; } - - [Column("SKUOrder")] - public int? Skuorder { get; set; } - - [Column("SKULastModified")] - public DateTime SkulastModified { get; set; } - - [Column("SKUCreated")] - public DateTime? Skucreated { get; set; } - - [Column("SKUSiteID")] - public int? SkusiteId { get; set; } - - [Column("SKUNeedsShipping")] - public bool? SkuneedsShipping { get; set; } - - [Column("SKUValidUntil")] - public DateTime? SkuvalidUntil { get; set; } - - [Column("SKUProductType")] - [StringLength(50)] - public string? SkuproductType { get; set; } - - [Column("SKUMaxItemsInOrder")] - public int? SkumaxItemsInOrder { get; set; } - - [Column("SKUValidity")] - [StringLength(50)] - public string? Skuvalidity { get; set; } - - [Column("SKUValidFor")] - public int? SkuvalidFor { get; set; } - - [Column("SKUMembershipGUID")] - public Guid? SkumembershipGuid { get; set; } - - [Column("SKUConversionName")] - [StringLength(100)] - public string? SkuconversionName { get; set; } - - [Column("SKUConversionValue")] - [StringLength(200)] - public string? SkuconversionValue { get; set; } - - [Column("SKUBundleInventoryType")] - [StringLength(50)] - public string? SkubundleInventoryType { get; set; } - - [Column("SKUMinItemsInOrder")] - public int? SkuminItemsInOrder { get; set; } - - [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] - public decimal? SkuretailPrice { get; set; } - - [Column("SKUParentSKUID")] - public int? SkuparentSkuid { get; set; } - - [Column("SKUShortDescription")] - public string? SkushortDescription { get; set; } - - [Column("SKUEproductFilesCount")] - public int? SkueproductFilesCount { get; set; } - - [Column("SKUBundleItemsCount")] - public int? SkubundleItemsCount { get; set; } - - [Column("SKUInStoreFrom")] - public DateTime? SkuinStoreFrom { get; set; } - - [Column("SKUReorderAt")] - public int? SkureorderAt { get; set; } - - [Column("SKUTrackInventory")] - [StringLength(50)] - public string? SkutrackInventory { get; set; } - - [Column("SKUTaxClassID")] - public int? SkutaxClassId { get; set; } - - [Column("SKUBrandID")] - public int? SkubrandId { get; set; } - - [Column("SKUCollectionID")] - public int? SkucollectionId { get; set; } - - [InverseProperty("NodeSku")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountApplyToSku")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("OrderItemSku")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [InverseProperty("FileSku")] - public virtual ICollection ComSkufiles { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("VolumeDiscountSku")] - public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("SkuparentSku")] - public virtual ICollection InverseSkuparentSku { get; set; } = new List(); - - [ForeignKey("SkubrandId")] - [InverseProperty("ComSkus")] - public virtual ComBrand? Skubrand { get; set; } - - [ForeignKey("SkucollectionId")] - [InverseProperty("ComSkus")] - public virtual ComCollection? Skucollection { get; set; } - - [ForeignKey("SkudepartmentId")] - [InverseProperty("ComSkus")] - public virtual ComDepartment? Skudepartment { get; set; } - - [ForeignKey("SkuinternalStatusId")] - [InverseProperty("ComSkus")] - public virtual ComInternalStatus? SkuinternalStatus { get; set; } - - [ForeignKey("SkumanufacturerId")] - [InverseProperty("ComSkus")] - public virtual ComManufacturer? Skumanufacturer { get; set; } - - [ForeignKey("SkuoptionCategoryId")] - [InverseProperty("ComSkus")] - public virtual ComOptionCategory? SkuoptionCategory { get; set; } - - [ForeignKey("SkuparentSkuid")] - [InverseProperty("InverseSkuparentSku")] - public virtual ComSku? SkuparentSku { get; set; } - - [ForeignKey("SkupublicStatusId")] - [InverseProperty("ComSkus")] - public virtual ComPublicStatus? SkupublicStatus { get; set; } - - [ForeignKey("SkusiteId")] - [InverseProperty("ComSkus")] - public virtual CmsSite? Skusite { get; set; } - - [ForeignKey("SkusupplierId")] - [InverseProperty("ComSkus")] - public virtual ComSupplier? Skusupplier { get; set; } - - [ForeignKey("SkutaxClassId")] - [InverseProperty("ComSkus")] - public virtual ComTaxClass? SkutaxClass { get; set; } - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection Bundles { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("SkusNavigation")] - public virtual ICollection OptionSkus { get; set; } = new List(); - - [ForeignKey("VariantSkuid")] - [InverseProperty("VariantSkus")] - public virtual ICollection OptionSkusNavigation { get; set; } = new List(); - - [ForeignKey("BundleId")] - [InverseProperty("Bundles")] - public virtual ICollection Skus { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkus")] - public virtual ICollection SkusNavigation { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkusNavigation")] - public virtual ICollection VariantSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_SKU")] +[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] +[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] +[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] +[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] +[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] +[Index("Skuname", Name = "IX_COM_SKU_SKUName")] +[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] +[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] +[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] +[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] +[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] +[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] +[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] +public class ComSku +{ + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUNumber")] + [StringLength(200)] + public string? Skunumber { get; set; } + + [Column("SKUName")] + [StringLength(440)] + public string Skuname { get; set; } = null!; + + [Column("SKUDescription")] + public string? Skudescription { get; set; } + + [Column("SKUPrice", TypeName = "decimal(18, 9)")] + public decimal Skuprice { get; set; } + + [Required] + [Column("SKUEnabled")] + public bool? Skuenabled { get; set; } + + [Column("SKUDepartmentID")] + public int? SkudepartmentId { get; set; } + + [Column("SKUManufacturerID")] + public int? SkumanufacturerId { get; set; } + + [Column("SKUInternalStatusID")] + public int? SkuinternalStatusId { get; set; } + + [Column("SKUPublicStatusID")] + public int? SkupublicStatusId { get; set; } + + [Column("SKUSupplierID")] + public int? SkusupplierId { get; set; } + + [Column("SKUAvailableInDays")] + public int? SkuavailableInDays { get; set; } + + [Column("SKUGUID")] + public Guid Skuguid { get; set; } + + [Column("SKUImagePath")] + [StringLength(450)] + public string? SkuimagePath { get; set; } + + [Column("SKUWeight")] + public double? Skuweight { get; set; } + + [Column("SKUWidth")] + public double? Skuwidth { get; set; } + + [Column("SKUDepth")] + public double? Skudepth { get; set; } + + [Column("SKUHeight")] + public double? Skuheight { get; set; } + + [Column("SKUAvailableItems")] + public int? SkuavailableItems { get; set; } + + [Column("SKUSellOnlyAvailable")] + public bool? SkusellOnlyAvailable { get; set; } + + [Column("SKUCustomData")] + public string? SkucustomData { get; set; } + + [Column("SKUOptionCategoryID")] + public int? SkuoptionCategoryId { get; set; } + + [Column("SKUOrder")] + public int? Skuorder { get; set; } + + [Column("SKULastModified")] + public DateTime SkulastModified { get; set; } + + [Column("SKUCreated")] + public DateTime? Skucreated { get; set; } + + [Column("SKUSiteID")] + public int? SkusiteId { get; set; } + + [Column("SKUNeedsShipping")] + public bool? SkuneedsShipping { get; set; } + + [Column("SKUValidUntil")] + public DateTime? SkuvalidUntil { get; set; } + + [Column("SKUProductType")] + [StringLength(50)] + public string? SkuproductType { get; set; } + + [Column("SKUMaxItemsInOrder")] + public int? SkumaxItemsInOrder { get; set; } + + [Column("SKUValidity")] + [StringLength(50)] + public string? Skuvalidity { get; set; } + + [Column("SKUValidFor")] + public int? SkuvalidFor { get; set; } + + [Column("SKUMembershipGUID")] + public Guid? SkumembershipGuid { get; set; } + + [Column("SKUConversionName")] + [StringLength(100)] + public string? SkuconversionName { get; set; } + + [Column("SKUConversionValue")] + [StringLength(200)] + public string? SkuconversionValue { get; set; } + + [Column("SKUBundleInventoryType")] + [StringLength(50)] + public string? SkubundleInventoryType { get; set; } + + [Column("SKUMinItemsInOrder")] + public int? SkuminItemsInOrder { get; set; } + + [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] + public decimal? SkuretailPrice { get; set; } + + [Column("SKUParentSKUID")] + public int? SkuparentSkuid { get; set; } + + [Column("SKUShortDescription")] + public string? SkushortDescription { get; set; } + + [Column("SKUEproductFilesCount")] + public int? SkueproductFilesCount { get; set; } + + [Column("SKUBundleItemsCount")] + public int? SkubundleItemsCount { get; set; } + + [Column("SKUInStoreFrom")] + public DateTime? SkuinStoreFrom { get; set; } + + [Column("SKUReorderAt")] + public int? SkureorderAt { get; set; } + + [Column("SKUTrackInventory")] + [StringLength(50)] + public string? SkutrackInventory { get; set; } + + [Column("SKUTaxClassID")] + public int? SkutaxClassId { get; set; } + + [Column("SKUBrandID")] + public int? SkubrandId { get; set; } + + [Column("SKUCollectionID")] + public int? SkucollectionId { get; set; } + + [InverseProperty("NodeSku")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountApplyToSku")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("OrderItemSku")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [InverseProperty("FileSku")] + public virtual ICollection ComSkufiles { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("VolumeDiscountSku")] + public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("SkuparentSku")] + public virtual ICollection InverseSkuparentSku { get; set; } = new List(); + + [ForeignKey("SkubrandId")] + [InverseProperty("ComSkus")] + public virtual ComBrand? Skubrand { get; set; } + + [ForeignKey("SkucollectionId")] + [InverseProperty("ComSkus")] + public virtual ComCollection? Skucollection { get; set; } + + [ForeignKey("SkudepartmentId")] + [InverseProperty("ComSkus")] + public virtual ComDepartment? Skudepartment { get; set; } + + [ForeignKey("SkuinternalStatusId")] + [InverseProperty("ComSkus")] + public virtual ComInternalStatus? SkuinternalStatus { get; set; } + + [ForeignKey("SkumanufacturerId")] + [InverseProperty("ComSkus")] + public virtual ComManufacturer? Skumanufacturer { get; set; } + + [ForeignKey("SkuoptionCategoryId")] + [InverseProperty("ComSkus")] + public virtual ComOptionCategory? SkuoptionCategory { get; set; } + + [ForeignKey("SkuparentSkuid")] + [InverseProperty("InverseSkuparentSku")] + public virtual ComSku? SkuparentSku { get; set; } + + [ForeignKey("SkupublicStatusId")] + [InverseProperty("ComSkus")] + public virtual ComPublicStatus? SkupublicStatus { get; set; } + + [ForeignKey("SkusiteId")] + [InverseProperty("ComSkus")] + public virtual CmsSite? Skusite { get; set; } + + [ForeignKey("SkusupplierId")] + [InverseProperty("ComSkus")] + public virtual ComSupplier? Skusupplier { get; set; } + + [ForeignKey("SkutaxClassId")] + [InverseProperty("ComSkus")] + public virtual ComTaxClass? SkutaxClass { get; set; } + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection Bundles { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("SkusNavigation")] + public virtual ICollection OptionSkus { get; set; } = new List(); + + [ForeignKey("VariantSkuid")] + [InverseProperty("VariantSkus")] + public virtual ICollection OptionSkusNavigation { get; set; } = new List(); + + [ForeignKey("BundleId")] + [InverseProperty("Bundles")] + public virtual ICollection Skus { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkus")] + public virtual ICollection SkusNavigation { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkusNavigation")] + public virtual ICollection VariantSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ComSkufile.cs b/Migration.Toolkit.K11/Models/ComSkufile.cs index c22f0a77..0af601af 100644 --- a/Migration.Toolkit.K11/Models/ComSkufile.cs +++ b/Migration.Toolkit.K11/Models/ComSkufile.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_SKUFile")] -[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] -public partial class ComSkufile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileSKUID")] - public int FileSkuid { get; set; } - - [StringLength(450)] - public string FilePath { get; set; } = null!; - - [StringLength(50)] - public string FileType { get; set; } = null!; - - public DateTime FileLastModified { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [Column("FileMetaFileGUID")] - public Guid? FileMetaFileGuid { get; set; } - - [InverseProperty("File")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("FileSkuid")] - [InverseProperty("ComSkufiles")] - public virtual ComSku FileSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_SKUFile")] +[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] +public class ComSkufile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileSKUID")] + public int FileSkuid { get; set; } + + [StringLength(450)] + public string FilePath { get; set; } = null!; + + [StringLength(50)] + public string FileType { get; set; } = null!; + + public DateTime FileLastModified { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [Column("FileMetaFileGUID")] + public Guid? FileMetaFileGuid { get; set; } + + [InverseProperty("File")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("FileSkuid")] + [InverseProperty("ComSkufiles")] + public virtual ComSku FileSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs index 700fe03d..4ee3cf8d 100644 --- a/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs +++ b/Migration.Toolkit.K11/Models/ComSkuoptionCategory.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_SKUOptionCategory")] -[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] -[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] -public partial class ComSkuoptionCategory -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Key] - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComOptionCategory Category { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComSku Sku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_SKUOptionCategory")] +[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] +[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] +public class ComSkuoptionCategory +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Key] + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComOptionCategory Category { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComSupplier.cs b/Migration.Toolkit.K11/Models/ComSupplier.cs index b23eba29..b7c3acd0 100644 --- a/Migration.Toolkit.K11/Models/ComSupplier.cs +++ b/Migration.Toolkit.K11/Models/ComSupplier.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_Supplier")] -[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] -public partial class ComSupplier -{ - [Key] - [Column("SupplierID")] - public int SupplierId { get; set; } - - [StringLength(200)] - public string SupplierDisplayName { get; set; } = null!; - - [StringLength(50)] - public string? SupplierPhone { get; set; } - - [StringLength(254)] - public string? SupplierEmail { get; set; } - - [StringLength(50)] - public string? SupplierFax { get; set; } - - [Required] - public bool? SupplierEnabled { get; set; } - - [Column("SupplierGUID")] - public Guid SupplierGuid { get; set; } - - public DateTime SupplierLastModified { get; set; } - - [Column("SupplierSiteID")] - public int? SupplierSiteId { get; set; } - - [StringLength(200)] - public string? SupplierName { get; set; } - - [InverseProperty("Skusupplier")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("SupplierSiteId")] - [InverseProperty("ComSuppliers")] - public virtual CmsSite? SupplierSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_Supplier")] +[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] +public class ComSupplier +{ + [Key] + [Column("SupplierID")] + public int SupplierId { get; set; } + + [StringLength(200)] + public string SupplierDisplayName { get; set; } = null!; + + [StringLength(50)] + public string? SupplierPhone { get; set; } + + [StringLength(254)] + public string? SupplierEmail { get; set; } + + [StringLength(50)] + public string? SupplierFax { get; set; } + + [Required] + public bool? SupplierEnabled { get; set; } + + [Column("SupplierGUID")] + public Guid SupplierGuid { get; set; } + + public DateTime SupplierLastModified { get; set; } + + [Column("SupplierSiteID")] + public int? SupplierSiteId { get; set; } + + [StringLength(200)] + public string? SupplierName { get; set; } + + [InverseProperty("Skusupplier")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("SupplierSiteId")] + [InverseProperty("ComSuppliers")] + public virtual CmsSite? SupplierSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComTaxClass.cs b/Migration.Toolkit.K11/Models/ComTaxClass.cs index c84fb883..41ed5a73 100644 --- a/Migration.Toolkit.K11/Models/ComTaxClass.cs +++ b/Migration.Toolkit.K11/Models/ComTaxClass.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_TaxClass")] -[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] -public partial class ComTaxClass -{ - [Key] - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [StringLength(200)] - public string TaxClassName { get; set; } = null!; - - [StringLength(200)] - public string TaxClassDisplayName { get; set; } = null!; - - [Column("TaxClassZeroIfIDSupplied")] - public bool? TaxClassZeroIfIdsupplied { get; set; } - - [Column("TaxClassGUID")] - public Guid TaxClassGuid { get; set; } - - public DateTime TaxClassLastModified { get; set; } - - [Column("TaxClassSiteID")] - public int? TaxClassSiteId { get; set; } - - [InverseProperty("DepartmentDefaultTaxClass")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("ShippingOptionTaxClass")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("SkutaxClass")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("TaxClassSiteId")] - [InverseProperty("ComTaxClasses")] - public virtual CmsSite? TaxClassSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_TaxClass")] +[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] +public class ComTaxClass +{ + [Key] + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [StringLength(200)] + public string TaxClassName { get; set; } = null!; + + [StringLength(200)] + public string TaxClassDisplayName { get; set; } = null!; + + [Column("TaxClassZeroIfIDSupplied")] + public bool? TaxClassZeroIfIdsupplied { get; set; } + + [Column("TaxClassGUID")] + public Guid TaxClassGuid { get; set; } + + public DateTime TaxClassLastModified { get; set; } + + [Column("TaxClassSiteID")] + public int? TaxClassSiteId { get; set; } + + [InverseProperty("DepartmentDefaultTaxClass")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("ShippingOptionTaxClass")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("SkutaxClass")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("TaxClassSiteId")] + [InverseProperty("ComTaxClasses")] + public virtual CmsSite? TaxClassSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs b/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs index 97be5f44..e7b9afe4 100644 --- a/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs +++ b/Migration.Toolkit.K11/Models/ComTaxClassCountry.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_TaxClassCountry")] -[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] -[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] -public partial class ComTaxClassCountry -{ - [Key] - [Column("TaxClassCountryID")] - public int TaxClassCountryId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("CountryId")] - [InverseProperty("ComTaxClassCountries")] - public virtual CmsCountry Country { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassCountries")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_TaxClassCountry")] +[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] +[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] +public class ComTaxClassCountry +{ + [Key] + [Column("TaxClassCountryID")] + public int TaxClassCountryId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("CountryId")] + [InverseProperty("ComTaxClassCountries")] + public virtual CmsCountry Country { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassCountries")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComTaxClassState.cs b/Migration.Toolkit.K11/Models/ComTaxClassState.cs index fd1a6ac2..6f0505d3 100644 --- a/Migration.Toolkit.K11/Models/ComTaxClassState.cs +++ b/Migration.Toolkit.K11/Models/ComTaxClassState.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_TaxClassState")] -[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] -[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] -public partial class ComTaxClassState -{ - [Key] - [Column("TaxClassStateID")] - public int TaxClassStateId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("StateID")] - public int StateId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("StateId")] - [InverseProperty("ComTaxClassStates")] - public virtual CmsState State { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassStates")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_TaxClassState")] +[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] +[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] +public class ComTaxClassState +{ + [Key] + [Column("TaxClassStateID")] + public int TaxClassStateId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("StateID")] + public int StateId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("StateId")] + [InverseProperty("ComTaxClassStates")] + public virtual CmsState State { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassStates")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs b/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs index 5ba13111..0ff15709 100644 --- a/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs +++ b/Migration.Toolkit.K11/Models/ComVolumeDiscount.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("COM_VolumeDiscount")] -[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] -public partial class ComVolumeDiscount -{ - [Key] - [Column("VolumeDiscountID")] - public int VolumeDiscountId { get; set; } - - [Column("VolumeDiscountSKUID")] - public int VolumeDiscountSkuid { get; set; } - - public int VolumeDiscountMinCount { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal VolumeDiscountValue { get; set; } - - public bool VolumeDiscountIsFlatValue { get; set; } - - [Column("VolumeDiscountGUID")] - public Guid VolumeDiscountGuid { get; set; } - - public DateTime VolumeDiscountLastModified { get; set; } - - [ForeignKey("VolumeDiscountSkuid")] - [InverseProperty("ComVolumeDiscounts")] - public virtual ComSku VolumeDiscountSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("COM_VolumeDiscount")] +[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] +public class ComVolumeDiscount +{ + [Key] + [Column("VolumeDiscountID")] + public int VolumeDiscountId { get; set; } + + [Column("VolumeDiscountSKUID")] + public int VolumeDiscountSkuid { get; set; } + + public int VolumeDiscountMinCount { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal VolumeDiscountValue { get; set; } + + public bool VolumeDiscountIsFlatValue { get; set; } + + [Column("VolumeDiscountGUID")] + public Guid VolumeDiscountGuid { get; set; } + + public DateTime VolumeDiscountLastModified { get; set; } + + [ForeignKey("VolumeDiscountSkuid")] + [InverseProperty("ComVolumeDiscounts")] + public virtual ComSku VolumeDiscountSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ComWishlist.cs b/Migration.Toolkit.K11/Models/ComWishlist.cs index 9b4e0e1d..47d6775a 100644 --- a/Migration.Toolkit.K11/Models/ComWishlist.cs +++ b/Migration.Toolkit.K11/Models/ComWishlist.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("UserId", "Skuid", "SiteId")] -[Table("COM_Wishlist")] -[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] -[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] -public partial class ComWishlist -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ComWishlists")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComWishlists")] - public virtual ComSku Sku { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ComWishlists")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("UserId", "Skuid", "SiteId")] +[Table("COM_Wishlist")] +[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] +[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] +public class ComWishlist +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ComWishlists")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComWishlists")] + public virtual ComSku Sku { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ComWishlists")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CommunityFriend.cs b/Migration.Toolkit.K11/Models/CommunityFriend.cs index 527c77ec..5e7d903b 100644 --- a/Migration.Toolkit.K11/Models/CommunityFriend.cs +++ b/Migration.Toolkit.K11/Models/CommunityFriend.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Community_Friend")] -[Index("FriendApprovedBy", Name = "IX_Community_Friend_FriendApprovedBy")] -[Index("FriendRejectedBy", Name = "IX_Community_Friend_FriendRejectedBy")] -[Index("FriendRequestedUserId", "FriendStatus", Name = "IX_Community_Friend_FriendRequestedUserID_FriendStatus")] -[Index("FriendRequestedUserId", "FriendUserId", Name = "IX_Community_Friend_FriendRequestedUserID_FriendUserID", IsUnique = true)] -[Index("FriendUserId", "FriendStatus", Name = "IX_Community_Friend_FriendUserID_FriendStatus")] -public partial class CommunityFriend -{ - [Key] - [Column("FriendID")] - public int FriendId { get; set; } - - [Column("FriendRequestedUserID")] - public int FriendRequestedUserId { get; set; } - - [Column("FriendUserID")] - public int FriendUserId { get; set; } - - public DateTime FriendRequestedWhen { get; set; } - - public string? FriendComment { get; set; } - - public int? FriendApprovedBy { get; set; } - - public DateTime? FriendApprovedWhen { get; set; } - - public int? FriendRejectedBy { get; set; } - - public DateTime? FriendRejectedWhen { get; set; } - - [Column("FriendGUID")] - public Guid FriendGuid { get; set; } - - public int FriendStatus { get; set; } - - [ForeignKey("FriendApprovedBy")] - [InverseProperty("CommunityFriendFriendApprovedByNavigations")] - public virtual CmsUser? FriendApprovedByNavigation { get; set; } - - [ForeignKey("FriendRejectedBy")] - [InverseProperty("CommunityFriendFriendRejectedByNavigations")] - public virtual CmsUser? FriendRejectedByNavigation { get; set; } - - [ForeignKey("FriendRequestedUserId")] - [InverseProperty("CommunityFriendFriendRequestedUsers")] - public virtual CmsUser FriendRequestedUser { get; set; } = null!; - - [ForeignKey("FriendUserId")] - [InverseProperty("CommunityFriendFriendUsers")] - public virtual CmsUser FriendUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Community_Friend")] +[Index("FriendApprovedBy", Name = "IX_Community_Friend_FriendApprovedBy")] +[Index("FriendRejectedBy", Name = "IX_Community_Friend_FriendRejectedBy")] +[Index("FriendRequestedUserId", "FriendStatus", Name = "IX_Community_Friend_FriendRequestedUserID_FriendStatus")] +[Index("FriendRequestedUserId", "FriendUserId", Name = "IX_Community_Friend_FriendRequestedUserID_FriendUserID", IsUnique = true)] +[Index("FriendUserId", "FriendStatus", Name = "IX_Community_Friend_FriendUserID_FriendStatus")] +public class CommunityFriend +{ + [Key] + [Column("FriendID")] + public int FriendId { get; set; } + + [Column("FriendRequestedUserID")] + public int FriendRequestedUserId { get; set; } + + [Column("FriendUserID")] + public int FriendUserId { get; set; } + + public DateTime FriendRequestedWhen { get; set; } + + public string? FriendComment { get; set; } + + public int? FriendApprovedBy { get; set; } + + public DateTime? FriendApprovedWhen { get; set; } + + public int? FriendRejectedBy { get; set; } + + public DateTime? FriendRejectedWhen { get; set; } + + [Column("FriendGUID")] + public Guid FriendGuid { get; set; } + + public int FriendStatus { get; set; } + + [ForeignKey("FriendApprovedBy")] + [InverseProperty("CommunityFriendFriendApprovedByNavigations")] + public virtual CmsUser? FriendApprovedByNavigation { get; set; } + + [ForeignKey("FriendRejectedBy")] + [InverseProperty("CommunityFriendFriendRejectedByNavigations")] + public virtual CmsUser? FriendRejectedByNavigation { get; set; } + + [ForeignKey("FriendRequestedUserId")] + [InverseProperty("CommunityFriendFriendRequestedUsers")] + public virtual CmsUser FriendRequestedUser { get; set; } = null!; + + [ForeignKey("FriendUserId")] + [InverseProperty("CommunityFriendFriendUsers")] + public virtual CmsUser FriendUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CommunityGroup.cs b/Migration.Toolkit.K11/Models/CommunityGroup.cs index 156dfa11..d319f6b5 100644 --- a/Migration.Toolkit.K11/Models/CommunityGroup.cs +++ b/Migration.Toolkit.K11/Models/CommunityGroup.cs @@ -1,110 +1,109 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Community_Group")] -[Index("GroupApproved", Name = "IX_Community_Group_GroupApproved")] -[Index("GroupApprovedByUserId", Name = "IX_Community_Group_GroupApprovedByUserID")] -[Index("GroupAvatarId", Name = "IX_Community_Group_GroupAvatarID")] -[Index("GroupCreatedByUserId", Name = "IX_Community_Group_GroupCreatedByUserID")] -[Index("GroupSiteId", "GroupName", Name = "IX_Community_Group_GroupSiteID_GroupName")] -public partial class CommunityGroup -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - [StringLength(100)] - public string GroupName { get; set; } = null!; - - public string GroupDescription { get; set; } = null!; - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int GroupApproveMembers { get; set; } - - public int GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } - - public bool? GroupLogActivity { get; set; } - - [InverseProperty("BoardGroup")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("RoleGroup")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("NodeGroup")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MemberGroup")] - public virtual ICollection CommunityGroupMembers { get; set; } = new List(); - - [InverseProperty("Group")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("InvitationGroup")] - public virtual ICollection CommunityInvitations { get; set; } = new List(); - - [InverseProperty("GroupGroup")] - public virtual ICollection ForumsForumGroups { get; set; } = new List(); - - [InverseProperty("ForumCommunityGroup")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [ForeignKey("GroupApprovedByUserId")] - [InverseProperty("CommunityGroupGroupApprovedByUsers")] - public virtual CmsUser? GroupApprovedByUser { get; set; } - - [ForeignKey("GroupAvatarId")] - [InverseProperty("CommunityGroups")] - public virtual CmsAvatar? GroupAvatar { get; set; } - - [ForeignKey("GroupCreatedByUserId")] - [InverseProperty("CommunityGroupGroupCreatedByUsers")] - public virtual CmsUser? GroupCreatedByUser { get; set; } - - [ForeignKey("GroupSiteId")] - [InverseProperty("CommunityGroups")] - public virtual CmsSite GroupSite { get; set; } = null!; - - [InverseProperty("LibraryGroup")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("PollGroup")] - public virtual ICollection PollsPolls { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Community_Group")] +[Index("GroupApproved", Name = "IX_Community_Group_GroupApproved")] +[Index("GroupApprovedByUserId", Name = "IX_Community_Group_GroupApprovedByUserID")] +[Index("GroupAvatarId", Name = "IX_Community_Group_GroupAvatarID")] +[Index("GroupCreatedByUserId", Name = "IX_Community_Group_GroupCreatedByUserID")] +[Index("GroupSiteId", "GroupName", Name = "IX_Community_Group_GroupSiteID_GroupName")] +public class CommunityGroup +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + [StringLength(100)] + public string GroupName { get; set; } = null!; + + public string GroupDescription { get; set; } = null!; + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int GroupApproveMembers { get; set; } + + public int GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } + + public bool? GroupLogActivity { get; set; } + + [InverseProperty("BoardGroup")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("RoleGroup")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("NodeGroup")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MemberGroup")] + public virtual ICollection CommunityGroupMembers { get; set; } = new List(); + + [InverseProperty("Group")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("InvitationGroup")] + public virtual ICollection CommunityInvitations { get; set; } = new List(); + + [InverseProperty("GroupGroup")] + public virtual ICollection ForumsForumGroups { get; set; } = new List(); + + [InverseProperty("ForumCommunityGroup")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [ForeignKey("GroupApprovedByUserId")] + [InverseProperty("CommunityGroupGroupApprovedByUsers")] + public virtual CmsUser? GroupApprovedByUser { get; set; } + + [ForeignKey("GroupAvatarId")] + [InverseProperty("CommunityGroups")] + public virtual CmsAvatar? GroupAvatar { get; set; } + + [ForeignKey("GroupCreatedByUserId")] + [InverseProperty("CommunityGroupGroupCreatedByUsers")] + public virtual CmsUser? GroupCreatedByUser { get; set; } + + [ForeignKey("GroupSiteId")] + [InverseProperty("CommunityGroups")] + public virtual CmsSite GroupSite { get; set; } = null!; + + [InverseProperty("LibraryGroup")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("PollGroup")] + public virtual ICollection PollsPolls { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/CommunityGroupMember.cs b/Migration.Toolkit.K11/Models/CommunityGroupMember.cs index 5684378f..3ab6ee47 100644 --- a/Migration.Toolkit.K11/Models/CommunityGroupMember.cs +++ b/Migration.Toolkit.K11/Models/CommunityGroupMember.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Community_GroupMember")] -[Index("MemberApprovedByUserId", Name = "IX_Community_GroupMember_MemberApprovedByUserID")] -[Index("MemberGroupId", Name = "IX_Community_GroupMember_MemberGroupID")] -[Index("MemberInvitedByUserId", Name = "IX_Community_GroupMember_MemberInvitedByUserID")] -[Index("MemberStatus", Name = "IX_Community_GroupMember_MemberStatus")] -[Index("MemberUserId", Name = "IX_Community_GroupMember_MemberUserID")] -public partial class CommunityGroupMember -{ - [Key] - [Column("MemberID")] - public int MemberId { get; set; } - - [Column("MemberGUID")] - public Guid MemberGuid { get; set; } - - [Column("MemberUserID")] - public int MemberUserId { get; set; } - - [Column("MemberGroupID")] - public int MemberGroupId { get; set; } - - public DateTime MemberJoined { get; set; } - - public DateTime? MemberApprovedWhen { get; set; } - - public DateTime? MemberRejectedWhen { get; set; } - - [Column("MemberApprovedByUserID")] - public int? MemberApprovedByUserId { get; set; } - - public string? MemberComment { get; set; } - - [Column("MemberInvitedByUserID")] - public int? MemberInvitedByUserId { get; set; } - - public int? MemberStatus { get; set; } - - [ForeignKey("MemberApprovedByUserId")] - [InverseProperty("CommunityGroupMemberMemberApprovedByUsers")] - public virtual CmsUser? MemberApprovedByUser { get; set; } - - [ForeignKey("MemberGroupId")] - [InverseProperty("CommunityGroupMembers")] - public virtual CommunityGroup MemberGroup { get; set; } = null!; - - [ForeignKey("MemberInvitedByUserId")] - [InverseProperty("CommunityGroupMemberMemberInvitedByUsers")] - public virtual CmsUser? MemberInvitedByUser { get; set; } - - [ForeignKey("MemberUserId")] - [InverseProperty("CommunityGroupMemberMemberUsers")] - public virtual CmsUser MemberUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Community_GroupMember")] +[Index("MemberApprovedByUserId", Name = "IX_Community_GroupMember_MemberApprovedByUserID")] +[Index("MemberGroupId", Name = "IX_Community_GroupMember_MemberGroupID")] +[Index("MemberInvitedByUserId", Name = "IX_Community_GroupMember_MemberInvitedByUserID")] +[Index("MemberStatus", Name = "IX_Community_GroupMember_MemberStatus")] +[Index("MemberUserId", Name = "IX_Community_GroupMember_MemberUserID")] +public class CommunityGroupMember +{ + [Key] + [Column("MemberID")] + public int MemberId { get; set; } + + [Column("MemberGUID")] + public Guid MemberGuid { get; set; } + + [Column("MemberUserID")] + public int MemberUserId { get; set; } + + [Column("MemberGroupID")] + public int MemberGroupId { get; set; } + + public DateTime MemberJoined { get; set; } + + public DateTime? MemberApprovedWhen { get; set; } + + public DateTime? MemberRejectedWhen { get; set; } + + [Column("MemberApprovedByUserID")] + public int? MemberApprovedByUserId { get; set; } + + public string? MemberComment { get; set; } + + [Column("MemberInvitedByUserID")] + public int? MemberInvitedByUserId { get; set; } + + public int? MemberStatus { get; set; } + + [ForeignKey("MemberApprovedByUserId")] + [InverseProperty("CommunityGroupMemberMemberApprovedByUsers")] + public virtual CmsUser? MemberApprovedByUser { get; set; } + + [ForeignKey("MemberGroupId")] + [InverseProperty("CommunityGroupMembers")] + public virtual CommunityGroup MemberGroup { get; set; } = null!; + + [ForeignKey("MemberInvitedByUserId")] + [InverseProperty("CommunityGroupMemberMemberInvitedByUsers")] + public virtual CmsUser? MemberInvitedByUser { get; set; } + + [ForeignKey("MemberUserId")] + [InverseProperty("CommunityGroupMemberMemberUsers")] + public virtual CmsUser MemberUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs b/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs index 9a190a36..1aa1c519 100644 --- a/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs +++ b/Migration.Toolkit.K11/Models/CommunityGroupRolePermission.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("GroupId", "RoleId", "PermissionId")] -[Table("Community_GroupRolePermission")] -[Index("PermissionId", Name = "IX_Community_GroupRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Community_GroupRolePermission_RoleID")] -public partial class CommunityGroupRolePermission -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("GroupId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CommunityGroup Group { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("GroupId", "RoleId", "PermissionId")] +[Table("Community_GroupRolePermission")] +[Index("PermissionId", Name = "IX_Community_GroupRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Community_GroupRolePermission_RoleID")] +public class CommunityGroupRolePermission +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("GroupId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CommunityGroup Group { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/CommunityInvitation.cs b/Migration.Toolkit.K11/Models/CommunityInvitation.cs index 9683b3bd..293c6c35 100644 --- a/Migration.Toolkit.K11/Models/CommunityInvitation.cs +++ b/Migration.Toolkit.K11/Models/CommunityInvitation.cs @@ -1,53 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Community_Invitation")] -[Index("InvitationGroupId", Name = "IX_Community_Invitation_InvitationGroupID")] -[Index("InvitedByUserId", Name = "IX_Community_Invitation_InvitedByUserID")] -[Index("InvitedUserId", Name = "IX_Community_Invitation_InvitedUserID")] -public partial class CommunityInvitation -{ - [Key] - [Column("InvitationID")] - public int InvitationId { get; set; } - - [Column("InvitedUserID")] - public int? InvitedUserId { get; set; } - - [Column("InvitedByUserID")] - public int InvitedByUserId { get; set; } - - [Column("InvitationGroupID")] - public int? InvitationGroupId { get; set; } - - public DateTime? InvitationCreated { get; set; } - - public DateTime? InvitationValidTo { get; set; } - - public string? InvitationComment { get; set; } - - [Column("InvitationGUID")] - public Guid InvitationGuid { get; set; } - - public DateTime InvitationLastModified { get; set; } - - [StringLength(254)] - public string? InvitationUserEmail { get; set; } - - [ForeignKey("InvitationGroupId")] - [InverseProperty("CommunityInvitations")] - public virtual CommunityGroup? InvitationGroup { get; set; } - - [ForeignKey("InvitedByUserId")] - [InverseProperty("CommunityInvitationInvitedByUsers")] - public virtual CmsUser InvitedByUser { get; set; } = null!; - - [ForeignKey("InvitedUserId")] - [InverseProperty("CommunityInvitationInvitedUsers")] - public virtual CmsUser? InvitedUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Community_Invitation")] +[Index("InvitationGroupId", Name = "IX_Community_Invitation_InvitationGroupID")] +[Index("InvitedByUserId", Name = "IX_Community_Invitation_InvitedByUserID")] +[Index("InvitedUserId", Name = "IX_Community_Invitation_InvitedUserID")] +public class CommunityInvitation +{ + [Key] + [Column("InvitationID")] + public int InvitationId { get; set; } + + [Column("InvitedUserID")] + public int? InvitedUserId { get; set; } + + [Column("InvitedByUserID")] + public int InvitedByUserId { get; set; } + + [Column("InvitationGroupID")] + public int? InvitationGroupId { get; set; } + + public DateTime? InvitationCreated { get; set; } + + public DateTime? InvitationValidTo { get; set; } + + public string? InvitationComment { get; set; } + + [Column("InvitationGUID")] + public Guid InvitationGuid { get; set; } + + public DateTime InvitationLastModified { get; set; } + + [StringLength(254)] + public string? InvitationUserEmail { get; set; } + + [ForeignKey("InvitationGroupId")] + [InverseProperty("CommunityInvitations")] + public virtual CommunityGroup? InvitationGroup { get; set; } + + [ForeignKey("InvitedByUserId")] + [InverseProperty("CommunityInvitationInvitedByUsers")] + public virtual CmsUser InvitedByUser { get; set; } = null!; + + [ForeignKey("InvitedUserId")] + [InverseProperty("CommunityInvitationInvitedUsers")] + public virtual CmsUser? InvitedUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentArticle.cs b/Migration.Toolkit.K11/Models/ContentArticle.cs index 1ffe1318..47382657 100644 --- a/Migration.Toolkit.K11/Models/ContentArticle.cs +++ b/Migration.Toolkit.K11/Models/ContentArticle.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Article")] -public partial class ContentArticle -{ - [Key] - [Column("ArticleID")] - public int ArticleId { get; set; } - - [StringLength(450)] - public string ArticleName { get; set; } = null!; - - public string? ArticleTeaserText { get; set; } - - public Guid? ArticleTeaserImage { get; set; } - - public string? ArticleText { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Article")] +public class ContentArticle +{ + [Key] + [Column("ArticleID")] + public int ArticleId { get; set; } + + [StringLength(450)] + public string ArticleName { get; set; } = null!; + + public string? ArticleTeaserText { get; set; } + + public Guid? ArticleTeaserImage { get; set; } + + public string? ArticleText { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentBlog.cs b/Migration.Toolkit.K11/Models/ContentBlog.cs index e40659a7..53261b84 100644 --- a/Migration.Toolkit.K11/Models/ContentBlog.cs +++ b/Migration.Toolkit.K11/Models/ContentBlog.cs @@ -1,57 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Blog")] -public partial class ContentBlog -{ - [Key] - [Column("BlogID")] - public int BlogId { get; set; } - - [StringLength(200)] - public string BlogName { get; set; } = null!; - - public string BlogDescription { get; set; } = null!; - - public string? BlogSideColumnText { get; set; } - - public Guid? BlogTeaser { get; set; } - - [StringLength(10)] - public string BlogOpenCommentsFor { get; set; } = null!; - - public bool? BlogRequireEmails { get; set; } - - [StringLength(254)] - public string? BlogSendCommentsToEmail { get; set; } - - [Required] - public bool? BlogAllowAnonymousComments { get; set; } - - [Required] - [Column("BlogUseCAPTCHAForComments")] - public bool? BlogUseCaptchaforComments { get; set; } - - public bool BlogModerateComments { get; set; } - - [StringLength(450)] - public string? BlogModerators { get; set; } - - public bool? BlogEnableSubscriptions { get; set; } - - public int? BlogEnableOptIn { get; set; } - - public int? BlogSendOptInConfirmation { get; set; } - - [StringLength(250)] - public string? BlogUnsubscriptionUrl { get; set; } - - [Column("BlogOptInApprovalURL")] - [StringLength(450)] - public string? BlogOptInApprovalUrl { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Blog")] +public class ContentBlog +{ + [Key] + [Column("BlogID")] + public int BlogId { get; set; } + + [StringLength(200)] + public string BlogName { get; set; } = null!; + + public string BlogDescription { get; set; } = null!; + + public string? BlogSideColumnText { get; set; } + + public Guid? BlogTeaser { get; set; } + + [StringLength(10)] + public string BlogOpenCommentsFor { get; set; } = null!; + + public bool? BlogRequireEmails { get; set; } + + [StringLength(254)] + public string? BlogSendCommentsToEmail { get; set; } + + [Required] + public bool? BlogAllowAnonymousComments { get; set; } + + [Required] + [Column("BlogUseCAPTCHAForComments")] + public bool? BlogUseCaptchaforComments { get; set; } + + public bool BlogModerateComments { get; set; } + + [StringLength(450)] + public string? BlogModerators { get; set; } + + public bool? BlogEnableSubscriptions { get; set; } + + public int? BlogEnableOptIn { get; set; } + + public int? BlogSendOptInConfirmation { get; set; } + + [StringLength(250)] + public string? BlogUnsubscriptionUrl { get; set; } + + [Column("BlogOptInApprovalURL")] + [StringLength(450)] + public string? BlogOptInApprovalUrl { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentBlogMonth.cs b/Migration.Toolkit.K11/Models/ContentBlogMonth.cs index d73a662a..efdff172 100644 --- a/Migration.Toolkit.K11/Models/ContentBlogMonth.cs +++ b/Migration.Toolkit.K11/Models/ContentBlogMonth.cs @@ -1,20 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_BlogMonth")] -public partial class ContentBlogMonth -{ - [Key] - [Column("BlogMonthID")] - public int BlogMonthId { get; set; } - - [StringLength(100)] - public string BlogMonthName { get; set; } = null!; - - public DateTime BlogMonthStartingDate { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_BlogMonth")] +public class ContentBlogMonth +{ + [Key] + [Column("BlogMonthID")] + public int BlogMonthId { get; set; } + + [StringLength(100)] + public string BlogMonthName { get; set; } = null!; + + public DateTime BlogMonthStartingDate { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentBlogPost.cs b/Migration.Toolkit.K11/Models/ContentBlogPost.cs index 7d698856..c4b7b8a4 100644 --- a/Migration.Toolkit.K11/Models/ContentBlogPost.cs +++ b/Migration.Toolkit.K11/Models/ContentBlogPost.cs @@ -1,38 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_BlogPost")] -public partial class ContentBlogPost -{ - [Key] - [Column("BlogPostID")] - public int BlogPostId { get; set; } - - [StringLength(200)] - public string BlogPostTitle { get; set; } = null!; - - public DateTime BlogPostDate { get; set; } - - public string? BlogPostSummary { get; set; } - - public string BlogPostBody { get; set; } = null!; - - public Guid? BlogPostTeaser { get; set; } - - [Required] - public bool? BlogPostAllowComments { get; set; } - - public bool? BlogLogActivity { get; set; } - - public string? FacebookAutoPost { get; set; } - - public string? TwitterAutoPost { get; set; } - - [StringLength(200)] - public string? LinkedInAutoPost { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_BlogPost")] +public class ContentBlogPost +{ + [Key] + [Column("BlogPostID")] + public int BlogPostId { get; set; } + + [StringLength(200)] + public string BlogPostTitle { get; set; } = null!; + + public DateTime BlogPostDate { get; set; } + + public string? BlogPostSummary { get; set; } + + public string BlogPostBody { get; set; } = null!; + + public Guid? BlogPostTeaser { get; set; } + + [Required] + public bool? BlogPostAllowComments { get; set; } + + public bool? BlogLogActivity { get; set; } + + public string? FacebookAutoPost { get; set; } + + public string? TwitterAutoPost { get; set; } + + [StringLength(200)] + public string? LinkedInAutoPost { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentBookingEvent.cs b/Migration.Toolkit.K11/Models/ContentBookingEvent.cs index 21be3d9b..f0a1b6b7 100644 --- a/Migration.Toolkit.K11/Models/ContentBookingEvent.cs +++ b/Migration.Toolkit.K11/Models/ContentBookingEvent.cs @@ -1,40 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_BookingEvent")] -public partial class ContentBookingEvent -{ - [Key] - [Column("BookingEventID")] - public int BookingEventId { get; set; } - - [StringLength(200)] - public string EventName { get; set; } = null!; - - public string? EventSummary { get; set; } - - public string? EventDetails { get; set; } - - public string? EventLocation { get; set; } - - public DateTime? EventDate { get; set; } - - public DateTime? EventEndDate { get; set; } - - public bool? EventAllDay { get; set; } - - public int? EventCapacity { get; set; } - - public bool? EventAllowRegistrationOverCapacity { get; set; } - - public DateTime? EventOpenFrom { get; set; } - - public DateTime? EventOpenTo { get; set; } - - public bool? EventLogActivity { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_BookingEvent")] +public class ContentBookingEvent +{ + [Key] + [Column("BookingEventID")] + public int BookingEventId { get; set; } + + [StringLength(200)] + public string EventName { get; set; } = null!; + + public string? EventSummary { get; set; } + + public string? EventDetails { get; set; } + + public string? EventLocation { get; set; } + + public DateTime? EventDate { get; set; } + + public DateTime? EventEndDate { get; set; } + + public bool? EventAllDay { get; set; } + + public int? EventCapacity { get; set; } + + public bool? EventAllowRegistrationOverCapacity { get; set; } + + public DateTime? EventOpenFrom { get; set; } + + public DateTime? EventOpenTo { get; set; } + + public bool? EventLogActivity { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentCellphone.cs b/Migration.Toolkit.K11/Models/ContentCellphone.cs index 0a48b759..5fe2f546 100644 --- a/Migration.Toolkit.K11/Models/ContentCellphone.cs +++ b/Migration.Toolkit.K11/Models/ContentCellphone.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Cellphone")] -public partial class ContentCellphone -{ - [Key] - [Column("CellphoneID")] - public int CellphoneId { get; set; } - - [StringLength(100)] - public string? CellDisplayType { get; set; } - - public int? CellDisplayWidth { get; set; } - - public int? CellDisplayHeight { get; set; } - - [StringLength(100)] - public string? CellDisplayResolution { get; set; } - - public bool? CellBluetooth { get; set; } - - [Column("CellIrDA")] - public bool? CellIrDa { get; set; } - - [Column("CellGPRS")] - public bool? CellGprs { get; set; } - - [Column("CellEDGE")] - public bool? CellEdge { get; set; } - - [Column("CellHSCSD")] - public bool? CellHscsd { get; set; } - - public bool? Cell3G { get; set; } - - public bool? CellWiFi { get; set; } - - public bool? CellJava { get; set; } - - public bool? CellCamera { get; set; } - - [Column("CellMP3")] - public bool? CellMp3 { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Cellphone")] +public class ContentCellphone +{ + [Key] + [Column("CellphoneID")] + public int CellphoneId { get; set; } + + [StringLength(100)] + public string? CellDisplayType { get; set; } + + public int? CellDisplayWidth { get; set; } + + public int? CellDisplayHeight { get; set; } + + [StringLength(100)] + public string? CellDisplayResolution { get; set; } + + public bool? CellBluetooth { get; set; } + + [Column("CellIrDA")] + public bool? CellIrDa { get; set; } + + [Column("CellGPRS")] + public bool? CellGprs { get; set; } + + [Column("CellEDGE")] + public bool? CellEdge { get; set; } + + [Column("CellHSCSD")] + public bool? CellHscsd { get; set; } + + public bool? Cell3G { get; set; } + + public bool? CellWiFi { get; set; } + + public bool? CellJava { get; set; } + + public bool? CellCamera { get; set; } + + [Column("CellMP3")] + public bool? CellMp3 { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentEbook.cs b/Migration.Toolkit.K11/Models/ContentEbook.cs index a8af10f9..af2cc408 100644 --- a/Migration.Toolkit.K11/Models/ContentEbook.cs +++ b/Migration.Toolkit.K11/Models/ContentEbook.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Ebook")] -public partial class ContentEbook -{ - [Key] - [Column("EbookID")] - public int EbookId { get; set; } - - [StringLength(100)] - public string? BookAuthor { get; set; } - - [StringLength(100)] - public string? BookPublisher { get; set; } - - [StringLength(100)] - public string? BookFormat { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Ebook")] +public class ContentEbook +{ + [Key] + [Column("EbookID")] + public int EbookId { get; set; } + + [StringLength(100)] + public string? BookAuthor { get; set; } + + [StringLength(100)] + public string? BookPublisher { get; set; } + + [StringLength(100)] + public string? BookFormat { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentEvent.cs b/Migration.Toolkit.K11/Models/ContentEvent.cs index 3468f390..a30606fe 100644 --- a/Migration.Toolkit.K11/Models/ContentEvent.cs +++ b/Migration.Toolkit.K11/Models/ContentEvent.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Event")] -public partial class ContentEvent -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(200)] - public string EventName { get; set; } = null!; - - public string? EventSummary { get; set; } - - public string? EventDetails { get; set; } - - public string? EventLocation { get; set; } - - public DateTime? EventDate { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Event")] +public class ContentEvent +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(200)] + public string EventName { get; set; } = null!; + + public string? EventSummary { get; set; } + + public string? EventDetails { get; set; } + + public string? EventLocation { get; set; } + + public DateTime? EventDate { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentFaq.cs b/Migration.Toolkit.K11/Models/ContentFaq.cs index 87652425..79f5440a 100644 --- a/Migration.Toolkit.K11/Models/ContentFaq.cs +++ b/Migration.Toolkit.K11/Models/ContentFaq.cs @@ -1,22 +1,19 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_FAQ")] -public partial class ContentFaq -{ - [Key] - [Column("FAQID")] - public int Faqid { get; set; } - - [Column("FAQQuestion")] - [StringLength(450)] - public string Faqquestion { get; set; } = null!; - - [Column("FAQAnswer")] - public string Faqanswer { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_FAQ")] +public class ContentFaq +{ + [Key] + [Column("FAQID")] + public int Faqid { get; set; } + + [Column("FAQQuestion")] + [StringLength(450)] + public string Faqquestion { get; set; } = null!; + + [Column("FAQAnswer")] + public string Faqanswer { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ContentFile.cs b/Migration.Toolkit.K11/Models/ContentFile.cs index 91da1bf4..da05bec8 100644 --- a/Migration.Toolkit.K11/Models/ContentFile.cs +++ b/Migration.Toolkit.K11/Models/ContentFile.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_File")] -public partial class ContentFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(500)] - public string? FileDescription { get; set; } - - [StringLength(100)] - public string FileName { get; set; } = null!; - - public Guid? FileAttachment { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_File")] +public class ContentFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(500)] + public string? FileDescription { get; set; } + + [StringLength(100)] + public string FileName { get; set; } = null!; + + public Guid? FileAttachment { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs b/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs index 082c88fe..dffdc26f 100644 --- a/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs +++ b/Migration.Toolkit.K11/Models/ContentHeadlineBanner.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_HeadlineBanner")] -public partial class ContentHeadlineBanner -{ - [Key] - [Column("HeadlineBannerID")] - public int HeadlineBannerId { get; set; } - - [StringLength(50)] - public string HeadlineBannerDescription { get; set; } = null!; - - [StringLength(300)] - public string? HeadlineBannerImage { get; set; } - - [StringLength(300)] - public string HeadlineBannerDocumentUrl { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_HeadlineBanner")] +public class ContentHeadlineBanner +{ + [Key] + [Column("HeadlineBannerID")] + public int HeadlineBannerId { get; set; } + + [StringLength(50)] + public string HeadlineBannerDescription { get; set; } = null!; + + [StringLength(300)] + public string? HeadlineBannerImage { get; set; } + + [StringLength(300)] + public string HeadlineBannerDocumentUrl { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ContentImageGallery.cs b/Migration.Toolkit.K11/Models/ContentImageGallery.cs index 82691eef..8bf5efa3 100644 --- a/Migration.Toolkit.K11/Models/ContentImageGallery.cs +++ b/Migration.Toolkit.K11/Models/ContentImageGallery.cs @@ -1,22 +1,19 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_ImageGallery")] -public partial class ContentImageGallery -{ - [Key] - [Column("ImageGalleryID")] - public int ImageGalleryId { get; set; } - - [StringLength(1000)] - public string GalleryName { get; set; } = null!; - - public string? GalleryDescription { get; set; } - - public Guid? GalleryTeaserImage { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_ImageGallery")] +public class ContentImageGallery +{ + [Key] + [Column("ImageGalleryID")] + public int ImageGalleryId { get; set; } + + [StringLength(1000)] + public string GalleryName { get; set; } = null!; + + public string? GalleryDescription { get; set; } + + public Guid? GalleryTeaserImage { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentJob.cs b/Migration.Toolkit.K11/Models/ContentJob.cs index 5d3d4387..f44699f7 100644 --- a/Migration.Toolkit.K11/Models/ContentJob.cs +++ b/Migration.Toolkit.K11/Models/ContentJob.cs @@ -1,30 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Job")] -public partial class ContentJob -{ - [Key] - [Column("JobID")] - public int JobId { get; set; } - - [StringLength(200)] - public string JobName { get; set; } = null!; - - public string? JobSummary { get; set; } - - public string? JobDescription { get; set; } - - public string? JobLocation { get; set; } - - public string? JobCompensation { get; set; } - - public string? JobContact { get; set; } - - public Guid? JobAttachment { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Job")] +public class ContentJob +{ + [Key] + [Column("JobID")] + public int JobId { get; set; } + + [StringLength(200)] + public string JobName { get; set; } = null!; + + public string? JobSummary { get; set; } + + public string? JobDescription { get; set; } + + public string? JobLocation { get; set; } + + public string? JobCompensation { get; set; } + + public string? JobContact { get; set; } + + public Guid? JobAttachment { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentKbarticle.cs b/Migration.Toolkit.K11/Models/ContentKbarticle.cs index 5e6006b9..e88e4d7e 100644 --- a/Migration.Toolkit.K11/Models/ContentKbarticle.cs +++ b/Migration.Toolkit.K11/Models/ContentKbarticle.cs @@ -1,29 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_KBArticle")] -public partial class ContentKbarticle -{ - [Key] - [Column("KBArticleID")] - public int KbarticleId { get; set; } - - [StringLength(200)] - public string? ArticleIdentifier { get; set; } - - [StringLength(400)] - public string ArticleName { get; set; } = null!; - - public string ArticleSummary { get; set; } = null!; - - public string ArticleAppliesTo { get; set; } = null!; - - public string ArticleText { get; set; } = null!; - - public string? ArticleSeeAlso { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_KBArticle")] +public class ContentKbarticle +{ + [Key] + [Column("KBArticleID")] + public int KbarticleId { get; set; } + + [StringLength(200)] + public string? ArticleIdentifier { get; set; } + + [StringLength(400)] + public string ArticleName { get; set; } = null!; + + public string ArticleSummary { get; set; } = null!; + + public string ArticleAppliesTo { get; set; } = null!; + + public string ArticleText { get; set; } = null!; + + public string? ArticleSeeAlso { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentLaptop.cs b/Migration.Toolkit.K11/Models/ContentLaptop.cs index f1923854..c39726df 100644 --- a/Migration.Toolkit.K11/Models/ContentLaptop.cs +++ b/Migration.Toolkit.K11/Models/ContentLaptop.cs @@ -1,55 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Laptop")] -public partial class ContentLaptop -{ - [Key] - [Column("LaptopID")] - public int LaptopId { get; set; } - - [StringLength(100)] - public string? LaptopProcessorType { get; set; } - - [StringLength(50)] - public string? LaptopDisplayType { get; set; } - - [StringLength(50)] - public string? LaptopResolution { get; set; } - - [StringLength(100)] - public string? LaptopGraphicsCard { get; set; } - - [StringLength(50)] - public string? LaptopMemoryType { get; set; } - - public int? LaptopMemorySize { get; set; } - - [StringLength(100)] - public string? LaptopOpticalDrive { get; set; } - - [StringLength(100)] - public string? LaptopHardDrive { get; set; } - - [Column("LaptopWirelessLAN")] - public bool? LaptopWirelessLan { get; set; } - - public bool? LaptopBluetooth { get; set; } - - public bool? LaptopInfraport { get; set; } - - [StringLength(100)] - public string? LaptopBatteryType { get; set; } - - [StringLength(100)] - public string? LaptopOperatingSystem { get; set; } - - public string? LaptopAccessories { get; set; } - - public double? LaptopWeight { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Laptop")] +public class ContentLaptop +{ + [Key] + [Column("LaptopID")] + public int LaptopId { get; set; } + + [StringLength(100)] + public string? LaptopProcessorType { get; set; } + + [StringLength(50)] + public string? LaptopDisplayType { get; set; } + + [StringLength(50)] + public string? LaptopResolution { get; set; } + + [StringLength(100)] + public string? LaptopGraphicsCard { get; set; } + + [StringLength(50)] + public string? LaptopMemoryType { get; set; } + + public int? LaptopMemorySize { get; set; } + + [StringLength(100)] + public string? LaptopOpticalDrive { get; set; } + + [StringLength(100)] + public string? LaptopHardDrive { get; set; } + + [Column("LaptopWirelessLAN")] + public bool? LaptopWirelessLan { get; set; } + + public bool? LaptopBluetooth { get; set; } + + public bool? LaptopInfraport { get; set; } + + [StringLength(100)] + public string? LaptopBatteryType { get; set; } + + [StringLength(100)] + public string? LaptopOperatingSystem { get; set; } + + public string? LaptopAccessories { get; set; } + + public double? LaptopWeight { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentMenuItem.cs b/Migration.Toolkit.K11/Models/ContentMenuItem.cs index 0adba11e..dd1b88d2 100644 --- a/Migration.Toolkit.K11/Models/ContentMenuItem.cs +++ b/Migration.Toolkit.K11/Models/ContentMenuItem.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_MenuItem")] -public partial class ContentMenuItem -{ - [Key] - [Column("MenuItemID")] - public int MenuItemId { get; set; } - - [StringLength(450)] - public string MenuItemName { get; set; } = null!; - - public Guid? MenuItemTeaserImage { get; set; } - - [StringLength(100)] - public string? MenuItemGroup { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_MenuItem")] +public class ContentMenuItem +{ + [Key] + [Column("MenuItemID")] + public int MenuItemId { get; set; } + + [StringLength(450)] + public string MenuItemName { get; set; } = null!; + + public Guid? MenuItemTeaserImage { get; set; } + + [StringLength(100)] + public string? MenuItemGroup { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentNews.cs b/Migration.Toolkit.K11/Models/ContentNews.cs index 6273efb4..71cf206e 100644 --- a/Migration.Toolkit.K11/Models/ContentNews.cs +++ b/Migration.Toolkit.K11/Models/ContentNews.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_News")] -public partial class ContentNews -{ - [Key] - [Column("NewsID")] - public int NewsId { get; set; } - - [StringLength(450)] - public string NewsTitle { get; set; } = null!; - - public DateTime NewsReleaseDate { get; set; } - - public string NewsSummary { get; set; } = null!; - - public string? NewsText { get; set; } - - public Guid? NewsTeaser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_News")] +public class ContentNews +{ + [Key] + [Column("NewsID")] + public int NewsId { get; set; } + + [StringLength(450)] + public string NewsTitle { get; set; } = null!; + + public DateTime NewsReleaseDate { get; set; } + + public string NewsSummary { get; set; } = null!; + + public string? NewsText { get; set; } + + public Guid? NewsTeaser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentOffice.cs b/Migration.Toolkit.K11/Models/ContentOffice.cs index 08043482..206c2f48 100644 --- a/Migration.Toolkit.K11/Models/ContentOffice.cs +++ b/Migration.Toolkit.K11/Models/ContentOffice.cs @@ -1,62 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Office")] -public partial class ContentOffice -{ - [Key] - [Column("OfficeID")] - public int OfficeId { get; set; } - - [StringLength(400)] - public string OfficeName { get; set; } = null!; - - [StringLength(200)] - public string? OfficeCompanyName { get; set; } - - [StringLength(400)] - public string? OfficeAddress1 { get; set; } - - [StringLength(400)] - public string? OfficeAddress2 { get; set; } - - [StringLength(400)] - public string? OfficeCity { get; set; } - - [Column("OfficeZIP")] - [StringLength(50)] - public string? OfficeZip { get; set; } - - [StringLength(200)] - public string? OfficeState { get; set; } - - [StringLength(200)] - public string? OfficeCountry { get; set; } - - [StringLength(100)] - public string? OfficePhone { get; set; } - - [StringLength(254)] - public string? OfficeEmail { get; set; } - - public string? OfficeDirections { get; set; } - - public double? OfficeLatitude { get; set; } - - public double? OfficeLongitude { get; set; } - - public Guid? OfficePhoto { get; set; } - - public string? OfficeDescription { get; set; } - - public bool? OfficeIsHeadquarters { get; set; } - - [Column("OfficeIconURL")] - [StringLength(200)] - public string? OfficeIconUrl { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Office")] +public class ContentOffice +{ + [Key] + [Column("OfficeID")] + public int OfficeId { get; set; } + + [StringLength(400)] + public string OfficeName { get; set; } = null!; + + [StringLength(200)] + public string? OfficeCompanyName { get; set; } + + [StringLength(400)] + public string? OfficeAddress1 { get; set; } + + [StringLength(400)] + public string? OfficeAddress2 { get; set; } + + [StringLength(400)] + public string? OfficeCity { get; set; } + + [Column("OfficeZIP")] + [StringLength(50)] + public string? OfficeZip { get; set; } + + [StringLength(200)] + public string? OfficeState { get; set; } + + [StringLength(200)] + public string? OfficeCountry { get; set; } + + [StringLength(100)] + public string? OfficePhone { get; set; } + + [StringLength(254)] + public string? OfficeEmail { get; set; } + + public string? OfficeDirections { get; set; } + + public double? OfficeLatitude { get; set; } + + public double? OfficeLongitude { get; set; } + + public Guid? OfficePhoto { get; set; } + + public string? OfficeDescription { get; set; } + + public bool? OfficeIsHeadquarters { get; set; } + + [Column("OfficeIconURL")] + [StringLength(200)] + public string? OfficeIconUrl { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentPressRelease.cs b/Migration.Toolkit.K11/Models/ContentPressRelease.cs index 99b23508..475547ff 100644 --- a/Migration.Toolkit.K11/Models/ContentPressRelease.cs +++ b/Migration.Toolkit.K11/Models/ContentPressRelease.cs @@ -1,28 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_PressRelease")] -public partial class ContentPressRelease -{ - [Key] - [Column("PressReleaseID")] - public int PressReleaseId { get; set; } - - [StringLength(400)] - public string PressReleaseTitle { get; set; } = null!; - - public DateTime PressReleaseDate { get; set; } - - public string PressReleaseSummary { get; set; } = null!; - - public string PressReleaseText { get; set; } = null!; - - public string? PressReleaseAbout { get; set; } - - public string? PressReleaseTrademarks { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_PressRelease")] +public class ContentPressRelease +{ + [Key] + [Column("PressReleaseID")] + public int PressReleaseId { get; set; } + + [StringLength(400)] + public string PressReleaseTitle { get; set; } = null!; + + public DateTime PressReleaseDate { get; set; } + + public string PressReleaseSummary { get; set; } = null!; + + public string PressReleaseText { get; set; } = null!; + + public string? PressReleaseAbout { get; set; } + + public string? PressReleaseTrademarks { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentProduct.cs b/Migration.Toolkit.K11/Models/ContentProduct.cs index 3911bc84..2debabaa 100644 --- a/Migration.Toolkit.K11/Models/ContentProduct.cs +++ b/Migration.Toolkit.K11/Models/ContentProduct.cs @@ -1,18 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Product")] -public partial class ContentProduct -{ - [Key] - [Column("ProductID")] - public int ProductId { get; set; } - - [StringLength(440)] - public string? ProductName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Product")] +public class ContentProduct +{ + [Key] + [Column("ProductID")] + public int ProductId { get; set; } + + [StringLength(440)] + public string? ProductName { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs b/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs index cf3f470b..078b3b6b 100644 --- a/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs +++ b/Migration.Toolkit.K11/Models/ContentSimpleArticle.cs @@ -1,20 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_SimpleArticle")] -public partial class ContentSimpleArticle -{ - [Key] - [Column("ArticleID")] - public int ArticleId { get; set; } - - [StringLength(400)] - public string ArticleTitle { get; set; } = null!; - - public string ArticleText { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_SimpleArticle")] +public class ContentSimpleArticle +{ + [Key] + [Column("ArticleID")] + public int ArticleId { get; set; } + + [StringLength(400)] + public string ArticleTitle { get; set; } = null!; + + public string ArticleText { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ContentSmartphone.cs b/Migration.Toolkit.K11/Models/ContentSmartphone.cs index 520142e4..2dda1f36 100644 --- a/Migration.Toolkit.K11/Models/ContentSmartphone.cs +++ b/Migration.Toolkit.K11/Models/ContentSmartphone.cs @@ -1,57 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Smartphone")] -public partial class ContentSmartphone -{ - [Key] - [Column("SmartphoneID")] - public int SmartphoneId { get; set; } - - [Column("SmartphoneOS")] - [StringLength(100)] - public string? SmartphoneOs { get; set; } - - [StringLength(100)] - public string? SmartphoneDimensions { get; set; } - - [StringLength(50)] - public string? SmartphoneWeight { get; set; } - - [StringLength(50)] - public string? SmartphoneDisplayType { get; set; } - - [StringLength(50)] - public string? SmartphoneDisplaySize { get; set; } - - [StringLength(50)] - public string? SmartphoneDisplayResolution { get; set; } - - [Column("SmartphoneCPU")] - [StringLength(100)] - public string? SmartphoneCpu { get; set; } - - [Column("SmartphoneRAM")] - [StringLength(50)] - public string? SmartphoneRam { get; set; } - - [StringLength(50)] - public string? SmartphoneInternalStorage { get; set; } - - [StringLength(100)] - public string? SmartphoneRemovableStorage { get; set; } - - [StringLength(100)] - public string? SmartphoneBatteryType { get; set; } - - [StringLength(50)] - public string? SmartphoneCamera { get; set; } - - [Column("SmartphoneGPS")] - public bool? SmartphoneGps { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Smartphone")] +public class ContentSmartphone +{ + [Key] + [Column("SmartphoneID")] + public int SmartphoneId { get; set; } + + [Column("SmartphoneOS")] + [StringLength(100)] + public string? SmartphoneOs { get; set; } + + [StringLength(100)] + public string? SmartphoneDimensions { get; set; } + + [StringLength(50)] + public string? SmartphoneWeight { get; set; } + + [StringLength(50)] + public string? SmartphoneDisplayType { get; set; } + + [StringLength(50)] + public string? SmartphoneDisplaySize { get; set; } + + [StringLength(50)] + public string? SmartphoneDisplayResolution { get; set; } + + [Column("SmartphoneCPU")] + [StringLength(100)] + public string? SmartphoneCpu { get; set; } + + [Column("SmartphoneRAM")] + [StringLength(50)] + public string? SmartphoneRam { get; set; } + + [StringLength(50)] + public string? SmartphoneInternalStorage { get; set; } + + [StringLength(100)] + public string? SmartphoneRemovableStorage { get; set; } + + [StringLength(100)] + public string? SmartphoneBatteryType { get; set; } + + [StringLength(50)] + public string? SmartphoneCamera { get; set; } + + [Column("SmartphoneGPS")] + public bool? SmartphoneGps { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ContentSoftware.cs b/Migration.Toolkit.K11/Models/ContentSoftware.cs index 3b1681de..04479600 100644 --- a/Migration.Toolkit.K11/Models/ContentSoftware.cs +++ b/Migration.Toolkit.K11/Models/ContentSoftware.cs @@ -1,27 +1,24 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("CONTENT_Software")] -public partial class ContentSoftware -{ - [Key] - [Column("SoftwareID")] - public int SoftwareId { get; set; } - - [StringLength(100)] - public string? SoftwarePlatform { get; set; } - - [StringLength(100)] - public string? SoftwareLicense { get; set; } - - [StringLength(100)] - public string? SoftwareVersion { get; set; } - - [StringLength(100)] - public string? SoftwareLanguage { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("CONTENT_Software")] +public class ContentSoftware +{ + [Key] + [Column("SoftwareID")] + public int SoftwareId { get; set; } + + [StringLength(100)] + public string? SoftwarePlatform { get; set; } + + [StringLength(100)] + public string? SoftwareLicense { get; set; } + + [StringLength(100)] + public string? SoftwareVersion { get; set; } + + [StringLength(100)] + public string? SoftwareLanguage { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs b/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs index 95f961a7..db6dc98e 100644 --- a/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs +++ b/Migration.Toolkit.K11/Models/CustomtableSampleTable.cs @@ -1,31 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("customtable_SampleTable")] -public partial class CustomtableSampleTable -{ - [Key] - [Column("ItemID")] - public int ItemId { get; set; } - - public int? ItemCreatedBy { get; set; } - - public DateTime? ItemCreatedWhen { get; set; } - - public int? ItemModifiedBy { get; set; } - - public DateTime? ItemModifiedWhen { get; set; } - - public int? ItemOrder { get; set; } - - [StringLength(400)] - public string ItemText { get; set; } = null!; - - [Column("ItemGUID")] - public Guid ItemGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("customtable_SampleTable")] +public class CustomtableSampleTable +{ + [Key] + [Column("ItemID")] + public int ItemId { get; set; } + + public int? ItemCreatedBy { get; set; } + + public DateTime? ItemCreatedWhen { get; set; } + + public int? ItemModifiedBy { get; set; } + + public DateTime? ItemModifiedWhen { get; set; } + + public int? ItemOrder { get; set; } + + [StringLength(400)] + public string ItemText { get; set; } = null!; + + [Column("ItemGUID")] + public Guid ItemGuid { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatArticle.cs b/Migration.Toolkit.K11/Models/DancingGoatArticle.cs index 01147b68..6b9ec71e 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatArticle.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatArticle.cs @@ -1,25 +1,22 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Article")] -public partial class DancingGoatArticle -{ - [Key] - [Column("ArticleID")] - public int ArticleId { get; set; } - - [StringLength(450)] - public string ArticleTitle { get; set; } = null!; - - public Guid? ArticleTeaser { get; set; } - - [StringLength(190)] - public string ArticleSummary { get; set; } = null!; - - public string ArticleText { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Article")] +public class DancingGoatArticle +{ + [Key] + [Column("ArticleID")] + public int ArticleId { get; set; } + + [StringLength(450)] + public string ArticleTitle { get; set; } = null!; + + public Guid? ArticleTeaser { get; set; } + + [StringLength(190)] + public string ArticleSummary { get; set; } = null!; + + public string ArticleText { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs b/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs index fbde87f4..6c4b696b 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatBrewer.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Brewer")] -public partial class DancingGoatBrewer -{ - [Key] - [Column("BrewerID")] - public int BrewerId { get; set; } - - [StringLength(200)] - public string? BrewerPromotionTitle { get; set; } - - [StringLength(200)] - public string? BrewerPromotionDescription { get; set; } - - [StringLength(200)] - public string? BrewerBannerText { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Brewer")] +public class DancingGoatBrewer +{ + [Key] + [Column("BrewerID")] + public int BrewerId { get; set; } + + [StringLength(200)] + public string? BrewerPromotionTitle { get; set; } + + [StringLength(200)] + public string? BrewerPromotionDescription { get; set; } + + [StringLength(200)] + public string? BrewerBannerText { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatCafe.cs b/Migration.Toolkit.K11/Models/DancingGoatCafe.cs index d7ec3c34..c8efe994 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCafe.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatCafe.cs @@ -1,43 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Cafe")] -public partial class DancingGoatCafe -{ - [Key] - [Column("CafeID")] - public int CafeId { get; set; } - - [StringLength(50)] - public string CafeStreet { get; set; } = null!; - - [StringLength(50)] - public string CafeCity { get; set; } = null!; - - [StringLength(100)] - public string CafeCountry { get; set; } = null!; - - [StringLength(15)] - public string CafeZipCode { get; set; } = null!; - - [StringLength(30)] - public string CafePhone { get; set; } = null!; - - [StringLength(100)] - public string? CafeEmail { get; set; } - - public Guid? CafePhoto { get; set; } - - [Column("CafeIsAlsoARoastery")] - public bool? CafeIsAlsoAroastery { get; set; } - - public bool? CafeIsPartner { get; set; } - - [StringLength(50)] - public string? CafeName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Cafe")] +public class DancingGoatCafe +{ + [Key] + [Column("CafeID")] + public int CafeId { get; set; } + + [StringLength(50)] + public string CafeStreet { get; set; } = null!; + + [StringLength(50)] + public string CafeCity { get; set; } = null!; + + [StringLength(100)] + public string CafeCountry { get; set; } = null!; + + [StringLength(15)] + public string CafeZipCode { get; set; } = null!; + + [StringLength(30)] + public string CafePhone { get; set; } = null!; + + [StringLength(100)] + public string? CafeEmail { get; set; } + + public Guid? CafePhoto { get; set; } + + [Column("CafeIsAlsoARoastery")] + public bool? CafeIsAlsoAroastery { get; set; } + + public bool? CafeIsPartner { get; set; } + + [StringLength(50)] + public string? CafeName { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatCity.cs b/Migration.Toolkit.K11/Models/DancingGoatCity.cs index 25b07b25..27e78e2b 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCity.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatCity.cs @@ -1,21 +1,18 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_City")] -public partial class DancingGoatCity -{ - [Key] - [Column("CityID")] - public int CityId { get; set; } - - [StringLength(50)] - public string CityName { get; set; } = null!; - - [StringLength(100)] - public string? CityCountry { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_City")] +public class DancingGoatCity +{ + [Key] + [Column("CityID")] + public int CityId { get; set; } + + [StringLength(50)] + public string CityName { get; set; } = null!; + + [StringLength(100)] + public string? CityCountry { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs b/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs index 9da4d300..92d4dc95 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatCoffee.cs @@ -1,38 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Coffee")] -public partial class DancingGoatCoffee -{ - [Key] - [Column("CoffeeID")] - public int CoffeeId { get; set; } - - [StringLength(100)] - public string? CoffeeFarm { get; set; } - - [StringLength(100)] - public string? CoffeeCountry { get; set; } - - [StringLength(40)] - public string CoffeeVariety { get; set; } = null!; - - [StringLength(20)] - public string CoffeeProcessing { get; set; } = null!; - - public int? CoffeeAltitude { get; set; } - - [StringLength(200)] - public string? CoffeePromotionTitle { get; set; } - - [StringLength(200)] - public string? CoffeePromotionDescription { get; set; } - - [StringLength(200)] - public string? CoffeeBannerText { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Coffee")] +public class DancingGoatCoffee +{ + [Key] + [Column("CoffeeID")] + public int CoffeeId { get; set; } + + [StringLength(100)] + public string? CoffeeFarm { get; set; } + + [StringLength(100)] + public string? CoffeeCountry { get; set; } + + [StringLength(40)] + public string CoffeeVariety { get; set; } = null!; + + [StringLength(20)] + public string CoffeeProcessing { get; set; } = null!; + + public int? CoffeeAltitude { get; set; } + + [StringLength(200)] + public string? CoffeePromotionTitle { get; set; } + + [StringLength(200)] + public string? CoffeePromotionDescription { get; set; } + + [StringLength(200)] + public string? CoffeeBannerText { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatEbook.cs b/Migration.Toolkit.K11/Models/DancingGoatEbook.cs index 4222c449..b5a5d86a 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatEbook.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatEbook.cs @@ -1,22 +1,19 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Ebook")] -public partial class DancingGoatEbook -{ - [Key] - [Column("EbookID")] - public int EbookId { get; set; } - - [StringLength(200)] - public string? EbookAuthor { get; set; } - - [Column("EbookISBN")] - [StringLength(200)] - public string? EbookIsbn { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Ebook")] +public class DancingGoatEbook +{ + [Key] + [Column("EbookID")] + public int EbookId { get; set; } + + [StringLength(200)] + public string? EbookAuthor { get; set; } + + [Column("EbookISBN")] + [StringLength(200)] + public string? EbookIsbn { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs b/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs index 7bafc5de..9a499ba0 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatElectricGrinder.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_ElectricGrinder")] -public partial class DancingGoatElectricGrinder -{ - [Key] - [Column("ElectricGrinderID")] - public int ElectricGrinderId { get; set; } - - public int ElectricGrinderPower { get; set; } - - [StringLength(200)] - public string? ElectricGrinderPromotionTitle { get; set; } - - [StringLength(200)] - public string? ElectricGrinderPromotionDescription { get; set; } - - [StringLength(200)] - public string? ElectricGrinderBannerText { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_ElectricGrinder")] +public class DancingGoatElectricGrinder +{ + [Key] + [Column("ElectricGrinderID")] + public int ElectricGrinderId { get; set; } + + public int ElectricGrinderPower { get; set; } + + [StringLength(200)] + public string? ElectricGrinderPromotionTitle { get; set; } + + [StringLength(200)] + public string? ElectricGrinderPromotionDescription { get; set; } + + [StringLength(200)] + public string? ElectricGrinderBannerText { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs b/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs index effee0b7..872457f2 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatFilterPack.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_FilterPack")] -public partial class DancingGoatFilterPack -{ - [Key] - [Column("FilterPackID")] - public int FilterPackId { get; set; } - - public int FilterPackQuantity { get; set; } - - [StringLength(200)] - public string? FilterPromotionTitle { get; set; } - - [StringLength(200)] - public string? FilterPromotionDescription { get; set; } - - [StringLength(200)] - public string? FilterBannerText { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_FilterPack")] +public class DancingGoatFilterPack +{ + [Key] + [Column("FilterPackID")] + public int FilterPackId { get; set; } + + public int FilterPackQuantity { get; set; } + + [StringLength(200)] + public string? FilterPromotionTitle { get; set; } + + [StringLength(200)] + public string? FilterPromotionDescription { get; set; } + + [StringLength(200)] + public string? FilterBannerText { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs b/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs index f75a7302..c667d5c5 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatGrinder.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Grinder")] -public partial class DancingGoatGrinder -{ - [Key] - [Column("GrinderID")] - public int GrinderId { get; set; } - - [StringLength(200)] - public string? GrinderPromotionTitle { get; set; } - - [StringLength(200)] - public string? GrinderPromotionDescription { get; set; } - - [StringLength(200)] - public string? GrinderBannerText { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Grinder")] +public class DancingGoatGrinder +{ + [Key] + [Column("GrinderID")] + public int GrinderId { get; set; } + + [StringLength(200)] + public string? GrinderPromotionTitle { get; set; } + + [StringLength(200)] + public string? GrinderPromotionDescription { get; set; } + + [StringLength(200)] + public string? GrinderBannerText { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatMembership.cs b/Migration.Toolkit.K11/Models/DancingGoatMembership.cs index 806bea6e..a1437509 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatMembership.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatMembership.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Membership")] -public partial class DancingGoatMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [StringLength(200)] - public string? MembershipPromotionTitle { get; set; } - - [StringLength(200)] - public string? MembershipPromotionDescription { get; set; } - - [StringLength(200)] - public string? MembershipBannerText { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Membership")] +public class DancingGoatMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [StringLength(200)] + public string? MembershipPromotionTitle { get; set; } + + [StringLength(200)] + public string? MembershipPromotionDescription { get; set; } + + [StringLength(200)] + public string? MembershipBannerText { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatOffice.cs b/Migration.Toolkit.K11/Models/DancingGoatOffice.cs index 495957aa..da8a3607 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatOffice.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatOffice.cs @@ -1,39 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Office")] -public partial class DancingGoatOffice -{ - [Key] - [Column("OfficeID")] - public int OfficeId { get; set; } - - [StringLength(200)] - public string OfficeName { get; set; } = null!; - - [StringLength(200)] - public string OfficeCodeName { get; set; } = null!; - - [StringLength(200)] - public string OfficeStreet { get; set; } = null!; - - [StringLength(200)] - public string OfficeCity { get; set; } = null!; - - [StringLength(200)] - public string OfficeCountry { get; set; } = null!; - - [StringLength(200)] - public string OfficeZipCode { get; set; } = null!; - - [StringLength(200)] - public string OfficePhone { get; set; } = null!; - - [StringLength(200)] - public string OfficeEmail { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Office")] +public class DancingGoatOffice +{ + [Key] + [Column("OfficeID")] + public int OfficeId { get; set; } + + [StringLength(200)] + public string OfficeName { get; set; } = null!; + + [StringLength(200)] + public string OfficeCodeName { get; set; } = null!; + + [StringLength(200)] + public string OfficeStreet { get; set; } = null!; + + [StringLength(200)] + public string OfficeCity { get; set; } = null!; + + [StringLength(200)] + public string OfficeCountry { get; set; } = null!; + + [StringLength(200)] + public string OfficeZipCode { get; set; } = null!; + + [StringLength(200)] + public string OfficePhone { get; set; } = null!; + + [StringLength(200)] + public string OfficeEmail { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs b/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs index f80fccee..3bbbaec5 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatPartnerCafe.cs @@ -1,27 +1,24 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_PartnerCafe")] -public partial class DancingGoatPartnerCafe -{ - [Key] - [Column("PartnerCafeID")] - public int PartnerCafeId { get; set; } - - [StringLength(80)] - public string PartnerCafeName { get; set; } = null!; - - [StringLength(50)] - public string PartnerCafeStreet { get; set; } = null!; - - [StringLength(15)] - public string PartnerCafeZipCode { get; set; } = null!; - - [StringLength(20)] - public string? PartnerCafePhone { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_PartnerCafe")] +public class DancingGoatPartnerCafe +{ + [Key] + [Column("PartnerCafeID")] + public int PartnerCafeId { get; set; } + + [StringLength(80)] + public string PartnerCafeName { get; set; } = null!; + + [StringLength(50)] + public string PartnerCafeStreet { get; set; } = null!; + + [StringLength(15)] + public string PartnerCafeZipCode { get; set; } = null!; + + [StringLength(20)] + public string? PartnerCafePhone { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/DancingGoatTableware.cs b/Migration.Toolkit.K11/Models/DancingGoatTableware.cs index 92881aa6..61da58ae 100644 --- a/Migration.Toolkit.K11/Models/DancingGoatTableware.cs +++ b/Migration.Toolkit.K11/Models/DancingGoatTableware.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("DancingGoat_Tableware")] -public partial class DancingGoatTableware -{ - [Key] - [Column("TablewareID")] - public int TablewareId { get; set; } - - [StringLength(200)] - public string? TablewarePromotionTitle { get; set; } - - [StringLength(200)] - public string? TablewarePromotionDescription { get; set; } - - [StringLength(200)] - public string? TablewareBannerText { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("DancingGoat_Tableware")] +public class DancingGoatTableware +{ + [Key] + [Column("TablewareID")] + public int TablewareId { get; set; } + + [StringLength(200)] + public string? TablewarePromotionTitle { get; set; } + + [StringLength(200)] + public string? TablewarePromotionDescription { get; set; } + + [StringLength(200)] + public string? TablewareBannerText { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs b/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs index 4c5a0f45..025e4344 100644 --- a/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs +++ b/Migration.Toolkit.K11/Models/EcommerceCheckoutStep.cs @@ -1,18 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Ecommerce_CheckoutStep")] -public partial class EcommerceCheckoutStep -{ - [Key] - [Column("CheckoutStepID")] - public int CheckoutStepId { get; set; } - - [StringLength(1000)] - public string StepName { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("Ecommerce_CheckoutStep")] +public class EcommerceCheckoutStep +{ + [Key] + [Column("CheckoutStepID")] + public int CheckoutStepId { get; set; } + + [StringLength(1000)] + public string StepName { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs b/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs index 85423648..d0e3943b 100644 --- a/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs +++ b/Migration.Toolkit.K11/Models/EcommerceCheckoutWizard.cs @@ -1,18 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Ecommerce_CheckoutWizard")] -public partial class EcommerceCheckoutWizard -{ - [Key] - [Column("CheckoutWizardID")] - public int CheckoutWizardId { get; set; } - - [StringLength(1000)] - public string? WizardName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("Ecommerce_CheckoutWizard")] +public class EcommerceCheckoutWizard +{ + [Key] + [Column("CheckoutWizardID")] + public int CheckoutWizardId { get; set; } + + [StringLength(1000)] + public string? WizardName { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/EventsAttendee.cs b/Migration.Toolkit.K11/Models/EventsAttendee.cs index e8253c6c..ece716e8 100644 --- a/Migration.Toolkit.K11/Models/EventsAttendee.cs +++ b/Migration.Toolkit.K11/Models/EventsAttendee.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Events_Attendee")] -[Index("AttendeeEventNodeId", Name = "IX_Events_Attendee_AttendeeEventNodeID")] -public partial class EventsAttendee -{ - [Key] - [Column("AttendeeID")] - public int AttendeeId { get; set; } - - [StringLength(254)] - public string AttendeeEmail { get; set; } = null!; - - [StringLength(100)] - public string? AttendeeFirstName { get; set; } - - [StringLength(100)] - public string? AttendeeLastName { get; set; } - - [StringLength(50)] - public string? AttendeePhone { get; set; } - - [Column("AttendeeEventNodeID")] - public int AttendeeEventNodeId { get; set; } - - [Column("AttendeeGUID")] - public Guid AttendeeGuid { get; set; } - - public DateTime AttendeeLastModified { get; set; } - - [ForeignKey("AttendeeEventNodeId")] - [InverseProperty("EventsAttendees")] - public virtual CmsTree AttendeeEventNode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Events_Attendee")] +[Index("AttendeeEventNodeId", Name = "IX_Events_Attendee_AttendeeEventNodeID")] +public class EventsAttendee +{ + [Key] + [Column("AttendeeID")] + public int AttendeeId { get; set; } + + [StringLength(254)] + public string AttendeeEmail { get; set; } = null!; + + [StringLength(100)] + public string? AttendeeFirstName { get; set; } + + [StringLength(100)] + public string? AttendeeLastName { get; set; } + + [StringLength(50)] + public string? AttendeePhone { get; set; } + + [Column("AttendeeEventNodeID")] + public int AttendeeEventNodeId { get; set; } + + [Column("AttendeeGUID")] + public Guid AttendeeGuid { get; set; } + + public DateTime AttendeeLastModified { get; set; } + + [ForeignKey("AttendeeEventNodeId")] + [InverseProperty("EventsAttendees")] + public virtual CmsTree AttendeeEventNode { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ExportHistory.cs b/Migration.Toolkit.K11/Models/ExportHistory.cs index cd69b3a2..41ef5363 100644 --- a/Migration.Toolkit.K11/Models/ExportHistory.cs +++ b/Migration.Toolkit.K11/Models/ExportHistory.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Export_History")] -[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] -[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] -public partial class ExportHistory -{ - [Key] - [Column("ExportID")] - public int ExportId { get; set; } - - public DateTime ExportDateTime { get; set; } - - [StringLength(450)] - public string ExportFileName { get; set; } = null!; - - [Column("ExportSiteID")] - public int? ExportSiteId { get; set; } - - [Column("ExportUserID")] - public int? ExportUserId { get; set; } - - public string? ExportSettings { get; set; } - - [ForeignKey("ExportSiteId")] - [InverseProperty("ExportHistories")] - public virtual CmsSite? ExportSite { get; set; } - - [ForeignKey("ExportUserId")] - [InverseProperty("ExportHistories")] - public virtual CmsUser? ExportUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Export_History")] +[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] +[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] +public class ExportHistory +{ + [Key] + [Column("ExportID")] + public int ExportId { get; set; } + + public DateTime ExportDateTime { get; set; } + + [StringLength(450)] + public string ExportFileName { get; set; } = null!; + + [Column("ExportSiteID")] + public int? ExportSiteId { get; set; } + + [Column("ExportUserID")] + public int? ExportUserId { get; set; } + + public string? ExportSettings { get; set; } + + [ForeignKey("ExportSiteId")] + [InverseProperty("ExportHistories")] + public virtual CmsSite? ExportSite { get; set; } + + [ForeignKey("ExportUserId")] + [InverseProperty("ExportHistories")] + public virtual CmsUser? ExportUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ExportTask.cs b/Migration.Toolkit.K11/Models/ExportTask.cs index a2081d54..204ae5bf 100644 --- a/Migration.Toolkit.K11/Models/ExportTask.cs +++ b/Migration.Toolkit.K11/Models/ExportTask.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Export_Task")] -[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] -public partial class ExportTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("ExportTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Export_Task")] +[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] +public class ExportTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("ExportTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/FormContactU.cs b/Migration.Toolkit.K11/Models/FormContactU.cs index f65d74ca..df83855b 100644 --- a/Migration.Toolkit.K11/Models/FormContactU.cs +++ b/Migration.Toolkit.K11/Models/FormContactU.cs @@ -1,33 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Form_ContactUs")] -public partial class FormContactU -{ - [Key] - [Column("ContactUsID")] - public int ContactUsId { get; set; } - - public DateTime FormInserted { get; set; } - - public DateTime FormUpdated { get; set; } - - [StringLength(200)] - public string FirstName { get; set; } = null!; - - [StringLength(200)] - public string LastName { get; set; } = null!; - - [StringLength(100)] - public string Email { get; set; } = null!; - - [StringLength(14)] - public string PhoneNumber { get; set; } = null!; - - public string Message { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("Form_ContactUs")] +public class FormContactU +{ + [Key] + [Column("ContactUsID")] + public int ContactUsId { get; set; } + + public DateTime FormInserted { get; set; } + + public DateTime FormUpdated { get; set; } + + [StringLength(200)] + public string FirstName { get; set; } = null!; + + [StringLength(200)] + public string LastName { get; set; } = null!; + + [StringLength(100)] + public string Email { get; set; } = null!; + + [StringLength(14)] + public string PhoneNumber { get; set; } = null!; + + public string Message { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs b/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs index 37d83650..156f4aec 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs +++ b/Migration.Toolkit.K11/Models/FormDancingGoatBusinessCustomerRegistration.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Form_DancingGoat_BusinessCustomerRegistration")] -public partial class FormDancingGoatBusinessCustomerRegistration -{ - [Key] - [Column("BusinessCustomerRegistrationID")] - public int BusinessCustomerRegistrationId { get; set; } - - [StringLength(200)] - public string CompanyName { get; set; } = null!; - - [StringLength(200)] - public string FirstName { get; set; } = null!; - - [StringLength(200)] - public string LastName { get; set; } = null!; - - [StringLength(200)] - public string? Phone { get; set; } - - [StringLength(200)] - public string Email { get; set; } = null!; - - [StringLength(200)] - public string BecomePartner { get; set; } = null!; - - [Precision(0)] - public DateTime FormInserted { get; set; } - - [Precision(0)] - public DateTime FormUpdated { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Form_DancingGoat_BusinessCustomerRegistration")] +public class FormDancingGoatBusinessCustomerRegistration +{ + [Key] + [Column("BusinessCustomerRegistrationID")] + public int BusinessCustomerRegistrationId { get; set; } + + [StringLength(200)] + public string CompanyName { get; set; } = null!; + + [StringLength(200)] + public string FirstName { get; set; } = null!; + + [StringLength(200)] + public string LastName { get; set; } = null!; + + [StringLength(200)] + public string? Phone { get; set; } + + [StringLength(200)] + public string Email { get; set; } = null!; + + [StringLength(200)] + public string BecomePartner { get; set; } = null!; + + [Precision(0)] + public DateTime FormInserted { get; set; } + + [Precision(0)] + public DateTime FormUpdated { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs b/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs index eac2900c..412be22e 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs +++ b/Migration.Toolkit.K11/Models/FormDancingGoatContactU.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Form_DancingGoat_ContactUs")] -public partial class FormDancingGoatContactU -{ - [Key] - [Column("ContactUsID")] - public int ContactUsId { get; set; } - - [StringLength(200)] - public string? UserFirstName { get; set; } - - [StringLength(200)] - public string? UserLastName { get; set; } - - [StringLength(100)] - public string UserEmail { get; set; } = null!; - - [StringLength(500)] - public string UserMessage { get; set; } = null!; - - [Precision(0)] - public DateTime FormInserted { get; set; } - - [Precision(0)] - public DateTime FormUpdated { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Form_DancingGoat_ContactUs")] +public class FormDancingGoatContactU +{ + [Key] + [Column("ContactUsID")] + public int ContactUsId { get; set; } + + [StringLength(200)] + public string? UserFirstName { get; set; } + + [StringLength(200)] + public string? UserLastName { get; set; } + + [StringLength(100)] + public string UserEmail { get; set; } = null!; + + [StringLength(500)] + public string UserMessage { get; set; } = null!; + + [Precision(0)] + public DateTime FormInserted { get; set; } + + [Precision(0)] + public DateTime FormUpdated { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs b/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs index 368ae9b5..dec11a64 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs +++ b/Migration.Toolkit.K11/Models/FormDancingGoatMachineRental.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Form_DancingGoat_MachineRental")] -public partial class FormDancingGoatMachineRental -{ - [Key] - [Column("MachineRentalID")] - public int MachineRentalId { get; set; } - - [StringLength(200)] - public string? Email { get; set; } - - [StringLength(200)] - public string Machine { get; set; } = null!; - - [StringLength(200)] - public string RentalPeriod { get; set; } = null!; - - [StringLength(200)] - public string? Details { get; set; } - - [Precision(0)] - public DateTime FormInserted { get; set; } - - [Precision(0)] - public DateTime FormUpdated { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Form_DancingGoat_MachineRental")] +public class FormDancingGoatMachineRental +{ + [Key] + [Column("MachineRentalID")] + public int MachineRentalId { get; set; } + + [StringLength(200)] + public string? Email { get; set; } + + [StringLength(200)] + public string Machine { get; set; } = null!; + + [StringLength(200)] + public string RentalPeriod { get; set; } = null!; + + [StringLength(200)] + public string? Details { get; set; } + + [Precision(0)] + public DateTime FormInserted { get; set; } + + [Precision(0)] + public DateTime FormUpdated { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs b/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs index 5c9ec61c..7a77760d 100644 --- a/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs +++ b/Migration.Toolkit.K11/Models/FormDancingGoatTryFreeSample.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Form_DancingGoat_TryFreeSample")] -public partial class FormDancingGoatTryFreeSample -{ - [Key] - [Column("TryAFreeSampleID")] - public int TryAfreeSampleId { get; set; } - - [Precision(0)] - public DateTime FormInserted { get; set; } - - [Precision(0)] - public DateTime FormUpdated { get; set; } - - [StringLength(500)] - public string FirstName { get; set; } = null!; - - [StringLength(500)] - public string LastName { get; set; } = null!; - - [StringLength(500)] - public string EmailAddress { get; set; } = null!; - - [StringLength(500)] - public string Address { get; set; } = null!; - - [StringLength(500)] - public string City { get; set; } = null!; - - [Column("ZIPCode")] - [StringLength(500)] - public string Zipcode { get; set; } = null!; - - [StringLength(3)] - public string Country { get; set; } = null!; - - [StringLength(500)] - public string? State { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Form_DancingGoat_TryFreeSample")] +public class FormDancingGoatTryFreeSample +{ + [Key] + [Column("TryAFreeSampleID")] + public int TryAfreeSampleId { get; set; } + + [Precision(0)] + public DateTime FormInserted { get; set; } + + [Precision(0)] + public DateTime FormUpdated { get; set; } + + [StringLength(500)] + public string FirstName { get; set; } = null!; + + [StringLength(500)] + public string LastName { get; set; } = null!; + + [StringLength(500)] + public string EmailAddress { get; set; } = null!; + + [StringLength(500)] + public string Address { get; set; } = null!; + + [StringLength(500)] + public string City { get; set; } = null!; + + [Column("ZIPCode")] + [StringLength(500)] + public string Zipcode { get; set; } = null!; + + [StringLength(3)] + public string Country { get; set; } = null!; + + [StringLength(500)] + public string? State { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs b/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs index 504f6414..8aa6e8e4 100644 --- a/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs +++ b/Migration.Toolkit.K11/Models/FormEcommerceSiteGeneralQuestion.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Form_EcommerceSite_GeneralQuestion")] -public partial class FormEcommerceSiteGeneralQuestion -{ - [Key] - [Column("GeneralQuestionID")] - public int GeneralQuestionId { get; set; } - - [StringLength(150)] - public string GeneralQuestionEmail { get; set; } = null!; - - public string GeneralQuestionText { get; set; } = null!; - - public DateTime FormInserted { get; set; } - - public DateTime FormUpdated { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("Form_EcommerceSite_GeneralQuestion")] +public class FormEcommerceSiteGeneralQuestion +{ + [Key] + [Column("GeneralQuestionID")] + public int GeneralQuestionId { get; set; } + + [StringLength(150)] + public string GeneralQuestionEmail { get; set; } = null!; + + public string GeneralQuestionText { get; set; } = null!; + + public DateTime FormInserted { get; set; } + + public DateTime FormUpdated { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs b/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs index 7ea136e9..84363ddf 100644 --- a/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs +++ b/Migration.Toolkit.K11/Models/FormEcommerceSiteProductQuestion.cs @@ -1,27 +1,24 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Form_EcommerceSite_ProductQuestion")] -public partial class FormEcommerceSiteProductQuestion -{ - [Key] - [Column("ProductQuestionID")] - public int ProductQuestionId { get; set; } - - [StringLength(150)] - public string ProductQuestionEmail { get; set; } = null!; - - public string ProductQuestionText { get; set; } = null!; - - [StringLength(500)] - public string ProductQuestionProduct { get; set; } = null!; - - public DateTime FormInserted { get; set; } - - public DateTime FormUpdated { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("Form_EcommerceSite_ProductQuestion")] +public class FormEcommerceSiteProductQuestion +{ + [Key] + [Column("ProductQuestionID")] + public int ProductQuestionId { get; set; } + + [StringLength(150)] + public string ProductQuestionEmail { get; set; } = null!; + + public string ProductQuestionText { get; set; } = null!; + + [StringLength(500)] + public string ProductQuestionProduct { get; set; } = null!; + + public DateTime FormInserted { get; set; } + + public DateTime FormUpdated { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ForumsAttachment.cs b/Migration.Toolkit.K11/Models/ForumsAttachment.cs index 35f4207f..3bf5eb62 100644 --- a/Migration.Toolkit.K11/Models/ForumsAttachment.cs +++ b/Migration.Toolkit.K11/Models/ForumsAttachment.cs @@ -1,53 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_Attachment")] -[Index("AttachmentSiteId", "AttachmentGuid", Name = "IX_Forums_Attachment_AttachmentGUID", IsUnique = true)] -[Index("AttachmentPostId", Name = "IX_Forums_Attachment_AttachmentPostID")] -public partial class ForumsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(200)] - public string AttachmentFileName { get; set; } = null!; - - [StringLength(10)] - public string AttachmentFileExtension { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public int AttachmentFileSize { get; set; } - - public int? AttachmentImageHeight { get; set; } - - public int? AttachmentImageWidth { get; set; } - - [Column("AttachmentPostID")] - public int AttachmentPostId { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentPostId")] - [InverseProperty("ForumsAttachments")] - public virtual ForumsForumPost AttachmentPost { get; set; } = null!; - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("ForumsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Forums_Attachment")] +[Index("AttachmentSiteId", "AttachmentGuid", Name = "IX_Forums_Attachment_AttachmentGUID", IsUnique = true)] +[Index("AttachmentPostId", Name = "IX_Forums_Attachment_AttachmentPostID")] +public class ForumsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(200)] + public string AttachmentFileName { get; set; } = null!; + + [StringLength(10)] + public string AttachmentFileExtension { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public int AttachmentFileSize { get; set; } + + public int? AttachmentImageHeight { get; set; } + + public int? AttachmentImageWidth { get; set; } + + [Column("AttachmentPostID")] + public int AttachmentPostId { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentPostId")] + [InverseProperty("ForumsAttachments")] + public virtual ForumsForumPost AttachmentPost { get; set; } = null!; + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("ForumsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ForumsForum.cs b/Migration.Toolkit.K11/Models/ForumsForum.cs index b7fe9a46..5c9f96b6 100644 --- a/Migration.Toolkit.K11/Models/ForumsForum.cs +++ b/Migration.Toolkit.K11/Models/ForumsForum.cs @@ -1,147 +1,146 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_Forum")] -[Index("ForumCommunityGroupId", Name = "IX_Forums_Forum_ForumCommunityGroupID")] -[Index("ForumDocumentId", Name = "IX_Forums_Forum_ForumDocumentID")] -[Index("ForumSiteId", "ForumName", Name = "IX_Forums_Forum_ForumSiteID_ForumName")] -public partial class ForumsForum -{ - [Key] - [Column("ForumID")] - public int ForumId { get; set; } - - [Column("ForumGroupID")] - public int ForumGroupId { get; set; } - - [StringLength(200)] - public string ForumName { get; set; } = null!; - - [StringLength(200)] - public string ForumDisplayName { get; set; } = null!; - - public string? ForumDescription { get; set; } - - public int? ForumOrder { get; set; } - - [Column("ForumDocumentID")] - public int? ForumDocumentId { get; set; } - - public bool ForumOpen { get; set; } - - public bool ForumModerated { get; set; } - - public bool? ForumDisplayEmails { get; set; } - - public bool? ForumRequireEmail { get; set; } - - public int ForumAccess { get; set; } - - public int ForumThreads { get; set; } - - public int ForumPosts { get; set; } - - public DateTime? ForumLastPostTime { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserName { get; set; } - - [StringLength(200)] - public string? ForumBaseUrl { get; set; } - - public bool? ForumAllowChangeName { get; set; } - - [Column("ForumHTMLEditor")] - public bool? ForumHtmleditor { get; set; } - - [Column("ForumUseCAPTCHA")] - public bool? ForumUseCaptcha { get; set; } - - [Column("ForumGUID")] - public Guid ForumGuid { get; set; } - - public DateTime ForumLastModified { get; set; } - - [StringLength(200)] - public string? ForumUnsubscriptionUrl { get; set; } - - public bool? ForumIsLocked { get; set; } - - public string? ForumSettings { get; set; } - - public bool? ForumAuthorEdit { get; set; } - - public bool? ForumAuthorDelete { get; set; } - - public int? ForumType { get; set; } - - public int? ForumIsAnswerLimit { get; set; } - - public int? ForumImageMaxSideSize { get; set; } - - public DateTime? ForumLastPostTimeAbsolute { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserNameAbsolute { get; set; } - - public int? ForumPostsAbsolute { get; set; } - - public int? ForumThreadsAbsolute { get; set; } - - public int? ForumAttachmentMaxFileSize { get; set; } - - public int? ForumDiscussionActions { get; set; } - - [Column("ForumSiteID")] - public int ForumSiteId { get; set; } - - public bool? ForumLogActivity { get; set; } - - [Column("ForumCommunityGroupID")] - public int? ForumCommunityGroupId { get; set; } - - public bool? ForumEnableOptIn { get; set; } - - public bool? ForumSendOptInConfirmation { get; set; } - - [Column("ForumOptInApprovalURL")] - [StringLength(450)] - public string? ForumOptInApprovalUrl { get; set; } - - [ForeignKey("ForumCommunityGroupId")] - [InverseProperty("ForumsForums")] - public virtual CommunityGroup? ForumCommunityGroup { get; set; } - - [ForeignKey("ForumDocumentId")] - [InverseProperty("ForumsForums")] - public virtual CmsDocument? ForumDocument { get; set; } - - [ForeignKey("ForumGroupId")] - [InverseProperty("ForumsForums")] - public virtual ForumsForumGroup ForumGroup { get; set; } = null!; - - [ForeignKey("ForumSiteId")] - [InverseProperty("ForumsForums")] - public virtual CmsSite ForumSite { get; set; } = null!; - - [InverseProperty("PostForum")] - public virtual ICollection ForumsForumPosts { get; set; } = new List(); - - [InverseProperty("Forum")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("SubscriptionForum")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("Forum")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [ForeignKey("ForumId")] - [InverseProperty("Forums")] - public virtual ICollection Users { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Forums_Forum")] +[Index("ForumCommunityGroupId", Name = "IX_Forums_Forum_ForumCommunityGroupID")] +[Index("ForumDocumentId", Name = "IX_Forums_Forum_ForumDocumentID")] +[Index("ForumSiteId", "ForumName", Name = "IX_Forums_Forum_ForumSiteID_ForumName")] +public class ForumsForum +{ + [Key] + [Column("ForumID")] + public int ForumId { get; set; } + + [Column("ForumGroupID")] + public int ForumGroupId { get; set; } + + [StringLength(200)] + public string ForumName { get; set; } = null!; + + [StringLength(200)] + public string ForumDisplayName { get; set; } = null!; + + public string? ForumDescription { get; set; } + + public int? ForumOrder { get; set; } + + [Column("ForumDocumentID")] + public int? ForumDocumentId { get; set; } + + public bool ForumOpen { get; set; } + + public bool ForumModerated { get; set; } + + public bool? ForumDisplayEmails { get; set; } + + public bool? ForumRequireEmail { get; set; } + + public int ForumAccess { get; set; } + + public int ForumThreads { get; set; } + + public int ForumPosts { get; set; } + + public DateTime? ForumLastPostTime { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserName { get; set; } + + [StringLength(200)] + public string? ForumBaseUrl { get; set; } + + public bool? ForumAllowChangeName { get; set; } + + [Column("ForumHTMLEditor")] + public bool? ForumHtmleditor { get; set; } + + [Column("ForumUseCAPTCHA")] + public bool? ForumUseCaptcha { get; set; } + + [Column("ForumGUID")] + public Guid ForumGuid { get; set; } + + public DateTime ForumLastModified { get; set; } + + [StringLength(200)] + public string? ForumUnsubscriptionUrl { get; set; } + + public bool? ForumIsLocked { get; set; } + + public string? ForumSettings { get; set; } + + public bool? ForumAuthorEdit { get; set; } + + public bool? ForumAuthorDelete { get; set; } + + public int? ForumType { get; set; } + + public int? ForumIsAnswerLimit { get; set; } + + public int? ForumImageMaxSideSize { get; set; } + + public DateTime? ForumLastPostTimeAbsolute { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserNameAbsolute { get; set; } + + public int? ForumPostsAbsolute { get; set; } + + public int? ForumThreadsAbsolute { get; set; } + + public int? ForumAttachmentMaxFileSize { get; set; } + + public int? ForumDiscussionActions { get; set; } + + [Column("ForumSiteID")] + public int ForumSiteId { get; set; } + + public bool? ForumLogActivity { get; set; } + + [Column("ForumCommunityGroupID")] + public int? ForumCommunityGroupId { get; set; } + + public bool? ForumEnableOptIn { get; set; } + + public bool? ForumSendOptInConfirmation { get; set; } + + [Column("ForumOptInApprovalURL")] + [StringLength(450)] + public string? ForumOptInApprovalUrl { get; set; } + + [ForeignKey("ForumCommunityGroupId")] + [InverseProperty("ForumsForums")] + public virtual CommunityGroup? ForumCommunityGroup { get; set; } + + [ForeignKey("ForumDocumentId")] + [InverseProperty("ForumsForums")] + public virtual CmsDocument? ForumDocument { get; set; } + + [ForeignKey("ForumGroupId")] + [InverseProperty("ForumsForums")] + public virtual ForumsForumGroup ForumGroup { get; set; } = null!; + + [ForeignKey("ForumSiteId")] + [InverseProperty("ForumsForums")] + public virtual CmsSite ForumSite { get; set; } = null!; + + [InverseProperty("PostForum")] + public virtual ICollection ForumsForumPosts { get; set; } = new List(); + + [InverseProperty("Forum")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("SubscriptionForum")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("Forum")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [ForeignKey("ForumId")] + [InverseProperty("Forums")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ForumsForumGroup.cs b/Migration.Toolkit.K11/Models/ForumsForumGroup.cs index 97a05c59..eb811aa0 100644 --- a/Migration.Toolkit.K11/Models/ForumsForumGroup.cs +++ b/Migration.Toolkit.K11/Models/ForumsForumGroup.cs @@ -1,89 +1,88 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_ForumGroup")] -[Index("GroupGroupId", Name = "IX_Forums_ForumGroup_GroupGroupID")] -[Index("GroupSiteId", "GroupName", Name = "IX_Forums_ForumGroup_GroupSiteID_GroupName")] -public partial class ForumsForumGroup -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupName { get; set; } = null!; - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - public int? GroupOrder { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [StringLength(200)] - public string? GroupBaseUrl { get; set; } - - [StringLength(200)] - public string? GroupUnsubscriptionUrl { get; set; } - - [Column("GroupGroupID")] - public int? GroupGroupId { get; set; } - - public bool? GroupAuthorEdit { get; set; } - - public bool? GroupAuthorDelete { get; set; } - - public int? GroupType { get; set; } - - public int? GroupIsAnswerLimit { get; set; } - - public int? GroupImageMaxSideSize { get; set; } - - public bool? GroupDisplayEmails { get; set; } - - public bool? GroupRequireEmail { get; set; } - - [Column("GroupHTMLEditor")] - public bool? GroupHtmleditor { get; set; } - - [Column("GroupUseCAPTCHA")] - public bool? GroupUseCaptcha { get; set; } - - public int? GroupAttachmentMaxFileSize { get; set; } - - public int? GroupDiscussionActions { get; set; } - - public bool? GroupLogActivity { get; set; } - - public bool? GroupEnableOptIn { get; set; } - - public bool? GroupSendOptInConfirmation { get; set; } - - [Column("GroupOptInApprovalURL")] - [StringLength(450)] - public string? GroupOptInApprovalUrl { get; set; } - - [InverseProperty("ForumGroup")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [ForeignKey("GroupGroupId")] - [InverseProperty("ForumsForumGroups")] - public virtual CommunityGroup? GroupGroup { get; set; } - - [ForeignKey("GroupSiteId")] - [InverseProperty("ForumsForumGroups")] - public virtual CmsSite GroupSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Forums_ForumGroup")] +[Index("GroupGroupId", Name = "IX_Forums_ForumGroup_GroupGroupID")] +[Index("GroupSiteId", "GroupName", Name = "IX_Forums_ForumGroup_GroupSiteID_GroupName")] +public class ForumsForumGroup +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupName { get; set; } = null!; + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + public int? GroupOrder { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [StringLength(200)] + public string? GroupBaseUrl { get; set; } + + [StringLength(200)] + public string? GroupUnsubscriptionUrl { get; set; } + + [Column("GroupGroupID")] + public int? GroupGroupId { get; set; } + + public bool? GroupAuthorEdit { get; set; } + + public bool? GroupAuthorDelete { get; set; } + + public int? GroupType { get; set; } + + public int? GroupIsAnswerLimit { get; set; } + + public int? GroupImageMaxSideSize { get; set; } + + public bool? GroupDisplayEmails { get; set; } + + public bool? GroupRequireEmail { get; set; } + + [Column("GroupHTMLEditor")] + public bool? GroupHtmleditor { get; set; } + + [Column("GroupUseCAPTCHA")] + public bool? GroupUseCaptcha { get; set; } + + public int? GroupAttachmentMaxFileSize { get; set; } + + public int? GroupDiscussionActions { get; set; } + + public bool? GroupLogActivity { get; set; } + + public bool? GroupEnableOptIn { get; set; } + + public bool? GroupSendOptInConfirmation { get; set; } + + [Column("GroupOptInApprovalURL")] + [StringLength(450)] + public string? GroupOptInApprovalUrl { get; set; } + + [InverseProperty("ForumGroup")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [ForeignKey("GroupGroupId")] + [InverseProperty("ForumsForumGroups")] + public virtual CommunityGroup? GroupGroup { get; set; } + + [ForeignKey("GroupSiteId")] + [InverseProperty("ForumsForumGroups")] + public virtual CmsSite GroupSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ForumsForumPost.cs b/Migration.Toolkit.K11/Models/ForumsForumPost.cs index de206ebd..f117c464 100644 --- a/Migration.Toolkit.K11/Models/ForumsForumPost.cs +++ b/Migration.Toolkit.K11/Models/ForumsForumPost.cs @@ -1,124 +1,123 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_ForumPost")] -[Index("PostApproved", Name = "IX_Forums_ForumPost_PostApproved")] -[Index("PostApprovedByUserId", Name = "IX_Forums_ForumPost_PostApprovedByUserID")] -[Index("PostForumId", Name = "IX_Forums_ForumPost_PostForumID")] -[Index("PostLevel", Name = "IX_Forums_ForumPost_PostLevel")] -[Index("PostParentId", Name = "IX_Forums_ForumPost_PostParentID")] -[Index("PostUserId", Name = "IX_Forums_ForumPost_PostUserID")] -public partial class ForumsForumPost -{ - [Key] - public int PostId { get; set; } - - [Column("PostForumID")] - public int PostForumId { get; set; } - - [Column("PostParentID")] - public int? PostParentId { get; set; } - - [Column("PostIDPath")] - public string PostIdpath { get; set; } = null!; - - public int PostLevel { get; set; } - - [StringLength(450)] - public string PostSubject { get; set; } = null!; - - [Column("PostUserID")] - public int? PostUserId { get; set; } - - [StringLength(200)] - public string PostUserName { get; set; } = null!; - - [StringLength(254)] - public string? PostUserMail { get; set; } - - public string? PostText { get; set; } - - public DateTime PostTime { get; set; } - - [Column("PostApprovedByUserID")] - public int? PostApprovedByUserId { get; set; } - - public int? PostThreadPosts { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserName { get; set; } - - public DateTime? PostThreadLastPostTime { get; set; } - - public string? PostUserSignature { get; set; } - - [Column("PostGUID")] - public Guid PostGuid { get; set; } - - public DateTime PostLastModified { get; set; } - - public bool? PostApproved { get; set; } - - public bool? PostIsLocked { get; set; } - - public int? PostIsAnswer { get; set; } - - public int PostStickOrder { get; set; } - - public int? PostViews { get; set; } - - public DateTime? PostLastEdit { get; set; } - - public string? PostInfo { get; set; } - - public int? PostAttachmentCount { get; set; } - - public int? PostType { get; set; } - - public int? PostThreadPostsAbsolute { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserNameAbsolute { get; set; } - - public DateTime? PostThreadLastPostTimeAbsolute { get; set; } - - public bool? PostQuestionSolved { get; set; } - - public int? PostIsNotAnswer { get; set; } - - [Column("PostSiteID")] - public int? PostSiteId { get; set; } - - [InverseProperty("AttachmentPost")] - public virtual ICollection ForumsAttachments { get; set; } = new List(); - - [InverseProperty("SubscriptionPost")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("Post")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("PostParent")] - public virtual ICollection InversePostParent { get; set; } = new List(); - - [ForeignKey("PostApprovedByUserId")] - [InverseProperty("ForumsForumPostPostApprovedByUsers")] - public virtual CmsUser? PostApprovedByUser { get; set; } - - [ForeignKey("PostForumId")] - [InverseProperty("ForumsForumPosts")] - public virtual ForumsForum PostForum { get; set; } = null!; - - [ForeignKey("PostParentId")] - [InverseProperty("InversePostParent")] - public virtual ForumsForumPost? PostParent { get; set; } - - [ForeignKey("PostUserId")] - [InverseProperty("ForumsForumPostPostUsers")] - public virtual CmsUser? PostUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Forums_ForumPost")] +[Index("PostApproved", Name = "IX_Forums_ForumPost_PostApproved")] +[Index("PostApprovedByUserId", Name = "IX_Forums_ForumPost_PostApprovedByUserID")] +[Index("PostForumId", Name = "IX_Forums_ForumPost_PostForumID")] +[Index("PostLevel", Name = "IX_Forums_ForumPost_PostLevel")] +[Index("PostParentId", Name = "IX_Forums_ForumPost_PostParentID")] +[Index("PostUserId", Name = "IX_Forums_ForumPost_PostUserID")] +public class ForumsForumPost +{ + [Key] + public int PostId { get; set; } + + [Column("PostForumID")] + public int PostForumId { get; set; } + + [Column("PostParentID")] + public int? PostParentId { get; set; } + + [Column("PostIDPath")] + public string PostIdpath { get; set; } = null!; + + public int PostLevel { get; set; } + + [StringLength(450)] + public string PostSubject { get; set; } = null!; + + [Column("PostUserID")] + public int? PostUserId { get; set; } + + [StringLength(200)] + public string PostUserName { get; set; } = null!; + + [StringLength(254)] + public string? PostUserMail { get; set; } + + public string? PostText { get; set; } + + public DateTime PostTime { get; set; } + + [Column("PostApprovedByUserID")] + public int? PostApprovedByUserId { get; set; } + + public int? PostThreadPosts { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserName { get; set; } + + public DateTime? PostThreadLastPostTime { get; set; } + + public string? PostUserSignature { get; set; } + + [Column("PostGUID")] + public Guid PostGuid { get; set; } + + public DateTime PostLastModified { get; set; } + + public bool? PostApproved { get; set; } + + public bool? PostIsLocked { get; set; } + + public int? PostIsAnswer { get; set; } + + public int PostStickOrder { get; set; } + + public int? PostViews { get; set; } + + public DateTime? PostLastEdit { get; set; } + + public string? PostInfo { get; set; } + + public int? PostAttachmentCount { get; set; } + + public int? PostType { get; set; } + + public int? PostThreadPostsAbsolute { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserNameAbsolute { get; set; } + + public DateTime? PostThreadLastPostTimeAbsolute { get; set; } + + public bool? PostQuestionSolved { get; set; } + + public int? PostIsNotAnswer { get; set; } + + [Column("PostSiteID")] + public int? PostSiteId { get; set; } + + [InverseProperty("AttachmentPost")] + public virtual ICollection ForumsAttachments { get; set; } = new List(); + + [InverseProperty("SubscriptionPost")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("Post")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("PostParent")] + public virtual ICollection InversePostParent { get; set; } = new List(); + + [ForeignKey("PostApprovedByUserId")] + [InverseProperty("ForumsForumPostPostApprovedByUsers")] + public virtual CmsUser? PostApprovedByUser { get; set; } + + [ForeignKey("PostForumId")] + [InverseProperty("ForumsForumPosts")] + public virtual ForumsForum PostForum { get; set; } = null!; + + [ForeignKey("PostParentId")] + [InverseProperty("InversePostParent")] + public virtual ForumsForumPost? PostParent { get; set; } + + [ForeignKey("PostUserId")] + [InverseProperty("ForumsForumPostPostUsers")] + public virtual CmsUser? PostUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ForumsForumRole.cs b/Migration.Toolkit.K11/Models/ForumsForumRole.cs index 5f45e663..8daf079b 100644 --- a/Migration.Toolkit.K11/Models/ForumsForumRole.cs +++ b/Migration.Toolkit.K11/Models/ForumsForumRole.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("ForumId", "RoleId", "PermissionId")] -[Table("Forums_ForumRoles")] -[Index("PermissionId", Name = "IX_Forums_ForumRoles_PermissionID")] -[Index("RoleId", Name = "IX_Forums_ForumRoles_RoleID")] -public partial class ForumsForumRole -{ - [Key] - [Column("ForumID")] - public int ForumId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("ForumId")] - [InverseProperty("ForumsForumRoles")] - public virtual ForumsForum Forum { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("ForumsForumRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("ForumsForumRoles")] - public virtual CmsRole Role { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("ForumId", "RoleId", "PermissionId")] +[Table("Forums_ForumRoles")] +[Index("PermissionId", Name = "IX_Forums_ForumRoles_PermissionID")] +[Index("RoleId", Name = "IX_Forums_ForumRoles_RoleID")] +public class ForumsForumRole +{ + [Key] + [Column("ForumID")] + public int ForumId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("ForumId")] + [InverseProperty("ForumsForumRoles")] + public virtual ForumsForum Forum { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("ForumsForumRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("ForumsForumRoles")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs b/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs index 1f100102..31079334 100644 --- a/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs +++ b/Migration.Toolkit.K11/Models/ForumsForumSubscription.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_ForumSubscription")] -[Index("SubscriptionForumId", Name = "IX_Forums_ForumSubscription_SubscriptionForumID")] -[Index("SubscriptionPostId", Name = "IX_Forums_ForumSubscription_SubscriptionPostID")] -[Index("SubscriptionUserId", Name = "IX_Forums_ForumSubscription_SubscriptionUserID")] -public partial class ForumsForumSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string? SubscriptionEmail { get; set; } - - [Column("SubscriptionForumID")] - public int SubscriptionForumId { get; set; } - - [Column("SubscriptionPostID")] - public int? SubscriptionPostId { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public DateTime SubscriptionLastModified { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionForumId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual ForumsForum SubscriptionForum { get; set; } = null!; - - [ForeignKey("SubscriptionPostId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual ForumsForumPost? SubscriptionPost { get; set; } - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Forums_ForumSubscription")] +[Index("SubscriptionForumId", Name = "IX_Forums_ForumSubscription_SubscriptionForumID")] +[Index("SubscriptionPostId", Name = "IX_Forums_ForumSubscription_SubscriptionPostID")] +[Index("SubscriptionUserId", Name = "IX_Forums_ForumSubscription_SubscriptionUserID")] +public class ForumsForumSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string? SubscriptionEmail { get; set; } + + [Column("SubscriptionForumID")] + public int SubscriptionForumId { get; set; } + + [Column("SubscriptionPostID")] + public int? SubscriptionPostId { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public DateTime SubscriptionLastModified { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionForumId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual ForumsForum SubscriptionForum { get; set; } = null!; + + [ForeignKey("SubscriptionPostId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual ForumsForumPost? SubscriptionPost { get; set; } + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs b/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs index c3217c6a..388cc7dd 100644 --- a/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs +++ b/Migration.Toolkit.K11/Models/ForumsUserFavorite.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Forums_UserFavorites")] -[Index("ForumId", Name = "IX_Forums_UserFavorites_ForumID")] -[Index("PostId", Name = "IX_Forums_UserFavorites_PostID")] -[Index("SiteId", Name = "IX_Forums_UserFavorites_SiteID")] -[Index("UserId", Name = "IX_Forums_UserFavorites_UserID")] -[Index("UserId", "PostId", "ForumId", Name = "IX_Forums_UserFavorites_UserID_PostID_ForumID", IsUnique = true)] -public partial class ForumsUserFavorite -{ - [Key] - [Column("FavoriteID")] - public int FavoriteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("PostID")] - public int? PostId { get; set; } - - [Column("ForumID")] - public int? ForumId { get; set; } - - [StringLength(100)] - public string? FavoriteName { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [Column("FavoriteGUID")] - public Guid FavoriteGuid { get; set; } - - public DateTime FavoriteLastModified { get; set; } - - [ForeignKey("ForumId")] - [InverseProperty("ForumsUserFavorites")] - public virtual ForumsForum? Forum { get; set; } - - [ForeignKey("PostId")] - [InverseProperty("ForumsUserFavorites")] - public virtual ForumsForumPost? Post { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ForumsUserFavorites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ForumsUserFavorites")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Forums_UserFavorites")] +[Index("ForumId", Name = "IX_Forums_UserFavorites_ForumID")] +[Index("PostId", Name = "IX_Forums_UserFavorites_PostID")] +[Index("SiteId", Name = "IX_Forums_UserFavorites_SiteID")] +[Index("UserId", Name = "IX_Forums_UserFavorites_UserID")] +[Index("UserId", "PostId", "ForumId", Name = "IX_Forums_UserFavorites_UserID_PostID_ForumID", IsUnique = true)] +public class ForumsUserFavorite +{ + [Key] + [Column("FavoriteID")] + public int FavoriteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("PostID")] + public int? PostId { get; set; } + + [Column("ForumID")] + public int? ForumId { get; set; } + + [StringLength(100)] + public string? FavoriteName { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [Column("FavoriteGUID")] + public Guid FavoriteGuid { get; set; } + + public DateTime FavoriteLastModified { get; set; } + + [ForeignKey("ForumId")] + [InverseProperty("ForumsUserFavorites")] + public virtual ForumsForum? Forum { get; set; } + + [ForeignKey("PostId")] + [InverseProperty("ForumsUserFavorites")] + public virtual ForumsForumPost? Post { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ForumsUserFavorites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ForumsUserFavorites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/IntegrationConnector.cs b/Migration.Toolkit.K11/Models/IntegrationConnector.cs index 477f3fad..5788df5b 100644 --- a/Migration.Toolkit.K11/Models/IntegrationConnector.cs +++ b/Migration.Toolkit.K11/Models/IntegrationConnector.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Integration_Connector")] -[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] -public partial class IntegrationConnector -{ - [Key] - [Column("ConnectorID")] - public int ConnectorId { get; set; } - - [StringLength(100)] - public string ConnectorName { get; set; } = null!; - - [StringLength(440)] - public string ConnectorDisplayName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorAssemblyName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorClassName { get; set; } = null!; - - [Required] - public bool? ConnectorEnabled { get; set; } - - public DateTime ConnectorLastModified { get; set; } - - [InverseProperty("SynchronizationConnector")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Integration_Connector")] +[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] +public class IntegrationConnector +{ + [Key] + [Column("ConnectorID")] + public int ConnectorId { get; set; } + + [StringLength(100)] + public string ConnectorName { get; set; } = null!; + + [StringLength(440)] + public string ConnectorDisplayName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorAssemblyName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorClassName { get; set; } = null!; + + [Required] + public bool? ConnectorEnabled { get; set; } + + public DateTime ConnectorLastModified { get; set; } + + [InverseProperty("SynchronizationConnector")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs b/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs index 1e138961..6aad44c9 100644 --- a/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs +++ b/Migration.Toolkit.K11/Models/IntegrationSyncLog.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Integration_SyncLog")] -[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] -public partial class IntegrationSyncLog -{ - [Key] - [Column("SyncLogID")] - public int SyncLogId { get; set; } - - [Column("SyncLogSynchronizationID")] - public int SyncLogSynchronizationId { get; set; } - - public DateTime SyncLogTime { get; set; } - - public string? SyncLogErrorMessage { get; set; } - - [ForeignKey("SyncLogSynchronizationId")] - [InverseProperty("IntegrationSyncLogs")] - public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Integration_SyncLog")] +[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] +public class IntegrationSyncLog +{ + [Key] + [Column("SyncLogID")] + public int SyncLogId { get; set; } + + [Column("SyncLogSynchronizationID")] + public int SyncLogSynchronizationId { get; set; } + + public DateTime SyncLogTime { get; set; } + + public string? SyncLogErrorMessage { get; set; } + + [ForeignKey("SyncLogSynchronizationId")] + [InverseProperty("IntegrationSyncLogs")] + public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs b/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs index 4d351ffa..618b1b86 100644 --- a/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs +++ b/Migration.Toolkit.K11/Models/IntegrationSynchronization.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Integration_Synchronization")] -[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] -[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] -public partial class IntegrationSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int SynchronizationConnectorId { get; set; } - - public DateTime SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [InverseProperty("SyncLogSynchronization")] - public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); - - [ForeignKey("SynchronizationConnectorId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationTask SynchronizationTask { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Integration_Synchronization")] +[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] +[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] +public class IntegrationSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int SynchronizationConnectorId { get; set; } + + public DateTime SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [InverseProperty("SyncLogSynchronization")] + public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); + + [ForeignKey("SynchronizationConnectorId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/IntegrationTask.cs b/Migration.Toolkit.K11/Models/IntegrationTask.cs index 85e71c0c..9e9f4c84 100644 --- a/Migration.Toolkit.K11/Models/IntegrationTask.cs +++ b/Migration.Toolkit.K11/Models/IntegrationTask.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Integration_Task")] -[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] -[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Integration_Task_TaskType")] -public partial class IntegrationTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("IntegrationTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Integration_Task")] +[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] +[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Integration_Task_TaskType")] +public class IntegrationTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("IntegrationTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs b/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs index 85be1926..059d86a0 100644 --- a/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs +++ b/Migration.Toolkit.K11/Models/IntranetPortalDepartment.cs @@ -1,29 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("IntranetPortal_Department")] -public partial class IntranetPortalDepartment -{ - [Key] - [Column("DepartmentID")] - public int DepartmentId { get; set; } - - [StringLength(200)] - public string DepartmentName { get; set; } = null!; - - [StringLength(450)] - public string? DepartmentDescription { get; set; } - - public Guid? DepartmentAvatar { get; set; } - - [StringLength(450)] - public string? DepartmentSections { get; set; } - - [StringLength(100)] - public string? DepartmentRoles { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("IntranetPortal_Department")] +public class IntranetPortalDepartment +{ + [Key] + [Column("DepartmentID")] + public int DepartmentId { get; set; } + + [StringLength(200)] + public string DepartmentName { get; set; } = null!; + + [StringLength(450)] + public string? DepartmentDescription { get; set; } + + public Guid? DepartmentAvatar { get; set; } + + [StringLength(450)] + public string? DepartmentSections { get; set; } + + [StringLength(100)] + public string? DepartmentRoles { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs b/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs index 7e2b89a9..37aa3554 100644 --- a/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs +++ b/Migration.Toolkit.K11/Models/IntranetPortalWorkingEnvironment.cs @@ -1,27 +1,24 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("IntranetPortal_WorkingEnvironment")] -public partial class IntranetPortalWorkingEnvironment -{ - [Key] - [Column("workingenvironmentID")] - public int WorkingenvironmentId { get; set; } - - public DateTime FormInserted { get; set; } - - public DateTime FormUpdated { get; set; } - - [StringLength(200)] - public string? YourName { get; set; } - - [StringLength(500)] - public string OfficeSatisfaction { get; set; } = null!; - - public string? Suggestions { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("IntranetPortal_WorkingEnvironment")] +public class IntranetPortalWorkingEnvironment +{ + [Key] + [Column("workingenvironmentID")] + public int WorkingenvironmentId { get; set; } + + public DateTime FormInserted { get; set; } + + public DateTime FormUpdated { get; set; } + + [StringLength(200)] + public string? YourName { get; set; } + + [StringLength(500)] + public string OfficeSatisfaction { get; set; } = null!; + + public string? Suggestions { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/MediaFile.cs b/Migration.Toolkit.K11/Models/MediaFile.cs index 7b7b0da1..576877b9 100644 --- a/Migration.Toolkit.K11/Models/MediaFile.cs +++ b/Migration.Toolkit.K11/Models/MediaFile.cs @@ -1,78 +1,77 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Media_File")] -[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] -[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] -[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] -[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] -public partial class MediaFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string FileTitle { get; set; } = null!; - - public string FileDescription { get; set; } = null!; - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public string FilePath { get; set; } = null!; - - public long FileSize { get; set; } - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileLibraryID")] - public int FileLibraryId { get; set; } - - [Column("FileSiteID")] - public int FileSiteId { get; set; } - - [Column("FileCreatedByUserID")] - public int? FileCreatedByUserId { get; set; } - - public DateTime FileCreatedWhen { get; set; } - - [Column("FileModifiedByUserID")] - public int? FileModifiedByUserId { get; set; } - - public DateTime FileModifiedWhen { get; set; } - - public string? FileCustomData { get; set; } - - [ForeignKey("FileCreatedByUserId")] - [InverseProperty("MediaFileFileCreatedByUsers")] - public virtual CmsUser? FileCreatedByUser { get; set; } - - [ForeignKey("FileLibraryId")] - [InverseProperty("MediaFiles")] - public virtual MediaLibrary FileLibrary { get; set; } = null!; - - [ForeignKey("FileModifiedByUserId")] - [InverseProperty("MediaFileFileModifiedByUsers")] - public virtual CmsUser? FileModifiedByUser { get; set; } - - [ForeignKey("FileSiteId")] - [InverseProperty("MediaFiles")] - public virtual CmsSite FileSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Media_File")] +[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] +[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] +[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] +[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] +public class MediaFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string FileTitle { get; set; } = null!; + + public string FileDescription { get; set; } = null!; + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public string FilePath { get; set; } = null!; + + public long FileSize { get; set; } + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileLibraryID")] + public int FileLibraryId { get; set; } + + [Column("FileSiteID")] + public int FileSiteId { get; set; } + + [Column("FileCreatedByUserID")] + public int? FileCreatedByUserId { get; set; } + + public DateTime FileCreatedWhen { get; set; } + + [Column("FileModifiedByUserID")] + public int? FileModifiedByUserId { get; set; } + + public DateTime FileModifiedWhen { get; set; } + + public string? FileCustomData { get; set; } + + [ForeignKey("FileCreatedByUserId")] + [InverseProperty("MediaFileFileCreatedByUsers")] + public virtual CmsUser? FileCreatedByUser { get; set; } + + [ForeignKey("FileLibraryId")] + [InverseProperty("MediaFiles")] + public virtual MediaLibrary FileLibrary { get; set; } = null!; + + [ForeignKey("FileModifiedByUserId")] + [InverseProperty("MediaFileFileModifiedByUsers")] + public virtual CmsUser? FileModifiedByUser { get; set; } + + [ForeignKey("FileSiteId")] + [InverseProperty("MediaFiles")] + public virtual CmsSite FileSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/MediaLibrary.cs b/Migration.Toolkit.K11/Models/MediaLibrary.cs index 1c9dbe5e..8a62a308 100644 --- a/Migration.Toolkit.K11/Models/MediaLibrary.cs +++ b/Migration.Toolkit.K11/Models/MediaLibrary.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Media_Library")] -[Index("LibraryGroupId", Name = "IX_Media_Library_LibraryGroupID")] -[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] -public partial class MediaLibrary -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [StringLength(250)] - public string LibraryName { get; set; } = null!; - - [StringLength(250)] - public string LibraryDisplayName { get; set; } = null!; - - public string? LibraryDescription { get; set; } - - [StringLength(250)] - public string LibraryFolder { get; set; } = null!; - - public int? LibraryAccess { get; set; } - - [Column("LibraryGroupID")] - public int? LibraryGroupId { get; set; } - - [Column("LibrarySiteID")] - public int LibrarySiteId { get; set; } - - [Column("LibraryGUID")] - public Guid? LibraryGuid { get; set; } - - public DateTime? LibraryLastModified { get; set; } - - [StringLength(450)] - public string? LibraryTeaserPath { get; set; } - - [Column("LibraryTeaserGUID")] - public Guid? LibraryTeaserGuid { get; set; } - - [ForeignKey("LibraryGroupId")] - [InverseProperty("MediaLibraries")] - public virtual CommunityGroup? LibraryGroup { get; set; } - - [ForeignKey("LibrarySiteId")] - [InverseProperty("MediaLibraries")] - public virtual CmsSite LibrarySite { get; set; } = null!; - - [InverseProperty("FileLibrary")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("Library")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Media_Library")] +[Index("LibraryGroupId", Name = "IX_Media_Library_LibraryGroupID")] +[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] +public class MediaLibrary +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [StringLength(250)] + public string LibraryName { get; set; } = null!; + + [StringLength(250)] + public string LibraryDisplayName { get; set; } = null!; + + public string? LibraryDescription { get; set; } + + [StringLength(250)] + public string LibraryFolder { get; set; } = null!; + + public int? LibraryAccess { get; set; } + + [Column("LibraryGroupID")] + public int? LibraryGroupId { get; set; } + + [Column("LibrarySiteID")] + public int LibrarySiteId { get; set; } + + [Column("LibraryGUID")] + public Guid? LibraryGuid { get; set; } + + public DateTime? LibraryLastModified { get; set; } + + [StringLength(450)] + public string? LibraryTeaserPath { get; set; } + + [Column("LibraryTeaserGUID")] + public Guid? LibraryTeaserGuid { get; set; } + + [ForeignKey("LibraryGroupId")] + [InverseProperty("MediaLibraries")] + public virtual CommunityGroup? LibraryGroup { get; set; } + + [ForeignKey("LibrarySiteId")] + [InverseProperty("MediaLibraries")] + public virtual CmsSite LibrarySite { get; set; } = null!; + + [InverseProperty("FileLibrary")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("Library")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs index 276a6336..55df393b 100644 --- a/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs +++ b/Migration.Toolkit.K11/Models/MediaLibraryRolePermission.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("LibraryId", "RoleId", "PermissionId")] -[Table("Media_LibraryRolePermission")] -[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] -public partial class MediaLibraryRolePermission -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("LibraryId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual MediaLibrary Library { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("LibraryId", "RoleId", "PermissionId")] +[Table("Media_LibraryRolePermission")] +[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] +public class MediaLibraryRolePermission +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("LibraryId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual MediaLibrary Library { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/MessagingMessage.cs b/Migration.Toolkit.K11/Models/MessagingMessage.cs index 673f39eb..dbe23202 100644 --- a/Migration.Toolkit.K11/Models/MessagingMessage.cs +++ b/Migration.Toolkit.K11/Models/MessagingMessage.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Messaging_Message")] -[Index("MessageSenderUserId", "MessageSent", "MessageSenderDeleted", Name = "IX_Messaging_Message_MessageSenderUserID_MessageSent_MessageSenderDeleted")] -public partial class MessagingMessage -{ - [Key] - [Column("MessageID")] - public int MessageId { get; set; } - - [Column("MessageSenderUserID")] - public int? MessageSenderUserId { get; set; } - - [StringLength(200)] - public string? MessageSenderNickName { get; set; } - - [Column("MessageRecipientUserID")] - public int? MessageRecipientUserId { get; set; } - - [StringLength(200)] - public string? MessageRecipientNickName { get; set; } - - public DateTime MessageSent { get; set; } - - [StringLength(200)] - public string? MessageSubject { get; set; } - - public string MessageBody { get; set; } = null!; - - public DateTime? MessageRead { get; set; } - - public bool? MessageSenderDeleted { get; set; } - - public bool? MessageRecipientDeleted { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public DateTime MessageLastModified { get; set; } - - public bool? MessageIsRead { get; set; } - - [ForeignKey("MessageRecipientUserId")] - [InverseProperty("MessagingMessageMessageRecipientUsers")] - public virtual CmsUser? MessageRecipientUser { get; set; } - - [ForeignKey("MessageSenderUserId")] - [InverseProperty("MessagingMessageMessageSenderUsers")] - public virtual CmsUser? MessageSenderUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Messaging_Message")] +[Index("MessageSenderUserId", "MessageSent", "MessageSenderDeleted", Name = "IX_Messaging_Message_MessageSenderUserID_MessageSent_MessageSenderDeleted")] +public class MessagingMessage +{ + [Key] + [Column("MessageID")] + public int MessageId { get; set; } + + [Column("MessageSenderUserID")] + public int? MessageSenderUserId { get; set; } + + [StringLength(200)] + public string? MessageSenderNickName { get; set; } + + [Column("MessageRecipientUserID")] + public int? MessageRecipientUserId { get; set; } + + [StringLength(200)] + public string? MessageRecipientNickName { get; set; } + + public DateTime MessageSent { get; set; } + + [StringLength(200)] + public string? MessageSubject { get; set; } + + public string MessageBody { get; set; } = null!; + + public DateTime? MessageRead { get; set; } + + public bool? MessageSenderDeleted { get; set; } + + public bool? MessageRecipientDeleted { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public DateTime MessageLastModified { get; set; } + + public bool? MessageIsRead { get; set; } + + [ForeignKey("MessageRecipientUserId")] + [InverseProperty("MessagingMessageMessageRecipientUsers")] + public virtual CmsUser? MessageRecipientUser { get; set; } + + [ForeignKey("MessageSenderUserId")] + [InverseProperty("MessagingMessageMessageSenderUsers")] + public virtual CmsUser? MessageSenderUser { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/NewsletterAbtest.cs b/Migration.Toolkit.K11/Models/NewsletterAbtest.cs index 998b905e..39b06af6 100644 --- a/Migration.Toolkit.K11/Models/NewsletterAbtest.cs +++ b/Migration.Toolkit.K11/Models/NewsletterAbtest.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_ABTest")] -[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] -[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] -[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] -public partial class NewsletterAbtest -{ - [Key] - [Column("TestID")] - public int TestId { get; set; } - - [Column("TestIssueID")] - public int TestIssueId { get; set; } - - public int TestWinnerOption { get; set; } - - public int? TestSelectWinnerAfter { get; set; } - - [Column("TestWinnerIssueID")] - public int? TestWinnerIssueId { get; set; } - - public DateTime? TestWinnerSelected { get; set; } - - public DateTime TestLastModified { get; set; } - - [Column("TestGUID")] - public Guid TestGuid { get; set; } - - [Column("TestWinnerScheduledTaskID")] - public int? TestWinnerScheduledTaskId { get; set; } - - public int TestSizePercentage { get; set; } - - public int? TestNumberPerVariantEmails { get; set; } - - [ForeignKey("TestIssueId")] - [InverseProperty("NewsletterAbtestTestIssue")] - public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; - - [ForeignKey("TestWinnerIssueId")] - [InverseProperty("NewsletterAbtestTestWinnerIssues")] - public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } - - [ForeignKey("TestWinnerScheduledTaskId")] - [InverseProperty("NewsletterAbtests")] - public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_ABTest")] +[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] +[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] +[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] +public class NewsletterAbtest +{ + [Key] + [Column("TestID")] + public int TestId { get; set; } + + [Column("TestIssueID")] + public int TestIssueId { get; set; } + + public int TestWinnerOption { get; set; } + + public int? TestSelectWinnerAfter { get; set; } + + [Column("TestWinnerIssueID")] + public int? TestWinnerIssueId { get; set; } + + public DateTime? TestWinnerSelected { get; set; } + + public DateTime TestLastModified { get; set; } + + [Column("TestGUID")] + public Guid TestGuid { get; set; } + + [Column("TestWinnerScheduledTaskID")] + public int? TestWinnerScheduledTaskId { get; set; } + + public int TestSizePercentage { get; set; } + + public int? TestNumberPerVariantEmails { get; set; } + + [ForeignKey("TestIssueId")] + [InverseProperty("NewsletterAbtestTestIssue")] + public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; + + [ForeignKey("TestWinnerIssueId")] + [InverseProperty("NewsletterAbtestTestWinnerIssues")] + public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } + + [ForeignKey("TestWinnerScheduledTaskId")] + [InverseProperty("NewsletterAbtests")] + public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs b/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs index dd94eaa3..3060af23 100644 --- a/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs +++ b/Migration.Toolkit.K11/Models/NewsletterClickedLink.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_ClickedLink")] -[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] -public partial class NewsletterClickedLink -{ - [Key] - [Column("ClickedLinkID")] - public int ClickedLinkId { get; set; } - - public Guid ClickedLinkGuid { get; set; } - - [StringLength(254)] - public string ClickedLinkEmail { get; set; } = null!; - - [Column("ClickedLinkNewsletterLinkID")] - public int ClickedLinkNewsletterLinkId { get; set; } - - public DateTime? ClickedLinkTime { get; set; } - - [ForeignKey("ClickedLinkNewsletterLinkId")] - [InverseProperty("NewsletterClickedLinks")] - public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_ClickedLink")] +[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] +public class NewsletterClickedLink +{ + [Key] + [Column("ClickedLinkID")] + public int ClickedLinkId { get; set; } + + public Guid ClickedLinkGuid { get; set; } + + [StringLength(254)] + public string ClickedLinkEmail { get; set; } = null!; + + [Column("ClickedLinkNewsletterLinkID")] + public int ClickedLinkNewsletterLinkId { get; set; } + + public DateTime? ClickedLinkTime { get; set; } + + [ForeignKey("ClickedLinkNewsletterLinkId")] + [InverseProperty("NewsletterClickedLinks")] + public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/NewsletterEmail.cs b/Migration.Toolkit.K11/Models/NewsletterEmail.cs index a8bc989a..46187bb9 100644 --- a/Migration.Toolkit.K11/Models/NewsletterEmail.cs +++ b/Migration.Toolkit.K11/Models/NewsletterEmail.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Emails")] -[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] -[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] -[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] -[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] -[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] -public partial class NewsletterEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Column("EmailNewsletterIssueID")] - public int EmailNewsletterIssueId { get; set; } - - [Column("EmailSubscriberID")] - public int? EmailSubscriberId { get; set; } - - [Column("EmailSiteID")] - public int EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - public bool? EmailSending { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - [Column("EmailContactID")] - public int? EmailContactId { get; set; } - - [StringLength(254)] - public string? EmailAddress { get; set; } - - [ForeignKey("EmailNewsletterIssueId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; - - [ForeignKey("EmailSiteId")] - [InverseProperty("NewsletterEmails")] - public virtual CmsSite EmailSite { get; set; } = null!; - - [ForeignKey("EmailSubscriberId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterSubscriber? EmailSubscriber { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_Emails")] +[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] +[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] +[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] +[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] +[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] +public class NewsletterEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Column("EmailNewsletterIssueID")] + public int EmailNewsletterIssueId { get; set; } + + [Column("EmailSubscriberID")] + public int? EmailSubscriberId { get; set; } + + [Column("EmailSiteID")] + public int EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + public bool? EmailSending { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + [Column("EmailContactID")] + public int? EmailContactId { get; set; } + + [StringLength(254)] + public string? EmailAddress { get; set; } + + [ForeignKey("EmailNewsletterIssueId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; + + [ForeignKey("EmailSiteId")] + [InverseProperty("NewsletterEmails")] + public virtual CmsSite EmailSite { get; set; } = null!; + + [ForeignKey("EmailSubscriberId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterSubscriber? EmailSubscriber { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs index 611be700..14a0fd0f 100644 --- a/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs +++ b/Migration.Toolkit.K11/Models/NewsletterEmailTemplate.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_EmailTemplate")] -[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] -public partial class NewsletterEmailTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TemplateName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int TemplateSiteId { get; set; } - - [StringLength(50)] - public string TemplateType { get; set; } = null!; - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [StringLength(450)] - public string? TemplateSubject { get; set; } - - [Column("TemplateThumbnailGUID")] - public Guid? TemplateThumbnailGuid { get; set; } - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateCode { get; set; } - - [Column("TemplateInlineCSS")] - public bool TemplateInlineCss { get; set; } - - [InverseProperty("Template")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); - - [InverseProperty("IssueTemplate")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterOptInTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); - - [InverseProperty("NewsletterUnsubscriptionTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NewsletterEmailTemplates")] - public virtual CmsSite TemplateSite { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("Templates")] - public virtual ICollection Newsletters { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_EmailTemplate")] +[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] +public class NewsletterEmailTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TemplateName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int TemplateSiteId { get; set; } + + [StringLength(50)] + public string TemplateType { get; set; } = null!; + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [StringLength(450)] + public string? TemplateSubject { get; set; } + + [Column("TemplateThumbnailGUID")] + public Guid? TemplateThumbnailGuid { get; set; } + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateCode { get; set; } + + [Column("TemplateInlineCSS")] + public bool TemplateInlineCss { get; set; } + + [InverseProperty("Template")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); + + [InverseProperty("IssueTemplate")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterOptInTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); + + [InverseProperty("NewsletterUnsubscriptionTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NewsletterEmailTemplates")] + public virtual CmsSite TemplateSite { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("Templates")] + public virtual ICollection Newsletters { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs index c319adcf..794a1431 100644 --- a/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs +++ b/Migration.Toolkit.K11/Models/NewsletterEmailWidget.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_EmailWidget")] -[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] -public partial class NewsletterEmailWidget -{ - [Key] - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - public Guid EmailWidgetGuid { get; set; } - - public DateTime EmailWidgetLastModified { get; set; } - - [StringLength(250)] - public string EmailWidgetDisplayName { get; set; } = null!; - - [StringLength(250)] - public string EmailWidgetName { get; set; } = null!; - - public string? EmailWidgetDescription { get; set; } - - public string? EmailWidgetCode { get; set; } - - [Column("EmailWidgetSiteID")] - public int EmailWidgetSiteId { get; set; } - - [Column("EmailWidgetThumbnailGUID")] - public Guid? EmailWidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? EmailWidgetIconCssClass { get; set; } - - public string? EmailWidgetProperties { get; set; } - - [ForeignKey("EmailWidgetSiteId")] - [InverseProperty("NewsletterEmailWidgets")] - public virtual CmsSite EmailWidgetSite { get; set; } = null!; - - [InverseProperty("EmailWidget")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_EmailWidget")] +[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] +public class NewsletterEmailWidget +{ + [Key] + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + public Guid EmailWidgetGuid { get; set; } + + public DateTime EmailWidgetLastModified { get; set; } + + [StringLength(250)] + public string EmailWidgetDisplayName { get; set; } = null!; + + [StringLength(250)] + public string EmailWidgetName { get; set; } = null!; + + public string? EmailWidgetDescription { get; set; } + + public string? EmailWidgetCode { get; set; } + + [Column("EmailWidgetSiteID")] + public int EmailWidgetSiteId { get; set; } + + [Column("EmailWidgetThumbnailGUID")] + public Guid? EmailWidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? EmailWidgetIconCssClass { get; set; } + + public string? EmailWidgetProperties { get; set; } + + [ForeignKey("EmailWidgetSiteId")] + [InverseProperty("NewsletterEmailWidgets")] + public virtual CmsSite EmailWidgetSite { get; set; } = null!; + + [InverseProperty("EmailWidget")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs index b35f054d..cb382c89 100644 --- a/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs +++ b/Migration.Toolkit.K11/Models/NewsletterEmailWidgetTemplate.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_EmailWidgetTemplate")] -[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] -[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] -public partial class NewsletterEmailWidgetTemplate -{ - [Key] - [Column("EmailWidgetTemplateID")] - public int EmailWidgetTemplateId { get; set; } - - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [ForeignKey("EmailWidgetId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailTemplate Template { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_EmailWidgetTemplate")] +[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] +[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] +public class NewsletterEmailWidgetTemplate +{ + [Key] + [Column("EmailWidgetTemplateID")] + public int EmailWidgetTemplateId { get; set; } + + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [ForeignKey("EmailWidgetId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailTemplate Template { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs index 51e50c27..5d2c3b64 100644 --- a/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs +++ b/Migration.Toolkit.K11/Models/NewsletterIssueContactGroup.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_IssueContactGroup")] -[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] -public partial class NewsletterIssueContactGroup -{ - [Key] - [Column("IssueContactGroupID")] - public int IssueContactGroupId { get; set; } - - [Column("IssueID")] - public int IssueId { get; set; } - - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [ForeignKey("ContactGroupId")] - [InverseProperty("NewsletterIssueContactGroups")] - public virtual OmContactGroup ContactGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_IssueContactGroup")] +[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] +public class NewsletterIssueContactGroup +{ + [Key] + [Column("IssueContactGroupID")] + public int IssueContactGroupId { get; set; } + + [Column("IssueID")] + public int IssueId { get; set; } + + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [ForeignKey("ContactGroupId")] + [InverseProperty("NewsletterIssueContactGroups")] + public virtual OmContactGroup ContactGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/NewsletterLink.cs b/Migration.Toolkit.K11/Models/NewsletterLink.cs index a7fa2dca..304c6e2d 100644 --- a/Migration.Toolkit.K11/Models/NewsletterLink.cs +++ b/Migration.Toolkit.K11/Models/NewsletterLink.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Link")] -[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] -public partial class NewsletterLink -{ - [Key] - [Column("LinkID")] - public int LinkId { get; set; } - - [Column("LinkIssueID")] - public int LinkIssueId { get; set; } - - public string LinkTarget { get; set; } = null!; - - [StringLength(450)] - public string LinkDescription { get; set; } = null!; - - [Column("LinkGUID")] - public Guid LinkGuid { get; set; } - - [ForeignKey("LinkIssueId")] - [InverseProperty("NewsletterLinks")] - public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; - - [InverseProperty("ClickedLinkNewsletterLink")] - public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_Link")] +[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] +public class NewsletterLink +{ + [Key] + [Column("LinkID")] + public int LinkId { get; set; } + + [Column("LinkIssueID")] + public int LinkIssueId { get; set; } + + public string LinkTarget { get; set; } = null!; + + [StringLength(450)] + public string LinkDescription { get; set; } = null!; + + [Column("LinkGUID")] + public Guid LinkGuid { get; set; } + + [ForeignKey("LinkIssueId")] + [InverseProperty("NewsletterLinks")] + public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; + + [InverseProperty("ClickedLinkNewsletterLink")] + public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs b/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs index 0e41c18e..9294589d 100644 --- a/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs +++ b/Migration.Toolkit.K11/Models/NewsletterNewsletter.cs @@ -1,116 +1,115 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Newsletter")] -[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] -[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] -[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] -[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] -[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] -public partial class NewsletterNewsletter -{ - [Key] - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [StringLength(250)] - public string NewsletterName { get; set; } = null!; - - [Column("NewsletterSubscriptionTemplateID")] - public int? NewsletterSubscriptionTemplateId { get; set; } - - [Column("NewsletterUnsubscriptionTemplateID")] - public int NewsletterUnsubscriptionTemplateId { get; set; } - - [StringLength(200)] - public string NewsletterSenderName { get; set; } = null!; - - [StringLength(254)] - public string NewsletterSenderEmail { get; set; } = null!; - - [StringLength(100)] - public string? NewsletterDynamicSubject { get; set; } - - [Column("NewsletterDynamicURL")] - [StringLength(500)] - public string? NewsletterDynamicUrl { get; set; } - - [Column("NewsletterDynamicScheduledTaskID")] - public int? NewsletterDynamicScheduledTaskId { get; set; } - - [Column("NewsletterSiteID")] - public int NewsletterSiteId { get; set; } - - [Column("NewsletterGUID")] - public Guid NewsletterGuid { get; set; } - - [StringLength(1000)] - public string? NewsletterUnsubscribeUrl { get; set; } - - [StringLength(500)] - public string? NewsletterBaseUrl { get; set; } - - public DateTime NewsletterLastModified { get; set; } - - public bool? NewsletterEnableOptIn { get; set; } - - [Column("NewsletterOptInTemplateID")] - public int? NewsletterOptInTemplateId { get; set; } - - public bool? NewsletterSendOptInConfirmation { get; set; } - - [Column("NewsletterOptInApprovalURL")] - [StringLength(450)] - public string? NewsletterOptInApprovalUrl { get; set; } - - public bool? NewsletterTrackOpenEmails { get; set; } - - public bool? NewsletterTrackClickedLinks { get; set; } - - [StringLength(998)] - public string? NewsletterDraftEmails { get; set; } - - public bool? NewsletterLogActivity { get; set; } - - [StringLength(5)] - public string NewsletterSource { get; set; } = null!; - - public int NewsletterType { get; set; } - - [ForeignKey("NewsletterDynamicScheduledTaskId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } - - [InverseProperty("IssueNewsletter")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [ForeignKey("NewsletterOptInTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] - public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } - - [ForeignKey("NewsletterSiteId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsSite NewsletterSite { get; set; } = null!; - - [InverseProperty("Newsletter")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("NewsletterUnsubscriptionTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] - public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; - - [InverseProperty("UnsubscriptionNewsletter")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); - - [ForeignKey("NewsletterId")] - [InverseProperty("Newsletters")] - public virtual ICollection Templates { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_Newsletter")] +[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] +[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] +[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] +[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] +[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] +public class NewsletterNewsletter +{ + [Key] + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [StringLength(250)] + public string NewsletterName { get; set; } = null!; + + [Column("NewsletterSubscriptionTemplateID")] + public int? NewsletterSubscriptionTemplateId { get; set; } + + [Column("NewsletterUnsubscriptionTemplateID")] + public int NewsletterUnsubscriptionTemplateId { get; set; } + + [StringLength(200)] + public string NewsletterSenderName { get; set; } = null!; + + [StringLength(254)] + public string NewsletterSenderEmail { get; set; } = null!; + + [StringLength(100)] + public string? NewsletterDynamicSubject { get; set; } + + [Column("NewsletterDynamicURL")] + [StringLength(500)] + public string? NewsletterDynamicUrl { get; set; } + + [Column("NewsletterDynamicScheduledTaskID")] + public int? NewsletterDynamicScheduledTaskId { get; set; } + + [Column("NewsletterSiteID")] + public int NewsletterSiteId { get; set; } + + [Column("NewsletterGUID")] + public Guid NewsletterGuid { get; set; } + + [StringLength(1000)] + public string? NewsletterUnsubscribeUrl { get; set; } + + [StringLength(500)] + public string? NewsletterBaseUrl { get; set; } + + public DateTime NewsletterLastModified { get; set; } + + public bool? NewsletterEnableOptIn { get; set; } + + [Column("NewsletterOptInTemplateID")] + public int? NewsletterOptInTemplateId { get; set; } + + public bool? NewsletterSendOptInConfirmation { get; set; } + + [Column("NewsletterOptInApprovalURL")] + [StringLength(450)] + public string? NewsletterOptInApprovalUrl { get; set; } + + public bool? NewsletterTrackOpenEmails { get; set; } + + public bool? NewsletterTrackClickedLinks { get; set; } + + [StringLength(998)] + public string? NewsletterDraftEmails { get; set; } + + public bool? NewsletterLogActivity { get; set; } + + [StringLength(5)] + public string NewsletterSource { get; set; } = null!; + + public int NewsletterType { get; set; } + + [ForeignKey("NewsletterDynamicScheduledTaskId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } + + [InverseProperty("IssueNewsletter")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [ForeignKey("NewsletterOptInTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] + public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } + + [ForeignKey("NewsletterSiteId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsSite NewsletterSite { get; set; } = null!; + + [InverseProperty("Newsletter")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("NewsletterUnsubscriptionTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] + public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; + + [InverseProperty("UnsubscriptionNewsletter")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); + + [ForeignKey("NewsletterId")] + [InverseProperty("Newsletters")] + public virtual ICollection Templates { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs index c017d251..7a3342e6 100644 --- a/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs +++ b/Migration.Toolkit.K11/Models/NewsletterNewsletterIssue.cs @@ -1,126 +1,125 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_NewsletterIssue")] -[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] -[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] -[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] -[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] -[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] -public partial class NewsletterNewsletterIssue -{ - [Key] - [Column("IssueID")] - public int IssueId { get; set; } - - [StringLength(450)] - public string IssueSubject { get; set; } = null!; - - public string IssueText { get; set; } = null!; - - public int IssueUnsubscribed { get; set; } - - [Column("IssueNewsletterID")] - public int IssueNewsletterId { get; set; } - - [Column("IssueTemplateID")] - public int? IssueTemplateId { get; set; } - - public int IssueSentEmails { get; set; } - - public DateTime? IssueMailoutTime { get; set; } - - [Column("IssueGUID")] - public Guid IssueGuid { get; set; } - - public DateTime IssueLastModified { get; set; } - - [Column("IssueSiteID")] - public int IssueSiteId { get; set; } - - public int? IssueOpenedEmails { get; set; } - - public int? IssueBounces { get; set; } - - public int? IssueStatus { get; set; } - - [Column("IssueIsABTest")] - public bool? IssueIsAbtest { get; set; } - - [Column("IssueVariantOfIssueID")] - public int? IssueVariantOfIssueId { get; set; } - - [StringLength(200)] - public string? IssueVariantName { get; set; } - - [StringLength(200)] - public string? IssueSenderName { get; set; } - - [StringLength(254)] - public string? IssueSenderEmail { get; set; } - - [Column("IssueScheduledTaskID")] - public int? IssueScheduledTaskId { get; set; } - - [Column("IssueUTMSource")] - [StringLength(200)] - public string? IssueUtmsource { get; set; } - - [Column("IssueUseUTM")] - public bool IssueUseUtm { get; set; } - - [Column("IssueUTMCampaign")] - [StringLength(200)] - public string? IssueUtmcampaign { get; set; } - - [StringLength(200)] - public string IssueDisplayName { get; set; } = null!; - - public string? IssueWidgets { get; set; } - - public string? IssuePreheader { get; set; } - - public string? IssuePlainText { get; set; } - - [InverseProperty("IssueVariantOfIssue")] - public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); - - [ForeignKey("IssueNewsletterId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; - - [ForeignKey("IssueSiteId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual CmsSite IssueSite { get; set; } = null!; - - [ForeignKey("IssueTemplateId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } - - [ForeignKey("IssueVariantOfIssueId")] - [InverseProperty("InverseIssueVariantOfIssue")] - public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } - - [InverseProperty("TestIssue")] - public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } - - [InverseProperty("TestWinnerIssue")] - public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); - - [InverseProperty("EmailNewsletterIssue")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("LinkIssue")] - public virtual ICollection NewsletterLinks { get; set; } = new List(); - - [InverseProperty("OpenedEmailIssue")] - public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); - - [InverseProperty("UnsubscriptionFromIssue")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_NewsletterIssue")] +[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] +[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] +[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] +[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] +[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] +public class NewsletterNewsletterIssue +{ + [Key] + [Column("IssueID")] + public int IssueId { get; set; } + + [StringLength(450)] + public string IssueSubject { get; set; } = null!; + + public string IssueText { get; set; } = null!; + + public int IssueUnsubscribed { get; set; } + + [Column("IssueNewsletterID")] + public int IssueNewsletterId { get; set; } + + [Column("IssueTemplateID")] + public int? IssueTemplateId { get; set; } + + public int IssueSentEmails { get; set; } + + public DateTime? IssueMailoutTime { get; set; } + + [Column("IssueGUID")] + public Guid IssueGuid { get; set; } + + public DateTime IssueLastModified { get; set; } + + [Column("IssueSiteID")] + public int IssueSiteId { get; set; } + + public int? IssueOpenedEmails { get; set; } + + public int? IssueBounces { get; set; } + + public int? IssueStatus { get; set; } + + [Column("IssueIsABTest")] + public bool? IssueIsAbtest { get; set; } + + [Column("IssueVariantOfIssueID")] + public int? IssueVariantOfIssueId { get; set; } + + [StringLength(200)] + public string? IssueVariantName { get; set; } + + [StringLength(200)] + public string? IssueSenderName { get; set; } + + [StringLength(254)] + public string? IssueSenderEmail { get; set; } + + [Column("IssueScheduledTaskID")] + public int? IssueScheduledTaskId { get; set; } + + [Column("IssueUTMSource")] + [StringLength(200)] + public string? IssueUtmsource { get; set; } + + [Column("IssueUseUTM")] + public bool IssueUseUtm { get; set; } + + [Column("IssueUTMCampaign")] + [StringLength(200)] + public string? IssueUtmcampaign { get; set; } + + [StringLength(200)] + public string IssueDisplayName { get; set; } = null!; + + public string? IssueWidgets { get; set; } + + public string? IssuePreheader { get; set; } + + public string? IssuePlainText { get; set; } + + [InverseProperty("IssueVariantOfIssue")] + public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); + + [ForeignKey("IssueNewsletterId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; + + [ForeignKey("IssueSiteId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual CmsSite IssueSite { get; set; } = null!; + + [ForeignKey("IssueTemplateId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } + + [ForeignKey("IssueVariantOfIssueId")] + [InverseProperty("InverseIssueVariantOfIssue")] + public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } + + [InverseProperty("TestIssue")] + public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } + + [InverseProperty("TestWinnerIssue")] + public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); + + [InverseProperty("EmailNewsletterIssue")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("LinkIssue")] + public virtual ICollection NewsletterLinks { get; set; } = new List(); + + [InverseProperty("OpenedEmailIssue")] + public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); + + [InverseProperty("UnsubscriptionFromIssue")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs index a4b85d7f..330e8a6c 100644 --- a/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs +++ b/Migration.Toolkit.K11/Models/NewsletterOpenedEmail.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_OpenedEmail")] -[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] -public partial class NewsletterOpenedEmail -{ - [Key] - [Column("OpenedEmailID")] - public int OpenedEmailId { get; set; } - - [StringLength(254)] - public string OpenedEmailEmail { get; set; } = null!; - - public Guid OpenedEmailGuid { get; set; } - - public DateTime? OpenedEmailTime { get; set; } - - [Column("OpenedEmailIssueID")] - public int OpenedEmailIssueId { get; set; } - - [ForeignKey("OpenedEmailIssueId")] - [InverseProperty("NewsletterOpenedEmails")] - public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_OpenedEmail")] +[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] +public class NewsletterOpenedEmail +{ + [Key] + [Column("OpenedEmailID")] + public int OpenedEmailId { get; set; } + + [StringLength(254)] + public string OpenedEmailEmail { get; set; } = null!; + + public Guid OpenedEmailGuid { get; set; } + + public DateTime? OpenedEmailTime { get; set; } + + [Column("OpenedEmailIssueID")] + public int OpenedEmailIssueId { get; set; } + + [ForeignKey("OpenedEmailIssueId")] + [InverseProperty("NewsletterOpenedEmails")] + public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs b/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs index 854198bd..860cefdc 100644 --- a/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs +++ b/Migration.Toolkit.K11/Models/NewsletterSubscriber.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Subscriber")] -[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] -[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] -public partial class NewsletterSubscriber -{ - [Key] - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - [StringLength(200)] - public string? SubscriberFirstName { get; set; } - - [StringLength(200)] - public string? SubscriberLastName { get; set; } - - [Column("SubscriberSiteID")] - public int SubscriberSiteId { get; set; } - - [Column("SubscriberGUID")] - public Guid SubscriberGuid { get; set; } - - public string? SubscriberCustomData { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - public DateTime SubscriberLastModified { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - public int? SubscriberBounces { get; set; } - - [InverseProperty("EmailSubscriber")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("Subscriber")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("SubscriberSiteId")] - [InverseProperty("NewsletterSubscribers")] - public virtual CmsSite SubscriberSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_Subscriber")] +[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] +[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] +public class NewsletterSubscriber +{ + [Key] + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + [StringLength(200)] + public string? SubscriberFirstName { get; set; } + + [StringLength(200)] + public string? SubscriberLastName { get; set; } + + [Column("SubscriberSiteID")] + public int SubscriberSiteId { get; set; } + + [Column("SubscriberGUID")] + public Guid SubscriberGuid { get; set; } + + public string? SubscriberCustomData { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + public DateTime SubscriberLastModified { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + public int? SubscriberBounces { get; set; } + + [InverseProperty("EmailSubscriber")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("Subscriber")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("SubscriberSiteId")] + [InverseProperty("NewsletterSubscribers")] + public virtual CmsSite SubscriberSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs index d90907f2..65518eeb 100644 --- a/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs +++ b/Migration.Toolkit.K11/Models/NewsletterSubscriberNewsletter.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_SubscriberNewsletter")] -[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] -[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] -public partial class NewsletterSubscriberNewsletter -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - public DateTime SubscribedWhen { get; set; } - - public bool? SubscriptionApproved { get; set; } - - public DateTime? SubscriptionApprovedWhen { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [Key] - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } - - [ForeignKey("NewsletterId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterNewsletter Newsletter { get; set; } = null!; - - [ForeignKey("SubscriberId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterSubscriber Subscriber { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_SubscriberNewsletter")] +[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] +[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] +public class NewsletterSubscriberNewsletter +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + public DateTime SubscribedWhen { get; set; } + + public bool? SubscriptionApproved { get; set; } + + public DateTime? SubscriptionApprovedWhen { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [Key] + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } + + [ForeignKey("NewsletterId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterNewsletter Newsletter { get; set; } = null!; + + [ForeignKey("SubscriberId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterSubscriber Subscriber { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs index ece5108f..c4c70203 100644 --- a/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs +++ b/Migration.Toolkit.K11/Models/NewsletterUnsubscription.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Newsletter_Unsubscription")] -[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] -[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] -[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] -public partial class NewsletterUnsubscription -{ - [Key] - [Column("UnsubscriptionID")] - public int UnsubscriptionId { get; set; } - - [StringLength(254)] - public string UnsubscriptionEmail { get; set; } = null!; - - public DateTime UnsubscriptionCreated { get; set; } - - [Column("UnsubscriptionNewsletterID")] - public int? UnsubscriptionNewsletterId { get; set; } - - [Column("UnsubscriptionFromIssueID")] - public int? UnsubscriptionFromIssueId { get; set; } - - [Column("UnsubscriptionGUID")] - public Guid UnsubscriptionGuid { get; set; } - - [ForeignKey("UnsubscriptionFromIssueId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } - - [ForeignKey("UnsubscriptionNewsletterId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Newsletter_Unsubscription")] +[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] +[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] +[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] +public class NewsletterUnsubscription +{ + [Key] + [Column("UnsubscriptionID")] + public int UnsubscriptionId { get; set; } + + [StringLength(254)] + public string UnsubscriptionEmail { get; set; } = null!; + + public DateTime UnsubscriptionCreated { get; set; } + + [Column("UnsubscriptionNewsletterID")] + public int? UnsubscriptionNewsletterId { get; set; } + + [Column("UnsubscriptionFromIssueID")] + public int? UnsubscriptionFromIssueId { get; set; } + + [Column("UnsubscriptionGUID")] + public Guid UnsubscriptionGuid { get; set; } + + [ForeignKey("UnsubscriptionFromIssueId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } + + [ForeignKey("UnsubscriptionNewsletterId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/NotificationGateway.cs b/Migration.Toolkit.K11/Models/NotificationGateway.cs index 5201240c..fd2e1df8 100644 --- a/Migration.Toolkit.K11/Models/NotificationGateway.cs +++ b/Migration.Toolkit.K11/Models/NotificationGateway.cs @@ -1,49 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Notification_Gateway")] -public partial class NotificationGateway -{ - [Key] - [Column("GatewayID")] - public int GatewayId { get; set; } - - [StringLength(200)] - public string GatewayName { get; set; } = null!; - - [StringLength(200)] - public string GatewayDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GatewayAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string GatewayClassName { get; set; } = null!; - - public string? GatewayDescription { get; set; } - - public bool? GatewaySupportsEmail { get; set; } - - public bool? GatewaySupportsPlainText { get; set; } - - [Column("GatewaySupportsHTMLText")] - public bool? GatewaySupportsHtmltext { get; set; } - - public DateTime GatewayLastModified { get; set; } - - [Column("GatewayGUID")] - public Guid GatewayGuid { get; set; } - - public bool? GatewayEnabled { get; set; } - - [InverseProperty("SubscriptionGateway")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("Gateway")] - public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("Notification_Gateway")] +public class NotificationGateway +{ + [Key] + [Column("GatewayID")] + public int GatewayId { get; set; } + + [StringLength(200)] + public string GatewayName { get; set; } = null!; + + [StringLength(200)] + public string GatewayDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GatewayAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string GatewayClassName { get; set; } = null!; + + public string? GatewayDescription { get; set; } + + public bool? GatewaySupportsEmail { get; set; } + + public bool? GatewaySupportsPlainText { get; set; } + + [Column("GatewaySupportsHTMLText")] + public bool? GatewaySupportsHtmltext { get; set; } + + public DateTime GatewayLastModified { get; set; } + + [Column("GatewayGUID")] + public Guid GatewayGuid { get; set; } + + public bool? GatewayEnabled { get; set; } + + [InverseProperty("SubscriptionGateway")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("Gateway")] + public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/NotificationSubscription.cs b/Migration.Toolkit.K11/Models/NotificationSubscription.cs index ff6a174e..5bddeb4c 100644 --- a/Migration.Toolkit.K11/Models/NotificationSubscription.cs +++ b/Migration.Toolkit.K11/Models/NotificationSubscription.cs @@ -1,77 +1,76 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Notification_Subscription")] -[Index("SubscriptionEventSource", "SubscriptionEventCode", "SubscriptionEventObjectId", Name = "IX_Notification_Subscription_SubscriptionEventSource_SubscriptionEventCode_SubscriptionEventObjectID")] -[Index("SubscriptionGatewayId", Name = "IX_Notification_Subscription_SubscriptionGatewayID")] -[Index("SubscriptionSiteId", Name = "IX_Notification_Subscription_SubscriptionSiteID")] -[Index("SubscriptionTemplateId", Name = "IX_Notification_Subscription_SubscriptionTemplateID")] -[Index("SubscriptionUserId", Name = "IX_Notification_Subscription_SubscriptionUserID")] -public partial class NotificationSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionGatewayID")] - public int SubscriptionGatewayId { get; set; } - - [Column("SubscriptionTemplateID")] - public int SubscriptionTemplateId { get; set; } - - [StringLength(100)] - public string? SubscriptionEventSource { get; set; } - - [StringLength(100)] - public string? SubscriptionEventCode { get; set; } - - [StringLength(250)] - public string SubscriptionEventDisplayName { get; set; } = null!; - - [Column("SubscriptionEventObjectID")] - public int? SubscriptionEventObjectId { get; set; } - - public DateTime SubscriptionTime { get; set; } - - [Column("SubscriptionUserID")] - public int SubscriptionUserId { get; set; } - - [StringLength(250)] - public string SubscriptionTarget { get; set; } = null!; - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public string? SubscriptionEventData1 { get; set; } - - public string? SubscriptionEventData2 { get; set; } - - [Column("SubscriptionUseHTML")] - public bool? SubscriptionUseHtml { get; set; } - - [Column("SubscriptionSiteID")] - public int? SubscriptionSiteId { get; set; } - - [ForeignKey("SubscriptionGatewayId")] - [InverseProperty("NotificationSubscriptions")] - public virtual NotificationGateway SubscriptionGateway { get; set; } = null!; - - [ForeignKey("SubscriptionSiteId")] - [InverseProperty("NotificationSubscriptions")] - public virtual CmsSite? SubscriptionSite { get; set; } - - [ForeignKey("SubscriptionTemplateId")] - [InverseProperty("NotificationSubscriptions")] - public virtual NotificationTemplate SubscriptionTemplate { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("NotificationSubscriptions")] - public virtual CmsUser SubscriptionUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Notification_Subscription")] +[Index("SubscriptionEventSource", "SubscriptionEventCode", "SubscriptionEventObjectId", Name = "IX_Notification_Subscription_SubscriptionEventSource_SubscriptionEventCode_SubscriptionEventObjectID")] +[Index("SubscriptionGatewayId", Name = "IX_Notification_Subscription_SubscriptionGatewayID")] +[Index("SubscriptionSiteId", Name = "IX_Notification_Subscription_SubscriptionSiteID")] +[Index("SubscriptionTemplateId", Name = "IX_Notification_Subscription_SubscriptionTemplateID")] +[Index("SubscriptionUserId", Name = "IX_Notification_Subscription_SubscriptionUserID")] +public class NotificationSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionGatewayID")] + public int SubscriptionGatewayId { get; set; } + + [Column("SubscriptionTemplateID")] + public int SubscriptionTemplateId { get; set; } + + [StringLength(100)] + public string? SubscriptionEventSource { get; set; } + + [StringLength(100)] + public string? SubscriptionEventCode { get; set; } + + [StringLength(250)] + public string SubscriptionEventDisplayName { get; set; } = null!; + + [Column("SubscriptionEventObjectID")] + public int? SubscriptionEventObjectId { get; set; } + + public DateTime SubscriptionTime { get; set; } + + [Column("SubscriptionUserID")] + public int SubscriptionUserId { get; set; } + + [StringLength(250)] + public string SubscriptionTarget { get; set; } = null!; + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public string? SubscriptionEventData1 { get; set; } + + public string? SubscriptionEventData2 { get; set; } + + [Column("SubscriptionUseHTML")] + public bool? SubscriptionUseHtml { get; set; } + + [Column("SubscriptionSiteID")] + public int? SubscriptionSiteId { get; set; } + + [ForeignKey("SubscriptionGatewayId")] + [InverseProperty("NotificationSubscriptions")] + public virtual NotificationGateway SubscriptionGateway { get; set; } = null!; + + [ForeignKey("SubscriptionSiteId")] + [InverseProperty("NotificationSubscriptions")] + public virtual CmsSite? SubscriptionSite { get; set; } + + [ForeignKey("SubscriptionTemplateId")] + [InverseProperty("NotificationSubscriptions")] + public virtual NotificationTemplate SubscriptionTemplate { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("NotificationSubscriptions")] + public virtual CmsUser SubscriptionUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/NotificationTemplate.cs b/Migration.Toolkit.K11/Models/NotificationTemplate.cs index eedbdaf8..089dd037 100644 --- a/Migration.Toolkit.K11/Models/NotificationTemplate.cs +++ b/Migration.Toolkit.K11/Models/NotificationTemplate.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Notification_Template")] -[Index("TemplateSiteId", Name = "IX_Notification_Template_TemplateSiteID")] -public partial class NotificationTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(200)] - public string TemplateName { get; set; } = null!; - - [StringLength(200)] - public string TemplateDisplayName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int? TemplateSiteId { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - [InverseProperty("SubscriptionTemplate")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("Template")] - public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NotificationTemplates")] - public virtual CmsSite? TemplateSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Notification_Template")] +[Index("TemplateSiteId", Name = "IX_Notification_Template_TemplateSiteID")] +public class NotificationTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(200)] + public string TemplateName { get; set; } = null!; + + [StringLength(200)] + public string TemplateDisplayName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int? TemplateSiteId { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + [InverseProperty("SubscriptionTemplate")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("Template")] + public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NotificationTemplates")] + public virtual CmsSite? TemplateSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/NotificationTemplateText.cs b/Migration.Toolkit.K11/Models/NotificationTemplateText.cs index c629384a..205b043d 100644 --- a/Migration.Toolkit.K11/Models/NotificationTemplateText.cs +++ b/Migration.Toolkit.K11/Models/NotificationTemplateText.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Notification_TemplateText")] -[Index("GatewayId", Name = "IX_Notification_TemplateText_GatewayID")] -[Index("TemplateId", Name = "IX_Notification_TemplateText_TemplateID")] -public partial class NotificationTemplateText -{ - [Key] - [Column("TemplateTextID")] - public int TemplateTextId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [Column("GatewayID")] - public int GatewayId { get; set; } - - [StringLength(250)] - public string TemplateSubject { get; set; } = null!; - - [Column("TemplateHTMLText")] - public string TemplateHtmltext { get; set; } = null!; - - public string TemplatePlainText { get; set; } = null!; - - [Column("TemplateTextGUID")] - public Guid TemplateTextGuid { get; set; } - - public DateTime TemplateTextLastModified { get; set; } - - [ForeignKey("GatewayId")] - [InverseProperty("NotificationTemplateTexts")] - public virtual NotificationGateway Gateway { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NotificationTemplateTexts")] - public virtual NotificationTemplate Template { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Notification_TemplateText")] +[Index("GatewayId", Name = "IX_Notification_TemplateText_GatewayID")] +[Index("TemplateId", Name = "IX_Notification_TemplateText_TemplateID")] +public class NotificationTemplateText +{ + [Key] + [Column("TemplateTextID")] + public int TemplateTextId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [Column("GatewayID")] + public int GatewayId { get; set; } + + [StringLength(250)] + public string TemplateSubject { get; set; } = null!; + + [Column("TemplateHTMLText")] + public string TemplateHtmltext { get; set; } = null!; + + public string TemplatePlainText { get; set; } = null!; + + [Column("TemplateTextGUID")] + public Guid TemplateTextGuid { get; set; } + + public DateTime TemplateTextLastModified { get; set; } + + [ForeignKey("GatewayId")] + [InverseProperty("NotificationTemplateTexts")] + public virtual NotificationGateway Gateway { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NotificationTemplateTexts")] + public virtual NotificationTemplate Template { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/OmAbtest.cs b/Migration.Toolkit.K11/Models/OmAbtest.cs index 64676145..e305c29e 100644 --- a/Migration.Toolkit.K11/Models/OmAbtest.cs +++ b/Migration.Toolkit.K11/Models/OmAbtest.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ABTest")] -[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] -public partial class OmAbtest -{ - [Key] - [Column("ABTestID")] - public int AbtestId { get; set; } - - [Column("ABTestName")] - [StringLength(50)] - public string AbtestName { get; set; } = null!; - - [Column("ABTestDescription")] - public string? AbtestDescription { get; set; } - - [Column("ABTestCulture")] - [StringLength(50)] - public string? AbtestCulture { get; set; } - - [Column("ABTestOriginalPage")] - [StringLength(450)] - public string AbtestOriginalPage { get; set; } = null!; - - [Column("ABTestOpenFrom")] - public DateTime? AbtestOpenFrom { get; set; } - - [Column("ABTestOpenTo")] - public DateTime? AbtestOpenTo { get; set; } - - [Column("ABTestSiteID")] - public int AbtestSiteId { get; set; } - - [Column("ABTestGUID")] - public Guid AbtestGuid { get; set; } - - [Column("ABTestLastModified")] - public DateTime AbtestLastModified { get; set; } - - [Column("ABTestDisplayName")] - [StringLength(100)] - public string AbtestDisplayName { get; set; } = null!; - - [Column("ABTestIncludedTraffic")] - public int AbtestIncludedTraffic { get; set; } - - [Column("ABTestVisitorTargeting")] - public string? AbtestVisitorTargeting { get; set; } - - [Column("ABTestConversions")] - public string? AbtestConversions { get; set; } - - [Column("ABTestWinnerGUID")] - public Guid? AbtestWinnerGuid { get; set; } - - [ForeignKey("AbtestSiteId")] - [InverseProperty("OmAbtests")] - public virtual CmsSite AbtestSite { get; set; } = null!; - - [InverseProperty("AbvariantTest")] - public virtual ICollection OmAbvariants { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ABTest")] +[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] +public class OmAbtest +{ + [Key] + [Column("ABTestID")] + public int AbtestId { get; set; } + + [Column("ABTestName")] + [StringLength(50)] + public string AbtestName { get; set; } = null!; + + [Column("ABTestDescription")] + public string? AbtestDescription { get; set; } + + [Column("ABTestCulture")] + [StringLength(50)] + public string? AbtestCulture { get; set; } + + [Column("ABTestOriginalPage")] + [StringLength(450)] + public string AbtestOriginalPage { get; set; } = null!; + + [Column("ABTestOpenFrom")] + public DateTime? AbtestOpenFrom { get; set; } + + [Column("ABTestOpenTo")] + public DateTime? AbtestOpenTo { get; set; } + + [Column("ABTestSiteID")] + public int AbtestSiteId { get; set; } + + [Column("ABTestGUID")] + public Guid AbtestGuid { get; set; } + + [Column("ABTestLastModified")] + public DateTime AbtestLastModified { get; set; } + + [Column("ABTestDisplayName")] + [StringLength(100)] + public string AbtestDisplayName { get; set; } = null!; + + [Column("ABTestIncludedTraffic")] + public int AbtestIncludedTraffic { get; set; } + + [Column("ABTestVisitorTargeting")] + public string? AbtestVisitorTargeting { get; set; } + + [Column("ABTestConversions")] + public string? AbtestConversions { get; set; } + + [Column("ABTestWinnerGUID")] + public Guid? AbtestWinnerGuid { get; set; } + + [ForeignKey("AbtestSiteId")] + [InverseProperty("OmAbtests")] + public virtual CmsSite AbtestSite { get; set; } = null!; + + [InverseProperty("AbvariantTest")] + public virtual ICollection OmAbvariants { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmAbvariant.cs b/Migration.Toolkit.K11/Models/OmAbvariant.cs index a450dada..9aa05369 100644 --- a/Migration.Toolkit.K11/Models/OmAbvariant.cs +++ b/Migration.Toolkit.K11/Models/OmAbvariant.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ABVariant")] -[Index("AbvariantSiteId", Name = "IX_OM_ABVariant_ABVariantSiteID")] -[Index("AbvariantTestId", Name = "IX_OM_ABVariant_ABVariantTestID")] -public partial class OmAbvariant -{ - [Key] - [Column("ABVariantID")] - public int AbvariantId { get; set; } - - [Column("ABVariantDisplayName")] - [StringLength(110)] - public string AbvariantDisplayName { get; set; } = null!; - - [Column("ABVariantName")] - [StringLength(50)] - public string AbvariantName { get; set; } = null!; - - [Column("ABVariantTestID")] - public int AbvariantTestId { get; set; } - - [Column("ABVariantPath")] - [StringLength(450)] - public string AbvariantPath { get; set; } = null!; - - [Column("ABVariantGUID")] - public Guid AbvariantGuid { get; set; } - - [Column("ABVariantLastModified")] - public DateTime AbvariantLastModified { get; set; } - - [Column("ABVariantSiteID")] - public int AbvariantSiteId { get; set; } - - [ForeignKey("AbvariantSiteId")] - [InverseProperty("OmAbvariants")] - public virtual CmsSite AbvariantSite { get; set; } = null!; - - [ForeignKey("AbvariantTestId")] - [InverseProperty("OmAbvariants")] - public virtual OmAbtest AbvariantTest { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ABVariant")] +[Index("AbvariantSiteId", Name = "IX_OM_ABVariant_ABVariantSiteID")] +[Index("AbvariantTestId", Name = "IX_OM_ABVariant_ABVariantTestID")] +public class OmAbvariant +{ + [Key] + [Column("ABVariantID")] + public int AbvariantId { get; set; } + + [Column("ABVariantDisplayName")] + [StringLength(110)] + public string AbvariantDisplayName { get; set; } = null!; + + [Column("ABVariantName")] + [StringLength(50)] + public string AbvariantName { get; set; } = null!; + + [Column("ABVariantTestID")] + public int AbvariantTestId { get; set; } + + [Column("ABVariantPath")] + [StringLength(450)] + public string AbvariantPath { get; set; } = null!; + + [Column("ABVariantGUID")] + public Guid AbvariantGuid { get; set; } + + [Column("ABVariantLastModified")] + public DateTime AbvariantLastModified { get; set; } + + [Column("ABVariantSiteID")] + public int AbvariantSiteId { get; set; } + + [ForeignKey("AbvariantSiteId")] + [InverseProperty("OmAbvariants")] + public virtual CmsSite AbvariantSite { get; set; } = null!; + + [ForeignKey("AbvariantTestId")] + [InverseProperty("OmAbvariants")] + public virtual OmAbtest AbvariantTest { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/OmAccount.cs b/Migration.Toolkit.K11/Models/OmAccount.cs index 8f341ce1..4463f7f6 100644 --- a/Migration.Toolkit.K11/Models/OmAccount.cs +++ b/Migration.Toolkit.K11/Models/OmAccount.cs @@ -1,114 +1,113 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Account")] -[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] -[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] -[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] -[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] -[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] -[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] -[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] -public partial class OmAccount -{ - [Key] - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [ForeignKey("AccountCountryId")] - [InverseProperty("OmAccounts")] - public virtual CmsCountry? AccountCountry { get; set; } - - [ForeignKey("AccountOwnerUserId")] - [InverseProperty("OmAccounts")] - public virtual CmsUser? AccountOwnerUser { get; set; } - - [ForeignKey("AccountPrimaryContactId")] - [InverseProperty("OmAccountAccountPrimaryContacts")] - public virtual OmContact? AccountPrimaryContact { get; set; } - - [ForeignKey("AccountSecondaryContactId")] - [InverseProperty("OmAccountAccountSecondaryContacts")] - public virtual OmContact? AccountSecondaryContact { get; set; } - - [ForeignKey("AccountStateId")] - [InverseProperty("OmAccounts")] - public virtual CmsState? AccountState { get; set; } - - [ForeignKey("AccountStatusId")] - [InverseProperty("OmAccounts")] - public virtual OmAccountStatus? AccountStatus { get; set; } - - [ForeignKey("AccountSubsidiaryOfId")] - [InverseProperty("InverseAccountSubsidiaryOf")] - public virtual OmAccount? AccountSubsidiaryOf { get; set; } - - [InverseProperty("AccountSubsidiaryOf")] - public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); - - [InverseProperty("Account")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_Account")] +[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] +[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] +[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] +[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] +[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] +[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] +[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] +public class OmAccount +{ + [Key] + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [ForeignKey("AccountCountryId")] + [InverseProperty("OmAccounts")] + public virtual CmsCountry? AccountCountry { get; set; } + + [ForeignKey("AccountOwnerUserId")] + [InverseProperty("OmAccounts")] + public virtual CmsUser? AccountOwnerUser { get; set; } + + [ForeignKey("AccountPrimaryContactId")] + [InverseProperty("OmAccountAccountPrimaryContacts")] + public virtual OmContact? AccountPrimaryContact { get; set; } + + [ForeignKey("AccountSecondaryContactId")] + [InverseProperty("OmAccountAccountSecondaryContacts")] + public virtual OmContact? AccountSecondaryContact { get; set; } + + [ForeignKey("AccountStateId")] + [InverseProperty("OmAccounts")] + public virtual CmsState? AccountState { get; set; } + + [ForeignKey("AccountStatusId")] + [InverseProperty("OmAccounts")] + public virtual OmAccountStatus? AccountStatus { get; set; } + + [ForeignKey("AccountSubsidiaryOfId")] + [InverseProperty("InverseAccountSubsidiaryOf")] + public virtual OmAccount? AccountSubsidiaryOf { get; set; } + + [InverseProperty("AccountSubsidiaryOf")] + public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); + + [InverseProperty("Account")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmAccountContact.cs b/Migration.Toolkit.K11/Models/OmAccountContact.cs index 418e7425..e257be3f 100644 --- a/Migration.Toolkit.K11/Models/OmAccountContact.cs +++ b/Migration.Toolkit.K11/Models/OmAccountContact.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_AccountContact")] -[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] -[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] -[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] -public partial class OmAccountContact -{ - [Key] - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("AccountId")] - [InverseProperty("OmAccountContacts")] - public virtual OmAccount Account { get; set; } = null!; - - [ForeignKey("ContactId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("ContactRoleId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContactRole? ContactRole { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_AccountContact")] +[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] +[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] +[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] +public class OmAccountContact +{ + [Key] + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("AccountId")] + [InverseProperty("OmAccountContacts")] + public virtual OmAccount Account { get; set; } = null!; + + [ForeignKey("ContactId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("ContactRoleId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContactRole? ContactRole { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/OmAccountStatus.cs b/Migration.Toolkit.K11/Models/OmAccountStatus.cs index cb669366..903b4932 100644 --- a/Migration.Toolkit.K11/Models/OmAccountStatus.cs +++ b/Migration.Toolkit.K11/Models/OmAccountStatus.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_AccountStatus")] -public partial class OmAccountStatus -{ - [Key] - [Column("AccountStatusID")] - public int AccountStatusId { get; set; } - - [StringLength(200)] - public string AccountStatusName { get; set; } = null!; - - [StringLength(200)] - public string AccountStatusDisplayName { get; set; } = null!; - - public string? AccountStatusDescription { get; set; } - - [InverseProperty("AccountStatus")] - public virtual ICollection OmAccounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_AccountStatus")] +public class OmAccountStatus +{ + [Key] + [Column("AccountStatusID")] + public int AccountStatusId { get; set; } + + [StringLength(200)] + public string AccountStatusName { get; set; } = null!; + + [StringLength(200)] + public string AccountStatusDisplayName { get; set; } = null!; + + public string? AccountStatusDescription { get; set; } + + [InverseProperty("AccountStatus")] + public virtual ICollection OmAccounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmActivity.cs b/Migration.Toolkit.K11/Models/OmActivity.cs index f284d33a..7c402f37 100644 --- a/Migration.Toolkit.K11/Models/OmActivity.cs +++ b/Migration.Toolkit.K11/Models/OmActivity.cs @@ -1,79 +1,78 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Activity")] -[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] -[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] -[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] -[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] -[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] -public partial class OmActivity -{ - [Key] - [Column("ActivityID")] - public int ActivityId { get; set; } - - [Column("ActivityContactID")] - public int ActivityContactId { get; set; } - - public DateTime? ActivityCreated { get; set; } - - [StringLength(250)] - public string ActivityType { get; set; } = null!; - - [Column("ActivityItemID")] - public int? ActivityItemId { get; set; } - - [Column("ActivityItemDetailID")] - public int? ActivityItemDetailId { get; set; } - - [StringLength(250)] - public string? ActivityValue { get; set; } - - [Column("ActivityURL")] - public string? ActivityUrl { get; set; } - - [StringLength(250)] - public string? ActivityTitle { get; set; } - - [Column("ActivitySiteID")] - public int ActivitySiteId { get; set; } - - public string? ActivityComment { get; set; } - - [StringLength(200)] - public string? ActivityCampaign { get; set; } - - [Column("ActivityURLReferrer")] - public string? ActivityUrlreferrer { get; set; } - - [StringLength(10)] - public string? ActivityCulture { get; set; } - - [Column("ActivityNodeID")] - public int? ActivityNodeId { get; set; } - - [Column("ActivityUTMSource")] - [StringLength(200)] - public string? ActivityUtmsource { get; set; } - - [Column("ActivityABVariantName")] - [StringLength(200)] - public string? ActivityAbvariantName { get; set; } - - [Column("ActivityMVTCombinationName")] - [StringLength(200)] - public string? ActivityMvtcombinationName { get; set; } - - [Column("ActivityURLHash")] - public long ActivityUrlhash { get; set; } - - [Column("ActivityUTMContent")] - [StringLength(200)] - public string? ActivityUtmcontent { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_Activity")] +[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] +[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] +[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] +[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] +[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] +public class OmActivity +{ + [Key] + [Column("ActivityID")] + public int ActivityId { get; set; } + + [Column("ActivityContactID")] + public int ActivityContactId { get; set; } + + public DateTime? ActivityCreated { get; set; } + + [StringLength(250)] + public string ActivityType { get; set; } = null!; + + [Column("ActivityItemID")] + public int? ActivityItemId { get; set; } + + [Column("ActivityItemDetailID")] + public int? ActivityItemDetailId { get; set; } + + [StringLength(250)] + public string? ActivityValue { get; set; } + + [Column("ActivityURL")] + public string? ActivityUrl { get; set; } + + [StringLength(250)] + public string? ActivityTitle { get; set; } + + [Column("ActivitySiteID")] + public int ActivitySiteId { get; set; } + + public string? ActivityComment { get; set; } + + [StringLength(200)] + public string? ActivityCampaign { get; set; } + + [Column("ActivityURLReferrer")] + public string? ActivityUrlreferrer { get; set; } + + [StringLength(10)] + public string? ActivityCulture { get; set; } + + [Column("ActivityNodeID")] + public int? ActivityNodeId { get; set; } + + [Column("ActivityUTMSource")] + [StringLength(200)] + public string? ActivityUtmsource { get; set; } + + [Column("ActivityABVariantName")] + [StringLength(200)] + public string? ActivityAbvariantName { get; set; } + + [Column("ActivityMVTCombinationName")] + [StringLength(200)] + public string? ActivityMvtcombinationName { get; set; } + + [Column("ActivityURLHash")] + public long ActivityUrlhash { get; set; } + + [Column("ActivityUTMContent")] + [StringLength(200)] + public string? ActivityUtmcontent { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs index 1054df9f..501c5375 100644 --- a/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs +++ b/Migration.Toolkit.K11/Models/OmActivityRecalculationQueue.cs @@ -1,18 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ActivityRecalculationQueue")] -public partial class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ActivityRecalculationQueue")] +public class OmActivityRecalculationQueue +{ + [Key] + [Column("ActivityRecalculationQueueID")] + public int ActivityRecalculationQueueId { get; set; } + + [Column("ActivityRecalculationQueueActivityID")] + public int ActivityRecalculationQueueActivityId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/OmActivityType.cs b/Migration.Toolkit.K11/Models/OmActivityType.cs index eaf00b67..562dee28 100644 --- a/Migration.Toolkit.K11/Models/OmActivityType.cs +++ b/Migration.Toolkit.K11/Models/OmActivityType.cs @@ -1,40 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ActivityType")] -public partial class OmActivityType -{ - [Key] - [Column("ActivityTypeID")] - public int ActivityTypeId { get; set; } - - [StringLength(250)] - public string ActivityTypeDisplayName { get; set; } = null!; - - [StringLength(250)] - public string ActivityTypeName { get; set; } = null!; - - public bool? ActivityTypeEnabled { get; set; } - - public bool? ActivityTypeIsCustom { get; set; } - - public string? ActivityTypeDescription { get; set; } - - public bool? ActivityTypeManualCreationAllowed { get; set; } - - [StringLength(200)] - public string? ActivityTypeMainFormControl { get; set; } - - [StringLength(200)] - public string? ActivityTypeDetailFormControl { get; set; } - - public bool ActivityTypeIsHiddenInContentOnly { get; set; } - - [StringLength(7)] - public string? ActivityTypeColor { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ActivityType")] +public class OmActivityType +{ + [Key] + [Column("ActivityTypeID")] + public int ActivityTypeId { get; set; } + + [StringLength(250)] + public string ActivityTypeDisplayName { get; set; } = null!; + + [StringLength(250)] + public string ActivityTypeName { get; set; } = null!; + + public bool? ActivityTypeEnabled { get; set; } + + public bool? ActivityTypeIsCustom { get; set; } + + public string? ActivityTypeDescription { get; set; } + + public bool? ActivityTypeManualCreationAllowed { get; set; } + + [StringLength(200)] + public string? ActivityTypeMainFormControl { get; set; } + + [StringLength(200)] + public string? ActivityTypeDetailFormControl { get; set; } + + public bool ActivityTypeIsHiddenInContentOnly { get; set; } + + [StringLength(7)] + public string? ActivityTypeColor { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/OmContact.cs b/Migration.Toolkit.K11/Models/OmContact.cs index 0811195b..55850a9b 100644 --- a/Migration.Toolkit.K11/Models/OmContact.cs +++ b/Migration.Toolkit.K11/Models/OmContact.cs @@ -1,141 +1,140 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Contact")] -[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] -[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] -[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] -[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] -[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] -[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] -[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] -[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] -public partial class OmContact -{ - [Key] - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactSalesForceLeadID")] - [StringLength(18)] - public string? ContactSalesForceLeadId { get; set; } - - public bool? ContactSalesForceLeadReplicationDisabled { get; set; } - - public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } - - public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } - - public bool? ContactSalesForceLeadReplicationRequired { get; set; } - - [Column("ContactPersonaID")] - public int? ContactPersonaId { get; set; } - - [InverseProperty("ConsentAgreementContact")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [ForeignKey("ContactCountryId")] - [InverseProperty("OmContacts")] - public virtual CmsCountry? ContactCountry { get; set; } - - [ForeignKey("ContactOwnerUserId")] - [InverseProperty("OmContacts")] - public virtual CmsUser? ContactOwnerUser { get; set; } - - [ForeignKey("ContactStateId")] - [InverseProperty("OmContacts")] - public virtual CmsState? ContactState { get; set; } - - [ForeignKey("ContactStatusId")] - [InverseProperty("OmContacts")] - public virtual OmContactStatus? ContactStatus { get; set; } - - [InverseProperty("AccountPrimaryContact")] - public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); - - [InverseProperty("AccountSecondaryContact")] - public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmMemberships { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [InverseProperty("VisitorToContactContact")] - public virtual ICollection OmVisitorToContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_Contact")] +[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] +[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] +[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] +[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] +[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] +[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] +[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] +[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] +public class OmContact +{ + [Key] + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactSalesForceLeadID")] + [StringLength(18)] + public string? ContactSalesForceLeadId { get; set; } + + public bool? ContactSalesForceLeadReplicationDisabled { get; set; } + + public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } + + public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } + + public bool? ContactSalesForceLeadReplicationRequired { get; set; } + + [Column("ContactPersonaID")] + public int? ContactPersonaId { get; set; } + + [InverseProperty("ConsentAgreementContact")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [ForeignKey("ContactCountryId")] + [InverseProperty("OmContacts")] + public virtual CmsCountry? ContactCountry { get; set; } + + [ForeignKey("ContactOwnerUserId")] + [InverseProperty("OmContacts")] + public virtual CmsUser? ContactOwnerUser { get; set; } + + [ForeignKey("ContactStateId")] + [InverseProperty("OmContacts")] + public virtual CmsState? ContactState { get; set; } + + [ForeignKey("ContactStatusId")] + [InverseProperty("OmContacts")] + public virtual OmContactStatus? ContactStatus { get; set; } + + [InverseProperty("AccountPrimaryContact")] + public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); + + [InverseProperty("AccountSecondaryContact")] + public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmMemberships { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [InverseProperty("VisitorToContactContact")] + public virtual ICollection OmVisitorToContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs index 52eb6bb0..5b6e0fb4 100644 --- a/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs +++ b/Migration.Toolkit.K11/Models/OmContactChangeRecalculationQueue.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactChangeRecalculationQueue")] -public partial class OmContactChangeRecalculationQueue -{ - [Key] - [Column("ContactChangeRecalculationQueueID")] - public int ContactChangeRecalculationQueueId { get; set; } - - [Column("ContactChangeRecalculationQueueContactID")] - public int ContactChangeRecalculationQueueContactId { get; set; } - - public string? ContactChangeRecalculationQueueChangedColumns { get; set; } - - public bool ContactChangeRecalculationQueueContactIsNew { get; set; } - - public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ContactChangeRecalculationQueue")] +public class OmContactChangeRecalculationQueue +{ + [Key] + [Column("ContactChangeRecalculationQueueID")] + public int ContactChangeRecalculationQueueId { get; set; } + + [Column("ContactChangeRecalculationQueueContactID")] + public int ContactChangeRecalculationQueueContactId { get; set; } + + public string? ContactChangeRecalculationQueueChangedColumns { get; set; } + + public bool ContactChangeRecalculationQueueContactIsNew { get; set; } + + public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/OmContactGroup.cs b/Migration.Toolkit.K11/Models/OmContactGroup.cs index 98b0c4f0..0142c661 100644 --- a/Migration.Toolkit.K11/Models/OmContactGroup.cs +++ b/Migration.Toolkit.K11/Models/OmContactGroup.cs @@ -1,40 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactGroup")] -public partial class OmContactGroup -{ - [Key] - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - public string? ContactGroupDescription { get; set; } - - public string? ContactGroupDynamicCondition { get; set; } - - public bool? ContactGroupEnabled { get; set; } - - public DateTime? ContactGroupLastModified { get; set; } - - [Column("ContactGroupGUID")] - public Guid? ContactGroupGuid { get; set; } - - public int? ContactGroupStatus { get; set; } - - [InverseProperty("ContactGroup")] - public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); - - [InverseProperty("ContactGroupMemberContactGroup")] - public virtual ICollection OmContactGroupMembers { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ContactGroup")] +public class OmContactGroup +{ + [Key] + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + public string? ContactGroupDescription { get; set; } + + public string? ContactGroupDynamicCondition { get; set; } + + public bool? ContactGroupEnabled { get; set; } + + public DateTime? ContactGroupLastModified { get; set; } + + [Column("ContactGroupGUID")] + public Guid? ContactGroupGuid { get; set; } + + public int? ContactGroupStatus { get; set; } + + [InverseProperty("ContactGroup")] + public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); + + [InverseProperty("ContactGroupMemberContactGroup")] + public virtual ICollection OmContactGroupMembers { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmContactGroupMember.cs b/Migration.Toolkit.K11/Models/OmContactGroupMember.cs index 44392576..3b4d3c87 100644 --- a/Migration.Toolkit.K11/Models/OmContactGroupMember.cs +++ b/Migration.Toolkit.K11/Models/OmContactGroupMember.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactGroupMember")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] -[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] -public partial class OmContactGroupMember -{ - [Key] - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public int ContactGroupMemberType { get; set; } - - [Column("ContactGroupMemberRelatedID")] - public int ContactGroupMemberRelatedId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [ForeignKey("ContactGroupMemberContactGroupId")] - [InverseProperty("OmContactGroupMembers")] - public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ContactGroupMember")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] +[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] +public class OmContactGroupMember +{ + [Key] + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public int ContactGroupMemberType { get; set; } + + [Column("ContactGroupMemberRelatedID")] + public int ContactGroupMemberRelatedId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [ForeignKey("ContactGroupMemberContactGroupId")] + [InverseProperty("OmContactGroupMembers")] + public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/OmContactRole.cs b/Migration.Toolkit.K11/Models/OmContactRole.cs index 806da7fa..3e725325 100644 --- a/Migration.Toolkit.K11/Models/OmContactRole.cs +++ b/Migration.Toolkit.K11/Models/OmContactRole.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactRole")] -public partial class OmContactRole -{ - [Key] - [Column("ContactRoleID")] - public int ContactRoleId { get; set; } - - [StringLength(200)] - public string ContactRoleName { get; set; } = null!; - - [StringLength(200)] - public string ContactRoleDisplayName { get; set; } = null!; - - public string? ContactRoleDescription { get; set; } - - [InverseProperty("ContactRole")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ContactRole")] +public class OmContactRole +{ + [Key] + [Column("ContactRoleID")] + public int ContactRoleId { get; set; } + + [StringLength(200)] + public string ContactRoleName { get; set; } = null!; + + [StringLength(200)] + public string ContactRoleDisplayName { get; set; } = null!; + + public string? ContactRoleDescription { get; set; } + + [InverseProperty("ContactRole")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmContactStatus.cs b/Migration.Toolkit.K11/Models/OmContactStatus.cs index 260a07c8..9c5b78f9 100644 --- a/Migration.Toolkit.K11/Models/OmContactStatus.cs +++ b/Migration.Toolkit.K11/Models/OmContactStatus.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ContactStatus")] -public partial class OmContactStatus -{ - [Key] - [Column("ContactStatusID")] - public int ContactStatusId { get; set; } - - [StringLength(200)] - public string ContactStatusName { get; set; } = null!; - - [StringLength(200)] - public string ContactStatusDisplayName { get; set; } = null!; - - public string? ContactStatusDescription { get; set; } - - [InverseProperty("ContactStatus")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ContactStatus")] +public class OmContactStatus +{ + [Key] + [Column("ContactStatusID")] + public int ContactStatusId { get; set; } + + [StringLength(200)] + public string ContactStatusName { get; set; } = null!; + + [StringLength(200)] + public string ContactStatusDisplayName { get; set; } = null!; + + public string? ContactStatusDescription { get; set; } + + [InverseProperty("ContactStatus")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmMembership.cs b/Migration.Toolkit.K11/Models/OmMembership.cs index f5ff06ff..d12b12d4 100644 --- a/Migration.Toolkit.K11/Models/OmMembership.cs +++ b/Migration.Toolkit.K11/Models/OmMembership.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Membership")] -[Index("ContactId", Name = "IX_OM_Membership_ContactID")] -[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] -public partial class OmMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("RelatedID")] - public int RelatedId { get; set; } - - public int MemberType { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - public DateTime MembershipCreated { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmMemberships")] - public virtual OmContact Contact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_Membership")] +[Index("ContactId", Name = "IX_OM_Membership_ContactID")] +[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] +public class OmMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("RelatedID")] + public int RelatedId { get; set; } + + public int MemberType { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + public DateTime MembershipCreated { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmMemberships")] + public virtual OmContact Contact { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/OmMvtcombination.cs b/Migration.Toolkit.K11/Models/OmMvtcombination.cs index 21dbe0d4..fec0bddf 100644 --- a/Migration.Toolkit.K11/Models/OmMvtcombination.cs +++ b/Migration.Toolkit.K11/Models/OmMvtcombination.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_MVTCombination")] -[Index("MvtcombinationPageTemplateId", Name = "IX_OM_MVTCombination_MVTCombinationPageTemplateID")] -public partial class OmMvtcombination -{ - [Key] - [Column("MVTCombinationID")] - public int MvtcombinationId { get; set; } - - [Column("MVTCombinationName")] - [StringLength(200)] - public string MvtcombinationName { get; set; } = null!; - - [Column("MVTCombinationCustomName")] - [StringLength(200)] - public string? MvtcombinationCustomName { get; set; } - - [Column("MVTCombinationPageTemplateID")] - public int MvtcombinationPageTemplateId { get; set; } - - [Column("MVTCombinationEnabled")] - public bool MvtcombinationEnabled { get; set; } - - [Column("MVTCombinationGUID")] - public Guid MvtcombinationGuid { get; set; } - - [Column("MVTCombinationLastModified")] - public DateTime MvtcombinationLastModified { get; set; } - - [Column("MVTCombinationIsDefault")] - public bool? MvtcombinationIsDefault { get; set; } - - [Column("MVTCombinationConversions")] - public int? MvtcombinationConversions { get; set; } - - [Column("MVTCombinationDocumentID")] - public int? MvtcombinationDocumentId { get; set; } - - [ForeignKey("MvtcombinationId")] - [InverseProperty("Mvtcombinations")] - public virtual ICollection Mvtvariants { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_MVTCombination")] +[Index("MvtcombinationPageTemplateId", Name = "IX_OM_MVTCombination_MVTCombinationPageTemplateID")] +public class OmMvtcombination +{ + [Key] + [Column("MVTCombinationID")] + public int MvtcombinationId { get; set; } + + [Column("MVTCombinationName")] + [StringLength(200)] + public string MvtcombinationName { get; set; } = null!; + + [Column("MVTCombinationCustomName")] + [StringLength(200)] + public string? MvtcombinationCustomName { get; set; } + + [Column("MVTCombinationPageTemplateID")] + public int MvtcombinationPageTemplateId { get; set; } + + [Column("MVTCombinationEnabled")] + public bool MvtcombinationEnabled { get; set; } + + [Column("MVTCombinationGUID")] + public Guid MvtcombinationGuid { get; set; } + + [Column("MVTCombinationLastModified")] + public DateTime MvtcombinationLastModified { get; set; } + + [Column("MVTCombinationIsDefault")] + public bool? MvtcombinationIsDefault { get; set; } + + [Column("MVTCombinationConversions")] + public int? MvtcombinationConversions { get; set; } + + [Column("MVTCombinationDocumentID")] + public int? MvtcombinationDocumentId { get; set; } + + [ForeignKey("MvtcombinationId")] + [InverseProperty("Mvtcombinations")] + public virtual ICollection Mvtvariants { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmMvtest.cs b/Migration.Toolkit.K11/Models/OmMvtest.cs index ba0a284b..44a72807 100644 --- a/Migration.Toolkit.K11/Models/OmMvtest.cs +++ b/Migration.Toolkit.K11/Models/OmMvtest.cs @@ -1,67 +1,66 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_MVTest")] -[Index("MvtestSiteId", Name = "IX_OM_MVTest_MVTestSiteID")] -public partial class OmMvtest -{ - [Key] - [Column("MVTestID")] - public int MvtestId { get; set; } - - [Column("MVTestName")] - [StringLength(50)] - public string MvtestName { get; set; } = null!; - - [Column("MVTestDescription")] - public string? MvtestDescription { get; set; } - - [Column("MVTestPage")] - [StringLength(450)] - public string MvtestPage { get; set; } = null!; - - [Column("MVTestSiteID")] - public int MvtestSiteId { get; set; } - - [Column("MVTestCulture")] - [StringLength(50)] - public string? MvtestCulture { get; set; } - - [Column("MVTestOpenFrom")] - public DateTime? MvtestOpenFrom { get; set; } - - [Column("MVTestOpenTo")] - public DateTime? MvtestOpenTo { get; set; } - - [Column("MVTestMaxConversions")] - public int? MvtestMaxConversions { get; set; } - - [Column("MVTestConversions")] - public int? MvtestConversions { get; set; } - - [Column("MVTestTargetConversionType")] - [StringLength(100)] - public string? MvtestTargetConversionType { get; set; } - - [Column("MVTestGUID")] - public Guid MvtestGuid { get; set; } - - [Column("MVTestLastModified")] - public DateTime MvtestLastModified { get; set; } - - [Column("MVTestEnabled")] - public bool MvtestEnabled { get; set; } - - [Column("MVTestDisplayName")] - [StringLength(100)] - public string MvtestDisplayName { get; set; } = null!; - - [ForeignKey("MvtestSiteId")] - [InverseProperty("OmMvtests")] - public virtual CmsSite MvtestSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_MVTest")] +[Index("MvtestSiteId", Name = "IX_OM_MVTest_MVTestSiteID")] +public class OmMvtest +{ + [Key] + [Column("MVTestID")] + public int MvtestId { get; set; } + + [Column("MVTestName")] + [StringLength(50)] + public string MvtestName { get; set; } = null!; + + [Column("MVTestDescription")] + public string? MvtestDescription { get; set; } + + [Column("MVTestPage")] + [StringLength(450)] + public string MvtestPage { get; set; } = null!; + + [Column("MVTestSiteID")] + public int MvtestSiteId { get; set; } + + [Column("MVTestCulture")] + [StringLength(50)] + public string? MvtestCulture { get; set; } + + [Column("MVTestOpenFrom")] + public DateTime? MvtestOpenFrom { get; set; } + + [Column("MVTestOpenTo")] + public DateTime? MvtestOpenTo { get; set; } + + [Column("MVTestMaxConversions")] + public int? MvtestMaxConversions { get; set; } + + [Column("MVTestConversions")] + public int? MvtestConversions { get; set; } + + [Column("MVTestTargetConversionType")] + [StringLength(100)] + public string? MvtestTargetConversionType { get; set; } + + [Column("MVTestGUID")] + public Guid MvtestGuid { get; set; } + + [Column("MVTestLastModified")] + public DateTime MvtestLastModified { get; set; } + + [Column("MVTestEnabled")] + public bool MvtestEnabled { get; set; } + + [Column("MVTestDisplayName")] + [StringLength(100)] + public string MvtestDisplayName { get; set; } = null!; + + [ForeignKey("MvtestSiteId")] + [InverseProperty("OmMvtests")] + public virtual CmsSite MvtestSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/OmMvtvariant.cs b/Migration.Toolkit.K11/Models/OmMvtvariant.cs index 504a172c..5ec98451 100644 --- a/Migration.Toolkit.K11/Models/OmMvtvariant.cs +++ b/Migration.Toolkit.K11/Models/OmMvtvariant.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_MVTVariant")] -[Index("MvtvariantPageTemplateId", Name = "IX_OM_MVTVariant_MVTVariantPageTemplateID")] -public partial class OmMvtvariant -{ - [Key] - [Column("MVTVariantID")] - public int MvtvariantId { get; set; } - - [Column("MVTVariantName")] - [StringLength(100)] - public string MvtvariantName { get; set; } = null!; - - [Column("MVTVariantDisplayName")] - [StringLength(200)] - public string MvtvariantDisplayName { get; set; } = null!; - - [Column("MVTVariantInstanceGUID")] - public Guid? MvtvariantInstanceGuid { get; set; } - - [Column("MVTVariantZoneID")] - [StringLength(200)] - public string? MvtvariantZoneId { get; set; } - - [Column("MVTVariantPageTemplateID")] - public int MvtvariantPageTemplateId { get; set; } - - [Required] - [Column("MVTVariantEnabled")] - public bool? MvtvariantEnabled { get; set; } - - [Column("MVTVariantWebParts")] - public string? MvtvariantWebParts { get; set; } - - [Column("MVTVariantGUID")] - public Guid MvtvariantGuid { get; set; } - - [Column("MVTVariantLastModified")] - public DateTime MvtvariantLastModified { get; set; } - - [Column("MVTVariantDescription")] - public string? MvtvariantDescription { get; set; } - - [Column("MVTVariantDocumentID")] - public int? MvtvariantDocumentId { get; set; } - - [ForeignKey("MvtvariantPageTemplateId")] - [InverseProperty("OmMvtvariants")] - public virtual CmsPageTemplate MvtvariantPageTemplate { get; set; } = null!; - - [ForeignKey("MvtvariantId")] - [InverseProperty("Mvtvariants")] - public virtual ICollection Mvtcombinations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_MVTVariant")] +[Index("MvtvariantPageTemplateId", Name = "IX_OM_MVTVariant_MVTVariantPageTemplateID")] +public class OmMvtvariant +{ + [Key] + [Column("MVTVariantID")] + public int MvtvariantId { get; set; } + + [Column("MVTVariantName")] + [StringLength(100)] + public string MvtvariantName { get; set; } = null!; + + [Column("MVTVariantDisplayName")] + [StringLength(200)] + public string MvtvariantDisplayName { get; set; } = null!; + + [Column("MVTVariantInstanceGUID")] + public Guid? MvtvariantInstanceGuid { get; set; } + + [Column("MVTVariantZoneID")] + [StringLength(200)] + public string? MvtvariantZoneId { get; set; } + + [Column("MVTVariantPageTemplateID")] + public int MvtvariantPageTemplateId { get; set; } + + [Required] + [Column("MVTVariantEnabled")] + public bool? MvtvariantEnabled { get; set; } + + [Column("MVTVariantWebParts")] + public string? MvtvariantWebParts { get; set; } + + [Column("MVTVariantGUID")] + public Guid MvtvariantGuid { get; set; } + + [Column("MVTVariantLastModified")] + public DateTime MvtvariantLastModified { get; set; } + + [Column("MVTVariantDescription")] + public string? MvtvariantDescription { get; set; } + + [Column("MVTVariantDocumentID")] + public int? MvtvariantDocumentId { get; set; } + + [ForeignKey("MvtvariantPageTemplateId")] + [InverseProperty("OmMvtvariants")] + public virtual CmsPageTemplate MvtvariantPageTemplate { get; set; } = null!; + + [ForeignKey("MvtvariantId")] + [InverseProperty("Mvtvariants")] + public virtual ICollection Mvtcombinations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs b/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs index 2ef23dde..20adf1a0 100644 --- a/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs +++ b/Migration.Toolkit.K11/Models/OmPersonalizationVariant.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_PersonalizationVariant")] -[Index("VariantPageTemplateId", Name = "IX_OM_PersonalizationVariant_VariantDocumentID")] -[Index("VariantDocumentId", Name = "IX_OM_PersonalizationVariant_VariantPageTemplateID")] -public partial class OmPersonalizationVariant -{ - [Key] - [Column("VariantID")] - public int VariantId { get; set; } - - [Required] - public bool? VariantEnabled { get; set; } - - [StringLength(200)] - public string VariantName { get; set; } = null!; - - [StringLength(200)] - public string VariantDisplayName { get; set; } = null!; - - [Column("VariantInstanceGUID")] - public Guid? VariantInstanceGuid { get; set; } - - [Column("VariantZoneID")] - [StringLength(200)] - public string? VariantZoneId { get; set; } - - [Column("VariantPageTemplateID")] - public int VariantPageTemplateId { get; set; } - - public string VariantWebParts { get; set; } = null!; - - public int? VariantPosition { get; set; } - - [Column("VariantGUID")] - public Guid VariantGuid { get; set; } - - public DateTime VariantLastModified { get; set; } - - public string? VariantDescription { get; set; } - - [Column("VariantDocumentID")] - public int? VariantDocumentId { get; set; } - - public string VariantDisplayCondition { get; set; } = null!; - - [ForeignKey("VariantDocumentId")] - [InverseProperty("OmPersonalizationVariants")] - public virtual CmsDocument? VariantDocument { get; set; } - - [ForeignKey("VariantPageTemplateId")] - [InverseProperty("OmPersonalizationVariants")] - public virtual CmsPageTemplate VariantPageTemplate { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_PersonalizationVariant")] +[Index("VariantPageTemplateId", Name = "IX_OM_PersonalizationVariant_VariantDocumentID")] +[Index("VariantDocumentId", Name = "IX_OM_PersonalizationVariant_VariantPageTemplateID")] +public class OmPersonalizationVariant +{ + [Key] + [Column("VariantID")] + public int VariantId { get; set; } + + [Required] + public bool? VariantEnabled { get; set; } + + [StringLength(200)] + public string VariantName { get; set; } = null!; + + [StringLength(200)] + public string VariantDisplayName { get; set; } = null!; + + [Column("VariantInstanceGUID")] + public Guid? VariantInstanceGuid { get; set; } + + [Column("VariantZoneID")] + [StringLength(200)] + public string? VariantZoneId { get; set; } + + [Column("VariantPageTemplateID")] + public int VariantPageTemplateId { get; set; } + + public string VariantWebParts { get; set; } = null!; + + public int? VariantPosition { get; set; } + + [Column("VariantGUID")] + public Guid VariantGuid { get; set; } + + public DateTime VariantLastModified { get; set; } + + public string? VariantDescription { get; set; } + + [Column("VariantDocumentID")] + public int? VariantDocumentId { get; set; } + + public string VariantDisplayCondition { get; set; } = null!; + + [ForeignKey("VariantDocumentId")] + [InverseProperty("OmPersonalizationVariants")] + public virtual CmsDocument? VariantDocument { get; set; } + + [ForeignKey("VariantPageTemplateId")] + [InverseProperty("OmPersonalizationVariants")] + public virtual CmsPageTemplate VariantPageTemplate { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/OmRule.cs b/Migration.Toolkit.K11/Models/OmRule.cs index 5a06dab2..0304db26 100644 --- a/Migration.Toolkit.K11/Models/OmRule.cs +++ b/Migration.Toolkit.K11/Models/OmRule.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Rule")] -[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] -public partial class OmRule -{ - [Key] - [Column("RuleID")] - public int RuleId { get; set; } - - [Column("RuleScoreID")] - public int RuleScoreId { get; set; } - - [StringLength(200)] - public string RuleDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RuleName { get; set; } = null!; - - public int RuleValue { get; set; } - - public bool? RuleIsRecurring { get; set; } - - public int? RuleMaxPoints { get; set; } - - public DateTime? RuleValidUntil { get; set; } - - [StringLength(50)] - public string? RuleValidity { get; set; } - - public int? RuleValidFor { get; set; } - - public int RuleType { get; set; } - - [StringLength(250)] - public string? RuleParameter { get; set; } - - public string RuleCondition { get; set; } = null!; - - public DateTime RuleLastModified { get; set; } - - [Column("RuleGUID")] - public Guid RuleGuid { get; set; } - - public bool RuleBelongsToPersona { get; set; } - - [InverseProperty("Rule")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [ForeignKey("RuleScoreId")] - [InverseProperty("OmRules")] - public virtual OmScore RuleScore { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_Rule")] +[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] +public class OmRule +{ + [Key] + [Column("RuleID")] + public int RuleId { get; set; } + + [Column("RuleScoreID")] + public int RuleScoreId { get; set; } + + [StringLength(200)] + public string RuleDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RuleName { get; set; } = null!; + + public int RuleValue { get; set; } + + public bool? RuleIsRecurring { get; set; } + + public int? RuleMaxPoints { get; set; } + + public DateTime? RuleValidUntil { get; set; } + + [StringLength(50)] + public string? RuleValidity { get; set; } + + public int? RuleValidFor { get; set; } + + public int RuleType { get; set; } + + [StringLength(250)] + public string? RuleParameter { get; set; } + + public string RuleCondition { get; set; } = null!; + + public DateTime RuleLastModified { get; set; } + + [Column("RuleGUID")] + public Guid RuleGuid { get; set; } + + public bool RuleBelongsToPersona { get; set; } + + [InverseProperty("Rule")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [ForeignKey("RuleScoreId")] + [InverseProperty("OmRules")] + public virtual OmScore RuleScore { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/OmScore.cs b/Migration.Toolkit.K11/Models/OmScore.cs index ae6f677b..5a736512 100644 --- a/Migration.Toolkit.K11/Models/OmScore.cs +++ b/Migration.Toolkit.K11/Models/OmScore.cs @@ -1,48 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_Score")] -public partial class OmScore -{ - [Key] - [Column("ScoreID")] - public int ScoreId { get; set; } - - [StringLength(200)] - public string ScoreName { get; set; } = null!; - - [StringLength(200)] - public string ScoreDisplayName { get; set; } = null!; - - public string? ScoreDescription { get; set; } - - public bool ScoreEnabled { get; set; } - - public int? ScoreEmailAtScore { get; set; } - - [StringLength(998)] - public string? ScoreNotificationEmail { get; set; } - - public DateTime ScoreLastModified { get; set; } - - [Column("ScoreGUID")] - public Guid ScoreGuid { get; set; } - - public int? ScoreStatus { get; set; } - - [Column("ScoreScheduledTaskID")] - public int? ScoreScheduledTaskId { get; set; } - - public bool ScoreBelongsToPersona { get; set; } - - [InverseProperty("RuleScore")] - public virtual ICollection OmRules { get; set; } = new List(); - - [InverseProperty("Score")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_Score")] +public class OmScore +{ + [Key] + [Column("ScoreID")] + public int ScoreId { get; set; } + + [StringLength(200)] + public string ScoreName { get; set; } = null!; + + [StringLength(200)] + public string ScoreDisplayName { get; set; } = null!; + + public string? ScoreDescription { get; set; } + + public bool ScoreEnabled { get; set; } + + public int? ScoreEmailAtScore { get; set; } + + [StringLength(998)] + public string? ScoreNotificationEmail { get; set; } + + public DateTime ScoreLastModified { get; set; } + + [Column("ScoreGUID")] + public Guid ScoreGuid { get; set; } + + public int? ScoreStatus { get; set; } + + [Column("ScoreScheduledTaskID")] + public int? ScoreScheduledTaskId { get; set; } + + public bool ScoreBelongsToPersona { get; set; } + + [InverseProperty("RuleScore")] + public virtual ICollection OmRules { get; set; } = new List(); + + [InverseProperty("Score")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/OmScoreContactRule.cs b/Migration.Toolkit.K11/Models/OmScoreContactRule.cs index 6f929c9b..b2b954b9 100644 --- a/Migration.Toolkit.K11/Models/OmScoreContactRule.cs +++ b/Migration.Toolkit.K11/Models/OmScoreContactRule.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_ScoreContactRule")] -[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] -[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] -[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] -[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] -public partial class OmScoreContactRule -{ - [Column("ScoreID")] - public int ScoreId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("RuleID")] - public int RuleId { get; set; } - - public int Value { get; set; } - - public DateTime? Expiration { get; set; } - - [Key] - [Column("ScoreContactRuleID")] - public int ScoreContactRuleId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("RuleId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmRule Rule { get; set; } = null!; - - [ForeignKey("ScoreId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmScore Score { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_ScoreContactRule")] +[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] +[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] +[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] +[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] +public class OmScoreContactRule +{ + [Column("ScoreID")] + public int ScoreId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("RuleID")] + public int RuleId { get; set; } + + public int Value { get; set; } + + public DateTime? Expiration { get; set; } + + [Key] + [Column("ScoreContactRuleID")] + public int ScoreContactRuleId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("RuleId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmRule Rule { get; set; } = null!; + + [ForeignKey("ScoreId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmScore Score { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/OmVisitorToContact.cs b/Migration.Toolkit.K11/Models/OmVisitorToContact.cs index 1ef7adfe..c2e81723 100644 --- a/Migration.Toolkit.K11/Models/OmVisitorToContact.cs +++ b/Migration.Toolkit.K11/Models/OmVisitorToContact.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("OM_VisitorToContact")] -[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] -[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] -public partial class OmVisitorToContact -{ - [Key] - [Column("VisitorToContactID")] - public int VisitorToContactId { get; set; } - - [Column("VisitorToContactVisitorGUID")] - public Guid VisitorToContactVisitorGuid { get; set; } - - [Column("VisitorToContactContactID")] - public int VisitorToContactContactId { get; set; } - - [ForeignKey("VisitorToContactContactId")] - [InverseProperty("OmVisitorToContacts")] - public virtual OmContact VisitorToContactContact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("OM_VisitorToContact")] +[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] +[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] +public class OmVisitorToContact +{ + [Key] + [Column("VisitorToContactID")] + public int VisitorToContactId { get; set; } + + [Column("VisitorToContactVisitorGUID")] + public Guid VisitorToContactVisitorGuid { get; set; } + + [Column("VisitorToContactContactID")] + public int VisitorToContactContactId { get; set; } + + [ForeignKey("VisitorToContactContactId")] + [InverseProperty("OmVisitorToContacts")] + public virtual OmContact VisitorToContactContact { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/PersonasPersona.cs b/Migration.Toolkit.K11/Models/PersonasPersona.cs index b39f670e..c490b093 100644 --- a/Migration.Toolkit.K11/Models/PersonasPersona.cs +++ b/Migration.Toolkit.K11/Models/PersonasPersona.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Personas_Persona")] -[Index("PersonaScoreId", Name = "IX_Personas_Persona_PersonaScoreID")] -public partial class PersonasPersona -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [StringLength(200)] - public string PersonaDisplayName { get; set; } = null!; - - [StringLength(200)] - public string PersonaName { get; set; } = null!; - - public string? PersonaDescription { get; set; } - - [Required] - public bool? PersonaEnabled { get; set; } - - [Column("PersonaGUID")] - public Guid PersonaGuid { get; set; } - - [Column("PersonaScoreID")] - public int PersonaScoreId { get; set; } - - [Column("PersonaPictureMetafileGUID")] - public Guid? PersonaPictureMetafileGuid { get; set; } - - public int PersonaPointsThreshold { get; set; } - - [InverseProperty("PersonaContactHistoryPersona")] - public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Personas_Persona")] +[Index("PersonaScoreId", Name = "IX_Personas_Persona_PersonaScoreID")] +public class PersonasPersona +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [StringLength(200)] + public string PersonaDisplayName { get; set; } = null!; + + [StringLength(200)] + public string PersonaName { get; set; } = null!; + + public string? PersonaDescription { get; set; } + + [Required] + public bool? PersonaEnabled { get; set; } + + [Column("PersonaGUID")] + public Guid PersonaGuid { get; set; } + + [Column("PersonaScoreID")] + public int PersonaScoreId { get; set; } + + [Column("PersonaPictureMetafileGUID")] + public Guid? PersonaPictureMetafileGuid { get; set; } + + public int PersonaPointsThreshold { get; set; } + + [InverseProperty("PersonaContactHistoryPersona")] + public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs index bf542336..2184bf7f 100644 --- a/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs +++ b/Migration.Toolkit.K11/Models/PersonasPersonaContactHistory.cs @@ -1,28 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Personas_PersonaContactHistory")] -[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] -public partial class PersonasPersonaContactHistory -{ - [Key] - [Column("PersonaContactHistoryID")] - public int PersonaContactHistoryId { get; set; } - - [Column("PersonaContactHistoryPersonaID")] - public int? PersonaContactHistoryPersonaId { get; set; } - - [Column(TypeName = "date")] - public DateTime PersonaContactHistoryDate { get; set; } - - public int PersonaContactHistoryContacts { get; set; } - - [ForeignKey("PersonaContactHistoryPersonaId")] - [InverseProperty("PersonasPersonaContactHistories")] - public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Personas_PersonaContactHistory")] +[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] +public class PersonasPersonaContactHistory +{ + [Key] + [Column("PersonaContactHistoryID")] + public int PersonaContactHistoryId { get; set; } + + [Column("PersonaContactHistoryPersonaID")] + public int? PersonaContactHistoryPersonaId { get; set; } + + [Column(TypeName = "date")] + public DateTime PersonaContactHistoryDate { get; set; } + + public int PersonaContactHistoryContacts { get; set; } + + [ForeignKey("PersonaContactHistoryPersonaId")] + [InverseProperty("PersonasPersonaContactHistories")] + public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs b/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs index bf20c8f9..b8930a1f 100644 --- a/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs +++ b/Migration.Toolkit.K11/Models/PersonasPersonaNode.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[PrimaryKey("PersonaId", "NodeId")] -[Table("Personas_PersonaNode")] -[Index("NodeId", Name = "IX_Personas_PersonaNode_NodeID")] -[Index("PersonaId", Name = "IX_Personas_PersonaNode_PersonaID")] -public partial class PersonasPersonaNode -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [ForeignKey("NodeId")] - [InverseProperty("PersonasPersonaNodes")] - public virtual CmsTree Node { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[PrimaryKey("PersonaId", "NodeId")] +[Table("Personas_PersonaNode")] +[Index("NodeId", Name = "IX_Personas_PersonaNode_NodeID")] +[Index("PersonaId", Name = "IX_Personas_PersonaNode_PersonaID")] +public class PersonasPersonaNode +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [ForeignKey("NodeId")] + [InverseProperty("PersonasPersonaNodes")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/PollsPoll.cs b/Migration.Toolkit.K11/Models/PollsPoll.cs index d0a65df8..e0373e9c 100644 --- a/Migration.Toolkit.K11/Models/PollsPoll.cs +++ b/Migration.Toolkit.K11/Models/PollsPoll.cs @@ -1,72 +1,71 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Polls_Poll")] -[Index("PollGroupId", Name = "IX_Polls_Poll_PollGroupID")] -[Index("PollSiteId", "PollCodeName", Name = "IX_Polls_Poll_PollSiteID_PollCodeName")] -public partial class PollsPoll -{ - [Key] - [Column("PollID")] - public int PollId { get; set; } - - [StringLength(200)] - public string PollCodeName { get; set; } = null!; - - [StringLength(200)] - public string PollDisplayName { get; set; } = null!; - - [StringLength(100)] - public string? PollTitle { get; set; } - - public DateTime? PollOpenFrom { get; set; } - - public DateTime? PollOpenTo { get; set; } - - public bool PollAllowMultipleAnswers { get; set; } - - [StringLength(450)] - public string PollQuestion { get; set; } = null!; - - public int PollAccess { get; set; } - - [StringLength(450)] - public string? PollResponseMessage { get; set; } - - [Column("PollGUID")] - public Guid PollGuid { get; set; } - - public DateTime PollLastModified { get; set; } - - [Column("PollGroupID")] - public int? PollGroupId { get; set; } - - [Column("PollSiteID")] - public int? PollSiteId { get; set; } - - public bool? PollLogActivity { get; set; } - - [ForeignKey("PollGroupId")] - [InverseProperty("PollsPolls")] - public virtual CommunityGroup? PollGroup { get; set; } - - [ForeignKey("PollSiteId")] - [InverseProperty("PollsPolls")] - public virtual CmsSite? PollSite { get; set; } - - [InverseProperty("AnswerPoll")] - public virtual ICollection PollsPollAnswers { get; set; } = new List(); - - [ForeignKey("PollId")] - [InverseProperty("Polls")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("PollId")] - [InverseProperty("Polls")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Polls_Poll")] +[Index("PollGroupId", Name = "IX_Polls_Poll_PollGroupID")] +[Index("PollSiteId", "PollCodeName", Name = "IX_Polls_Poll_PollSiteID_PollCodeName")] +public class PollsPoll +{ + [Key] + [Column("PollID")] + public int PollId { get; set; } + + [StringLength(200)] + public string PollCodeName { get; set; } = null!; + + [StringLength(200)] + public string PollDisplayName { get; set; } = null!; + + [StringLength(100)] + public string? PollTitle { get; set; } + + public DateTime? PollOpenFrom { get; set; } + + public DateTime? PollOpenTo { get; set; } + + public bool PollAllowMultipleAnswers { get; set; } + + [StringLength(450)] + public string PollQuestion { get; set; } = null!; + + public int PollAccess { get; set; } + + [StringLength(450)] + public string? PollResponseMessage { get; set; } + + [Column("PollGUID")] + public Guid PollGuid { get; set; } + + public DateTime PollLastModified { get; set; } + + [Column("PollGroupID")] + public int? PollGroupId { get; set; } + + [Column("PollSiteID")] + public int? PollSiteId { get; set; } + + public bool? PollLogActivity { get; set; } + + [ForeignKey("PollGroupId")] + [InverseProperty("PollsPolls")] + public virtual CommunityGroup? PollGroup { get; set; } + + [ForeignKey("PollSiteId")] + [InverseProperty("PollsPolls")] + public virtual CmsSite? PollSite { get; set; } + + [InverseProperty("AnswerPoll")] + public virtual ICollection PollsPollAnswers { get; set; } = new List(); + + [ForeignKey("PollId")] + [InverseProperty("Polls")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("PollId")] + [InverseProperty("Polls")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/PollsPollAnswer.cs b/Migration.Toolkit.K11/Models/PollsPollAnswer.cs index 5b411f83..8acd619d 100644 --- a/Migration.Toolkit.K11/Models/PollsPollAnswer.cs +++ b/Migration.Toolkit.K11/Models/PollsPollAnswer.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Polls_PollAnswer")] -[Index("AnswerPollId", Name = "IX_Polls_PollAnswer_AnswerPollID")] -public partial class PollsPollAnswer -{ - [Key] - [Column("AnswerID")] - public int AnswerId { get; set; } - - [StringLength(200)] - public string AnswerText { get; set; } = null!; - - public int? AnswerOrder { get; set; } - - public int? AnswerCount { get; set; } - - public bool? AnswerEnabled { get; set; } - - [Column("AnswerPollID")] - public int AnswerPollId { get; set; } - - [Column("AnswerGUID")] - public Guid AnswerGuid { get; set; } - - public DateTime AnswerLastModified { get; set; } - - [StringLength(100)] - public string? AnswerForm { get; set; } - - [StringLength(100)] - public string? AnswerAlternativeForm { get; set; } - - public bool? AnswerHideForm { get; set; } - - [ForeignKey("AnswerPollId")] - [InverseProperty("PollsPollAnswers")] - public virtual PollsPoll AnswerPoll { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Polls_PollAnswer")] +[Index("AnswerPollId", Name = "IX_Polls_PollAnswer_AnswerPollID")] +public class PollsPollAnswer +{ + [Key] + [Column("AnswerID")] + public int AnswerId { get; set; } + + [StringLength(200)] + public string AnswerText { get; set; } = null!; + + public int? AnswerOrder { get; set; } + + public int? AnswerCount { get; set; } + + public bool? AnswerEnabled { get; set; } + + [Column("AnswerPollID")] + public int AnswerPollId { get; set; } + + [Column("AnswerGUID")] + public Guid AnswerGuid { get; set; } + + public DateTime AnswerLastModified { get; set; } + + [StringLength(100)] + public string? AnswerForm { get; set; } + + [StringLength(100)] + public string? AnswerAlternativeForm { get; set; } + + public bool? AnswerHideForm { get; set; } + + [ForeignKey("AnswerPollId")] + [InverseProperty("PollsPollAnswers")] + public virtual PollsPoll AnswerPoll { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ReportingReport.cs b/Migration.Toolkit.K11/Models/ReportingReport.cs index 5fe8f817..82d9183d 100644 --- a/Migration.Toolkit.K11/Models/ReportingReport.cs +++ b/Migration.Toolkit.K11/Models/ReportingReport.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_Report")] -[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] -[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] -[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] -public partial class ReportingReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [StringLength(200)] - public string ReportName { get; set; } = null!; - - [StringLength(440)] - public string ReportDisplayName { get; set; } = null!; - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - [Column("ReportCategoryID")] - public int ReportCategoryId { get; set; } - - public int ReportAccess { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - public DateTime ReportLastModified { get; set; } - - public bool? ReportEnableSubscription { get; set; } - - [StringLength(100)] - public string? ReportConnectionString { get; set; } - - [ForeignKey("ReportCategoryId")] - [InverseProperty("ReportingReports")] - public virtual ReportingReportCategory ReportCategory { get; set; } = null!; - - [InverseProperty("GraphReport")] - public virtual ICollection ReportingReportGraphs { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionReport")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("TableReport")] - public virtual ICollection ReportingReportTables { get; set; } = new List(); - - [InverseProperty("ValueReport")] - public virtual ICollection ReportingReportValues { get; set; } = new List(); - - [InverseProperty("SavedReportReport")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Reporting_Report")] +[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] +[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] +[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] +public class ReportingReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [StringLength(200)] + public string ReportName { get; set; } = null!; + + [StringLength(440)] + public string ReportDisplayName { get; set; } = null!; + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + [Column("ReportCategoryID")] + public int ReportCategoryId { get; set; } + + public int ReportAccess { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + public DateTime ReportLastModified { get; set; } + + public bool? ReportEnableSubscription { get; set; } + + [StringLength(100)] + public string? ReportConnectionString { get; set; } + + [ForeignKey("ReportCategoryId")] + [InverseProperty("ReportingReports")] + public virtual ReportingReportCategory ReportCategory { get; set; } = null!; + + [InverseProperty("GraphReport")] + public virtual ICollection ReportingReportGraphs { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionReport")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("TableReport")] + public virtual ICollection ReportingReportTables { get; set; } = new List(); + + [InverseProperty("ValueReport")] + public virtual ICollection ReportingReportValues { get; set; } = new List(); + + [InverseProperty("SavedReportReport")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ReportingReportCategory.cs b/Migration.Toolkit.K11/Models/ReportingReportCategory.cs index 7f2ff26b..203752de 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportCategory.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportCategory")] -[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] -public partial class ReportingReportCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryCodeName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual ReportingReportCategory? CategoryParent { get; set; } - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); - - [InverseProperty("ReportCategory")] - public virtual ICollection ReportingReports { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Reporting_ReportCategory")] +[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] +public class ReportingReportCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryCodeName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual ReportingReportCategory? CategoryParent { get; set; } + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); + + [InverseProperty("ReportCategory")] + public virtual ICollection ReportingReports { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ReportingReportGraph.cs b/Migration.Toolkit.K11/Models/ReportingReportGraph.cs index fffbcb1e..a9bc7652 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportGraph.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportGraph.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportGraph")] -[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] -[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] -public partial class ReportingReportGraph -{ - [Key] - [Column("GraphID")] - public int GraphId { get; set; } - - [StringLength(100)] - public string GraphName { get; set; } = null!; - - [StringLength(450)] - public string GraphDisplayName { get; set; } = null!; - - public string GraphQuery { get; set; } = null!; - - public bool GraphQueryIsStoredProcedure { get; set; } - - [StringLength(50)] - public string GraphType { get; set; } = null!; - - [Column("GraphReportID")] - public int GraphReportId { get; set; } - - [StringLength(200)] - public string? GraphTitle { get; set; } - - [Column("GraphXAxisTitle")] - [StringLength(200)] - public string? GraphXaxisTitle { get; set; } - - [Column("GraphYAxisTitle")] - [StringLength(200)] - public string? GraphYaxisTitle { get; set; } - - public int? GraphWidth { get; set; } - - public int? GraphHeight { get; set; } - - public int? GraphLegendPosition { get; set; } - - public string? GraphSettings { get; set; } - - [Column("GraphGUID")] - public Guid GraphGuid { get; set; } - - public DateTime GraphLastModified { get; set; } - - public bool? GraphIsHtml { get; set; } - - [StringLength(100)] - public string? GraphConnectionString { get; set; } - - [ForeignKey("GraphReportId")] - [InverseProperty("ReportingReportGraphs")] - public virtual ReportingReport GraphReport { get; set; } = null!; - - [InverseProperty("ReportSubscriptionGraph")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Reporting_ReportGraph")] +[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] +[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] +public class ReportingReportGraph +{ + [Key] + [Column("GraphID")] + public int GraphId { get; set; } + + [StringLength(100)] + public string GraphName { get; set; } = null!; + + [StringLength(450)] + public string GraphDisplayName { get; set; } = null!; + + public string GraphQuery { get; set; } = null!; + + public bool GraphQueryIsStoredProcedure { get; set; } + + [StringLength(50)] + public string GraphType { get; set; } = null!; + + [Column("GraphReportID")] + public int GraphReportId { get; set; } + + [StringLength(200)] + public string? GraphTitle { get; set; } + + [Column("GraphXAxisTitle")] + [StringLength(200)] + public string? GraphXaxisTitle { get; set; } + + [Column("GraphYAxisTitle")] + [StringLength(200)] + public string? GraphYaxisTitle { get; set; } + + public int? GraphWidth { get; set; } + + public int? GraphHeight { get; set; } + + public int? GraphLegendPosition { get; set; } + + public string? GraphSettings { get; set; } + + [Column("GraphGUID")] + public Guid GraphGuid { get; set; } + + public DateTime GraphLastModified { get; set; } + + public bool? GraphIsHtml { get; set; } + + [StringLength(100)] + public string? GraphConnectionString { get; set; } + + [ForeignKey("GraphReportId")] + [InverseProperty("ReportingReportGraphs")] + public virtual ReportingReport GraphReport { get; set; } = null!; + + [InverseProperty("ReportSubscriptionGraph")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs b/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs index 2cd75342..19521464 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportSubscription.cs @@ -1,93 +1,92 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportSubscription")] -[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] -[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] -[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] -[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] -[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] -[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] -public partial class ReportingReportSubscription -{ - [Key] - [Column("ReportSubscriptionID")] - public int ReportSubscriptionId { get; set; } - - [Column("ReportSubscriptionReportID")] - public int ReportSubscriptionReportId { get; set; } - - [StringLength(1000)] - public string ReportSubscriptionInterval { get; set; } = null!; - - public string? ReportSubscriptionCondition { get; set; } - - [Required] - public bool? ReportSubscriptionEnabled { get; set; } - - public string? ReportSubscriptionParameters { get; set; } - - [Column("ReportSubscriptionGUID")] - public Guid ReportSubscriptionGuid { get; set; } - - public DateTime ReportSubscriptionLastModified { get; set; } - - [StringLength(200)] - public string? ReportSubscriptionSubject { get; set; } - - [Column("ReportSubscriptionGraphID")] - public int? ReportSubscriptionGraphId { get; set; } - - [Column("ReportSubscriptionTableID")] - public int? ReportSubscriptionTableId { get; set; } - - [Column("ReportSubscriptionValueID")] - public int? ReportSubscriptionValueId { get; set; } - - [Column("ReportSubscriptionUserID")] - public int ReportSubscriptionUserId { get; set; } - - [StringLength(400)] - public string ReportSubscriptionEmail { get; set; } = null!; - - [Required] - public bool? ReportSubscriptionOnlyNonEmpty { get; set; } - - public DateTime? ReportSubscriptionLastPostDate { get; set; } - - public DateTime? ReportSubscriptionNextPostDate { get; set; } - - [Column("ReportSubscriptionSiteID")] - public int ReportSubscriptionSiteId { get; set; } - - public string? ReportSubscriptionSettings { get; set; } - - [ForeignKey("ReportSubscriptionGraphId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } - - [ForeignKey("ReportSubscriptionReportId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; - - [ForeignKey("ReportSubscriptionSiteId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; - - [ForeignKey("ReportSubscriptionTableId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } - - [ForeignKey("ReportSubscriptionUserId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; - - [ForeignKey("ReportSubscriptionValueId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Reporting_ReportSubscription")] +[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] +[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] +[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] +[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] +[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] +[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] +public class ReportingReportSubscription +{ + [Key] + [Column("ReportSubscriptionID")] + public int ReportSubscriptionId { get; set; } + + [Column("ReportSubscriptionReportID")] + public int ReportSubscriptionReportId { get; set; } + + [StringLength(1000)] + public string ReportSubscriptionInterval { get; set; } = null!; + + public string? ReportSubscriptionCondition { get; set; } + + [Required] + public bool? ReportSubscriptionEnabled { get; set; } + + public string? ReportSubscriptionParameters { get; set; } + + [Column("ReportSubscriptionGUID")] + public Guid ReportSubscriptionGuid { get; set; } + + public DateTime ReportSubscriptionLastModified { get; set; } + + [StringLength(200)] + public string? ReportSubscriptionSubject { get; set; } + + [Column("ReportSubscriptionGraphID")] + public int? ReportSubscriptionGraphId { get; set; } + + [Column("ReportSubscriptionTableID")] + public int? ReportSubscriptionTableId { get; set; } + + [Column("ReportSubscriptionValueID")] + public int? ReportSubscriptionValueId { get; set; } + + [Column("ReportSubscriptionUserID")] + public int ReportSubscriptionUserId { get; set; } + + [StringLength(400)] + public string ReportSubscriptionEmail { get; set; } = null!; + + [Required] + public bool? ReportSubscriptionOnlyNonEmpty { get; set; } + + public DateTime? ReportSubscriptionLastPostDate { get; set; } + + public DateTime? ReportSubscriptionNextPostDate { get; set; } + + [Column("ReportSubscriptionSiteID")] + public int ReportSubscriptionSiteId { get; set; } + + public string? ReportSubscriptionSettings { get; set; } + + [ForeignKey("ReportSubscriptionGraphId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } + + [ForeignKey("ReportSubscriptionReportId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; + + [ForeignKey("ReportSubscriptionSiteId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; + + [ForeignKey("ReportSubscriptionTableId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } + + [ForeignKey("ReportSubscriptionUserId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; + + [ForeignKey("ReportSubscriptionValueId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ReportingReportTable.cs b/Migration.Toolkit.K11/Models/ReportingReportTable.cs index 144dbbe3..1b068300 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportTable.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportTable.cs @@ -1,47 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportTable")] -[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] -[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] -public partial class ReportingReportTable -{ - [Key] - [Column("TableID")] - public int TableId { get; set; } - - [StringLength(100)] - public string TableName { get; set; } = null!; - - [StringLength(450)] - public string TableDisplayName { get; set; } = null!; - - public string TableQuery { get; set; } = null!; - - public bool TableQueryIsStoredProcedure { get; set; } - - [Column("TableReportID")] - public int TableReportId { get; set; } - - public string? TableSettings { get; set; } - - [Column("TableGUID")] - public Guid TableGuid { get; set; } - - public DateTime TableLastModified { get; set; } - - [StringLength(100)] - public string? TableConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionTable")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("TableReportId")] - [InverseProperty("ReportingReportTables")] - public virtual ReportingReport TableReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Reporting_ReportTable")] +[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] +[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] +public class ReportingReportTable +{ + [Key] + [Column("TableID")] + public int TableId { get; set; } + + [StringLength(100)] + public string TableName { get; set; } = null!; + + [StringLength(450)] + public string TableDisplayName { get; set; } = null!; + + public string TableQuery { get; set; } = null!; + + public bool TableQueryIsStoredProcedure { get; set; } + + [Column("TableReportID")] + public int TableReportId { get; set; } + + public string? TableSettings { get; set; } + + [Column("TableGUID")] + public Guid TableGuid { get; set; } + + public DateTime TableLastModified { get; set; } + + [StringLength(100)] + public string? TableConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionTable")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("TableReportId")] + [InverseProperty("ReportingReportTables")] + public virtual ReportingReport TableReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ReportingReportValue.cs b/Migration.Toolkit.K11/Models/ReportingReportValue.cs index a9b05d8c..2cf5b978 100644 --- a/Migration.Toolkit.K11/Models/ReportingReportValue.cs +++ b/Migration.Toolkit.K11/Models/ReportingReportValue.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_ReportValue")] -[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] -[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] -public partial class ReportingReportValue -{ - [Key] - [Column("ValueID")] - public int ValueId { get; set; } - - [StringLength(100)] - public string ValueName { get; set; } = null!; - - [StringLength(450)] - public string ValueDisplayName { get; set; } = null!; - - public string ValueQuery { get; set; } = null!; - - public bool ValueQueryIsStoredProcedure { get; set; } - - [StringLength(200)] - public string? ValueFormatString { get; set; } - - [Column("ValueReportID")] - public int ValueReportId { get; set; } - - [Column("ValueGUID")] - public Guid ValueGuid { get; set; } - - public DateTime ValueLastModified { get; set; } - - public string? ValueSettings { get; set; } - - [StringLength(100)] - public string? ValueConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionValue")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("ValueReportId")] - [InverseProperty("ReportingReportValues")] - public virtual ReportingReport ValueReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Reporting_ReportValue")] +[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] +[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] +public class ReportingReportValue +{ + [Key] + [Column("ValueID")] + public int ValueId { get; set; } + + [StringLength(100)] + public string ValueName { get; set; } = null!; + + [StringLength(450)] + public string ValueDisplayName { get; set; } = null!; + + public string ValueQuery { get; set; } = null!; + + public bool ValueQueryIsStoredProcedure { get; set; } + + [StringLength(200)] + public string? ValueFormatString { get; set; } + + [Column("ValueReportID")] + public int ValueReportId { get; set; } + + [Column("ValueGUID")] + public Guid ValueGuid { get; set; } + + public DateTime ValueLastModified { get; set; } + + public string? ValueSettings { get; set; } + + [StringLength(100)] + public string? ValueConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionValue")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("ValueReportId")] + [InverseProperty("ReportingReportValues")] + public virtual ReportingReport ValueReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs b/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs index c544436e..18217ce6 100644 --- a/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs +++ b/Migration.Toolkit.K11/Models/ReportingSavedGraph.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_SavedGraph")] -[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] -[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] -public partial class ReportingSavedGraph -{ - [Key] - [Column("SavedGraphID")] - public int SavedGraphId { get; set; } - - [Column("SavedGraphSavedReportID")] - public int SavedGraphSavedReportId { get; set; } - - [Column("SavedGraphGUID")] - public Guid SavedGraphGuid { get; set; } - - public byte[] SavedGraphBinary { get; set; } = null!; - - [StringLength(100)] - public string SavedGraphMimeType { get; set; } = null!; - - public DateTime SavedGraphLastModified { get; set; } - - [ForeignKey("SavedGraphSavedReportId")] - [InverseProperty("ReportingSavedGraphs")] - public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Reporting_SavedGraph")] +[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] +[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] +public class ReportingSavedGraph +{ + [Key] + [Column("SavedGraphID")] + public int SavedGraphId { get; set; } + + [Column("SavedGraphSavedReportID")] + public int SavedGraphSavedReportId { get; set; } + + [Column("SavedGraphGUID")] + public Guid SavedGraphGuid { get; set; } + + public byte[] SavedGraphBinary { get; set; } = null!; + + [StringLength(100)] + public string SavedGraphMimeType { get; set; } = null!; + + public DateTime SavedGraphLastModified { get; set; } + + [ForeignKey("SavedGraphSavedReportId")] + [InverseProperty("ReportingSavedGraphs")] + public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ReportingSavedReport.cs b/Migration.Toolkit.K11/Models/ReportingSavedReport.cs index f8b1528c..a85ce283 100644 --- a/Migration.Toolkit.K11/Models/ReportingSavedReport.cs +++ b/Migration.Toolkit.K11/Models/ReportingSavedReport.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Reporting_SavedReport")] -[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] -public partial class ReportingSavedReport -{ - [Key] - [Column("SavedReportID")] - public int SavedReportId { get; set; } - - [Column("SavedReportReportID")] - public int SavedReportReportId { get; set; } - - [Column("SavedReportGUID")] - public Guid SavedReportGuid { get; set; } - - [StringLength(200)] - public string? SavedReportTitle { get; set; } - - public DateTime SavedReportDate { get; set; } - - [Column("SavedReportHTML")] - public string SavedReportHtml { get; set; } = null!; - - public string SavedReportParameters { get; set; } = null!; - - [Column("SavedReportCreatedByUserID")] - public int? SavedReportCreatedByUserId { get; set; } - - public DateTime SavedReportLastModified { get; set; } - - [InverseProperty("SavedGraphSavedReport")] - public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); - - [ForeignKey("SavedReportCreatedByUserId")] - [InverseProperty("ReportingSavedReports")] - public virtual CmsUser? SavedReportCreatedByUser { get; set; } - - [ForeignKey("SavedReportReportId")] - [InverseProperty("ReportingSavedReports")] - public virtual ReportingReport SavedReportReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Reporting_SavedReport")] +[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] +public class ReportingSavedReport +{ + [Key] + [Column("SavedReportID")] + public int SavedReportId { get; set; } + + [Column("SavedReportReportID")] + public int SavedReportReportId { get; set; } + + [Column("SavedReportGUID")] + public Guid SavedReportGuid { get; set; } + + [StringLength(200)] + public string? SavedReportTitle { get; set; } + + public DateTime SavedReportDate { get; set; } + + [Column("SavedReportHTML")] + public string SavedReportHtml { get; set; } = null!; + + public string SavedReportParameters { get; set; } = null!; + + [Column("SavedReportCreatedByUserID")] + public int? SavedReportCreatedByUserId { get; set; } + + public DateTime SavedReportLastModified { get; set; } + + [InverseProperty("SavedGraphSavedReport")] + public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); + + [ForeignKey("SavedReportCreatedByUserId")] + [InverseProperty("ReportingSavedReports")] + public virtual CmsUser? SavedReportCreatedByUser { get; set; } + + [ForeignKey("SavedReportReportId")] + [InverseProperty("ReportingSavedReports")] + public virtual ReportingReport SavedReportReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs index d1594e9b..bd996d54 100644 --- a/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs +++ b/Migration.Toolkit.K11/Models/SharePointSharePointConnection.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SharePoint_SharePointConnection")] -[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] -public partial class SharePointSharePointConnection -{ - [Key] - [Column("SharePointConnectionID")] - public int SharePointConnectionId { get; set; } - - [Column("SharePointConnectionGUID")] - public Guid SharePointConnectionGuid { get; set; } - - [Column("SharePointConnectionSiteID")] - public int SharePointConnectionSiteId { get; set; } - - [StringLength(512)] - public string SharePointConnectionSiteUrl { get; set; } = null!; - - [StringLength(30)] - public string SharePointConnectionAuthMode { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionName { get; set; } = null!; - - [StringLength(30)] - public string SharePointConnectionSharePointVersion { get; set; } = null!; - - [StringLength(100)] - public string? SharePointConnectionUserName { get; set; } - - [StringLength(100)] - public string? SharePointConnectionPassword { get; set; } - - [StringLength(100)] - public string? SharePointConnectionDomain { get; set; } - - public DateTime SharePointConnectionLastModified { get; set; } - - [ForeignKey("SharePointConnectionSiteId")] - [InverseProperty("SharePointSharePointConnections")] - public virtual CmsSite SharePointConnectionSite { get; set; } = null!; - - [InverseProperty("SharePointLibrarySharePointConnection")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SharePoint_SharePointConnection")] +[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] +public class SharePointSharePointConnection +{ + [Key] + [Column("SharePointConnectionID")] + public int SharePointConnectionId { get; set; } + + [Column("SharePointConnectionGUID")] + public Guid SharePointConnectionGuid { get; set; } + + [Column("SharePointConnectionSiteID")] + public int SharePointConnectionSiteId { get; set; } + + [StringLength(512)] + public string SharePointConnectionSiteUrl { get; set; } = null!; + + [StringLength(30)] + public string SharePointConnectionAuthMode { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionName { get; set; } = null!; + + [StringLength(30)] + public string SharePointConnectionSharePointVersion { get; set; } = null!; + + [StringLength(100)] + public string? SharePointConnectionUserName { get; set; } + + [StringLength(100)] + public string? SharePointConnectionPassword { get; set; } + + [StringLength(100)] + public string? SharePointConnectionDomain { get; set; } + + public DateTime SharePointConnectionLastModified { get; set; } + + [ForeignKey("SharePointConnectionSiteId")] + [InverseProperty("SharePointSharePointConnections")] + public virtual CmsSite SharePointConnectionSite { get; set; } = null!; + + [InverseProperty("SharePointLibrarySharePointConnection")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs b/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs index 0f721155..84df96ce 100644 --- a/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs +++ b/Migration.Toolkit.K11/Models/SharePointSharePointFile.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SharePoint_SharePointFile")] -[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] -[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] -public partial class SharePointSharePointFile -{ - [Key] - [Column("SharePointFileID")] - public int SharePointFileId { get; set; } - - [Column("SharePointFileGUID")] - public Guid SharePointFileGuid { get; set; } - - [Column("SharePointFileSiteID")] - public int SharePointFileSiteId { get; set; } - - [StringLength(150)] - public string SharePointFileName { get; set; } = null!; - - [StringLength(150)] - public string? SharePointFileExtension { get; set; } - - [StringLength(255)] - public string? SharePointFileMimeType { get; set; } - - [Column("SharePointFileETag")] - [StringLength(255)] - public string? SharePointFileEtag { get; set; } - - public long SharePointFileSize { get; set; } - - public DateTime SharePointFileServerLastModified { get; set; } - - [Column("SharePointFileServerRelativeURL")] - [StringLength(300)] - public string SharePointFileServerRelativeUrl { get; set; } = null!; - - [Column("SharePointFileSharePointLibraryID")] - public int SharePointFileSharePointLibraryId { get; set; } - - public byte[]? SharePointFileBinary { get; set; } - - [ForeignKey("SharePointFileSharePointLibraryId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; - - [ForeignKey("SharePointFileSiteId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual CmsSite SharePointFileSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SharePoint_SharePointFile")] +[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] +[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] +public class SharePointSharePointFile +{ + [Key] + [Column("SharePointFileID")] + public int SharePointFileId { get; set; } + + [Column("SharePointFileGUID")] + public Guid SharePointFileGuid { get; set; } + + [Column("SharePointFileSiteID")] + public int SharePointFileSiteId { get; set; } + + [StringLength(150)] + public string SharePointFileName { get; set; } = null!; + + [StringLength(150)] + public string? SharePointFileExtension { get; set; } + + [StringLength(255)] + public string? SharePointFileMimeType { get; set; } + + [Column("SharePointFileETag")] + [StringLength(255)] + public string? SharePointFileEtag { get; set; } + + public long SharePointFileSize { get; set; } + + public DateTime SharePointFileServerLastModified { get; set; } + + [Column("SharePointFileServerRelativeURL")] + [StringLength(300)] + public string SharePointFileServerRelativeUrl { get; set; } = null!; + + [Column("SharePointFileSharePointLibraryID")] + public int SharePointFileSharePointLibraryId { get; set; } + + public byte[]? SharePointFileBinary { get; set; } + + [ForeignKey("SharePointFileSharePointLibraryId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; + + [ForeignKey("SharePointFileSiteId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual CmsSite SharePointFileSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs index 4b8ebe2c..6a96c5cc 100644 --- a/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs +++ b/Migration.Toolkit.K11/Models/SharePointSharePointLibrary.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SharePoint_SharePointLibrary")] -[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] -[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] -public partial class SharePointSharePointLibrary -{ - [Key] - [Column("SharePointLibraryID")] - public int SharePointLibraryId { get; set; } - - [StringLength(100)] - public string SharePointLibraryName { get; set; } = null!; - - [Column("SharePointLibrarySharePointConnectionID")] - public int? SharePointLibrarySharePointConnectionId { get; set; } - - [StringLength(100)] - public string SharePointLibraryListTitle { get; set; } = null!; - - public int SharePointLibrarySynchronizationPeriod { get; set; } - - [Column("SharePointLibraryGUID")] - public Guid SharePointLibraryGuid { get; set; } - - [Column("SharePointLibrarySiteID")] - public int SharePointLibrarySiteId { get; set; } - - [StringLength(100)] - public string SharePointLibraryDisplayName { get; set; } = null!; - - public DateTime SharePointLibraryLastModified { get; set; } - - public int SharePointLibraryListType { get; set; } - - [ForeignKey("SharePointLibrarySharePointConnectionId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } - - [ForeignKey("SharePointLibrarySiteId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual CmsSite SharePointLibrarySite { get; set; } = null!; - - [InverseProperty("SharePointFileSharePointLibrary")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SharePoint_SharePointLibrary")] +[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] +[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] +public class SharePointSharePointLibrary +{ + [Key] + [Column("SharePointLibraryID")] + public int SharePointLibraryId { get; set; } + + [StringLength(100)] + public string SharePointLibraryName { get; set; } = null!; + + [Column("SharePointLibrarySharePointConnectionID")] + public int? SharePointLibrarySharePointConnectionId { get; set; } + + [StringLength(100)] + public string SharePointLibraryListTitle { get; set; } = null!; + + public int SharePointLibrarySynchronizationPeriod { get; set; } + + [Column("SharePointLibraryGUID")] + public Guid SharePointLibraryGuid { get; set; } + + [Column("SharePointLibrarySiteID")] + public int SharePointLibrarySiteId { get; set; } + + [StringLength(100)] + public string SharePointLibraryDisplayName { get; set; } = null!; + + public DateTime SharePointLibraryLastModified { get; set; } + + public int SharePointLibraryListType { get; set; } + + [ForeignKey("SharePointLibrarySharePointConnectionId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } + + [ForeignKey("SharePointLibrarySiteId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual CmsSite SharePointLibrarySite { get; set; } = null!; + + [InverseProperty("SharePointFileSharePointLibrary")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/SmFacebookAccount.cs b/Migration.Toolkit.K11/Models/SmFacebookAccount.cs index b88bbe33..133d3e8e 100644 --- a/Migration.Toolkit.K11/Models/SmFacebookAccount.cs +++ b/Migration.Toolkit.K11/Models/SmFacebookAccount.cs @@ -1,58 +1,57 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_FacebookAccount")] -[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] -[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] -public partial class SmFacebookAccount -{ - [Key] - [Column("FacebookAccountID")] - public int FacebookAccountId { get; set; } - - [Column("FacebookAccountGUID")] - public Guid FacebookAccountGuid { get; set; } - - public DateTime FacebookAccountLastModified { get; set; } - - [Column("FacebookAccountSiteID")] - public int FacebookAccountSiteId { get; set; } - - [StringLength(200)] - public string FacebookAccountName { get; set; } = null!; - - [StringLength(200)] - public string FacebookAccountDisplayName { get; set; } = null!; - - [Column("FacebookAccountPageID")] - [StringLength(500)] - public string FacebookAccountPageId { get; set; } = null!; - - public string FacebookAccountPageAccessToken { get; set; } = null!; - - [Column("FacebookAccountFacebookApplicationID")] - public int FacebookAccountFacebookApplicationId { get; set; } - - public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } - - [StringLength(1000)] - public string? FacebookAccountPageUrl { get; set; } - - public bool? FacebookAccountIsDefault { get; set; } - - [ForeignKey("FacebookAccountFacebookApplicationId")] - [InverseProperty("SmFacebookAccounts")] - public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; - - [ForeignKey("FacebookAccountSiteId")] - [InverseProperty("SmFacebookAccounts")] - public virtual CmsSite FacebookAccountSite { get; set; } = null!; - - [InverseProperty("FacebookPostFacebookAccount")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_FacebookAccount")] +[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] +[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] +public class SmFacebookAccount +{ + [Key] + [Column("FacebookAccountID")] + public int FacebookAccountId { get; set; } + + [Column("FacebookAccountGUID")] + public Guid FacebookAccountGuid { get; set; } + + public DateTime FacebookAccountLastModified { get; set; } + + [Column("FacebookAccountSiteID")] + public int FacebookAccountSiteId { get; set; } + + [StringLength(200)] + public string FacebookAccountName { get; set; } = null!; + + [StringLength(200)] + public string FacebookAccountDisplayName { get; set; } = null!; + + [Column("FacebookAccountPageID")] + [StringLength(500)] + public string FacebookAccountPageId { get; set; } = null!; + + public string FacebookAccountPageAccessToken { get; set; } = null!; + + [Column("FacebookAccountFacebookApplicationID")] + public int FacebookAccountFacebookApplicationId { get; set; } + + public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } + + [StringLength(1000)] + public string? FacebookAccountPageUrl { get; set; } + + public bool? FacebookAccountIsDefault { get; set; } + + [ForeignKey("FacebookAccountFacebookApplicationId")] + [InverseProperty("SmFacebookAccounts")] + public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; + + [ForeignKey("FacebookAccountSiteId")] + [InverseProperty("SmFacebookAccounts")] + public virtual CmsSite FacebookAccountSite { get; set; } = null!; + + [InverseProperty("FacebookPostFacebookAccount")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/SmFacebookApplication.cs b/Migration.Toolkit.K11/Models/SmFacebookApplication.cs index 23e60af4..63dc6adb 100644 --- a/Migration.Toolkit.K11/Models/SmFacebookApplication.cs +++ b/Migration.Toolkit.K11/Models/SmFacebookApplication.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_FacebookApplication")] -[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] -public partial class SmFacebookApplication -{ - [Key] - [Column("FacebookApplicationID")] - public int FacebookApplicationId { get; set; } - - [StringLength(500)] - public string FacebookApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string FacebookApplicationConsumerSecret { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationName { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationDisplayName { get; set; } = null!; - - [Column("FacebookApplicationGUID")] - public Guid FacebookApplicationGuid { get; set; } - - public DateTime FacebookApplicationLastModified { get; set; } - - [Column("FacebookApplicationSiteID")] - public int FacebookApplicationSiteId { get; set; } - - [ForeignKey("FacebookApplicationSiteId")] - [InverseProperty("SmFacebookApplications")] - public virtual CmsSite FacebookApplicationSite { get; set; } = null!; - - [InverseProperty("FacebookAccountFacebookApplication")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_FacebookApplication")] +[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] +public class SmFacebookApplication +{ + [Key] + [Column("FacebookApplicationID")] + public int FacebookApplicationId { get; set; } + + [StringLength(500)] + public string FacebookApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string FacebookApplicationConsumerSecret { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationName { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationDisplayName { get; set; } = null!; + + [Column("FacebookApplicationGUID")] + public Guid FacebookApplicationGuid { get; set; } + + public DateTime FacebookApplicationLastModified { get; set; } + + [Column("FacebookApplicationSiteID")] + public int FacebookApplicationSiteId { get; set; } + + [ForeignKey("FacebookApplicationSiteId")] + [InverseProperty("SmFacebookApplications")] + public virtual CmsSite FacebookApplicationSite { get; set; } = null!; + + [InverseProperty("FacebookAccountFacebookApplication")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/SmFacebookPost.cs b/Migration.Toolkit.K11/Models/SmFacebookPost.cs index 46d11ba4..2b5a982b 100644 --- a/Migration.Toolkit.K11/Models/SmFacebookPost.cs +++ b/Migration.Toolkit.K11/Models/SmFacebookPost.cs @@ -1,89 +1,88 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_FacebookPost")] -[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] -[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] -[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] -public partial class SmFacebookPost -{ - [Key] - [Column("FacebookPostID")] - public int FacebookPostId { get; set; } - - [Column("FacebookPostGUID")] - public Guid FacebookPostGuid { get; set; } - - public DateTime FacebookPostLastModified { get; set; } - - [Column("FacebookPostSiteID")] - public int FacebookPostSiteId { get; set; } - - [Column("FacebookPostFacebookAccountID")] - public int FacebookPostFacebookAccountId { get; set; } - - public string FacebookPostText { get; set; } = null!; - - [Column("FacebookPostURLShortenerType")] - public int? FacebookPostUrlshortenerType { get; set; } - - public int? FacebookPostErrorCode { get; set; } - - public int? FacebookPostErrorSubcode { get; set; } - - [Column("FacebookPostExternalID")] - public string? FacebookPostExternalId { get; set; } - - public DateTime? FacebookPostPublishedDateTime { get; set; } - - public DateTime? FacebookPostScheduledPublishDateTime { get; set; } - - [Column("FacebookPostCampaignID")] - public int? FacebookPostCampaignId { get; set; } - - public bool? FacebookPostPostAfterDocumentPublish { get; set; } - - public int? FacebookPostInsightPeopleReached { get; set; } - - public int? FacebookPostInsightLikesFromPage { get; set; } - - public int? FacebookPostInsightCommentsFromPage { get; set; } - - public int? FacebookPostInsightSharesFromPage { get; set; } - - public int? FacebookPostInsightLikesTotal { get; set; } - - public int? FacebookPostInsightCommentsTotal { get; set; } - - public int? FacebookPostInsightNegativeHidePost { get; set; } - - public int? FacebookPostInsightNegativeHideAllPosts { get; set; } - - public int? FacebookPostInsightNegativeReportSpam { get; set; } - - public int? FacebookPostInsightNegativeUnlikePage { get; set; } - - public DateTime? FacebookPostInsightsLastUpdated { get; set; } - - [Column("FacebookPostDocumentGUID")] - public Guid? FacebookPostDocumentGuid { get; set; } - - public bool? FacebookPostIsCreatedByUser { get; set; } - - [ForeignKey("FacebookPostCampaignId")] - [InverseProperty("SmFacebookPosts")] - public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } - - [ForeignKey("FacebookPostFacebookAccountId")] - [InverseProperty("SmFacebookPosts")] - public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; - - [ForeignKey("FacebookPostSiteId")] - [InverseProperty("SmFacebookPosts")] - public virtual CmsSite FacebookPostSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_FacebookPost")] +[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] +[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] +[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] +public class SmFacebookPost +{ + [Key] + [Column("FacebookPostID")] + public int FacebookPostId { get; set; } + + [Column("FacebookPostGUID")] + public Guid FacebookPostGuid { get; set; } + + public DateTime FacebookPostLastModified { get; set; } + + [Column("FacebookPostSiteID")] + public int FacebookPostSiteId { get; set; } + + [Column("FacebookPostFacebookAccountID")] + public int FacebookPostFacebookAccountId { get; set; } + + public string FacebookPostText { get; set; } = null!; + + [Column("FacebookPostURLShortenerType")] + public int? FacebookPostUrlshortenerType { get; set; } + + public int? FacebookPostErrorCode { get; set; } + + public int? FacebookPostErrorSubcode { get; set; } + + [Column("FacebookPostExternalID")] + public string? FacebookPostExternalId { get; set; } + + public DateTime? FacebookPostPublishedDateTime { get; set; } + + public DateTime? FacebookPostScheduledPublishDateTime { get; set; } + + [Column("FacebookPostCampaignID")] + public int? FacebookPostCampaignId { get; set; } + + public bool? FacebookPostPostAfterDocumentPublish { get; set; } + + public int? FacebookPostInsightPeopleReached { get; set; } + + public int? FacebookPostInsightLikesFromPage { get; set; } + + public int? FacebookPostInsightCommentsFromPage { get; set; } + + public int? FacebookPostInsightSharesFromPage { get; set; } + + public int? FacebookPostInsightLikesTotal { get; set; } + + public int? FacebookPostInsightCommentsTotal { get; set; } + + public int? FacebookPostInsightNegativeHidePost { get; set; } + + public int? FacebookPostInsightNegativeHideAllPosts { get; set; } + + public int? FacebookPostInsightNegativeReportSpam { get; set; } + + public int? FacebookPostInsightNegativeUnlikePage { get; set; } + + public DateTime? FacebookPostInsightsLastUpdated { get; set; } + + [Column("FacebookPostDocumentGUID")] + public Guid? FacebookPostDocumentGuid { get; set; } + + public bool? FacebookPostIsCreatedByUser { get; set; } + + [ForeignKey("FacebookPostCampaignId")] + [InverseProperty("SmFacebookPosts")] + public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } + + [ForeignKey("FacebookPostFacebookAccountId")] + [InverseProperty("SmFacebookPosts")] + public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; + + [ForeignKey("FacebookPostSiteId")] + [InverseProperty("SmFacebookPosts")] + public virtual CmsSite FacebookPostSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmInsight.cs b/Migration.Toolkit.K11/Models/SmInsight.cs index 42f48dd3..50774215 100644 --- a/Migration.Toolkit.K11/Models/SmInsight.cs +++ b/Migration.Toolkit.K11/Models/SmInsight.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_Insight")] -[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] -public partial class SmInsight -{ - [Key] - [Column("InsightID")] - public int InsightId { get; set; } - - [StringLength(200)] - public string InsightCodeName { get; set; } = null!; - - [Column("InsightExternalID")] - public string InsightExternalId { get; set; } = null!; - - [StringLength(20)] - public string InsightPeriodType { get; set; } = null!; - - public string? InsightValueName { get; set; } - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitDays { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitMonths { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitYears { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_Insight")] +[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] +public class SmInsight +{ + [Key] + [Column("InsightID")] + public int InsightId { get; set; } + + [StringLength(200)] + public string InsightCodeName { get; set; } = null!; + + [Column("InsightExternalID")] + public string InsightExternalId { get; set; } = null!; + + [StringLength(20)] + public string InsightPeriodType { get; set; } = null!; + + public string? InsightValueName { get; set; } + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitDays { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitMonths { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitYears { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/SmInsightHitDay.cs b/Migration.Toolkit.K11/Models/SmInsightHitDay.cs index c7100481..ecf42752 100644 --- a/Migration.Toolkit.K11/Models/SmInsightHitDay.cs +++ b/Migration.Toolkit.K11/Models/SmInsightHitDay.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_InsightHit_Day")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitDay -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitDays")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_InsightHit_Day")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitDay +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitDays")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs b/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs index abec5cc6..1a44d4e4 100644 --- a/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs +++ b/Migration.Toolkit.K11/Models/SmInsightHitMonth.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_InsightHit_Month")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitMonth -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitMonths")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_InsightHit_Month")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitMonth +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitMonths")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs b/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs index 2c1b665b..fd056e1b 100644 --- a/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs +++ b/Migration.Toolkit.K11/Models/SmInsightHitWeek.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_InsightHit_Week")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitWeek -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitWeeks")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_InsightHit_Week")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitWeek +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitWeeks")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmInsightHitYear.cs b/Migration.Toolkit.K11/Models/SmInsightHitYear.cs index 2a03934c..2eb4a0c5 100644 --- a/Migration.Toolkit.K11/Models/SmInsightHitYear.cs +++ b/Migration.Toolkit.K11/Models/SmInsightHitYear.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_InsightHit_Year")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitYear -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitYears")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_InsightHit_Year")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitYear +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitYears")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs b/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs index 883077f9..803af4b6 100644 --- a/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs +++ b/Migration.Toolkit.K11/Models/SmLinkedInAccount.cs @@ -1,52 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_LinkedInAccount")] -public partial class SmLinkedInAccount -{ - [Key] - [Column("LinkedInAccountID")] - public int LinkedInAccountId { get; set; } - - [StringLength(200)] - public string LinkedInAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInAccountName { get; set; } = null!; - - public bool? LinkedInAccountIsDefault { get; set; } - - [StringLength(500)] - public string LinkedInAccountAccessToken { get; set; } = null!; - - [StringLength(500)] - public string LinkedInAccountAccessTokenSecret { get; set; } = null!; - - public DateTime LinkedInAccountLastModified { get; set; } - - [Column("LinkedInAccountGUID")] - public Guid LinkedInAccountGuid { get; set; } - - [Column("LinkedInAccountSiteID")] - public int LinkedInAccountSiteId { get; set; } - - [Column("LinkedInAccountProfileID")] - [StringLength(50)] - public string LinkedInAccountProfileId { get; set; } = null!; - - [Column("LinkedInAccountLinkedInApplicationID")] - public int LinkedInAccountLinkedInApplicationId { get; set; } - - [StringLength(200)] - public string? LinkedInAccountProfileName { get; set; } - - public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } - - [InverseProperty("LinkedInPostLinkedInAccount")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_LinkedInAccount")] +public class SmLinkedInAccount +{ + [Key] + [Column("LinkedInAccountID")] + public int LinkedInAccountId { get; set; } + + [StringLength(200)] + public string LinkedInAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInAccountName { get; set; } = null!; + + public bool? LinkedInAccountIsDefault { get; set; } + + [StringLength(500)] + public string LinkedInAccountAccessToken { get; set; } = null!; + + [StringLength(500)] + public string LinkedInAccountAccessTokenSecret { get; set; } = null!; + + public DateTime LinkedInAccountLastModified { get; set; } + + [Column("LinkedInAccountGUID")] + public Guid LinkedInAccountGuid { get; set; } + + [Column("LinkedInAccountSiteID")] + public int LinkedInAccountSiteId { get; set; } + + [Column("LinkedInAccountProfileID")] + [StringLength(50)] + public string LinkedInAccountProfileId { get; set; } = null!; + + [Column("LinkedInAccountLinkedInApplicationID")] + public int LinkedInAccountLinkedInApplicationId { get; set; } + + [StringLength(200)] + public string? LinkedInAccountProfileName { get; set; } + + public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } + + [InverseProperty("LinkedInPostLinkedInAccount")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs b/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs index ada243f5..cf1f4691 100644 --- a/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs +++ b/Migration.Toolkit.K11/Models/SmLinkedInApplication.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_LinkedInApplication")] -[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] -public partial class SmLinkedInApplication -{ - [Key] - [Column("LinkedInApplicationID")] - public int LinkedInApplicationId { get; set; } - - [StringLength(200)] - public string LinkedInApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInApplicationName { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerSecret { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerKey { get; set; } = null!; - - public DateTime LinkedInApplicationLastModified { get; set; } - - [Column("LinkedInApplicationGUID")] - public Guid LinkedInApplicationGuid { get; set; } - - [Column("LinkedInApplicationSiteID")] - public int LinkedInApplicationSiteId { get; set; } - - [ForeignKey("LinkedInApplicationSiteId")] - [InverseProperty("SmLinkedInApplications")] - public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_LinkedInApplication")] +[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] +public class SmLinkedInApplication +{ + [Key] + [Column("LinkedInApplicationID")] + public int LinkedInApplicationId { get; set; } + + [StringLength(200)] + public string LinkedInApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInApplicationName { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerSecret { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerKey { get; set; } = null!; + + public DateTime LinkedInApplicationLastModified { get; set; } + + [Column("LinkedInApplicationGUID")] + public Guid LinkedInApplicationGuid { get; set; } + + [Column("LinkedInApplicationSiteID")] + public int LinkedInApplicationSiteId { get; set; } + + [ForeignKey("LinkedInApplicationSiteId")] + [InverseProperty("SmLinkedInApplications")] + public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmLinkedInPost.cs b/Migration.Toolkit.K11/Models/SmLinkedInPost.cs index 9ae8fbd5..ccefb693 100644 --- a/Migration.Toolkit.K11/Models/SmLinkedInPost.cs +++ b/Migration.Toolkit.K11/Models/SmLinkedInPost.cs @@ -1,85 +1,84 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_LinkedInPost")] -[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] -[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] -[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] -public partial class SmLinkedInPost -{ - [Key] - [Column("LinkedInPostID")] - public int LinkedInPostId { get; set; } - - [Column("LinkedInPostLinkedInAccountID")] - public int LinkedInPostLinkedInAccountId { get; set; } - - [StringLength(700)] - public string LinkedInPostComment { get; set; } = null!; - - [Column("LinkedInPostSiteID")] - public int LinkedInPostSiteId { get; set; } - - [Column("LinkedInPostGUID")] - public Guid LinkedInPostGuid { get; set; } - - public DateTime? LinkedInPostLastModified { get; set; } - - [StringLength(200)] - public string? LinkedInPostUpdateKey { get; set; } - - [Column("LinkedInPostURLShortenerType")] - public int? LinkedInPostUrlshortenerType { get; set; } - - public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } - - [Column("LinkedInPostCampaignID")] - public int? LinkedInPostCampaignId { get; set; } - - public DateTime? LinkedInPostPublishedDateTime { get; set; } - - [Column("LinkedInPostHTTPStatusCode")] - public int? LinkedInPostHttpstatusCode { get; set; } - - public int? LinkedInPostErrorCode { get; set; } - - public string? LinkedInPostErrorMessage { get; set; } - - [Column("LinkedInPostDocumentGUID")] - public Guid? LinkedInPostDocumentGuid { get; set; } - - public bool? LinkedInPostIsCreatedByUser { get; set; } - - public bool? LinkedInPostPostAfterDocumentPublish { get; set; } - - public DateTime? LinkedInPostInsightsLastUpdated { get; set; } - - public int? LinkedInPostCommentCount { get; set; } - - public int? LinkedInPostImpressionCount { get; set; } - - public int? LinkedInPostLikeCount { get; set; } - - public int? LinkedInPostShareCount { get; set; } - - public int? LinkedInPostClickCount { get; set; } - - public double? LinkedInPostEngagement { get; set; } - - [ForeignKey("LinkedInPostCampaignId")] - [InverseProperty("SmLinkedInPosts")] - public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } - - [ForeignKey("LinkedInPostLinkedInAccountId")] - [InverseProperty("SmLinkedInPosts")] - public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; - - [ForeignKey("LinkedInPostSiteId")] - [InverseProperty("SmLinkedInPosts")] - public virtual CmsSite LinkedInPostSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_LinkedInPost")] +[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] +[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] +[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] +public class SmLinkedInPost +{ + [Key] + [Column("LinkedInPostID")] + public int LinkedInPostId { get; set; } + + [Column("LinkedInPostLinkedInAccountID")] + public int LinkedInPostLinkedInAccountId { get; set; } + + [StringLength(700)] + public string LinkedInPostComment { get; set; } = null!; + + [Column("LinkedInPostSiteID")] + public int LinkedInPostSiteId { get; set; } + + [Column("LinkedInPostGUID")] + public Guid LinkedInPostGuid { get; set; } + + public DateTime? LinkedInPostLastModified { get; set; } + + [StringLength(200)] + public string? LinkedInPostUpdateKey { get; set; } + + [Column("LinkedInPostURLShortenerType")] + public int? LinkedInPostUrlshortenerType { get; set; } + + public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } + + [Column("LinkedInPostCampaignID")] + public int? LinkedInPostCampaignId { get; set; } + + public DateTime? LinkedInPostPublishedDateTime { get; set; } + + [Column("LinkedInPostHTTPStatusCode")] + public int? LinkedInPostHttpstatusCode { get; set; } + + public int? LinkedInPostErrorCode { get; set; } + + public string? LinkedInPostErrorMessage { get; set; } + + [Column("LinkedInPostDocumentGUID")] + public Guid? LinkedInPostDocumentGuid { get; set; } + + public bool? LinkedInPostIsCreatedByUser { get; set; } + + public bool? LinkedInPostPostAfterDocumentPublish { get; set; } + + public DateTime? LinkedInPostInsightsLastUpdated { get; set; } + + public int? LinkedInPostCommentCount { get; set; } + + public int? LinkedInPostImpressionCount { get; set; } + + public int? LinkedInPostLikeCount { get; set; } + + public int? LinkedInPostShareCount { get; set; } + + public int? LinkedInPostClickCount { get; set; } + + public double? LinkedInPostEngagement { get; set; } + + [ForeignKey("LinkedInPostCampaignId")] + [InverseProperty("SmLinkedInPosts")] + public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } + + [ForeignKey("LinkedInPostLinkedInAccountId")] + [InverseProperty("SmLinkedInPosts")] + public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; + + [ForeignKey("LinkedInPostSiteId")] + [InverseProperty("SmLinkedInPosts")] + public virtual CmsSite LinkedInPostSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmTwitterAccount.cs b/Migration.Toolkit.K11/Models/SmTwitterAccount.cs index cb995c92..fb76cf8d 100644 --- a/Migration.Toolkit.K11/Models/SmTwitterAccount.cs +++ b/Migration.Toolkit.K11/Models/SmTwitterAccount.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_TwitterAccount")] -[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] -[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] -public partial class SmTwitterAccount -{ - [Key] - [Column("TwitterAccountID")] - public int TwitterAccountId { get; set; } - - [StringLength(200)] - public string TwitterAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterAccountName { get; set; } = null!; - - public DateTime TwitterAccountLastModified { get; set; } - - [Column("TwitterAccountGUID")] - public Guid TwitterAccountGuid { get; set; } - - [Column("TwitterAccountSiteID")] - public int TwitterAccountSiteId { get; set; } - - [StringLength(500)] - public string TwitterAccountAccessToken { get; set; } = null!; - - [StringLength(500)] - public string TwitterAccountAccessTokenSecret { get; set; } = null!; - - [Column("TwitterAccountTwitterApplicationID")] - public int TwitterAccountTwitterApplicationId { get; set; } - - public int? TwitterAccountFollowers { get; set; } - - public int? TwitterAccountMentions { get; set; } - - [StringLength(40)] - public string? TwitterAccountMentionsRange { get; set; } - - [Column("TwitterAccountUserID")] - [StringLength(20)] - public string? TwitterAccountUserId { get; set; } - - public bool? TwitterAccountIsDefault { get; set; } - - [InverseProperty("TwitterPostTwitterAccount")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [ForeignKey("TwitterAccountSiteId")] - [InverseProperty("SmTwitterAccounts")] - public virtual CmsSite TwitterAccountSite { get; set; } = null!; - - [ForeignKey("TwitterAccountTwitterApplicationId")] - [InverseProperty("SmTwitterAccounts")] - public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_TwitterAccount")] +[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] +[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] +public class SmTwitterAccount +{ + [Key] + [Column("TwitterAccountID")] + public int TwitterAccountId { get; set; } + + [StringLength(200)] + public string TwitterAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterAccountName { get; set; } = null!; + + public DateTime TwitterAccountLastModified { get; set; } + + [Column("TwitterAccountGUID")] + public Guid TwitterAccountGuid { get; set; } + + [Column("TwitterAccountSiteID")] + public int TwitterAccountSiteId { get; set; } + + [StringLength(500)] + public string TwitterAccountAccessToken { get; set; } = null!; + + [StringLength(500)] + public string TwitterAccountAccessTokenSecret { get; set; } = null!; + + [Column("TwitterAccountTwitterApplicationID")] + public int TwitterAccountTwitterApplicationId { get; set; } + + public int? TwitterAccountFollowers { get; set; } + + public int? TwitterAccountMentions { get; set; } + + [StringLength(40)] + public string? TwitterAccountMentionsRange { get; set; } + + [Column("TwitterAccountUserID")] + [StringLength(20)] + public string? TwitterAccountUserId { get; set; } + + public bool? TwitterAccountIsDefault { get; set; } + + [InverseProperty("TwitterPostTwitterAccount")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [ForeignKey("TwitterAccountSiteId")] + [InverseProperty("SmTwitterAccounts")] + public virtual CmsSite TwitterAccountSite { get; set; } = null!; + + [ForeignKey("TwitterAccountTwitterApplicationId")] + [InverseProperty("SmTwitterAccounts")] + public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmTwitterApplication.cs b/Migration.Toolkit.K11/Models/SmTwitterApplication.cs index 85cad25a..c723a90b 100644 --- a/Migration.Toolkit.K11/Models/SmTwitterApplication.cs +++ b/Migration.Toolkit.K11/Models/SmTwitterApplication.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_TwitterApplication")] -[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] -public partial class SmTwitterApplication -{ - [Key] - [Column("TwitterApplicationID")] - public int TwitterApplicationId { get; set; } - - [StringLength(200)] - public string TwitterApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterApplicationName { get; set; } = null!; - - public DateTime TwitterApplicationLastModified { get; set; } - - [Column("TwitterApplicationGUID")] - public Guid TwitterApplicationGuid { get; set; } - - [Column("TwitterApplicationSiteID")] - public int TwitterApplicationSiteId { get; set; } - - [StringLength(500)] - public string TwitterApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string TwitterApplicationConsumerSecret { get; set; } = null!; - - [InverseProperty("TwitterAccountTwitterApplication")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [ForeignKey("TwitterApplicationSiteId")] - [InverseProperty("SmTwitterApplications")] - public virtual CmsSite TwitterApplicationSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_TwitterApplication")] +[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] +public class SmTwitterApplication +{ + [Key] + [Column("TwitterApplicationID")] + public int TwitterApplicationId { get; set; } + + [StringLength(200)] + public string TwitterApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterApplicationName { get; set; } = null!; + + public DateTime TwitterApplicationLastModified { get; set; } + + [Column("TwitterApplicationGUID")] + public Guid TwitterApplicationGuid { get; set; } + + [Column("TwitterApplicationSiteID")] + public int TwitterApplicationSiteId { get; set; } + + [StringLength(500)] + public string TwitterApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string TwitterApplicationConsumerSecret { get; set; } = null!; + + [InverseProperty("TwitterAccountTwitterApplication")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [ForeignKey("TwitterApplicationSiteId")] + [InverseProperty("SmTwitterApplications")] + public virtual CmsSite TwitterApplicationSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/SmTwitterPost.cs b/Migration.Toolkit.K11/Models/SmTwitterPost.cs index 48f6c231..efa009ab 100644 --- a/Migration.Toolkit.K11/Models/SmTwitterPost.cs +++ b/Migration.Toolkit.K11/Models/SmTwitterPost.cs @@ -1,71 +1,70 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("SM_TwitterPost")] -[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] -[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] -[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] -public partial class SmTwitterPost -{ - [Key] - [Column("TwitterPostID")] - public int TwitterPostId { get; set; } - - [Column("TwitterPostGUID")] - public Guid TwitterPostGuid { get; set; } - - public DateTime TwitterPostLastModified { get; set; } - - [Column("TwitterPostSiteID")] - public int TwitterPostSiteId { get; set; } - - [Column("TwitterPostTwitterAccountID")] - public int TwitterPostTwitterAccountId { get; set; } - - public string TwitterPostText { get; set; } = null!; - - [Column("TwitterPostURLShortenerType")] - public int? TwitterPostUrlshortenerType { get; set; } - - [Column("TwitterPostExternalID")] - public string? TwitterPostExternalId { get; set; } - - public int? TwitterPostErrorCode { get; set; } - - public DateTime? TwitterPostPublishedDateTime { get; set; } - - public DateTime? TwitterPostScheduledPublishDateTime { get; set; } - - [Column("TwitterPostCampaignID")] - public int? TwitterPostCampaignId { get; set; } - - public int? TwitterPostFavorites { get; set; } - - public int? TwitterPostRetweets { get; set; } - - public bool? TwitterPostPostAfterDocumentPublish { get; set; } - - public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } - - [Column("TwitterPostDocumentGUID")] - public Guid? TwitterPostDocumentGuid { get; set; } - - public bool? TwitterPostIsCreatedByUser { get; set; } - - [ForeignKey("TwitterPostCampaignId")] - [InverseProperty("SmTwitterPosts")] - public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } - - [ForeignKey("TwitterPostSiteId")] - [InverseProperty("SmTwitterPosts")] - public virtual CmsSite TwitterPostSite { get; set; } = null!; - - [ForeignKey("TwitterPostTwitterAccountId")] - [InverseProperty("SmTwitterPosts")] - public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("SM_TwitterPost")] +[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] +[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] +[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] +public class SmTwitterPost +{ + [Key] + [Column("TwitterPostID")] + public int TwitterPostId { get; set; } + + [Column("TwitterPostGUID")] + public Guid TwitterPostGuid { get; set; } + + public DateTime TwitterPostLastModified { get; set; } + + [Column("TwitterPostSiteID")] + public int TwitterPostSiteId { get; set; } + + [Column("TwitterPostTwitterAccountID")] + public int TwitterPostTwitterAccountId { get; set; } + + public string TwitterPostText { get; set; } = null!; + + [Column("TwitterPostURLShortenerType")] + public int? TwitterPostUrlshortenerType { get; set; } + + [Column("TwitterPostExternalID")] + public string? TwitterPostExternalId { get; set; } + + public int? TwitterPostErrorCode { get; set; } + + public DateTime? TwitterPostPublishedDateTime { get; set; } + + public DateTime? TwitterPostScheduledPublishDateTime { get; set; } + + [Column("TwitterPostCampaignID")] + public int? TwitterPostCampaignId { get; set; } + + public int? TwitterPostFavorites { get; set; } + + public int? TwitterPostRetweets { get; set; } + + public bool? TwitterPostPostAfterDocumentPublish { get; set; } + + public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } + + [Column("TwitterPostDocumentGUID")] + public Guid? TwitterPostDocumentGuid { get; set; } + + public bool? TwitterPostIsCreatedByUser { get; set; } + + [ForeignKey("TwitterPostCampaignId")] + [InverseProperty("SmTwitterPosts")] + public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } + + [ForeignKey("TwitterPostSiteId")] + [InverseProperty("SmTwitterPosts")] + public virtual CmsSite TwitterPostSite { get; set; } = null!; + + [ForeignKey("TwitterPostTwitterAccountId")] + [InverseProperty("SmTwitterPosts")] + public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/StagingServer.cs b/Migration.Toolkit.K11/Models/StagingServer.cs index eca747c7..d64658b3 100644 --- a/Migration.Toolkit.K11/Models/StagingServer.cs +++ b/Migration.Toolkit.K11/Models/StagingServer.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Staging_Server")] -[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] -[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] -public partial class StagingServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(100)] - public string ServerName { get; set; } = null!; - - [StringLength(440)] - public string ServerDisplayName { get; set; } = null!; - - [Column("ServerSiteID")] - public int ServerSiteId { get; set; } - - [Column("ServerURL")] - [StringLength(450)] - public string ServerUrl { get; set; } = null!; - - [Required] - public bool? ServerEnabled { get; set; } - - [StringLength(20)] - public string ServerAuthentication { get; set; } = null!; - - [StringLength(100)] - public string? ServerUsername { get; set; } - - [StringLength(100)] - public string? ServerPassword { get; set; } - - [Column("ServerX509ClientKeyID")] - [StringLength(200)] - public string? ServerX509clientKeyId { get; set; } - - [Column("ServerX509ServerKeyID")] - [StringLength(200)] - public string? ServerX509serverKeyId { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - [ForeignKey("ServerSiteId")] - [InverseProperty("StagingServers")] - public virtual CmsSite ServerSite { get; set; } = null!; - - [InverseProperty("SynchronizationServer")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Staging_Server")] +[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] +[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] +public class StagingServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(100)] + public string ServerName { get; set; } = null!; + + [StringLength(440)] + public string ServerDisplayName { get; set; } = null!; + + [Column("ServerSiteID")] + public int ServerSiteId { get; set; } + + [Column("ServerURL")] + [StringLength(450)] + public string ServerUrl { get; set; } = null!; + + [Required] + public bool? ServerEnabled { get; set; } + + [StringLength(20)] + public string ServerAuthentication { get; set; } = null!; + + [StringLength(100)] + public string? ServerUsername { get; set; } + + [StringLength(100)] + public string? ServerPassword { get; set; } + + [Column("ServerX509ClientKeyID")] + [StringLength(200)] + public string? ServerX509clientKeyId { get; set; } + + [Column("ServerX509ServerKeyID")] + [StringLength(200)] + public string? ServerX509serverKeyId { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + [ForeignKey("ServerSiteId")] + [InverseProperty("StagingServers")] + public virtual CmsSite ServerSite { get; set; } = null!; + + [InverseProperty("SynchronizationServer")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/StagingSynchronization.cs b/Migration.Toolkit.K11/Models/StagingSynchronization.cs index d0bbc2a5..528cdb39 100644 --- a/Migration.Toolkit.K11/Models/StagingSynchronization.cs +++ b/Migration.Toolkit.K11/Models/StagingSynchronization.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Staging_Synchronization")] -[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] -[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] -public partial class StagingSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationServerID")] - public int SynchronizationServerId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - [ForeignKey("SynchronizationServerId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingServer SynchronizationServer { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingTask SynchronizationTask { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Staging_Synchronization")] +[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] +[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] +public class StagingSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationServerID")] + public int SynchronizationServerId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + [ForeignKey("SynchronizationServerId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingServer SynchronizationServer { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/StagingTask.cs b/Migration.Toolkit.K11/Models/StagingTask.cs index 0fd60d9d..a27a6dff 100644 --- a/Migration.Toolkit.K11/Models/StagingTask.cs +++ b/Migration.Toolkit.K11/Models/StagingTask.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Staging_Task")] -[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] -[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] -[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Staging_Task_TaskType")] -public partial class StagingTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool? TaskRunning { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - public string? TaskServers { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("StagingTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Staging_Task")] +[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] +[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] +[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Staging_Task_TaskType")] +public class StagingTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool? TaskRunning { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + public string? TaskServers { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("StagingTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroup.cs b/Migration.Toolkit.K11/Models/StagingTaskGroup.cs index 21c7c6ff..e7373fe4 100644 --- a/Migration.Toolkit.K11/Models/StagingTaskGroup.cs +++ b/Migration.Toolkit.K11/Models/StagingTaskGroup.cs @@ -1,28 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("staging_TaskGroup")] -public partial class StagingTaskGroup -{ - [Key] - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [StringLength(50)] - public string TaskGroupCodeName { get; set; } = null!; - - public Guid TaskGroupGuid { get; set; } - - public string? TaskGroupDescription { get; set; } - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("staging_TaskGroup")] +public class StagingTaskGroup +{ + [Key] + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [StringLength(50)] + public string TaskGroupCodeName { get; set; } = null!; + + public Guid TaskGroupGuid { get; set; } + + public string? TaskGroupDescription { get; set; } + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); +} diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs index a627256c..900fb7e4 100644 --- a/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs +++ b/Migration.Toolkit.K11/Models/StagingTaskGroupTask.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("staging_TaskGroupTask")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] -[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] -public partial class StagingTaskGroupTask -{ - [Key] - [Column("TaskGroupTaskID")] - public int TaskGroupTaskId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("staging_TaskGroupTask")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] +[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] +public class StagingTaskGroupTask +{ + [Key] + [Column("TaskGroupTaskID")] + public int TaskGroupTaskId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs index 50bab5eb..509a0f3c 100644 --- a/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs +++ b/Migration.Toolkit.K11/Models/StagingTaskGroupUser.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("staging_TaskGroupUser")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] -[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] -public partial class StagingTaskGroupUser -{ - [Key] - [Column("TaskGroupUserID")] - public int TaskGroupUserId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupUsers")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskGroupUser")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("staging_TaskGroupUser")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] +[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] +public class StagingTaskGroupUser +{ + [Key] + [Column("TaskGroupUserID")] + public int TaskGroupUserId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupUsers")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskGroupUser")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/StagingTaskUser.cs b/Migration.Toolkit.K11/Models/StagingTaskUser.cs index e6819d6d..d332d44c 100644 --- a/Migration.Toolkit.K11/Models/StagingTaskUser.cs +++ b/Migration.Toolkit.K11/Models/StagingTaskUser.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Staging_TaskUser")] -[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] -[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] -public partial class StagingTaskUser -{ - [Key] - [Column("TaskUserID")] - public int TaskUserId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskUsers")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Table("Staging_TaskUser")] +[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] +[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] +public class StagingTaskUser +{ + [Key] + [Column("TaskUserID")] + public int TaskUserId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskUsers")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/StorecontentBook.cs b/Migration.Toolkit.K11/Models/StorecontentBook.cs index 9e49464b..bea10edf 100644 --- a/Migration.Toolkit.K11/Models/StorecontentBook.cs +++ b/Migration.Toolkit.K11/Models/StorecontentBook.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Book")] -public partial class StorecontentBook -{ - [Key] - [Column("BookID")] - public int BookId { get; set; } - - [StringLength(100)] - public string? BookAuthor { get; set; } - - public DateTime? BookPublicationDate { get; set; } - - [Column("BookISBN")] - [StringLength(100)] - public string? BookIsbn { get; set; } - - public int? BookEdition { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Book")] +public class StorecontentBook +{ + [Key] + [Column("BookID")] + public int BookId { get; set; } + + [StringLength(100)] + public string? BookAuthor { get; set; } + + public DateTime? BookPublicationDate { get; set; } + + [Column("BookISBN")] + [StringLength(100)] + public string? BookIsbn { get; set; } + + public int? BookEdition { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs b/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs index 0191d3cb..f73f6302 100644 --- a/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs +++ b/Migration.Toolkit.K11/Models/StorecontentCellPhone.cs @@ -1,72 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_CellPhone")] -public partial class StorecontentCellPhone -{ - [Key] - [Column("CellPhoneID")] - public int CellPhoneId { get; set; } - - [Column("CellPhoneCPU")] - [StringLength(100)] - public string? CellPhoneCpu { get; set; } - - [Column("CellPhoneRAM")] - [StringLength(100)] - public string? CellPhoneRam { get; set; } - - [Column("CellPhoneOS")] - [StringLength(100)] - public string? CellPhoneOs { get; set; } - - [StringLength(100)] - public string? CellPhoneCamera { get; set; } - - [StringLength(100)] - public string? CellPhoneDimensions { get; set; } - - public double? CellPhoneWeight { get; set; } - - [StringLength(100)] - public string? CellPhoneDisplayType { get; set; } - - [StringLength(50)] - public string? CellPhoneDisplaySize { get; set; } - - [StringLength(50)] - public string? CellPhoneDisplayResolution { get; set; } - - [StringLength(100)] - public string? CellPhoneInternalStorage { get; set; } - - [StringLength(100)] - public string? CellPhoneRemovableStorage { get; set; } - - [StringLength(100)] - public string? CellPhoneWiFi { get; set; } - - public bool? CellPhoneBluetooth { get; set; } - - [Column("CellPhoneIrDA")] - public bool? CellPhoneIrDa { get; set; } - - [Column("CellPhoneGPRS")] - public bool? CellPhoneGprs { get; set; } - - [Column("CellPhoneEDGE")] - public bool? CellPhoneEdge { get; set; } - - [Column("CellPhoneHSCSD")] - public bool? CellPhoneHscsd { get; set; } - - public bool? CellPhone3G { get; set; } - - [Column("CellPhoneGPS")] - public bool? CellPhoneGps { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_CellPhone")] +public class StorecontentCellPhone +{ + [Key] + [Column("CellPhoneID")] + public int CellPhoneId { get; set; } + + [Column("CellPhoneCPU")] + [StringLength(100)] + public string? CellPhoneCpu { get; set; } + + [Column("CellPhoneRAM")] + [StringLength(100)] + public string? CellPhoneRam { get; set; } + + [Column("CellPhoneOS")] + [StringLength(100)] + public string? CellPhoneOs { get; set; } + + [StringLength(100)] + public string? CellPhoneCamera { get; set; } + + [StringLength(100)] + public string? CellPhoneDimensions { get; set; } + + public double? CellPhoneWeight { get; set; } + + [StringLength(100)] + public string? CellPhoneDisplayType { get; set; } + + [StringLength(50)] + public string? CellPhoneDisplaySize { get; set; } + + [StringLength(50)] + public string? CellPhoneDisplayResolution { get; set; } + + [StringLength(100)] + public string? CellPhoneInternalStorage { get; set; } + + [StringLength(100)] + public string? CellPhoneRemovableStorage { get; set; } + + [StringLength(100)] + public string? CellPhoneWiFi { get; set; } + + public bool? CellPhoneBluetooth { get; set; } + + [Column("CellPhoneIrDA")] + public bool? CellPhoneIrDa { get; set; } + + [Column("CellPhoneGPRS")] + public bool? CellPhoneGprs { get; set; } + + [Column("CellPhoneEDGE")] + public bool? CellPhoneEdge { get; set; } + + [Column("CellPhoneHSCSD")] + public bool? CellPhoneHscsd { get; set; } + + public bool? CellPhone3G { get; set; } + + [Column("CellPhoneGPS")] + public bool? CellPhoneGps { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentComputer.cs b/Migration.Toolkit.K11/Models/StorecontentComputer.cs index 65bb4e4b..e59516fa 100644 --- a/Migration.Toolkit.K11/Models/StorecontentComputer.cs +++ b/Migration.Toolkit.K11/Models/StorecontentComputer.cs @@ -1,41 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Computer")] -public partial class StorecontentComputer -{ - [Key] - [Column("ComputerID")] - public int ComputerId { get; set; } - - [StringLength(200)] - public string? ComputerProcessor { get; set; } - - [StringLength(200)] - public string? ComputerMemory { get; set; } - - [StringLength(200)] - public string? ComputerHardDrive { get; set; } - - [StringLength(200)] - public string? ComputerOpticalDrive { get; set; } - - [StringLength(300)] - public string? ComputerGraphicsCard { get; set; } - - [StringLength(500)] - public string? ComputerInputsOutputs { get; set; } - - [StringLength(100)] - public string? ComputerOperatingSystem { get; set; } - - [StringLength(200)] - public string? ComputerDimensions { get; set; } - - public double? ComputerWeight { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Computer")] +public class StorecontentComputer +{ + [Key] + [Column("ComputerID")] + public int ComputerId { get; set; } + + [StringLength(200)] + public string? ComputerProcessor { get; set; } + + [StringLength(200)] + public string? ComputerMemory { get; set; } + + [StringLength(200)] + public string? ComputerHardDrive { get; set; } + + [StringLength(200)] + public string? ComputerOpticalDrive { get; set; } + + [StringLength(300)] + public string? ComputerGraphicsCard { get; set; } + + [StringLength(500)] + public string? ComputerInputsOutputs { get; set; } + + [StringLength(100)] + public string? ComputerOperatingSystem { get; set; } + + [StringLength(200)] + public string? ComputerDimensions { get; set; } + + public double? ComputerWeight { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentCup.cs b/Migration.Toolkit.K11/Models/StorecontentCup.cs index 89d413d9..56e87f1c 100644 --- a/Migration.Toolkit.K11/Models/StorecontentCup.cs +++ b/Migration.Toolkit.K11/Models/StorecontentCup.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Cup")] -public partial class StorecontentCup -{ - [Key] - [Column("CupID")] - public int CupId { get; set; } - - [StringLength(100)] - public string? CupSize { get; set; } - - [StringLength(100)] - public string? CupType { get; set; } - - [StringLength(100)] - public string? CupStyle { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Cup")] +public class StorecontentCup +{ + [Key] + [Column("CupID")] + public int CupId { get; set; } + + [StringLength(100)] + public string? CupSize { get; set; } + + [StringLength(100)] + public string? CupType { get; set; } + + [StringLength(100)] + public string? CupStyle { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentLaptop.cs b/Migration.Toolkit.K11/Models/StorecontentLaptop.cs index 176aaa27..689821db 100644 --- a/Migration.Toolkit.K11/Models/StorecontentLaptop.cs +++ b/Migration.Toolkit.K11/Models/StorecontentLaptop.cs @@ -1,64 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Laptop")] -public partial class StorecontentLaptop -{ - [Key] - [Column("LaptopID")] - public int LaptopId { get; set; } - - [StringLength(100)] - public string? LaptopProcessorType { get; set; } - - [StringLength(200)] - public string? LaptopMemory { get; set; } - - [StringLength(100)] - public string? LaptopGraphicsCard { get; set; } - - [StringLength(100)] - public string? LaptopHardDrive { get; set; } - - [StringLength(100)] - public string? LaptopOpticalDrive { get; set; } - - [StringLength(100)] - public string? LaptopDisplayType { get; set; } - - [StringLength(100)] - public string? LaptopDisplaySize { get; set; } - - [StringLength(50)] - public string? LaptopDisplayResolution { get; set; } - - [StringLength(400)] - public string? LaptopInputsOutputs { get; set; } - - [Column("LaptopWirelessLAN")] - [StringLength(100)] - public string? LaptopWirelessLan { get; set; } - - [StringLength(100)] - public string? LaptopNetwork { get; set; } - - public bool? LaptopBluetooth { get; set; } - - public bool? LaptopWebcam { get; set; } - - [StringLength(100)] - public string? LaptopOperatingSystem { get; set; } - - [StringLength(100)] - public string? LaptopBattery { get; set; } - - [StringLength(100)] - public string? LaptopDimensions { get; set; } - - public double? LaptopWeight { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Laptop")] +public class StorecontentLaptop +{ + [Key] + [Column("LaptopID")] + public int LaptopId { get; set; } + + [StringLength(100)] + public string? LaptopProcessorType { get; set; } + + [StringLength(200)] + public string? LaptopMemory { get; set; } + + [StringLength(100)] + public string? LaptopGraphicsCard { get; set; } + + [StringLength(100)] + public string? LaptopHardDrive { get; set; } + + [StringLength(100)] + public string? LaptopOpticalDrive { get; set; } + + [StringLength(100)] + public string? LaptopDisplayType { get; set; } + + [StringLength(100)] + public string? LaptopDisplaySize { get; set; } + + [StringLength(50)] + public string? LaptopDisplayResolution { get; set; } + + [StringLength(400)] + public string? LaptopInputsOutputs { get; set; } + + [Column("LaptopWirelessLAN")] + [StringLength(100)] + public string? LaptopWirelessLan { get; set; } + + [StringLength(100)] + public string? LaptopNetwork { get; set; } + + public bool? LaptopBluetooth { get; set; } + + public bool? LaptopWebcam { get; set; } + + [StringLength(100)] + public string? LaptopOperatingSystem { get; set; } + + [StringLength(100)] + public string? LaptopBattery { get; set; } + + [StringLength(100)] + public string? LaptopDimensions { get; set; } + + public double? LaptopWeight { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs b/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs index 95229daf..19c31303 100644 --- a/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs +++ b/Migration.Toolkit.K11/Models/StorecontentMediaPlayer.cs @@ -1,37 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_MediaPlayer")] -public partial class StorecontentMediaPlayer -{ - [Key] - [Column("MediaPlayerID")] - public int MediaPlayerId { get; set; } - - public double? MediaPlayerWeight { get; set; } - - [StringLength(100)] - public string? MediaPlayerDimensions { get; set; } - - [StringLength(20)] - public string? MediaPlayerMemoryCapacity { get; set; } - - [StringLength(50)] - public string? MediaPlayerMemoryType { get; set; } - - [StringLength(100)] - public string? MediaPlayerMemoryCard { get; set; } - - public bool? MediaPlayerRadio { get; set; } - - [StringLength(200)] - public string? MediaPlayerSupportedFormats { get; set; } - - [StringLength(100)] - public string? MediaPlayerDisplay { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_MediaPlayer")] +public class StorecontentMediaPlayer +{ + [Key] + [Column("MediaPlayerID")] + public int MediaPlayerId { get; set; } + + public double? MediaPlayerWeight { get; set; } + + [StringLength(100)] + public string? MediaPlayerDimensions { get; set; } + + [StringLength(20)] + public string? MediaPlayerMemoryCapacity { get; set; } + + [StringLength(50)] + public string? MediaPlayerMemoryType { get; set; } + + [StringLength(100)] + public string? MediaPlayerMemoryCard { get; set; } + + public bool? MediaPlayerRadio { get; set; } + + [StringLength(200)] + public string? MediaPlayerSupportedFormats { get; set; } + + [StringLength(100)] + public string? MediaPlayerDisplay { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentPant.cs b/Migration.Toolkit.K11/Models/StorecontentPant.cs index 9cd760c0..3c5ce839 100644 --- a/Migration.Toolkit.K11/Models/StorecontentPant.cs +++ b/Migration.Toolkit.K11/Models/StorecontentPant.cs @@ -1,21 +1,18 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Pants")] -public partial class StorecontentPant -{ - [Key] - [Column("PantsID")] - public int PantsId { get; set; } - - [StringLength(100)] - public string? PantsColor { get; set; } - - [StringLength(100)] - public string? PantsStyle { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Pants")] +public class StorecontentPant +{ + [Key] + [Column("PantsID")] + public int PantsId { get; set; } + + [StringLength(100)] + public string? PantsColor { get; set; } + + [StringLength(100)] + public string? PantsStyle { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentPerfume.cs b/Migration.Toolkit.K11/Models/StorecontentPerfume.cs index 80d875c4..bffd4519 100644 --- a/Migration.Toolkit.K11/Models/StorecontentPerfume.cs +++ b/Migration.Toolkit.K11/Models/StorecontentPerfume.cs @@ -1,21 +1,18 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Perfume")] -public partial class StorecontentPerfume -{ - [Key] - [Column("PerfumeID")] - public int PerfumeId { get; set; } - - [StringLength(250)] - public string? PerfumeIngredients { get; set; } - - [StringLength(100)] - public string? PerfumeSize { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Perfume")] +public class StorecontentPerfume +{ + [Key] + [Column("PerfumeID")] + public int PerfumeId { get; set; } + + [StringLength(250)] + public string? PerfumeIngredients { get; set; } + + [StringLength(100)] + public string? PerfumeSize { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentShoe.cs b/Migration.Toolkit.K11/Models/StorecontentShoe.cs index 4bf4c219..3b2a6804 100644 --- a/Migration.Toolkit.K11/Models/StorecontentShoe.cs +++ b/Migration.Toolkit.K11/Models/StorecontentShoe.cs @@ -1,21 +1,18 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Shoes")] -public partial class StorecontentShoe -{ - [Key] - [Column("ShoesID")] - public int ShoesId { get; set; } - - [StringLength(100)] - public string? ShoesColor { get; set; } - - [StringLength(100)] - public string? ShoesStyle { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Shoes")] +public class StorecontentShoe +{ + [Key] + [Column("ShoesID")] + public int ShoesId { get; set; } + + [StringLength(100)] + public string? ShoesColor { get; set; } + + [StringLength(100)] + public string? ShoesStyle { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentTablet.cs b/Migration.Toolkit.K11/Models/StorecontentTablet.cs index 1c99fa60..1dba31e6 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTablet.cs +++ b/Migration.Toolkit.K11/Models/StorecontentTablet.cs @@ -1,55 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_tablet")] -public partial class StorecontentTablet -{ - [Key] - [Column("TabletID")] - public int TabletId { get; set; } - - [StringLength(100)] - public string? TabletProcessor { get; set; } - - [StringLength(100)] - public string? TabletMemory { get; set; } - - [StringLength(100)] - public string? TabletOperatingSystem { get; set; } - - [StringLength(100)] - public string? TabletDisplayType { get; set; } - - [StringLength(100)] - public string? TabletDisplaySize { get; set; } - - [StringLength(100)] - public string? TabletResolution { get; set; } - - [StringLength(300)] - public string? TabletInputsOutputs { get; set; } - - [StringLength(100)] - public string? TabletWifi { get; set; } - - public bool? TabletBluetooth { get; set; } - - [Column("TabletGPS")] - public bool? TabletGps { get; set; } - - [StringLength(100)] - public string? TabletKeyboard { get; set; } - - [StringLength(100)] - public string? TabletBattery { get; set; } - - [StringLength(100)] - public string? TabletDimensions { get; set; } - - public double? TabletWeight { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_tablet")] +public class StorecontentTablet +{ + [Key] + [Column("TabletID")] + public int TabletId { get; set; } + + [StringLength(100)] + public string? TabletProcessor { get; set; } + + [StringLength(100)] + public string? TabletMemory { get; set; } + + [StringLength(100)] + public string? TabletOperatingSystem { get; set; } + + [StringLength(100)] + public string? TabletDisplayType { get; set; } + + [StringLength(100)] + public string? TabletDisplaySize { get; set; } + + [StringLength(100)] + public string? TabletResolution { get; set; } + + [StringLength(300)] + public string? TabletInputsOutputs { get; set; } + + [StringLength(100)] + public string? TabletWifi { get; set; } + + public bool? TabletBluetooth { get; set; } + + [Column("TabletGPS")] + public bool? TabletGps { get; set; } + + [StringLength(100)] + public string? TabletKeyboard { get; set; } + + [StringLength(100)] + public string? TabletBattery { get; set; } + + [StringLength(100)] + public string? TabletDimensions { get; set; } + + public double? TabletWeight { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentTshirt.cs b/Migration.Toolkit.K11/Models/StorecontentTshirt.cs index 3c9f54a1..913b2fad 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTshirt.cs +++ b/Migration.Toolkit.K11/Models/StorecontentTshirt.cs @@ -1,21 +1,18 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Tshirt")] -public partial class StorecontentTshirt -{ - [Key] - [Column("TshirtID")] - public int TshirtId { get; set; } - - [StringLength(100)] - public string? TshirtColor { get; set; } - - [StringLength(100)] - public string? TshirtStyle { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Tshirt")] +public class StorecontentTshirt +{ + [Key] + [Column("TshirtID")] + public int TshirtId { get; set; } + + [StringLength(100)] + public string? TshirtColor { get; set; } + + [StringLength(100)] + public string? TshirtStyle { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentTv.cs b/Migration.Toolkit.K11/Models/StorecontentTv.cs index 5f298fa5..1b8d6db5 100644 --- a/Migration.Toolkit.K11/Models/StorecontentTv.cs +++ b/Migration.Toolkit.K11/Models/StorecontentTv.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_TV")] -public partial class StorecontentTv -{ - [Key] - [Column("TVID")] - public int Tvid { get; set; } - - [Column("TVScreenSize")] - [StringLength(100)] - public string? TvscreenSize { get; set; } - - [Column("TVPixelResolution")] - [StringLength(100)] - public string? TvpixelResolution { get; set; } - - [Column("TVContrastRatio")] - [StringLength(100)] - public string? TvcontrastRatio { get; set; } - - [Column("TVVideoSystem")] - [StringLength(100)] - public string? TvvideoSystem { get; set; } - - [Column("TVSound")] - [StringLength(100)] - public string? Tvsound { get; set; } - - [Column("TVInputsOutputs")] - [StringLength(300)] - public string? TvinputsOutputs { get; set; } - - [Column("TVPowerConsumption")] - [StringLength(200)] - public string? TvpowerConsumption { get; set; } - - [Column("TVDimensions")] - [StringLength(100)] - public string? Tvdimensions { get; set; } - - [Column("TVWeight")] - public double? Tvweight { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_TV")] +public class StorecontentTv +{ + [Key] + [Column("TVID")] + public int Tvid { get; set; } + + [Column("TVScreenSize")] + [StringLength(100)] + public string? TvscreenSize { get; set; } + + [Column("TVPixelResolution")] + [StringLength(100)] + public string? TvpixelResolution { get; set; } + + [Column("TVContrastRatio")] + [StringLength(100)] + public string? TvcontrastRatio { get; set; } + + [Column("TVVideoSystem")] + [StringLength(100)] + public string? TvvideoSystem { get; set; } + + [Column("TVSound")] + [StringLength(100)] + public string? Tvsound { get; set; } + + [Column("TVInputsOutputs")] + [StringLength(300)] + public string? TvinputsOutputs { get; set; } + + [Column("TVPowerConsumption")] + [StringLength(200)] + public string? TvpowerConsumption { get; set; } + + [Column("TVDimensions")] + [StringLength(100)] + public string? Tvdimensions { get; set; } + + [Column("TVWeight")] + public double? Tvweight { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/StorecontentWatch.cs b/Migration.Toolkit.K11/Models/StorecontentWatch.cs index f3b6fd05..721fa533 100644 --- a/Migration.Toolkit.K11/Models/StorecontentWatch.cs +++ b/Migration.Toolkit.K11/Models/StorecontentWatch.cs @@ -1,30 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("STORECONTENT_Watch")] -public partial class StorecontentWatch -{ - [Key] - [Column("WatchID")] - public int WatchId { get; set; } - - [StringLength(100)] - public string? WatchGender { get; set; } - - [StringLength(100)] - public string? WatchDisplay { get; set; } - - [StringLength(100)] - public string? WatchDialColour { get; set; } - - [StringLength(100)] - public string? WatchStrapMaterial { get; set; } - - [StringLength(100)] - public string? WatchWaterResistance { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("STORECONTENT_Watch")] +public class StorecontentWatch +{ + [Key] + [Column("WatchID")] + public int WatchId { get; set; } + + [StringLength(100)] + public string? WatchGender { get; set; } + + [StringLength(100)] + public string? WatchDisplay { get; set; } + + [StringLength(100)] + public string? WatchDialColour { get; set; } + + [StringLength(100)] + public string? WatchStrapMaterial { get; set; } + + [StringLength(100)] + public string? WatchWaterResistance { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/TempFile.cs b/Migration.Toolkit.K11/Models/TempFile.cs index ac93841c..7646c9e3 100644 --- a/Migration.Toolkit.K11/Models/TempFile.cs +++ b/Migration.Toolkit.K11/Models/TempFile.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Table("Temp_File")] -public partial class TempFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileParentGUID")] - public Guid FileParentGuid { get; set; } - - public int FileNumber { get; set; } - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - public long FileSize { get; set; } - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - public byte[]? FileBinary { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - public DateTime FileLastModified { get; set; } - - [StringLength(200)] - public string FileDirectory { get; set; } = null!; - - [StringLength(200)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string? FileTitle { get; set; } - - public string? FileDescription { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.K11.Models; + +[Table("Temp_File")] +public class TempFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileParentGUID")] + public Guid FileParentGuid { get; set; } + + public int FileNumber { get; set; } + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + public long FileSize { get; set; } + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + public byte[]? FileBinary { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + public DateTime FileLastModified { get; set; } + + [StringLength(200)] + public string FileDirectory { get; set; } = null!; + + [StringLength(200)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string? FileTitle { get; set; } + + public string? FileDescription { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs b/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs index ad88ff74..34d7e5f0 100644 --- a/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewBoardsBoardMessageJoined.cs @@ -1,159 +1,158 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewBoardsBoardMessageJoined -{ - [Column("BoardID")] - public int BoardId { get; set; } - - [StringLength(250)] - public string BoardName { get; set; } = null!; - - [StringLength(250)] - public string BoardDisplayName { get; set; } = null!; - - public string BoardDescription { get; set; } = null!; - - public DateTime? BoardOpenedFrom { get; set; } - - public bool BoardOpened { get; set; } - - public DateTime? BoardOpenedTo { get; set; } - - public bool BoardEnabled { get; set; } - - public bool BoardModerated { get; set; } - - public int BoardAccess { get; set; } - - public bool BoardUseCaptcha { get; set; } - - public DateTime BoardLastModified { get; set; } - - public int BoardMessages { get; set; } - - [Column("BoardDocumentID")] - public int BoardDocumentId { get; set; } - - [Column("BoardGUID")] - public Guid BoardGuid { get; set; } - - [Column("BoardUserID")] - public int? BoardUserId { get; set; } - - [Column("BoardGroupID")] - public int? BoardGroupId { get; set; } - - public DateTime? BoardLastMessageTime { get; set; } - - [StringLength(250)] - public string? BoardLastMessageUserName { get; set; } - - [Column("BoardUnsubscriptionURL")] - [StringLength(450)] - public string? BoardUnsubscriptionUrl { get; set; } - - public bool? BoardRequireEmails { get; set; } - - [Column("BoardSiteID")] - public int BoardSiteId { get; set; } - - public bool BoardEnableSubscriptions { get; set; } - - [Column("BoardBaseURL")] - [StringLength(450)] - public string? BoardBaseUrl { get; set; } - - [Column("MessageID")] - public int MessageId { get; set; } - - [StringLength(250)] - public string MessageUserName { get; set; } = null!; - - public string MessageText { get; set; } = null!; - - [StringLength(254)] - public string MessageEmail { get; set; } = null!; - - [Column("MessageURL")] - [StringLength(450)] - public string MessageUrl { get; set; } = null!; - - public bool MessageIsSpam { get; set; } - - [Column("MessageBoardID")] - public int MessageBoardId { get; set; } - - public bool MessageApproved { get; set; } - - [Column("MessageUserID")] - public int? MessageUserId { get; set; } - - [Column("MessageApprovedByUserID")] - public int? MessageApprovedByUserId { get; set; } - - public string MessageUserInfo { get; set; } = null!; - - [Column("MessageAvatarGUID")] - public Guid? MessageAvatarGuid { get; set; } - - public DateTime MessageInserted { get; set; } - - public DateTime MessageLastModified { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public double? MessageRatingValue { get; set; } - - [Column("GroupID")] - public int? GroupId { get; set; } - - [Column("GroupGUID")] - public Guid? GroupGuid { get; set; } - - public DateTime? GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int? GroupSiteId { get; set; } - - [StringLength(200)] - public string? GroupDisplayName { get; set; } - - [StringLength(100)] - public string? GroupName { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int? GroupApproveMembers { get; set; } - - public int? GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime? GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewBoardsBoardMessageJoined +{ + [Column("BoardID")] + public int BoardId { get; set; } + + [StringLength(250)] + public string BoardName { get; set; } = null!; + + [StringLength(250)] + public string BoardDisplayName { get; set; } = null!; + + public string BoardDescription { get; set; } = null!; + + public DateTime? BoardOpenedFrom { get; set; } + + public bool BoardOpened { get; set; } + + public DateTime? BoardOpenedTo { get; set; } + + public bool BoardEnabled { get; set; } + + public bool BoardModerated { get; set; } + + public int BoardAccess { get; set; } + + public bool BoardUseCaptcha { get; set; } + + public DateTime BoardLastModified { get; set; } + + public int BoardMessages { get; set; } + + [Column("BoardDocumentID")] + public int BoardDocumentId { get; set; } + + [Column("BoardGUID")] + public Guid BoardGuid { get; set; } + + [Column("BoardUserID")] + public int? BoardUserId { get; set; } + + [Column("BoardGroupID")] + public int? BoardGroupId { get; set; } + + public DateTime? BoardLastMessageTime { get; set; } + + [StringLength(250)] + public string? BoardLastMessageUserName { get; set; } + + [Column("BoardUnsubscriptionURL")] + [StringLength(450)] + public string? BoardUnsubscriptionUrl { get; set; } + + public bool? BoardRequireEmails { get; set; } + + [Column("BoardSiteID")] + public int BoardSiteId { get; set; } + + public bool BoardEnableSubscriptions { get; set; } + + [Column("BoardBaseURL")] + [StringLength(450)] + public string? BoardBaseUrl { get; set; } + + [Column("MessageID")] + public int MessageId { get; set; } + + [StringLength(250)] + public string MessageUserName { get; set; } = null!; + + public string MessageText { get; set; } = null!; + + [StringLength(254)] + public string MessageEmail { get; set; } = null!; + + [Column("MessageURL")] + [StringLength(450)] + public string MessageUrl { get; set; } = null!; + + public bool MessageIsSpam { get; set; } + + [Column("MessageBoardID")] + public int MessageBoardId { get; set; } + + public bool MessageApproved { get; set; } + + [Column("MessageUserID")] + public int? MessageUserId { get; set; } + + [Column("MessageApprovedByUserID")] + public int? MessageApprovedByUserId { get; set; } + + public string MessageUserInfo { get; set; } = null!; + + [Column("MessageAvatarGUID")] + public Guid? MessageAvatarGuid { get; set; } + + public DateTime MessageInserted { get; set; } + + public DateTime MessageLastModified { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public double? MessageRatingValue { get; set; } + + [Column("GroupID")] + public int? GroupId { get; set; } + + [Column("GroupGUID")] + public Guid? GroupGuid { get; set; } + + public DateTime? GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int? GroupSiteId { get; set; } + + [StringLength(200)] + public string? GroupDisplayName { get; set; } + + [StringLength(100)] + public string? GroupName { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int? GroupApproveMembers { get; set; } + + public int? GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime? GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs index d774ede3..bb2470ec 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsAclitemItemsAndOperator.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsAclitemItemsAndOperator -{ - [Column("ACLOwnerNodeID")] - public int AclownerNodeId { get; set; } - - [Column("ACLItemID")] - public int AclitemId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - [StringLength(51)] - public string? Operator { get; set; } - - [StringLength(100)] - public string? OperatorName { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [StringLength(450)] - public string? OperatorFullName { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsAclitemItemsAndOperator +{ + [Column("ACLOwnerNodeID")] + public int AclownerNodeId { get; set; } + + [Column("ACLItemID")] + public int AclitemId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + [StringLength(51)] + public string? Operator { get; set; } + + [StringLength(100)] + public string? OperatorName { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [StringLength(450)] + public string? OperatorFullName { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs index fa7912d3..203a6eca 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -1,124 +1,123 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsObjectVersionHistoryUserJoined -{ - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(100)] - public string? UserName { get; set; } - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string? UserPassword { get; set; } - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool? UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid? UserGuid { get; set; } - - public DateTime? UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int? UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsObjectVersionHistoryUserJoined +{ + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(100)] + public string? UserName { get; set; } + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string? UserPassword { get; set; } + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool? UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid? UserGuid { get; set; } + + public DateTime? UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int? UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs index f0a00911..d7cc429e 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -1,58 +1,57 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsPageTemplateCategoryPageTemplateJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string? CodeName { get; set; } - - [StringLength(200)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [StringLength(20)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - public bool? Parameter { get; set; } - - public int? PageTemplateForAllPages { get; set; } - - [StringLength(10)] - public string? PageTemplateType { get; set; } - - public int? PageTemplateIsReusable { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsPageTemplateCategoryPageTemplateJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string? CodeName { get; set; } + + [StringLength(200)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [StringLength(20)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + public bool? Parameter { get; set; } + + public int? PageTemplateForAllPages { get; set; } + + [StringLength(10)] + public string? PageTemplateType { get; set; } + + public int? PageTemplateIsReusable { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs index 377a3e47..695215f5 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsRelationshipJoined.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsRelationshipJoined -{ - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("LeftNodeGUID")] - public Guid LeftNodeGuid { get; set; } - - [StringLength(100)] - public string LeftNodeName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RightNodeGUID")] - public Guid RightNodeGuid { get; set; } - - [StringLength(100)] - public string RightNodeName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - public string? RelationshipCustomData { get; set; } - - [Column("LeftClassID")] - public int LeftClassId { get; set; } - - [Column("RightClassID")] - public int RightClassId { get; set; } - - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - public int? RelationshipOrder { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsRelationshipJoined +{ + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("LeftNodeGUID")] + public Guid LeftNodeGuid { get; set; } + + [StringLength(100)] + public string LeftNodeName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RightNodeGUID")] + public Guid RightNodeGuid { get; set; } + + [StringLength(100)] + public string RightNodeName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + public string? RelationshipCustomData { get; set; } + + [Column("LeftClassID")] + public int LeftClassId { get; set; } + + [Column("RightClassID")] + public int RightClassId { get; set; } + + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + public int? RelationshipOrder { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs index 9ef28bf0..61c49d9e 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsResourceStringJoined.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsResourceStringJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("TranslationID")] - public int? TranslationId { get; set; } - - [Column("TranslationStringID")] - public int? TranslationStringId { get; set; } - - [Column("TranslationCultureID")] - public int? TranslationCultureId { get; set; } - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int? CultureId { get; set; } - - [StringLength(200)] - public string? CultureName { get; set; } - - [StringLength(50)] - public string? CultureCode { get; set; } - - [Column("CultureGUID")] - public Guid? CultureGuid { get; set; } - - public DateTime? CultureLastModified { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsResourceStringJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("TranslationID")] + public int? TranslationId { get; set; } + + [Column("TranslationStringID")] + public int? TranslationStringId { get; set; } + + [Column("TranslationCultureID")] + public int? TranslationCultureId { get; set; } + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int? CultureId { get; set; } + + [StringLength(200)] + public string? CultureName { get; set; } + + [StringLength(50)] + public string? CultureCode { get; set; } + + [Column("CultureGUID")] + public Guid? CultureGuid { get; set; } + + public DateTime? CultureLastModified { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs index 0f0572f2..ea467833 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsResourceTranslatedJoined.cs @@ -1,28 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsResourceTranslatedJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsResourceTranslatedJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs index d8271bdb..7d65166f 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -1,23 +1,22 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsRoleResourcePermissionJoined -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("PermissionID")] - public int PermissionId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsRoleResourcePermissionJoined +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("PermissionID")] + public int PermissionId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs index 5ab3e55f..815652bf 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsSiteDocumentCount.cs @@ -1,47 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsSiteDocumentCount -{ - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [Column("SiteDefaultStylesheetID")] - public int? SiteDefaultStylesheetId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - public int? SiteDefaultEditorStylesheet { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - public bool? SiteIsContentOnly { get; set; } - - public int? Documents { get; set; } - - public bool? SiteIsOffline { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsSiteDocumentCount +{ + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [Column("SiteDefaultStylesheetID")] + public int? SiteDefaultStylesheetId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + public int? SiteDefaultEditorStylesheet { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + public bool? SiteIsContentOnly { get; set; } + + public int? Documents { get; set; } + + public bool? SiteIsOffline { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs index c9c64455..e4e2cfee 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsSiteRoleResourceUielementJoined -{ - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(100)] - public string? SiteName { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [Column("RoleSiteID")] - public int? RoleSiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsSiteRoleResourceUielementJoined +{ + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(100)] + public string? SiteName { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [Column("RoleSiteID")] + public int? RoleSiteId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs index 7941ed1a..223c7375 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsTreeJoined.cs @@ -1,292 +1,291 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsTreeJoined -{ - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - public int? NodeCacheMinutes { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - public string? NodeDocType { get; set; } - - public string? NodeHeadTags { get; set; } - - public string? NodeBodyElementAttributes { get; set; } - - [StringLength(200)] - public string? NodeInheritPageLevels { get; set; } - - [Column("RequiresSSL")] - public int? RequiresSsl { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeGroupID")] - public int? NodeGroupId { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - [Column("NodeTemplateID")] - public int? NodeTemplateId { get; set; } - - public bool? NodeTemplateForAllCultures { get; set; } - - public bool? NodeInheritPageTemplate { get; set; } - - public bool? NodeAllowCacheInFileSystem { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - public bool NodeIsContentOnly { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - public string? NodeBodyScripts { get; set; } - - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - [StringLength(450)] - public string? DocumentUrlPath { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public bool DocumentShowInSiteMap { get; set; } - - public bool DocumentMenuItemHideInNavigation { get; set; } - - [StringLength(200)] - public string? DocumentMenuCaption { get; set; } - - [StringLength(100)] - public string? DocumentMenuStyle { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImage { get; set; } - - [Column("DocumentPageTemplateID")] - public int? DocumentPageTemplateId { get; set; } - - [StringLength(450)] - public string? DocumentMenuJavascript { get; set; } - - [StringLength(450)] - public string? DocumentMenuRedirectUrl { get; set; } - - public bool? DocumentUseNamePathForUrlPath { get; set; } - - [Column("DocumentStylesheetID")] - public int? DocumentStylesheetId { get; set; } - - public string? DocumentContent { get; set; } - - [StringLength(100)] - public string? DocumentMenuClass { get; set; } - - [StringLength(200)] - public string? DocumentMenuStyleHighlighted { get; set; } - - [StringLength(100)] - public string? DocumentMenuClassHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImageHighlighted { get; set; } - - public bool? DocumentMenuItemInactive { get; set; } - - public string? DocumentCustomData { get; set; } - - [StringLength(100)] - public string? DocumentExtensions { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - [StringLength(440)] - public string? DocumentWildcardRule { get; set; } - - public string? DocumentWebParts { get; set; } - - public double? DocumentRatingValue { get; set; } - - public int? DocumentRatings { get; set; } - - public int? DocumentPriority { get; set; } - - [StringLength(50)] - public string? DocumentType { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentUseCustomExtensions { get; set; } - - public string? DocumentGroupWebParts { get; set; } - - public bool? DocumentCheckedOutAutomatically { get; set; } - - [StringLength(200)] - public string? DocumentTrackConversionName { get; set; } - - [StringLength(100)] - public string? DocumentConversionValue { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [StringLength(32)] - public string? DocumentHash { get; set; } - - public bool? DocumentLogVisitActivity { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - [StringLength(100)] - public string? DocumentSitemapSettings { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool? DocumentMenuRedirectToFirstChild { get; set; } - - public bool DocumentCanBePublished { get; set; } - - public bool DocumentInheritsStylesheet { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsTreeJoined +{ + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + public int? NodeCacheMinutes { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + public string? NodeDocType { get; set; } + + public string? NodeHeadTags { get; set; } + + public string? NodeBodyElementAttributes { get; set; } + + [StringLength(200)] + public string? NodeInheritPageLevels { get; set; } + + [Column("RequiresSSL")] + public int? RequiresSsl { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeGroupID")] + public int? NodeGroupId { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + [Column("NodeTemplateID")] + public int? NodeTemplateId { get; set; } + + public bool? NodeTemplateForAllCultures { get; set; } + + public bool? NodeInheritPageTemplate { get; set; } + + public bool? NodeAllowCacheInFileSystem { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + public bool NodeIsContentOnly { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + public string? NodeBodyScripts { get; set; } + + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + [StringLength(450)] + public string? DocumentUrlPath { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public bool DocumentShowInSiteMap { get; set; } + + public bool DocumentMenuItemHideInNavigation { get; set; } + + [StringLength(200)] + public string? DocumentMenuCaption { get; set; } + + [StringLength(100)] + public string? DocumentMenuStyle { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImage { get; set; } + + [Column("DocumentPageTemplateID")] + public int? DocumentPageTemplateId { get; set; } + + [StringLength(450)] + public string? DocumentMenuJavascript { get; set; } + + [StringLength(450)] + public string? DocumentMenuRedirectUrl { get; set; } + + public bool? DocumentUseNamePathForUrlPath { get; set; } + + [Column("DocumentStylesheetID")] + public int? DocumentStylesheetId { get; set; } + + public string? DocumentContent { get; set; } + + [StringLength(100)] + public string? DocumentMenuClass { get; set; } + + [StringLength(200)] + public string? DocumentMenuStyleHighlighted { get; set; } + + [StringLength(100)] + public string? DocumentMenuClassHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImageHighlighted { get; set; } + + public bool? DocumentMenuItemInactive { get; set; } + + public string? DocumentCustomData { get; set; } + + [StringLength(100)] + public string? DocumentExtensions { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + [StringLength(440)] + public string? DocumentWildcardRule { get; set; } + + public string? DocumentWebParts { get; set; } + + public double? DocumentRatingValue { get; set; } + + public int? DocumentRatings { get; set; } + + public int? DocumentPriority { get; set; } + + [StringLength(50)] + public string? DocumentType { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentUseCustomExtensions { get; set; } + + public string? DocumentGroupWebParts { get; set; } + + public bool? DocumentCheckedOutAutomatically { get; set; } + + [StringLength(200)] + public string? DocumentTrackConversionName { get; set; } + + [StringLength(100)] + public string? DocumentConversionValue { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [StringLength(32)] + public string? DocumentHash { get; set; } + + public bool? DocumentLogVisitActivity { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + [StringLength(100)] + public string? DocumentSitemapSettings { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool? DocumentMenuRedirectToFirstChild { get; set; } + + public bool DocumentCanBePublished { get; set; } + + public bool DocumentInheritsStylesheet { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUser.cs b/Migration.Toolkit.K11/Models/ViewCmsUser.cs index a78294a9..a7331e8c 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUser.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUser.cs @@ -1,218 +1,217 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsUser -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - [StringLength(200)] - public string? UserMessagingNotificationEmail { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsUser +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + [StringLength(200)] + public string? UserMessagingNotificationEmail { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs index cc437659..aefc7de0 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserDocument.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsUserDocument -{ - [StringLength(450)] - public string DocumentName { get; set; } = null!; - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [StringLength(200)] - public string? CultureName { get; set; } - - [Column("UserID1")] - public int? UserId1 { get; set; } - - [Column("UserID2")] - public int? UserId2 { get; set; } - - [Column("UserID3")] - public int? UserId3 { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(12)] - [Unicode(false)] - public string Type { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsUserDocument +{ + [StringLength(450)] + public string DocumentName { get; set; } = null!; + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [StringLength(200)] + public string? CultureName { get; set; } + + [Column("UserID1")] + public int? UserId1 { get; set; } + + [Column("UserID2")] + public int? UserId2 { get; set; } + + [Column("UserID3")] + public int? UserId3 { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(12)] + [Unicode(false)] + public string Type { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs index 61b8fa53..e62bd3c6 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserRoleJoined.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsUserRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [StringLength(100)] - public string? SiteName { get; set; } - - [Column("SiteGUID")] - public Guid? SiteGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsUserRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [StringLength(100)] + public string? SiteName { get; set; } + + [Column("SiteGUID")] + public Guid? SiteGuid { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs index 22095672..9666bb84 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRole.cs @@ -1,25 +1,24 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsUserRoleMembershipRole -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRole +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs index 1c426e98..d9a3198c 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -1,19 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRoleValidOnlyJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs index 2d6d76c0..c46d5483 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsUserSettingsRoleJoined.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsUserSettingsRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - public bool UserEnabled { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsUserSettingsRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + public bool UserEnabled { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs index 3b4921a2..463984e1 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -1,68 +1,67 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsWebPartCategoryWebpartJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - [StringLength(100)] - public string? WebPartFileName { get; set; } - - [Column("WebPartGUID")] - public Guid? WebPartGuid { get; set; } - - public int? WebPartType { get; set; } - - [StringLength(1000)] - public string? WebPartDescription { get; set; } - - [StringLength(15)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - [Column("ThumbnailGUID")] - public Guid? ThumbnailGuid { get; set; } - - [StringLength(200)] - public string? IconClass { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsWebPartCategoryWebpartJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + [StringLength(100)] + public string? WebPartFileName { get; set; } + + [Column("WebPartGUID")] + public Guid? WebPartGuid { get; set; } + + public int? WebPartType { get; set; } + + [StringLength(1000)] + public string? WebPartDescription { get; set; } + + [StringLength(15)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + [Column("ThumbnailGUID")] + public Guid? ThumbnailGuid { get; set; } + + [StringLength(200)] + public string? IconClass { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs index 7f855666..53d63924 100644 --- a/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCmsWidgetCategoryWidgetJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WidgetWebPartID")] - public int? WidgetWebPartId { get; set; } - - public int WidgetSecurity { get; set; } - - public bool? WidgetForGroup { get; set; } - - public bool? WidgetForInline { get; set; } - - public bool? WidgetForUser { get; set; } - - public bool? WidgetForEditor { get; set; } - - public bool? WidgetForDashboard { get; set; } - - [Column("WidgetGUID")] - public Guid? WidgetGuid { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCmsWidgetCategoryWidgetJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WidgetWebPartID")] + public int? WidgetWebPartId { get; set; } + + public int WidgetSecurity { get; set; } + + public bool? WidgetForGroup { get; set; } + + public bool? WidgetForInline { get; set; } + + public bool? WidgetForUser { get; set; } + + public bool? WidgetForEditor { get; set; } + + public bool? WidgetForDashboard { get; set; } + + [Column("WidgetGUID")] + public Guid? WidgetGuid { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs index be513cc8..c7907651 100644 --- a/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewComSkuoptionCategoryOptionCategoryJoined -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - public bool CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewComSkuoptionCategoryOptionCategoryJoined +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + public bool CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs b/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs index a352d09f..eb5b506c 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs +++ b/Migration.Toolkit.K11/Models/ViewCommunityFriendFriend.cs @@ -1,244 +1,243 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCommunityFriendFriend -{ - [Column("FriendID")] - public int FriendId { get; set; } - - [Column("FriendRequestedUserID")] - public int FriendRequestedUserId { get; set; } - - [Column("FriendUserID")] - public int FriendUserId { get; set; } - - public DateTime FriendRequestedWhen { get; set; } - - public string? FriendComment { get; set; } - - public int? FriendApprovedBy { get; set; } - - public DateTime? FriendApprovedWhen { get; set; } - - public int? FriendRejectedBy { get; set; } - - public DateTime? FriendRejectedWhen { get; set; } - - [Column("FriendGUID")] - public Guid FriendGuid { get; set; } - - public int FriendStatus { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - [StringLength(200)] - public string? UserMessagingNotificationEmail { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCommunityFriendFriend +{ + [Column("FriendID")] + public int FriendId { get; set; } + + [Column("FriendRequestedUserID")] + public int FriendRequestedUserId { get; set; } + + [Column("FriendUserID")] + public int FriendUserId { get; set; } + + public DateTime FriendRequestedWhen { get; set; } + + public string? FriendComment { get; set; } + + public int? FriendApprovedBy { get; set; } + + public DateTime? FriendApprovedWhen { get; set; } + + public int? FriendRejectedBy { get; set; } + + public DateTime? FriendRejectedWhen { get; set; } + + [Column("FriendGUID")] + public Guid FriendGuid { get; set; } + + public int FriendStatus { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + [StringLength(200)] + public string? UserMessagingNotificationEmail { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs b/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs index cf08f872..a2feb77d 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs +++ b/Migration.Toolkit.K11/Models/ViewCommunityFriendRequestedFriend.cs @@ -1,244 +1,243 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCommunityFriendRequestedFriend -{ - [Column("FriendID")] - public int FriendId { get; set; } - - [Column("FriendRequestedUserID")] - public int FriendRequestedUserId { get; set; } - - [Column("FriendUserID")] - public int FriendUserId { get; set; } - - public DateTime FriendRequestedWhen { get; set; } - - public string? FriendComment { get; set; } - - public int? FriendApprovedBy { get; set; } - - public DateTime? FriendApprovedWhen { get; set; } - - public int? FriendRejectedBy { get; set; } - - public DateTime? FriendRejectedWhen { get; set; } - - [Column("FriendGUID")] - public Guid FriendGuid { get; set; } - - public int FriendStatus { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - [StringLength(200)] - public string? UserMessagingNotificationEmail { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCommunityFriendRequestedFriend +{ + [Column("FriendID")] + public int FriendId { get; set; } + + [Column("FriendRequestedUserID")] + public int FriendRequestedUserId { get; set; } + + [Column("FriendUserID")] + public int FriendUserId { get; set; } + + public DateTime FriendRequestedWhen { get; set; } + + public string? FriendComment { get; set; } + + public int? FriendApprovedBy { get; set; } + + public DateTime? FriendApprovedWhen { get; set; } + + public int? FriendRejectedBy { get; set; } + + public DateTime? FriendRejectedWhen { get; set; } + + [Column("FriendGUID")] + public Guid FriendGuid { get; set; } + + public int FriendStatus { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + [StringLength(200)] + public string? UserMessagingNotificationEmail { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs b/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs index 41c66ad8..68426306 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs +++ b/Migration.Toolkit.K11/Models/ViewCommunityGroup.cs @@ -1,67 +1,66 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCommunityGroup -{ - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - [StringLength(100)] - public string GroupName { get; set; } = null!; - - public string GroupDescription { get; set; } = null!; - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int GroupApproveMembers { get; set; } - - public int GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } - - public bool? GroupLogActivity { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCommunityGroup +{ + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + [StringLength(100)] + public string GroupName { get; set; } = null!; + + public string GroupDescription { get; set; } = null!; + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int GroupApproveMembers { get; set; } + + public int GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } + + public bool? GroupLogActivity { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewCommunityMember.cs b/Migration.Toolkit.K11/Models/ViewCommunityMember.cs index d263c7aa..53de7d66 100644 --- a/Migration.Toolkit.K11/Models/ViewCommunityMember.cs +++ b/Migration.Toolkit.K11/Models/ViewCommunityMember.cs @@ -1,249 +1,248 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewCommunityMember -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - [StringLength(200)] - public string? UserMessagingNotificationEmail { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("MemberID")] - public int? MemberId { get; set; } - - [Column("MemberGUID")] - public Guid? MemberGuid { get; set; } - - [Column("MemberUserID")] - public int? MemberUserId { get; set; } - - [Column("MemberGroupID")] - public int? MemberGroupId { get; set; } - - public DateTime? MemberJoined { get; set; } - - public DateTime? MemberApprovedWhen { get; set; } - - public DateTime? MemberRejectedWhen { get; set; } - - [Column("MemberApprovedByUserID")] - public int? MemberApprovedByUserId { get; set; } - - public string? MemberComment { get; set; } - - [Column("MemberInvitedByUserID")] - public int? MemberInvitedByUserId { get; set; } - - public int? MemberStatus { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewCommunityMember +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + [StringLength(200)] + public string? UserMessagingNotificationEmail { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("MemberID")] + public int? MemberId { get; set; } + + [Column("MemberGUID")] + public Guid? MemberGuid { get; set; } + + [Column("MemberUserID")] + public int? MemberUserId { get; set; } + + [Column("MemberGroupID")] + public int? MemberGroupId { get; set; } + + public DateTime? MemberJoined { get; set; } + + public DateTime? MemberApprovedWhen { get; set; } + + public DateTime? MemberRejectedWhen { get; set; } + + [Column("MemberApprovedByUserID")] + public int? MemberApprovedByUserId { get; set; } + + public string? MemberComment { get; set; } + + [Column("MemberInvitedByUserID")] + public int? MemberInvitedByUserId { get; set; } + + public int? MemberStatus { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs b/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs index d3d7669f..b660bb96 100644 --- a/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewForumsGroupForumPostJoined.cs @@ -1,228 +1,227 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewForumsGroupForumPostJoined -{ - [Column("ForumID")] - public int? ForumId { get; set; } - - [Column("ForumGroupID")] - public int? ForumGroupId { get; set; } - - [StringLength(200)] - public string? ForumName { get; set; } - - [StringLength(200)] - public string? ForumDisplayName { get; set; } - - public string? ForumDescription { get; set; } - - public int? ForumOrder { get; set; } - - [Column("ForumDocumentID")] - public int? ForumDocumentId { get; set; } - - public bool? ForumOpen { get; set; } - - public bool? ForumModerated { get; set; } - - public bool? ForumDisplayEmails { get; set; } - - public bool? ForumRequireEmail { get; set; } - - public int? ForumAccess { get; set; } - - public int? ForumThreads { get; set; } - - public int? ForumPosts { get; set; } - - public DateTime? ForumLastPostTime { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserName { get; set; } - - [StringLength(200)] - public string? ForumBaseUrl { get; set; } - - public bool? ForumAllowChangeName { get; set; } - - [Column("ForumHTMLEditor")] - public bool? ForumHtmleditor { get; set; } - - [Column("ForumUseCAPTCHA")] - public bool? ForumUseCaptcha { get; set; } - - [Column("ForumGUID")] - public Guid? ForumGuid { get; set; } - - public DateTime? ForumLastModified { get; set; } - - [StringLength(200)] - public string? ForumUnsubscriptionUrl { get; set; } - - public bool? ForumIsLocked { get; set; } - - public string? ForumSettings { get; set; } - - public bool? ForumAuthorEdit { get; set; } - - public bool? ForumAuthorDelete { get; set; } - - public int? ForumType { get; set; } - - public int? ForumIsAnswerLimit { get; set; } - - public int? ForumImageMaxSideSize { get; set; } - - public DateTime? ForumLastPostTimeAbsolute { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserNameAbsolute { get; set; } - - public int? ForumPostsAbsolute { get; set; } - - public int? ForumThreadsAbsolute { get; set; } - - public int? ForumAttachmentMaxFileSize { get; set; } - - public int? ForumDiscussionActions { get; set; } - - [Column("ForumSiteID")] - public int? ForumSiteId { get; set; } - - [Column("GroupID")] - public int? GroupId { get; set; } - - [Column("GroupSiteID")] - public int? GroupSiteId { get; set; } - - [StringLength(200)] - public string? GroupName { get; set; } - - [StringLength(200)] - public string? GroupDisplayName { get; set; } - - public int? GroupOrder { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupGUID")] - public Guid? GroupGuid { get; set; } - - public DateTime? GroupLastModified { get; set; } - - [StringLength(200)] - public string? GroupBaseUrl { get; set; } - - [StringLength(200)] - public string? GroupUnsubscriptionUrl { get; set; } - - [Column("GroupGroupID")] - public int? GroupGroupId { get; set; } - - public bool? GroupAuthorEdit { get; set; } - - public bool? GroupAuthorDelete { get; set; } - - public int? GroupType { get; set; } - - public int? GroupIsAnswerLimit { get; set; } - - public int? GroupImageMaxSideSize { get; set; } - - public bool? GroupDisplayEmails { get; set; } - - public bool? GroupRequireEmail { get; set; } - - [Column("GroupHTMLEditor")] - public bool? GroupHtmleditor { get; set; } - - [Column("GroupUseCAPTCHA")] - public bool? GroupUseCaptcha { get; set; } - - public int? GroupAttachmentMaxFileSize { get; set; } - - public int? GroupDiscussionActions { get; set; } - - public int PostId { get; set; } - - [Column("PostForumID")] - public int PostForumId { get; set; } - - [Column("PostParentID")] - public int? PostParentId { get; set; } - - [Column("PostIDPath")] - [StringLength(450)] - public string PostIdpath { get; set; } = null!; - - public int PostLevel { get; set; } - - [StringLength(450)] - public string PostSubject { get; set; } = null!; - - [Column("PostUserID")] - public int? PostUserId { get; set; } - - [StringLength(200)] - public string PostUserName { get; set; } = null!; - - [StringLength(254)] - public string? PostUserMail { get; set; } - - public string? PostText { get; set; } - - public DateTime PostTime { get; set; } - - [Column("PostApprovedByUserID")] - public int? PostApprovedByUserId { get; set; } - - public int? PostThreadPosts { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserName { get; set; } - - public DateTime? PostThreadLastPostTime { get; set; } - - public string? PostUserSignature { get; set; } - - [Column("PostGUID")] - public Guid PostGuid { get; set; } - - public DateTime PostLastModified { get; set; } - - public bool? PostApproved { get; set; } - - public bool? PostIsLocked { get; set; } - - public int? PostIsAnswer { get; set; } - - public int PostStickOrder { get; set; } - - public int? PostViews { get; set; } - - public DateTime? PostLastEdit { get; set; } - - public string? PostInfo { get; set; } - - public int? PostAttachmentCount { get; set; } - - public int? PostType { get; set; } - - public int? PostThreadPostsAbsolute { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserNameAbsolute { get; set; } - - public DateTime? PostThreadLastPostTimeAbsolute { get; set; } - - public bool? PostQuestionSolved { get; set; } - - public int? PostIsNotAnswer { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewForumsGroupForumPostJoined +{ + [Column("ForumID")] + public int? ForumId { get; set; } + + [Column("ForumGroupID")] + public int? ForumGroupId { get; set; } + + [StringLength(200)] + public string? ForumName { get; set; } + + [StringLength(200)] + public string? ForumDisplayName { get; set; } + + public string? ForumDescription { get; set; } + + public int? ForumOrder { get; set; } + + [Column("ForumDocumentID")] + public int? ForumDocumentId { get; set; } + + public bool? ForumOpen { get; set; } + + public bool? ForumModerated { get; set; } + + public bool? ForumDisplayEmails { get; set; } + + public bool? ForumRequireEmail { get; set; } + + public int? ForumAccess { get; set; } + + public int? ForumThreads { get; set; } + + public int? ForumPosts { get; set; } + + public DateTime? ForumLastPostTime { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserName { get; set; } + + [StringLength(200)] + public string? ForumBaseUrl { get; set; } + + public bool? ForumAllowChangeName { get; set; } + + [Column("ForumHTMLEditor")] + public bool? ForumHtmleditor { get; set; } + + [Column("ForumUseCAPTCHA")] + public bool? ForumUseCaptcha { get; set; } + + [Column("ForumGUID")] + public Guid? ForumGuid { get; set; } + + public DateTime? ForumLastModified { get; set; } + + [StringLength(200)] + public string? ForumUnsubscriptionUrl { get; set; } + + public bool? ForumIsLocked { get; set; } + + public string? ForumSettings { get; set; } + + public bool? ForumAuthorEdit { get; set; } + + public bool? ForumAuthorDelete { get; set; } + + public int? ForumType { get; set; } + + public int? ForumIsAnswerLimit { get; set; } + + public int? ForumImageMaxSideSize { get; set; } + + public DateTime? ForumLastPostTimeAbsolute { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserNameAbsolute { get; set; } + + public int? ForumPostsAbsolute { get; set; } + + public int? ForumThreadsAbsolute { get; set; } + + public int? ForumAttachmentMaxFileSize { get; set; } + + public int? ForumDiscussionActions { get; set; } + + [Column("ForumSiteID")] + public int? ForumSiteId { get; set; } + + [Column("GroupID")] + public int? GroupId { get; set; } + + [Column("GroupSiteID")] + public int? GroupSiteId { get; set; } + + [StringLength(200)] + public string? GroupName { get; set; } + + [StringLength(200)] + public string? GroupDisplayName { get; set; } + + public int? GroupOrder { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupGUID")] + public Guid? GroupGuid { get; set; } + + public DateTime? GroupLastModified { get; set; } + + [StringLength(200)] + public string? GroupBaseUrl { get; set; } + + [StringLength(200)] + public string? GroupUnsubscriptionUrl { get; set; } + + [Column("GroupGroupID")] + public int? GroupGroupId { get; set; } + + public bool? GroupAuthorEdit { get; set; } + + public bool? GroupAuthorDelete { get; set; } + + public int? GroupType { get; set; } + + public int? GroupIsAnswerLimit { get; set; } + + public int? GroupImageMaxSideSize { get; set; } + + public bool? GroupDisplayEmails { get; set; } + + public bool? GroupRequireEmail { get; set; } + + [Column("GroupHTMLEditor")] + public bool? GroupHtmleditor { get; set; } + + [Column("GroupUseCAPTCHA")] + public bool? GroupUseCaptcha { get; set; } + + public int? GroupAttachmentMaxFileSize { get; set; } + + public int? GroupDiscussionActions { get; set; } + + public int PostId { get; set; } + + [Column("PostForumID")] + public int PostForumId { get; set; } + + [Column("PostParentID")] + public int? PostParentId { get; set; } + + [Column("PostIDPath")] + [StringLength(450)] + public string PostIdpath { get; set; } = null!; + + public int PostLevel { get; set; } + + [StringLength(450)] + public string PostSubject { get; set; } = null!; + + [Column("PostUserID")] + public int? PostUserId { get; set; } + + [StringLength(200)] + public string PostUserName { get; set; } = null!; + + [StringLength(254)] + public string? PostUserMail { get; set; } + + public string? PostText { get; set; } + + public DateTime PostTime { get; set; } + + [Column("PostApprovedByUserID")] + public int? PostApprovedByUserId { get; set; } + + public int? PostThreadPosts { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserName { get; set; } + + public DateTime? PostThreadLastPostTime { get; set; } + + public string? PostUserSignature { get; set; } + + [Column("PostGUID")] + public Guid PostGuid { get; set; } + + public DateTime PostLastModified { get; set; } + + public bool? PostApproved { get; set; } + + public bool? PostIsLocked { get; set; } + + public int? PostIsAnswer { get; set; } + + public int PostStickOrder { get; set; } + + public int? PostViews { get; set; } + + public DateTime? PostLastEdit { get; set; } + + public string? PostInfo { get; set; } + + public int? PostAttachmentCount { get; set; } + + public int? PostType { get; set; } + + public int? PostThreadPostsAbsolute { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserNameAbsolute { get; set; } + + public DateTime? PostThreadLastPostTimeAbsolute { get; set; } + + public bool? PostQuestionSolved { get; set; } + + public int? PostIsNotAnswer { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs index d8f60e2b..e49897f2 100644 --- a/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewIntegrationTaskJoined.cs @@ -1,65 +1,64 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewIntegrationTaskJoined -{ - [Column("SynchronizationID")] - public int? SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int? SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int? SynchronizationConnectorId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewIntegrationTaskJoined +{ + [Column("SynchronizationID")] + public int? SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int? SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int? SynchronizationConnectorId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs index 54b2208a..8bc0b640 100644 --- a/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewMembershipMembershipUserJoined.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewMembershipMembershipUserJoined -{ - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - [Column("MembershipID")] - public int MembershipId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewMembershipMembershipUserJoined +{ + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + [Column("MembershipID")] + public int MembershipId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs b/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs index e973a903..ba13561e 100644 --- a/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs +++ b/Migration.Toolkit.K11/Models/ViewMessagingContactList.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewMessagingContactList -{ - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [Column("ContactListUserID")] - public int ContactListUserId { get; set; } - - [Column("ContactListContactUserID")] - public int ContactListContactUserId { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public int? UserAccountLockReason { get; set; } - - public bool UserEnabled { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewMessagingContactList +{ + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [Column("ContactListUserID")] + public int ContactListUserId { get; set; } + + [Column("ContactListContactUserID")] + public int ContactListContactUserId { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public int? UserAccountLockReason { get; set; } + + public bool UserEnabled { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs b/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs index 46f7a142..ea63aa7b 100644 --- a/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs +++ b/Migration.Toolkit.K11/Models/ViewMessagingIgnoreList.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewMessagingIgnoreList -{ - [Column("IgnoreListUserID")] - public int IgnoreListUserId { get; set; } - - [Column("IgnoreListIgnoredUserID")] - public int IgnoreListIgnoredUserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewMessagingIgnoreList +{ + [Column("IgnoreListUserID")] + public int IgnoreListUserId { get; set; } + + [Column("IgnoreListIgnoredUserID")] + public int IgnoreListIgnoredUserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs index 436c1646..4339f3af 100644 --- a/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewNewsletterSubscriptionsJoined.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewNewsletterSubscriptionsJoined -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - public int? SubscriberBounces { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewNewsletterSubscriptionsJoined +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + public int? SubscriberBounces { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs index 4447ca89..eaffc266 100644 --- a/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmAccountContactAccountJoined.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewOmAccountContactAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewOmAccountContactAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs index 437832a5..c5cbe210 100644 --- a/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmAccountContactContactJoined.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewOmAccountContactContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewOmAccountContactContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs index 26b7f8c5..d6b8536e 100644 --- a/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmAccountJoined.cs @@ -1,102 +1,101 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewOmAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [StringLength(100)] - public string? PrimaryContactFirstName { get; set; } - - [StringLength(100)] - public string? PrimaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? PrimaryContactLastName { get; set; } - - [StringLength(100)] - public string? SecondaryContactFirstName { get; set; } - - [StringLength(100)] - public string? SecondaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? SecondaryContactLastName { get; set; } - - [StringLength(200)] - public string? SubsidiaryOfName { get; set; } - - [StringLength(302)] - public string PrimaryContactFullName { get; set; } = null!; - - [StringLength(302)] - public string SecondaryContactFullName { get; set; } = null!; - - [StringLength(201)] - public string AccountFullAddress { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewOmAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [StringLength(100)] + public string? PrimaryContactFirstName { get; set; } + + [StringLength(100)] + public string? PrimaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? PrimaryContactLastName { get; set; } + + [StringLength(100)] + public string? SecondaryContactFirstName { get; set; } + + [StringLength(100)] + public string? SecondaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? SecondaryContactLastName { get; set; } + + [StringLength(200)] + public string? SubsidiaryOfName { get; set; } + + [StringLength(302)] + public string PrimaryContactFullName { get; set; } = null!; + + [StringLength(302)] + public string SecondaryContactFullName { get; set; } = null!; + + [StringLength(201)] + public string AccountFullAddress { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs index 58b9f7bc..646e8c00 100644 --- a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -1,78 +1,77 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewOmContactGroupMemberAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewOmContactGroupMemberAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs index fe59973a..9d0f959f 100644 --- a/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewOmContactGroupMemberContactJoined.cs @@ -1,101 +1,100 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewOmContactGroupMemberContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewOmContactGroupMemberContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs b/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs index aeef0bec..452759e6 100644 --- a/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs +++ b/Migration.Toolkit.K11/Models/ViewPollAnswerCount.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewPollAnswerCount -{ - [Column("PollID")] - public int PollId { get; set; } - - [StringLength(200)] - public string PollCodeName { get; set; } = null!; - - [StringLength(200)] - public string PollDisplayName { get; set; } = null!; - - [StringLength(100)] - public string? PollTitle { get; set; } - - public DateTime? PollOpenFrom { get; set; } - - public DateTime? PollOpenTo { get; set; } - - public bool PollAllowMultipleAnswers { get; set; } - - [StringLength(450)] - public string PollQuestion { get; set; } = null!; - - public int PollAccess { get; set; } - - [StringLength(450)] - public string? PollResponseMessage { get; set; } - - [Column("PollGUID")] - public Guid PollGuid { get; set; } - - public DateTime PollLastModified { get; set; } - - [Column("PollGroupID")] - public int? PollGroupId { get; set; } - - [Column("PollSiteID")] - public int? PollSiteId { get; set; } - - public bool? PollLogActivity { get; set; } - - public int? AnswerCount { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewPollAnswerCount +{ + [Column("PollID")] + public int PollId { get; set; } + + [StringLength(200)] + public string PollCodeName { get; set; } = null!; + + [StringLength(200)] + public string PollDisplayName { get; set; } = null!; + + [StringLength(100)] + public string? PollTitle { get; set; } + + public DateTime? PollOpenFrom { get; set; } + + public DateTime? PollOpenTo { get; set; } + + public bool PollAllowMultipleAnswers { get; set; } + + [StringLength(450)] + public string PollQuestion { get; set; } = null!; + + public int PollAccess { get; set; } + + [StringLength(450)] + public string? PollResponseMessage { get; set; } + + [Column("PollGUID")] + public Guid PollGuid { get; set; } + + public DateTime PollLastModified { get; set; } + + [Column("PollGroupID")] + public int? PollGroupId { get; set; } + + [Column("PollSiteID")] + public int? PollSiteId { get; set; } + + public bool? PollLogActivity { get; set; } + + public int? AnswerCount { get; set; } +} diff --git a/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs index 4734e9b7..afbb6e0c 100644 --- a/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs +++ b/Migration.Toolkit.K11/Models/ViewReportingCategoryReportJoined.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.K11.Models; - -[Keyless] -public partial class ViewReportingCategoryReportJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string CodeName { get; set; } = null!; - - [StringLength(440)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(651)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - public int? ReportAccess { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.K11.Models; + +[Keyless] +public class ViewReportingCategoryReportJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string CodeName { get; set; } = null!; + + [StringLength(440)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(651)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + public int? ReportAccess { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Toolkit.K11/SettingsKeys.cs b/Migration.Toolkit.K11/SettingsKeys.cs index e56a2578..f496b4d6 100644 --- a/Migration.Toolkit.K11/SettingsKeys.cs +++ b/Migration.Toolkit.K11/SettingsKeys.cs @@ -1,749 +1,750 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo -namespace Migration.Toolkit.K11; - -public static class SettingsKeys -{ - public const string CMSABTestingEnabled = "CMSABTestingEnabled"; - public const string CMSAccessDeniedPageURL = "CMSAccessDeniedPageURL"; - public const string CMSActivityPointsForBlogCommentPost = "CMSActivityPointsForBlogCommentPost"; - public const string CMSActivityPointsForBlogPost = "CMSActivityPointsForBlogPost"; - public const string CMSActivityPointsForForumPost = "CMSActivityPointsForForumPost"; - public const string CMSActivityPointsForMessageBoardPost = "CMSActivityPointsForMessageBoardPost"; - public const string CMSActivityTrackedExtensions = "CMSActivityTrackedExtensions"; - public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; - public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; - public const string CMSAllowComponentsCSS = "CMSAllowComponentsCSS"; - public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; - public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; - public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; - public const string CMSAllowGZip = "CMSAllowGZip"; - public const string CMSAllowOnSiteEditing = "CMSAllowOnSiteEditing"; - public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; - public const string CMSAllowPreviewMode = "CMSAllowPreviewMode"; - public const string CMSAllowUrlsWithoutLanguagePrefixes = "CMSAllowUrlsWithoutLanguagePrefixes"; - public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; - public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; - public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; - public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; - public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; - public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; - public const string CMSAnalyticsExcludedFileExtensions = "CMSAnalyticsExcludedFileExtensions"; - public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; - public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; - public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; - public const string CMSAnalyticsTrackAggregatedViews = "CMSAnalyticsTrackAggregatedViews"; - public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; - public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; - public const string CMSAnalyticsTrackFileDownloads = "CMSAnalyticsTrackFileDownloads"; - public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; - public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; - public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; - public const string CMSAnalyticsTrackRegisteredUsers = "CMSAnalyticsTrackRegisteredUsers"; - public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; - public const string CMSAnalyticsVisitorsSmartCheck = "CMSAnalyticsVisitorsSmartCheck"; - public const string CMSApplicationHealthMonitoringInterval = "CMSApplicationHealthMonitoringInterval"; - public const string CMSApplicationID = "CMSApplicationID"; - public const string CMSApplicationSecret = "CMSApplicationSecret"; - public const string CMSApplicationState = "CMSApplicationState"; - public const string CMSArchiveEmails = "CMSArchiveEmails"; - public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; - public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; - public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; - public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; - public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; - public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; - public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; - public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; - public const string CMSAvatarHeight = "CMSAvatarHeight"; - public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; - public const string CMSAvatarType = "CMSAvatarType"; - public const string CMSAvatarWidth = "CMSAvatarWidth"; - public const string CMSBadWordsAction = "CMSBadWordsAction"; - public const string CMSBadWordsReplacement = "CMSBadWordsReplacement"; - public const string CMSBannedIPEnabled = "CMSBannedIPEnabled"; - public const string CMSBannedIPRedirectURL = "CMSBannedIPRedirectURL"; - public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; - public const string CMSBitlyLogin = "CMSBitlyLogin"; - public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; - public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; - public const string CMSBlogEnableOptIn = "CMSBlogEnableOptIn"; - public const string CMSBlogEnableOptInConfirmation = "CMSBlogEnableOptInConfirmation"; - public const string CMSBlogOptInApprovalPath = "CMSBlogOptInApprovalPath"; - public const string CMSBlogOptInInterval = "CMSBlogOptInInterval"; - public const string CMSBlogsUnsubscriptionUrl = "CMSBlogsUnsubscriptionUrl"; - public const string CMSBoardBaseUrl = "CMSBoardBaseUrl"; - public const string CMSBoardEnableOptIn = "CMSBoardEnableOptIn"; - public const string CMSBoardEnableOptInConfirmation = "CMSBoardEnableOptInConfirmation"; - public const string CMSBoardOptInApprovalPath = "CMSBoardOptInApprovalPath"; - public const string CMSBoardOptInInterval = "CMSBoardOptInInterval"; - public const string CMSBoardUnsubsriptionURL = "CMSBoardUnsubsriptionURL"; - public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; - public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; - public const string CMSCacheImages = "CMSCacheImages"; - public const string CMSCacheMinutes = "CMSCacheMinutes"; - public const string CMSCachePageInfo = "CMSCachePageInfo"; - public const string CMSCampaignNewPageLocation = "CMSCampaignNewPageLocation"; - public const string CMSCaptchaControl = "CMSCaptchaControl"; - public const string CMSChatAllowAnonymGlobally = "CMSChatAllowAnonymGlobally"; - public const string CMSChatDaysNeededToDeleteRecods = "CMSChatDaysNeededToDeleteRecods"; - public const string CMSChatDisplayAnnouncementAtFirstLoad = "CMSChatDisplayAnnouncementAtFirstLoad"; - public const string CMSChatDisplayChangeNicknameAtFirstLoad = "CMSChatDisplayChangeNicknameAtFirstLoad"; - public const string CMSChatDisplayEnterAtFirstLoad = "CMSChatDisplayEnterAtFirstLoad"; - public const string CMSChatDisplayInvitedAtFirstLoad = "CMSChatDisplayInvitedAtFirstLoad"; - public const string CMSChatDisplayKickAtFirstLoad = "CMSChatDisplayKickAtFirstLoad"; - public const string CMSChatDisplayLeaveAtFirstLoad = "CMSChatDisplayLeaveAtFirstLoad"; - public const string CMSChatDisplaySupportGreetingAtFirstLoad = "CMSChatDisplaySupportGreetingAtFirstLoad"; - public const string CMSChatEnableBBCode = "CMSChatEnableBBCode"; - public const string CMSChatEnableFloodProtection = "CMSChatEnableFloodProtection"; - public const string CMSChatEnableSmileys = "CMSChatEnableSmileys"; - public const string CMSChatEnableSoundLiveChat = "CMSChatEnableSoundLiveChat"; - public const string CMSChatEnableSoundSupportChat = "CMSChatEnableSoundSupportChat"; - public const string CMSChatErrorDeleteAllTrans = "CMSChatErrorDeleteAllTrans"; - public const string CMSChatErrorTrans = "CMSChatErrorTrans"; - public const string CMSChatFirstLoadMessagesCount = "CMSChatFirstLoadMessagesCount"; - public const string CMSChatFloodProtectionChangeNickname = "CMSChatFloodProtectionChangeNickname"; - public const string CMSChatFloodProtectionCreateRoom = "CMSChatFloodProtectionCreateRoom"; - public const string CMSChatFloodProtectionJoinRoom = "CMSChatFloodProtectionJoinRoom"; - public const string CMSChatFloodProtectionPostMessage = "CMSChatFloodProtectionPostMessage"; - public const string CMSChatForceAnonymUniqueNicknames = "CMSChatForceAnonymUniqueNicknames"; - public const string CMSChatGlobalPingInterval = "CMSChatGlobalPingInterval"; - public const string CMSChatGuestPrefix = "CMSChatGuestPrefix"; - public const string CMSChatInitiatedChatTrans = "CMSChatInitiatedChatTrans"; - public const string CMSChatKickLastingTime = "CMSChatKickLastingTime"; - public const string CMSChatMaximumMessageLength = "CMSChatMaximumMessageLength"; - public const string CMSChatNotificationTrans = "CMSChatNotificationTrans"; - public const string CMSChatOnlineUserTrans = "CMSChatOnlineUserTrans"; - public const string CMSChatRedirectURLJoin = "CMSChatRedirectURLJoin"; - public const string CMSChatRedirectURLLeave = "CMSChatRedirectURLLeave"; - public const string CMSChatRedirectURLLogin = "CMSChatRedirectURLLogin"; - public const string CMSChatRedirectURLLogout = "CMSChatRedirectURLLogout"; - public const string CMSChatResolveURLEnabled = "CMSChatResolveURLEnabled"; - public const string CMSChatRoomMessageTrans = "CMSChatRoomMessageTrans"; - public const string CMSChatRoomNameTrans = "CMSChatRoomNameTrans"; - public const string CMSChatRoomPingInterval = "CMSChatRoomPingInterval"; - public const string CMSChatRoomPopupWindow = "CMSChatRoomPopupWindow"; - public const string CMSChatRoomTrans = "CMSChatRoomTrans"; - public const string CMSChatRoomUserTrans = "CMSChatRoomUserTrans"; - public const string CMSChatSendSupportMessagesTo = "CMSChatSendSupportMessagesTo"; - public const string CMSChatSupportEnabled = "CMSChatSupportEnabled"; - public const string CMSChatSupportEngineerLogoutTimeout = "CMSChatSupportEngineerLogoutTimeout"; - public const string CMSChatSupportRequestTrans = "CMSChatSupportRequestTrans"; - public const string CMSChatSupportTakenRoomReleaseTimeout = "CMSChatSupportTakenRoomReleaseTimeout"; - public const string CMSChatUserLogoutTimeout = "CMSChatUserLogoutTimeout"; - public const string CMSChatWPDefaultGroupPagesBy = "CMSChatWPDefaultGroupPagesBy"; - public const string CMSChatWPDefaultInviteModePagingItems = "CMSChatWPDefaultInviteModePagingItems"; - public const string CMSChatWPDefaultInviteModeSearchMode = "CMSChatWPDefaultInviteModeSearchMode"; - public const string CMSChatWPDefaultPagingItems = "CMSChatWPDefaultPagingItems"; - public const string CMSChatWPDefaultSearchOnlineMaxUsers = "CMSChatWPDefaultSearchOnlineMaxUsers"; - public const string CMSChatWPDefaultShowFilterLimit = "CMSChatWPDefaultShowFilterLimit"; - public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; - public const string CMSCheckBadWords = "CMSCheckBadWords"; - public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; - public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; - public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; - public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; - public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; - public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; - public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; - public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; - public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; - public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; - public const string CMSCMBlogPostComments = "CMSCMBlogPostComments"; - public const string CMSCMBlogPostSubscription = "CMSCMBlogPostSubscription"; - public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; - public const string CMSCMContentRating = "CMSCMContentRating"; - public const string CMSCMCustomActivities = "CMSCMCustomActivities"; - public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; - public const string CMSCMEmailOpening = "CMSCMEmailOpening"; - public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; - public const string CMSCMEventBooking = "CMSCMEventBooking"; - public const string CMSCMExternalSearch = "CMSCMExternalSearch"; - public const string CMSCMForumPosts = "CMSCMForumPosts"; - public const string CMSCMForumPostSubscription = "CMSCMForumPostSubscription"; - public const string CMSCMGeoCity = "CMSCMGeoCity"; - public const string CMSCMGeoCountry = "CMSCMGeoCountry"; - public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; - public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; - public const string CMSCMGeoMetro = "CMSCMGeoMetro"; - public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; - public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; - public const string CMSCMGeoPostal = "CMSCMGeoPostal"; - public const string CMSCMGeoState = "CMSCMGeoState"; - public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; - public const string CMSCMLandingPage = "CMSCMLandingPage"; - public const string CMSCMMessageBoardPosts = "CMSCMMessageBoardPosts"; - public const string CMSCMMessageBoardSubscription = "CMSCMMessageBoardSubscription"; - public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; - public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; - public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; - public const string CMSCMPageVisits = "CMSCMPageVisits"; - public const string CMSCMPollVoting = "CMSCMPollVoting"; - public const string CMSCMPurchase = "CMSCMPurchase"; - public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; - public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; - public const string CMSCMSearch = "CMSCMSearch"; - public const string CMSCMStamp = "CMSCMStamp"; - public const string CMSCMUserLogin = "CMSCMUserLogin"; - public const string CMSCMUserRegistration = "CMSCMUserRegistration"; - public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; - public const string CMSCombineComponentsCSS = "CMSCombineComponentsCSS"; - public const string CMSCombineImagesWithDefaultCulture = "CMSCombineImagesWithDefaultCulture"; - public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; - public const string CMSConfirmChanges = "CMSConfirmChanges"; - public const string CMSContentImageWatermark = "CMSContentImageWatermark"; - public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; - public const string CMSControlElement = "CMSControlElement"; - public const string CMSConvertTablesToDivs = "CMSConvertTablesToDivs"; - public const string CMSDataVersion = "CMSDataVersion"; - public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; - public const string CMSDBVersion = "CMSDBVersion"; - public const string CMSDebugAllCache = "CMSDebugAllCache"; - public const string CMSDebugAllFiles = "CMSDebugAllFiles"; - public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; - public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; - public const string CMSDebugAllMacros = "CMSDebugAllMacros"; - public const string CMSDebugAllOutput = "CMSDebugAllOutput"; - public const string CMSDebugAllRequests = "CMSDebugAllRequests"; - public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; - public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; - public const string CMSDebugAllViewState = "CMSDebugAllViewState"; - public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; - public const string CMSDebugAnalytics = "CMSDebugAnalytics"; - public const string CMSDebugAnalyticsLive = "CMSDebugAnalyticsLive"; - public const string CMSDebugAnalyticsLogLength = "CMSDebugAnalyticsLogLength"; - public const string CMSDebugAnalyticsStack = "CMSDebugAnalyticsStack"; - public const string CMSDebugCache = "CMSDebugCache"; - public const string CMSDebugCacheLive = "CMSDebugCacheLive"; - public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; - public const string CMSDebugCacheStack = "CMSDebugCacheStack"; - public const string CMSDebugEverything = "CMSDebugEverything"; - public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; - public const string CMSDebugEverythingLive = "CMSDebugEverythingLive"; - public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; - public const string CMSDebugFiles = "CMSDebugFiles"; - public const string CMSDebugFilesLive = "CMSDebugFilesLive"; - public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; - public const string CMSDebugFilesStack = "CMSDebugFilesStack"; - public const string CMSDebugHandlers = "CMSDebugHandlers"; - public const string CMSDebugHandlersLive = "CMSDebugHandlersLive"; - public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; - public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; - public const string CMSDebugImportExport = "CMSDebugImportExport"; - public const string CMSDebugMacros = "CMSDebugMacros"; - public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; - public const string CMSDebugMacrosLive = "CMSDebugMacrosLive"; - public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; - public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; - public const string CMSDebugOutput = "CMSDebugOutput"; - public const string CMSDebugOutputLive = "CMSDebugOutputLive"; - public const string CMSDebugOutputLogLength = "CMSDebugOutputLogLength"; - public const string CMSDebugRequests = "CMSDebugRequests"; - public const string CMSDebugRequestsLive = "CMSDebugRequestsLive"; - public const string CMSDebugRequestsLogLength = "CMSDebugRequestsLogLength"; - public const string CMSDebugRequestsStack = "CMSDebugRequestsStack"; - public const string CMSDebugResources = "CMSDebugResources"; - public const string CMSDebugScheduler = "CMSDebugScheduler"; - public const string CMSDebugSecurity = "CMSDebugSecurity"; - public const string CMSDebugSecurityLive = "CMSDebugSecurityLive"; - public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; - public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; - public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; - public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; - public const string CMSDebugSQLQueriesLive = "CMSDebugSQLQueriesLive"; - public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; - public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; - public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; - public const string CMSDebugViewState = "CMSDebugViewState"; - public const string CMSDebugViewStateLive = "CMSDebugViewStateLive"; - public const string CMSDebugViewStateLogLength = "CMSDebugViewStateLogLength"; - public const string CMSDebugWebFarm = "CMSDebugWebFarm"; - public const string CMSDebugWebFarmLive = "CMSDebugWebFarmLive"; - public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; - public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; - public const string CMSDefaulPage = "CMSDefaulPage"; - public const string CMSDefaultAliasPath = "CMSDefaultAliasPath"; - public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; - public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; - public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; - public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; - public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; - public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; - public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; - public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; - public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; - public const string CMSDefaultControlForText = "CMSDefaultControlForText"; - public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; - public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; - public const string CMSDefaultDeletedNodePath = "CMSDefaultDeletedNodePath"; - public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; - public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; - public const string CMSDefaultUrlPathPrefix = "CMSDefaultUrlPathPrefix"; - public const string CMSDefaultUserID = "CMSDefaultUserID"; - public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; - public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; - public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; - public const string CMSDenyLoginInterval = "CMSDenyLoginInterval"; - public const string CMSDepartmentTemplatePath = "CMSDepartmentTemplatePath"; - public const string CMSDeploymentMode = "CMSDeploymentMode"; - public const string CMSDeviceProfilesEnable = "CMSDeviceProfilesEnable"; - public const string CMSDisableDebug = "CMSDisableDebug"; - public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; - public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; - public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; - public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; - public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; - public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; - public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; - public const string CMSDisplayRedirectedIcon = "CMSDisplayRedirectedIcon"; - public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; - public const string CMSEmailBatchSize = "CMSEmailBatchSize"; - public const string CMSEmailEncoding = "CMSEmailEncoding"; - public const string CMSEmailFormat = "CMSEmailFormat"; - public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; - public const string CMSEmailsEnabled = "CMSEmailsEnabled"; - public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; - public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; - public const string CMSEnableCI = "CMSEnableCI"; - public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; - public const string CMSEnableDefaultAvatars = "CMSEnableDefaultAvatars"; - public const string CMSEnableFacebookConnect = "CMSEnableFacebookConnect"; - public const string CMSEnableHealthMonitoring = "CMSEnableHealthMonitoring"; - public const string CMSEnableLinkedIn = "CMSEnableLinkedIn"; - public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; - public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; - public const string CMSEnableOpenID = "CMSEnableOpenID"; - public const string CMSEnableOutputCache = "CMSEnableOutputCache"; - public const string CMSEnablePartialCache = "CMSEnablePartialCache"; - public const string CMSEnableSiteCounters = "CMSEnableSiteCounters"; - public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; - public const string CMSEnableTranslations = "CMSEnableTranslations"; - public const string CMSEnableUserCounts = "CMSEnableUserCounts"; - public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; - public const string CMSEnableVersioningCMSCssStylesheet = "CMSEnableVersioningCMSCssStylesheet"; - public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; - public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; - public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; - public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; - public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; - public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; - public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; - public const string CMSEnableVersioningCMSTemplateDeviceLayout = "CMSEnableVersioningCMSTemplateDeviceLayout"; - public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; - public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; - public const string CMSEnableVersioningCMSWebPartContainer = "CMSEnableVersioningCMSWebPartContainer"; - public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; - public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; - public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; - public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; - public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; - public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; - public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; - public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; - public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; - public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; - public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; - public const string CMSEnableWebDAV = "CMSEnableWebDAV"; - public const string CMSEnableWindowsLiveID = "CMSEnableWindowsLiveID"; - public const string CMSEventManagerInvitationFrom = "CMSEventManagerInvitationFrom"; - public const string CMSEventManagerInvitationSubject = "CMSEventManagerInvitationSubject"; - public const string CMSEventManagerSenderName = "CMSEventManagerSenderName"; - public const string CMSExcludedAttributesFilterURLs = "CMSExcludedAttributesFilterURLs"; - public const string CMSExcludedFormFilterURLs = "CMSExcludedFormFilterURLs"; - public const string CMSExcludedHTML5FilterURLs = "CMSExcludedHTML5FilterURLs"; - public const string CMSExcludedJavascriptFilterURLs = "CMSExcludedJavascriptFilterURLs"; - public const string CMSExcludedLowercaseFilterURLs = "CMSExcludedLowercaseFilterURLs"; - public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; - public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; - public const string CMSExcludedResolveFilterURLs = "CMSExcludedResolveFilterURLs"; - public const string CMSExcludedSelfcloseFilterURLs = "CMSExcludedSelfcloseFilterURLs"; - public const string CMSExcludedURLs = "CMSExcludedURLs"; - public const string CMSExcludedXHTMLFilterURLs = "CMSExcludedXHTMLFilterURLs"; - public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; - public const string CMSFacebookApplicationSecret = "CMSFacebookApplicationSecret"; - public const string CMSFacebookConnectApiKey = "CMSFacebookConnectApiKey"; - public const string CMSFacebookMapUserProfile = "CMSFacebookMapUserProfile"; - public const string CMSFacebookRoles = "CMSFacebookRoles"; - public const string CMSFacebookUserMapping = "CMSFacebookUserMapping"; - public const string CMSFaviconPath = "CMSFaviconPath"; - public const string CMSFilesFolder = "CMSFilesFolder"; - public const string CMSFilesFriendlyURLExtension = "CMSFilesFriendlyURLExtension"; - public const string CMSFilesLocationType = "CMSFilesLocationType"; - public const string CMSFileSystemOutputCacheMinutes = "CMSFileSystemOutputCacheMinutes"; - public const string CMSFloodInterval = "CMSFloodInterval"; - public const string CMSFloodProtectionEnabled = "CMSFloodProtectionEnabled"; - public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; - public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; - public const string CMSForumAttachmentExtensions = "CMSForumAttachmentExtensions"; - public const string CMSForumBaseUrl = "CMSForumBaseUrl"; - public const string CMSForumEnableOptIn = "CMSForumEnableOptIn"; - public const string CMSForumEnableOptInConfirmation = "CMSForumEnableOptInConfirmation"; - public const string CMSForumMaxPostNode = "CMSForumMaxPostNode"; - public const string CMSForumOptInApprovalPath = "CMSForumOptInApprovalPath"; - public const string CMSForumOptInInterval = "CMSForumOptInInterval"; - public const string CMSForumUnsubscriptionUrl = "CMSForumUnsubscriptionUrl"; - public const string CMSFriendlyURLExtension = "CMSFriendlyURLExtension"; - public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; - public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; - public const string CMSGoogleSitemapURL = "CMSGoogleSitemapURL"; - public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; - public const string CMSGravatarDefaultImage = "CMSGravatarDefaultImage"; - public const string CMSGravatarRating = "CMSGravatarRating"; - public const string CMSGroupAvatarHeight = "CMSGroupAvatarHeight"; - public const string CMSGroupAvatarMaxSideSize = "CMSGroupAvatarMaxSideSize"; - public const string CMSGroupAvatarWidth = "CMSGroupAvatarWidth"; - public const string CMSGroupManagementPath = "CMSGroupManagementPath"; - public const string CMSGroupProfilePath = "CMSGroupProfilePath"; - public const string CMSGroupsSecurityAccessPath = "CMSGroupsSecurityAccessPath"; - public const string CMSGroupTemplatePath = "CMSGroupTemplatePath"; - public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; - public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; - public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; - public const string CMSHotfixVersion = "CMSHotfixVersion"; - public const string CMSImageWatermark = "CMSImageWatermark"; - public const string CMSImageWatermarkPosition = "CMSImageWatermarkPosition"; - public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; - public const string CMSIndentOutputHtml = "CMSIndentOutputHtml"; - public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; - public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; - public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; - public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; - public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; - public const string CMSInvitationAcceptationPath = "CMSInvitationAcceptationPath"; - public const string CMSInvitationValidity = "CMSInvitationValidity"; - public const string CMSKeepChangedDocumentAccesible = "CMSKeepChangedDocumentAccesible"; - public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; - public const string CMSLayoutMappingEnable = "CMSLayoutMappingEnable"; - public const string CMSLinkedInAccessToken = "CMSLinkedInAccessToken"; - public const string CMSLinkedInApiKey = "CMSLinkedInApiKey"; - public const string CMSLinkedInApplicationSecret = "CMSLinkedInApplicationSecret"; - public const string CMSLinkedInRoles = "CMSLinkedInRoles"; - public const string CMSLinkedInSignInPermissionScope = "CMSLinkedInSignInPermissionScope"; - public const string CMSLiveIDRequiredUserDataPage = "CMSLiveIDRequiredUserDataPage"; - public const string CMSLiveIDRoles = "CMSLiveIDRoles"; - public const string CMSLogAnalytics = "CMSLogAnalytics"; - public const string CMSLogCache = "CMSLogCache"; - public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; - public const string CMSLogFiles = "CMSLogFiles"; - public const string CMSLogHandlers = "CMSLogHandlers"; - public const string CMSLogMacros = "CMSLogMacros"; - public const string CMSLogMetadata = "CMSLogMetadata"; - public const string CMSLogOutput = "CMSLogOutput"; - public const string CMSLogPageNotFoundException = "CMSLogPageNotFoundException"; - public const string CMSLogRequests = "CMSLogRequests"; - public const string CMSLogSecurity = "CMSLogSecurity"; - public const string CMSLogSize = "CMSLogSize"; - public const string CMSLogSQLQueries = "CMSLogSQLQueries"; - public const string CMSLogToDatabase = "CMSLogToDatabase"; - public const string CMSLogToFileSystem = "CMSLogToFileSystem"; - public const string CMSLogToTrace = "CMSLogToTrace"; - public const string CMSLogViewState = "CMSLogViewState"; - public const string CMSLogWebFarm = "CMSLogWebFarm"; - public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; - public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; - public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; - public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; - public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; - public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; - public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; - public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; - public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; - public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; - public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; - public const string CMSMediaImageWatermark = "CMSMediaImageWatermark"; - public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; - public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; - public const string CMSMediaUsePermanentURLs = "CMSMediaUsePermanentURLs"; - public const string CMSMemberManagementPath = "CMSMemberManagementPath"; - public const string CMSMemberProfilePath = "CMSMemberProfilePath"; - public const string CMSMembershipReminder = "CMSMembershipReminder"; - public const string CMSMetaImageWatermark = "CMSMetaImageWatermark"; - public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; - public const string CMSMFEnabled = "CMSMFEnabled"; - public const string CMSMFRequired = "CMSMFRequired"; - public const string CMSMinWatermarkImageHeight = "CMSMinWatermarkImageHeight"; - public const string CMSMinWatermarkImageWidth = "CMSMinWatermarkImageWidth"; - public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; - public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; - public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; - public const string CMSMoveViewStateToEnd = "CMSMoveViewStateToEnd"; - public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; - public const string CMSMVTEnabled = "CMSMVTEnabled"; - public const string CMSMyAccountURL = "CMSMyAccountURL"; - public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; - public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; - public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; - public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; - public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; - public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; - public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; - public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; - public const string CMSOnSiteEditButton = "CMSOnSiteEditButton"; - public const string CMSOpenIDRoles = "CMSOpenIDRoles"; - public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; - public const string CMSOptInInterval = "CMSOptInInterval"; - public const string CMSOutputCacheItems = "CMSOutputCacheItems"; - public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; - public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; - public const string CMSPageNotFoundForNonPublished = "CMSPageNotFoundForNonPublished"; - public const string CMSPageNotFoundUrl = "CMSPageNotFoundUrl"; - public const string CMSPageTitleFormat = "CMSPageTitleFormat"; - public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; - public const string CMSPartialCacheItems = "CMSPartialCacheItems"; - public const string CMSPasswordExpiration = "CMSPasswordExpiration"; - public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; - public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; - public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; - public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; - public const string CMSPasswordFormat = "CMSPasswordFormat"; - public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; - public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; - public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; - public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; - public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; - public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; - public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; - public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; - public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; - public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; - public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; - public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; - public const string CMSPollsAllowGlobal = "CMSPollsAllowGlobal"; - public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; - public const string CMSPOP3Password = "CMSPOP3Password"; - public const string CMSPOP3ServerName = "CMSPOP3ServerName"; - public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; - public const string CMSPOP3UserName = "CMSPOP3UserName"; - public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; - public const string CMSPriceRounding = "CMSPriceRounding"; - public const string CMSProcessDomainPrefix = "CMSProcessDomainPrefix"; - public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; - public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; - public const string CMSRedirectAliasesToMainURL = "CMSRedirectAliasesToMainURL"; - public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; - public const string CMSRedirectInvalidCasePages = "CMSRedirectInvalidCasePages"; - public const string CMSRedirectToMainExtension = "CMSRedirectToMainExtension"; - public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; - public const string CMSRegistrationApprovalPath = "CMSRegistrationApprovalPath"; - public const string CMSRegistrationEmailConfirmation = "CMSRegistrationEmailConfirmation"; - public const string CMSRememberUniGridState = "CMSRememberUniGridState"; - public const string CMSRequiredLinkedInPage = "CMSRequiredLinkedInPage"; - public const string CMSRequiredOpenIDPage = "CMSRequiredOpenIDPage"; - public const string CMSReservedUserNames = "CMSReservedUserNames"; - public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; - public const string CMSResetPasswordURL = "CMSResetPasswordURL"; - public const string CMSResizeImagesToDevice = "CMSResizeImagesToDevice"; - public const string CMSResolveMacrosInCSS = "CMSResolveMacrosInCSS"; - public const string CMSResourceCompressionEnabled = "CMSResourceCompressionEnabled"; - public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; - public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; - public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; - public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; - public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; - public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; - public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; - public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; - public const string CMSRestoreObjects = "CMSRestoreObjects"; - public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; - public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; - public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; - public const string CMSRobotsPath = "CMSRobotsPath"; - public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; - public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; - public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; - public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; - public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; - public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; - public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; - public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; - public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; - public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; - public const string CMSSchedulerInterval = "CMSSchedulerInterval"; - public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; - public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; - public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; - public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; - public const string CMSScreenLockInterval = "CMSScreenLockInterval"; - public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; - public const string CMSScriptMinificationEnabled = "CMSScriptMinificationEnabled"; - public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; - public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; - public const string CMSSecuredAreasLogonPage = "CMSSecuredAreasLogonPage"; - public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; - public const string CMSSendBlogEmailsFrom = "CMSSendBlogEmailsFrom"; - public const string CMSSendBoardEmailsFrom = "CMSSendBoardEmailsFrom"; - public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; - public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; - public const string CMSSendForumEmailsFrom = "CMSSendForumEmailsFrom"; - public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; - public const string CMSSendPasswordResetConfirmation = "CMSSendPasswordResetConfirmation"; - public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; - public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; - public const string CMSServerTimeZone = "CMSServerTimeZone"; - public const string CMSServiceHealthMonitoringInterval = "CMSServiceHealthMonitoringInterval"; - public const string CMSSessionManagerSchedulerInterval = "CMSSessionManagerSchedulerInterval"; - public const string CMSSessionUseDBRepository = "CMSSessionUseDBRepository"; - public const string CMSSharePointCache = "CMSSharePointCache"; - public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; - public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; - public const string CMSShoppingCartURL = "CMSShoppingCartURL"; - public const string CMSSitemapPath = "CMSSitemapPath"; - public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; - public const string CMSSiteTimeZone = "CMSSiteTimeZone"; - public const string CMSSMTPServer = "CMSSMTPServer"; - public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; - public const string CMSSMTPServerTip = "CMSSMTPServerTip"; - public const string CMSSMTPServerUser = "CMSSMTPServerUser"; - public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; - public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; - public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; - public const string CMSStagingLogChanges = "CMSStagingLogChanges"; - public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; - public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; - public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; - public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; - public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; - public const string CMSStagingServicePassword = "CMSStagingServicePassword"; - public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; - public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; - public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; - public const string CMSStoreAddToShoppingCartConversionName = "CMSStoreAddToShoppingCartConversionName"; - public const string CMSStoreAddToShoppingCartConversionValue = "CMSStoreAddToShoppingCartConversionValue"; - public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; - public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; - public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; - public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; - public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; - public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; - public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; - public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; - public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; - public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; - public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; - public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; - public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; - public const string CMSStoreCSSStylesheetsInFS = "CMSStoreCSSStylesheetsInFS"; - public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; - public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; - public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; - public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; - public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; - public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; - public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; - public const string CMSStoreMassUnit = "CMSStoreMassUnit"; - public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; - public const string CMSStoreOrderConversionName = "CMSStoreOrderConversionName"; - public const string CMSStoreOrderConversionValue = "CMSStoreOrderConversionValue"; - public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; - public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; - public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; - public const string CMSStoreProductsTree = "CMSStoreProductsTree"; - public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; - public const string CMSStoreRegistrationConversionName = "CMSStoreRegistrationConversionName"; - public const string CMSStoreRegistrationConversionValue = "CMSStoreRegistrationConversionValue"; - public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; - public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; - public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; - public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; - public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; - public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; - public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; - public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; - public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; - public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; - public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; - public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; - public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; - public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; - public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; - public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; - public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; - public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; - public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; - public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; - public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; - public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; - public const string CMSStrandsAPIID = "CMSStrandsAPIID"; - public const string CMSStrandsAutomaticCatalogUploadEnabled = "CMSStrandsAutomaticCatalogUploadEnabled"; - public const string CMSStrandsAutomaticUploadFrequency = "CMSStrandsAutomaticUploadFrequency"; - public const string CMSStrandsCatalogFeedPassword = "CMSStrandsCatalogFeedPassword"; - public const string CMSStrandsCatalogFeedUsername = "CMSStrandsCatalogFeedUsername"; - public const string CMSStrandsCatalogTransformation = "CMSStrandsCatalogTransformation"; - public const string CMSStrandsCatalogWhereCondition = "CMSStrandsCatalogWhereCondition"; - public const string CMSStrandsDocumentTypes = "CMSStrandsDocumentTypes"; - public const string CMSStrandsPath = "CMSStrandsPath"; - public const string CMSStrandsValidationToken = "CMSStrandsValidationToken"; - public const string CMSStylesheetMinificationEnabled = "CMSStylesheetMinificationEnabled"; - public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; - public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; - public const string CMSTrackExitPages = "CMSTrackExitPages"; - public const string CMSTrackLandingPages = "CMSTrackLandingPages"; - public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; - public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; - public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; - public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; - public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; - public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; - public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; - public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; - public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; - public const string CMSTranslateWebpartProperties = "CMSTranslateWebpartProperties"; - public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; - public const string CMSTranslationsComPassword = "CMSTranslationsComPassword"; - public const string CMSTranslationsComProjectCode = "CMSTranslationsComProjectCode"; - public const string CMSTranslationsComURL = "CMSTranslationsComURL"; - public const string CMSTranslationsComUserName = "CMSTranslationsComUserName"; - public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; - public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; - public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; - public const string CMSUploadExtensions = "CMSUploadExtensions"; - public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; - public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; - public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; - public const string CMSUseDomainForCulture = "CMSUseDomainForCulture"; - public const string CMSUseEventLogListener = "CMSUseEventLogListener"; - public const string CMSUseExternalService = "CMSUseExternalService"; - public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; - public const string CMSUseLangPrefixForUrls = "CMSUseLangPrefixForUrls"; - public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; - public const string CMSUseNamePathForUrlPath = "CMSUseNamePathForUrlPath"; - public const string CMSUseNoFollowForUsersLinks = "CMSUseNoFollowForUsersLinks"; - public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; - public const string CMSUseParentGroupIDForNewDocuments = "CMSUseParentGroupIDForNewDocuments"; - public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; - public const string CMSUsePermanentRedirect = "CMSUsePermanentRedirect"; - public const string CMSUsePermanentURLs = "CMSUsePermanentURLs"; - public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; - public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; - public const string CMSUseSessionManagement = "CMSUseSessionManagement"; - public const string CMSUseSitePrefixForUserName = "CMSUseSitePrefixForUserName"; - public const string CMSUseSSL = "CMSUseSSL"; - public const string CMSUseSSLForAdministrationInterface = "CMSUseSSLForAdministrationInterface"; - public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; - public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; - public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; - public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; - public const string CMSWebAnalyticsUseJavascriptLogging = "CMSWebAnalyticsUseJavascriptLogging"; - public const string CMSWebDAVExtensions = "CMSWebDAVExtensions"; - public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; - public const string CMSWebFarmMode = "CMSWebFarmMode"; - public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; - public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; - public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; - public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; - public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; - public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; - public const string CMSWebFarmSynchronizeForumAttachments = "CMSWebFarmSynchronizeForumAttachments"; - public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; - public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; - public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; - public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; - public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; - public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; - public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; - public const string CMSWIFEnabled = "CMSWIFEnabled"; - public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; - public const string CMSWIFRealm = "CMSWIFRealm"; - public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; - public const string CMSWishlistURL = "CMSWishlistURL"; -} \ No newline at end of file +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo + +namespace Migration.Toolkit.K11; + +public static class SettingsKeys +{ + public const string CMSABTestingEnabled = "CMSABTestingEnabled"; + public const string CMSAccessDeniedPageURL = "CMSAccessDeniedPageURL"; + public const string CMSActivityPointsForBlogCommentPost = "CMSActivityPointsForBlogCommentPost"; + public const string CMSActivityPointsForBlogPost = "CMSActivityPointsForBlogPost"; + public const string CMSActivityPointsForForumPost = "CMSActivityPointsForForumPost"; + public const string CMSActivityPointsForMessageBoardPost = "CMSActivityPointsForMessageBoardPost"; + public const string CMSActivityTrackedExtensions = "CMSActivityTrackedExtensions"; + public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; + public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; + public const string CMSAllowComponentsCSS = "CMSAllowComponentsCSS"; + public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; + public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; + public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; + public const string CMSAllowGZip = "CMSAllowGZip"; + public const string CMSAllowOnSiteEditing = "CMSAllowOnSiteEditing"; + public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; + public const string CMSAllowPreviewMode = "CMSAllowPreviewMode"; + public const string CMSAllowUrlsWithoutLanguagePrefixes = "CMSAllowUrlsWithoutLanguagePrefixes"; + public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; + public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; + public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; + public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; + public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; + public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; + public const string CMSAnalyticsExcludedFileExtensions = "CMSAnalyticsExcludedFileExtensions"; + public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; + public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; + public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; + public const string CMSAnalyticsTrackAggregatedViews = "CMSAnalyticsTrackAggregatedViews"; + public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; + public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; + public const string CMSAnalyticsTrackFileDownloads = "CMSAnalyticsTrackFileDownloads"; + public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; + public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; + public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; + public const string CMSAnalyticsTrackRegisteredUsers = "CMSAnalyticsTrackRegisteredUsers"; + public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; + public const string CMSAnalyticsVisitorsSmartCheck = "CMSAnalyticsVisitorsSmartCheck"; + public const string CMSApplicationHealthMonitoringInterval = "CMSApplicationHealthMonitoringInterval"; + public const string CMSApplicationID = "CMSApplicationID"; + public const string CMSApplicationSecret = "CMSApplicationSecret"; + public const string CMSApplicationState = "CMSApplicationState"; + public const string CMSArchiveEmails = "CMSArchiveEmails"; + public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; + public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; + public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; + public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; + public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; + public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; + public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; + public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; + public const string CMSAvatarHeight = "CMSAvatarHeight"; + public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; + public const string CMSAvatarType = "CMSAvatarType"; + public const string CMSAvatarWidth = "CMSAvatarWidth"; + public const string CMSBadWordsAction = "CMSBadWordsAction"; + public const string CMSBadWordsReplacement = "CMSBadWordsReplacement"; + public const string CMSBannedIPEnabled = "CMSBannedIPEnabled"; + public const string CMSBannedIPRedirectURL = "CMSBannedIPRedirectURL"; + public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; + public const string CMSBitlyLogin = "CMSBitlyLogin"; + public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; + public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; + public const string CMSBlogEnableOptIn = "CMSBlogEnableOptIn"; + public const string CMSBlogEnableOptInConfirmation = "CMSBlogEnableOptInConfirmation"; + public const string CMSBlogOptInApprovalPath = "CMSBlogOptInApprovalPath"; + public const string CMSBlogOptInInterval = "CMSBlogOptInInterval"; + public const string CMSBlogsUnsubscriptionUrl = "CMSBlogsUnsubscriptionUrl"; + public const string CMSBoardBaseUrl = "CMSBoardBaseUrl"; + public const string CMSBoardEnableOptIn = "CMSBoardEnableOptIn"; + public const string CMSBoardEnableOptInConfirmation = "CMSBoardEnableOptInConfirmation"; + public const string CMSBoardOptInApprovalPath = "CMSBoardOptInApprovalPath"; + public const string CMSBoardOptInInterval = "CMSBoardOptInInterval"; + public const string CMSBoardUnsubsriptionURL = "CMSBoardUnsubsriptionURL"; + public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; + public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; + public const string CMSCacheImages = "CMSCacheImages"; + public const string CMSCacheMinutes = "CMSCacheMinutes"; + public const string CMSCachePageInfo = "CMSCachePageInfo"; + public const string CMSCampaignNewPageLocation = "CMSCampaignNewPageLocation"; + public const string CMSCaptchaControl = "CMSCaptchaControl"; + public const string CMSChatAllowAnonymGlobally = "CMSChatAllowAnonymGlobally"; + public const string CMSChatDaysNeededToDeleteRecods = "CMSChatDaysNeededToDeleteRecods"; + public const string CMSChatDisplayAnnouncementAtFirstLoad = "CMSChatDisplayAnnouncementAtFirstLoad"; + public const string CMSChatDisplayChangeNicknameAtFirstLoad = "CMSChatDisplayChangeNicknameAtFirstLoad"; + public const string CMSChatDisplayEnterAtFirstLoad = "CMSChatDisplayEnterAtFirstLoad"; + public const string CMSChatDisplayInvitedAtFirstLoad = "CMSChatDisplayInvitedAtFirstLoad"; + public const string CMSChatDisplayKickAtFirstLoad = "CMSChatDisplayKickAtFirstLoad"; + public const string CMSChatDisplayLeaveAtFirstLoad = "CMSChatDisplayLeaveAtFirstLoad"; + public const string CMSChatDisplaySupportGreetingAtFirstLoad = "CMSChatDisplaySupportGreetingAtFirstLoad"; + public const string CMSChatEnableBBCode = "CMSChatEnableBBCode"; + public const string CMSChatEnableFloodProtection = "CMSChatEnableFloodProtection"; + public const string CMSChatEnableSmileys = "CMSChatEnableSmileys"; + public const string CMSChatEnableSoundLiveChat = "CMSChatEnableSoundLiveChat"; + public const string CMSChatEnableSoundSupportChat = "CMSChatEnableSoundSupportChat"; + public const string CMSChatErrorDeleteAllTrans = "CMSChatErrorDeleteAllTrans"; + public const string CMSChatErrorTrans = "CMSChatErrorTrans"; + public const string CMSChatFirstLoadMessagesCount = "CMSChatFirstLoadMessagesCount"; + public const string CMSChatFloodProtectionChangeNickname = "CMSChatFloodProtectionChangeNickname"; + public const string CMSChatFloodProtectionCreateRoom = "CMSChatFloodProtectionCreateRoom"; + public const string CMSChatFloodProtectionJoinRoom = "CMSChatFloodProtectionJoinRoom"; + public const string CMSChatFloodProtectionPostMessage = "CMSChatFloodProtectionPostMessage"; + public const string CMSChatForceAnonymUniqueNicknames = "CMSChatForceAnonymUniqueNicknames"; + public const string CMSChatGlobalPingInterval = "CMSChatGlobalPingInterval"; + public const string CMSChatGuestPrefix = "CMSChatGuestPrefix"; + public const string CMSChatInitiatedChatTrans = "CMSChatInitiatedChatTrans"; + public const string CMSChatKickLastingTime = "CMSChatKickLastingTime"; + public const string CMSChatMaximumMessageLength = "CMSChatMaximumMessageLength"; + public const string CMSChatNotificationTrans = "CMSChatNotificationTrans"; + public const string CMSChatOnlineUserTrans = "CMSChatOnlineUserTrans"; + public const string CMSChatRedirectURLJoin = "CMSChatRedirectURLJoin"; + public const string CMSChatRedirectURLLeave = "CMSChatRedirectURLLeave"; + public const string CMSChatRedirectURLLogin = "CMSChatRedirectURLLogin"; + public const string CMSChatRedirectURLLogout = "CMSChatRedirectURLLogout"; + public const string CMSChatResolveURLEnabled = "CMSChatResolveURLEnabled"; + public const string CMSChatRoomMessageTrans = "CMSChatRoomMessageTrans"; + public const string CMSChatRoomNameTrans = "CMSChatRoomNameTrans"; + public const string CMSChatRoomPingInterval = "CMSChatRoomPingInterval"; + public const string CMSChatRoomPopupWindow = "CMSChatRoomPopupWindow"; + public const string CMSChatRoomTrans = "CMSChatRoomTrans"; + public const string CMSChatRoomUserTrans = "CMSChatRoomUserTrans"; + public const string CMSChatSendSupportMessagesTo = "CMSChatSendSupportMessagesTo"; + public const string CMSChatSupportEnabled = "CMSChatSupportEnabled"; + public const string CMSChatSupportEngineerLogoutTimeout = "CMSChatSupportEngineerLogoutTimeout"; + public const string CMSChatSupportRequestTrans = "CMSChatSupportRequestTrans"; + public const string CMSChatSupportTakenRoomReleaseTimeout = "CMSChatSupportTakenRoomReleaseTimeout"; + public const string CMSChatUserLogoutTimeout = "CMSChatUserLogoutTimeout"; + public const string CMSChatWPDefaultGroupPagesBy = "CMSChatWPDefaultGroupPagesBy"; + public const string CMSChatWPDefaultInviteModePagingItems = "CMSChatWPDefaultInviteModePagingItems"; + public const string CMSChatWPDefaultInviteModeSearchMode = "CMSChatWPDefaultInviteModeSearchMode"; + public const string CMSChatWPDefaultPagingItems = "CMSChatWPDefaultPagingItems"; + public const string CMSChatWPDefaultSearchOnlineMaxUsers = "CMSChatWPDefaultSearchOnlineMaxUsers"; + public const string CMSChatWPDefaultShowFilterLimit = "CMSChatWPDefaultShowFilterLimit"; + public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; + public const string CMSCheckBadWords = "CMSCheckBadWords"; + public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; + public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; + public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; + public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; + public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; + public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; + public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; + public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; + public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; + public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; + public const string CMSCMBlogPostComments = "CMSCMBlogPostComments"; + public const string CMSCMBlogPostSubscription = "CMSCMBlogPostSubscription"; + public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; + public const string CMSCMContentRating = "CMSCMContentRating"; + public const string CMSCMCustomActivities = "CMSCMCustomActivities"; + public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; + public const string CMSCMEmailOpening = "CMSCMEmailOpening"; + public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; + public const string CMSCMEventBooking = "CMSCMEventBooking"; + public const string CMSCMExternalSearch = "CMSCMExternalSearch"; + public const string CMSCMForumPosts = "CMSCMForumPosts"; + public const string CMSCMForumPostSubscription = "CMSCMForumPostSubscription"; + public const string CMSCMGeoCity = "CMSCMGeoCity"; + public const string CMSCMGeoCountry = "CMSCMGeoCountry"; + public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; + public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; + public const string CMSCMGeoMetro = "CMSCMGeoMetro"; + public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; + public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; + public const string CMSCMGeoPostal = "CMSCMGeoPostal"; + public const string CMSCMGeoState = "CMSCMGeoState"; + public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; + public const string CMSCMLandingPage = "CMSCMLandingPage"; + public const string CMSCMMessageBoardPosts = "CMSCMMessageBoardPosts"; + public const string CMSCMMessageBoardSubscription = "CMSCMMessageBoardSubscription"; + public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; + public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; + public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; + public const string CMSCMPageVisits = "CMSCMPageVisits"; + public const string CMSCMPollVoting = "CMSCMPollVoting"; + public const string CMSCMPurchase = "CMSCMPurchase"; + public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; + public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; + public const string CMSCMSearch = "CMSCMSearch"; + public const string CMSCMStamp = "CMSCMStamp"; + public const string CMSCMUserLogin = "CMSCMUserLogin"; + public const string CMSCMUserRegistration = "CMSCMUserRegistration"; + public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; + public const string CMSCombineComponentsCSS = "CMSCombineComponentsCSS"; + public const string CMSCombineImagesWithDefaultCulture = "CMSCombineImagesWithDefaultCulture"; + public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; + public const string CMSConfirmChanges = "CMSConfirmChanges"; + public const string CMSContentImageWatermark = "CMSContentImageWatermark"; + public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; + public const string CMSControlElement = "CMSControlElement"; + public const string CMSConvertTablesToDivs = "CMSConvertTablesToDivs"; + public const string CMSDataVersion = "CMSDataVersion"; + public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; + public const string CMSDBVersion = "CMSDBVersion"; + public const string CMSDebugAllCache = "CMSDebugAllCache"; + public const string CMSDebugAllFiles = "CMSDebugAllFiles"; + public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; + public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; + public const string CMSDebugAllMacros = "CMSDebugAllMacros"; + public const string CMSDebugAllOutput = "CMSDebugAllOutput"; + public const string CMSDebugAllRequests = "CMSDebugAllRequests"; + public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; + public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; + public const string CMSDebugAllViewState = "CMSDebugAllViewState"; + public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; + public const string CMSDebugAnalytics = "CMSDebugAnalytics"; + public const string CMSDebugAnalyticsLive = "CMSDebugAnalyticsLive"; + public const string CMSDebugAnalyticsLogLength = "CMSDebugAnalyticsLogLength"; + public const string CMSDebugAnalyticsStack = "CMSDebugAnalyticsStack"; + public const string CMSDebugCache = "CMSDebugCache"; + public const string CMSDebugCacheLive = "CMSDebugCacheLive"; + public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; + public const string CMSDebugCacheStack = "CMSDebugCacheStack"; + public const string CMSDebugEverything = "CMSDebugEverything"; + public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; + public const string CMSDebugEverythingLive = "CMSDebugEverythingLive"; + public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; + public const string CMSDebugFiles = "CMSDebugFiles"; + public const string CMSDebugFilesLive = "CMSDebugFilesLive"; + public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; + public const string CMSDebugFilesStack = "CMSDebugFilesStack"; + public const string CMSDebugHandlers = "CMSDebugHandlers"; + public const string CMSDebugHandlersLive = "CMSDebugHandlersLive"; + public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; + public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; + public const string CMSDebugImportExport = "CMSDebugImportExport"; + public const string CMSDebugMacros = "CMSDebugMacros"; + public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; + public const string CMSDebugMacrosLive = "CMSDebugMacrosLive"; + public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; + public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; + public const string CMSDebugOutput = "CMSDebugOutput"; + public const string CMSDebugOutputLive = "CMSDebugOutputLive"; + public const string CMSDebugOutputLogLength = "CMSDebugOutputLogLength"; + public const string CMSDebugRequests = "CMSDebugRequests"; + public const string CMSDebugRequestsLive = "CMSDebugRequestsLive"; + public const string CMSDebugRequestsLogLength = "CMSDebugRequestsLogLength"; + public const string CMSDebugRequestsStack = "CMSDebugRequestsStack"; + public const string CMSDebugResources = "CMSDebugResources"; + public const string CMSDebugScheduler = "CMSDebugScheduler"; + public const string CMSDebugSecurity = "CMSDebugSecurity"; + public const string CMSDebugSecurityLive = "CMSDebugSecurityLive"; + public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; + public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; + public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; + public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; + public const string CMSDebugSQLQueriesLive = "CMSDebugSQLQueriesLive"; + public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; + public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; + public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; + public const string CMSDebugViewState = "CMSDebugViewState"; + public const string CMSDebugViewStateLive = "CMSDebugViewStateLive"; + public const string CMSDebugViewStateLogLength = "CMSDebugViewStateLogLength"; + public const string CMSDebugWebFarm = "CMSDebugWebFarm"; + public const string CMSDebugWebFarmLive = "CMSDebugWebFarmLive"; + public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; + public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; + public const string CMSDefaulPage = "CMSDefaulPage"; + public const string CMSDefaultAliasPath = "CMSDefaultAliasPath"; + public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; + public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; + public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; + public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; + public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; + public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; + public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; + public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; + public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; + public const string CMSDefaultControlForText = "CMSDefaultControlForText"; + public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; + public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; + public const string CMSDefaultDeletedNodePath = "CMSDefaultDeletedNodePath"; + public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; + public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; + public const string CMSDefaultUrlPathPrefix = "CMSDefaultUrlPathPrefix"; + public const string CMSDefaultUserID = "CMSDefaultUserID"; + public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; + public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; + public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; + public const string CMSDenyLoginInterval = "CMSDenyLoginInterval"; + public const string CMSDepartmentTemplatePath = "CMSDepartmentTemplatePath"; + public const string CMSDeploymentMode = "CMSDeploymentMode"; + public const string CMSDeviceProfilesEnable = "CMSDeviceProfilesEnable"; + public const string CMSDisableDebug = "CMSDisableDebug"; + public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; + public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; + public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; + public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; + public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; + public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; + public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; + public const string CMSDisplayRedirectedIcon = "CMSDisplayRedirectedIcon"; + public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; + public const string CMSEmailBatchSize = "CMSEmailBatchSize"; + public const string CMSEmailEncoding = "CMSEmailEncoding"; + public const string CMSEmailFormat = "CMSEmailFormat"; + public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; + public const string CMSEmailsEnabled = "CMSEmailsEnabled"; + public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; + public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; + public const string CMSEnableCI = "CMSEnableCI"; + public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; + public const string CMSEnableDefaultAvatars = "CMSEnableDefaultAvatars"; + public const string CMSEnableFacebookConnect = "CMSEnableFacebookConnect"; + public const string CMSEnableHealthMonitoring = "CMSEnableHealthMonitoring"; + public const string CMSEnableLinkedIn = "CMSEnableLinkedIn"; + public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; + public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; + public const string CMSEnableOpenID = "CMSEnableOpenID"; + public const string CMSEnableOutputCache = "CMSEnableOutputCache"; + public const string CMSEnablePartialCache = "CMSEnablePartialCache"; + public const string CMSEnableSiteCounters = "CMSEnableSiteCounters"; + public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; + public const string CMSEnableTranslations = "CMSEnableTranslations"; + public const string CMSEnableUserCounts = "CMSEnableUserCounts"; + public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; + public const string CMSEnableVersioningCMSCssStylesheet = "CMSEnableVersioningCMSCssStylesheet"; + public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; + public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; + public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; + public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; + public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; + public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; + public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; + public const string CMSEnableVersioningCMSTemplateDeviceLayout = "CMSEnableVersioningCMSTemplateDeviceLayout"; + public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; + public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; + public const string CMSEnableVersioningCMSWebPartContainer = "CMSEnableVersioningCMSWebPartContainer"; + public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; + public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; + public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; + public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; + public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; + public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; + public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; + public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; + public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; + public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; + public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; + public const string CMSEnableWebDAV = "CMSEnableWebDAV"; + public const string CMSEnableWindowsLiveID = "CMSEnableWindowsLiveID"; + public const string CMSEventManagerInvitationFrom = "CMSEventManagerInvitationFrom"; + public const string CMSEventManagerInvitationSubject = "CMSEventManagerInvitationSubject"; + public const string CMSEventManagerSenderName = "CMSEventManagerSenderName"; + public const string CMSExcludedAttributesFilterURLs = "CMSExcludedAttributesFilterURLs"; + public const string CMSExcludedFormFilterURLs = "CMSExcludedFormFilterURLs"; + public const string CMSExcludedHTML5FilterURLs = "CMSExcludedHTML5FilterURLs"; + public const string CMSExcludedJavascriptFilterURLs = "CMSExcludedJavascriptFilterURLs"; + public const string CMSExcludedLowercaseFilterURLs = "CMSExcludedLowercaseFilterURLs"; + public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; + public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; + public const string CMSExcludedResolveFilterURLs = "CMSExcludedResolveFilterURLs"; + public const string CMSExcludedSelfcloseFilterURLs = "CMSExcludedSelfcloseFilterURLs"; + public const string CMSExcludedURLs = "CMSExcludedURLs"; + public const string CMSExcludedXHTMLFilterURLs = "CMSExcludedXHTMLFilterURLs"; + public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; + public const string CMSFacebookApplicationSecret = "CMSFacebookApplicationSecret"; + public const string CMSFacebookConnectApiKey = "CMSFacebookConnectApiKey"; + public const string CMSFacebookMapUserProfile = "CMSFacebookMapUserProfile"; + public const string CMSFacebookRoles = "CMSFacebookRoles"; + public const string CMSFacebookUserMapping = "CMSFacebookUserMapping"; + public const string CMSFaviconPath = "CMSFaviconPath"; + public const string CMSFilesFolder = "CMSFilesFolder"; + public const string CMSFilesFriendlyURLExtension = "CMSFilesFriendlyURLExtension"; + public const string CMSFilesLocationType = "CMSFilesLocationType"; + public const string CMSFileSystemOutputCacheMinutes = "CMSFileSystemOutputCacheMinutes"; + public const string CMSFloodInterval = "CMSFloodInterval"; + public const string CMSFloodProtectionEnabled = "CMSFloodProtectionEnabled"; + public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; + public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; + public const string CMSForumAttachmentExtensions = "CMSForumAttachmentExtensions"; + public const string CMSForumBaseUrl = "CMSForumBaseUrl"; + public const string CMSForumEnableOptIn = "CMSForumEnableOptIn"; + public const string CMSForumEnableOptInConfirmation = "CMSForumEnableOptInConfirmation"; + public const string CMSForumMaxPostNode = "CMSForumMaxPostNode"; + public const string CMSForumOptInApprovalPath = "CMSForumOptInApprovalPath"; + public const string CMSForumOptInInterval = "CMSForumOptInInterval"; + public const string CMSForumUnsubscriptionUrl = "CMSForumUnsubscriptionUrl"; + public const string CMSFriendlyURLExtension = "CMSFriendlyURLExtension"; + public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; + public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; + public const string CMSGoogleSitemapURL = "CMSGoogleSitemapURL"; + public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; + public const string CMSGravatarDefaultImage = "CMSGravatarDefaultImage"; + public const string CMSGravatarRating = "CMSGravatarRating"; + public const string CMSGroupAvatarHeight = "CMSGroupAvatarHeight"; + public const string CMSGroupAvatarMaxSideSize = "CMSGroupAvatarMaxSideSize"; + public const string CMSGroupAvatarWidth = "CMSGroupAvatarWidth"; + public const string CMSGroupManagementPath = "CMSGroupManagementPath"; + public const string CMSGroupProfilePath = "CMSGroupProfilePath"; + public const string CMSGroupsSecurityAccessPath = "CMSGroupsSecurityAccessPath"; + public const string CMSGroupTemplatePath = "CMSGroupTemplatePath"; + public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; + public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; + public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; + public const string CMSHotfixVersion = "CMSHotfixVersion"; + public const string CMSImageWatermark = "CMSImageWatermark"; + public const string CMSImageWatermarkPosition = "CMSImageWatermarkPosition"; + public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; + public const string CMSIndentOutputHtml = "CMSIndentOutputHtml"; + public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; + public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; + public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; + public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; + public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; + public const string CMSInvitationAcceptationPath = "CMSInvitationAcceptationPath"; + public const string CMSInvitationValidity = "CMSInvitationValidity"; + public const string CMSKeepChangedDocumentAccesible = "CMSKeepChangedDocumentAccesible"; + public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; + public const string CMSLayoutMappingEnable = "CMSLayoutMappingEnable"; + public const string CMSLinkedInAccessToken = "CMSLinkedInAccessToken"; + public const string CMSLinkedInApiKey = "CMSLinkedInApiKey"; + public const string CMSLinkedInApplicationSecret = "CMSLinkedInApplicationSecret"; + public const string CMSLinkedInRoles = "CMSLinkedInRoles"; + public const string CMSLinkedInSignInPermissionScope = "CMSLinkedInSignInPermissionScope"; + public const string CMSLiveIDRequiredUserDataPage = "CMSLiveIDRequiredUserDataPage"; + public const string CMSLiveIDRoles = "CMSLiveIDRoles"; + public const string CMSLogAnalytics = "CMSLogAnalytics"; + public const string CMSLogCache = "CMSLogCache"; + public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; + public const string CMSLogFiles = "CMSLogFiles"; + public const string CMSLogHandlers = "CMSLogHandlers"; + public const string CMSLogMacros = "CMSLogMacros"; + public const string CMSLogMetadata = "CMSLogMetadata"; + public const string CMSLogOutput = "CMSLogOutput"; + public const string CMSLogPageNotFoundException = "CMSLogPageNotFoundException"; + public const string CMSLogRequests = "CMSLogRequests"; + public const string CMSLogSecurity = "CMSLogSecurity"; + public const string CMSLogSize = "CMSLogSize"; + public const string CMSLogSQLQueries = "CMSLogSQLQueries"; + public const string CMSLogToDatabase = "CMSLogToDatabase"; + public const string CMSLogToFileSystem = "CMSLogToFileSystem"; + public const string CMSLogToTrace = "CMSLogToTrace"; + public const string CMSLogViewState = "CMSLogViewState"; + public const string CMSLogWebFarm = "CMSLogWebFarm"; + public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; + public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; + public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; + public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; + public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; + public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; + public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; + public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; + public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; + public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; + public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; + public const string CMSMediaImageWatermark = "CMSMediaImageWatermark"; + public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; + public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; + public const string CMSMediaUsePermanentURLs = "CMSMediaUsePermanentURLs"; + public const string CMSMemberManagementPath = "CMSMemberManagementPath"; + public const string CMSMemberProfilePath = "CMSMemberProfilePath"; + public const string CMSMembershipReminder = "CMSMembershipReminder"; + public const string CMSMetaImageWatermark = "CMSMetaImageWatermark"; + public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; + public const string CMSMFEnabled = "CMSMFEnabled"; + public const string CMSMFRequired = "CMSMFRequired"; + public const string CMSMinWatermarkImageHeight = "CMSMinWatermarkImageHeight"; + public const string CMSMinWatermarkImageWidth = "CMSMinWatermarkImageWidth"; + public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; + public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; + public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; + public const string CMSMoveViewStateToEnd = "CMSMoveViewStateToEnd"; + public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; + public const string CMSMVTEnabled = "CMSMVTEnabled"; + public const string CMSMyAccountURL = "CMSMyAccountURL"; + public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; + public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; + public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; + public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; + public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; + public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; + public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; + public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; + public const string CMSOnSiteEditButton = "CMSOnSiteEditButton"; + public const string CMSOpenIDRoles = "CMSOpenIDRoles"; + public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; + public const string CMSOptInInterval = "CMSOptInInterval"; + public const string CMSOutputCacheItems = "CMSOutputCacheItems"; + public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; + public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; + public const string CMSPageNotFoundForNonPublished = "CMSPageNotFoundForNonPublished"; + public const string CMSPageNotFoundUrl = "CMSPageNotFoundUrl"; + public const string CMSPageTitleFormat = "CMSPageTitleFormat"; + public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; + public const string CMSPartialCacheItems = "CMSPartialCacheItems"; + public const string CMSPasswordExpiration = "CMSPasswordExpiration"; + public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; + public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; + public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; + public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; + public const string CMSPasswordFormat = "CMSPasswordFormat"; + public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; + public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; + public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; + public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; + public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; + public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; + public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; + public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; + public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; + public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; + public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; + public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; + public const string CMSPollsAllowGlobal = "CMSPollsAllowGlobal"; + public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; + public const string CMSPOP3Password = "CMSPOP3Password"; + public const string CMSPOP3ServerName = "CMSPOP3ServerName"; + public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; + public const string CMSPOP3UserName = "CMSPOP3UserName"; + public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; + public const string CMSPriceRounding = "CMSPriceRounding"; + public const string CMSProcessDomainPrefix = "CMSProcessDomainPrefix"; + public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; + public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; + public const string CMSRedirectAliasesToMainURL = "CMSRedirectAliasesToMainURL"; + public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; + public const string CMSRedirectInvalidCasePages = "CMSRedirectInvalidCasePages"; + public const string CMSRedirectToMainExtension = "CMSRedirectToMainExtension"; + public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; + public const string CMSRegistrationApprovalPath = "CMSRegistrationApprovalPath"; + public const string CMSRegistrationEmailConfirmation = "CMSRegistrationEmailConfirmation"; + public const string CMSRememberUniGridState = "CMSRememberUniGridState"; + public const string CMSRequiredLinkedInPage = "CMSRequiredLinkedInPage"; + public const string CMSRequiredOpenIDPage = "CMSRequiredOpenIDPage"; + public const string CMSReservedUserNames = "CMSReservedUserNames"; + public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; + public const string CMSResetPasswordURL = "CMSResetPasswordURL"; + public const string CMSResizeImagesToDevice = "CMSResizeImagesToDevice"; + public const string CMSResolveMacrosInCSS = "CMSResolveMacrosInCSS"; + public const string CMSResourceCompressionEnabled = "CMSResourceCompressionEnabled"; + public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; + public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; + public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; + public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; + public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; + public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; + public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; + public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; + public const string CMSRestoreObjects = "CMSRestoreObjects"; + public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; + public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; + public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; + public const string CMSRobotsPath = "CMSRobotsPath"; + public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; + public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; + public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; + public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; + public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; + public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; + public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; + public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; + public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; + public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; + public const string CMSSchedulerInterval = "CMSSchedulerInterval"; + public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; + public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; + public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; + public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; + public const string CMSScreenLockInterval = "CMSScreenLockInterval"; + public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; + public const string CMSScriptMinificationEnabled = "CMSScriptMinificationEnabled"; + public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; + public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; + public const string CMSSecuredAreasLogonPage = "CMSSecuredAreasLogonPage"; + public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; + public const string CMSSendBlogEmailsFrom = "CMSSendBlogEmailsFrom"; + public const string CMSSendBoardEmailsFrom = "CMSSendBoardEmailsFrom"; + public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; + public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; + public const string CMSSendForumEmailsFrom = "CMSSendForumEmailsFrom"; + public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; + public const string CMSSendPasswordResetConfirmation = "CMSSendPasswordResetConfirmation"; + public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; + public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; + public const string CMSServerTimeZone = "CMSServerTimeZone"; + public const string CMSServiceHealthMonitoringInterval = "CMSServiceHealthMonitoringInterval"; + public const string CMSSessionManagerSchedulerInterval = "CMSSessionManagerSchedulerInterval"; + public const string CMSSessionUseDBRepository = "CMSSessionUseDBRepository"; + public const string CMSSharePointCache = "CMSSharePointCache"; + public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; + public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; + public const string CMSShoppingCartURL = "CMSShoppingCartURL"; + public const string CMSSitemapPath = "CMSSitemapPath"; + public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; + public const string CMSSiteTimeZone = "CMSSiteTimeZone"; + public const string CMSSMTPServer = "CMSSMTPServer"; + public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; + public const string CMSSMTPServerTip = "CMSSMTPServerTip"; + public const string CMSSMTPServerUser = "CMSSMTPServerUser"; + public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; + public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; + public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; + public const string CMSStagingLogChanges = "CMSStagingLogChanges"; + public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; + public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; + public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; + public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; + public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; + public const string CMSStagingServicePassword = "CMSStagingServicePassword"; + public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; + public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; + public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; + public const string CMSStoreAddToShoppingCartConversionName = "CMSStoreAddToShoppingCartConversionName"; + public const string CMSStoreAddToShoppingCartConversionValue = "CMSStoreAddToShoppingCartConversionValue"; + public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; + public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; + public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; + public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; + public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; + public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; + public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; + public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; + public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; + public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; + public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; + public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; + public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; + public const string CMSStoreCSSStylesheetsInFS = "CMSStoreCSSStylesheetsInFS"; + public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; + public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; + public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; + public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; + public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; + public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; + public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; + public const string CMSStoreMassUnit = "CMSStoreMassUnit"; + public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; + public const string CMSStoreOrderConversionName = "CMSStoreOrderConversionName"; + public const string CMSStoreOrderConversionValue = "CMSStoreOrderConversionValue"; + public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; + public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; + public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; + public const string CMSStoreProductsTree = "CMSStoreProductsTree"; + public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; + public const string CMSStoreRegistrationConversionName = "CMSStoreRegistrationConversionName"; + public const string CMSStoreRegistrationConversionValue = "CMSStoreRegistrationConversionValue"; + public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; + public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; + public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; + public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; + public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; + public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; + public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; + public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; + public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; + public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; + public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; + public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; + public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; + public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; + public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; + public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; + public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; + public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; + public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; + public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; + public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; + public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; + public const string CMSStrandsAPIID = "CMSStrandsAPIID"; + public const string CMSStrandsAutomaticCatalogUploadEnabled = "CMSStrandsAutomaticCatalogUploadEnabled"; + public const string CMSStrandsAutomaticUploadFrequency = "CMSStrandsAutomaticUploadFrequency"; + public const string CMSStrandsCatalogFeedPassword = "CMSStrandsCatalogFeedPassword"; + public const string CMSStrandsCatalogFeedUsername = "CMSStrandsCatalogFeedUsername"; + public const string CMSStrandsCatalogTransformation = "CMSStrandsCatalogTransformation"; + public const string CMSStrandsCatalogWhereCondition = "CMSStrandsCatalogWhereCondition"; + public const string CMSStrandsDocumentTypes = "CMSStrandsDocumentTypes"; + public const string CMSStrandsPath = "CMSStrandsPath"; + public const string CMSStrandsValidationToken = "CMSStrandsValidationToken"; + public const string CMSStylesheetMinificationEnabled = "CMSStylesheetMinificationEnabled"; + public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; + public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; + public const string CMSTrackExitPages = "CMSTrackExitPages"; + public const string CMSTrackLandingPages = "CMSTrackLandingPages"; + public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; + public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; + public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; + public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; + public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; + public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; + public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; + public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; + public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; + public const string CMSTranslateWebpartProperties = "CMSTranslateWebpartProperties"; + public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; + public const string CMSTranslationsComPassword = "CMSTranslationsComPassword"; + public const string CMSTranslationsComProjectCode = "CMSTranslationsComProjectCode"; + public const string CMSTranslationsComURL = "CMSTranslationsComURL"; + public const string CMSTranslationsComUserName = "CMSTranslationsComUserName"; + public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; + public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; + public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; + public const string CMSUploadExtensions = "CMSUploadExtensions"; + public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; + public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; + public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; + public const string CMSUseDomainForCulture = "CMSUseDomainForCulture"; + public const string CMSUseEventLogListener = "CMSUseEventLogListener"; + public const string CMSUseExternalService = "CMSUseExternalService"; + public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; + public const string CMSUseLangPrefixForUrls = "CMSUseLangPrefixForUrls"; + public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; + public const string CMSUseNamePathForUrlPath = "CMSUseNamePathForUrlPath"; + public const string CMSUseNoFollowForUsersLinks = "CMSUseNoFollowForUsersLinks"; + public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; + public const string CMSUseParentGroupIDForNewDocuments = "CMSUseParentGroupIDForNewDocuments"; + public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; + public const string CMSUsePermanentRedirect = "CMSUsePermanentRedirect"; + public const string CMSUsePermanentURLs = "CMSUsePermanentURLs"; + public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; + public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; + public const string CMSUseSessionManagement = "CMSUseSessionManagement"; + public const string CMSUseSitePrefixForUserName = "CMSUseSitePrefixForUserName"; + public const string CMSUseSSL = "CMSUseSSL"; + public const string CMSUseSSLForAdministrationInterface = "CMSUseSSLForAdministrationInterface"; + public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; + public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; + public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; + public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; + public const string CMSWebAnalyticsUseJavascriptLogging = "CMSWebAnalyticsUseJavascriptLogging"; + public const string CMSWebDAVExtensions = "CMSWebDAVExtensions"; + public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; + public const string CMSWebFarmMode = "CMSWebFarmMode"; + public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; + public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; + public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; + public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; + public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; + public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; + public const string CMSWebFarmSynchronizeForumAttachments = "CMSWebFarmSynchronizeForumAttachments"; + public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; + public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; + public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; + public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; + public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; + public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; + public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; + public const string CMSWIFEnabled = "CMSWIFEnabled"; + public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; + public const string CMSWIFRealm = "CMSWIFRealm"; + public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; + public const string CMSWishlistURL = "CMSWishlistURL"; +} diff --git a/Migration.Toolkit.K11/SettingsKeys.tt b/Migration.Toolkit.K11/SettingsKeys.tt index 0254bd98..79807a48 100644 --- a/Migration.Toolkit.K11/SettingsKeys.tt +++ b/Migration.Toolkit.K11/SettingsKeys.tt @@ -1,6 +1,4 @@ <#@ template language="C#" #> -<#@ import namespace="System.Text" #> -<#@ import namespace="System.Collections.Generic" #> <#@ import namespace="System.Data.SqlClient" #> // ReSharper disable InconsistentNaming // ReSharper disable IdentifierTypo diff --git a/Migration.Toolkit.K11/genModel.ps1 b/Migration.Toolkit.K11/genModel.ps1 index 953d4e1a..ea085f99 100644 --- a/Migration.Toolkit.K11/genModel.ps1 +++ b/Migration.Toolkit.K11/genModel.ps1 @@ -6,9 +6,9 @@ $workDir = $MyInvocation.MyCommand.Path $workDir = [System.IO.Path]::GetDirectoryName($workDir) $contextPath = "$workDir\Context\K11Context.cs" $contextText = [System.IO.File]::ReadAllText($contextPath) -$result = $contextText -replace '.*optionsBuilder.UseSqlServer.*',''; -$result = $result -replace '.*protected override void OnConfiguring.*',''; -$result = $result -replace '.*#warning To protect potentially sensitive information in your connection string, .*',''; +$result = $contextText -replace '.*optionsBuilder.UseSqlServer.*', ''; +$result = $result -replace '.*protected override void OnConfiguring.*', ''; +$result = $result -replace '.*#warning To protect potentially sensitive information in your connection string, .*', ''; [System.IO.File]::WriteAllText($contextPath, $result) # ./genModel.ps1 -connection "Data Source=.;Initial Catalog=Kentico11_DG;Integrated Security=True;Persist Security Info=False;Connect Timeout=60;Encrypt=False;Current Language=English;" \ No newline at end of file diff --git a/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs b/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs index 9e2f05fa..21bd0852 100644 --- a/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs +++ b/Migration.Toolkit.KX12/Auxiliary/Kx13FormControls.cs @@ -1,233 +1,234 @@ -// ReSharper disable InconsistentNaming -namespace Migration.Toolkit.KX12.Auxiliary; - -public class Kx12FormControls -{ - public class UserControlForText - { - public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; - public const string ActivityTypeSelector = "ActivityTypeSelector"; - public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; - public const string Selectalternativeform = "selectalternativeform"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string AssemblyClassSelector = "AssemblyClassSelector"; - public const string Fieldselector = "fieldselector"; - public const string BizFormSelector = "BizFormSelector"; - public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; - public const string CampaignSelector = "CampaignSelector"; - public const string CategorySelector = "CategorySelector"; - public const string ClassFieldSelector = "ClassFieldSelector"; - public const string ClassFields = "Class_fields"; - public const string CodeName = "CodeName"; - public const string CodeNameWithPrefix = "CodeNameWithPrefix"; - public const string Selectcolor = "selectcolor"; - public const string Columns = "Columns"; - public const string ConnectionStringSelector = "Connection_string_selector"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CountrySelector = "countrySelector"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectculture = "selectculture"; - public const string CultureSelectorForSettings = "CultureSelectorForSettings"; - public const string CurrencySelector = "currencySelector"; - public const string CustomTableItemSelector = "CustomTableItemSelector"; - public const string CustomTableSelector = "CustomTableSelector"; - public const string Selectcolumns = "selectcolumns"; - public const string DepartmentSelector = "DepartmentSelector"; - public const string DropDownListControl = "DropDownListControl"; - public const string DueDateSelector = "Due_date_selector"; - public const string Emailinput = "emailinput"; - public const string EmailTemplateSelector = "Email_template_selector"; - public const string EmailTemplateTypeSelector = "Email_template_type_selector"; - public const string EncodingTextBox = "EncodingTextBox"; - public const string EncryptedPassword = "EncryptedPassword"; - public const string EnumSelector = "EnumSelector"; - public const string EventLogTypeSelector = "EventLogTypeSelector"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string FontIconSelector = "FontIconSelector"; - public const string FormFieldSelector = "FormFieldSelector"; - public const string FormPassword = "FormPassword"; - public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; - public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; - public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; - public const string GoToExternalUrl = "Go_to_external_URL"; - public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; - public const string Html5Input = "HTML5Input"; - public const string IconSelector = "IconSelector"; - public const string InternalStatusSelector = "InternalStatusSelector"; - public const string Internationalphone = "internationalphone"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LicenseSelector = "LicenseSelector"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string ListBoxControl = "ListBoxControl"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; - public const string MacroAnyAllSelector = "MacroAnyAllSelector"; - public const string MacroDateOperator = "Macro_date_operator"; - public const string MacroEditor = "MacroEditor"; - public const string MacroEqualityOperator = "MacroEqualityOperator"; - public const string MacroNegationOperator = "MacroNegationOperator"; - public const string MacroNumericOperator = "Macro_numeric_operator"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MacroTextOperator = "Macro_text_operator"; - public const string MacroType = "MacroType"; - public const string ManufacturerSelector = "ManufacturerSelector"; - public const string MediaLibrarySelector = "MediaLibrarySelector"; - public const string MediaSelectionControl = "MediaSelectionControl"; - public const string MembershipSelector = "MembershipSelector"; - public const string MetafileUploaderControl = "MetafileUploaderControl"; - public const string ModuleSelector = "ModuleSelector"; - public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; - public const string MultipleChoiceControl = "MultipleChoiceControl"; - public const string RoleCheckboxSelector = "RoleCheckboxSelector"; - public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; - public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; - public const string MultipleUserSelector = "MultipleUserSelector"; - public const string NewsletterSelector = "NewsletterSelector"; - public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; - public const string NumericUpDown = "NumericUpDown"; - public const string ObjectColumnSelector = "ObjectColumnSelector"; - public const string ObjectSelector = "ObjectSelector"; - public const string ObjectTransformation = "ObjectTransformation"; - public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; - public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; - public const string OrderBy = "OrderBy"; - public const string OrderStatusSelector = "OrderStatusSelector"; - public const string DocumentCultureFilter = "DocumentCultureFilter"; - public const string PageLayoutCode = "Page_layout_code"; - public const string Selectdocument = "selectdocument"; - public const string PageTemplateLevels = "PageTemplateLevels"; - public const string Selectpagetemplate = "selectpagetemplate"; - public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; - public const string Selectclassnames = "selectclassnames"; - public const string Password = "Password"; - public const string PasswordStrength = "PasswordStrength"; - public const string PasswordConfirmator = "PasswordConfirmator"; - public const string Selectpath = "selectpath"; - public const string PaymentSelector = "paymentSelector"; - public const string ProductImageSelector = "ProductImageSelector"; - public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string ProductTypeSelector = "ProductTypeSelector"; - public const string PublicStatusSelector = "PublicStatusSelector"; - public const string Selectquery = "selectquery"; - public const string RadioButtonsControl = "RadioButtonsControl"; - public const string AgeRangeSelector = "AgeRangeSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string Relationshipconfiguration = "relationshipconfiguration"; - public const string SelectRelationshipName = "SelectRelationshipName"; - public const string ReportSelectorDropDown = "ReportSelectorDropDown"; - public const string RoleSelector = "RoleSelector"; - public const string SearchClassNameSelector = "SearchClassNameSelector"; - public const string SearchIndexSelector = "SearchIndexSelector"; - public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; - public const string SelectCmsVersion = "SelectCMSVersion"; - public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointListSelector = "SharePointListSelector"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string ShippingSelector = "shippingSelector"; - public const string ShippingServiceSelector = "ShippingServiceSelector"; - public const string Selectsinglepath = "selectsinglepath"; - public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; - public const string SiteContentCulture = "SiteContentCulture"; - public const string SiteCultureSelector = "SiteCultureSelector"; - public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; - public const string Selectsite = "selectsite"; - public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; - public const string SkuSelector = "SKUSelector"; - public const string StopWordsSelector = "StopWordsSelector"; - public const string SupplierSelector = "SupplierSelector"; - public const string SupportedCultureSelector = "SupportedCultureSelector"; - public const string TableConversionSettings = "TableConversionSettings"; - public const string TagGroupSelector = "TagGroupSelector"; - public const string TagSelector = "TagSelector"; - public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; - public const string TextboxDoubleValidator = "Textbox_double_validator"; - public const string TimeZoneSelector = "TimeZoneSelector"; - public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; - public const string ToggleButton = "ToggleButton"; - public const string Selecttransformation = "selecttransformation"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string Usphone = "usphone"; - public const string Uszipcode = "uszipcode"; - public const string UiCultureSelector = "UICultureSelector"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string UrlChecker = "UrlChecker"; - public const string UrlSelector = "URLSelector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string UserName = "UserName"; - public const string UserNameSelector = "UserNameSelector"; - public const string UserSelector = "UserSelector"; - public const string ValiditySelector = "ValiditySelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; - } - - public class UserControlForLongText - { - public const string AbTestConversionSelector = "ABTestConversionSelector"; - public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; - public const string BbEditorControl = "BBEditorControl"; - public const string CacheDependencies = "CacheDependencies"; - public const string ClassFields = "Class_fields"; - public const string Columns = "Columns"; - public const string ConditionBuilder = "ConditionBuilder"; - public const string ContactClassFields = "Contact_class_fields"; - public const string CssStylesEditor = "CSS_Styles_Editor"; - public const string Selectcolumns = "selectcolumns"; - public const string DropDownListControl = "DropDownListControl"; - public const string FacebookAutoPost = "Facebook_auto_post"; - public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; - public const string FileSystemSelector = "FileSystemSelector"; - public const string Html5Input = "HTML5Input"; - public const string AutoResizeConfiguration = "AutoResizeConfiguration"; - public const string LabelControl = "LabelControl"; - public const string LargeTextArea = "LargeTextArea"; - public const string LinkedInAutoPost = "LinkedInAutoPost"; - public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; - public const string LocalizableTextArea = "LocalizableTextArea"; - public const string LocalizableTextBox = "LocalizableTextBox"; - public const string MacroEditor = "MacroEditor"; - public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; - public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; - public const string ObjectTypeSelector = "ObjectTypeSelector"; - public const string OptionsSelector = "OptionsSelector"; - public const string OrderBy = "OrderBy"; - public const string PageLayoutCode = "Page_layout_code"; - public const string ProductSectionsSelector = "ProductSectionsSelector"; - public const string RelatedDocuments = "RelatedDocuments"; - public const string ReportGraphSelector = "ReportGraphSelector"; - public const string ReportTableSelector = "ReportTableSelector"; - public const string ReportValueSelector = "ReportValueSelector"; - public const string HtmlAreaControl = "HtmlAreaControl"; - public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; - public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; - public const string TagSelector = "TagSelector"; - public const string TextAreaControl = "TextAreaControl"; - public const string TextBoxControl = "TextBoxControl"; - public const string TextFilter = "TextFilter"; - public const string TranslationServiceSelector = "Translation_service_selector"; - public const string TwitterAutoPost = "Twitter_auto_post"; - public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; - public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; - public const string UniSelector = "Uni_selector"; - public const string SmurlShortenerSelector = "SMURLShortenerSelector"; - public const string ViewSecureText = "ViewSecureText"; - public const string WhereCondition = "WhereCondition"; - } -} \ No newline at end of file +// ReSharper disable InconsistentNaming + +namespace Migration.Toolkit.KX12.Auxiliary; + +public class Kx12FormControls +{ + public class UserControlForText + { + public const string AbTestConversionTypeSelector = "ABTestConversionTypeSelector"; + public const string ActivityTypeSelector = "ActivityTypeSelector"; + public const string AllowedExtensionsSelector = "AllowedExtensionsSelector"; + public const string Selectalternativeform = "selectalternativeform"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string AssemblyClassSelector = "AssemblyClassSelector"; + public const string Fieldselector = "fieldselector"; + public const string BizFormSelector = "BizFormSelector"; + public const string BundleInventoryTypeSelector = "BundleInventoryTypeSelector"; + public const string CampaignSelector = "CampaignSelector"; + public const string CategorySelector = "CategorySelector"; + public const string ClassFieldSelector = "ClassFieldSelector"; + public const string ClassFields = "Class_fields"; + public const string CodeName = "CodeName"; + public const string CodeNameWithPrefix = "CodeNameWithPrefix"; + public const string Selectcolor = "selectcolor"; + public const string Columns = "Columns"; + public const string ConnectionStringSelector = "Connection_string_selector"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CountrySelector = "countrySelector"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectculture = "selectculture"; + public const string CultureSelectorForSettings = "CultureSelectorForSettings"; + public const string CurrencySelector = "currencySelector"; + public const string CustomTableItemSelector = "CustomTableItemSelector"; + public const string CustomTableSelector = "CustomTableSelector"; + public const string Selectcolumns = "selectcolumns"; + public const string DepartmentSelector = "DepartmentSelector"; + public const string DropDownListControl = "DropDownListControl"; + public const string DueDateSelector = "Due_date_selector"; + public const string Emailinput = "emailinput"; + public const string EmailTemplateSelector = "Email_template_selector"; + public const string EmailTemplateTypeSelector = "Email_template_type_selector"; + public const string EncodingTextBox = "EncodingTextBox"; + public const string EncryptedPassword = "EncryptedPassword"; + public const string EnumSelector = "EnumSelector"; + public const string EventLogTypeSelector = "EventLogTypeSelector"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string FontIconSelector = "FontIconSelector"; + public const string FormFieldSelector = "FormFieldSelector"; + public const string FormPassword = "FormPassword"; + public const string FullMediaLibrarySelector = "FullMediaLibrarySelector"; + public const string GetGoogleTranslatorApiKey = "Get_Google_Translator_API_key"; + public const string GetMsTranslatorTextApiKey = "GetMSTranslatorTextAPIKey"; + public const string GoToExternalUrl = "Go_to_external_URL"; + public const string GoogleAnalyticsParameterSelector = "Google_Analytics_parameter_selector"; + public const string Html5Input = "HTML5Input"; + public const string IconSelector = "IconSelector"; + public const string InternalStatusSelector = "InternalStatusSelector"; + public const string Internationalphone = "internationalphone"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LicenseSelector = "LicenseSelector"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string ListBoxControl = "ListBoxControl"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroAnyAllBoolSelector = "Macro_any-all_bool_selector"; + public const string MacroAnyAllSelector = "MacroAnyAllSelector"; + public const string MacroDateOperator = "Macro_date_operator"; + public const string MacroEditor = "MacroEditor"; + public const string MacroEqualityOperator = "MacroEqualityOperator"; + public const string MacroNegationOperator = "MacroNegationOperator"; + public const string MacroNumericOperator = "Macro_numeric_operator"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MacroTextOperator = "Macro_text_operator"; + public const string MacroType = "MacroType"; + public const string ManufacturerSelector = "ManufacturerSelector"; + public const string MediaLibrarySelector = "MediaLibrarySelector"; + public const string MediaSelectionControl = "MediaSelectionControl"; + public const string MembershipSelector = "MembershipSelector"; + public const string MetafileUploaderControl = "MetafileUploaderControl"; + public const string ModuleSelector = "ModuleSelector"; + public const string MultipleCategoriesSelector = "MultipleCategoriesSelector"; + public const string MultipleChoiceControl = "MultipleChoiceControl"; + public const string RoleCheckboxSelector = "RoleCheckboxSelector"; + public const string SimpleCheckboxRoleSelector = "SimpleCheckboxRoleSelector"; + public const string SimpleCheckboxSiteSelector = "SimpleCheckboxSiteSelector"; + public const string MultipleUserSelector = "MultipleUserSelector"; + public const string NewsletterSelector = "NewsletterSelector"; + public const string NewsletterSelectorSimple = "NewsletterSelectorSimple"; + public const string NumericUpDown = "NumericUpDown"; + public const string ObjectColumnSelector = "ObjectColumnSelector"; + public const string ObjectSelector = "ObjectSelector"; + public const string ObjectTransformation = "ObjectTransformation"; + public const string ObjectTypeBinSelector = "ObjectTypeBinSelector"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionCategoryProductOptionSelector = "OptionCategoryProductOptionSelector"; + public const string OptionCategorySelectionTypeSelector = "OptionCategorySelectionTypeSelector"; + public const string OrderBy = "OrderBy"; + public const string OrderStatusSelector = "OrderStatusSelector"; + public const string DocumentCultureFilter = "DocumentCultureFilter"; + public const string PageLayoutCode = "Page_layout_code"; + public const string Selectdocument = "selectdocument"; + public const string PageTemplateLevels = "PageTemplateLevels"; + public const string Selectpagetemplate = "selectpagetemplate"; + public const string DocumentTypeIconSelector = "DocumentTypeIconSelector"; + public const string Selectclassnames = "selectclassnames"; + public const string Password = "Password"; + public const string PasswordStrength = "PasswordStrength"; + public const string PasswordConfirmator = "PasswordConfirmator"; + public const string Selectpath = "selectpath"; + public const string PaymentSelector = "paymentSelector"; + public const string ProductImageSelector = "ProductImageSelector"; + public const string ProductRelationshipNameSelector = "ProductRelationshipNameSelector"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string ProductTypeSelector = "ProductTypeSelector"; + public const string PublicStatusSelector = "PublicStatusSelector"; + public const string Selectquery = "selectquery"; + public const string RadioButtonsControl = "RadioButtonsControl"; + public const string AgeRangeSelector = "AgeRangeSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string Relationshipconfiguration = "relationshipconfiguration"; + public const string SelectRelationshipName = "SelectRelationshipName"; + public const string ReportSelectorDropDown = "ReportSelectorDropDown"; + public const string RoleSelector = "RoleSelector"; + public const string SearchClassNameSelector = "SearchClassNameSelector"; + public const string SearchIndexSelector = "SearchIndexSelector"; + public const string SearchIndexTypeSelector = "SearchIndexTypeSelector"; + public const string SelectCmsVersion = "SelectCMSVersion"; + public const string SettingsKeyControlSelector = "SettingsKeyControlSelector"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointListSelector = "SharePointListSelector"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string ShippingSelector = "shippingSelector"; + public const string ShippingServiceSelector = "ShippingServiceSelector"; + public const string Selectsinglepath = "selectsinglepath"; + public const string SinglePathSelectorWithPermissions = "SinglePathSelectorWithPermissions"; + public const string SiteContentCulture = "SiteContentCulture"; + public const string SiteCultureSelector = "SiteCultureSelector"; + public const string SiteCultureSelectorAll = "SiteCultureSelectorAll"; + public const string Selectsite = "selectsite"; + public const string SiteSelectorWithAllFieldForGlobalAdmin = "SiteSelectorWithAllFieldForGlobalAdmin"; + public const string SkuSelector = "SKUSelector"; + public const string StopWordsSelector = "StopWordsSelector"; + public const string SupplierSelector = "SupplierSelector"; + public const string SupportedCultureSelector = "SupportedCultureSelector"; + public const string TableConversionSettings = "TableConversionSettings"; + public const string TagGroupSelector = "TagGroupSelector"; + public const string TagSelector = "TagSelector"; + public const string TaxAddressTypeSelector = "TaxAddressTypeSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TextboxDefaultValueFromSetting = "Textbox_default_value_from_setting"; + public const string TextboxDoubleValidator = "Textbox_double_validator"; + public const string TimeZoneSelector = "TimeZoneSelector"; + public const string TimeZoneTypeSelector = "TimeZoneTypeSelector"; + public const string ToggleButton = "ToggleButton"; + public const string Selecttransformation = "selecttransformation"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string Usphone = "usphone"; + public const string Uszipcode = "uszipcode"; + public const string UiCultureSelector = "UICultureSelector"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string UrlChecker = "UrlChecker"; + public const string UrlSelector = "URLSelector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string UserName = "UserName"; + public const string UserNameSelector = "UserNameSelector"; + public const string UserSelector = "UserSelector"; + public const string ValiditySelector = "ValiditySelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + public const string WorkflowScopeDefinition = "WorkflowScopeDefinition"; + } + + public class UserControlForLongText + { + public const string AbTestConversionSelector = "ABTestConversionSelector"; + public const string AlternativeUrLsConstraintEditor = "AlternativeURLsConstraintEditor"; + public const string BbEditorControl = "BBEditorControl"; + public const string CacheDependencies = "CacheDependencies"; + public const string ClassFields = "Class_fields"; + public const string Columns = "Columns"; + public const string ConditionBuilder = "ConditionBuilder"; + public const string ContactClassFields = "Contact_class_fields"; + public const string CssStylesEditor = "CSS_Styles_Editor"; + public const string Selectcolumns = "selectcolumns"; + public const string DropDownListControl = "DropDownListControl"; + public const string FacebookAutoPost = "Facebook_auto_post"; + public const string SmFacebookPageAccessToken = "SMFacebookPageAccessToken"; + public const string FileSystemSelector = "FileSystemSelector"; + public const string Html5Input = "HTML5Input"; + public const string AutoResizeConfiguration = "AutoResizeConfiguration"; + public const string LabelControl = "LabelControl"; + public const string LargeTextArea = "LargeTextArea"; + public const string LinkedInAutoPost = "LinkedInAutoPost"; + public const string LinkedInCompanyAccessToken = "LinkedInCompanyAccessToken"; + public const string LocalizableTextArea = "LocalizableTextArea"; + public const string LocalizableTextBox = "LocalizableTextBox"; + public const string MacroEditor = "MacroEditor"; + public const string MacroSyntaxHighlighter = "MacroSyntaxHighlighter"; + public const string MultipleObjectBindingControl = "MultipleObjectBindingControl"; + public const string ObjectTypeSelector = "ObjectTypeSelector"; + public const string OptionsSelector = "OptionsSelector"; + public const string OrderBy = "OrderBy"; + public const string PageLayoutCode = "Page_layout_code"; + public const string ProductSectionsSelector = "ProductSectionsSelector"; + public const string RelatedDocuments = "RelatedDocuments"; + public const string ReportGraphSelector = "ReportGraphSelector"; + public const string ReportTableSelector = "ReportTableSelector"; + public const string ReportValueSelector = "ReportValueSelector"; + public const string HtmlAreaControl = "HtmlAreaControl"; + public const string SettingsKeyDefaultValue = "SettingsKeyDefaultValue"; + public const string SharePointServerConnectionTest = "SharePointServerConnectionTest"; + public const string TagSelector = "TagSelector"; + public const string TextAreaControl = "TextAreaControl"; + public const string TextBoxControl = "TextBoxControl"; + public const string TextFilter = "TextFilter"; + public const string TranslationServiceSelector = "Translation_service_selector"; + public const string TwitterAutoPost = "Twitter_auto_post"; + public const string SmTwitterPostTextArea = "SMTwitterPostTextArea"; + public const string UiElementPropertiesEditor = "UIElementPropertiesEditor"; + public const string UniSelector = "Uni_selector"; + public const string SmurlShortenerSelector = "SMURLShortenerSelector"; + public const string ViewSecureText = "ViewSecureText"; + public const string WhereCondition = "WhereCondition"; + } +} diff --git a/Migration.Toolkit.KX12/Context/KX12Context.cs b/Migration.Toolkit.KX12/Context/KX12Context.cs index f4ee8503..c2fefc4a 100644 --- a/Migration.Toolkit.KX12/Context/KX12Context.cs +++ b/Migration.Toolkit.KX12/Context/KX12Context.cs @@ -1,5223 +1,5058 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.KX12.Models; - -namespace Migration.Toolkit.KX12.Context; - -public partial class KX12Context : DbContext -{ - public KX12Context() - { - } - - public KX12Context(DbContextOptions options) - : base(options) - { - } - - public virtual DbSet AnalyticsCampaigns { get; set; } - - public virtual DbSet AnalyticsCampaignAssets { get; set; } - - public virtual DbSet AnalyticsCampaignAssetUrls { get; set; } - - public virtual DbSet AnalyticsCampaignConversions { get; set; } - - public virtual DbSet AnalyticsCampaignConversionHits { get; set; } - - public virtual DbSet AnalyticsCampaignObjectives { get; set; } - - public virtual DbSet AnalyticsConversions { get; set; } - - public virtual DbSet AnalyticsDayHits { get; set; } - - public virtual DbSet AnalyticsExitPages { get; set; } - - public virtual DbSet AnalyticsHourHits { get; set; } - - public virtual DbSet AnalyticsMonthHits { get; set; } - - public virtual DbSet AnalyticsStatistics { get; set; } - - public virtual DbSet AnalyticsWeekHits { get; set; } - - public virtual DbSet AnalyticsYearHits { get; set; } - - public virtual DbSet BadWordsWords { get; set; } - - public virtual DbSet BlogComments { get; set; } - - public virtual DbSet BlogPostSubscriptions { get; set; } - - public virtual DbSet BoardBoards { get; set; } - - public virtual DbSet BoardMessages { get; set; } - - public virtual DbSet BoardSubscriptions { get; set; } - - public virtual DbSet ChatInitiatedChatRequests { get; set; } - - public virtual DbSet ChatMessages { get; set; } - - public virtual DbSet ChatNotifications { get; set; } - - public virtual DbSet ChatOnlineSupports { get; set; } - - public virtual DbSet ChatOnlineUsers { get; set; } - - public virtual DbSet ChatPopupWindowSettings { get; set; } - - public virtual DbSet ChatRooms { get; set; } - - public virtual DbSet ChatRoomUsers { get; set; } - - public virtual DbSet ChatSupportCannedResponses { get; set; } - - public virtual DbSet ChatSupportTakenRooms { get; set; } - - public virtual DbSet ChatUsers { get; set; } - - public virtual DbSet CiFileMetadata { get; set; } - - public virtual DbSet CiMigrations { get; set; } - - public virtual DbSet CmsAbuseReports { get; set; } - - public virtual DbSet CmsAcls { get; set; } - - public virtual DbSet CmsAclitems { get; set; } - - public virtual DbSet CmsAlternativeForms { get; set; } - - public virtual DbSet CmsAlternativeUrls { get; set; } - - public virtual DbSet CmsAttachments { get; set; } - - public virtual DbSet CmsAttachmentHistories { get; set; } - - public virtual DbSet CmsAutomationHistories { get; set; } - - public virtual DbSet CmsAutomationStates { get; set; } - - public virtual DbSet CmsAvatars { get; set; } - - public virtual DbSet CmsBadges { get; set; } - - public virtual DbSet CmsBannedIps { get; set; } - - public virtual DbSet CmsBanners { get; set; } - - public virtual DbSet CmsBannerCategories { get; set; } - - public virtual DbSet CmsCategories { get; set; } - - public virtual DbSet CmsClasses { get; set; } - - public virtual DbSet CmsConsents { get; set; } - - public virtual DbSet CmsConsentAgreements { get; set; } - - public virtual DbSet CmsConsentArchives { get; set; } - - public virtual DbSet CmsCountries { get; set; } - - public virtual DbSet CmsCssStylesheets { get; set; } - - public virtual DbSet CmsCultures { get; set; } - - public virtual DbSet CmsDeviceProfiles { get; set; } - - public virtual DbSet CmsDeviceProfileLayouts { get; set; } - - public virtual DbSet CmsDocuments { get; set; } - - public virtual DbSet CmsDocumentAliases { get; set; } - - public virtual DbSet CmsDocumentTypeScopes { get; set; } - - public virtual DbSet CmsEmails { get; set; } - - public virtual DbSet CmsEmailAttachments { get; set; } - - public virtual DbSet CmsEmailTemplates { get; set; } - - public virtual DbSet CmsEmailUsers { get; set; } - - public virtual DbSet CmsEventLogs { get; set; } - - public virtual DbSet CmsExternalLogins { get; set; } - - public virtual DbSet CmsForms { get; set; } - - public virtual DbSet CmsFormUserControls { get; set; } - - public virtual DbSet CmsHelpTopics { get; set; } - - public virtual DbSet CmsLayouts { get; set; } - - public virtual DbSet CmsLicenseKeys { get; set; } - - public virtual DbSet CmsMacroIdentities { get; set; } - - public virtual DbSet CmsMacroRules { get; set; } - - public virtual DbSet CmsMemberships { get; set; } - - public virtual DbSet CmsMembershipUsers { get; set; } - - public virtual DbSet CmsMetaFiles { get; set; } - - public virtual DbSet CmsModuleLicenseKeys { get; set; } - - public virtual DbSet CmsModuleUsageCounters { get; set; } - - public virtual DbSet CmsObjectSettings { get; set; } - - public virtual DbSet CmsObjectVersionHistories { get; set; } - - public virtual DbSet CmsObjectWorkflowTriggers { get; set; } - - public virtual DbSet CmsOpenIdusers { get; set; } - - public virtual DbSet CmsPageTemplates { get; set; } - - public virtual DbSet CmsPageTemplateCategories { get; set; } - - public virtual DbSet CmsPageTemplateConfigurations { get; set; } - - public virtual DbSet CmsPageTemplateScopes { get; set; } - - public virtual DbSet CmsPermissions { get; set; } - - public virtual DbSet CmsPersonalizations { get; set; } - - public virtual DbSet CmsQueries { get; set; } - - public virtual DbSet CmsRelationships { get; set; } - - public virtual DbSet CmsRelationshipNames { get; set; } - - public virtual DbSet CmsResources { get; set; } - - public virtual DbSet CmsResourceLibraries { get; set; } - - public virtual DbSet CmsResourceStrings { get; set; } - - public virtual DbSet CmsResourceTranslations { get; set; } - - public virtual DbSet CmsRoles { get; set; } - - public virtual DbSet CmsScheduledTasks { get; set; } - - public virtual DbSet CmsSearchEngines { get; set; } - - public virtual DbSet CmsSearchIndices { get; set; } - - public virtual DbSet CmsSearchTasks { get; set; } - - public virtual DbSet CmsSearchTaskAzures { get; set; } - - public virtual DbSet CmsSessions { get; set; } - - public virtual DbSet CmsSettingsCategories { get; set; } - - public virtual DbSet CmsSettingsKeys { get; set; } - - public virtual DbSet CmsSites { get; set; } - - public virtual DbSet CmsSiteDomainAliases { get; set; } - - public virtual DbSet CmsSmtpservers { get; set; } - - public virtual DbSet CmsStates { get; set; } - - public virtual DbSet CmsTags { get; set; } - - public virtual DbSet CmsTagGroups { get; set; } - - public virtual DbSet CmsTemplateDeviceLayouts { get; set; } - - public virtual DbSet CmsTimeZones { get; set; } - - public virtual DbSet CmsTransformations { get; set; } - - public virtual DbSet CmsTranslationServices { get; set; } - - public virtual DbSet CmsTranslationSubmissions { get; set; } - - public virtual DbSet CmsTranslationSubmissionItems { get; set; } - - public virtual DbSet CmsTrees { get; set; } - - public virtual DbSet CmsUielements { get; set; } - - public virtual DbSet CmsUsers { get; set; } - - public virtual DbSet CmsUserCultures { get; set; } - - public virtual DbSet CmsUserMacroIdentities { get; set; } - - public virtual DbSet CmsUserRoles { get; set; } - - public virtual DbSet CmsUserSettings { get; set; } - - public virtual DbSet CmsUserSites { get; set; } - - public virtual DbSet CmsVersionHistories { get; set; } - - public virtual DbSet CmsWebFarmServers { get; set; } - - public virtual DbSet CmsWebFarmServerLogs { get; set; } - - public virtual DbSet CmsWebFarmServerMonitorings { get; set; } - - public virtual DbSet CmsWebFarmServerTasks { get; set; } - - public virtual DbSet CmsWebFarmTasks { get; set; } - - public virtual DbSet CmsWebParts { get; set; } - - public virtual DbSet CmsWebPartCategories { get; set; } - - public virtual DbSet CmsWebPartContainers { get; set; } - - public virtual DbSet CmsWebPartLayouts { get; set; } - - public virtual DbSet CmsWebTemplates { get; set; } - - public virtual DbSet CmsWidgets { get; set; } - - public virtual DbSet CmsWidgetCategories { get; set; } - - public virtual DbSet CmsWidgetRoles { get; set; } - - public virtual DbSet CmsWorkflows { get; set; } - - public virtual DbSet CmsWorkflowActions { get; set; } - - public virtual DbSet CmsWorkflowHistories { get; set; } - - public virtual DbSet CmsWorkflowScopes { get; set; } - - public virtual DbSet CmsWorkflowSteps { get; set; } - - public virtual DbSet CmsWorkflowStepRoles { get; set; } - - public virtual DbSet CmsWorkflowStepUsers { get; set; } - - public virtual DbSet CmsWorkflowTransitions { get; set; } - - public virtual DbSet ComAddresses { get; set; } - - public virtual DbSet ComBrands { get; set; } - - public virtual DbSet ComCarriers { get; set; } - - public virtual DbSet ComCollections { get; set; } - - public virtual DbSet ComCouponCodes { get; set; } - - public virtual DbSet ComCurrencies { get; set; } - - public virtual DbSet ComCurrencyExchangeRates { get; set; } - - public virtual DbSet ComCustomers { get; set; } - - public virtual DbSet ComCustomerCreditHistories { get; set; } - - public virtual DbSet ComDepartments { get; set; } - - public virtual DbSet ComDiscounts { get; set; } - - public virtual DbSet ComExchangeTables { get; set; } - - public virtual DbSet ComGiftCards { get; set; } - - public virtual DbSet ComGiftCardCouponCodes { get; set; } - - public virtual DbSet ComInternalStatuses { get; set; } - - public virtual DbSet ComManufacturers { get; set; } - - public virtual DbSet ComMultiBuyCouponCodes { get; set; } - - public virtual DbSet ComMultiBuyDiscounts { get; set; } - - public virtual DbSet ComMultiBuyDiscountBrands { get; set; } - - public virtual DbSet ComMultiBuyDiscountCollections { get; set; } - - public virtual DbSet ComMultiBuyDiscountTrees { get; set; } - - public virtual DbSet ComOptionCategories { get; set; } - - public virtual DbSet ComOrders { get; set; } - - public virtual DbSet ComOrderAddresses { get; set; } - - public virtual DbSet ComOrderItems { get; set; } - - public virtual DbSet ComOrderItemSkufiles { get; set; } - - public virtual DbSet ComOrderStatuses { get; set; } - - public virtual DbSet ComOrderStatusUsers { get; set; } - - public virtual DbSet ComPaymentOptions { get; set; } - - public virtual DbSet ComPublicStatuses { get; set; } - - public virtual DbSet ComShippingCosts { get; set; } - - public virtual DbSet ComShippingOptions { get; set; } - - public virtual DbSet ComShoppingCarts { get; set; } - - public virtual DbSet ComShoppingCartCouponCodes { get; set; } - - public virtual DbSet ComShoppingCartSkus { get; set; } - - public virtual DbSet ComSkus { get; set; } - - public virtual DbSet ComSkufiles { get; set; } - - public virtual DbSet ComSkuoptionCategories { get; set; } - - public virtual DbSet ComSuppliers { get; set; } - - public virtual DbSet ComTaxClasses { get; set; } - - public virtual DbSet ComTaxClassCountries { get; set; } - - public virtual DbSet ComTaxClassStates { get; set; } - - public virtual DbSet ComVolumeDiscounts { get; set; } - - public virtual DbSet ComWishlists { get; set; } - - public virtual DbSet CommunityGroups { get; set; } - - public virtual DbSet CommunityGroupMembers { get; set; } - - public virtual DbSet CommunityGroupRolePermissions { get; set; } - - public virtual DbSet CommunityInvitations { get; set; } - - public virtual DbSet ContentFiles { get; set; } - - public virtual DbSet EventsAttendees { get; set; } - - public virtual DbSet ExportHistories { get; set; } - - public virtual DbSet ExportTasks { get; set; } - - public virtual DbSet ForumsAttachments { get; set; } - - public virtual DbSet ForumsForums { get; set; } - - public virtual DbSet ForumsForumGroups { get; set; } - - public virtual DbSet ForumsForumPosts { get; set; } - - public virtual DbSet ForumsForumRoles { get; set; } - - public virtual DbSet ForumsForumSubscriptions { get; set; } - - public virtual DbSet ForumsUserFavorites { get; set; } - - public virtual DbSet IntegrationConnectors { get; set; } - - public virtual DbSet IntegrationSyncLogs { get; set; } - - public virtual DbSet IntegrationSynchronizations { get; set; } - - public virtual DbSet IntegrationTasks { get; set; } - - public virtual DbSet MediaFiles { get; set; } - - public virtual DbSet MediaLibraries { get; set; } - - public virtual DbSet MediaLibraryRolePermissions { get; set; } - - public virtual DbSet NewsletterAbtests { get; set; } - - public virtual DbSet NewsletterClickedLinks { get; set; } - - public virtual DbSet NewsletterEmails { get; set; } - - public virtual DbSet NewsletterEmailTemplates { get; set; } - - public virtual DbSet NewsletterEmailWidgets { get; set; } - - public virtual DbSet NewsletterEmailWidgetTemplates { get; set; } - - public virtual DbSet NewsletterIssueContactGroups { get; set; } - - public virtual DbSet NewsletterLinks { get; set; } - - public virtual DbSet NewsletterNewsletters { get; set; } - - public virtual DbSet NewsletterNewsletterIssues { get; set; } - - public virtual DbSet NewsletterOpenedEmails { get; set; } - - public virtual DbSet NewsletterSubscribers { get; set; } - - public virtual DbSet NewsletterSubscriberNewsletters { get; set; } - - public virtual DbSet NewsletterUnsubscriptions { get; set; } - - public virtual DbSet NotificationGateways { get; set; } - - public virtual DbSet NotificationSubscriptions { get; set; } - - public virtual DbSet NotificationTemplates { get; set; } - - public virtual DbSet NotificationTemplateTexts { get; set; } - - public virtual DbSet OmAbtests { get; set; } - - public virtual DbSet OmAbvariants { get; set; } - - public virtual DbSet OmAbvariantData { get; set; } - - public virtual DbSet OmAccounts { get; set; } - - public virtual DbSet OmAccountContacts { get; set; } - - public virtual DbSet OmAccountStatuses { get; set; } - - public virtual DbSet OmActivities { get; set; } - - public virtual DbSet OmActivityRecalculationQueues { get; set; } - - public virtual DbSet OmActivityTypes { get; set; } - - public virtual DbSet OmContacts { get; set; } - - public virtual DbSet OmContactChangeRecalculationQueues { get; set; } - - public virtual DbSet OmContactGroups { get; set; } - - public virtual DbSet OmContactGroupMembers { get; set; } - - public virtual DbSet OmContactRoles { get; set; } - - public virtual DbSet OmContactStatuses { get; set; } - - public virtual DbSet OmMemberships { get; set; } - - public virtual DbSet OmMvtcombinations { get; set; } - - public virtual DbSet OmMvtests { get; set; } - - public virtual DbSet OmMvtvariants { get; set; } - - public virtual DbSet OmPersonalizationVariants { get; set; } - - public virtual DbSet OmRules { get; set; } - - public virtual DbSet OmScores { get; set; } - - public virtual DbSet OmScoreContactRules { get; set; } - - public virtual DbSet OmVisitorToContacts { get; set; } - - public virtual DbSet PersonasPersonas { get; set; } - - public virtual DbSet PersonasPersonaContactHistories { get; set; } - - public virtual DbSet PersonasPersonaNodes { get; set; } - - public virtual DbSet PollsPolls { get; set; } - - public virtual DbSet PollsPollAnswers { get; set; } - - public virtual DbSet ReportingReports { get; set; } - - public virtual DbSet ReportingReportCategories { get; set; } - - public virtual DbSet ReportingReportGraphs { get; set; } - - public virtual DbSet ReportingReportSubscriptions { get; set; } - - public virtual DbSet ReportingReportTables { get; set; } - - public virtual DbSet ReportingReportValues { get; set; } - - public virtual DbSet ReportingSavedGraphs { get; set; } - - public virtual DbSet ReportingSavedReports { get; set; } - - public virtual DbSet SharePointSharePointConnections { get; set; } - - public virtual DbSet SharePointSharePointFiles { get; set; } - - public virtual DbSet SharePointSharePointLibraries { get; set; } - - public virtual DbSet SmFacebookAccounts { get; set; } - - public virtual DbSet SmFacebookApplications { get; set; } - - public virtual DbSet SmFacebookPosts { get; set; } - - public virtual DbSet SmInsights { get; set; } - - public virtual DbSet SmInsightHitDays { get; set; } - - public virtual DbSet SmInsightHitMonths { get; set; } - - public virtual DbSet SmInsightHitWeeks { get; set; } - - public virtual DbSet SmInsightHitYears { get; set; } - - public virtual DbSet SmLinkedInAccounts { get; set; } - - public virtual DbSet SmLinkedInApplications { get; set; } - - public virtual DbSet SmLinkedInPosts { get; set; } - - public virtual DbSet SmTwitterAccounts { get; set; } - - public virtual DbSet SmTwitterApplications { get; set; } - - public virtual DbSet SmTwitterPosts { get; set; } - - public virtual DbSet StagingServers { get; set; } - - public virtual DbSet StagingSynchronizations { get; set; } - - public virtual DbSet StagingTasks { get; set; } - - public virtual DbSet StagingTaskGroups { get; set; } - - public virtual DbSet StagingTaskGroupTasks { get; set; } - - public virtual DbSet StagingTaskGroupUsers { get; set; } - - public virtual DbSet StagingTaskUsers { get; set; } - - public virtual DbSet TempFiles { get; set; } - - public virtual DbSet TempPageBuilderWidgets { get; set; } - - public virtual DbSet ViewBoardsBoardMessageJoineds { get; set; } - - public virtual DbSet ViewCmsAclitemItemsAndOperators { get; set; } - - public virtual DbSet ViewCmsObjectVersionHistoryUserJoineds { get; set; } - - public virtual DbSet ViewCmsPageTemplateCategoryPageTemplateJoineds { get; set; } - - public virtual DbSet ViewCmsRelationshipJoineds { get; set; } - - public virtual DbSet ViewCmsResourceStringJoineds { get; set; } - - public virtual DbSet ViewCmsResourceTranslatedJoineds { get; set; } - - public virtual DbSet ViewCmsRoleResourcePermissionJoineds { get; set; } - - public virtual DbSet ViewCmsSiteDocumentCounts { get; set; } - - public virtual DbSet ViewCmsSiteRoleResourceUielementJoineds { get; set; } - - public virtual DbSet ViewCmsTreeJoineds { get; set; } - - public virtual DbSet ViewCmsUsers { get; set; } - - public virtual DbSet ViewCmsUserDocuments { get; set; } - - public virtual DbSet ViewCmsUserRoleJoineds { get; set; } - - public virtual DbSet ViewCmsUserRoleMembershipRoles { get; set; } - - public virtual DbSet ViewCmsUserRoleMembershipRoleValidOnlyJoineds { get; set; } - - public virtual DbSet ViewCmsUserSettingsRoleJoineds { get; set; } - - public virtual DbSet ViewCmsWebPartCategoryWebpartJoineds { get; set; } - - public virtual DbSet ViewCmsWidgetCategoryWidgetJoineds { get; set; } - - public virtual DbSet ViewComSkuoptionCategoryOptionCategoryJoineds { get; set; } - - public virtual DbSet ViewCommunityGroups { get; set; } - - public virtual DbSet ViewCommunityMembers { get; set; } - - public virtual DbSet ViewForumsGroupForumPostJoineds { get; set; } - - public virtual DbSet ViewIntegrationTaskJoineds { get; set; } - - public virtual DbSet ViewMembershipMembershipUserJoineds { get; set; } - - public virtual DbSet ViewNewsletterSubscriptionsJoineds { get; set; } - - public virtual DbSet ViewOmAccountContactAccountJoineds { get; set; } - - public virtual DbSet ViewOmAccountContactContactJoineds { get; set; } - - public virtual DbSet ViewOmAccountJoineds { get; set; } - - public virtual DbSet ViewOmContactGroupMemberAccountJoineds { get; set; } - - public virtual DbSet ViewPollAnswerCounts { get; set; } - - public virtual DbSet ViewReportingCategoryReportJoineds { get; set; } - - - - - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CampaignName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CampaignScheduledTask).WithMany(p => p.AnalyticsCampaigns).HasConstraintName("FK_Analytics_Campaign_CampaignScheduledTaskID_ScheduledTask"); - - entity.HasOne(d => d.CampaignSite).WithMany(p => p.AnalyticsCampaigns) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_Campaign_StatisticsSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignAssetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CampaignAssetType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignAssetCampaign).WithMany(p => p.AnalyticsCampaignAssets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignAsset_CampaignAssetCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignAssetUrlPageTitle).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignAssetUrlTarget).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignAssetUrlCampaignAsset).WithMany(p => p.AnalyticsCampaignAssetUrls) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID_Analytics_CampaignAsset"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignConversionActivityType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignConversionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignConversionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CampaignConversionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignConversionCampaign).WithMany(p => p.AnalyticsCampaignConversions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignConversion_CampaignConversionCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignConversionHitsSourceName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignConversionHitsConversion).WithMany(p => p.AnalyticsCampaignConversionHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID_Analytics_CampaignConversion"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignObjectiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.CampaignObjectiveCampaignConversion).WithMany(p => p.AnalyticsCampaignObjectives) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID_Analytics_CampaignConversion"); - - entity.HasOne(d => d.CampaignObjectiveCampaign).WithOne(p => p.AnalyticsCampaignObjective) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ConversionId).HasName("PK_CMS_Conversion"); - - entity.HasOne(d => d.ConversionSite).WithMany(p => p.AnalyticsConversions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_Conversion_ConversionSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_DayHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsDayHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_DayHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_HourHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsHourHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_HourHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_MonthHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsMonthHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_MonthHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StatisticsId).IsClustered(false); - - entity.HasIndex(e => e.StatisticsCode, "IX_Analytics_Statistics_StatisticsCode_StatisticsSiteID_StatisticsObjectID_StatisticsObjectCulture").IsClustered(); - - entity.Property(e => e.StatisticsCode).HasDefaultValueSql("('')"); - entity.Property(e => e.StatisticsObjectCulture).HasDefaultValueSql("(N'')"); - entity.Property(e => e.StatisticsObjectName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.StatisticsSite).WithMany(p => p.AnalyticsStatistics).HasConstraintName("FK_Analytics_Statistics_StatisticsSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_WeekHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsWeekHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_WeekHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_YearHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsYearHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_YearHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WordId).IsClustered(false); - - entity.HasIndex(e => e.WordExpression, "IX_BadWords_Word_WordExpression").IsClustered(); - - entity.Property(e => e.WordExpression).HasDefaultValueSql("(N'')"); - - entity.HasMany(d => d.Cultures).WithMany(p => p.Words) - .UsingEntity>( - "BadWordsWordCulture", - r => r.HasOne().WithMany() - .HasForeignKey("CultureId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_BadWords_WordCulture_CultureID_CMS_Culture"), - l => l.HasOne().WithMany() - .HasForeignKey("WordId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_BadWords_WordCulture_WordID_BadWords_Word"), - j => - { - j.HasKey("WordId", "CultureId"); - j.ToTable("BadWords_WordCulture"); - j.HasIndex(new[] { "CultureId" }, "IX_BadWords_WordCulture_CultureID"); - j.IndexerProperty("WordId").HasColumnName("WordID"); - j.IndexerProperty("CultureId").HasColumnName("CultureID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CommentId).IsClustered(false); - - entity.HasIndex(e => e.CommentDate, "IX_Blog_Comment_CommentDate") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.CommentApproved).HasDefaultValueSql("((0))"); - entity.Property(e => e.CommentIsSpam).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CommentApprovedByUser).WithMany(p => p.BlogCommentCommentApprovedByUsers).HasConstraintName("FK_Blog_Comment_CommentApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.CommentPostDocument).WithMany(p => p.BlogComments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Blog_Comment_CommentPostDocumentID_CMS_Document"); - - entity.HasOne(d => d.CommentUser).WithMany(p => p.BlogCommentCommentUsers).HasConstraintName("FK_Blog_Comment_CommentUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SubscriptionPostDocument).WithMany(p => p.BlogPostSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Blog_PostSubscription_SubscriptionPostDocumentID_CMS_Document"); - - entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.BlogPostSubscriptions).HasConstraintName("FK_Blog_PostSubscription_SubscriptionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BoardName).HasDefaultValueSql("('')"); - entity.Property(e => e.BoardRequireEmails).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.BoardDocument).WithMany(p => p.BoardBoards) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Board_BoardDocumentID_CMS_Document"); - - entity.HasOne(d => d.BoardGroup).WithMany(p => p.BoardBoards).HasConstraintName("FK_Board_Board_BoardGroupID_Community_Group"); - - entity.HasOne(d => d.BoardSite).WithMany(p => p.BoardBoards) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Board_BoardSiteID_CMS_Site"); - - entity.HasOne(d => d.BoardUser).WithMany(p => p.BoardBoards).HasConstraintName("FK_Board_Board_BoardUserID_CMS_User"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Boards) - .UsingEntity>( - "BoardRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Role_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("BoardId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Role_BoardID_Board_Board"), - j => - { - j.HasKey("BoardId", "RoleId"); - j.ToTable("Board_Role"); - j.HasIndex(new[] { "RoleId" }, "IX_Board_Role_RoleID"); - j.IndexerProperty("BoardId").HasColumnName("BoardID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - - entity.HasMany(d => d.Users).WithMany(p => p.Boards) - .UsingEntity>( - "BoardModerator", - r => r.HasOne().WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Moderator_UserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("BoardId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Moderator_BoardID_Board_Board"), - j => - { - j.HasKey("BoardId", "UserId"); - j.ToTable("Board_Moderator"); - j.HasIndex(new[] { "UserId" }, "IX_Board_Moderator_UserID"); - j.IndexerProperty("BoardId").HasColumnName("BoardID"); - j.IndexerProperty("UserId").HasColumnName("UserID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MessageId).IsClustered(false); - - entity.HasIndex(e => e.MessageInserted, "IX_Board_Message_MessageInserted") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.MessageEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MessageInserted).HasDefaultValueSql("('8/26/2008 12:14:50 PM')"); - entity.Property(e => e.MessageLastModified).HasDefaultValueSql("('8/26/2008 12:15:04 PM')"); - entity.Property(e => e.MessageText).HasDefaultValueSql("('')"); - entity.Property(e => e.MessageUrl).HasDefaultValueSql("('')"); - entity.Property(e => e.MessageUserInfo).HasDefaultValueSql("('')"); - entity.Property(e => e.MessageUserName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.MessageApprovedByUser).WithMany(p => p.BoardMessageMessageApprovedByUsers).HasConstraintName("FK_Board_Message_MessageApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.MessageBoard).WithMany(p => p.BoardMessagesNavigation) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Message_MessageBoardID_Board_Board"); - - entity.HasOne(d => d.MessageUser).WithMany(p => p.BoardMessageMessageUsers).HasConstraintName("FK_Board_Message_MessageUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubscriptionEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SubscriptionBoard).WithMany(p => p.BoardSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Board_Subscription_SubscriptionBoardID_Board_Board"); - - entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.BoardSubscriptions).HasConstraintName("FK_Board_Subscription_SubscriptionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.InitiatedChatRequestState).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.InitiatedChatRequestInitiatorChatUser).WithMany(p => p.ChatInitiatedChatRequests) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_InitiatedChatRequest_Chat_User"); - - entity.HasOne(d => d.InitiatedChatRequestRoom).WithOne(p => p.ChatInitiatedChatRequest) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_InitiatedChatRequest_Chat_Room"); - - entity.HasOne(d => d.InitiatedChatRequestUser).WithMany(p => p.ChatInitiatedChatRequests).HasConstraintName("FK_Chat_InitiatedChatRequest_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatMessageId).HasName("PK_CMS_ChatMessage"); - - entity.Property(e => e.ChatMessageCreatedWhen).HasDefaultValueSql("('7/25/2011 2:47:18 PM')"); - entity.Property(e => e.ChatMessageIpaddress).HasDefaultValueSql("('')"); - entity.Property(e => e.ChatMessageLastModified).HasDefaultValueSql("('8/3/2011 11:24:54 AM')"); - entity.Property(e => e.ChatMessageText).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ChatMessageRecipient).WithMany(p => p.ChatMessageChatMessageRecipients).HasConstraintName("FK_Chat_Message_Chat_User_Recipient"); - - entity.HasOne(d => d.ChatMessageRoom).WithMany(p => p.ChatMessages) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_Message_Chat_Room"); - - entity.HasOne(d => d.ChatMessageUser).WithMany(p => p.ChatMessageChatMessageUsers).HasConstraintName("FK_Chat_Message_Chat_User_Sender"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatNotificationId).HasName("PK_CMS_ChatNotification"); - - entity.HasOne(d => d.ChatNotificationReceiver).WithMany(p => p.ChatNotificationChatNotificationReceivers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_Notification_Chat_User_Receiver"); - - entity.HasOne(d => d.ChatNotificationRoom).WithMany(p => p.ChatNotifications).HasConstraintName("FK_Chat_Notification_Chat_Room"); - - entity.HasOne(d => d.ChatNotificationSender).WithMany(p => p.ChatNotificationChatNotificationSenders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_Notification_Chat_User_Sender"); - - entity.HasOne(d => d.ChatNotificationSite).WithMany(p => p.ChatNotifications).HasConstraintName("FK_Chat_Notification_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ChatOnlineSupportChatUser).WithMany(p => p.ChatOnlineSupports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_OnlineSupport_Chat_User"); - - entity.HasOne(d => d.ChatOnlineSupportSite).WithMany(p => p.ChatOnlineSupports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_OnlineSupport_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ChatOnlineUserChatUser).WithMany(p => p.ChatOnlineUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_OnlineUser_Chat_User"); - - entity.HasOne(d => d.ChatOnlineUserSite).WithMany(p => p.ChatOnlineUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_OnlineUser_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatRoomId).HasName("PK_CMS_ChatRoom"); - - entity.Property(e => e.ChatRoomDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ChatRoomLastModification).HasDefaultValueSql("('10/19/2011 12:16:33 PM')"); - entity.Property(e => e.ChatRoomPrivateStateLastModification).HasDefaultValueSql("('1/30/2012 4:36:47 PM')"); - - entity.HasOne(d => d.ChatRoomCreatedByChatUser).WithMany(p => p.ChatRooms).HasConstraintName("FK_Chat_Room_Chat_User"); - - entity.HasOne(d => d.ChatRoomSite).WithMany(p => p.ChatRooms).HasConstraintName("FK_Chat_Room_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatRoomUserId).HasName("PK_CMS_ChatRoomUser"); - - entity.Property(e => e.ChatRoomUserLastModification).HasDefaultValueSql("('11/10/2011 3:29:00 PM')"); - - entity.HasOne(d => d.ChatRoomUserChatUser).WithMany(p => p.ChatRoomUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_RoomUser_Chat_User"); - - entity.HasOne(d => d.ChatRoomUserRoom).WithMany(p => p.ChatRoomUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_RoomUser_Chat_Room"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatSupportCannedResponseId).HasName("PK_CMS_ChatSupportCannedResponse"); - - entity.Property(e => e.ChatSupportCannedResponseTagName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ChatSupportCannedResponseChatUser).WithMany(p => p.ChatSupportCannedResponses).HasConstraintName("FK_Chat_SupportCannedResponse_Chat_User"); - - entity.HasOne(d => d.ChatSupportCannedResponseSite).WithMany(p => p.ChatSupportCannedResponses).HasConstraintName("FK_Chat_SupportCannedResponse_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatSupportTakenRoomId).HasName("PK_Chat_SupportTakenRooms"); - - entity.Property(e => e.ChatSupportTakenRoomLastModification).HasDefaultValueSql("('4/16/2012 5:11:30 PM')"); - - entity.HasOne(d => d.ChatSupportTakenRoomChatUser).WithMany(p => p.ChatSupportTakenRooms).HasConstraintName("FK_Chat_SupportTakenRoom_Chat_User"); - - entity.HasOne(d => d.ChatSupportTakenRoomRoom).WithMany(p => p.ChatSupportTakenRooms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Chat_SupportTakenRoom_Chat_Room"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ChatUserId).HasName("PK_CMS_ChatUser"); - - entity.Property(e => e.ChatUserLastModification).HasDefaultValueSql("('2/20/2012 2:02:00 PM')"); - entity.Property(e => e.ChatUserNickname).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ChatUserUser).WithMany(p => p.ChatUsers).HasConstraintName("FK_Chat_User_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FileLocation).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ReportId).IsClustered(false); - - entity.HasIndex(e => e.ReportWhen, "IX_CMS_AbuseReport_ReportWhen") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.ReportComment).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportCulture).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportTitle).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportUrl).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportWhen).HasDefaultValueSql("('9/11/2008 4:32:15 PM')"); - - entity.HasOne(d => d.ReportSite).WithMany(p => p.CmsAbuseReports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AbuseReport_ReportSiteID_CMS_Site"); - - entity.HasOne(d => d.ReportUser).WithMany(p => p.CmsAbuseReports).HasConstraintName("FK_CMS_AbuseReport_ReportUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AclinheritedAcls).HasDefaultValueSql("('')"); - entity.Property(e => e.AcllastModified).HasDefaultValueSql("('10/30/2008 9:17:31 AM')"); - - entity.HasOne(d => d.Aclsite).WithMany(p => p.CmsAcls).HasConstraintName("FK_CMS_ACL_ACLSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Acl).WithMany(p => p.CmsAclitems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ACLItem_ACLID_CMS_ACL"); - - entity.HasOne(d => d.LastModifiedByUser).WithMany(p => p.CmsAclitemLastModifiedByUsers).HasConstraintName("FK_CMS_ACLItem_LastModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsAclitems).HasConstraintName("FK_CMS_ACLItem_RoleID_CMS_Role"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsAclitemUsers).HasConstraintName("FK_CMS_ACLItem_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormHideNewParentFields).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FormClass).WithMany(p => p.CmsAlternativeFormFormClasses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AlternativeForm_FormClassID_CMS_Class"); - - entity.HasOne(d => d.FormCoupledClass).WithMany(p => p.CmsAlternativeFormFormCoupledClasses).HasConstraintName("FK_CMS_AlternativeForm_FormCoupledClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AlternativeUrlLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.AlternativeUrlUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AlternativeUrlDocument).WithMany(p => p.CmsAlternativeUrls) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AlternativeUrl_CMS_Document"); - - entity.HasOne(d => d.AlternativeUrlSite).WithMany(p => p.CmsAlternativeUrls) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AlternativeUrl_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AttachmentId).IsClustered(false); - - entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName, e.AttachmentIsUnsorted, e.AttachmentOrder }, "IX_CMS_Attachment_AttachmentDocumentID_AttachmentIsUnsorted_AttachmentName_AttachmentOrder").IsClustered(); - - entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_Attachment_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") - .IsUnique() - .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); - - entity.HasOne(d => d.AttachmentDocument).WithMany(p => p.CmsAttachments).HasConstraintName("FK_CMS_Attachment_AttachmentDocumentID_CMS_Document"); - - entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Attachment_AttachmentSiteID_CMS_Site"); - - entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_Attachment_AttachmentVariantParentID_CMS_Attachment"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AttachmentHistoryId).IsClustered(false); - - entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName }, "IX_CMS_AttachmentHistory_AttachmentDocumentID_AttachmentName").IsClustered(); - - entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_AttachmentHistory_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") - .IsUnique() - .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); - - entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachmentHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentHistory_AttachmentSiteID_CMS_Site"); - - entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_AttachmentHistory_AttachmentVariantParentID_CMS_AttachmentHistory"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); - entity.Property(e => e.HistoryStepDisplayName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.HistoryApprovedByUser).WithMany(p => p.CmsAutomationHistories).HasConstraintName("FK_CMS_AutomationHistory_HistoryApprovedByUserID"); - - entity.HasOne(d => d.HistoryState).WithMany(p => p.CmsAutomationHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationHistory_HistoryStateID"); - - entity.HasOne(d => d.HistoryStep).WithMany(p => p.CmsAutomationHistoryHistorySteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryStepID"); - - entity.HasOne(d => d.HistoryTargetStep).WithMany(p => p.CmsAutomationHistoryHistoryTargetSteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryTargetStepID"); - - entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsAutomationHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationHistory_HistoryWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.StateSite).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateSiteID_CMS_Site"); - - entity.HasOne(d => d.StateStep).WithMany(p => p.CmsAutomationStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationState_StateStepID"); - - entity.HasOne(d => d.StateUser).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateUserID_CMS_User"); - - entity.HasOne(d => d.StateWorkflow).WithMany(p => p.CmsAutomationStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationState_StateWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AvatarId).IsClustered(false); - - entity.HasIndex(e => e.AvatarName, "IX_CMS_Avatar_AvatarName").IsClustered(); - - entity.Property(e => e.DefaultFemaleUserAvatar).HasDefaultValueSql("((0))"); - entity.Property(e => e.DefaultGroupAvatar).HasDefaultValueSql("((0))"); - entity.Property(e => e.DefaultMaleUserAvatar).HasDefaultValueSql("((0))"); - entity.Property(e => e.DefaultUserAvatar).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.BadgeId).IsClustered(false); - - entity.HasIndex(e => e.BadgeTopLimit, "IX_CMS_Badge_BadgeTopLimit") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.BadgeDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.BadgeLastModified).HasDefaultValueSql("('9/25/2008 5:07:55 PM')"); - entity.Property(e => e.BadgeName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IpaddressId).IsClustered(false); - - entity.HasIndex(e => new { e.Ipaddress, e.IpaddressSiteId }, "IX_CMS_BannedIP_IPAddressSiteID_IPAddress").IsClustered(); - - entity.Property(e => e.IpaddressBanEnabled).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.IpaddressSite).WithMany(p => p.CmsBannedIps).HasConstraintName("FK_CMS_BannedIP_IPAddressSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BannerContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BannerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.BannerEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.BannerLastModified).HasDefaultValueSql("('1/1/1970 12:00:00 AM')"); - entity.Property(e => e.BannerName).HasDefaultValueSql("('')"); - entity.Property(e => e.BannerType).HasDefaultValueSql("((2))"); - entity.Property(e => e.BannerWeight).HasDefaultValueSql("((5))"); - - entity.HasOne(d => d.BannerCategory).WithMany(p => p.CmsBanners) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Banner_CMS_BannerCategory"); - - entity.HasOne(d => d.BannerSite).WithMany(p => p.CmsBanners).HasConstraintName("FK_CMS_Banner_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.BannerCategoryId).HasName("PK__CMS_BannerCategory"); - - entity.Property(e => e.BannerCategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.BannerCategoryEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.BannerCategoryLastModified).HasDefaultValueSql("('1/1/1970 12:00:00 AM')"); - entity.Property(e => e.BannerCategoryName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.BannerCategorySite).WithMany(p => p.CmsBannerCategories).HasConstraintName("FK_CMS_BannerCategory_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_CMS_Category_CategoryDisplayName_CategoryEnabled").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.CategorySite).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategorySiteID_CMS_Site"); - - entity.HasOne(d => d.CategoryUser).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategoryUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ClassId).IsClustered(false); - - entity.HasIndex(e => new { e.ClassId, e.ClassName, e.ClassDisplayName }, "IX_CMS_Class_ClassID_ClassName_ClassDisplayName").IsClustered(); - - entity.Property(e => e.ClassIsContentOnly).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ClassDefaultPageTemplate).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassDefaultPageTemplateID_CMS_PageTemplate"); - - entity.HasOne(d => d.ClassPageTemplateCategory).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassPageTemplateCategoryID_CMS_PageTemplateCategory"); - - entity.HasOne(d => d.ClassResource).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassResourceID_CMS_Resource"); - - entity.HasMany(d => d.ChildClasses).WithMany(p => p.ParentClasses) - .UsingEntity>( - "CmsAllowedChildClass", - r => r.HasOne().WithMany() - .HasForeignKey("ChildClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ParentClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), - j => - { - j.HasKey("ParentClassId", "ChildClassId"); - j.ToTable("CMS_AllowedChildClasses"); - j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); - j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); - j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); - }); - - entity.HasMany(d => d.ParentClasses).WithMany(p => p.ChildClasses) - .UsingEntity>( - "CmsAllowedChildClass", - r => r.HasOne().WithMany() - .HasForeignKey("ParentClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ChildClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), - j => - { - j.HasKey("ParentClassId", "ChildClassId"); - j.ToTable("CMS_AllowedChildClasses"); - j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); - j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); - j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); - }); - - entity.HasMany(d => d.Sites).WithMany(p => p.Classes) - .UsingEntity>( - "CmsClassSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Class_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Class_ClassID_CMS_Class"), - j => - { - j.HasKey("ClassId", "SiteId"); - j.ToTable("CMS_ClassSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_ClassSite_SiteID"); - j.IndexerProperty("ClassId").HasColumnName("ClassID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ConsentName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentAgreementTime).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ConsentAgreementConsent).WithMany(p => p.CmsConsentAgreements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementConsentID_CMS_Consent"); - - entity.HasOne(d => d.ConsentAgreementContact).WithMany(p => p.CmsConsentAgreements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementContactID_OM_Contact"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentArchiveContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentArchiveHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentArchiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ConsentArchiveConsent).WithMany(p => p.CmsConsentArchives) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentArchive_ConsentArchiveConsentID_CMS_Consent"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CountryId).IsClustered(false); - - entity.HasIndex(e => e.CountryDisplayName, "IX_CMS_Country_CountryDisplayName").IsClustered(); - - entity.Property(e => e.CountryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CountryLastModified).HasDefaultValueSql("('11/14/2013 1:43:04 PM')"); - entity.Property(e => e.CountryName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StylesheetId).IsClustered(false); - - entity.HasIndex(e => e.StylesheetDisplayName, "IX_CMS_CssStylesheet_StylesheetDisplayName").IsClustered(); - - entity.Property(e => e.StylesheetDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.StylesheetDynamicLanguage).HasDefaultValueSql("('plaincss')"); - entity.Property(e => e.StylesheetName).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Stylesheets) - .UsingEntity>( - "CmsCssStylesheetSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_CssStylesheetSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("StylesheetId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_CssStylesheetSite_StylesheetID_CMS_CssStylesheet"), - j => - { - j.HasKey("StylesheetId", "SiteId"); - j.ToTable("CMS_CssStylesheetSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_CssStylesheetSite_SiteID"); - j.IndexerProperty("StylesheetId").HasColumnName("StylesheetID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CultureId).IsClustered(false); - - entity.HasIndex(e => e.CultureName, "IX_CMS_Culture_CultureName").IsClustered(); - - entity.Property(e => e.CultureIsUiculture).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ProfileEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ProfileName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.DeviceProfile).WithMany(p => p.CmsDeviceProfileLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DeviceProfileLayout_DeviceProfileID_CMS_DeviceProfile"); - - entity.HasOne(d => d.SourceLayout).WithMany(p => p.CmsDeviceProfileLayoutSourceLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DeviceProfileLayout_SourceLayoutID_CMS_Layout"); - - entity.HasOne(d => d.TargetLayout).WithMany(p => p.CmsDeviceProfileLayoutTargetLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DeviceProfileLayout_TargetLayoutID_CMS_Layout"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DocumentCanBePublished).HasDefaultValueSql("((1))"); - entity.Property(e => e.DocumentInheritsStylesheet).HasDefaultValueSql("((1))"); - entity.Property(e => e.DocumentMenuRedirectToFirstChild).HasDefaultValueSql("((0))"); - entity.Property(e => e.DocumentUseCustomExtensions).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.DocumentCheckedOutByUser).WithMany(p => p.CmsDocumentDocumentCheckedOutByUsers).HasConstraintName("FK_CMS_Document_DocumentCheckedOutByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentCheckedOutVersionHistory).WithMany(p => p.CmsDocumentDocumentCheckedOutVersionHistories).HasConstraintName("FK_CMS_Document_DocumentCheckedOutVersionHistoryID_CMS_VersionHistory"); - - entity.HasOne(d => d.DocumentCreatedByUser).WithMany(p => p.CmsDocumentDocumentCreatedByUsers).HasConstraintName("FK_CMS_Document_DocumentCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentModifiedByUser).WithMany(p => p.CmsDocumentDocumentModifiedByUsers).HasConstraintName("FK_CMS_Document_DocumentModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentNode).WithMany(p => p.CmsDocuments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Document_DocumentNodeID_CMS_Tree"); - - entity.HasOne(d => d.DocumentPageTemplate).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentPageTemplateID_CMS_Template"); - - entity.HasOne(d => d.DocumentPublishedVersionHistory).WithMany(p => p.CmsDocumentDocumentPublishedVersionHistories).HasConstraintName("FK_CMS_Document_DocumentPublishedVersionHistoryID_CMS_VersionHistory"); - - entity.HasOne(d => d.DocumentStylesheet).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentStylesheetID_CMS_CssStylesheet"); - - entity.HasOne(d => d.DocumentTagGroup).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentTagGroupID_CMS_TagGroup"); - - entity.HasOne(d => d.DocumentWorkflowStep).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentWorkflowStepID_CMS_WorkflowStep"); - - entity.HasMany(d => d.Categories).WithMany(p => p.Documents) - .UsingEntity>( - "CmsDocumentCategory", - r => r.HasOne().WithMany() - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentCategory_CategoryID_CMS_Category"), - l => l.HasOne().WithMany() - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentCategory_DocumentID_CMS_Document"), - j => - { - j.HasKey("DocumentId", "CategoryId"); - j.ToTable("CMS_DocumentCategory"); - j.HasIndex(new[] { "CategoryId" }, "IX_CMS_DocumentCategory_CategoryID"); - j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); - j.IndexerProperty("CategoryId").HasColumnName("CategoryID"); - }); - - entity.HasMany(d => d.Tags).WithMany(p => p.Documents) - .UsingEntity>( - "CmsDocumentTag", - r => r.HasOne().WithMany() - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTag_TagID_CMS_Tag"), - l => l.HasOne().WithMany() - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTag_DocumentID_CMS_Document"), - j => - { - j.HasKey("DocumentId", "TagId"); - j.ToTable("CMS_DocumentTag"); - j.HasIndex(new[] { "TagId" }, "IX_CMS_DocumentTag_TagID"); - j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); - j.IndexerProperty("TagId").HasColumnName("TagID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AliasId).IsClustered(false); - - entity.HasIndex(e => e.AliasUrlpath, "IX_CMS_DocumentAlias_AliasURLPath").IsClustered(); - - entity.Property(e => e.AliasCulture).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AliasExtensions).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AliasLastModified).HasDefaultValueSql("('10/22/2008 12:55:43 PM')"); - entity.Property(e => e.AliasUrlpath).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AliasNode).WithMany(p => p.CmsDocumentAliases) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentAlias_AliasNodeID_CMS_Tree"); - - entity.HasOne(d => d.AliasSite).WithMany(p => p.CmsDocumentAliases) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentAlias_AliasSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ScopeId).IsClustered(false); - - entity.HasIndex(e => e.ScopePath, "IX_CMS_DocumentTypeScope_ScopePath").IsClustered(); - - entity.Property(e => e.ScopeAllowAbvariant).HasDefaultValueSql("((0))"); - entity.Property(e => e.ScopeAllowAllTypes).HasDefaultValueSql("((0))"); - entity.Property(e => e.ScopeAllowLinks).HasDefaultValueSql("((0))"); - entity.Property(e => e.ScopeLastModified).HasDefaultValueSql("('4/30/2013 2:47:21 PM')"); - entity.Property(e => e.ScopePath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsDocumentTypeScopes).HasConstraintName("FK_CMS_DocumentTypeScope_ScopeSiteID_CMS_Site"); - - entity.HasMany(d => d.Classes).WithMany(p => p.Scopes) - .UsingEntity>( - "CmsDocumentTypeScopeClass", - r => r.HasOne().WithMany() - .HasForeignKey("ClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ScopeId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ScopeID_CMS_DocumentTypeScope"), - j => - { - j.HasKey("ScopeId", "ClassId"); - j.ToTable("CMS_DocumentTypeScopeClass"); - j.HasIndex(new[] { "ClassId" }, "IX_CMS_DocumentTypeScopeClass_ClassID"); - j.IndexerProperty("ScopeId").HasColumnName("ScopeID"); - j.IndexerProperty("ClassId").HasColumnName("ClassID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailFrom).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailIsMass).HasDefaultValueSql("((1))"); - entity.Property(e => e.EmailLastModified).HasDefaultValueSql("('6/17/2016 10:11:21 AM')"); - entity.Property(e => e.EmailSubject).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Attachments).WithMany(p => p.Emails) - .UsingEntity>( - "CmsAttachmentForEmail", - r => r.HasOne().WithMany() - .HasForeignKey("AttachmentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentForEmail_AttachmentID_CMS_EmailAttachment"), - l => l.HasOne().WithMany() - .HasForeignKey("EmailId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentForEmail_EmailID_CMS_Email"), - j => - { - j.HasKey("EmailId", "AttachmentId"); - j.ToTable("CMS_AttachmentForEmail"); - j.HasIndex(new[] { "AttachmentId" }, "IX_CMS_AttachmentForEmail_AttachmentID"); - j.IndexerProperty("EmailId").HasColumnName("EmailID"); - j.IndexerProperty("AttachmentId").HasColumnName("AttachmentID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.EmailTemplateId).IsClustered(false); - - entity.HasIndex(e => e.EmailTemplateDisplayName, "IX_CMS_EmailTemplate_EmailTemplateDisplayName").IsClustered(); - - entity.Property(e => e.EmailTemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.EmailTemplateName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailTemplateSite).WithMany(p => p.CmsEmailTemplates).HasConstraintName("FK_CMS_Email_EmailTemplateSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Email).WithMany(p => p.CmsEmailUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_EmailUser_EmailID_CMS_Email"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsEmailUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_EmailUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DocumentName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventMachineName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventTime).HasDefaultValueSql("('4/21/2015 8:21:43 AM')"); - entity.Property(e => e.EventType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventUrl).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventUrlReferrer).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Ipaddress).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Source).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.User).WithMany(p => p.CmsExternalLogins) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ExternalLogin_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.FormId).IsClustered(false); - - entity.HasIndex(e => e.FormDisplayName, "IX_CMS_Form_FormDisplayName").IsClustered(); - - entity.Property(e => e.FormConfirmationEmailSubject).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormEmailAttachUploadedDocs).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormLastModified).HasDefaultValueSql("('9/17/2012 1:37:08 PM')"); - entity.Property(e => e.FormLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.FormName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormSubmitButtonText).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.FormClass).WithMany(p => p.CmsForms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Form_FormClassID_CMS_Class"); - - entity.HasOne(d => d.FormSite).WithMany(p => p.CmsForms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Form_FormSiteID_CMS_Site"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Forms) - .UsingEntity>( - "CmsFormRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_FormRole_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("FormId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_FormRole_FormID_CMS_Form"), - j => - { - j.HasKey("FormId", "RoleId"); - j.ToTable("CMS_FormRole"); - j.HasIndex(new[] { "RoleId" }, "IX_CMS_FormRole_RoleID"); - j.IndexerProperty("FormId").HasColumnName("FormID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.UserControlId).IsClustered(false); - - entity.HasIndex(e => e.UserControlDisplayName, "IX_CMS_FormUserControl_UserControlDisplayName").IsClustered(); - - entity.Property(e => e.UserControlIsSystem).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserControlPriority).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserControlShowInCustomTables).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.UserControlParent).WithMany(p => p.InverseUserControlParent).HasConstraintName("FK_CMS_FormUserControl_UserControlParentID_CMS_FormUserControl"); - - entity.HasOne(d => d.UserControlResource).WithMany(p => p.CmsFormUserControls).HasConstraintName("FK_CMS_FormUserControl_UserControlResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HelpTopicLink).HasDefaultValueSql("(N'')"); - entity.Property(e => e.HelpTopicName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.HelpTopicUielement).WithMany(p => p.CmsHelpTopics) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_HelpTopic_HelpTopicUIElementID_CMS_UIElement"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LayoutCode).HasDefaultValueSql("('')"); - entity.Property(e => e.LayoutCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.LayoutDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LayoutIconClass).HasDefaultValueSql("(N'icon-layout')"); - entity.Property(e => e.LayoutIsConvertible).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.LicenseKeyId).IsClustered(false); - - entity.HasIndex(e => e.LicenseDomain, "IX_CMS_LicenseKey_LicenseDomain").IsClustered(); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.MacroIdentityName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.MacroIdentityEffectiveUser).WithMany(p => p.CmsMacroIdentities).HasConstraintName("FK_CMS_MacroIdentity_MacroIdentityEffectiveUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MacroRuleAvailability).HasDefaultValueSql("((0))"); - entity.Property(e => e.MacroRuleCondition).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MacroRuleDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.MacroRuleEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MacroRuleIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.MacroRuleLastModified).HasDefaultValueSql("('5/1/2012 8:46:33 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.MembershipSite).WithMany(p => p.CmsMemberships).HasConstraintName("FK_CMS_Membership_MembershipSiteID_CMS_Site"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Memberships) - .UsingEntity>( - "CmsMembershipRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipRole_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("MembershipId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipRole_MembershipID_CMS_Membership"), - j => - { - j.HasKey("MembershipId", "RoleId"); - j.ToTable("CMS_MembershipRole"); - j.HasIndex(new[] { "RoleId" }, "IX_CMS_MembershipRole_RoleID"); - j.IndexerProperty("MembershipId").HasColumnName("MembershipID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Membership).WithMany(p => p.CmsMembershipUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipUser_MembershipID_CMS_Membership"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsMembershipUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MetaFileId).IsClustered(false); - - entity.HasIndex(e => new { e.MetaFileObjectType, e.MetaFileObjectId, e.MetaFileGroupName }, "IX_CMS_Metafile_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName").IsClustered(); - - entity.HasOne(d => d.MetaFileSite).WithMany(p => p.CmsMetaFiles).HasConstraintName("FK_CMS_MetaFile_MetaFileSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ModuleLicenseKeyLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ModuleLicenseKeyLicense).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ModuleLicenseKeyResource).WithMany(p => p.CmsModuleLicenseKeys) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ModuleUsageCounterName, "IX_CMS_ModuleUsageCounter_ModuleUsageCounterName") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.ModuleUsageCounterId).ValueGeneratedOnAdd(); - entity.Property(e => e.ModuleUsageCounterName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ObjectSettingsObjectType).HasDefaultValueSql("('')"); - entity.Property(e => e.ObjectWorkflowSendEmails).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ObjectCheckedOutByUser).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutByUserID_CMS_User"); - - entity.HasOne(d => d.ObjectCheckedOutVersionHistory).WithMany(p => p.CmsObjectSettingObjectCheckedOutVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID_CMS_ObjectVersionHistory"); - - entity.HasOne(d => d.ObjectPublishedVersionHistory).WithMany(p => p.CmsObjectSettingObjectPublishedVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectPublishedVersionHistoryID_CMS_ObjectVersionHistory"); - - entity.HasOne(d => d.ObjectWorkflowStep).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectWorkflowStepID_CMS_WorkflowStep"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.VersionId) - .HasName("PK_CMS_ObjectVersionHistory_VersionID") - .IsClustered(false); - - entity.HasIndex(e => new { e.VersionObjectType, e.VersionObjectId, e.VersionId }, "PK_CMS_ObjectVersionHistory") - .IsUnique() - .IsDescending(false, false, true) - .IsClustered(); - - entity.Property(e => e.VersionNumber).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionDeletedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionModifiedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionModifiedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionObjectSite).WithMany(p => p.CmsObjectVersionHistories).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionObjectSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TriggerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TriggerObjectType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TriggerWorkflow).WithMany(p => p.CmsObjectWorkflowTriggers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ObjectWorkflowTrigger_TriggerWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.OpenId).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsOpenIdusers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_OpenIDUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PageTemplateId).IsClustered(false); - - entity.HasIndex(e => e.PageTemplateCategoryId, "IX_CMS_PageTemplate_PageTemplateCategoryID").IsClustered(); - - entity.Property(e => e.PageTemplateCloneAsAdHoc).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.PageTemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.PageTemplateForAllPages).HasDefaultValueSql("((1))"); - entity.Property(e => e.PageTemplateIconClass).HasDefaultValueSql("(N'icon-layout')"); - entity.Property(e => e.PageTemplateIsLayout).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateIsReusable).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateShowAsMasterTemplate).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateType).HasDefaultValueSql("(N'portal')"); - - entity.HasOne(d => d.PageTemplateCategory).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateCategoryID_CMS_PageTemplateCategory"); - - entity.HasOne(d => d.PageTemplateLayoutNavigation).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateLayoutID_CMS_Layout"); - - entity.HasOne(d => d.PageTemplateSite).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateSiteID_CMS_Site"); - - entity.HasMany(d => d.Sites).WithMany(p => p.PageTemplates) - .UsingEntity>( - "CmsPageTemplateSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageTemplateSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("PageTemplateId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageTemplateSite_PageTemplateID_CMS_PageTemplate"), - j => - { - j.HasKey("PageTemplateId", "SiteId"); - j.ToTable("CMS_PageTemplateSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_PageTemplateSite_SiteID"); - j.IndexerProperty("PageTemplateId").HasColumnName("PageTemplateID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_CMS_PageTemplateCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryChildCount).HasDefaultValueSql("((0))"); - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryTemplateChildCount).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_PageTemplateCategory_CategoryParentID_CMS_PageTemplateCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PageTemplateConfigurationLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.PageTemplateConfigurationName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PageTemplateConfigurationTemplate).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PageTemplateConfigurationSite).WithMany(p => p.CmsPageTemplateConfigurations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PageTemplateScopeId).IsClustered(false); - - entity.HasIndex(e => e.PageTemplateScopePath, "IX_CMS_PageTemplateScope_PageTemplateScopePath").IsClustered(); - - entity.Property(e => e.PageTemplateScopeLastModified).HasDefaultValueSql("('2/22/2010 9:30:07 AM')"); - entity.Property(e => e.PageTemplateScopePath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.PageTemplateScopeClass).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeClassID_CMS_Class"); - - entity.HasOne(d => d.PageTemplateScopeCulture).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeCultureID_CMS_Culture"); - - entity.HasOne(d => d.PageTemplateScopeSite).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeSiteID_CMS_Site"); - - entity.HasOne(d => d.PageTemplateScopeTemplate).WithMany(p => p.CmsPageTemplateScopes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeTemplateID_CMS_PageTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PermissionDisplayInMatrix).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.Class).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ClassID_CMS_Class"); - - entity.HasOne(d => d.Resource).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PersonalizationId).IsClustered(false); - - entity.HasIndex(e => e.PersonalizationDocumentId, "IX_CMS_Personalization_PersonalizationUserID_PersonalizationDocumentID").IsClustered(); - - entity.Property(e => e.PersonalizationLastModified).HasDefaultValueSql("('9/2/2008 5:36:59 PM')"); - - entity.HasOne(d => d.PersonalizationDocument).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationDocumentID_CMS_Document"); - - entity.HasOne(d => d.PersonalizationSite).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationSiteID_CMS_Site"); - - entity.HasOne(d => d.PersonalizationUser).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.QueryIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.QueryName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.Class).WithMany(p => p.CmsQueries).HasConstraintName("FK_CMS_Query_ClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.LeftNode).WithMany(p => p.CmsRelationshipLeftNodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_LeftNodeID_CMS_Tree"); - - entity.HasOne(d => d.RelationshipName).WithMany(p => p.CmsRelationships) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_RelationshipNameID_CMS_RelationshipName"); - - entity.HasOne(d => d.RightNode).WithMany(p => p.CmsRelationshipRightNodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_RightNodeID_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.RelationshipDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.RelationshipName).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Sites).WithMany(p => p.RelationshipNames) - .UsingEntity>( - "CmsRelationshipNameSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RelationshipNameSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("RelationshipNameId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RelationshipNameSite_RelationshipNameID_CMS_RelationshipName"), - j => - { - j.HasKey("RelationshipNameId", "SiteId"); - j.ToTable("CMS_RelationshipNameSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_RelationshipNameSite_SiteID"); - j.IndexerProperty("RelationshipNameId").HasColumnName("RelationshipNameID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ResourceId).IsClustered(false); - - entity.HasIndex(e => e.ResourceDisplayName, "IX_CMS_Resource_ResourceDisplayName").IsClustered(); - - entity.Property(e => e.ResourceHasFiles).HasDefaultValueSql("((0))"); - entity.Property(e => e.ResourceInstallationState).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ResourceInstalledVersion).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ShowInDevelopment).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Resources) - .UsingEntity>( - "CmsResourceSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ResourceId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceSite_ResourceID_CMS_Resource"), - j => - { - j.HasKey("ResourceId", "SiteId"); - j.ToTable("CMS_ResourceSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_ResourceSite_SiteID"); - j.IndexerProperty("ResourceId").HasColumnName("ResourceID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ResourceLibraryPath).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ResourceLibraryResource).WithMany(p => p.CmsResourceLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceLibrary_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TranslationCulture).WithMany(p => p.CmsResourceTranslations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceTranslation_TranslationCultureID_CMS_Culture"); - - entity.HasOne(d => d.TranslationString).WithMany(p => p.CmsResourceTranslations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceTranslation_TranslationStringID_CMS_ResourceString"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.RoleId).IsClustered(false); - - entity.HasIndex(e => new { e.SiteId, e.RoleName, e.RoleDisplayName }, "IX_CMS_Role_SiteID_RoleName_RoleDisplayName").IsClustered(); - - entity.HasOne(d => d.RoleGroup).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_RoleGroupID_Community_Group"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_SiteID_CMS_SiteID"); - - entity.HasMany(d => d.Elements).WithMany(p => p.Roles) - .UsingEntity>( - "CmsRoleApplication", - r => r.HasOne().WithMany() - .HasForeignKey("ElementId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleApplication_CMS_UIElement"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleApplication_CMS_Role"), - j => - { - j.HasKey("RoleId", "ElementId"); - j.ToTable("CMS_RoleApplication"); - j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleApplication"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("ElementId").HasColumnName("ElementID"); - }); - - entity.HasMany(d => d.ElementsNavigation).WithMany(p => p.RolesNavigation) - .UsingEntity>( - "CmsRoleUielement", - r => r.HasOne().WithMany() - .HasForeignKey("ElementId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleUIElement_ElementID_CMS_UIElement"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleUIElement_RoleID_CMS_Role"), - j => - { - j.HasKey("RoleId", "ElementId"); - j.ToTable("CMS_RoleUIElement"); - j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleUIElement_ElementID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("ElementId").HasColumnName("ElementID"); - }); - - entity.HasMany(d => d.Permissions).WithMany(p => p.Roles) - .UsingEntity>( - "CmsRolePermission", - r => r.HasOne().WithMany() - .HasForeignKey("PermissionId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RolePermission_PermissionID_CMS_Permission"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RolePermission_RoleID_CMS_Role"), - j => - { - j.HasKey("RoleId", "PermissionId"); - j.ToTable("CMS_RolePermission"); - j.HasIndex(new[] { "PermissionId" }, "IX_CMS_RolePermission_PermissionID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("PermissionId").HasColumnName("PermissionID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskAllowExternalService).HasDefaultValueSql("((0))"); - entity.Property(e => e.TaskExecutingServerName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.TaskResource).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskResourceID_CMS_Resource"); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskSiteID_CMS_Site"); - - entity.HasOne(d => d.TaskUser).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IndexId).IsClustered(false); - - entity.HasIndex(e => e.IndexDisplayName, "IX_CMS_SearchIndex_IndexDisplayName").IsClustered(); - - entity.Property(e => e.IndexProvider).HasDefaultValueSql("(N'')"); - entity.Property(e => e.IndexType).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.IndexCultures).WithMany(p => p.Indices) - .UsingEntity>( - "CmsSearchIndexCulture", - r => r.HasOne().WithMany() - .HasForeignKey("IndexCultureId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexCulture_IndexCultureID_CMS_Culture"), - l => l.HasOne().WithMany() - .HasForeignKey("IndexId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexCulture_IndexID_CMS_SearchIndex"), - j => - { - j.HasKey("IndexId", "IndexCultureId"); - j.ToTable("CMS_SearchIndexCulture"); - j.HasIndex(new[] { "IndexCultureId" }, "IX_CMS_SearchIndexCulture_IndexCultureID"); - j.IndexerProperty("IndexId").HasColumnName("IndexID"); - j.IndexerProperty("IndexCultureId").HasColumnName("IndexCultureID"); - }); - - entity.HasMany(d => d.IndexSites).WithMany(p => p.Indices) - .UsingEntity>( - "CmsSearchIndexSite", - r => r.HasOne().WithMany() - .HasForeignKey("IndexSiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexSite_IndexSiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("IndexId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexSite_IndexID_CMS_SearchIndex"), - j => - { - j.HasKey("IndexId", "IndexSiteId"); - j.ToTable("CMS_SearchIndexSite"); - j.HasIndex(new[] { "IndexSiteId" }, "IX_CMS_SearchIndexSite_IndexSiteID"); - j.IndexerProperty("IndexId").HasColumnName("IndexID"); - j.IndexerProperty("IndexSiteId").HasColumnName("IndexSiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SearchTaskId).IsClustered(false); - - entity.HasIndex(e => new { e.SearchTaskPriority, e.SearchTaskStatus, e.SearchTaskServerName }, "IX_CMS_SearchTask_SearchTaskPriority_SearchTaskStatus_SearchTaskServerName") - .IsDescending(true, false, false) - .IsClustered(); - - entity.Property(e => e.SearchTaskCreated).HasDefaultValueSql("('4/15/2009 11:23:52 AM')"); - entity.Property(e => e.SearchTaskStatus).HasDefaultValueSql("('')"); - entity.Property(e => e.SearchTaskType).HasDefaultValueSql("('')"); - entity.Property(e => e.SearchTaskValue).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SearchTaskAzureAdditionalData).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SearchTaskAzureCreated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.SearchTaskAzureType).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SessionExpires).HasDefaultValueSql("('9/9/2008 3:45:44 PM')"); - entity.Property(e => e.SessionIdentificator).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SessionLastActive).HasDefaultValueSql("('9/9/2008 3:44:26 PM')"); - - entity.HasOne(d => d.SessionSite).WithMany(p => p.CmsSessions).HasConstraintName("FK_CMS_Session_SessionSiteID_CMS_Site"); - - entity.HasOne(d => d.SessionUser).WithMany(p => p.CmsSessions).HasConstraintName("FK_CMS_Session_SessionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryOrder, "IX_CMS_SettingsCategory_CategoryOrder").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.CategoryIsGroup).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_SettingsCategory_CMS_SettingsCategory1"); - - entity.HasOne(d => d.CategoryResource).WithMany(p => p.CmsSettingsCategories).HasConstraintName("FK_CMS_SettingsCategory_CategoryResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.KeyDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.KeyExplanationText).HasDefaultValueSql("(N'')"); - entity.Property(e => e.KeyIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyIsGlobal).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyIsHidden).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyName).HasDefaultValueSql("('')"); - entity.Property(e => e.KeyType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.KeyCategory).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_KeyCategoryID_CMS_SettingsCategory"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SiteId).IsClustered(false); - - entity.HasIndex(e => e.SiteDisplayName, "IX_CMS_Site_SiteDisplayName").IsClustered(); - - entity.Property(e => e.SiteDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.SiteDomainName).HasDefaultValueSql("('')"); - entity.Property(e => e.SiteName).HasDefaultValueSql("('')"); - entity.Property(e => e.SiteStatus).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.SiteDefaultEditorStylesheetNavigation).WithMany(p => p.CmsSiteSiteDefaultEditorStylesheetNavigations).HasConstraintName("FK_CMS_Site_SiteDefaultEditorStylesheet_CMS_CssStylesheet"); - - entity.HasOne(d => d.SiteDefaultStylesheet).WithMany(p => p.CmsSiteSiteDefaultStylesheets).HasConstraintName("FK_CMS_Site_SiteDefaultStylesheetID_CMS_CssStylesheet"); - - entity.HasMany(d => d.Cultures).WithMany(p => p.Sites) - .UsingEntity>( - "CmsSiteCulture", - r => r.HasOne().WithMany() - .HasForeignKey("CultureId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteCulture_CultureID_CMS_Culture"), - l => l.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteCulture_SiteID_CMS_Site"), - j => - { - j.HasKey("SiteId", "CultureId"); - j.ToTable("CMS_SiteCulture"); - j.HasIndex(new[] { "CultureId" }, "IX_CMS_SiteCulture_CultureID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - j.IndexerProperty("CultureId").HasColumnName("CultureID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SiteDomainAliasName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsSiteDomainAliases) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteDomainAlias_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ServerDeliveryMethod).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Servers) - .UsingEntity>( - "CmsSmtpserverSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SMTPServerSite_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SMTPServerSite_CMS_SMTPServer"), - j => - { - j.HasKey("ServerId", "SiteId"); - j.ToTable("CMS_SMTPServerSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_SMTPServerSite_SiteID"); - j.IndexerProperty("ServerId").HasColumnName("ServerID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StateId).IsClustered(false); - - entity.HasIndex(e => e.StateDisplayName, "IX_CMS_State_CountryID_StateDisplayName").IsClustered(); - - entity.Property(e => e.StateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.StateName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.Country).WithMany(p => p.CmsStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_State_CountryID_CMS_Country"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TagId).IsClustered(false); - - entity.HasIndex(e => e.TagName, "IX_CMS_Tag_TagName").IsClustered(); - - entity.HasOne(d => d.TagGroup).WithMany(p => p.CmsTags) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tag_TagGroupID_CMS_TagGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TagGroupId).IsClustered(false); - - entity.HasIndex(e => e.TagGroupDisplayName, "IX_CMS_TagGroup_TagGroupDisplayName").IsClustered(); - - entity.Property(e => e.TagGroupDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TagGroupName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TagGroupSite).WithMany(p => p.CmsTagGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TagGroup_TagGroupSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LayoutLastModified).HasDefaultValueSql("('7/31/2012 12:10:49 PM')"); - - entity.HasOne(d => d.Layout).WithMany(p => p.CmsTemplateDeviceLayouts).HasConstraintName("FK_CMS_TemplateDeviceLayout_LayoutID_CMS_Layout"); - - entity.HasOne(d => d.PageTemplate).WithMany(p => p.CmsTemplateDeviceLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TemplateDeviceLayout_PageTemplateID_CMS_PageTemplate"); - - entity.HasOne(d => d.Profile).WithMany(p => p.CmsTemplateDeviceLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TemplateDeviceLayout_ProfileID_CMS_DeviceProfile"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TimeZoneId).IsClustered(false); - - entity.HasIndex(e => e.TimeZoneDisplayName, "IX_CMS_TimeZone_TimeZoneDisplayName").IsClustered(); - - entity.Property(e => e.TimeZoneDaylight).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TransformationId).IsClustered(false); - - entity.HasIndex(e => new { e.TransformationClassId, e.TransformationName }, "IX_CMS_Transformation_TransformationClassID_TransformationName").IsClustered(); - - entity.Property(e => e.TransformationCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TransformationIsHierarchical).HasDefaultValueSql("((0))"); - entity.Property(e => e.TransformationName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TransformationType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.TransformationClass).WithMany(p => p.CmsTransformations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Transformation_TransformationClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TranslationServiceGenerateTargetTag).HasDefaultValueSql("((0))"); - entity.Property(e => e.TranslationServiceSupportsCancel).HasDefaultValueSql("((0))"); - entity.Property(e => e.TranslationServiceSupportsStatusUpdate).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubmissionTargetCulture).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SubmissionService).WithMany(p => p.CmsTranslationSubmissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TranslationSubmission_CMS_TranslationService"); - - entity.HasOne(d => d.SubmissionSubmittedByUser).WithMany(p => p.CmsTranslationSubmissions).HasConstraintName("FK_CMS_TranslationSubmission_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SubmissionItemSubmission).WithMany(p => p.CmsTranslationSubmissionItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TranslationSubmissionItem_CMS_TranslationSubmission"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.NodeAllowCacheInFileSystem).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeHasChildren).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeHasLinks).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeInheritPageTemplate).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeTemplateForAllCultures).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.NodeAcl).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeACLID_CMS_ACL"); - - entity.HasOne(d => d.NodeClass).WithMany(p => p.CmsTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tree_NodeClassID_CMS_Class"); - - entity.HasOne(d => d.NodeGroup).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeGroupID_Community_Group"); - - entity.HasOne(d => d.NodeLinkedNode).WithMany(p => p.InverseNodeLinkedNode).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeID_CMS_Tree"); - - entity.HasOne(d => d.NodeLinkedNodeSite).WithMany(p => p.CmsTreeNodeLinkedNodeSites).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeSiteID_CMS_Site"); - - entity.HasOne(d => d.NodeOriginalNode).WithMany(p => p.InverseNodeOriginalNode).HasConstraintName("FK_CMS_Tree_NodeOriginalNodeID_CMS_Tree"); - - entity.HasOne(d => d.NodeOwnerNavigation).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeOwner_CMS_User"); - - entity.HasOne(d => d.NodeParent).WithMany(p => p.InverseNodeParent).HasConstraintName("FK_CMS_Tree_NodeParentID_CMS_Tree"); - - entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsTreeNodeSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tree_NodeSiteID_CMS_Site"); - - entity.HasOne(d => d.NodeSku).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeSKUID_COM_SKU"); - - entity.HasOne(d => d.NodeTemplate).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeTemplateID_CMS_PageTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ElementId).IsClustered(false); - - entity.HasIndex(e => new { e.ElementResourceId, e.ElementLevel, e.ElementParentId, e.ElementOrder, e.ElementCaption }, "IX_CMS_UIElement_ElementResourceID_ElementLevel_ElementParentID_ElementOrder_ElementCaption").IsClustered(); - - entity.Property(e => e.ElementCheckModuleReadPermission).HasDefaultValueSql("((1))"); - entity.Property(e => e.ElementIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementIsGlobalApplication).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementIsMenu).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ElementSize).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ElementPageTemplate).WithMany(p => p.CmsUielements).HasConstraintName("FK_CMS_UIElement_ElementPageTemplateID_CMS_PageTemplate"); - - entity.HasOne(d => d.ElementParent).WithMany(p => p.InverseElementParent).HasConstraintName("FK_CMS_UIElement_ElementParentID_CMS_UIElement"); - - entity.HasOne(d => d.ElementResource).WithMany(p => p.CmsUielements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UIElement_ElementResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserIsDomain).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserIsExternal).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserIsHidden).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserName).HasDefaultValueSql("('')"); - entity.Property(e => e.UserPassword).HasDefaultValueSql("(N'')"); - - entity.HasMany(d => d.Forums).WithMany(p => p.Users) - .UsingEntity>( - "ForumsForumModerator", - r => r.HasOne().WithMany() - .HasForeignKey("ForumId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumModerators_ForumID_Forums_Forum"), - l => l.HasOne().WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumModerators_UserID_CMS_User"), - j => - { - j.HasKey("UserId", "ForumId"); - j.ToTable("Forums_ForumModerators"); - j.HasIndex(new[] { "ForumId" }, "IX_Forums_ForumModerators_ForumID"); - j.IndexerProperty("UserId").HasColumnName("UserID"); - j.IndexerProperty("ForumId").HasColumnName("ForumID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Culture).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_CultureID_CMS_Culture"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_SiteID_CMS_Site"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserMacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.UserMacroIdentityMacroIdentity).WithMany(p => p.CmsUserMacroIdentities).HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID_CMS_MacroIdentity"); - - entity.HasOne(d => d.UserMacroIdentityUser).WithOne(p => p.CmsUserMacroIdentity) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Role).WithMany(p => p.CmsUserRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserRole_RoleID_CMS_Role"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserRole_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserAccountLockReason).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserInvalidLogOnAttempts).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserWaitingForApproval).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.UserActivatedByUser).WithMany(p => p.CmsUserSettingUserActivatedByUsers).HasConstraintName("FK_CMS_UserSettings_UserActivatedByUserID_CMS_User"); - - entity.HasOne(d => d.UserAvatar).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserAvatarID_CMS_Avatar"); - - entity.HasOne(d => d.UserBadge).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserBadgeID_CMS_Badge"); - - entity.HasOne(d => d.UserSettingsUser).WithMany(p => p.CmsUserSettingUserSettingsUsers) - .HasPrincipalKey(p => p.UserGuid) - .HasForeignKey(d => d.UserSettingsUserGuid) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserGUID_CMS_User"); - - entity.HasOne(d => d.UserSettingsUserNavigation).WithOne(p => p.CmsUserSettingUserSettingsUserNavigation) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserID_CMS_User"); - - entity.HasOne(d => d.UserTimeZone).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserTimeZoneID_CMS_TimeZone"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Site).WithMany(p => p.CmsUserSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSite_SiteID_CMS_Site"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSite_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.VersionHistoryId).IsClustered(false); - - entity.HasIndex(e => e.DocumentId, "IX_CMS_VersionHistory_DocumentID").IsClustered(); - - entity.Property(e => e.DocumentNamePath).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ModifiedByUser).WithMany(p => p.CmsVersionHistoryModifiedByUsers).HasConstraintName("FK_CMS_VersionHistory_ModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsVersionHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionHistory_NodeSiteID_CMS_Site"); - - entity.HasOne(d => d.VersionClass).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionClassID_CMS_Class"); - - entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_VersionHistory_DeletedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionWorkflow).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowID_CMS_Workflow"); - - entity.HasOne(d => d.VersionWorkflowStep).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowStepID_CMS_WorkflowStep"); - - entity.HasMany(d => d.AttachmentHistories).WithMany(p => p.VersionHistories) - .UsingEntity>( - "CmsVersionAttachment", - r => r.HasOne().WithMany() - .HasForeignKey("AttachmentHistoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionAttachment_AttachmentHistoryID_CMS_AttachmentHistory"), - l => l.HasOne().WithMany() - .HasForeignKey("VersionHistoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionAttachment_VersionHistoryID_CMS_VersionHistory"), - j => - { - j.HasKey("VersionHistoryId", "AttachmentHistoryId"); - j.ToTable("CMS_VersionAttachment"); - j.HasIndex(new[] { "AttachmentHistoryId" }, "IX_CMS_VersionAttachment_AttachmentHistoryID"); - j.IndexerProperty("VersionHistoryId").HasColumnName("VersionHistoryID"); - j.IndexerProperty("AttachmentHistoryId").HasColumnName("AttachmentHistoryID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ServerId).IsClustered(false); - - entity.HasIndex(e => e.ServerDisplayName, "IX_CMS_WebFarmServer_ServerDisplayName").IsClustered(); - - entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ServerLastModified).HasDefaultValueSql("('9/17/2013 12:18:06 PM')"); - entity.Property(e => e.ServerName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LogCode).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Server).WithMany(p => p.CmsWebFarmServerTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer"); - - entity.HasOne(d => d.Task).WithMany(p => p.CmsWebFarmServerTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebFarmServerTask_TaskID_CMS_WebFarmTask"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskGuid).HasDefaultValueSql("('00000000-0000-0000-0000-000000000000')"); - entity.Property(e => e.TaskIsMemory).HasDefaultValueSql("((0))"); - entity.Property(e => e.TaskType).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.WebPartDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartFileName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.WebPartName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartProperties).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartSkipInsertProperties).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.WebPartCategory).WithMany(p => p.CmsWebParts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPart_WebPartCategoryID_CMS_WebPartCategory"); - - entity.HasOne(d => d.WebPartParent).WithMany(p => p.InverseWebPartParent).HasConstraintName("FK_CMS_WebPart_WebPartParentID_CMS_WebPart"); - - entity.HasOne(d => d.WebPartResource).WithMany(p => p.CmsWebParts).HasConstraintName("FK_CMS_WebPart_WebPartResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_CMS_WebPartCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_WebPartCategory_CategoryParentID_CMS_WebPartCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ContainerId).IsClustered(false); - - entity.HasIndex(e => e.ContainerDisplayName, "IX_CMS_WebPartContainer_ContainerDisplayName").IsClustered(); - - entity.Property(e => e.ContainerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContainerName).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Containers) - .UsingEntity>( - "CmsWebPartContainerSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartContainerSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ContainerId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartContainerSite_ContainerID_CMS_WebPartContainer"), - j => - { - j.HasKey("ContainerId", "SiteId"); - j.ToTable("CMS_WebPartContainerSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_WebPartContainerSite_SiteID"); - j.IndexerProperty("ContainerId").HasColumnName("ContainerID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WebPartLayoutId).IsClustered(false); - - entity.HasIndex(e => new { e.WebPartLayoutWebPartId, e.WebPartLayoutCodeName }, "IX_CMS_WebPartLayout_WebPartLayoutWebPartID_WebPartLayoutCodeName").IsClustered(); - - entity.Property(e => e.WebPartLayoutCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebPartLayoutDisplayName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.WebPartLayoutWebPart).WithMany(p => p.CmsWebPartLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartLayout_WebPartLayoutWebPartID_CMS_WebPart"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WebTemplateId).IsClustered(false); - - entity.HasIndex(e => e.WebTemplateOrder, "IX_CMS_WebTemplate_WebTemplateOrder").IsClustered(); - - entity.Property(e => e.WebTemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebTemplateFileName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebTemplateLicenses).HasDefaultValueSql("('')"); - entity.Property(e => e.WebTemplateName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebTemplateOrder).HasDefaultValueSql("((99999))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WidgetId).IsClustered(false); - - entity.HasIndex(e => new { e.WidgetCategoryId, e.WidgetDisplayName }, "IX_CMS_Widget_WidgetCategoryID_WidgetDisplayName").IsClustered(); - - entity.Property(e => e.WidgetSecurity).HasDefaultValueSql("((2))"); - - entity.HasOne(d => d.WidgetCategory).WithMany(p => p.CmsWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Widget_WidgetCategoryID_CMS_WidgetCategory"); - - entity.HasOne(d => d.WidgetLayout).WithMany(p => p.CmsWidgets).HasConstraintName("FK_CMS_Widget_WidgetLayoutID_CMS_WebPartLayout"); - - entity.HasOne(d => d.WidgetWebPart).WithMany(p => p.CmsWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Widget_WidgetWebPartID_CMS_WebPart"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WidgetCategoryId).IsClustered(false); - - entity.HasIndex(e => e.WidgetCategoryPath, "IX_CMS_WidgetCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.WidgetCategoryParent).WithMany(p => p.InverseWidgetCategoryParent).HasConstraintName("FK_CMS_WidgetCategory_WidgetCategoryParentID_CMS_WidgetCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Permission).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_RoleID_CMS_Role"); - - entity.HasOne(d => d.Widget).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_WidgetID_CMS_Widget"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowId).IsClustered(false); - - entity.HasIndex(e => e.WorkflowDisplayName, "IX_CMS_Workflow_WorkflowDisplayName").IsClustered(); - - entity.Property(e => e.WorkflowAutoPublishChanges).HasDefaultValueSql("((0))"); - entity.Property(e => e.WorkflowDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.WorkflowEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowName).HasDefaultValueSql("('')"); - entity.Property(e => e.WorkflowSendApproveEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendArchiveEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendPublishEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendReadyForApprovalEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendRejectEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowUseCheckinCheckout).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Users).WithMany(p => p.Workflows) - .UsingEntity>( - "CmsWorkflowUser", - r => r.HasOne().WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowUser_UserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowUser_WorkflowID_CMS_Workflow"), - j => - { - j.HasKey("WorkflowId", "UserId").HasName("PK_CMS_WorkflowUser_1"); - j.ToTable("CMS_WorkflowUser"); - j.HasIndex(new[] { "UserId" }, "IX_CMS_WorkflowUser_UserID"); - j.IndexerProperty("WorkflowId").HasColumnName("WorkflowID"); - j.IndexerProperty("UserId").HasColumnName("UserID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ActionEnabled).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ActionResource).WithMany(p => p.CmsWorkflowActions).HasConstraintName("FK_CMS_WorkflowAction_ActionResourceID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ApprovedByUser).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_ApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_HistoryWorkflowID_CMS_Workflow"); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowHistorySteps).HasConstraintName("FK_CMS_WorkflowHistory_StepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TargetStep).WithMany(p => p.CmsWorkflowHistoryTargetSteps).HasConstraintName("FK_CMS_WorkflowHistory_TargetStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.VersionHistory).WithMany(p => p.CmsWorkflowHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowHistory_VersionHistoryID_CMS_VersionHistory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ScopeId).IsClustered(false); - - entity.HasIndex(e => e.ScopeStartingPath, "IX_CMS_WorkflowScope_ScopeStartingPath").IsClustered(); - - entity.HasOne(d => d.ScopeClass).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeClassID_CMS_Class"); - - entity.HasOne(d => d.ScopeCulture).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeCultureID_CMS_Culture"); - - entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsWorkflowScopes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowScope_ScopeSiteID_CMS_Site"); - - entity.HasOne(d => d.ScopeWorkflow).WithMany(p => p.CmsWorkflowScopes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowScope_ScopeWorkflowID_CMS_WorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.StepAllowPublish).HasDefaultValueSql("((0))"); - entity.Property(e => e.StepAllowReject).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.StepAction).WithMany(p => p.CmsWorkflowSteps).HasConstraintName("FK_CMS_WorkflowStep_StepActionID"); - - entity.HasOne(d => d.StepWorkflow).WithMany(p => p.CmsWorkflowSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStep_StepWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowStepRoleId).IsClustered(false); - - entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.RoleId }, "IX_CMS_WorkflowStepRoles_StepID_StepSourcePointGUID_RoleID") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsWorkflowStepRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepRoles_RoleID_CMS_Role"); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepRoles_StepID_CMS_WorkflowStep"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowStepUserId).IsClustered(false); - - entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.UserId }, "IX_CMS_WorkflowStepUser_StepID_StepSourcePointGUID_UserID") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepUser_StepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsWorkflowStepUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TransitionEndStep).WithMany(p => p.CmsWorkflowTransitionTransitionEndSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionEndStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TransitionStartStep).WithMany(p => p.CmsWorkflowTransitionTransitionStartSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionStartStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TransitionWorkflow).WithMany(p => p.CmsWorkflowTransitions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionWorkflowID_CMS_Workflow"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AddressId).HasName("PK_COM_CustomerAdress"); - - entity.Property(e => e.AddressCity).HasDefaultValueSql("('')"); - entity.Property(e => e.AddressLastModified).HasDefaultValueSql("('10/18/2012 3:39:07 PM')"); - entity.Property(e => e.AddressLine1).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AddressName).HasDefaultValueSql("('')"); - entity.Property(e => e.AddressPersonalName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AddressZip).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Address_AddressCountryID_CMS_Country"); - - entity.HasOne(d => d.AddressCustomer).WithMany(p => p.ComAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Address_AddressCustomerID_COM_Customer"); - - entity.HasOne(d => d.AddressState).WithMany(p => p.ComAddresses).HasConstraintName("FK_COM_Address_AddressStateID_CMS_State"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BrandDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BrandEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.BrandLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.BrandName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.BrandSite).WithMany(p => p.ComBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Brand_BrandSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CarrierAssemblyName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierClassName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierLastModified).HasDefaultValueSql("('9/22/2014 3:00:14 PM')"); - entity.Property(e => e.CarrierName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CarrierSite).WithMany(p => p.ComCarriers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Carrier_CarrierSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CollectionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CollectionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.CollectionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CollectionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CollectionSite).WithMany(p => p.ComCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Collection_CollectionSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CouponCodeCode).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CouponCodeDiscount).WithMany(p => p.ComCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CouponCode_CouponCodeDiscountID_COM_Discount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CurrencyCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyFormatString).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CurrencySite).WithMany(p => p.ComCurrencies).HasConstraintName("FK_COM_Currency_CurrencySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ExchangeRateToCurrency).WithMany(p => p.ComCurrencyExchangeRates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID_COM_Currency"); - - entity.HasOne(d => d.ExchangeTable).WithMany(p => p.ComCurrencyExchangeRates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeTableID_COM_ExchangeTable"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.CustomerCompany, "IX_COM_Customer_CustomerCompany") - .HasFilter("([CustomerCompany] IS NOT NULL)") - .HasFillFactor(90); - - entity.HasOne(d => d.CustomerSite).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerSiteID_CMS_Site"); - - entity.HasOne(d => d.CustomerUser).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EventCreditLastModified).HasDefaultValueSql("('9/26/2012 12:21:38 PM')"); - entity.Property(e => e.EventDate).HasDefaultValueSql("('9/27/2012 2:48:56 PM')"); - entity.Property(e => e.EventName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.EventCustomer).WithMany(p => p.ComCustomerCreditHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CustomerCreditHistory_EventCustomerID_COM_Customer"); - - entity.HasOne(d => d.EventSite).WithMany(p => p.ComCustomerCreditHistories).HasConstraintName("FK_COM_CustomerCreditHistory_EventSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DepartmentDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.DepartmentName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.DepartmentDefaultTaxClass).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentDefaultTaxClassID_COM_TaxClass"); - - entity.HasOne(d => d.DepartmentSite).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); - entity.Property(e => e.DiscountApplyTo).HasDefaultValueSql("('Order')"); - entity.Property(e => e.DiscountDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.DiscountEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.DiscountOrder).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.DiscountSite).WithMany(p => p.ComDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Discount_DiscountSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ExchangeTableId).IsClustered(false); - - entity.HasIndex(e => new { e.ExchangeTableValidFrom, e.ExchangeTableValidTo }, "IX_COM_ExchangeTable_ExchangeTableValidFrom_ExchangeTableValidTo") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.ExchangeTableDisplayName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ExchangeTableSite).WithMany(p => p.ComExchangeTables).HasConstraintName("FK_COM_ExchangeTable_ExchangeTableSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.GiftCardCustomerRestriction).HasDefaultValueSql("(N'enum1')"); - entity.Property(e => e.GiftCardDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GiftCardEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.GiftCardLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.GiftCardName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.GiftCardSite).WithMany(p => p.ComGiftCards) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_GiftCard_GiftCardSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.GiftCardCouponCodeCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GiftCardCouponCodeLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.GiftCardCouponCodeGiftCard).WithMany(p => p.ComGiftCardCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_GiftCardCouponCode_GiftCardCouponCodeGiftCardID_COM_GiftCard"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.InternalStatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.InternalStatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.InternalStatusLastModified).HasDefaultValueSql("('9/20/2012 2:45:44 PM')"); - entity.Property(e => e.InternalStatusName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.InternalStatusSite).WithMany(p => p.ComInternalStatuses).HasConstraintName("FK_COM_InternalStatus_InternalStatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ManufacturerId).IsClustered(false); - - entity.HasIndex(e => new { e.ManufacturerDisplayName, e.ManufacturerEnabled }, "IX_COM_Manufacturer_ManufacturerDisplayName_ManufacturerEnabled").IsClustered(); - - entity.Property(e => e.ManufacturerDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ManufacturerEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ManufacturerLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ManufacturerSite).WithMany(p => p.ComManufacturers).HasConstraintName("FK_COM_Manufacturer_ManufacturerSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MultiBuyCouponCodeCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MultiBuyCouponCodeUseCount).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.MultiBuyCouponCodeMultiBuyDiscount).WithMany(p => p.ComMultiBuyCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MultiBuyDiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountAutoAddEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountCustomerRestriction).HasDefaultValueSql("(N'All')"); - entity.Property(e => e.MultiBuyDiscountEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountIsFlat).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountMinimumBuyCount).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountUsesCoupons).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.MultiBuyDiscountApplyToSku).WithMany(p => p.ComMultiBuyDiscounts).HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID_COM_SKU"); - - entity.HasOne(d => d.MultiBuyDiscountSite).WithMany(p => p.ComMultiBuyDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountSiteID_CMS_Site"); - - entity.HasMany(d => d.Departments).WithMany(p => p.MultiBuyDiscounts) - .UsingEntity>( - "ComMultiBuyDiscountDepartment", - r => r.HasOne().WithMany() - .HasForeignKey("DepartmentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_DepartmentID_COM_Department"), - l => l.HasOne().WithMany() - .HasForeignKey("MultiBuyDiscountId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_MultiBuyDiscountID_COM_MultiBuyDiscount"), - j => - { - j.HasKey("MultiBuyDiscountId", "DepartmentId"); - j.ToTable("COM_MultiBuyDiscountDepartment"); - j.HasIndex(new[] { "DepartmentId" }, "IX_COM_MultiBuyDiscountDepartment_DepartmentID"); - j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); - j.IndexerProperty("DepartmentId").HasColumnName("DepartmentID"); - }); - - entity.HasMany(d => d.Skus).WithMany(p => p.MultiBuyDiscounts) - .UsingEntity>( - "ComMultiBuyDiscountSku", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountSKU_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("MultiBuyDiscountId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountSKU_MultiBuyDiscountID_COM_MultiBuyDiscount"), - j => - { - j.HasKey("MultiBuyDiscountId", "Skuid"); - j.ToTable("COM_MultiBuyDiscountSKU"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_MultiBuyDiscountSKU_SKUID"); - j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BrandIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Brand).WithMany(p => p.ComMultiBuyDiscountBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountBrand_BrandID_COM_Brand"); - - entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountBrand_MultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CollectionIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Collection).WithMany(p => p.ComMultiBuyDiscountCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountCollection_CollectionID_COM_Collection"); - - entity.HasOne(d => d.MultibuyDiscount).WithMany(p => p.ComMultiBuyDiscountCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountCollection_MultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.NodeIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountTree_MultiBuyDiscountID_COM_MultiBuyDiscount"); - - entity.HasOne(d => d.Node).WithMany(p => p.ComMultiBuyDiscountTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountTree_NodeID_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_COM_OptionCategory_CategoryDisplayName_CategoryEnabled").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CategoryDisplayPrice).HasDefaultValueSql("((1))"); - entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.CategoryName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CategorySelectionType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CategorySite).WithMany(p => p.ComOptionCategories).HasConstraintName("FK_COM_OptionCategory_CategorySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.OrderCreatedByUser).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.OrderCurrency).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCurrencyID_COM_Currency"); - - entity.HasOne(d => d.OrderCustomer).WithMany(p => p.ComOrders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Order_OrderCustomerID_COM_Customer"); - - entity.HasOne(d => d.OrderPaymentOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderPaymentOptionID_COM_PaymentOption"); - - entity.HasOne(d => d.OrderShippingOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderShippingOptionID_COM_ShippingOption"); - - entity.HasOne(d => d.OrderSite).WithMany(p => p.ComOrders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Order_OrderSiteID_CMS_Site"); - - entity.HasOne(d => d.OrderStatus).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderStatusID_COM_Status"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComOrderAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderAddress_AddressCountryID_CMS_Country"); - - entity.HasOne(d => d.AddressOrder).WithMany(p => p.ComOrderAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderAddress_AddressOrderID_COM_Order"); - - entity.HasOne(d => d.AddressState).WithMany(p => p.ComOrderAddresses).HasConstraintName("FK_COM_OrderAddress_AddressStateID_CMS_State"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.OrderItemOrder).WithMany(p => p.ComOrderItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItem_OrderItemOrderID_COM_Order"); - - entity.HasOne(d => d.OrderItemSku).WithMany(p => p.ComOrderItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItem_OrderItemSKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.File).WithMany(p => p.ComOrderItemSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItemSKUFile_COM_SKUFile"); - - entity.HasOne(d => d.OrderItem).WithMany(p => p.ComOrderItemSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItemSKUFile_COM_OrderItem"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.StatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.StatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.StatusName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.StatusSendNotification).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.StatusSite).WithMany(p => p.ComOrderStatuses).HasConstraintName("FK_COM_OrderStatus_StatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ChangedByUser).WithMany(p => p.ComOrderStatusUsers).HasConstraintName("FK_COM_OrderStatusUser_ChangedByUserID_CMS_User"); - - entity.HasOne(d => d.FromStatus).WithMany(p => p.ComOrderStatusUserFromStatuses).HasConstraintName("FK_COM_OrderStatusUser_FromStatusID_COM_Status"); - - entity.HasOne(d => d.Order).WithMany(p => p.ComOrderStatusUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderStatusUser_OrderID_COM_Order"); - - entity.HasOne(d => d.ToStatus).WithMany(p => p.ComOrderStatusUserToStatuses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderStatusUser_ToStatusID_COM_Status"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PaymentOptionId).IsClustered(false); - - entity.HasIndex(e => new { e.PaymentOptionSiteId, e.PaymentOptionDisplayName, e.PaymentOptionEnabled }, "IX_COM_PaymentOption_PaymentOptionSiteID_PaymentOptionDisplayName_PaymentOptionEnabled").IsClustered(); - - entity.Property(e => e.PaymentOptionAllowIfNoShipping).HasDefaultValueSql("((0))"); - entity.Property(e => e.PaymentOptionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PaymentOptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PaymentOptionLastModified).HasDefaultValueSql("('9/27/2012 4:18:26 PM')"); - entity.Property(e => e.PaymentOptionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PaymentOptionAuthorizedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionAuthorizedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID_COM_OrderStatus"); - - entity.HasOne(d => d.PaymentOptionFailedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionFailedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionFailedOrderStatusID_COM_OrderStatus"); - - entity.HasOne(d => d.PaymentOptionSite).WithMany(p => p.ComPaymentOptions).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSiteID_CMS_Site"); - - entity.HasOne(d => d.PaymentOptionSucceededOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionSucceededOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSucceededOrderStatusID_COM_OrderStatus"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PublicStatusId).IsClustered(false); - - entity.HasIndex(e => new { e.PublicStatusDisplayName, e.PublicStatusEnabled }, "IX_COM_PublicStatus_PublicStatusDisplayName_PublicStatusEnabled").IsClustered(); - - entity.Property(e => e.PublicStatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PublicStatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PublicStatusName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PublicStatusSite).WithMany(p => p.ComPublicStatuses).HasConstraintName("FK_COM_PublicStatus_PublicStatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ShippingCostId).HasName("PK__COM_ShippingCost"); - - entity.HasOne(d => d.ShippingCostShippingOption).WithMany(p => p.ComShippingCosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShippingCost_ShippingCostShippingOptionID_COM_ShippingOption"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ShippingOptionId).IsClustered(false); - - entity.HasIndex(e => e.ShippingOptionDisplayName, "IX_COM_ShippingOptionDisplayName").IsClustered(); - - entity.Property(e => e.ShippingOptionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ShippingOptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ShippingOptionLastModified).HasDefaultValueSql("('9/26/2012 12:44:18 PM')"); - entity.Property(e => e.ShippingOptionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ShippingOptionCarrier).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionCarrierID_COM_Carrier"); - - entity.HasOne(d => d.ShippingOptionSite).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionSiteID_CMS_Site"); - - entity.HasOne(d => d.ShippingOptionTaxClass).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionTaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ShoppingCartBillingAddress).WithMany(p => p.ComShoppingCartShoppingCartBillingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartBillingAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartCompanyAddress).WithMany(p => p.ComShoppingCartShoppingCartCompanyAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCompanyAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartCurrency).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCurrencyID_COM_Currency"); - - entity.HasOne(d => d.ShoppingCartCustomer).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCustomerID_COM_Customer"); - - entity.HasOne(d => d.ShoppingCartPaymentOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartPaymentOptionID_COM_PaymentOption"); - - entity.HasOne(d => d.ShoppingCartShippingAddress).WithMany(p => p.ComShoppingCartShoppingCartShippingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartShippingOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingOptionID_COM_ShippingOption"); - - entity.HasOne(d => d.ShoppingCartSite).WithMany(p => p.ComShoppingCarts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCart_ShoppingCartSiteID_CMS_Site"); - - entity.HasOne(d => d.ShoppingCartUser).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CouponCode).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartCouponCode_ShoppingCartID_COM_ShoppingCart"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CartItemAutoAddedUnits).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartSkus) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartSKU_ShoppingCartID_COM_ShoppingCart"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComShoppingCartSkus) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartSKU_SKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.Skunumber, "IX_COM_SKU_SKUNumber") - .HasFilter("([SKUNumber] IS NOT NULL)") - .HasFillFactor(90); - - entity.Property(e => e.SkubundleInventoryType).HasDefaultValueSql("('REMOVEBUNDLE')"); - entity.Property(e => e.SkuconversionValue).HasDefaultValueSql("('0')"); - entity.Property(e => e.Skuenabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.Skuname).HasDefaultValueSql("('')"); - entity.Property(e => e.SkusellOnlyAvailable).HasDefaultValueSql("((0))"); - entity.Property(e => e.SkutrackInventory).HasDefaultValueSql("(N'ByProduct')"); - - entity.HasOne(d => d.Skubrand).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUBrandID_COM_Brand"); - - entity.HasOne(d => d.Skucollection).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUCollectionID_COM_Collection"); - - entity.HasOne(d => d.Skudepartment).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUDepartmentID_COM_Department"); - - entity.HasOne(d => d.SkuinternalStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUInternalStatusID_COM_InternalStatus"); - - entity.HasOne(d => d.Skumanufacturer).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUManufacturerID_COM_Manifacturer"); - - entity.HasOne(d => d.SkuoptionCategory).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUOptionCategoryID_COM_OptionCategory"); - - entity.HasOne(d => d.SkuparentSku).WithMany(p => p.InverseSkuparentSku).HasConstraintName("FK_COM_SKU_SKUParentSKUID_COM_SKU"); - - entity.HasOne(d => d.SkupublicStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUPublicStatusID_COM_PublicStatus"); - - entity.HasOne(d => d.Skusite).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSiteID_CMS_Site"); - - entity.HasOne(d => d.Skusupplier).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSupplierID_COM_Supplier"); - - entity.HasOne(d => d.SkutaxClass).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUTaxClass_COM_TaxClass"); - - entity.HasMany(d => d.Bundles).WithMany(p => p.Skus) - .UsingEntity>( - "ComBundle", - r => r.HasOne().WithMany() - .HasForeignKey("BundleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), - j => - { - j.HasKey("BundleId", "Skuid"); - j.ToTable("COM_Bundle"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); - j.IndexerProperty("BundleId").HasColumnName("BundleID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.OptionSkus).WithMany(p => p.SkusNavigation) - .UsingEntity>( - "ComSkuallowedOption", - r => r.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), - j => - { - j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); - j.ToTable("COM_SKUAllowedOption"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.OptionSkusNavigation).WithMany(p => p.VariantSkus) - .UsingEntity>( - "ComVariantOption", - r => r.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("VariantSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), - j => - { - j.HasKey("VariantSkuid", "OptionSkuid"); - j.ToTable("COM_VariantOption"); - j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); - j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - }); - - entity.HasMany(d => d.Skus).WithMany(p => p.Bundles) - .UsingEntity>( - "ComBundle", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("BundleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), - j => - { - j.HasKey("BundleId", "Skuid"); - j.ToTable("COM_Bundle"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); - j.IndexerProperty("BundleId").HasColumnName("BundleID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.SkusNavigation).WithMany(p => p.OptionSkus) - .UsingEntity>( - "ComSkuallowedOption", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), - j => - { - j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); - j.ToTable("COM_SKUAllowedOption"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.VariantSkus).WithMany(p => p.OptionSkusNavigation) - .UsingEntity>( - "ComVariantOption", - r => r.HasOne().WithMany() - .HasForeignKey("VariantSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), - j => - { - j.HasKey("VariantSkuid", "OptionSkuid"); - j.ToTable("COM_VariantOption"); - j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); - j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.FileSku).WithMany(p => p.ComSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUFile_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Category).WithMany(p => p.ComSkuoptionCategories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOptionCategory_CategoryID_COM_OptionCategory"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComSkuoptionCategories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOptionCategory_SKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SupplierId).IsClustered(false); - - entity.HasIndex(e => new { e.SupplierDisplayName, e.SupplierEnabled }, "IX_COM_Supplier_SupplierDisplayName_SupplierEnabled").IsClustered(); - - entity.Property(e => e.SupplierDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.SupplierEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.SupplierLastModified).HasDefaultValueSql("('9/21/2012 12:34:09 PM')"); - - entity.HasOne(d => d.SupplierSite).WithMany(p => p.ComSuppliers).HasConstraintName("FK_COM_Supplier_SupplierSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TaxClassId).IsClustered(false); - - entity.HasIndex(e => e.TaxClassDisplayName, "IX_COM_TaxClass_TaxClassDisplayName").IsClustered(); - - entity.Property(e => e.TaxClassDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TaxClassLastModified).HasDefaultValueSql("('9/20/2012 1:31:27 PM')"); - entity.Property(e => e.TaxClassName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TaxClassZeroIfIdsupplied).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.TaxClassSite).WithMany(p => p.ComTaxClasses).HasConstraintName("FK_COM_TaxClass_TaxClassSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Country).WithMany(p => p.ComTaxClassCountries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxCategoryCountry_CountryID_CMS_Country"); - - entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassCountries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxCategoryCountry_TaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.State).WithMany(p => p.ComTaxClassStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxClassState_StateID_CMS_State"); - - entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxClassState_TaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.VolumeDiscountSku).WithMany(p => p.ComVolumeDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VolumeDiscount_VolumeDiscountSKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Site).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_SiteID_CMS_Site"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_SKUID_COM_SKU"); - - entity.HasOne(d => d.User).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.GroupId).IsClustered(false); - - entity.HasIndex(e => new { e.GroupSiteId, e.GroupDisplayName }, "IX_Community_Group_GroupDisplayName").IsClustered(); - - entity.Property(e => e.GroupApproved).HasDefaultValueSql("((0))"); - entity.Property(e => e.GroupCreatedWhen).HasDefaultValueSql("('10/21/2008 10:17:56 AM')"); - entity.Property(e => e.GroupSecurity).HasDefaultValueSql("((444))"); - entity.Property(e => e.GroupSendJoinLeaveNotification).HasDefaultValueSql("((1))"); - entity.Property(e => e.GroupSendWaitingForApprovalNotification).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.GroupApprovedByUser).WithMany(p => p.CommunityGroupGroupApprovedByUsers).HasConstraintName("FK_Community_Group_GroupApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.GroupAvatar).WithMany(p => p.CommunityGroups).HasConstraintName("FK_Community_Group_GroupAvatarID_CMS_Avatar"); - - entity.HasOne(d => d.GroupCreatedByUser).WithMany(p => p.CommunityGroupGroupCreatedByUsers).HasConstraintName("FK_Community_Group_GroupCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.GroupSite).WithMany(p => p.CommunityGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Community_Group_GroupSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MemberId).IsClustered(false); - - entity.HasIndex(e => e.MemberJoined, "IX_Community_GroupMember_MemberJoined") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.MemberStatus).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.MemberApprovedByUser).WithMany(p => p.CommunityGroupMemberMemberApprovedByUsers).HasConstraintName("FK_Community_GroupMember_MemberApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.MemberGroup).WithMany(p => p.CommunityGroupMembers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Community_GroupMember_MemberGroupID_Community_Group"); - - entity.HasOne(d => d.MemberInvitedByUser).WithMany(p => p.CommunityGroupMemberMemberInvitedByUsers).HasConstraintName("FK_Community_GroupMember_MemberInvitedByUserID_CMS_User"); - - entity.HasOne(d => d.MemberUser).WithMany(p => p.CommunityGroupMemberMemberUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Community_GroupMember_MemberUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Group).WithMany(p => p.CommunityGroupRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_community_GroupRolePermission_GroupID_Community_Group"); - - entity.HasOne(d => d.Permission).WithMany(p => p.CommunityGroupRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_community_GroupRolePermission_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.CommunityGroupRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_community_GroupRolePermission_RoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.InvitationId).HasName("PK_Community_GroupInvitation"); - - entity.HasOne(d => d.InvitationGroup).WithMany(p => p.CommunityInvitations).HasConstraintName("FK_Community_GroupInvitation_InvitationGroupID_Community_Group"); - - entity.HasOne(d => d.InvitedByUser).WithMany(p => p.CommunityInvitationInvitedByUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Community_GroupInvitation_InvitedByUserID_CMS_User"); - - entity.HasOne(d => d.InvitedUser).WithMany(p => p.CommunityInvitationInvitedUsers).HasConstraintName("FK_Community_GroupInvitation_InvitedUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AttendeeId).IsClustered(false); - - entity.HasIndex(e => new { e.AttendeeEmail, e.AttendeeFirstName, e.AttendeeLastName }, "IX_Events_Attendee_AttendeeEmail_AttendeeFirstName_AttendeeLastName").IsClustered(); - - entity.Property(e => e.AttendeeEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AttendeeFirstName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AttendeeLastModified).HasDefaultValueSql("('1/20/2015 8:52:25 AM')"); - entity.Property(e => e.AttendeeLastName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AttendeePhone).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AttendeeEventNode).WithMany(p => p.EventsAttendees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Events_Attendee_AttendeeEventNodeID_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ExportId).IsClustered(false); - - entity.HasIndex(e => e.ExportDateTime, "IX_Export_History_ExportDateTime") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.ExportFileName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ExportSite).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportSiteID_CMS_Site"); - - entity.HasOne(d => d.ExportUser).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskSite).WithMany(p => p.ExportTasks).HasConstraintName("FK_Export_Task_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AttachmentPost).WithMany(p => p.ForumsAttachments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_Attachment_AttachmentPostID_Forums_ForumPost"); - - entity.HasOne(d => d.AttachmentSite).WithMany(p => p.ForumsAttachments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_Attachment_AttachmentSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ForumId).IsClustered(false); - - entity.HasIndex(e => new { e.ForumGroupId, e.ForumOrder }, "IX_Forums_Forum_ForumGroupID_ForumOrder").IsClustered(); - - entity.Property(e => e.ForumImageMaxSideSize).HasDefaultValueSql("((400))"); - entity.Property(e => e.ForumIsAnswerLimit).HasDefaultValueSql("((5))"); - entity.Property(e => e.ForumIsLocked).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ForumCommunityGroup).WithMany(p => p.ForumsForums).HasConstraintName("FK_Forums_Forum_ForumCommunityGroupID_Community_Group"); - - entity.HasOne(d => d.ForumDocument).WithMany(p => p.ForumsForums).HasConstraintName("FK_Forums_Forum_ForumDocumentID_CMS_Document"); - - entity.HasOne(d => d.ForumGroup).WithMany(p => p.ForumsForums) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_Forum_ForumGroupID_Forums_ForumGroup"); - - entity.HasOne(d => d.ForumSite).WithMany(p => p.ForumsForums) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_Forum_ForumSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.GroupId).IsClustered(false); - - entity.HasIndex(e => new { e.GroupSiteId, e.GroupOrder }, "IX_Forums_ForumGroup_GroupSiteID_GroupOrder").IsClustered(); - - entity.Property(e => e.GroupHtmleditor).HasDefaultValueSql("((0))"); - entity.Property(e => e.GroupImageMaxSideSize).HasDefaultValueSql("((400))"); - entity.Property(e => e.GroupLastModified).HasDefaultValueSql("('11/6/2013 2:43:02 PM')"); - entity.Property(e => e.GroupName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GroupUseCaptcha).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.GroupGroup).WithMany(p => p.ForumsForumGroups).HasConstraintName("FK_Forums_ForumGroup_GroupGroupID_Community_Group"); - - entity.HasOne(d => d.GroupSite).WithMany(p => p.ForumsForumGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumGroup_GroupSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PostId).IsClustered(false); - - entity.HasIndex(e => e.PostIdpath, "IX_Forums_ForumPost_PostIDPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.PostAttachmentCount).HasDefaultValueSql("((0))"); - entity.Property(e => e.PostIsLocked).HasDefaultValueSql("((0))"); - entity.Property(e => e.PostQuestionSolved).HasDefaultValueSql("((0))"); - entity.Property(e => e.PostUserName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.PostApprovedByUser).WithMany(p => p.ForumsForumPostPostApprovedByUsers).HasConstraintName("FK_Forums_ForumPost_PostApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.PostForum).WithMany(p => p.ForumsForumPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumPost_PostForumID_Forums_Forum"); - - entity.HasOne(d => d.PostParent).WithMany(p => p.InversePostParent).HasConstraintName("FK_Forums_ForumPost_PostParentID_Forums_ForumPost"); - - entity.HasOne(d => d.PostUser).WithMany(p => p.ForumsForumPostPostUsers).HasConstraintName("FK_Forums_ForumPost_PostUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Forum).WithMany(p => p.ForumsForumRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumRoles_ForumID_Forums_Forum"); - - entity.HasOne(d => d.Permission).WithMany(p => p.ForumsForumRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumRoles_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.ForumsForumRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumRoles_RoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SubscriptionId).IsClustered(false); - - entity.HasIndex(e => new { e.SubscriptionEmail, e.SubscriptionForumId }, "IX_Forums_ForumSubscription_SubscriptionForumID_SubscriptionEmail").IsClustered(); - - entity.HasOne(d => d.SubscriptionForum).WithMany(p => p.ForumsForumSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_ForumSubscription_SubscriptionForumID_Forums_Forum"); - - entity.HasOne(d => d.SubscriptionPost).WithMany(p => p.ForumsForumSubscriptions).HasConstraintName("FK_Forums_ForumSubscription_SubscriptionPostID_Forums_ForumPost"); - - entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.ForumsForumSubscriptions).HasConstraintName("FK_Forums_ForumSubscription_SubscriptionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FavoriteLastModified).HasDefaultValueSql("('12/4/2008 3:23:57 PM')"); - - entity.HasOne(d => d.Forum).WithMany(p => p.ForumsUserFavorites).HasConstraintName("FK_Forums_UserFavorites_ForumID_Forums_Forum"); - - entity.HasOne(d => d.Post).WithMany(p => p.ForumsUserFavorites).HasConstraintName("FK_Forums_UserFavorites_PostID_Forums_ForumPost"); - - entity.HasOne(d => d.Site).WithMany(p => p.ForumsUserFavorites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_UserFavorites_SiteID_CMS_Site"); - - entity.HasOne(d => d.User).WithMany(p => p.ForumsUserFavorites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Forums_UserFavorites_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ConnectorId).IsClustered(false); - - entity.HasIndex(e => e.ConnectorDisplayName, "IX_Integration_Connector_ConnectorDisplayName").IsClustered(); - - entity.Property(e => e.ConnectorEnabled).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SyncLogSynchronization).WithMany(p => p.IntegrationSyncLogs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_SyncLog_SyncLogSynchronizationID_Integration_Synchronization"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SynchronizationConnector).WithMany(p => p.IntegrationSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_Synchronization_SynchronizationConnectorID_Integration_Connector"); - - entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.IntegrationSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_Synchronization_SynchronizationTaskID_Integration_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TaskId).IsClustered(false); - - entity.HasIndex(e => e.TaskNodeAliasPath, "IX_Integration_Task_TaskNodeAliasPath").IsClustered(); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.IntegrationTasks).HasConstraintName("FK_IntegrationTask_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.FileId).IsClustered(false); - - entity.HasIndex(e => e.FilePath, "IX_Media_File_FilePath").IsClustered(); - - entity.Property(e => e.FileCreatedWhen).HasDefaultValueSql("('11/11/2008 4:10:00 PM')"); - entity.Property(e => e.FileModifiedWhen).HasDefaultValueSql("('11/11/2008 4:11:15 PM')"); - entity.Property(e => e.FileTitle).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FileCreatedByUser).WithMany(p => p.MediaFileFileCreatedByUsers).HasConstraintName("FK_Media_File_FileCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.FileLibrary).WithMany(p => p.MediaFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_File_FileLibraryID_Media_Library"); - - entity.HasOne(d => d.FileModifiedByUser).WithMany(p => p.MediaFileFileModifiedByUsers).HasConstraintName("FK_Media_File_FileModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.FileSite).WithMany(p => p.MediaFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_File_FileSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.LibraryId).IsClustered(false); - - entity.HasIndex(e => new { e.LibrarySiteId, e.LibraryDisplayName }, "IX_Media_Library_LibraryDisplayName").IsClustered(); - - entity.Property(e => e.LibraryName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.LibraryGroup).WithMany(p => p.MediaLibraries).HasConstraintName("FK_Media_Library_LibraryGroupID_Community_Group"); - - entity.HasOne(d => d.LibrarySite).WithMany(p => p.MediaLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_Library_LibrarySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Library).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_LibraryID_Media_Library"); - - entity.HasOne(d => d.Permission).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_RoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TestLastModified).HasDefaultValueSql("('12/5/2011 4:56:38 PM')"); - - entity.HasOne(d => d.TestIssue).WithOne(p => p.NewsletterAbtestTestIssue) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_ABTest_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.TestWinnerIssue).WithMany(p => p.NewsletterAbtestTestWinnerIssues).HasConstraintName("FK_Newsletter_ABTest_TestWinnerIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.TestWinnerScheduledTask).WithMany(p => p.NewsletterAbtests).HasConstraintName("FK_Newsletter_ABTest_TestWinnerScheduledTaskID_CMS_ScheduledTask"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ClickedLinkEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ClickedLinkNewsletterLink).WithMany(p => p.NewsletterClickedLinks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_ClickedLink_Newsletter_Link"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.EmailNewsletterIssue).WithMany(p => p.NewsletterEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Emails_EmailNewsletterIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.EmailSite).WithMany(p => p.NewsletterEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Emails_EmailSiteID_CMS_Site"); - - entity.HasOne(d => d.EmailSubscriber).WithMany(p => p.NewsletterEmails).HasConstraintName("FK_Newsletter_Emails_EmailSubscriberID_Newsletter_Subscriber"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TemplateId).IsClustered(false); - - entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateDisplayName").IsClustered(); - - entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TemplateIconClass).HasDefaultValueSql("(N'icon-accordion')"); - entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); - entity.Property(e => e.TemplateType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TemplateSite).WithMany(p => p.NewsletterEmailTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplate_TemplateSiteID_CMS_Site"); - - entity.HasMany(d => d.Newsletters).WithMany(p => p.Templates) - .UsingEntity>( - "NewsletterEmailTemplateNewsletter", - r => r.HasOne().WithMany() - .HasForeignKey("NewsletterId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_Newsletter"), - l => l.HasOne().WithMany() - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_EmailTemplate"), - j => - { - j.HasKey("TemplateId", "NewsletterId"); - j.ToTable("Newsletter_EmailTemplateNewsletter"); - j.HasIndex(new[] { "NewsletterId" }, "IX_Newsletter_EmailTemplateNewsletter_NewsletterID"); - j.IndexerProperty("TemplateId").HasColumnName("TemplateID"); - j.IndexerProperty("NewsletterId").HasColumnName("NewsletterID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailWidgetDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailWidgetIconCssClass).HasDefaultValueSql("(N'icon-cogwheel-square')"); - entity.Property(e => e.EmailWidgetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.EmailWidgetName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailWidgetSite).WithMany(p => p.NewsletterEmailWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidget_EmailWidgetSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.EmailWidget).WithMany(p => p.NewsletterEmailWidgetTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_EmailWidgetID_Newsletter_EmailWidget"); - - entity.HasOne(d => d.Template).WithMany(p => p.NewsletterEmailWidgetTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_TemplateID_Newsletter_EmailTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContactGroup).WithMany(p => p.NewsletterIssueContactGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_IssueContactGroup_ContactGroupID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.LinkIssue).WithMany(p => p.NewsletterLinks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Link_Newsletter_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.NewsletterId).IsClustered(false); - - entity.HasIndex(e => new { e.NewsletterSiteId, e.NewsletterDisplayName }, "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterDisplayName").IsClustered(); - - entity.Property(e => e.NewsletterDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterEnableOptIn).HasDefaultValueSql("((0))"); - entity.Property(e => e.NewsletterLastModified).HasDefaultValueSql("('3/13/2015 2:53:28 PM')"); - entity.Property(e => e.NewsletterLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.NewsletterName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterSendOptInConfirmation).HasDefaultValueSql("((0))"); - entity.Property(e => e.NewsletterSenderEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.NewsletterSenderName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterSource).HasDefaultValueSql("(N'T')"); - entity.Property(e => e.NewsletterTrackClickedLinks).HasDefaultValueSql("((1))"); - entity.Property(e => e.NewsletterTrackOpenEmails).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.NewsletterDynamicScheduledTask).WithMany(p => p.NewsletterNewsletters).HasConstraintName("FK_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID_CMS_ScheduledTask"); - - entity.HasOne(d => d.NewsletterOptInTemplate).WithMany(p => p.NewsletterNewsletterNewsletterOptInTemplates).HasConstraintName("FK_Newsletter_Newsletter_NewsletterOptInTemplateID_EmailTemplate"); - - entity.HasOne(d => d.NewsletterSite).WithMany(p => p.NewsletterNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Newsletter_NewsletterSiteID_CMS_Site"); - - entity.HasOne(d => d.NewsletterUnsubscriptionTemplate).WithMany(p => p.NewsletterNewsletterNewsletterUnsubscriptionTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID_Newsletter_EmailTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.IssueDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.IssueSubject).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.IssueNewsletter).WithMany(p => p.NewsletterNewsletterIssues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueNewsletterID_Newsletter_Newsletter"); - - entity.HasOne(d => d.IssueSite).WithMany(p => p.NewsletterNewsletterIssues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueSiteID_CMS_Site"); - - entity.HasOne(d => d.IssueTemplate).WithMany(p => p.NewsletterNewsletterIssues).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueTemplateID_Newsletter_EmailTemplate"); - - entity.HasOne(d => d.IssueVariantOfIssue).WithMany(p => p.InverseIssueVariantOfIssue).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueVariantOfIssue_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.OpenedEmailEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.OpenedEmailIssue).WithMany(p => p.NewsletterOpenedEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_OpenedEmail_OpenedEmailIssueID_Newsletter_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SubscriberId).IsClustered(false); - - entity.HasIndex(e => new { e.SubscriberSiteId, e.SubscriberFullName }, "IX_Newsletter_Subscriber_SubscriberSiteID_SubscriberFullName").IsClustered(); - - entity.Property(e => e.SubscriberType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SubscriberSite).WithMany(p => p.NewsletterSubscribers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Subscriber_SubscriberSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubscriptionApproved).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Newsletter).WithMany(p => p.NewsletterSubscriberNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_SubscriberNewsletter_NewsletterID_Newsletter_Newsletter"); - - entity.HasOne(d => d.Subscriber).WithMany(p => p.NewsletterSubscriberNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_SubscriberNewsletter_SubscriberID_Newsletter_Subscriber"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UnsubscriptionEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.UnsubscriptionFromIssue).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionFromIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.UnsubscriptionNewsletter).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionNewsletterID_Newsletter_Newsletter"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.GatewayId).IsClustered(false); - - entity.HasIndex(e => e.GatewayDisplayName, "IX_Notification_Gateway_GatewayDisplayName").IsClustered(); - - entity.Property(e => e.GatewayAssemblyName).HasDefaultValueSql("('')"); - entity.Property(e => e.GatewayClassName).HasDefaultValueSql("('')"); - entity.Property(e => e.GatewayDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.GatewayEnabled).HasDefaultValueSql("((0))"); - entity.Property(e => e.GatewayName).HasDefaultValueSql("('')"); - entity.Property(e => e.GatewaySupportsEmail).HasDefaultValueSql("((0))"); - entity.Property(e => e.GatewaySupportsHtmltext).HasDefaultValueSql("((0))"); - entity.Property(e => e.GatewaySupportsPlainText).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubscriptionEventDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.SubscriptionSiteId).HasDefaultValueSql("((0))"); - entity.Property(e => e.SubscriptionUseHtml).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.SubscriptionGateway).WithMany(p => p.NotificationSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_Subscription_SubscriptionGatewayID_Notification_Gateway"); - - entity.HasOne(d => d.SubscriptionSite).WithMany(p => p.NotificationSubscriptions).HasConstraintName("FK_Notification_Subscription_SubscriptionSiteID_CMS_Site"); - - entity.HasOne(d => d.SubscriptionTemplate).WithMany(p => p.NotificationSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_Subscription_SubscriptionTemplateID_Notification_Template"); - - entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.NotificationSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_Subscription_SubscriptionUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TemplateId).IsClustered(false); - - entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Notification_Template_TemplateSiteID_TemplateDisplayName").IsClustered(); - - entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TemplateSite).WithMany(p => p.NotificationTemplates).HasConstraintName("FK_Notification_Template_TemplateSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Gateway).WithMany(p => p.NotificationTemplateTexts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_TemplateText_GatewayID_Notification_Gateway"); - - entity.HasOne(d => d.Template).WithMany(p => p.NotificationTemplateTexts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Notification_TemplateText_TemplateID_Notification_Template"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AbtestDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.AbtestIncludedTraffic).HasDefaultValueSql("((100))"); - entity.Property(e => e.AbtestName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AbtestOriginalPage).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AbtestSite).WithMany(p => p.OmAbtests) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABTest_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AbvariantDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.AbvariantName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AbvariantSite).WithMany(p => p.OmAbvariants) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABVariant_CMS_Site"); - - entity.HasOne(d => d.AbvariantTest).WithMany(p => p.OmAbvariants) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABVariant_ABVariantTestID_OM_ABTest"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AbvariantDisplayName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AbvariantTest).WithMany(p => p.OmAbvariantData) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABVariantData_ABVariantTestID_OM_ABTest"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AccountCountry).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_Country"); - - entity.HasOne(d => d.AccountOwnerUser).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_User"); - - entity.HasOne(d => d.AccountPrimaryContact).WithMany(p => p.OmAccountAccountPrimaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_PrimaryContact"); - - entity.HasOne(d => d.AccountSecondaryContact).WithMany(p => p.OmAccountAccountSecondaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_SecondaryContact"); - - entity.HasOne(d => d.AccountState).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_State"); - - entity.HasOne(d => d.AccountStatus).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_OM_AccountStatus"); - - entity.HasOne(d => d.AccountSubsidiaryOf).WithMany(p => p.InverseAccountSubsidiaryOf).HasConstraintName("FK_OM_Account_OM_Account_SubsidiaryOf"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Account).WithMany(p => p.OmAccountContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_AccountContact_OM_Account"); - - entity.HasOne(d => d.Contact).WithMany(p => p.OmAccountContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_AccountContact_OM_Contact"); - - entity.HasOne(d => d.ContactRole).WithMany(p => p.OmAccountContacts).HasConstraintName("FK_OM_AccountContact_OM_ContactRole"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ActivityCampaign, "IX_OM_Activity_ActivityCampaign") - .HasFilter("([ActivityCampaign] IS NOT NULL)") - .HasFillFactor(90); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ActivityTypeEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ActivityTypeIsCustom).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactCreated).HasDefaultValueSql("('5/3/2011 10:51:13 AM')"); - entity.Property(e => e.ContactMonitored).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactSalesForceLeadReplicationDisabled).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactSalesForceLeadReplicationRequired).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ContactCountry).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_Country"); - - entity.HasOne(d => d.ContactOwnerUser).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_User"); - - entity.HasOne(d => d.ContactState).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_State"); - - entity.HasOne(d => d.ContactStatus).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_OM_ContactStatus"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ContactGroupId).HasName("PK_CMS_ContactGroup"); - - entity.Property(e => e.ContactGroupName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactGroupMemberFromCondition).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactGroupMemberFromManual).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ContactGroupMemberContactGroup).WithMany(p => p.OmContactGroupMembers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ContactGroupMembers_OM_ContactGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactRoleDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContactRoleName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactStatusDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContactStatusName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Contact).WithMany(p => p.OmMemberships) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_Membership_OM_Contact"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MvtcombinationIsDefault).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Mvtvariants).WithMany(p => p.Mvtcombinations) - .UsingEntity>( - "OmMvtcombinationVariation", - r => r.HasOne().WithMany() - .HasForeignKey("MvtvariantId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_MVTCombinationVariation_OM_MVTVariant"), - l => l.HasOne().WithMany() - .HasForeignKey("MvtcombinationId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_MVTCombinationVariation_OM_MVTCombination"), - j => - { - j.HasKey("MvtcombinationId", "MvtvariantId"); - j.ToTable("OM_MVTCombinationVariation"); - j.HasIndex(new[] { "MvtvariantId" }, "IX_OM_MVTCombinationVariation_MVTVariantID"); - j.IndexerProperty("MvtcombinationId").HasColumnName("MVTCombinationID"); - j.IndexerProperty("MvtvariantId").HasColumnName("MVTVariantID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MvtestDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.MvtestName).HasDefaultValueSql("('')"); - entity.Property(e => e.MvtestPage).HasDefaultValueSql("('')"); - entity.Property(e => e.MvtestTargetConversionType).HasDefaultValueSql("('TOTAL')"); - - entity.HasOne(d => d.MvtestSite).WithMany(p => p.OmMvtests) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_MVTest_MVTestSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MvtvariantEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MvtvariantName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.MvtvariantPageTemplate).WithMany(p => p.OmMvtvariants) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_MVTVariant_MVTVariantPageTemplateID_CMS_PageTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.VariantDisplayCondition).HasDefaultValueSql("('')"); - entity.Property(e => e.VariantDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.VariantEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.VariantName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.VariantDocument).WithMany(p => p.OmPersonalizationVariants).HasConstraintName("FK_OM_PersonalizationVariant_VariantDocumentID_CMS_Document"); - - entity.HasOne(d => d.VariantPageTemplate).WithMany(p => p.OmPersonalizationVariants) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_PersonalizationVariant_VariantPageTemplateID_CMS_PageTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.RuleDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.RuleName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); - entity.Property(e => e.RuleType).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.RuleScore).WithMany(p => p.OmRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_Rule_OM_Score"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Contact).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Contact"); - - entity.HasOne(d => d.Rule).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Rule"); - - entity.HasOne(d => d.Score).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Score"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.VisitorToContactContact).WithMany(p => p.OmVisitorToContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_VisitorToContact_OM_Contact_Cascade"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PersonaDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PersonaEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PersonaName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); - entity.Property(e => e.PersonaPointsThreshold).HasDefaultValueSql("((100))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PersonaContactHistoryDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.PersonaContactHistoryPersona).WithMany(p => p.PersonasPersonaContactHistories).HasConstraintName("FK_Personas_PersonaContactHistory_Personas_Persona"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Node).WithMany(p => p.PersonasPersonaNodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Personas_PersonaNode_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PollId).IsClustered(false); - - entity.HasIndex(e => new { e.PollSiteId, e.PollDisplayName }, "IX_Polls_Poll_PollSiteID_PollDisplayName").IsClustered(); - - entity.Property(e => e.PollCodeName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PollDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PollQuestion).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PollResponseMessage).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PollTitle).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PollGroup).WithMany(p => p.PollsPolls).HasConstraintName("FK_Polls_Poll_PollGroupID_Community_Group"); - - entity.HasOne(d => d.PollSite).WithMany(p => p.PollsPolls).HasConstraintName("FK_Polls_Poll_PollSiteID_CMS_Site"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Polls) - .UsingEntity>( - "PollsPollRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollRoles_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("PollId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollRoles_PollID_Polls_Poll"), - j => - { - j.HasKey("PollId", "RoleId"); - j.ToTable("Polls_PollRoles"); - j.HasIndex(new[] { "RoleId" }, "IX_Polls_PollRoles_RoleID"); - j.IndexerProperty("PollId").HasColumnName("PollID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - - entity.HasMany(d => d.Sites).WithMany(p => p.Polls) - .UsingEntity>( - "PollsPollSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("PollId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollSite_PollID_Polls_Poll"), - j => - { - j.HasKey("PollId", "SiteId"); - j.ToTable("Polls_PollSite"); - j.HasIndex(new[] { "SiteId" }, "IX_Polls_PollSite_SiteID"); - j.IndexerProperty("PollId").HasColumnName("PollID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AnswerId).IsClustered(false); - - entity.HasIndex(e => new { e.AnswerOrder, e.AnswerPollId, e.AnswerEnabled }, "IX_Polls_PollAnswer_AnswerPollID_AnswerOrder_AnswerEnabled").IsClustered(); - - entity.Property(e => e.AnswerHideForm).HasDefaultValueSql("((0))"); - entity.Property(e => e.AnswerText).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AnswerPoll).WithMany(p => p.PollsPollAnswers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Polls_PollAnswer_AnswerPollID_Polls_Poll"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ReportId).IsClustered(false); - - entity.HasIndex(e => new { e.ReportDisplayName, e.ReportCategoryId }, "IX_Reporting_Report_ReportCategoryID_ReportDisplayName").IsClustered(); - - entity.Property(e => e.ReportAccess).HasDefaultValueSql("((1))"); - entity.Property(e => e.ReportDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportEnableSubscription).HasDefaultValueSql("((0))"); - entity.Property(e => e.ReportName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ReportCategory).WithMany(p => p.ReportingReports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_Report_ReportCategoryID_Reporting_ReportCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_Reporting_ReportCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_Reporting_ReportCategory_CategoryID_Reporting_ReportCategory_ParentCategoryID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.GraphReport).WithMany(p => p.ReportingReportGraphs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportGraph_GraphReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ReportSubscriptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ReportSubscriptionInterval).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportSubscriptionLastModified).HasDefaultValueSql("('3/9/2012 11:17:19 AM')"); - entity.Property(e => e.ReportSubscriptionOnlyNonEmpty).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ReportSubscriptionGraph).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionGraphID_Reporting_ReportGraph"); - - entity.HasOne(d => d.ReportSubscriptionReport).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionReportID_Reporting_Report"); - - entity.HasOne(d => d.ReportSubscriptionSite).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionSiteID_CMS_Site"); - - entity.HasOne(d => d.ReportSubscriptionTable).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionTableID_Reporting_ReportTable"); - - entity.HasOne(d => d.ReportSubscriptionUser).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionUserID_CMS_User"); - - entity.HasOne(d => d.ReportSubscriptionValue).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionValueID_Reporting_ReportValue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TableReport).WithMany(p => p.ReportingReportTables) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportTable_TableReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ValueReport).WithMany(p => p.ReportingReportValues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportValue_ValueReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SavedGraphSavedReport).WithMany(p => p.ReportingSavedGraphs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_SavedGraph_SavedGraphSavedReportID_Reporting_SavedReport"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SavedReportId).IsClustered(false); - - entity.HasIndex(e => new { e.SavedReportReportId, e.SavedReportDate }, "IX_Reporting_SavedReport_SavedReportReportID_SavedReportDate") - .IsDescending(false, true) - .IsClustered(); - - entity.HasOne(d => d.SavedReportCreatedByUser).WithMany(p => p.ReportingSavedReports).HasConstraintName("FK_Reporting_SavedReport_SavedReportCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.SavedReportReport).WithMany(p => p.ReportingSavedReports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_SavedReport_SavedReportReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SharePointConnectionAuthMode).HasDefaultValueSql("(N'default')"); - entity.Property(e => e.SharePointConnectionSharePointVersion).HasDefaultValueSql("(N'sp2010')"); - - entity.HasOne(d => d.SharePointConnectionSite).WithMany(p => p.SharePointSharePointConnections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointConnection_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SharePointFileEtag).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileExtension).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileMimeType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileServerRelativeUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SharePointFileSharePointLibrary).WithMany(p => p.SharePointSharePointFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointFile_SharePoint_SharePointLibrary"); - - entity.HasOne(d => d.SharePointFileSite).WithMany(p => p.SharePointSharePointFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointFile_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SharePointLibraryDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibraryLastModified).HasDefaultValueSql("('10/3/2014 2:45:04 PM')"); - entity.Property(e => e.SharePointLibraryListTitle).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibraryName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibrarySharePointConnectionId).HasDefaultValueSql("((0))"); - entity.Property(e => e.SharePointLibrarySynchronizationPeriod).HasDefaultValueSql("((720))"); - - entity.HasOne(d => d.SharePointLibrarySharePointConnection).WithMany(p => p.SharePointSharePointLibraries).HasConstraintName("FK_SharePoint_SharePointLibrary_SharePoint_SharePointConnection"); - - entity.HasOne(d => d.SharePointLibrarySite).WithMany(p => p.SharePointSharePointLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointLibrary_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookAccountPageAccessToken).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookAccountPageId).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FacebookAccountFacebookApplication).WithMany(p => p.SmFacebookAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookAccount_SM_FacebookApplication"); - - entity.HasOne(d => d.FacebookAccountSite).WithMany(p => p.SmFacebookAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookAccount_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookApplicationConsumerKey).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookApplicationConsumerSecret).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookApplicationLastModified).HasDefaultValueSql("('5/28/2013 1:02:36 PM')"); - - entity.HasOne(d => d.FacebookApplicationSite).WithMany(p => p.SmFacebookApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookPostIsCreatedByUser).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.FacebookPostFacebookAccount).WithMany(p => p.SmFacebookPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookPost_SM_FacebookAccount"); - - entity.HasOne(d => d.FacebookPostSite).WithMany(p => p.SmFacebookPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookPost_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.InsightExternalId).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitDays).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitMonths).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitWeeks).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitYears).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInAccountAccessToken).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountProfileId).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInApplicationConsumerKey).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationConsumerSecret).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.LinkedInApplicationSite).WithMany(p => p.SmLinkedInApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInPostComment).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInPostIsCreatedByUser).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.LinkedInPostLinkedInAccount).WithMany(p => p.SmLinkedInPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInPost_SM_LinkedInAccount"); - - entity.HasOne(d => d.LinkedInPostSite).WithMany(p => p.SmLinkedInPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInPost_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterAccountAccessToken).HasDefaultValueSql("('')"); - entity.Property(e => e.TwitterAccountAccessTokenSecret).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterAccountSite).WithMany(p => p.SmTwitterAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterAccount_CMS_Site"); - - entity.HasOne(d => d.TwitterAccountTwitterApplication).WithMany(p => p.SmTwitterAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterAccount_SM_TwitterApplication"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterApplicationConsumerKey).HasDefaultValueSql("('')"); - entity.Property(e => e.TwitterApplicationConsumerSecret).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterApplicationSite).WithMany(p => p.SmTwitterApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterPostIsCreatedByUser).HasDefaultValueSql("((1))"); - entity.Property(e => e.TwitterPostText).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterPostSite).WithMany(p => p.SmTwitterPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterPost_CMS_Site"); - - entity.HasOne(d => d.TwitterPostTwitterAccount).WithMany(p => p.SmTwitterPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterPost_SM_TwitterAccount"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ServerId).IsClustered(false); - - entity.HasIndex(e => new { e.ServerSiteId, e.ServerDisplayName }, "IX_Staging_Server_ServerSiteID_ServerDisplayName").IsClustered(); - - entity.Property(e => e.ServerAuthentication).HasDefaultValueSql("('USERNAME')"); - entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ServerEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ServerName).HasDefaultValueSql("('')"); - entity.Property(e => e.ServerUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ServerSite).WithMany(p => p.StagingServers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Server_ServerSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SynchronizationServer).WithMany(p => p.StagingSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Synchronization_SynchronizationServerID_Staging_Server"); - - entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.StagingSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Synchronization_SynchronizationTaskID_Staging_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskServers).HasDefaultValueSql("('null')"); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.StagingTasks).HasConstraintName("FK_Staging_Task_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskGroupCodeName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupTask_Staging_TaskGroup"); - - entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskGroupTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupTask_Staging_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupUser_Staging_TaskGroup"); - - entity.HasOne(d => d.User).WithOne(p => p.StagingTaskGroupUser) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupUser_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskUser_StagingTask"); - - entity.HasOne(d => d.User).WithMany(p => p.StagingTaskUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskUser_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileDirectory).HasDefaultValueSql("('')"); - entity.Property(e => e.FileExtension).HasDefaultValueSql("('')"); - entity.Property(e => e.FileLastModified).HasDefaultValueSql("('6/29/2010 1:57:54 PM')"); - entity.Property(e => e.FileMimeType).HasDefaultValueSql("('')"); - entity.Property(e => e.FileName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PageBuilderWidgetsLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Boards_BoardMessage_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ACLItem_ItemsAndOperators"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ObjectVersionHistoryUser_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_PageTemplateCategoryPageTemplate_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Relationship_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ResourceString_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ResourceTranslated_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_RoleResourcePermission_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Site_DocumentCount"); - - entity.Property(e => e.SiteId).ValueGeneratedOnAdd(); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_SiteRoleResourceUIElement_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Tree_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserDocuments"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRole_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRoleMembershipRole"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRole_MembershipRole_ValidOnly_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserSettingsRole_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_WebPartCategoryWebpart_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_WidgetCategoryWidget_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_COM_SKUOptionCategory_OptionCategory_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Community_Group"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Community_Member"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Forums_GroupForumPost_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Integration_Task_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Membership_MembershipUser_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Newsletter_Subscriptions_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_AccountContact_AccountJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_AccountContact_ContactJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_Account_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_ContactGroupMember_AccountJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Poll_AnswerCount"); - - entity.Property(e => e.PollId).ValueGeneratedOnAdd(); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Reporting_CategoryReport_Joined"); - }); - - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; + +using Migration.Toolkit.KX12.Models; + +namespace Migration.Toolkit.KX12.Context; + +public partial class KX12Context : DbContext +{ + public KX12Context() + { + } + + public KX12Context(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet AnalyticsCampaigns { get; set; } + + public virtual DbSet AnalyticsCampaignAssets { get; set; } + + public virtual DbSet AnalyticsCampaignAssetUrls { get; set; } + + public virtual DbSet AnalyticsCampaignConversions { get; set; } + + public virtual DbSet AnalyticsCampaignConversionHits { get; set; } + + public virtual DbSet AnalyticsCampaignObjectives { get; set; } + + public virtual DbSet AnalyticsConversions { get; set; } + + public virtual DbSet AnalyticsDayHits { get; set; } + + public virtual DbSet AnalyticsExitPages { get; set; } + + public virtual DbSet AnalyticsHourHits { get; set; } + + public virtual DbSet AnalyticsMonthHits { get; set; } + + public virtual DbSet AnalyticsStatistics { get; set; } + + public virtual DbSet AnalyticsWeekHits { get; set; } + + public virtual DbSet AnalyticsYearHits { get; set; } + + public virtual DbSet BadWordsWords { get; set; } + + public virtual DbSet BlogComments { get; set; } + + public virtual DbSet BlogPostSubscriptions { get; set; } + + public virtual DbSet BoardBoards { get; set; } + + public virtual DbSet BoardMessages { get; set; } + + public virtual DbSet BoardSubscriptions { get; set; } + + public virtual DbSet ChatInitiatedChatRequests { get; set; } + + public virtual DbSet ChatMessages { get; set; } + + public virtual DbSet ChatNotifications { get; set; } + + public virtual DbSet ChatOnlineSupports { get; set; } + + public virtual DbSet ChatOnlineUsers { get; set; } + + public virtual DbSet ChatPopupWindowSettings { get; set; } + + public virtual DbSet ChatRooms { get; set; } + + public virtual DbSet ChatRoomUsers { get; set; } + + public virtual DbSet ChatSupportCannedResponses { get; set; } + + public virtual DbSet ChatSupportTakenRooms { get; set; } + + public virtual DbSet ChatUsers { get; set; } + + public virtual DbSet CiFileMetadata { get; set; } + + public virtual DbSet CiMigrations { get; set; } + + public virtual DbSet CmsAbuseReports { get; set; } + + public virtual DbSet CmsAcls { get; set; } + + public virtual DbSet CmsAclitems { get; set; } + + public virtual DbSet CmsAlternativeForms { get; set; } + + public virtual DbSet CmsAlternativeUrls { get; set; } + + public virtual DbSet CmsAttachments { get; set; } + + public virtual DbSet CmsAttachmentHistories { get; set; } + + public virtual DbSet CmsAutomationHistories { get; set; } + + public virtual DbSet CmsAutomationStates { get; set; } + + public virtual DbSet CmsAvatars { get; set; } + + public virtual DbSet CmsBadges { get; set; } + + public virtual DbSet CmsBannedIps { get; set; } + + public virtual DbSet CmsBanners { get; set; } + + public virtual DbSet CmsBannerCategories { get; set; } + + public virtual DbSet CmsCategories { get; set; } + + public virtual DbSet CmsClasses { get; set; } + + public virtual DbSet CmsConsents { get; set; } + + public virtual DbSet CmsConsentAgreements { get; set; } + + public virtual DbSet CmsConsentArchives { get; set; } + + public virtual DbSet CmsCountries { get; set; } + + public virtual DbSet CmsCssStylesheets { get; set; } + + public virtual DbSet CmsCultures { get; set; } + + public virtual DbSet CmsDeviceProfiles { get; set; } + + public virtual DbSet CmsDeviceProfileLayouts { get; set; } + + public virtual DbSet CmsDocuments { get; set; } + + public virtual DbSet CmsDocumentAliases { get; set; } + + public virtual DbSet CmsDocumentTypeScopes { get; set; } + + public virtual DbSet CmsEmails { get; set; } + + public virtual DbSet CmsEmailAttachments { get; set; } + + public virtual DbSet CmsEmailTemplates { get; set; } + + public virtual DbSet CmsEmailUsers { get; set; } + + public virtual DbSet CmsEventLogs { get; set; } + + public virtual DbSet CmsExternalLogins { get; set; } + + public virtual DbSet CmsForms { get; set; } + + public virtual DbSet CmsFormUserControls { get; set; } + + public virtual DbSet CmsHelpTopics { get; set; } + + public virtual DbSet CmsLayouts { get; set; } + + public virtual DbSet CmsLicenseKeys { get; set; } + + public virtual DbSet CmsMacroIdentities { get; set; } + + public virtual DbSet CmsMacroRules { get; set; } + + public virtual DbSet CmsMemberships { get; set; } + + public virtual DbSet CmsMembershipUsers { get; set; } + + public virtual DbSet CmsMetaFiles { get; set; } + + public virtual DbSet CmsModuleLicenseKeys { get; set; } + + public virtual DbSet CmsModuleUsageCounters { get; set; } + + public virtual DbSet CmsObjectSettings { get; set; } + + public virtual DbSet CmsObjectVersionHistories { get; set; } + + public virtual DbSet CmsObjectWorkflowTriggers { get; set; } + + public virtual DbSet CmsOpenIdusers { get; set; } + + public virtual DbSet CmsPageTemplates { get; set; } + + public virtual DbSet CmsPageTemplateCategories { get; set; } + + public virtual DbSet CmsPageTemplateConfigurations { get; set; } + + public virtual DbSet CmsPageTemplateScopes { get; set; } + + public virtual DbSet CmsPermissions { get; set; } + + public virtual DbSet CmsPersonalizations { get; set; } + + public virtual DbSet CmsQueries { get; set; } + + public virtual DbSet CmsRelationships { get; set; } + + public virtual DbSet CmsRelationshipNames { get; set; } + + public virtual DbSet CmsResources { get; set; } + + public virtual DbSet CmsResourceLibraries { get; set; } + + public virtual DbSet CmsResourceStrings { get; set; } + + public virtual DbSet CmsResourceTranslations { get; set; } + + public virtual DbSet CmsRoles { get; set; } + + public virtual DbSet CmsScheduledTasks { get; set; } + + public virtual DbSet CmsSearchEngines { get; set; } + + public virtual DbSet CmsSearchIndices { get; set; } + + public virtual DbSet CmsSearchTasks { get; set; } + + public virtual DbSet CmsSearchTaskAzures { get; set; } + + public virtual DbSet CmsSessions { get; set; } + + public virtual DbSet CmsSettingsCategories { get; set; } + + public virtual DbSet CmsSettingsKeys { get; set; } + + public virtual DbSet CmsSites { get; set; } + + public virtual DbSet CmsSiteDomainAliases { get; set; } + + public virtual DbSet CmsSmtpservers { get; set; } + + public virtual DbSet CmsStates { get; set; } + + public virtual DbSet CmsTags { get; set; } + + public virtual DbSet CmsTagGroups { get; set; } + + public virtual DbSet CmsTemplateDeviceLayouts { get; set; } + + public virtual DbSet CmsTimeZones { get; set; } + + public virtual DbSet CmsTransformations { get; set; } + + public virtual DbSet CmsTranslationServices { get; set; } + + public virtual DbSet CmsTranslationSubmissions { get; set; } + + public virtual DbSet CmsTranslationSubmissionItems { get; set; } + + public virtual DbSet CmsTrees { get; set; } + + public virtual DbSet CmsUielements { get; set; } + + public virtual DbSet CmsUsers { get; set; } + + public virtual DbSet CmsUserCultures { get; set; } + + public virtual DbSet CmsUserMacroIdentities { get; set; } + + public virtual DbSet CmsUserRoles { get; set; } + + public virtual DbSet CmsUserSettings { get; set; } + + public virtual DbSet CmsUserSites { get; set; } + + public virtual DbSet CmsVersionHistories { get; set; } + + public virtual DbSet CmsWebFarmServers { get; set; } + + public virtual DbSet CmsWebFarmServerLogs { get; set; } + + public virtual DbSet CmsWebFarmServerMonitorings { get; set; } + + public virtual DbSet CmsWebFarmServerTasks { get; set; } + + public virtual DbSet CmsWebFarmTasks { get; set; } + + public virtual DbSet CmsWebParts { get; set; } + + public virtual DbSet CmsWebPartCategories { get; set; } + + public virtual DbSet CmsWebPartContainers { get; set; } + + public virtual DbSet CmsWebPartLayouts { get; set; } + + public virtual DbSet CmsWebTemplates { get; set; } + + public virtual DbSet CmsWidgets { get; set; } + + public virtual DbSet CmsWidgetCategories { get; set; } + + public virtual DbSet CmsWidgetRoles { get; set; } + + public virtual DbSet CmsWorkflows { get; set; } + + public virtual DbSet CmsWorkflowActions { get; set; } + + public virtual DbSet CmsWorkflowHistories { get; set; } + + public virtual DbSet CmsWorkflowScopes { get; set; } + + public virtual DbSet CmsWorkflowSteps { get; set; } + + public virtual DbSet CmsWorkflowStepRoles { get; set; } + + public virtual DbSet CmsWorkflowStepUsers { get; set; } + + public virtual DbSet CmsWorkflowTransitions { get; set; } + + public virtual DbSet ComAddresses { get; set; } + + public virtual DbSet ComBrands { get; set; } + + public virtual DbSet ComCarriers { get; set; } + + public virtual DbSet ComCollections { get; set; } + + public virtual DbSet ComCouponCodes { get; set; } + + public virtual DbSet ComCurrencies { get; set; } + + public virtual DbSet ComCurrencyExchangeRates { get; set; } + + public virtual DbSet ComCustomers { get; set; } + + public virtual DbSet ComCustomerCreditHistories { get; set; } + + public virtual DbSet ComDepartments { get; set; } + + public virtual DbSet ComDiscounts { get; set; } + + public virtual DbSet ComExchangeTables { get; set; } + + public virtual DbSet ComGiftCards { get; set; } + + public virtual DbSet ComGiftCardCouponCodes { get; set; } + + public virtual DbSet ComInternalStatuses { get; set; } + + public virtual DbSet ComManufacturers { get; set; } + + public virtual DbSet ComMultiBuyCouponCodes { get; set; } + + public virtual DbSet ComMultiBuyDiscounts { get; set; } + + public virtual DbSet ComMultiBuyDiscountBrands { get; set; } + + public virtual DbSet ComMultiBuyDiscountCollections { get; set; } + + public virtual DbSet ComMultiBuyDiscountTrees { get; set; } + + public virtual DbSet ComOptionCategories { get; set; } + + public virtual DbSet ComOrders { get; set; } + + public virtual DbSet ComOrderAddresses { get; set; } + + public virtual DbSet ComOrderItems { get; set; } + + public virtual DbSet ComOrderItemSkufiles { get; set; } + + public virtual DbSet ComOrderStatuses { get; set; } + + public virtual DbSet ComOrderStatusUsers { get; set; } + + public virtual DbSet ComPaymentOptions { get; set; } + + public virtual DbSet ComPublicStatuses { get; set; } + + public virtual DbSet ComShippingCosts { get; set; } + + public virtual DbSet ComShippingOptions { get; set; } + + public virtual DbSet ComShoppingCarts { get; set; } + + public virtual DbSet ComShoppingCartCouponCodes { get; set; } + + public virtual DbSet ComShoppingCartSkus { get; set; } + + public virtual DbSet ComSkus { get; set; } + + public virtual DbSet ComSkufiles { get; set; } + + public virtual DbSet ComSkuoptionCategories { get; set; } + + public virtual DbSet ComSuppliers { get; set; } + + public virtual DbSet ComTaxClasses { get; set; } + + public virtual DbSet ComTaxClassCountries { get; set; } + + public virtual DbSet ComTaxClassStates { get; set; } + + public virtual DbSet ComVolumeDiscounts { get; set; } + + public virtual DbSet ComWishlists { get; set; } + + public virtual DbSet CommunityGroups { get; set; } + + public virtual DbSet CommunityGroupMembers { get; set; } + + public virtual DbSet CommunityGroupRolePermissions { get; set; } + + public virtual DbSet CommunityInvitations { get; set; } + + public virtual DbSet ContentFiles { get; set; } + + public virtual DbSet EventsAttendees { get; set; } + + public virtual DbSet ExportHistories { get; set; } + + public virtual DbSet ExportTasks { get; set; } + + public virtual DbSet ForumsAttachments { get; set; } + + public virtual DbSet ForumsForums { get; set; } + + public virtual DbSet ForumsForumGroups { get; set; } + + public virtual DbSet ForumsForumPosts { get; set; } + + public virtual DbSet ForumsForumRoles { get; set; } + + public virtual DbSet ForumsForumSubscriptions { get; set; } + + public virtual DbSet ForumsUserFavorites { get; set; } + + public virtual DbSet IntegrationConnectors { get; set; } + + public virtual DbSet IntegrationSyncLogs { get; set; } + + public virtual DbSet IntegrationSynchronizations { get; set; } + + public virtual DbSet IntegrationTasks { get; set; } + + public virtual DbSet MediaFiles { get; set; } + + public virtual DbSet MediaLibraries { get; set; } + + public virtual DbSet MediaLibraryRolePermissions { get; set; } + + public virtual DbSet NewsletterAbtests { get; set; } + + public virtual DbSet NewsletterClickedLinks { get; set; } + + public virtual DbSet NewsletterEmails { get; set; } + + public virtual DbSet NewsletterEmailTemplates { get; set; } + + public virtual DbSet NewsletterEmailWidgets { get; set; } + + public virtual DbSet NewsletterEmailWidgetTemplates { get; set; } + + public virtual DbSet NewsletterIssueContactGroups { get; set; } + + public virtual DbSet NewsletterLinks { get; set; } + + public virtual DbSet NewsletterNewsletters { get; set; } + + public virtual DbSet NewsletterNewsletterIssues { get; set; } + + public virtual DbSet NewsletterOpenedEmails { get; set; } + + public virtual DbSet NewsletterSubscribers { get; set; } + + public virtual DbSet NewsletterSubscriberNewsletters { get; set; } + + public virtual DbSet NewsletterUnsubscriptions { get; set; } + + public virtual DbSet NotificationGateways { get; set; } + + public virtual DbSet NotificationSubscriptions { get; set; } + + public virtual DbSet NotificationTemplates { get; set; } + + public virtual DbSet NotificationTemplateTexts { get; set; } + + public virtual DbSet OmAbtests { get; set; } + + public virtual DbSet OmAbvariants { get; set; } + + public virtual DbSet OmAbvariantData { get; set; } + + public virtual DbSet OmAccounts { get; set; } + + public virtual DbSet OmAccountContacts { get; set; } + + public virtual DbSet OmAccountStatuses { get; set; } + + public virtual DbSet OmActivities { get; set; } + + public virtual DbSet OmActivityRecalculationQueues { get; set; } + + public virtual DbSet OmActivityTypes { get; set; } + + public virtual DbSet OmContacts { get; set; } + + public virtual DbSet OmContactChangeRecalculationQueues { get; set; } + + public virtual DbSet OmContactGroups { get; set; } + + public virtual DbSet OmContactGroupMembers { get; set; } + + public virtual DbSet OmContactRoles { get; set; } + + public virtual DbSet OmContactStatuses { get; set; } + + public virtual DbSet OmMemberships { get; set; } + + public virtual DbSet OmMvtcombinations { get; set; } + + public virtual DbSet OmMvtests { get; set; } + + public virtual DbSet OmMvtvariants { get; set; } + + public virtual DbSet OmPersonalizationVariants { get; set; } + + public virtual DbSet OmRules { get; set; } + + public virtual DbSet OmScores { get; set; } + + public virtual DbSet OmScoreContactRules { get; set; } + + public virtual DbSet OmVisitorToContacts { get; set; } + + public virtual DbSet PersonasPersonas { get; set; } + + public virtual DbSet PersonasPersonaContactHistories { get; set; } + + public virtual DbSet PersonasPersonaNodes { get; set; } + + public virtual DbSet PollsPolls { get; set; } + + public virtual DbSet PollsPollAnswers { get; set; } + + public virtual DbSet ReportingReports { get; set; } + + public virtual DbSet ReportingReportCategories { get; set; } + + public virtual DbSet ReportingReportGraphs { get; set; } + + public virtual DbSet ReportingReportSubscriptions { get; set; } + + public virtual DbSet ReportingReportTables { get; set; } + + public virtual DbSet ReportingReportValues { get; set; } + + public virtual DbSet ReportingSavedGraphs { get; set; } + + public virtual DbSet ReportingSavedReports { get; set; } + + public virtual DbSet SharePointSharePointConnections { get; set; } + + public virtual DbSet SharePointSharePointFiles { get; set; } + + public virtual DbSet SharePointSharePointLibraries { get; set; } + + public virtual DbSet SmFacebookAccounts { get; set; } + + public virtual DbSet SmFacebookApplications { get; set; } + + public virtual DbSet SmFacebookPosts { get; set; } + + public virtual DbSet SmInsights { get; set; } + + public virtual DbSet SmInsightHitDays { get; set; } + + public virtual DbSet SmInsightHitMonths { get; set; } + + public virtual DbSet SmInsightHitWeeks { get; set; } + + public virtual DbSet SmInsightHitYears { get; set; } + + public virtual DbSet SmLinkedInAccounts { get; set; } + + public virtual DbSet SmLinkedInApplications { get; set; } + + public virtual DbSet SmLinkedInPosts { get; set; } + + public virtual DbSet SmTwitterAccounts { get; set; } + + public virtual DbSet SmTwitterApplications { get; set; } + + public virtual DbSet SmTwitterPosts { get; set; } + + public virtual DbSet StagingServers { get; set; } + + public virtual DbSet StagingSynchronizations { get; set; } + + public virtual DbSet StagingTasks { get; set; } + + public virtual DbSet StagingTaskGroups { get; set; } + + public virtual DbSet StagingTaskGroupTasks { get; set; } + + public virtual DbSet StagingTaskGroupUsers { get; set; } + + public virtual DbSet StagingTaskUsers { get; set; } + + public virtual DbSet TempFiles { get; set; } + + public virtual DbSet TempPageBuilderWidgets { get; set; } + + public virtual DbSet ViewBoardsBoardMessageJoineds { get; set; } + + public virtual DbSet ViewCmsAclitemItemsAndOperators { get; set; } + + public virtual DbSet ViewCmsObjectVersionHistoryUserJoineds { get; set; } + + public virtual DbSet ViewCmsPageTemplateCategoryPageTemplateJoineds { get; set; } + + public virtual DbSet ViewCmsRelationshipJoineds { get; set; } + + public virtual DbSet ViewCmsResourceStringJoineds { get; set; } + + public virtual DbSet ViewCmsResourceTranslatedJoineds { get; set; } + + public virtual DbSet ViewCmsRoleResourcePermissionJoineds { get; set; } + + public virtual DbSet ViewCmsSiteDocumentCounts { get; set; } + + public virtual DbSet ViewCmsSiteRoleResourceUielementJoineds { get; set; } + + public virtual DbSet ViewCmsTreeJoineds { get; set; } + + public virtual DbSet ViewCmsUsers { get; set; } + + public virtual DbSet ViewCmsUserDocuments { get; set; } + + public virtual DbSet ViewCmsUserRoleJoineds { get; set; } + + public virtual DbSet ViewCmsUserRoleMembershipRoles { get; set; } + + public virtual DbSet ViewCmsUserRoleMembershipRoleValidOnlyJoineds { get; set; } + + public virtual DbSet ViewCmsUserSettingsRoleJoineds { get; set; } + + public virtual DbSet ViewCmsWebPartCategoryWebpartJoineds { get; set; } + + public virtual DbSet ViewCmsWidgetCategoryWidgetJoineds { get; set; } + + public virtual DbSet ViewComSkuoptionCategoryOptionCategoryJoineds { get; set; } + + public virtual DbSet ViewCommunityGroups { get; set; } + + public virtual DbSet ViewCommunityMembers { get; set; } + + public virtual DbSet ViewForumsGroupForumPostJoineds { get; set; } + + public virtual DbSet ViewIntegrationTaskJoineds { get; set; } + + public virtual DbSet ViewMembershipMembershipUserJoineds { get; set; } + + public virtual DbSet ViewNewsletterSubscriptionsJoineds { get; set; } + + public virtual DbSet ViewOmAccountContactAccountJoineds { get; set; } + + public virtual DbSet ViewOmAccountContactContactJoineds { get; set; } + + public virtual DbSet ViewOmAccountJoineds { get; set; } + + public virtual DbSet ViewOmContactGroupMemberAccountJoineds { get; set; } + + public virtual DbSet ViewPollAnswerCounts { get; set; } + + public virtual DbSet ViewReportingCategoryReportJoineds { get; set; } + + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CampaignName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CampaignScheduledTask).WithMany(p => p.AnalyticsCampaigns).HasConstraintName("FK_Analytics_Campaign_CampaignScheduledTaskID_ScheduledTask"); + + entity.HasOne(d => d.CampaignSite).WithMany(p => p.AnalyticsCampaigns) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_Campaign_StatisticsSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignAssetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CampaignAssetType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignAssetCampaign).WithMany(p => p.AnalyticsCampaignAssets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignAsset_CampaignAssetCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignAssetUrlPageTitle).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignAssetUrlTarget).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignAssetUrlCampaignAsset).WithMany(p => p.AnalyticsCampaignAssetUrls) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID_Analytics_CampaignAsset"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignConversionActivityType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignConversionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignConversionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CampaignConversionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignConversionCampaign).WithMany(p => p.AnalyticsCampaignConversions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignConversion_CampaignConversionCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignConversionHitsSourceName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignConversionHitsConversion).WithMany(p => p.AnalyticsCampaignConversionHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID_Analytics_CampaignConversion"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignObjectiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.CampaignObjectiveCampaignConversion).WithMany(p => p.AnalyticsCampaignObjectives) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID_Analytics_CampaignConversion"); + + entity.HasOne(d => d.CampaignObjectiveCampaign).WithOne(p => p.AnalyticsCampaignObjective) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ConversionId).HasName("PK_CMS_Conversion"); + + entity.HasOne(d => d.ConversionSite).WithMany(p => p.AnalyticsConversions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_Conversion_ConversionSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_DayHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsDayHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_DayHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_HourHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsHourHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_HourHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_MonthHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsMonthHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_MonthHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StatisticsId).IsClustered(false); + + entity.HasIndex(e => e.StatisticsCode, "IX_Analytics_Statistics_StatisticsCode_StatisticsSiteID_StatisticsObjectID_StatisticsObjectCulture").IsClustered(); + + entity.Property(e => e.StatisticsCode).HasDefaultValueSql("('')"); + entity.Property(e => e.StatisticsObjectCulture).HasDefaultValueSql("(N'')"); + entity.Property(e => e.StatisticsObjectName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.StatisticsSite).WithMany(p => p.AnalyticsStatistics).HasConstraintName("FK_Analytics_Statistics_StatisticsSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_WeekHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsWeekHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_WeekHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_YearHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsYearHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_YearHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WordId).IsClustered(false); + + entity.HasIndex(e => e.WordExpression, "IX_BadWords_Word_WordExpression").IsClustered(); + + entity.Property(e => e.WordExpression).HasDefaultValueSql("(N'')"); + + entity.HasMany(d => d.Cultures).WithMany(p => p.Words) + .UsingEntity>( + "BadWordsWordCulture", + r => r.HasOne().WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_BadWords_WordCulture_CultureID_CMS_Culture"), + l => l.HasOne().WithMany() + .HasForeignKey("WordId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_BadWords_WordCulture_WordID_BadWords_Word"), + j => + { + j.HasKey("WordId", "CultureId"); + j.ToTable("BadWords_WordCulture"); + j.HasIndex(new[] { "CultureId" }, "IX_BadWords_WordCulture_CultureID"); + j.IndexerProperty("WordId").HasColumnName("WordID"); + j.IndexerProperty("CultureId").HasColumnName("CultureID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CommentId).IsClustered(false); + + entity.HasIndex(e => e.CommentDate, "IX_Blog_Comment_CommentDate") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.CommentApproved).HasDefaultValueSql("((0))"); + entity.Property(e => e.CommentIsSpam).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.CommentApprovedByUser).WithMany(p => p.BlogCommentCommentApprovedByUsers).HasConstraintName("FK_Blog_Comment_CommentApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.CommentPostDocument).WithMany(p => p.BlogComments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Blog_Comment_CommentPostDocumentID_CMS_Document"); + + entity.HasOne(d => d.CommentUser).WithMany(p => p.BlogCommentCommentUsers).HasConstraintName("FK_Blog_Comment_CommentUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SubscriptionPostDocument).WithMany(p => p.BlogPostSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Blog_PostSubscription_SubscriptionPostDocumentID_CMS_Document"); + + entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.BlogPostSubscriptions).HasConstraintName("FK_Blog_PostSubscription_SubscriptionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BoardName).HasDefaultValueSql("('')"); + entity.Property(e => e.BoardRequireEmails).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.BoardDocument).WithMany(p => p.BoardBoards) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Board_BoardDocumentID_CMS_Document"); + + entity.HasOne(d => d.BoardGroup).WithMany(p => p.BoardBoards).HasConstraintName("FK_Board_Board_BoardGroupID_Community_Group"); + + entity.HasOne(d => d.BoardSite).WithMany(p => p.BoardBoards) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Board_BoardSiteID_CMS_Site"); + + entity.HasOne(d => d.BoardUser).WithMany(p => p.BoardBoards).HasConstraintName("FK_Board_Board_BoardUserID_CMS_User"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Boards) + .UsingEntity>( + "BoardRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Role_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("BoardId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Role_BoardID_Board_Board"), + j => + { + j.HasKey("BoardId", "RoleId"); + j.ToTable("Board_Role"); + j.HasIndex(new[] { "RoleId" }, "IX_Board_Role_RoleID"); + j.IndexerProperty("BoardId").HasColumnName("BoardID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + + entity.HasMany(d => d.Users).WithMany(p => p.Boards) + .UsingEntity>( + "BoardModerator", + r => r.HasOne().WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Moderator_UserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("BoardId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Moderator_BoardID_Board_Board"), + j => + { + j.HasKey("BoardId", "UserId"); + j.ToTable("Board_Moderator"); + j.HasIndex(new[] { "UserId" }, "IX_Board_Moderator_UserID"); + j.IndexerProperty("BoardId").HasColumnName("BoardID"); + j.IndexerProperty("UserId").HasColumnName("UserID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MessageId).IsClustered(false); + + entity.HasIndex(e => e.MessageInserted, "IX_Board_Message_MessageInserted") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.MessageEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MessageInserted).HasDefaultValueSql("('8/26/2008 12:14:50 PM')"); + entity.Property(e => e.MessageLastModified).HasDefaultValueSql("('8/26/2008 12:15:04 PM')"); + entity.Property(e => e.MessageText).HasDefaultValueSql("('')"); + entity.Property(e => e.MessageUrl).HasDefaultValueSql("('')"); + entity.Property(e => e.MessageUserInfo).HasDefaultValueSql("('')"); + entity.Property(e => e.MessageUserName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.MessageApprovedByUser).WithMany(p => p.BoardMessageMessageApprovedByUsers).HasConstraintName("FK_Board_Message_MessageApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.MessageBoard).WithMany(p => p.BoardMessagesNavigation) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Message_MessageBoardID_Board_Board"); + + entity.HasOne(d => d.MessageUser).WithMany(p => p.BoardMessageMessageUsers).HasConstraintName("FK_Board_Message_MessageUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubscriptionEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SubscriptionBoard).WithMany(p => p.BoardSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Board_Subscription_SubscriptionBoardID_Board_Board"); + + entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.BoardSubscriptions).HasConstraintName("FK_Board_Subscription_SubscriptionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.InitiatedChatRequestState).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.InitiatedChatRequestInitiatorChatUser).WithMany(p => p.ChatInitiatedChatRequests) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_InitiatedChatRequest_Chat_User"); + + entity.HasOne(d => d.InitiatedChatRequestRoom).WithOne(p => p.ChatInitiatedChatRequest) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_InitiatedChatRequest_Chat_Room"); + + entity.HasOne(d => d.InitiatedChatRequestUser).WithMany(p => p.ChatInitiatedChatRequests).HasConstraintName("FK_Chat_InitiatedChatRequest_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatMessageId).HasName("PK_CMS_ChatMessage"); + + entity.Property(e => e.ChatMessageCreatedWhen).HasDefaultValueSql("('7/25/2011 2:47:18 PM')"); + entity.Property(e => e.ChatMessageIpaddress).HasDefaultValueSql("('')"); + entity.Property(e => e.ChatMessageLastModified).HasDefaultValueSql("('8/3/2011 11:24:54 AM')"); + entity.Property(e => e.ChatMessageText).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ChatMessageRecipient).WithMany(p => p.ChatMessageChatMessageRecipients).HasConstraintName("FK_Chat_Message_Chat_User_Recipient"); + + entity.HasOne(d => d.ChatMessageRoom).WithMany(p => p.ChatMessages) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_Message_Chat_Room"); + + entity.HasOne(d => d.ChatMessageUser).WithMany(p => p.ChatMessageChatMessageUsers).HasConstraintName("FK_Chat_Message_Chat_User_Sender"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatNotificationId).HasName("PK_CMS_ChatNotification"); + + entity.HasOne(d => d.ChatNotificationReceiver).WithMany(p => p.ChatNotificationChatNotificationReceivers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_Notification_Chat_User_Receiver"); + + entity.HasOne(d => d.ChatNotificationRoom).WithMany(p => p.ChatNotifications).HasConstraintName("FK_Chat_Notification_Chat_Room"); + + entity.HasOne(d => d.ChatNotificationSender).WithMany(p => p.ChatNotificationChatNotificationSenders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_Notification_Chat_User_Sender"); + + entity.HasOne(d => d.ChatNotificationSite).WithMany(p => p.ChatNotifications).HasConstraintName("FK_Chat_Notification_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ChatOnlineSupportChatUser).WithMany(p => p.ChatOnlineSupports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_OnlineSupport_Chat_User"); + + entity.HasOne(d => d.ChatOnlineSupportSite).WithMany(p => p.ChatOnlineSupports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_OnlineSupport_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ChatOnlineUserChatUser).WithMany(p => p.ChatOnlineUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_OnlineUser_Chat_User"); + + entity.HasOne(d => d.ChatOnlineUserSite).WithMany(p => p.ChatOnlineUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_OnlineUser_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatRoomId).HasName("PK_CMS_ChatRoom"); + + entity.Property(e => e.ChatRoomDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ChatRoomLastModification).HasDefaultValueSql("('10/19/2011 12:16:33 PM')"); + entity.Property(e => e.ChatRoomPrivateStateLastModification).HasDefaultValueSql("('1/30/2012 4:36:47 PM')"); + + entity.HasOne(d => d.ChatRoomCreatedByChatUser).WithMany(p => p.ChatRooms).HasConstraintName("FK_Chat_Room_Chat_User"); + + entity.HasOne(d => d.ChatRoomSite).WithMany(p => p.ChatRooms).HasConstraintName("FK_Chat_Room_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatRoomUserId).HasName("PK_CMS_ChatRoomUser"); + + entity.Property(e => e.ChatRoomUserLastModification).HasDefaultValueSql("('11/10/2011 3:29:00 PM')"); + + entity.HasOne(d => d.ChatRoomUserChatUser).WithMany(p => p.ChatRoomUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_RoomUser_Chat_User"); + + entity.HasOne(d => d.ChatRoomUserRoom).WithMany(p => p.ChatRoomUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_RoomUser_Chat_Room"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatSupportCannedResponseId).HasName("PK_CMS_ChatSupportCannedResponse"); + + entity.Property(e => e.ChatSupportCannedResponseTagName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ChatSupportCannedResponseChatUser).WithMany(p => p.ChatSupportCannedResponses).HasConstraintName("FK_Chat_SupportCannedResponse_Chat_User"); + + entity.HasOne(d => d.ChatSupportCannedResponseSite).WithMany(p => p.ChatSupportCannedResponses).HasConstraintName("FK_Chat_SupportCannedResponse_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatSupportTakenRoomId).HasName("PK_Chat_SupportTakenRooms"); + + entity.Property(e => e.ChatSupportTakenRoomLastModification).HasDefaultValueSql("('4/16/2012 5:11:30 PM')"); + + entity.HasOne(d => d.ChatSupportTakenRoomChatUser).WithMany(p => p.ChatSupportTakenRooms).HasConstraintName("FK_Chat_SupportTakenRoom_Chat_User"); + + entity.HasOne(d => d.ChatSupportTakenRoomRoom).WithMany(p => p.ChatSupportTakenRooms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Chat_SupportTakenRoom_Chat_Room"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ChatUserId).HasName("PK_CMS_ChatUser"); + + entity.Property(e => e.ChatUserLastModification).HasDefaultValueSql("('2/20/2012 2:02:00 PM')"); + entity.Property(e => e.ChatUserNickname).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ChatUserUser).WithMany(p => p.ChatUsers).HasConstraintName("FK_Chat_User_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FileHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FileLocation).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ReportId).IsClustered(false); + + entity.HasIndex(e => e.ReportWhen, "IX_CMS_AbuseReport_ReportWhen") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.ReportComment).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportCulture).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportTitle).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportUrl).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportWhen).HasDefaultValueSql("('9/11/2008 4:32:15 PM')"); + + entity.HasOne(d => d.ReportSite).WithMany(p => p.CmsAbuseReports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AbuseReport_ReportSiteID_CMS_Site"); + + entity.HasOne(d => d.ReportUser).WithMany(p => p.CmsAbuseReports).HasConstraintName("FK_CMS_AbuseReport_ReportUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AclinheritedAcls).HasDefaultValueSql("('')"); + entity.Property(e => e.AcllastModified).HasDefaultValueSql("('10/30/2008 9:17:31 AM')"); + + entity.HasOne(d => d.Aclsite).WithMany(p => p.CmsAcls).HasConstraintName("FK_CMS_ACL_ACLSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Acl).WithMany(p => p.CmsAclitems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ACLItem_ACLID_CMS_ACL"); + + entity.HasOne(d => d.LastModifiedByUser).WithMany(p => p.CmsAclitemLastModifiedByUsers).HasConstraintName("FK_CMS_ACLItem_LastModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsAclitems).HasConstraintName("FK_CMS_ACLItem_RoleID_CMS_Role"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsAclitemUsers).HasConstraintName("FK_CMS_ACLItem_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormHideNewParentFields).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FormClass).WithMany(p => p.CmsAlternativeFormFormClasses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AlternativeForm_FormClassID_CMS_Class"); + + entity.HasOne(d => d.FormCoupledClass).WithMany(p => p.CmsAlternativeFormFormCoupledClasses).HasConstraintName("FK_CMS_AlternativeForm_FormCoupledClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AlternativeUrlLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.AlternativeUrlUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AlternativeUrlDocument).WithMany(p => p.CmsAlternativeUrls) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AlternativeUrl_CMS_Document"); + + entity.HasOne(d => d.AlternativeUrlSite).WithMany(p => p.CmsAlternativeUrls) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AlternativeUrl_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AttachmentId).IsClustered(false); + + entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName, e.AttachmentIsUnsorted, e.AttachmentOrder }, "IX_CMS_Attachment_AttachmentDocumentID_AttachmentIsUnsorted_AttachmentName_AttachmentOrder").IsClustered(); + + entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_Attachment_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") + .IsUnique() + .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); + + entity.HasOne(d => d.AttachmentDocument).WithMany(p => p.CmsAttachments).HasConstraintName("FK_CMS_Attachment_AttachmentDocumentID_CMS_Document"); + + entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Attachment_AttachmentSiteID_CMS_Site"); + + entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_Attachment_AttachmentVariantParentID_CMS_Attachment"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AttachmentHistoryId).IsClustered(false); + + entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName }, "IX_CMS_AttachmentHistory_AttachmentDocumentID_AttachmentName").IsClustered(); + + entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_AttachmentHistory_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") + .IsUnique() + .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); + + entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachmentHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentHistory_AttachmentSiteID_CMS_Site"); + + entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_AttachmentHistory_AttachmentVariantParentID_CMS_AttachmentHistory"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); + entity.Property(e => e.HistoryStepDisplayName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.HistoryApprovedByUser).WithMany(p => p.CmsAutomationHistories).HasConstraintName("FK_CMS_AutomationHistory_HistoryApprovedByUserID"); + + entity.HasOne(d => d.HistoryState).WithMany(p => p.CmsAutomationHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationHistory_HistoryStateID"); + + entity.HasOne(d => d.HistoryStep).WithMany(p => p.CmsAutomationHistoryHistorySteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryStepID"); + + entity.HasOne(d => d.HistoryTargetStep).WithMany(p => p.CmsAutomationHistoryHistoryTargetSteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryTargetStepID"); + + entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsAutomationHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationHistory_HistoryWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.StateSite).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateSiteID_CMS_Site"); + + entity.HasOne(d => d.StateStep).WithMany(p => p.CmsAutomationStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationState_StateStepID"); + + entity.HasOne(d => d.StateUser).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateUserID_CMS_User"); + + entity.HasOne(d => d.StateWorkflow).WithMany(p => p.CmsAutomationStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationState_StateWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AvatarId).IsClustered(false); + + entity.HasIndex(e => e.AvatarName, "IX_CMS_Avatar_AvatarName").IsClustered(); + + entity.Property(e => e.DefaultFemaleUserAvatar).HasDefaultValueSql("((0))"); + entity.Property(e => e.DefaultGroupAvatar).HasDefaultValueSql("((0))"); + entity.Property(e => e.DefaultMaleUserAvatar).HasDefaultValueSql("((0))"); + entity.Property(e => e.DefaultUserAvatar).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.BadgeId).IsClustered(false); + + entity.HasIndex(e => e.BadgeTopLimit, "IX_CMS_Badge_BadgeTopLimit") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.BadgeDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.BadgeLastModified).HasDefaultValueSql("('9/25/2008 5:07:55 PM')"); + entity.Property(e => e.BadgeName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IpaddressId).IsClustered(false); + + entity.HasIndex(e => new { e.Ipaddress, e.IpaddressSiteId }, "IX_CMS_BannedIP_IPAddressSiteID_IPAddress").IsClustered(); + + entity.Property(e => e.IpaddressBanEnabled).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.IpaddressSite).WithMany(p => p.CmsBannedIps).HasConstraintName("FK_CMS_BannedIP_IPAddressSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BannerContent).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BannerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.BannerEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.BannerLastModified).HasDefaultValueSql("('1/1/1970 12:00:00 AM')"); + entity.Property(e => e.BannerName).HasDefaultValueSql("('')"); + entity.Property(e => e.BannerType).HasDefaultValueSql("((2))"); + entity.Property(e => e.BannerWeight).HasDefaultValueSql("((5))"); + + entity.HasOne(d => d.BannerCategory).WithMany(p => p.CmsBanners) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Banner_CMS_BannerCategory"); + + entity.HasOne(d => d.BannerSite).WithMany(p => p.CmsBanners).HasConstraintName("FK_CMS_Banner_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.BannerCategoryId).HasName("PK__CMS_BannerCategory"); + + entity.Property(e => e.BannerCategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.BannerCategoryEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.BannerCategoryLastModified).HasDefaultValueSql("('1/1/1970 12:00:00 AM')"); + entity.Property(e => e.BannerCategoryName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.BannerCategorySite).WithMany(p => p.CmsBannerCategories).HasConstraintName("FK_CMS_BannerCategory_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_CMS_Category_CategoryDisplayName_CategoryEnabled").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.CategorySite).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategorySiteID_CMS_Site"); + + entity.HasOne(d => d.CategoryUser).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategoryUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ClassId).IsClustered(false); + + entity.HasIndex(e => new { e.ClassId, e.ClassName, e.ClassDisplayName }, "IX_CMS_Class_ClassID_ClassName_ClassDisplayName").IsClustered(); + + entity.Property(e => e.ClassIsContentOnly).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ClassDefaultPageTemplate).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassDefaultPageTemplateID_CMS_PageTemplate"); + + entity.HasOne(d => d.ClassPageTemplateCategory).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassPageTemplateCategoryID_CMS_PageTemplateCategory"); + + entity.HasOne(d => d.ClassResource).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassResourceID_CMS_Resource"); + + entity.HasMany(d => d.ChildClasses).WithMany(p => p.ParentClasses) + .UsingEntity>( + "CmsAllowedChildClass", + r => r.HasOne().WithMany() + .HasForeignKey("ChildClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ParentClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), + j => + { + j.HasKey("ParentClassId", "ChildClassId"); + j.ToTable("CMS_AllowedChildClasses"); + j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); + j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); + j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); + }); + + entity.HasMany(d => d.ParentClasses).WithMany(p => p.ChildClasses) + .UsingEntity>( + "CmsAllowedChildClass", + r => r.HasOne().WithMany() + .HasForeignKey("ParentClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ChildClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), + j => + { + j.HasKey("ParentClassId", "ChildClassId"); + j.ToTable("CMS_AllowedChildClasses"); + j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); + j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); + j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); + }); + + entity.HasMany(d => d.Sites).WithMany(p => p.Classes) + .UsingEntity>( + "CmsClassSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Class_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Class_ClassID_CMS_Class"), + j => + { + j.HasKey("ClassId", "SiteId"); + j.ToTable("CMS_ClassSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_ClassSite_SiteID"); + j.IndexerProperty("ClassId").HasColumnName("ClassID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentContent).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.ConsentName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentAgreementTime).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ConsentAgreementConsent).WithMany(p => p.CmsConsentAgreements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementConsentID_CMS_Consent"); + + entity.HasOne(d => d.ConsentAgreementContact).WithMany(p => p.CmsConsentAgreements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementContactID_OM_Contact"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentArchiveContent).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentArchiveHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentArchiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ConsentArchiveConsent).WithMany(p => p.CmsConsentArchives) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentArchive_ConsentArchiveConsentID_CMS_Consent"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CountryId).IsClustered(false); + + entity.HasIndex(e => e.CountryDisplayName, "IX_CMS_Country_CountryDisplayName").IsClustered(); + + entity.Property(e => e.CountryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CountryLastModified).HasDefaultValueSql("('11/14/2013 1:43:04 PM')"); + entity.Property(e => e.CountryName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StylesheetId).IsClustered(false); + + entity.HasIndex(e => e.StylesheetDisplayName, "IX_CMS_CssStylesheet_StylesheetDisplayName").IsClustered(); + + entity.Property(e => e.StylesheetDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.StylesheetDynamicLanguage).HasDefaultValueSql("('plaincss')"); + entity.Property(e => e.StylesheetName).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Stylesheets) + .UsingEntity>( + "CmsCssStylesheetSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_CssStylesheetSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("StylesheetId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_CssStylesheetSite_StylesheetID_CMS_CssStylesheet"), + j => + { + j.HasKey("StylesheetId", "SiteId"); + j.ToTable("CMS_CssStylesheetSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_CssStylesheetSite_SiteID"); + j.IndexerProperty("StylesheetId").HasColumnName("StylesheetID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CultureId).IsClustered(false); + + entity.HasIndex(e => e.CultureName, "IX_CMS_Culture_CultureName").IsClustered(); + + entity.Property(e => e.CultureIsUiculture).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ProfileEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ProfileName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.DeviceProfile).WithMany(p => p.CmsDeviceProfileLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DeviceProfileLayout_DeviceProfileID_CMS_DeviceProfile"); + + entity.HasOne(d => d.SourceLayout).WithMany(p => p.CmsDeviceProfileLayoutSourceLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DeviceProfileLayout_SourceLayoutID_CMS_Layout"); + + entity.HasOne(d => d.TargetLayout).WithMany(p => p.CmsDeviceProfileLayoutTargetLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DeviceProfileLayout_TargetLayoutID_CMS_Layout"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DocumentCanBePublished).HasDefaultValueSql("((1))"); + entity.Property(e => e.DocumentInheritsStylesheet).HasDefaultValueSql("((1))"); + entity.Property(e => e.DocumentMenuRedirectToFirstChild).HasDefaultValueSql("((0))"); + entity.Property(e => e.DocumentUseCustomExtensions).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.DocumentCheckedOutByUser).WithMany(p => p.CmsDocumentDocumentCheckedOutByUsers).HasConstraintName("FK_CMS_Document_DocumentCheckedOutByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentCheckedOutVersionHistory).WithMany(p => p.CmsDocumentDocumentCheckedOutVersionHistories).HasConstraintName("FK_CMS_Document_DocumentCheckedOutVersionHistoryID_CMS_VersionHistory"); + + entity.HasOne(d => d.DocumentCreatedByUser).WithMany(p => p.CmsDocumentDocumentCreatedByUsers).HasConstraintName("FK_CMS_Document_DocumentCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentModifiedByUser).WithMany(p => p.CmsDocumentDocumentModifiedByUsers).HasConstraintName("FK_CMS_Document_DocumentModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentNode).WithMany(p => p.CmsDocuments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Document_DocumentNodeID_CMS_Tree"); + + entity.HasOne(d => d.DocumentPageTemplate).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentPageTemplateID_CMS_Template"); + + entity.HasOne(d => d.DocumentPublishedVersionHistory).WithMany(p => p.CmsDocumentDocumentPublishedVersionHistories).HasConstraintName("FK_CMS_Document_DocumentPublishedVersionHistoryID_CMS_VersionHistory"); + + entity.HasOne(d => d.DocumentStylesheet).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentStylesheetID_CMS_CssStylesheet"); + + entity.HasOne(d => d.DocumentTagGroup).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentTagGroupID_CMS_TagGroup"); + + entity.HasOne(d => d.DocumentWorkflowStep).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentWorkflowStepID_CMS_WorkflowStep"); + + entity.HasMany(d => d.Categories).WithMany(p => p.Documents) + .UsingEntity>( + "CmsDocumentCategory", + r => r.HasOne().WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentCategory_CategoryID_CMS_Category"), + l => l.HasOne().WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentCategory_DocumentID_CMS_Document"), + j => + { + j.HasKey("DocumentId", "CategoryId"); + j.ToTable("CMS_DocumentCategory"); + j.HasIndex(new[] { "CategoryId" }, "IX_CMS_DocumentCategory_CategoryID"); + j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); + j.IndexerProperty("CategoryId").HasColumnName("CategoryID"); + }); + + entity.HasMany(d => d.Tags).WithMany(p => p.Documents) + .UsingEntity>( + "CmsDocumentTag", + r => r.HasOne().WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTag_TagID_CMS_Tag"), + l => l.HasOne().WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTag_DocumentID_CMS_Document"), + j => + { + j.HasKey("DocumentId", "TagId"); + j.ToTable("CMS_DocumentTag"); + j.HasIndex(new[] { "TagId" }, "IX_CMS_DocumentTag_TagID"); + j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); + j.IndexerProperty("TagId").HasColumnName("TagID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AliasId).IsClustered(false); + + entity.HasIndex(e => e.AliasUrlpath, "IX_CMS_DocumentAlias_AliasURLPath").IsClustered(); + + entity.Property(e => e.AliasCulture).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AliasExtensions).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AliasLastModified).HasDefaultValueSql("('10/22/2008 12:55:43 PM')"); + entity.Property(e => e.AliasUrlpath).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AliasNode).WithMany(p => p.CmsDocumentAliases) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentAlias_AliasNodeID_CMS_Tree"); + + entity.HasOne(d => d.AliasSite).WithMany(p => p.CmsDocumentAliases) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentAlias_AliasSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ScopeId).IsClustered(false); + + entity.HasIndex(e => e.ScopePath, "IX_CMS_DocumentTypeScope_ScopePath").IsClustered(); + + entity.Property(e => e.ScopeAllowAbvariant).HasDefaultValueSql("((0))"); + entity.Property(e => e.ScopeAllowAllTypes).HasDefaultValueSql("((0))"); + entity.Property(e => e.ScopeAllowLinks).HasDefaultValueSql("((0))"); + entity.Property(e => e.ScopeLastModified).HasDefaultValueSql("('4/30/2013 2:47:21 PM')"); + entity.Property(e => e.ScopePath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsDocumentTypeScopes).HasConstraintName("FK_CMS_DocumentTypeScope_ScopeSiteID_CMS_Site"); + + entity.HasMany(d => d.Classes).WithMany(p => p.Scopes) + .UsingEntity>( + "CmsDocumentTypeScopeClass", + r => r.HasOne().WithMany() + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ScopeID_CMS_DocumentTypeScope"), + j => + { + j.HasKey("ScopeId", "ClassId"); + j.ToTable("CMS_DocumentTypeScopeClass"); + j.HasIndex(new[] { "ClassId" }, "IX_CMS_DocumentTypeScopeClass_ClassID"); + j.IndexerProperty("ScopeId").HasColumnName("ScopeID"); + j.IndexerProperty("ClassId").HasColumnName("ClassID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailFrom).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EmailIsMass).HasDefaultValueSql("((1))"); + entity.Property(e => e.EmailLastModified).HasDefaultValueSql("('6/17/2016 10:11:21 AM')"); + entity.Property(e => e.EmailSubject).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Attachments).WithMany(p => p.Emails) + .UsingEntity>( + "CmsAttachmentForEmail", + r => r.HasOne().WithMany() + .HasForeignKey("AttachmentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentForEmail_AttachmentID_CMS_EmailAttachment"), + l => l.HasOne().WithMany() + .HasForeignKey("EmailId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentForEmail_EmailID_CMS_Email"), + j => + { + j.HasKey("EmailId", "AttachmentId"); + j.ToTable("CMS_AttachmentForEmail"); + j.HasIndex(new[] { "AttachmentId" }, "IX_CMS_AttachmentForEmail_AttachmentID"); + j.IndexerProperty("EmailId").HasColumnName("EmailID"); + j.IndexerProperty("AttachmentId").HasColumnName("AttachmentID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.EmailTemplateId).IsClustered(false); + + entity.HasIndex(e => e.EmailTemplateDisplayName, "IX_CMS_EmailTemplate_EmailTemplateDisplayName").IsClustered(); + + entity.Property(e => e.EmailTemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.EmailTemplateName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.EmailTemplateSite).WithMany(p => p.CmsEmailTemplates).HasConstraintName("FK_CMS_Email_EmailTemplateSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Email).WithMany(p => p.CmsEmailUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_EmailUser_EmailID_CMS_Email"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsEmailUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_EmailUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DocumentName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventMachineName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventTime).HasDefaultValueSql("('4/21/2015 8:21:43 AM')"); + entity.Property(e => e.EventType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventUrl).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventUrlReferrer).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Ipaddress).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Source).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.User).WithMany(p => p.CmsExternalLogins) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ExternalLogin_UserID_CMS_User")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FormId).IsClustered(false); + + entity.HasIndex(e => e.FormDisplayName, "IX_CMS_Form_FormDisplayName").IsClustered(); + + entity.Property(e => e.FormConfirmationEmailSubject).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormEmailAttachUploadedDocs).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormLastModified).HasDefaultValueSql("('9/17/2012 1:37:08 PM')"); + entity.Property(e => e.FormLogActivity).HasDefaultValueSql("((1))"); + entity.Property(e => e.FormName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormSubmitButtonText).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.FormClass).WithMany(p => p.CmsForms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Form_FormClassID_CMS_Class"); + + entity.HasOne(d => d.FormSite).WithMany(p => p.CmsForms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Form_FormSiteID_CMS_Site"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Forms) + .UsingEntity>( + "CmsFormRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_FormRole_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("FormId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_FormRole_FormID_CMS_Form"), + j => + { + j.HasKey("FormId", "RoleId"); + j.ToTable("CMS_FormRole"); + j.HasIndex(new[] { "RoleId" }, "IX_CMS_FormRole_RoleID"); + j.IndexerProperty("FormId").HasColumnName("FormID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.UserControlId).IsClustered(false); + + entity.HasIndex(e => e.UserControlDisplayName, "IX_CMS_FormUserControl_UserControlDisplayName").IsClustered(); + + entity.Property(e => e.UserControlIsSystem).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserControlPriority).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserControlShowInCustomTables).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.UserControlParent).WithMany(p => p.InverseUserControlParent).HasConstraintName("FK_CMS_FormUserControl_UserControlParentID_CMS_FormUserControl"); + + entity.HasOne(d => d.UserControlResource).WithMany(p => p.CmsFormUserControls).HasConstraintName("FK_CMS_FormUserControl_UserControlResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HelpTopicLink).HasDefaultValueSql("(N'')"); + entity.Property(e => e.HelpTopicName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.HelpTopicUielement).WithMany(p => p.CmsHelpTopics) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_HelpTopic_HelpTopicUIElementID_CMS_UIElement"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LayoutCode).HasDefaultValueSql("('')"); + entity.Property(e => e.LayoutCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.LayoutDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LayoutIconClass).HasDefaultValueSql("(N'icon-layout')"); + entity.Property(e => e.LayoutIsConvertible).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LicenseKeyId).IsClustered(false); + + entity.HasIndex(e => e.LicenseDomain, "IX_CMS_LicenseKey_LicenseDomain").IsClustered(); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.MacroIdentityName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.MacroIdentityEffectiveUser).WithMany(p => p.CmsMacroIdentities).HasConstraintName("FK_CMS_MacroIdentity_MacroIdentityEffectiveUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MacroRuleAvailability).HasDefaultValueSql("((0))"); + entity.Property(e => e.MacroRuleCondition).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MacroRuleDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.MacroRuleEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MacroRuleIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.MacroRuleLastModified).HasDefaultValueSql("('5/1/2012 8:46:33 AM')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.MembershipSite).WithMany(p => p.CmsMemberships).HasConstraintName("FK_CMS_Membership_MembershipSiteID_CMS_Site"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Memberships) + .UsingEntity>( + "CmsMembershipRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipRole_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("MembershipId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipRole_MembershipID_CMS_Membership"), + j => + { + j.HasKey("MembershipId", "RoleId"); + j.ToTable("CMS_MembershipRole"); + j.HasIndex(new[] { "RoleId" }, "IX_CMS_MembershipRole_RoleID"); + j.IndexerProperty("MembershipId").HasColumnName("MembershipID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Membership).WithMany(p => p.CmsMembershipUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipUser_MembershipID_CMS_Membership"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsMembershipUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MetaFileId).IsClustered(false); + + entity.HasIndex(e => new { e.MetaFileObjectType, e.MetaFileObjectId, e.MetaFileGroupName }, "IX_CMS_Metafile_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName").IsClustered(); + + entity.HasOne(d => d.MetaFileSite).WithMany(p => p.CmsMetaFiles).HasConstraintName("FK_CMS_MetaFile_MetaFileSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ModuleLicenseKeyLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.ModuleLicenseKeyLicense).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ModuleLicenseKeyResource).WithMany(p => p.CmsModuleLicenseKeys) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.ModuleUsageCounterName, "IX_CMS_ModuleUsageCounter_ModuleUsageCounterName") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.ModuleUsageCounterId).ValueGeneratedOnAdd(); + entity.Property(e => e.ModuleUsageCounterName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ObjectSettingsObjectType).HasDefaultValueSql("('')"); + entity.Property(e => e.ObjectWorkflowSendEmails).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.ObjectCheckedOutByUser).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutByUserID_CMS_User"); + + entity.HasOne(d => d.ObjectCheckedOutVersionHistory).WithMany(p => p.CmsObjectSettingObjectCheckedOutVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID_CMS_ObjectVersionHistory"); + + entity.HasOne(d => d.ObjectPublishedVersionHistory).WithMany(p => p.CmsObjectSettingObjectPublishedVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectPublishedVersionHistoryID_CMS_ObjectVersionHistory"); + + entity.HasOne(d => d.ObjectWorkflowStep).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectWorkflowStepID_CMS_WorkflowStep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.VersionId) + .HasName("PK_CMS_ObjectVersionHistory_VersionID") + .IsClustered(false); + + entity.HasIndex(e => new { e.VersionObjectType, e.VersionObjectId, e.VersionId }, "PK_CMS_ObjectVersionHistory") + .IsUnique() + .IsDescending(false, false, true) + .IsClustered(); + + entity.Property(e => e.VersionNumber).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionDeletedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionModifiedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionModifiedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionObjectSite).WithMany(p => p.CmsObjectVersionHistories).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionObjectSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TriggerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TriggerObjectType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TriggerWorkflow).WithMany(p => p.CmsObjectWorkflowTriggers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ObjectWorkflowTrigger_TriggerWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.OpenId).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsOpenIdusers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_OpenIDUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PageTemplateId).IsClustered(false); + + entity.HasIndex(e => e.PageTemplateCategoryId, "IX_CMS_PageTemplate_PageTemplateCategoryID").IsClustered(); + + entity.Property(e => e.PageTemplateCloneAsAdHoc).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.PageTemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.PageTemplateForAllPages).HasDefaultValueSql("((1))"); + entity.Property(e => e.PageTemplateIconClass).HasDefaultValueSql("(N'icon-layout')"); + entity.Property(e => e.PageTemplateIsLayout).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateIsReusable).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateShowAsMasterTemplate).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateType).HasDefaultValueSql("(N'portal')"); + + entity.HasOne(d => d.PageTemplateCategory).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateCategoryID_CMS_PageTemplateCategory"); + + entity.HasOne(d => d.PageTemplateLayoutNavigation).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateLayoutID_CMS_Layout"); + + entity.HasOne(d => d.PageTemplateSite).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateSiteID_CMS_Site"); + + entity.HasMany(d => d.Sites).WithMany(p => p.PageTemplates) + .UsingEntity>( + "CmsPageTemplateSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageTemplateSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("PageTemplateId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageTemplateSite_PageTemplateID_CMS_PageTemplate"), + j => + { + j.HasKey("PageTemplateId", "SiteId"); + j.ToTable("CMS_PageTemplateSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_PageTemplateSite_SiteID"); + j.IndexerProperty("PageTemplateId").HasColumnName("PageTemplateID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_CMS_PageTemplateCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryChildCount).HasDefaultValueSql("((0))"); + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryTemplateChildCount).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_PageTemplateCategory_CategoryParentID_CMS_PageTemplateCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PageTemplateConfigurationLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.PageTemplateConfigurationName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PageTemplateConfigurationTemplate).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PageTemplateConfigurationSite).WithMany(p => p.CmsPageTemplateConfigurations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PageTemplateScopeId).IsClustered(false); + + entity.HasIndex(e => e.PageTemplateScopePath, "IX_CMS_PageTemplateScope_PageTemplateScopePath").IsClustered(); + + entity.Property(e => e.PageTemplateScopeLastModified).HasDefaultValueSql("('2/22/2010 9:30:07 AM')"); + entity.Property(e => e.PageTemplateScopePath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.PageTemplateScopeClass).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeClassID_CMS_Class"); + + entity.HasOne(d => d.PageTemplateScopeCulture).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeCultureID_CMS_Culture"); + + entity.HasOne(d => d.PageTemplateScopeSite).WithMany(p => p.CmsPageTemplateScopes).HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeSiteID_CMS_Site"); + + entity.HasOne(d => d.PageTemplateScopeTemplate).WithMany(p => p.CmsPageTemplateScopes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageTemplateScope_PageTemplateScopeTemplateID_CMS_PageTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PermissionDisplayInMatrix).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.Class).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ClassID_CMS_Class"); + + entity.HasOne(d => d.Resource).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PersonalizationId).IsClustered(false); + + entity.HasIndex(e => e.PersonalizationDocumentId, "IX_CMS_Personalization_PersonalizationUserID_PersonalizationDocumentID").IsClustered(); + + entity.Property(e => e.PersonalizationLastModified).HasDefaultValueSql("('9/2/2008 5:36:59 PM')"); + + entity.HasOne(d => d.PersonalizationDocument).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationDocumentID_CMS_Document"); + + entity.HasOne(d => d.PersonalizationSite).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationSiteID_CMS_Site"); + + entity.HasOne(d => d.PersonalizationUser).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.QueryIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.QueryName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.Class).WithMany(p => p.CmsQueries).HasConstraintName("FK_CMS_Query_ClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.LeftNode).WithMany(p => p.CmsRelationshipLeftNodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_LeftNodeID_CMS_Tree"); + + entity.HasOne(d => d.RelationshipName).WithMany(p => p.CmsRelationships) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_RelationshipNameID_CMS_RelationshipName"); + + entity.HasOne(d => d.RightNode).WithMany(p => p.CmsRelationshipRightNodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_RightNodeID_CMS_Tree"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.RelationshipDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.RelationshipName).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Sites).WithMany(p => p.RelationshipNames) + .UsingEntity>( + "CmsRelationshipNameSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RelationshipNameSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("RelationshipNameId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RelationshipNameSite_RelationshipNameID_CMS_RelationshipName"), + j => + { + j.HasKey("RelationshipNameId", "SiteId"); + j.ToTable("CMS_RelationshipNameSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_RelationshipNameSite_SiteID"); + j.IndexerProperty("RelationshipNameId").HasColumnName("RelationshipNameID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ResourceId).IsClustered(false); + + entity.HasIndex(e => e.ResourceDisplayName, "IX_CMS_Resource_ResourceDisplayName").IsClustered(); + + entity.Property(e => e.ResourceHasFiles).HasDefaultValueSql("((0))"); + entity.Property(e => e.ResourceInstallationState).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ResourceInstalledVersion).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ShowInDevelopment).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Resources) + .UsingEntity>( + "CmsResourceSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ResourceId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceSite_ResourceID_CMS_Resource"), + j => + { + j.HasKey("ResourceId", "SiteId"); + j.ToTable("CMS_ResourceSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_ResourceSite_SiteID"); + j.IndexerProperty("ResourceId").HasColumnName("ResourceID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ResourceLibraryPath).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ResourceLibraryResource).WithMany(p => p.CmsResourceLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceLibrary_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TranslationCulture).WithMany(p => p.CmsResourceTranslations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceTranslation_TranslationCultureID_CMS_Culture"); + + entity.HasOne(d => d.TranslationString).WithMany(p => p.CmsResourceTranslations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceTranslation_TranslationStringID_CMS_ResourceString"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.RoleId).IsClustered(false); + + entity.HasIndex(e => new { e.SiteId, e.RoleName, e.RoleDisplayName }, "IX_CMS_Role_SiteID_RoleName_RoleDisplayName").IsClustered(); + + entity.HasOne(d => d.RoleGroup).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_RoleGroupID_Community_Group"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_SiteID_CMS_SiteID"); + + entity.HasMany(d => d.Elements).WithMany(p => p.Roles) + .UsingEntity>( + "CmsRoleApplication", + r => r.HasOne().WithMany() + .HasForeignKey("ElementId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleApplication_CMS_UIElement"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleApplication_CMS_Role"), + j => + { + j.HasKey("RoleId", "ElementId"); + j.ToTable("CMS_RoleApplication"); + j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleApplication"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("ElementId").HasColumnName("ElementID"); + }); + + entity.HasMany(d => d.ElementsNavigation).WithMany(p => p.RolesNavigation) + .UsingEntity>( + "CmsRoleUielement", + r => r.HasOne().WithMany() + .HasForeignKey("ElementId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleUIElement_ElementID_CMS_UIElement"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleUIElement_RoleID_CMS_Role"), + j => + { + j.HasKey("RoleId", "ElementId"); + j.ToTable("CMS_RoleUIElement"); + j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleUIElement_ElementID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("ElementId").HasColumnName("ElementID"); + }); + + entity.HasMany(d => d.Permissions).WithMany(p => p.Roles) + .UsingEntity>( + "CmsRolePermission", + r => r.HasOne().WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RolePermission_PermissionID_CMS_Permission"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RolePermission_RoleID_CMS_Role"), + j => + { + j.HasKey("RoleId", "PermissionId"); + j.ToTable("CMS_RolePermission"); + j.HasIndex(new[] { "PermissionId" }, "IX_CMS_RolePermission_PermissionID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("PermissionId").HasColumnName("PermissionID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskAllowExternalService).HasDefaultValueSql("((0))"); + entity.Property(e => e.TaskExecutingServerName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.TaskResource).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskResourceID_CMS_Resource"); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskSiteID_CMS_Site"); + + entity.HasOne(d => d.TaskUser).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IndexId).IsClustered(false); + + entity.HasIndex(e => e.IndexDisplayName, "IX_CMS_SearchIndex_IndexDisplayName").IsClustered(); + + entity.Property(e => e.IndexProvider).HasDefaultValueSql("(N'')"); + entity.Property(e => e.IndexType).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.IndexCultures).WithMany(p => p.Indices) + .UsingEntity>( + "CmsSearchIndexCulture", + r => r.HasOne().WithMany() + .HasForeignKey("IndexCultureId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexCulture_IndexCultureID_CMS_Culture"), + l => l.HasOne().WithMany() + .HasForeignKey("IndexId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexCulture_IndexID_CMS_SearchIndex"), + j => + { + j.HasKey("IndexId", "IndexCultureId"); + j.ToTable("CMS_SearchIndexCulture"); + j.HasIndex(new[] { "IndexCultureId" }, "IX_CMS_SearchIndexCulture_IndexCultureID"); + j.IndexerProperty("IndexId").HasColumnName("IndexID"); + j.IndexerProperty("IndexCultureId").HasColumnName("IndexCultureID"); + }); + + entity.HasMany(d => d.IndexSites).WithMany(p => p.Indices) + .UsingEntity>( + "CmsSearchIndexSite", + r => r.HasOne().WithMany() + .HasForeignKey("IndexSiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexSite_IndexSiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("IndexId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexSite_IndexID_CMS_SearchIndex"), + j => + { + j.HasKey("IndexId", "IndexSiteId"); + j.ToTable("CMS_SearchIndexSite"); + j.HasIndex(new[] { "IndexSiteId" }, "IX_CMS_SearchIndexSite_IndexSiteID"); + j.IndexerProperty("IndexId").HasColumnName("IndexID"); + j.IndexerProperty("IndexSiteId").HasColumnName("IndexSiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SearchTaskId).IsClustered(false); + + entity.HasIndex(e => new { e.SearchTaskPriority, e.SearchTaskStatus, e.SearchTaskServerName }, "IX_CMS_SearchTask_SearchTaskPriority_SearchTaskStatus_SearchTaskServerName") + .IsDescending(true, false, false) + .IsClustered(); + + entity.Property(e => e.SearchTaskCreated).HasDefaultValueSql("('4/15/2009 11:23:52 AM')"); + entity.Property(e => e.SearchTaskStatus).HasDefaultValueSql("('')"); + entity.Property(e => e.SearchTaskType).HasDefaultValueSql("('')"); + entity.Property(e => e.SearchTaskValue).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SearchTaskAzureAdditionalData).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SearchTaskAzureCreated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.SearchTaskAzureType).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SessionExpires).HasDefaultValueSql("('9/9/2008 3:45:44 PM')"); + entity.Property(e => e.SessionIdentificator).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SessionLastActive).HasDefaultValueSql("('9/9/2008 3:44:26 PM')"); + + entity.HasOne(d => d.SessionSite).WithMany(p => p.CmsSessions).HasConstraintName("FK_CMS_Session_SessionSiteID_CMS_Site"); + + entity.HasOne(d => d.SessionUser).WithMany(p => p.CmsSessions).HasConstraintName("FK_CMS_Session_SessionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryOrder, "IX_CMS_SettingsCategory_CategoryOrder").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.CategoryIsGroup).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_SettingsCategory_CMS_SettingsCategory1"); + + entity.HasOne(d => d.CategoryResource).WithMany(p => p.CmsSettingsCategories).HasConstraintName("FK_CMS_SettingsCategory_CategoryResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.KeyDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.KeyExplanationText).HasDefaultValueSql("(N'')"); + entity.Property(e => e.KeyIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyIsGlobal).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyIsHidden).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyName).HasDefaultValueSql("('')"); + entity.Property(e => e.KeyType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.KeyCategory).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_KeyCategoryID_CMS_SettingsCategory"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_SiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SiteId).IsClustered(false); + + entity.HasIndex(e => e.SiteDisplayName, "IX_CMS_Site_SiteDisplayName").IsClustered(); + + entity.Property(e => e.SiteDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.SiteDomainName).HasDefaultValueSql("('')"); + entity.Property(e => e.SiteName).HasDefaultValueSql("('')"); + entity.Property(e => e.SiteStatus).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.SiteDefaultEditorStylesheetNavigation).WithMany(p => p.CmsSiteSiteDefaultEditorStylesheetNavigations).HasConstraintName("FK_CMS_Site_SiteDefaultEditorStylesheet_CMS_CssStylesheet"); + + entity.HasOne(d => d.SiteDefaultStylesheet).WithMany(p => p.CmsSiteSiteDefaultStylesheets).HasConstraintName("FK_CMS_Site_SiteDefaultStylesheetID_CMS_CssStylesheet"); + + entity.HasMany(d => d.Cultures).WithMany(p => p.Sites) + .UsingEntity>( + "CmsSiteCulture", + r => r.HasOne().WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteCulture_CultureID_CMS_Culture"), + l => l.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteCulture_SiteID_CMS_Site"), + j => + { + j.HasKey("SiteId", "CultureId"); + j.ToTable("CMS_SiteCulture"); + j.HasIndex(new[] { "CultureId" }, "IX_CMS_SiteCulture_CultureID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + j.IndexerProperty("CultureId").HasColumnName("CultureID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SiteDomainAliasName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsSiteDomainAliases) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteDomainAlias_SiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ServerDeliveryMethod).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Servers) + .UsingEntity>( + "CmsSmtpserverSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SMTPServerSite_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ServerId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SMTPServerSite_CMS_SMTPServer"), + j => + { + j.HasKey("ServerId", "SiteId"); + j.ToTable("CMS_SMTPServerSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_SMTPServerSite_SiteID"); + j.IndexerProperty("ServerId").HasColumnName("ServerID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StateId).IsClustered(false); + + entity.HasIndex(e => e.StateDisplayName, "IX_CMS_State_CountryID_StateDisplayName").IsClustered(); + + entity.Property(e => e.StateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.StateName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.Country).WithMany(p => p.CmsStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_State_CountryID_CMS_Country"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TagId).IsClustered(false); + + entity.HasIndex(e => e.TagName, "IX_CMS_Tag_TagName").IsClustered(); + + entity.HasOne(d => d.TagGroup).WithMany(p => p.CmsTags) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tag_TagGroupID_CMS_TagGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TagGroupId).IsClustered(false); + + entity.HasIndex(e => e.TagGroupDisplayName, "IX_CMS_TagGroup_TagGroupDisplayName").IsClustered(); + + entity.Property(e => e.TagGroupDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TagGroupName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TagGroupSite).WithMany(p => p.CmsTagGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TagGroup_TagGroupSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LayoutLastModified).HasDefaultValueSql("('7/31/2012 12:10:49 PM')"); + + entity.HasOne(d => d.Layout).WithMany(p => p.CmsTemplateDeviceLayouts).HasConstraintName("FK_CMS_TemplateDeviceLayout_LayoutID_CMS_Layout"); + + entity.HasOne(d => d.PageTemplate).WithMany(p => p.CmsTemplateDeviceLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TemplateDeviceLayout_PageTemplateID_CMS_PageTemplate"); + + entity.HasOne(d => d.Profile).WithMany(p => p.CmsTemplateDeviceLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TemplateDeviceLayout_ProfileID_CMS_DeviceProfile"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TimeZoneId).IsClustered(false); + + entity.HasIndex(e => e.TimeZoneDisplayName, "IX_CMS_TimeZone_TimeZoneDisplayName").IsClustered(); + + entity.Property(e => e.TimeZoneDaylight).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TransformationId).IsClustered(false); + + entity.HasIndex(e => new { e.TransformationClassId, e.TransformationName }, "IX_CMS_Transformation_TransformationClassID_TransformationName").IsClustered(); + + entity.Property(e => e.TransformationCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TransformationIsHierarchical).HasDefaultValueSql("((0))"); + entity.Property(e => e.TransformationName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TransformationType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.TransformationClass).WithMany(p => p.CmsTransformations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Transformation_TransformationClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TranslationServiceGenerateTargetTag).HasDefaultValueSql("((0))"); + entity.Property(e => e.TranslationServiceSupportsCancel).HasDefaultValueSql("((0))"); + entity.Property(e => e.TranslationServiceSupportsStatusUpdate).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubmissionTargetCulture).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SubmissionService).WithMany(p => p.CmsTranslationSubmissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TranslationSubmission_CMS_TranslationService"); + + entity.HasOne(d => d.SubmissionSubmittedByUser).WithMany(p => p.CmsTranslationSubmissions).HasConstraintName("FK_CMS_TranslationSubmission_CMS_User"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SubmissionItemSubmission).WithMany(p => p.CmsTranslationSubmissionItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TranslationSubmissionItem_CMS_TranslationSubmission")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.NodeAllowCacheInFileSystem).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeHasChildren).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeHasLinks).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeInheritPageTemplate).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeTemplateForAllCultures).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.NodeAcl).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeACLID_CMS_ACL"); + + entity.HasOne(d => d.NodeClass).WithMany(p => p.CmsTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tree_NodeClassID_CMS_Class"); + + entity.HasOne(d => d.NodeGroup).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeGroupID_Community_Group"); + + entity.HasOne(d => d.NodeLinkedNode).WithMany(p => p.InverseNodeLinkedNode).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeID_CMS_Tree"); + + entity.HasOne(d => d.NodeLinkedNodeSite).WithMany(p => p.CmsTreeNodeLinkedNodeSites).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeSiteID_CMS_Site"); + + entity.HasOne(d => d.NodeOriginalNode).WithMany(p => p.InverseNodeOriginalNode).HasConstraintName("FK_CMS_Tree_NodeOriginalNodeID_CMS_Tree"); + + entity.HasOne(d => d.NodeOwnerNavigation).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeOwner_CMS_User"); + + entity.HasOne(d => d.NodeParent).WithMany(p => p.InverseNodeParent).HasConstraintName("FK_CMS_Tree_NodeParentID_CMS_Tree"); + + entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsTreeNodeSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tree_NodeSiteID_CMS_Site"); + + entity.HasOne(d => d.NodeSku).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeSKUID_COM_SKU"); + + entity.HasOne(d => d.NodeTemplate).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeTemplateID_CMS_PageTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ElementId).IsClustered(false); + + entity.HasIndex(e => new + { + e.ElementResourceId, + e.ElementLevel, + e.ElementParentId, + e.ElementOrder, + e.ElementCaption + }, "IX_CMS_UIElement_ElementResourceID_ElementLevel_ElementParentID_ElementOrder_ElementCaption").IsClustered(); + + entity.Property(e => e.ElementCheckModuleReadPermission).HasDefaultValueSql("((1))"); + entity.Property(e => e.ElementIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementIsGlobalApplication).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementIsMenu).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ElementSize).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ElementPageTemplate).WithMany(p => p.CmsUielements).HasConstraintName("FK_CMS_UIElement_ElementPageTemplateID_CMS_PageTemplate"); + + entity.HasOne(d => d.ElementParent).WithMany(p => p.InverseElementParent).HasConstraintName("FK_CMS_UIElement_ElementParentID_CMS_UIElement"); + + entity.HasOne(d => d.ElementResource).WithMany(p => p.CmsUielements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UIElement_ElementResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserIsDomain).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserIsExternal).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserIsHidden).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserName).HasDefaultValueSql("('')"); + entity.Property(e => e.UserPassword).HasDefaultValueSql("(N'')"); + + entity.HasMany(d => d.Forums).WithMany(p => p.Users) + .UsingEntity>( + "ForumsForumModerator", + r => r.HasOne().WithMany() + .HasForeignKey("ForumId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumModerators_ForumID_Forums_Forum"), + l => l.HasOne().WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumModerators_UserID_CMS_User"), + j => + { + j.HasKey("UserId", "ForumId"); + j.ToTable("Forums_ForumModerators"); + j.HasIndex(new[] { "ForumId" }, "IX_Forums_ForumModerators_ForumID"); + j.IndexerProperty("UserId").HasColumnName("UserID"); + j.IndexerProperty("ForumId").HasColumnName("ForumID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Culture).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_CultureID_CMS_Culture"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_SiteID_CMS_Site"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserMacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.UserMacroIdentityMacroIdentity).WithMany(p => p.CmsUserMacroIdentities).HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID_CMS_MacroIdentity"); + + entity.HasOne(d => d.UserMacroIdentityUser).WithOne(p => p.CmsUserMacroIdentity) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Role).WithMany(p => p.CmsUserRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserRole_RoleID_CMS_Role"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserRole_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserAccountLockReason).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserInvalidLogOnAttempts).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserWaitingForApproval).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.UserActivatedByUser).WithMany(p => p.CmsUserSettingUserActivatedByUsers).HasConstraintName("FK_CMS_UserSettings_UserActivatedByUserID_CMS_User"); + + entity.HasOne(d => d.UserAvatar).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserAvatarID_CMS_Avatar"); + + entity.HasOne(d => d.UserBadge).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserBadgeID_CMS_Badge"); + + entity.HasOne(d => d.UserSettingsUser).WithMany(p => p.CmsUserSettingUserSettingsUsers) + .HasPrincipalKey(p => p.UserGuid) + .HasForeignKey(d => d.UserSettingsUserGuid) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserGUID_CMS_User"); + + entity.HasOne(d => d.UserSettingsUserNavigation).WithOne(p => p.CmsUserSettingUserSettingsUserNavigation) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserID_CMS_User"); + + entity.HasOne(d => d.UserTimeZone).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserTimeZoneID_CMS_TimeZone"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Site).WithMany(p => p.CmsUserSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSite_SiteID_CMS_Site"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSite_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.VersionHistoryId).IsClustered(false); + + entity.HasIndex(e => e.DocumentId, "IX_CMS_VersionHistory_DocumentID").IsClustered(); + + entity.Property(e => e.DocumentNamePath).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ModifiedByUser).WithMany(p => p.CmsVersionHistoryModifiedByUsers).HasConstraintName("FK_CMS_VersionHistory_ModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsVersionHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionHistory_NodeSiteID_CMS_Site"); + + entity.HasOne(d => d.VersionClass).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionClassID_CMS_Class"); + + entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_VersionHistory_DeletedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionWorkflow).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowID_CMS_Workflow"); + + entity.HasOne(d => d.VersionWorkflowStep).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowStepID_CMS_WorkflowStep"); + + entity.HasMany(d => d.AttachmentHistories).WithMany(p => p.VersionHistories) + .UsingEntity>( + "CmsVersionAttachment", + r => r.HasOne().WithMany() + .HasForeignKey("AttachmentHistoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionAttachment_AttachmentHistoryID_CMS_AttachmentHistory"), + l => l.HasOne().WithMany() + .HasForeignKey("VersionHistoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionAttachment_VersionHistoryID_CMS_VersionHistory"), + j => + { + j.HasKey("VersionHistoryId", "AttachmentHistoryId"); + j.ToTable("CMS_VersionAttachment"); + j.HasIndex(new[] { "AttachmentHistoryId" }, "IX_CMS_VersionAttachment_AttachmentHistoryID"); + j.IndexerProperty("VersionHistoryId").HasColumnName("VersionHistoryID"); + j.IndexerProperty("AttachmentHistoryId").HasColumnName("AttachmentHistoryID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ServerId).IsClustered(false); + + entity.HasIndex(e => e.ServerDisplayName, "IX_CMS_WebFarmServer_ServerDisplayName").IsClustered(); + + entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ServerLastModified).HasDefaultValueSql("('9/17/2013 12:18:06 PM')"); + entity.Property(e => e.ServerName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.LogCode).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Server).WithMany(p => p.CmsWebFarmServerTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer"); + + entity.HasOne(d => d.Task).WithMany(p => p.CmsWebFarmServerTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebFarmServerTask_TaskID_CMS_WebFarmTask"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskGuid).HasDefaultValueSql("('00000000-0000-0000-0000-000000000000')"); + entity.Property(e => e.TaskIsMemory).HasDefaultValueSql("((0))"); + entity.Property(e => e.TaskType).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.WebPartDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartFileName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.WebPartName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartProperties).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartSkipInsertProperties).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.WebPartCategory).WithMany(p => p.CmsWebParts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPart_WebPartCategoryID_CMS_WebPartCategory"); + + entity.HasOne(d => d.WebPartParent).WithMany(p => p.InverseWebPartParent).HasConstraintName("FK_CMS_WebPart_WebPartParentID_CMS_WebPart"); + + entity.HasOne(d => d.WebPartResource).WithMany(p => p.CmsWebParts).HasConstraintName("FK_CMS_WebPart_WebPartResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_CMS_WebPartCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_WebPartCategory_CategoryParentID_CMS_WebPartCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ContainerId).IsClustered(false); + + entity.HasIndex(e => e.ContainerDisplayName, "IX_CMS_WebPartContainer_ContainerDisplayName").IsClustered(); + + entity.Property(e => e.ContainerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContainerName).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Containers) + .UsingEntity>( + "CmsWebPartContainerSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartContainerSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ContainerId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartContainerSite_ContainerID_CMS_WebPartContainer"), + j => + { + j.HasKey("ContainerId", "SiteId"); + j.ToTable("CMS_WebPartContainerSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_WebPartContainerSite_SiteID"); + j.IndexerProperty("ContainerId").HasColumnName("ContainerID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WebPartLayoutId).IsClustered(false); + + entity.HasIndex(e => new { e.WebPartLayoutWebPartId, e.WebPartLayoutCodeName }, "IX_CMS_WebPartLayout_WebPartLayoutWebPartID_WebPartLayoutCodeName").IsClustered(); + + entity.Property(e => e.WebPartLayoutCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebPartLayoutDisplayName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.WebPartLayoutWebPart).WithMany(p => p.CmsWebPartLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartLayout_WebPartLayoutWebPartID_CMS_WebPart"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WebTemplateId).IsClustered(false); + + entity.HasIndex(e => e.WebTemplateOrder, "IX_CMS_WebTemplate_WebTemplateOrder").IsClustered(); + + entity.Property(e => e.WebTemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebTemplateFileName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebTemplateLicenses).HasDefaultValueSql("('')"); + entity.Property(e => e.WebTemplateName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebTemplateOrder).HasDefaultValueSql("((99999))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WidgetId).IsClustered(false); + + entity.HasIndex(e => new { e.WidgetCategoryId, e.WidgetDisplayName }, "IX_CMS_Widget_WidgetCategoryID_WidgetDisplayName").IsClustered(); + + entity.Property(e => e.WidgetSecurity).HasDefaultValueSql("((2))"); + + entity.HasOne(d => d.WidgetCategory).WithMany(p => p.CmsWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Widget_WidgetCategoryID_CMS_WidgetCategory"); + + entity.HasOne(d => d.WidgetLayout).WithMany(p => p.CmsWidgets).HasConstraintName("FK_CMS_Widget_WidgetLayoutID_CMS_WebPartLayout"); + + entity.HasOne(d => d.WidgetWebPart).WithMany(p => p.CmsWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Widget_WidgetWebPartID_CMS_WebPart"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WidgetCategoryId).IsClustered(false); + + entity.HasIndex(e => e.WidgetCategoryPath, "IX_CMS_WidgetCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.WidgetCategoryParent).WithMany(p => p.InverseWidgetCategoryParent).HasConstraintName("FK_CMS_WidgetCategory_WidgetCategoryParentID_CMS_WidgetCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Permission).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_RoleID_CMS_Role"); + + entity.HasOne(d => d.Widget).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_WidgetID_CMS_Widget"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowId).IsClustered(false); + + entity.HasIndex(e => e.WorkflowDisplayName, "IX_CMS_Workflow_WorkflowDisplayName").IsClustered(); + + entity.Property(e => e.WorkflowAutoPublishChanges).HasDefaultValueSql("((0))"); + entity.Property(e => e.WorkflowDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.WorkflowEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowName).HasDefaultValueSql("('')"); + entity.Property(e => e.WorkflowSendApproveEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendArchiveEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendPublishEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendReadyForApprovalEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendRejectEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowUseCheckinCheckout).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Users).WithMany(p => p.Workflows) + .UsingEntity>( + "CmsWorkflowUser", + r => r.HasOne().WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowUser_UserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("WorkflowId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowUser_WorkflowID_CMS_Workflow"), + j => + { + j.HasKey("WorkflowId", "UserId").HasName("PK_CMS_WorkflowUser_1"); + j.ToTable("CMS_WorkflowUser"); + j.HasIndex(new[] { "UserId" }, "IX_CMS_WorkflowUser_UserID"); + j.IndexerProperty("WorkflowId").HasColumnName("WorkflowID"); + j.IndexerProperty("UserId").HasColumnName("UserID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ActionEnabled).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.ActionResource).WithMany(p => p.CmsWorkflowActions).HasConstraintName("FK_CMS_WorkflowAction_ActionResourceID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ApprovedByUser).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_ApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_HistoryWorkflowID_CMS_Workflow"); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowHistorySteps).HasConstraintName("FK_CMS_WorkflowHistory_StepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TargetStep).WithMany(p => p.CmsWorkflowHistoryTargetSteps).HasConstraintName("FK_CMS_WorkflowHistory_TargetStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.VersionHistory).WithMany(p => p.CmsWorkflowHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowHistory_VersionHistoryID_CMS_VersionHistory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ScopeId).IsClustered(false); + + entity.HasIndex(e => e.ScopeStartingPath, "IX_CMS_WorkflowScope_ScopeStartingPath").IsClustered(); + + entity.HasOne(d => d.ScopeClass).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeClassID_CMS_Class"); + + entity.HasOne(d => d.ScopeCulture).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeCultureID_CMS_Culture"); + + entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsWorkflowScopes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowScope_ScopeSiteID_CMS_Site"); + + entity.HasOne(d => d.ScopeWorkflow).WithMany(p => p.CmsWorkflowScopes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowScope_ScopeWorkflowID_CMS_WorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.StepAllowPublish).HasDefaultValueSql("((0))"); + entity.Property(e => e.StepAllowReject).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.StepAction).WithMany(p => p.CmsWorkflowSteps).HasConstraintName("FK_CMS_WorkflowStep_StepActionID"); + + entity.HasOne(d => d.StepWorkflow).WithMany(p => p.CmsWorkflowSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStep_StepWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowStepRoleId).IsClustered(false); + + entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.RoleId }, "IX_CMS_WorkflowStepRoles_StepID_StepSourcePointGUID_RoleID") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsWorkflowStepRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepRoles_RoleID_CMS_Role"); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepRoles_StepID_CMS_WorkflowStep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowStepUserId).IsClustered(false); + + entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.UserId }, "IX_CMS_WorkflowStepUser_StepID_StepSourcePointGUID_UserID") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepUser_StepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsWorkflowStepUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TransitionEndStep).WithMany(p => p.CmsWorkflowTransitionTransitionEndSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionEndStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TransitionStartStep).WithMany(p => p.CmsWorkflowTransitionTransitionStartSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionStartStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TransitionWorkflow).WithMany(p => p.CmsWorkflowTransitions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionWorkflowID_CMS_Workflow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AddressId).HasName("PK_COM_CustomerAdress"); + + entity.Property(e => e.AddressCity).HasDefaultValueSql("('')"); + entity.Property(e => e.AddressLastModified).HasDefaultValueSql("('10/18/2012 3:39:07 PM')"); + entity.Property(e => e.AddressLine1).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AddressName).HasDefaultValueSql("('')"); + entity.Property(e => e.AddressPersonalName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AddressZip).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Address_AddressCountryID_CMS_Country"); + + entity.HasOne(d => d.AddressCustomer).WithMany(p => p.ComAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Address_AddressCustomerID_COM_Customer"); + + entity.HasOne(d => d.AddressState).WithMany(p => p.ComAddresses).HasConstraintName("FK_COM_Address_AddressStateID_CMS_State"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BrandDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BrandEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.BrandLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.BrandName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.BrandSite).WithMany(p => p.ComBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Brand_BrandSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CarrierAssemblyName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierClassName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierLastModified).HasDefaultValueSql("('9/22/2014 3:00:14 PM')"); + entity.Property(e => e.CarrierName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CarrierSite).WithMany(p => p.ComCarriers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Carrier_CarrierSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CollectionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CollectionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.CollectionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CollectionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CollectionSite).WithMany(p => p.ComCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Collection_CollectionSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CouponCodeCode).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CouponCodeDiscount).WithMany(p => p.ComCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CouponCode_CouponCodeDiscountID_COM_Discount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CurrencyCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyFormatString).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CurrencySite).WithMany(p => p.ComCurrencies).HasConstraintName("FK_COM_Currency_CurrencySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ExchangeRateToCurrency).WithMany(p => p.ComCurrencyExchangeRates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID_COM_Currency"); + + entity.HasOne(d => d.ExchangeTable).WithMany(p => p.ComCurrencyExchangeRates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeTableID_COM_ExchangeTable"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.CustomerCompany, "IX_COM_Customer_CustomerCompany") + .HasFilter("([CustomerCompany] IS NOT NULL)") + .HasFillFactor(90); + + entity.HasOne(d => d.CustomerSite).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerSiteID_CMS_Site"); + + entity.HasOne(d => d.CustomerUser).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EventCreditLastModified).HasDefaultValueSql("('9/26/2012 12:21:38 PM')"); + entity.Property(e => e.EventDate).HasDefaultValueSql("('9/27/2012 2:48:56 PM')"); + entity.Property(e => e.EventName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.EventCustomer).WithMany(p => p.ComCustomerCreditHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CustomerCreditHistory_EventCustomerID_COM_Customer"); + + entity.HasOne(d => d.EventSite).WithMany(p => p.ComCustomerCreditHistories).HasConstraintName("FK_COM_CustomerCreditHistory_EventSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DepartmentDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.DepartmentName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.DepartmentDefaultTaxClass).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentDefaultTaxClassID_COM_TaxClass"); + + entity.HasOne(d => d.DepartmentSite).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); + entity.Property(e => e.DiscountApplyTo).HasDefaultValueSql("('Order')"); + entity.Property(e => e.DiscountDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.DiscountEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.DiscountOrder).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.DiscountSite).WithMany(p => p.ComDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Discount_DiscountSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ExchangeTableId).IsClustered(false); + + entity.HasIndex(e => new { e.ExchangeTableValidFrom, e.ExchangeTableValidTo }, "IX_COM_ExchangeTable_ExchangeTableValidFrom_ExchangeTableValidTo") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.ExchangeTableDisplayName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ExchangeTableSite).WithMany(p => p.ComExchangeTables).HasConstraintName("FK_COM_ExchangeTable_ExchangeTableSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.GiftCardCustomerRestriction).HasDefaultValueSql("(N'enum1')"); + entity.Property(e => e.GiftCardDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GiftCardEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.GiftCardLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.GiftCardName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.GiftCardSite).WithMany(p => p.ComGiftCards) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_GiftCard_GiftCardSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.GiftCardCouponCodeCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GiftCardCouponCodeLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.GiftCardCouponCodeGiftCard).WithMany(p => p.ComGiftCardCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_GiftCardCouponCode_GiftCardCouponCodeGiftCardID_COM_GiftCard"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.InternalStatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.InternalStatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.InternalStatusLastModified).HasDefaultValueSql("('9/20/2012 2:45:44 PM')"); + entity.Property(e => e.InternalStatusName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.InternalStatusSite).WithMany(p => p.ComInternalStatuses).HasConstraintName("FK_COM_InternalStatus_InternalStatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ManufacturerId).IsClustered(false); + + entity.HasIndex(e => new { e.ManufacturerDisplayName, e.ManufacturerEnabled }, "IX_COM_Manufacturer_ManufacturerDisplayName_ManufacturerEnabled").IsClustered(); + + entity.Property(e => e.ManufacturerDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ManufacturerEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ManufacturerLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ManufacturerSite).WithMany(p => p.ComManufacturers).HasConstraintName("FK_COM_Manufacturer_ManufacturerSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MultiBuyCouponCodeCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MultiBuyCouponCodeUseCount).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.MultiBuyCouponCodeMultiBuyDiscount).WithMany(p => p.ComMultiBuyCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MultiBuyDiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountAutoAddEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountCustomerRestriction).HasDefaultValueSql("(N'All')"); + entity.Property(e => e.MultiBuyDiscountEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountIsFlat).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountMinimumBuyCount).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountUsesCoupons).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.MultiBuyDiscountApplyToSku).WithMany(p => p.ComMultiBuyDiscounts).HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID_COM_SKU"); + + entity.HasOne(d => d.MultiBuyDiscountSite).WithMany(p => p.ComMultiBuyDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountSiteID_CMS_Site"); + + entity.HasMany(d => d.Departments).WithMany(p => p.MultiBuyDiscounts) + .UsingEntity>( + "ComMultiBuyDiscountDepartment", + r => r.HasOne().WithMany() + .HasForeignKey("DepartmentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_DepartmentID_COM_Department"), + l => l.HasOne().WithMany() + .HasForeignKey("MultiBuyDiscountId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_MultiBuyDiscountID_COM_MultiBuyDiscount"), + j => + { + j.HasKey("MultiBuyDiscountId", "DepartmentId"); + j.ToTable("COM_MultiBuyDiscountDepartment"); + j.HasIndex(new[] { "DepartmentId" }, "IX_COM_MultiBuyDiscountDepartment_DepartmentID"); + j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); + j.IndexerProperty("DepartmentId").HasColumnName("DepartmentID"); + }); + + entity.HasMany(d => d.Skus).WithMany(p => p.MultiBuyDiscounts) + .UsingEntity>( + "ComMultiBuyDiscountSku", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountSKU_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("MultiBuyDiscountId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountSKU_MultiBuyDiscountID_COM_MultiBuyDiscount"), + j => + { + j.HasKey("MultiBuyDiscountId", "Skuid"); + j.ToTable("COM_MultiBuyDiscountSKU"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_MultiBuyDiscountSKU_SKUID"); + j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BrandIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Brand).WithMany(p => p.ComMultiBuyDiscountBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountBrand_BrandID_COM_Brand"); + + entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountBrand_MultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CollectionIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Collection).WithMany(p => p.ComMultiBuyDiscountCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountCollection_CollectionID_COM_Collection"); + + entity.HasOne(d => d.MultibuyDiscount).WithMany(p => p.ComMultiBuyDiscountCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountCollection_MultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.NodeIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountTree_MultiBuyDiscountID_COM_MultiBuyDiscount"); + + entity.HasOne(d => d.Node).WithMany(p => p.ComMultiBuyDiscountTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountTree_NodeID_CMS_Tree"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_COM_OptionCategory_CategoryDisplayName_CategoryEnabled").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CategoryDisplayPrice).HasDefaultValueSql("((1))"); + entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.CategoryName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CategorySelectionType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CategorySite).WithMany(p => p.ComOptionCategories).HasConstraintName("FK_COM_OptionCategory_CategorySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.OrderCreatedByUser).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.OrderCurrency).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCurrencyID_COM_Currency"); + + entity.HasOne(d => d.OrderCustomer).WithMany(p => p.ComOrders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Order_OrderCustomerID_COM_Customer"); + + entity.HasOne(d => d.OrderPaymentOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderPaymentOptionID_COM_PaymentOption"); + + entity.HasOne(d => d.OrderShippingOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderShippingOptionID_COM_ShippingOption"); + + entity.HasOne(d => d.OrderSite).WithMany(p => p.ComOrders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Order_OrderSiteID_CMS_Site"); + + entity.HasOne(d => d.OrderStatus).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderStatusID_COM_Status"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComOrderAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderAddress_AddressCountryID_CMS_Country"); + + entity.HasOne(d => d.AddressOrder).WithMany(p => p.ComOrderAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderAddress_AddressOrderID_COM_Order"); + + entity.HasOne(d => d.AddressState).WithMany(p => p.ComOrderAddresses).HasConstraintName("FK_COM_OrderAddress_AddressStateID_CMS_State"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.OrderItemOrder).WithMany(p => p.ComOrderItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItem_OrderItemOrderID_COM_Order"); + + entity.HasOne(d => d.OrderItemSku).WithMany(p => p.ComOrderItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItem_OrderItemSKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.File).WithMany(p => p.ComOrderItemSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItemSKUFile_COM_SKUFile"); + + entity.HasOne(d => d.OrderItem).WithMany(p => p.ComOrderItemSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItemSKUFile_COM_OrderItem"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.StatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.StatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.StatusName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.StatusSendNotification).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.StatusSite).WithMany(p => p.ComOrderStatuses).HasConstraintName("FK_COM_OrderStatus_StatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ChangedByUser).WithMany(p => p.ComOrderStatusUsers).HasConstraintName("FK_COM_OrderStatusUser_ChangedByUserID_CMS_User"); + + entity.HasOne(d => d.FromStatus).WithMany(p => p.ComOrderStatusUserFromStatuses).HasConstraintName("FK_COM_OrderStatusUser_FromStatusID_COM_Status"); + + entity.HasOne(d => d.Order).WithMany(p => p.ComOrderStatusUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderStatusUser_OrderID_COM_Order"); + + entity.HasOne(d => d.ToStatus).WithMany(p => p.ComOrderStatusUserToStatuses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderStatusUser_ToStatusID_COM_Status"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PaymentOptionId).IsClustered(false); + + entity.HasIndex(e => new { e.PaymentOptionSiteId, e.PaymentOptionDisplayName, e.PaymentOptionEnabled }, "IX_COM_PaymentOption_PaymentOptionSiteID_PaymentOptionDisplayName_PaymentOptionEnabled").IsClustered(); + + entity.Property(e => e.PaymentOptionAllowIfNoShipping).HasDefaultValueSql("((0))"); + entity.Property(e => e.PaymentOptionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PaymentOptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PaymentOptionLastModified).HasDefaultValueSql("('9/27/2012 4:18:26 PM')"); + entity.Property(e => e.PaymentOptionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PaymentOptionAuthorizedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionAuthorizedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID_COM_OrderStatus"); + + entity.HasOne(d => d.PaymentOptionFailedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionFailedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionFailedOrderStatusID_COM_OrderStatus"); + + entity.HasOne(d => d.PaymentOptionSite).WithMany(p => p.ComPaymentOptions).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSiteID_CMS_Site"); + + entity.HasOne(d => d.PaymentOptionSucceededOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionSucceededOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSucceededOrderStatusID_COM_OrderStatus"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PublicStatusId).IsClustered(false); + + entity.HasIndex(e => new { e.PublicStatusDisplayName, e.PublicStatusEnabled }, "IX_COM_PublicStatus_PublicStatusDisplayName_PublicStatusEnabled").IsClustered(); + + entity.Property(e => e.PublicStatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PublicStatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PublicStatusName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PublicStatusSite).WithMany(p => p.ComPublicStatuses).HasConstraintName("FK_COM_PublicStatus_PublicStatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ShippingCostId).HasName("PK__COM_ShippingCost"); + + entity.HasOne(d => d.ShippingCostShippingOption).WithMany(p => p.ComShippingCosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShippingCost_ShippingCostShippingOptionID_COM_ShippingOption"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ShippingOptionId).IsClustered(false); + + entity.HasIndex(e => e.ShippingOptionDisplayName, "IX_COM_ShippingOptionDisplayName").IsClustered(); + + entity.Property(e => e.ShippingOptionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ShippingOptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ShippingOptionLastModified).HasDefaultValueSql("('9/26/2012 12:44:18 PM')"); + entity.Property(e => e.ShippingOptionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ShippingOptionCarrier).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionCarrierID_COM_Carrier"); + + entity.HasOne(d => d.ShippingOptionSite).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionSiteID_CMS_Site"); + + entity.HasOne(d => d.ShippingOptionTaxClass).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionTaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ShoppingCartBillingAddress).WithMany(p => p.ComShoppingCartShoppingCartBillingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartBillingAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartCompanyAddress).WithMany(p => p.ComShoppingCartShoppingCartCompanyAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCompanyAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartCurrency).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCurrencyID_COM_Currency"); + + entity.HasOne(d => d.ShoppingCartCustomer).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCustomerID_COM_Customer"); + + entity.HasOne(d => d.ShoppingCartPaymentOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartPaymentOptionID_COM_PaymentOption"); + + entity.HasOne(d => d.ShoppingCartShippingAddress).WithMany(p => p.ComShoppingCartShoppingCartShippingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartShippingOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingOptionID_COM_ShippingOption"); + + entity.HasOne(d => d.ShoppingCartSite).WithMany(p => p.ComShoppingCarts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCart_ShoppingCartSiteID_CMS_Site"); + + entity.HasOne(d => d.ShoppingCartUser).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CouponCode).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartCouponCode_ShoppingCartID_COM_ShoppingCart"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CartItemAutoAddedUnits).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartSkus) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartSKU_ShoppingCartID_COM_ShoppingCart"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComShoppingCartSkus) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartSKU_SKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.Skunumber, "IX_COM_SKU_SKUNumber") + .HasFilter("([SKUNumber] IS NOT NULL)") + .HasFillFactor(90); + + entity.Property(e => e.SkubundleInventoryType).HasDefaultValueSql("('REMOVEBUNDLE')"); + entity.Property(e => e.SkuconversionValue).HasDefaultValueSql("('0')"); + entity.Property(e => e.Skuenabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.Skuname).HasDefaultValueSql("('')"); + entity.Property(e => e.SkusellOnlyAvailable).HasDefaultValueSql("((0))"); + entity.Property(e => e.SkutrackInventory).HasDefaultValueSql("(N'ByProduct')"); + + entity.HasOne(d => d.Skubrand).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUBrandID_COM_Brand"); + + entity.HasOne(d => d.Skucollection).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUCollectionID_COM_Collection"); + + entity.HasOne(d => d.Skudepartment).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUDepartmentID_COM_Department"); + + entity.HasOne(d => d.SkuinternalStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUInternalStatusID_COM_InternalStatus"); + + entity.HasOne(d => d.Skumanufacturer).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUManufacturerID_COM_Manifacturer"); + + entity.HasOne(d => d.SkuoptionCategory).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUOptionCategoryID_COM_OptionCategory"); + + entity.HasOne(d => d.SkuparentSku).WithMany(p => p.InverseSkuparentSku).HasConstraintName("FK_COM_SKU_SKUParentSKUID_COM_SKU"); + + entity.HasOne(d => d.SkupublicStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUPublicStatusID_COM_PublicStatus"); + + entity.HasOne(d => d.Skusite).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSiteID_CMS_Site"); + + entity.HasOne(d => d.Skusupplier).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSupplierID_COM_Supplier"); + + entity.HasOne(d => d.SkutaxClass).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUTaxClass_COM_TaxClass"); + + entity.HasMany(d => d.Bundles).WithMany(p => p.Skus) + .UsingEntity>( + "ComBundle", + r => r.HasOne().WithMany() + .HasForeignKey("BundleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), + j => + { + j.HasKey("BundleId", "Skuid"); + j.ToTable("COM_Bundle"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); + j.IndexerProperty("BundleId").HasColumnName("BundleID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.OptionSkus).WithMany(p => p.SkusNavigation) + .UsingEntity>( + "ComSkuallowedOption", + r => r.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), + j => + { + j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); + j.ToTable("COM_SKUAllowedOption"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.OptionSkusNavigation).WithMany(p => p.VariantSkus) + .UsingEntity>( + "ComVariantOption", + r => r.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("VariantSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), + j => + { + j.HasKey("VariantSkuid", "OptionSkuid"); + j.ToTable("COM_VariantOption"); + j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); + j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + }); + + entity.HasMany(d => d.Skus).WithMany(p => p.Bundles) + .UsingEntity>( + "ComBundle", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("BundleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), + j => + { + j.HasKey("BundleId", "Skuid"); + j.ToTable("COM_Bundle"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); + j.IndexerProperty("BundleId").HasColumnName("BundleID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.SkusNavigation).WithMany(p => p.OptionSkus) + .UsingEntity>( + "ComSkuallowedOption", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), + j => + { + j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); + j.ToTable("COM_SKUAllowedOption"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.VariantSkus).WithMany(p => p.OptionSkusNavigation) + .UsingEntity>( + "ComVariantOption", + r => r.HasOne().WithMany() + .HasForeignKey("VariantSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), + j => + { + j.HasKey("VariantSkuid", "OptionSkuid"); + j.ToTable("COM_VariantOption"); + j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); + j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + }); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.FileSku).WithMany(p => p.ComSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUFile_COM_SKU")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Category).WithMany(p => p.ComSkuoptionCategories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOptionCategory_CategoryID_COM_OptionCategory"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComSkuoptionCategories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOptionCategory_SKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SupplierId).IsClustered(false); + + entity.HasIndex(e => new { e.SupplierDisplayName, e.SupplierEnabled }, "IX_COM_Supplier_SupplierDisplayName_SupplierEnabled").IsClustered(); + + entity.Property(e => e.SupplierDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.SupplierEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.SupplierLastModified).HasDefaultValueSql("('9/21/2012 12:34:09 PM')"); + + entity.HasOne(d => d.SupplierSite).WithMany(p => p.ComSuppliers).HasConstraintName("FK_COM_Supplier_SupplierSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TaxClassId).IsClustered(false); + + entity.HasIndex(e => e.TaxClassDisplayName, "IX_COM_TaxClass_TaxClassDisplayName").IsClustered(); + + entity.Property(e => e.TaxClassDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TaxClassLastModified).HasDefaultValueSql("('9/20/2012 1:31:27 PM')"); + entity.Property(e => e.TaxClassName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TaxClassZeroIfIdsupplied).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.TaxClassSite).WithMany(p => p.ComTaxClasses).HasConstraintName("FK_COM_TaxClass_TaxClassSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Country).WithMany(p => p.ComTaxClassCountries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxCategoryCountry_CountryID_CMS_Country"); + + entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassCountries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxCategoryCountry_TaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.State).WithMany(p => p.ComTaxClassStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxClassState_StateID_CMS_State"); + + entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxClassState_TaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.VolumeDiscountSku).WithMany(p => p.ComVolumeDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VolumeDiscount_VolumeDiscountSKUID_COM_SKU")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Site).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_SiteID_CMS_Site"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_SKUID_COM_SKU"); + + entity.HasOne(d => d.User).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GroupId).IsClustered(false); + + entity.HasIndex(e => new { e.GroupSiteId, e.GroupDisplayName }, "IX_Community_Group_GroupDisplayName").IsClustered(); + + entity.Property(e => e.GroupApproved).HasDefaultValueSql("((0))"); + entity.Property(e => e.GroupCreatedWhen).HasDefaultValueSql("('10/21/2008 10:17:56 AM')"); + entity.Property(e => e.GroupSecurity).HasDefaultValueSql("((444))"); + entity.Property(e => e.GroupSendJoinLeaveNotification).HasDefaultValueSql("((1))"); + entity.Property(e => e.GroupSendWaitingForApprovalNotification).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.GroupApprovedByUser).WithMany(p => p.CommunityGroupGroupApprovedByUsers).HasConstraintName("FK_Community_Group_GroupApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.GroupAvatar).WithMany(p => p.CommunityGroups).HasConstraintName("FK_Community_Group_GroupAvatarID_CMS_Avatar"); + + entity.HasOne(d => d.GroupCreatedByUser).WithMany(p => p.CommunityGroupGroupCreatedByUsers).HasConstraintName("FK_Community_Group_GroupCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.GroupSite).WithMany(p => p.CommunityGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Community_Group_GroupSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MemberId).IsClustered(false); + + entity.HasIndex(e => e.MemberJoined, "IX_Community_GroupMember_MemberJoined") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.MemberStatus).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.MemberApprovedByUser).WithMany(p => p.CommunityGroupMemberMemberApprovedByUsers).HasConstraintName("FK_Community_GroupMember_MemberApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.MemberGroup).WithMany(p => p.CommunityGroupMembers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Community_GroupMember_MemberGroupID_Community_Group"); + + entity.HasOne(d => d.MemberInvitedByUser).WithMany(p => p.CommunityGroupMemberMemberInvitedByUsers).HasConstraintName("FK_Community_GroupMember_MemberInvitedByUserID_CMS_User"); + + entity.HasOne(d => d.MemberUser).WithMany(p => p.CommunityGroupMemberMemberUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Community_GroupMember_MemberUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Group).WithMany(p => p.CommunityGroupRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_community_GroupRolePermission_GroupID_Community_Group"); + + entity.HasOne(d => d.Permission).WithMany(p => p.CommunityGroupRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_community_GroupRolePermission_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.CommunityGroupRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_community_GroupRolePermission_RoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.InvitationId).HasName("PK_Community_GroupInvitation"); + + entity.HasOne(d => d.InvitationGroup).WithMany(p => p.CommunityInvitations).HasConstraintName("FK_Community_GroupInvitation_InvitationGroupID_Community_Group"); + + entity.HasOne(d => d.InvitedByUser).WithMany(p => p.CommunityInvitationInvitedByUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Community_GroupInvitation_InvitedByUserID_CMS_User"); + + entity.HasOne(d => d.InvitedUser).WithMany(p => p.CommunityInvitationInvitedUsers).HasConstraintName("FK_Community_GroupInvitation_InvitedUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.FileName).HasDefaultValueSql("('')")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AttendeeId).IsClustered(false); + + entity.HasIndex(e => new { e.AttendeeEmail, e.AttendeeFirstName, e.AttendeeLastName }, "IX_Events_Attendee_AttendeeEmail_AttendeeFirstName_AttendeeLastName").IsClustered(); + + entity.Property(e => e.AttendeeEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AttendeeFirstName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AttendeeLastModified).HasDefaultValueSql("('1/20/2015 8:52:25 AM')"); + entity.Property(e => e.AttendeeLastName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AttendeePhone).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AttendeeEventNode).WithMany(p => p.EventsAttendees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Events_Attendee_AttendeeEventNodeID_CMS_Tree"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ExportId).IsClustered(false); + + entity.HasIndex(e => e.ExportDateTime, "IX_Export_History_ExportDateTime") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.ExportFileName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ExportSite).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportSiteID_CMS_Site"); + + entity.HasOne(d => d.ExportUser).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.TaskSite).WithMany(p => p.ExportTasks).HasConstraintName("FK_Export_Task_TaskSiteID_CMS_Site")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AttachmentPost).WithMany(p => p.ForumsAttachments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_Attachment_AttachmentPostID_Forums_ForumPost"); + + entity.HasOne(d => d.AttachmentSite).WithMany(p => p.ForumsAttachments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_Attachment_AttachmentSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ForumId).IsClustered(false); + + entity.HasIndex(e => new { e.ForumGroupId, e.ForumOrder }, "IX_Forums_Forum_ForumGroupID_ForumOrder").IsClustered(); + + entity.Property(e => e.ForumImageMaxSideSize).HasDefaultValueSql("((400))"); + entity.Property(e => e.ForumIsAnswerLimit).HasDefaultValueSql("((5))"); + entity.Property(e => e.ForumIsLocked).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ForumCommunityGroup).WithMany(p => p.ForumsForums).HasConstraintName("FK_Forums_Forum_ForumCommunityGroupID_Community_Group"); + + entity.HasOne(d => d.ForumDocument).WithMany(p => p.ForumsForums).HasConstraintName("FK_Forums_Forum_ForumDocumentID_CMS_Document"); + + entity.HasOne(d => d.ForumGroup).WithMany(p => p.ForumsForums) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_Forum_ForumGroupID_Forums_ForumGroup"); + + entity.HasOne(d => d.ForumSite).WithMany(p => p.ForumsForums) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_Forum_ForumSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GroupId).IsClustered(false); + + entity.HasIndex(e => new { e.GroupSiteId, e.GroupOrder }, "IX_Forums_ForumGroup_GroupSiteID_GroupOrder").IsClustered(); + + entity.Property(e => e.GroupHtmleditor).HasDefaultValueSql("((0))"); + entity.Property(e => e.GroupImageMaxSideSize).HasDefaultValueSql("((400))"); + entity.Property(e => e.GroupLastModified).HasDefaultValueSql("('11/6/2013 2:43:02 PM')"); + entity.Property(e => e.GroupName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GroupUseCaptcha).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.GroupGroup).WithMany(p => p.ForumsForumGroups).HasConstraintName("FK_Forums_ForumGroup_GroupGroupID_Community_Group"); + + entity.HasOne(d => d.GroupSite).WithMany(p => p.ForumsForumGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumGroup_GroupSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PostId).IsClustered(false); + + entity.HasIndex(e => e.PostIdpath, "IX_Forums_ForumPost_PostIDPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.PostAttachmentCount).HasDefaultValueSql("((0))"); + entity.Property(e => e.PostIsLocked).HasDefaultValueSql("((0))"); + entity.Property(e => e.PostQuestionSolved).HasDefaultValueSql("((0))"); + entity.Property(e => e.PostUserName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.PostApprovedByUser).WithMany(p => p.ForumsForumPostPostApprovedByUsers).HasConstraintName("FK_Forums_ForumPost_PostApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.PostForum).WithMany(p => p.ForumsForumPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumPost_PostForumID_Forums_Forum"); + + entity.HasOne(d => d.PostParent).WithMany(p => p.InversePostParent).HasConstraintName("FK_Forums_ForumPost_PostParentID_Forums_ForumPost"); + + entity.HasOne(d => d.PostUser).WithMany(p => p.ForumsForumPostPostUsers).HasConstraintName("FK_Forums_ForumPost_PostUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Forum).WithMany(p => p.ForumsForumRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumRoles_ForumID_Forums_Forum"); + + entity.HasOne(d => d.Permission).WithMany(p => p.ForumsForumRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumRoles_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.ForumsForumRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumRoles_RoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SubscriptionId).IsClustered(false); + + entity.HasIndex(e => new { e.SubscriptionEmail, e.SubscriptionForumId }, "IX_Forums_ForumSubscription_SubscriptionForumID_SubscriptionEmail").IsClustered(); + + entity.HasOne(d => d.SubscriptionForum).WithMany(p => p.ForumsForumSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_ForumSubscription_SubscriptionForumID_Forums_Forum"); + + entity.HasOne(d => d.SubscriptionPost).WithMany(p => p.ForumsForumSubscriptions).HasConstraintName("FK_Forums_ForumSubscription_SubscriptionPostID_Forums_ForumPost"); + + entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.ForumsForumSubscriptions).HasConstraintName("FK_Forums_ForumSubscription_SubscriptionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FavoriteLastModified).HasDefaultValueSql("('12/4/2008 3:23:57 PM')"); + + entity.HasOne(d => d.Forum).WithMany(p => p.ForumsUserFavorites).HasConstraintName("FK_Forums_UserFavorites_ForumID_Forums_Forum"); + + entity.HasOne(d => d.Post).WithMany(p => p.ForumsUserFavorites).HasConstraintName("FK_Forums_UserFavorites_PostID_Forums_ForumPost"); + + entity.HasOne(d => d.Site).WithMany(p => p.ForumsUserFavorites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_UserFavorites_SiteID_CMS_Site"); + + entity.HasOne(d => d.User).WithMany(p => p.ForumsUserFavorites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Forums_UserFavorites_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ConnectorId).IsClustered(false); + + entity.HasIndex(e => e.ConnectorDisplayName, "IX_Integration_Connector_ConnectorDisplayName").IsClustered(); + + entity.Property(e => e.ConnectorEnabled).HasDefaultValueSql("((1))"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SyncLogSynchronization).WithMany(p => p.IntegrationSyncLogs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_SyncLog_SyncLogSynchronizationID_Integration_Synchronization")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SynchronizationConnector).WithMany(p => p.IntegrationSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_Synchronization_SynchronizationConnectorID_Integration_Connector"); + + entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.IntegrationSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_Synchronization_SynchronizationTaskID_Integration_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TaskId).IsClustered(false); + + entity.HasIndex(e => e.TaskNodeAliasPath, "IX_Integration_Task_TaskNodeAliasPath").IsClustered(); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.IntegrationTasks).HasConstraintName("FK_IntegrationTask_TaskSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FileId).IsClustered(false); + + entity.HasIndex(e => e.FilePath, "IX_Media_File_FilePath").IsClustered(); + + entity.Property(e => e.FileCreatedWhen).HasDefaultValueSql("('11/11/2008 4:10:00 PM')"); + entity.Property(e => e.FileModifiedWhen).HasDefaultValueSql("('11/11/2008 4:11:15 PM')"); + entity.Property(e => e.FileTitle).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FileCreatedByUser).WithMany(p => p.MediaFileFileCreatedByUsers).HasConstraintName("FK_Media_File_FileCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.FileLibrary).WithMany(p => p.MediaFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_File_FileLibraryID_Media_Library"); + + entity.HasOne(d => d.FileModifiedByUser).WithMany(p => p.MediaFileFileModifiedByUsers).HasConstraintName("FK_Media_File_FileModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.FileSite).WithMany(p => p.MediaFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_File_FileSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LibraryId).IsClustered(false); + + entity.HasIndex(e => new { e.LibrarySiteId, e.LibraryDisplayName }, "IX_Media_Library_LibraryDisplayName").IsClustered(); + + entity.Property(e => e.LibraryName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.LibraryGroup).WithMany(p => p.MediaLibraries).HasConstraintName("FK_Media_Library_LibraryGroupID_Community_Group"); + + entity.HasOne(d => d.LibrarySite).WithMany(p => p.MediaLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_Library_LibrarySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Library).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_LibraryID_Media_Library"); + + entity.HasOne(d => d.Permission).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_RoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TestLastModified).HasDefaultValueSql("('12/5/2011 4:56:38 PM')"); + + entity.HasOne(d => d.TestIssue).WithOne(p => p.NewsletterAbtestTestIssue) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_ABTest_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.TestWinnerIssue).WithMany(p => p.NewsletterAbtestTestWinnerIssues).HasConstraintName("FK_Newsletter_ABTest_TestWinnerIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.TestWinnerScheduledTask).WithMany(p => p.NewsletterAbtests).HasConstraintName("FK_Newsletter_ABTest_TestWinnerScheduledTaskID_CMS_ScheduledTask"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ClickedLinkEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ClickedLinkNewsletterLink).WithMany(p => p.NewsletterClickedLinks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_ClickedLink_Newsletter_Link"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailNewsletterIssue).WithMany(p => p.NewsletterEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Emails_EmailNewsletterIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.EmailSite).WithMany(p => p.NewsletterEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Emails_EmailSiteID_CMS_Site"); + + entity.HasOne(d => d.EmailSubscriber).WithMany(p => p.NewsletterEmails).HasConstraintName("FK_Newsletter_Emails_EmailSubscriberID_Newsletter_Subscriber"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TemplateId).IsClustered(false); + + entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateDisplayName").IsClustered(); + + entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TemplateIconClass).HasDefaultValueSql("(N'icon-accordion')"); + entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); + entity.Property(e => e.TemplateType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TemplateSite).WithMany(p => p.NewsletterEmailTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplate_TemplateSiteID_CMS_Site"); + + entity.HasMany(d => d.Newsletters).WithMany(p => p.Templates) + .UsingEntity>( + "NewsletterEmailTemplateNewsletter", + r => r.HasOne().WithMany() + .HasForeignKey("NewsletterId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_Newsletter"), + l => l.HasOne().WithMany() + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_EmailTemplate"), + j => + { + j.HasKey("TemplateId", "NewsletterId"); + j.ToTable("Newsletter_EmailTemplateNewsletter"); + j.HasIndex(new[] { "NewsletterId" }, "IX_Newsletter_EmailTemplateNewsletter_NewsletterID"); + j.IndexerProperty("TemplateId").HasColumnName("TemplateID"); + j.IndexerProperty("NewsletterId").HasColumnName("NewsletterID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailWidgetDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EmailWidgetIconCssClass).HasDefaultValueSql("(N'icon-cogwheel-square')"); + entity.Property(e => e.EmailWidgetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.EmailWidgetName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.EmailWidgetSite).WithMany(p => p.NewsletterEmailWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidget_EmailWidgetSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailWidget).WithMany(p => p.NewsletterEmailWidgetTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_EmailWidgetID_Newsletter_EmailWidget"); + + entity.HasOne(d => d.Template).WithMany(p => p.NewsletterEmailWidgetTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_TemplateID_Newsletter_EmailTemplate"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.ContactGroup).WithMany(p => p.NewsletterIssueContactGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_IssueContactGroup_ContactGroupID")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.LinkIssue).WithMany(p => p.NewsletterLinks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Link_Newsletter_NewsletterIssue")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.NewsletterId).IsClustered(false); + + entity.HasIndex(e => new { e.NewsletterSiteId, e.NewsletterDisplayName }, "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterDisplayName").IsClustered(); + + entity.Property(e => e.NewsletterDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterEnableOptIn).HasDefaultValueSql("((0))"); + entity.Property(e => e.NewsletterLastModified).HasDefaultValueSql("('3/13/2015 2:53:28 PM')"); + entity.Property(e => e.NewsletterLogActivity).HasDefaultValueSql("((1))"); + entity.Property(e => e.NewsletterName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterSendOptInConfirmation).HasDefaultValueSql("((0))"); + entity.Property(e => e.NewsletterSenderEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.NewsletterSenderName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterSource).HasDefaultValueSql("(N'T')"); + entity.Property(e => e.NewsletterTrackClickedLinks).HasDefaultValueSql("((1))"); + entity.Property(e => e.NewsletterTrackOpenEmails).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.NewsletterDynamicScheduledTask).WithMany(p => p.NewsletterNewsletters).HasConstraintName("FK_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID_CMS_ScheduledTask"); + + entity.HasOne(d => d.NewsletterOptInTemplate).WithMany(p => p.NewsletterNewsletterNewsletterOptInTemplates).HasConstraintName("FK_Newsletter_Newsletter_NewsletterOptInTemplateID_EmailTemplate"); + + entity.HasOne(d => d.NewsletterSite).WithMany(p => p.NewsletterNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Newsletter_NewsletterSiteID_CMS_Site"); + + entity.HasOne(d => d.NewsletterUnsubscriptionTemplate).WithMany(p => p.NewsletterNewsletterNewsletterUnsubscriptionTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID_Newsletter_EmailTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.IssueDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.IssueSubject).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.IssueNewsletter).WithMany(p => p.NewsletterNewsletterIssues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueNewsletterID_Newsletter_Newsletter"); + + entity.HasOne(d => d.IssueSite).WithMany(p => p.NewsletterNewsletterIssues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueSiteID_CMS_Site"); + + entity.HasOne(d => d.IssueTemplate).WithMany(p => p.NewsletterNewsletterIssues).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueTemplateID_Newsletter_EmailTemplate"); + + entity.HasOne(d => d.IssueVariantOfIssue).WithMany(p => p.InverseIssueVariantOfIssue).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueVariantOfIssue_NewsletterIssue"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.OpenedEmailEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.OpenedEmailIssue).WithMany(p => p.NewsletterOpenedEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_OpenedEmail_OpenedEmailIssueID_Newsletter_NewsletterIssue"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SubscriberId).IsClustered(false); + + entity.HasIndex(e => new { e.SubscriberSiteId, e.SubscriberFullName }, "IX_Newsletter_Subscriber_SubscriberSiteID_SubscriberFullName").IsClustered(); + + entity.Property(e => e.SubscriberType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SubscriberSite).WithMany(p => p.NewsletterSubscribers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Subscriber_SubscriberSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubscriptionApproved).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Newsletter).WithMany(p => p.NewsletterSubscriberNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_SubscriberNewsletter_NewsletterID_Newsletter_Newsletter"); + + entity.HasOne(d => d.Subscriber).WithMany(p => p.NewsletterSubscriberNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_SubscriberNewsletter_SubscriberID_Newsletter_Subscriber"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UnsubscriptionEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.UnsubscriptionFromIssue).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionFromIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.UnsubscriptionNewsletter).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionNewsletterID_Newsletter_Newsletter"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.GatewayId).IsClustered(false); + + entity.HasIndex(e => e.GatewayDisplayName, "IX_Notification_Gateway_GatewayDisplayName").IsClustered(); + + entity.Property(e => e.GatewayAssemblyName).HasDefaultValueSql("('')"); + entity.Property(e => e.GatewayClassName).HasDefaultValueSql("('')"); + entity.Property(e => e.GatewayDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.GatewayEnabled).HasDefaultValueSql("((0))"); + entity.Property(e => e.GatewayName).HasDefaultValueSql("('')"); + entity.Property(e => e.GatewaySupportsEmail).HasDefaultValueSql("((0))"); + entity.Property(e => e.GatewaySupportsHtmltext).HasDefaultValueSql("((0))"); + entity.Property(e => e.GatewaySupportsPlainText).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubscriptionEventDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.SubscriptionSiteId).HasDefaultValueSql("((0))"); + entity.Property(e => e.SubscriptionUseHtml).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.SubscriptionGateway).WithMany(p => p.NotificationSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_Subscription_SubscriptionGatewayID_Notification_Gateway"); + + entity.HasOne(d => d.SubscriptionSite).WithMany(p => p.NotificationSubscriptions).HasConstraintName("FK_Notification_Subscription_SubscriptionSiteID_CMS_Site"); + + entity.HasOne(d => d.SubscriptionTemplate).WithMany(p => p.NotificationSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_Subscription_SubscriptionTemplateID_Notification_Template"); + + entity.HasOne(d => d.SubscriptionUser).WithMany(p => p.NotificationSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_Subscription_SubscriptionUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TemplateId).IsClustered(false); + + entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Notification_Template_TemplateSiteID_TemplateDisplayName").IsClustered(); + + entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TemplateSite).WithMany(p => p.NotificationTemplates).HasConstraintName("FK_Notification_Template_TemplateSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Gateway).WithMany(p => p.NotificationTemplateTexts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_TemplateText_GatewayID_Notification_Gateway"); + + entity.HasOne(d => d.Template).WithMany(p => p.NotificationTemplateTexts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Notification_TemplateText_TemplateID_Notification_Template"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AbtestDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.AbtestIncludedTraffic).HasDefaultValueSql("((100))"); + entity.Property(e => e.AbtestName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AbtestOriginalPage).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AbtestSite).WithMany(p => p.OmAbtests) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABTest_SiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AbvariantDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.AbvariantName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AbvariantSite).WithMany(p => p.OmAbvariants) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABVariant_CMS_Site"); + + entity.HasOne(d => d.AbvariantTest).WithMany(p => p.OmAbvariants) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABVariant_ABVariantTestID_OM_ABTest"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AbvariantDisplayName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AbvariantTest).WithMany(p => p.OmAbvariantData) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABVariantData_ABVariantTestID_OM_ABTest"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AccountCountry).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_Country"); + + entity.HasOne(d => d.AccountOwnerUser).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_User"); + + entity.HasOne(d => d.AccountPrimaryContact).WithMany(p => p.OmAccountAccountPrimaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_PrimaryContact"); + + entity.HasOne(d => d.AccountSecondaryContact).WithMany(p => p.OmAccountAccountSecondaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_SecondaryContact"); + + entity.HasOne(d => d.AccountState).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_State"); + + entity.HasOne(d => d.AccountStatus).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_OM_AccountStatus"); + + entity.HasOne(d => d.AccountSubsidiaryOf).WithMany(p => p.InverseAccountSubsidiaryOf).HasConstraintName("FK_OM_Account_OM_Account_SubsidiaryOf"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Account).WithMany(p => p.OmAccountContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_AccountContact_OM_Account"); + + entity.HasOne(d => d.Contact).WithMany(p => p.OmAccountContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_AccountContact_OM_Contact"); + + entity.HasOne(d => d.ContactRole).WithMany(p => p.OmAccountContacts).HasConstraintName("FK_OM_AccountContact_OM_ContactRole"); + }); + + modelBuilder.Entity(entity => entity.HasIndex(e => e.ActivityCampaign, "IX_OM_Activity_ActivityCampaign") + .HasFilter("([ActivityCampaign] IS NOT NULL)") + .HasFillFactor(90)); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ActivityTypeEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ActivityTypeIsCustom).HasDefaultValueSql("((1))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactCreated).HasDefaultValueSql("('5/3/2011 10:51:13 AM')"); + entity.Property(e => e.ContactMonitored).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactSalesForceLeadReplicationDisabled).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactSalesForceLeadReplicationRequired).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ContactCountry).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_Country"); + + entity.HasOne(d => d.ContactOwnerUser).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_User"); + + entity.HasOne(d => d.ContactState).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_State"); + + entity.HasOne(d => d.ContactStatus).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_OM_ContactStatus"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ContactGroupId).HasName("PK_CMS_ContactGroup"); + + entity.Property(e => e.ContactGroupName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactGroupMemberFromCondition).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactGroupMemberFromManual).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ContactGroupMemberContactGroup).WithMany(p => p.OmContactGroupMembers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ContactGroupMembers_OM_ContactGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactRoleDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContactRoleName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactStatusDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContactStatusName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.Contact).WithMany(p => p.OmMemberships) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_Membership_OM_Contact")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MvtcombinationIsDefault).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Mvtvariants).WithMany(p => p.Mvtcombinations) + .UsingEntity>( + "OmMvtcombinationVariation", + r => r.HasOne().WithMany() + .HasForeignKey("MvtvariantId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_MVTCombinationVariation_OM_MVTVariant"), + l => l.HasOne().WithMany() + .HasForeignKey("MvtcombinationId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_MVTCombinationVariation_OM_MVTCombination"), + j => + { + j.HasKey("MvtcombinationId", "MvtvariantId"); + j.ToTable("OM_MVTCombinationVariation"); + j.HasIndex(new[] { "MvtvariantId" }, "IX_OM_MVTCombinationVariation_MVTVariantID"); + j.IndexerProperty("MvtcombinationId").HasColumnName("MVTCombinationID"); + j.IndexerProperty("MvtvariantId").HasColumnName("MVTVariantID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MvtestDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.MvtestName).HasDefaultValueSql("('')"); + entity.Property(e => e.MvtestPage).HasDefaultValueSql("('')"); + entity.Property(e => e.MvtestTargetConversionType).HasDefaultValueSql("('TOTAL')"); + + entity.HasOne(d => d.MvtestSite).WithMany(p => p.OmMvtests) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_MVTest_MVTestSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MvtvariantEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MvtvariantName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.MvtvariantPageTemplate).WithMany(p => p.OmMvtvariants) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_MVTVariant_MVTVariantPageTemplateID_CMS_PageTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.VariantDisplayCondition).HasDefaultValueSql("('')"); + entity.Property(e => e.VariantDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.VariantEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.VariantName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.VariantDocument).WithMany(p => p.OmPersonalizationVariants).HasConstraintName("FK_OM_PersonalizationVariant_VariantDocumentID_CMS_Document"); + + entity.HasOne(d => d.VariantPageTemplate).WithMany(p => p.OmPersonalizationVariants) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_PersonalizationVariant_VariantPageTemplateID_CMS_PageTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.RuleDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.RuleName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); + entity.Property(e => e.RuleType).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.RuleScore).WithMany(p => p.OmRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_Rule_OM_Score"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Contact).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Contact"); + + entity.HasOne(d => d.Rule).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Rule"); + + entity.HasOne(d => d.Score).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Score"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.VisitorToContactContact).WithMany(p => p.OmVisitorToContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_VisitorToContact_OM_Contact_Cascade")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PersonaDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PersonaEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PersonaName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); + entity.Property(e => e.PersonaPointsThreshold).HasDefaultValueSql("((100))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PersonaContactHistoryDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.PersonaContactHistoryPersona).WithMany(p => p.PersonasPersonaContactHistories).HasConstraintName("FK_Personas_PersonaContactHistory_Personas_Persona"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.Node).WithMany(p => p.PersonasPersonaNodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Personas_PersonaNode_CMS_Tree")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PollId).IsClustered(false); + + entity.HasIndex(e => new { e.PollSiteId, e.PollDisplayName }, "IX_Polls_Poll_PollSiteID_PollDisplayName").IsClustered(); + + entity.Property(e => e.PollCodeName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PollDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PollQuestion).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PollResponseMessage).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PollTitle).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PollGroup).WithMany(p => p.PollsPolls).HasConstraintName("FK_Polls_Poll_PollGroupID_Community_Group"); + + entity.HasOne(d => d.PollSite).WithMany(p => p.PollsPolls).HasConstraintName("FK_Polls_Poll_PollSiteID_CMS_Site"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Polls) + .UsingEntity>( + "PollsPollRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollRoles_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("PollId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollRoles_PollID_Polls_Poll"), + j => + { + j.HasKey("PollId", "RoleId"); + j.ToTable("Polls_PollRoles"); + j.HasIndex(new[] { "RoleId" }, "IX_Polls_PollRoles_RoleID"); + j.IndexerProperty("PollId").HasColumnName("PollID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + + entity.HasMany(d => d.Sites).WithMany(p => p.Polls) + .UsingEntity>( + "PollsPollSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("PollId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollSite_PollID_Polls_Poll"), + j => + { + j.HasKey("PollId", "SiteId"); + j.ToTable("Polls_PollSite"); + j.HasIndex(new[] { "SiteId" }, "IX_Polls_PollSite_SiteID"); + j.IndexerProperty("PollId").HasColumnName("PollID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AnswerId).IsClustered(false); + + entity.HasIndex(e => new { e.AnswerOrder, e.AnswerPollId, e.AnswerEnabled }, "IX_Polls_PollAnswer_AnswerPollID_AnswerOrder_AnswerEnabled").IsClustered(); + + entity.Property(e => e.AnswerHideForm).HasDefaultValueSql("((0))"); + entity.Property(e => e.AnswerText).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AnswerPoll).WithMany(p => p.PollsPollAnswers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Polls_PollAnswer_AnswerPollID_Polls_Poll"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ReportId).IsClustered(false); + + entity.HasIndex(e => new { e.ReportDisplayName, e.ReportCategoryId }, "IX_Reporting_Report_ReportCategoryID_ReportDisplayName").IsClustered(); + + entity.Property(e => e.ReportAccess).HasDefaultValueSql("((1))"); + entity.Property(e => e.ReportDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportEnableSubscription).HasDefaultValueSql("((0))"); + entity.Property(e => e.ReportName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ReportCategory).WithMany(p => p.ReportingReports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_Report_ReportCategoryID_Reporting_ReportCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_Reporting_ReportCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_Reporting_ReportCategory_CategoryID_Reporting_ReportCategory_ParentCategoryID"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.GraphReport).WithMany(p => p.ReportingReportGraphs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportGraph_GraphReportID_Reporting_Report")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ReportSubscriptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ReportSubscriptionInterval).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportSubscriptionLastModified).HasDefaultValueSql("('3/9/2012 11:17:19 AM')"); + entity.Property(e => e.ReportSubscriptionOnlyNonEmpty).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.ReportSubscriptionGraph).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionGraphID_Reporting_ReportGraph"); + + entity.HasOne(d => d.ReportSubscriptionReport).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionReportID_Reporting_Report"); + + entity.HasOne(d => d.ReportSubscriptionSite).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionSiteID_CMS_Site"); + + entity.HasOne(d => d.ReportSubscriptionTable).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionTableID_Reporting_ReportTable"); + + entity.HasOne(d => d.ReportSubscriptionUser).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionUserID_CMS_User"); + + entity.HasOne(d => d.ReportSubscriptionValue).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionValueID_Reporting_ReportValue"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.TableReport).WithMany(p => p.ReportingReportTables) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportTable_TableReportID_Reporting_Report")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.ValueReport).WithMany(p => p.ReportingReportValues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportValue_ValueReportID_Reporting_Report")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SavedGraphSavedReport).WithMany(p => p.ReportingSavedGraphs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_SavedGraph_SavedGraphSavedReportID_Reporting_SavedReport")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SavedReportId).IsClustered(false); + + entity.HasIndex(e => new { e.SavedReportReportId, e.SavedReportDate }, "IX_Reporting_SavedReport_SavedReportReportID_SavedReportDate") + .IsDescending(false, true) + .IsClustered(); + + entity.HasOne(d => d.SavedReportCreatedByUser).WithMany(p => p.ReportingSavedReports).HasConstraintName("FK_Reporting_SavedReport_SavedReportCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.SavedReportReport).WithMany(p => p.ReportingSavedReports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_SavedReport_SavedReportReportID_Reporting_Report"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SharePointConnectionAuthMode).HasDefaultValueSql("(N'default')"); + entity.Property(e => e.SharePointConnectionSharePointVersion).HasDefaultValueSql("(N'sp2010')"); + + entity.HasOne(d => d.SharePointConnectionSite).WithMany(p => p.SharePointSharePointConnections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointConnection_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SharePointFileEtag).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileExtension).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileMimeType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileServerRelativeUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SharePointFileSharePointLibrary).WithMany(p => p.SharePointSharePointFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointFile_SharePoint_SharePointLibrary"); + + entity.HasOne(d => d.SharePointFileSite).WithMany(p => p.SharePointSharePointFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointFile_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SharePointLibraryDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibraryLastModified).HasDefaultValueSql("('10/3/2014 2:45:04 PM')"); + entity.Property(e => e.SharePointLibraryListTitle).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibraryName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibrarySharePointConnectionId).HasDefaultValueSql("((0))"); + entity.Property(e => e.SharePointLibrarySynchronizationPeriod).HasDefaultValueSql("((720))"); + + entity.HasOne(d => d.SharePointLibrarySharePointConnection).WithMany(p => p.SharePointSharePointLibraries).HasConstraintName("FK_SharePoint_SharePointLibrary_SharePoint_SharePointConnection"); + + entity.HasOne(d => d.SharePointLibrarySite).WithMany(p => p.SharePointSharePointLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointLibrary_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookAccountPageAccessToken).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookAccountPageId).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FacebookAccountFacebookApplication).WithMany(p => p.SmFacebookAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookAccount_SM_FacebookApplication"); + + entity.HasOne(d => d.FacebookAccountSite).WithMany(p => p.SmFacebookAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookAccount_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookApplicationConsumerKey).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookApplicationConsumerSecret).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookApplicationLastModified).HasDefaultValueSql("('5/28/2013 1:02:36 PM')"); + + entity.HasOne(d => d.FacebookApplicationSite).WithMany(p => p.SmFacebookApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookPostIsCreatedByUser).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.FacebookPostFacebookAccount).WithMany(p => p.SmFacebookPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookPost_SM_FacebookAccount"); + + entity.HasOne(d => d.FacebookPostSite).WithMany(p => p.SmFacebookPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookPost_CMS_Site"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.InsightExternalId).HasDefaultValueSql("('')")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitDays).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitMonths).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitWeeks).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitYears).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInAccountAccessToken).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountProfileId).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInApplicationConsumerKey).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationConsumerSecret).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.LinkedInApplicationSite).WithMany(p => p.SmLinkedInApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInPostComment).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInPostIsCreatedByUser).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.LinkedInPostLinkedInAccount).WithMany(p => p.SmLinkedInPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInPost_SM_LinkedInAccount"); + + entity.HasOne(d => d.LinkedInPostSite).WithMany(p => p.SmLinkedInPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInPost_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterAccountAccessToken).HasDefaultValueSql("('')"); + entity.Property(e => e.TwitterAccountAccessTokenSecret).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterAccountSite).WithMany(p => p.SmTwitterAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterAccount_CMS_Site"); + + entity.HasOne(d => d.TwitterAccountTwitterApplication).WithMany(p => p.SmTwitterAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterAccount_SM_TwitterApplication"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterApplicationConsumerKey).HasDefaultValueSql("('')"); + entity.Property(e => e.TwitterApplicationConsumerSecret).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterApplicationSite).WithMany(p => p.SmTwitterApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterPostIsCreatedByUser).HasDefaultValueSql("((1))"); + entity.Property(e => e.TwitterPostText).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterPostSite).WithMany(p => p.SmTwitterPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterPost_CMS_Site"); + + entity.HasOne(d => d.TwitterPostTwitterAccount).WithMany(p => p.SmTwitterPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterPost_SM_TwitterAccount"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ServerId).IsClustered(false); + + entity.HasIndex(e => new { e.ServerSiteId, e.ServerDisplayName }, "IX_Staging_Server_ServerSiteID_ServerDisplayName").IsClustered(); + + entity.Property(e => e.ServerAuthentication).HasDefaultValueSql("('USERNAME')"); + entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ServerEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ServerName).HasDefaultValueSql("('')"); + entity.Property(e => e.ServerUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ServerSite).WithMany(p => p.StagingServers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Server_ServerSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SynchronizationServer).WithMany(p => p.StagingSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Synchronization_SynchronizationServerID_Staging_Server"); + + entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.StagingSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Synchronization_SynchronizationTaskID_Staging_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskServers).HasDefaultValueSql("('null')"); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.StagingTasks).HasConstraintName("FK_Staging_Task_TaskSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.TaskGroupCodeName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupTask_Staging_TaskGroup"); + + entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskGroupTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupTask_Staging_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupUser_Staging_TaskGroup"); + + entity.HasOne(d => d.User).WithOne(p => p.StagingTaskGroupUser) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupUser_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskUser_StagingTask"); + + entity.HasOne(d => d.User).WithMany(p => p.StagingTaskUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskUser_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FileDirectory).HasDefaultValueSql("('')"); + entity.Property(e => e.FileExtension).HasDefaultValueSql("('')"); + entity.Property(e => e.FileLastModified).HasDefaultValueSql("('6/29/2010 1:57:54 PM')"); + entity.Property(e => e.FileMimeType).HasDefaultValueSql("('')"); + entity.Property(e => e.FileName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.PageBuilderWidgetsLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')")); + + modelBuilder.Entity(entity => entity.ToView("View_Boards_BoardMessage_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ACLItem_ItemsAndOperators")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ObjectVersionHistoryUser_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_PageTemplateCategoryPageTemplate_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_Relationship_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ResourceString_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ResourceTranslated_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_RoleResourcePermission_Joined")); + + modelBuilder.Entity(entity => + { + entity.ToView("View_CMS_Site_DocumentCount"); + + entity.Property(e => e.SiteId).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_SiteRoleResourceUIElement_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_Tree_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_User")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserDocuments")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRole_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRoleMembershipRole")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRole_MembershipRole_ValidOnly_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserSettingsRole_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_WebPartCategoryWebpart_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_WidgetCategoryWidget_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_COM_SKUOptionCategory_OptionCategory_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Community_Group")); + + modelBuilder.Entity(entity => entity.ToView("View_Community_Member")); + + modelBuilder.Entity(entity => entity.ToView("View_Forums_GroupForumPost_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Integration_Task_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Membership_MembershipUser_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Newsletter_Subscriptions_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_AccountContact_AccountJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_AccountContact_ContactJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_Account_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_ContactGroupMember_AccountJoined")); + + modelBuilder.Entity(entity => + { + entity.ToView("View_Poll_AnswerCount"); + + entity.Property(e => e.PollId).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(entity => entity.ToView("View_Reporting_CategoryReport_Joined")); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); +} diff --git a/Migration.Toolkit.KX12/ContextCustomizations.cs b/Migration.Toolkit.KX12/ContextCustomizations.cs index 6d322907..7b08134e 100644 --- a/Migration.Toolkit.KX12/ContextCustomizations.cs +++ b/Migration.Toolkit.KX12/ContextCustomizations.cs @@ -1,14 +1,14 @@ -namespace Migration.Toolkit.KX12.Context; - -using Microsoft.EntityFrameworkCore; - -public partial class KX12Context -{ - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - optionsBuilder - .EnableDetailedErrors() - .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); - base.OnConfiguring(optionsBuilder); - } -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Context; + +public partial class KX12Context +{ + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder + .EnableDetailedErrors() + .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); + base.OnConfiguring(optionsBuilder); + } +} diff --git a/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs b/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs index 7a47a4ec..7e410fd6 100644 --- a/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.KX12/DependencyInjectionExtensions.cs @@ -1,15 +1,16 @@ -namespace Migration.Toolkit.KX12; - -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.KX12.Context; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKx12DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) - { - services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); - return services; - } -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Toolkit.Common; +using Migration.Toolkit.KX12.Context; + +namespace Migration.Toolkit.KX12; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKx12DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) + { + services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); + return services; + } +} diff --git a/Migration.Toolkit.KX12/Migration.Toolkit.KX12.csproj b/Migration.Toolkit.KX12/Migration.Toolkit.KX12.csproj index 3e658597..56298471 100644 --- a/Migration.Toolkit.KX12/Migration.Toolkit.KX12.csproj +++ b/Migration.Toolkit.KX12/Migration.Toolkit.KX12.csproj @@ -16,27 +16,27 @@ - + - + all runtime; build; native; contentfiles; analyzers; buildtransitive - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive - + - + diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs index e73fc1f4..0106a03b 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaign.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_Campaign")] -[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] -[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] -public partial class AnalyticsCampaign -{ - [Key] - [Column("CampaignID")] - public int CampaignId { get; set; } - - [StringLength(200)] - public string CampaignName { get; set; } = null!; - - [StringLength(100)] - public string CampaignDisplayName { get; set; } = null!; - - public string? CampaignDescription { get; set; } - - [Column("CampaignSiteID")] - public int CampaignSiteId { get; set; } - - public DateTime? CampaignOpenFrom { get; set; } - - public DateTime? CampaignOpenTo { get; set; } - - [Column("CampaignGUID")] - public Guid CampaignGuid { get; set; } - - public DateTime CampaignLastModified { get; set; } - - [Column("CampaignUTMCode")] - [StringLength(200)] - public string? CampaignUtmcode { get; set; } - - public DateTime? CampaignCalculatedTo { get; set; } - - [Column("CampaignScheduledTaskID")] - public int? CampaignScheduledTaskId { get; set; } - - public int? CampaignVisitors { get; set; } - - [InverseProperty("CampaignAssetCampaign")] - public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); - - [InverseProperty("CampaignConversionCampaign")] - public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaign")] - public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } - - [ForeignKey("CampaignScheduledTaskId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } - - [ForeignKey("CampaignSiteId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsSite CampaignSite { get; set; } = null!; - - [InverseProperty("FacebookPostCampaign")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInPostCampaign")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterPostCampaign")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_Campaign")] +[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] +[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] +public class AnalyticsCampaign +{ + [Key] + [Column("CampaignID")] + public int CampaignId { get; set; } + + [StringLength(200)] + public string CampaignName { get; set; } = null!; + + [StringLength(100)] + public string CampaignDisplayName { get; set; } = null!; + + public string? CampaignDescription { get; set; } + + [Column("CampaignSiteID")] + public int CampaignSiteId { get; set; } + + public DateTime? CampaignOpenFrom { get; set; } + + public DateTime? CampaignOpenTo { get; set; } + + [Column("CampaignGUID")] + public Guid CampaignGuid { get; set; } + + public DateTime CampaignLastModified { get; set; } + + [Column("CampaignUTMCode")] + [StringLength(200)] + public string? CampaignUtmcode { get; set; } + + public DateTime? CampaignCalculatedTo { get; set; } + + [Column("CampaignScheduledTaskID")] + public int? CampaignScheduledTaskId { get; set; } + + public int? CampaignVisitors { get; set; } + + [InverseProperty("CampaignAssetCampaign")] + public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); + + [InverseProperty("CampaignConversionCampaign")] + public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaign")] + public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } + + [ForeignKey("CampaignScheduledTaskId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } + + [ForeignKey("CampaignSiteId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsSite CampaignSite { get; set; } = null!; + + [InverseProperty("FacebookPostCampaign")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInPostCampaign")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterPostCampaign")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs index e7fd055d..23c7a47d 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAsset.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignAsset")] -[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] -public partial class AnalyticsCampaignAsset -{ - [Key] - [Column("CampaignAssetID")] - public int CampaignAssetId { get; set; } - - public Guid CampaignAssetGuid { get; set; } - - public DateTime CampaignAssetLastModified { get; set; } - - public Guid CampaignAssetAssetGuid { get; set; } - - [Column("CampaignAssetCampaignID")] - public int CampaignAssetCampaignId { get; set; } - - [StringLength(200)] - public string CampaignAssetType { get; set; } = null!; - - [InverseProperty("CampaignAssetUrlCampaignAsset")] - public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); - - [ForeignKey("CampaignAssetCampaignId")] - [InverseProperty("AnalyticsCampaignAssets")] - public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_CampaignAsset")] +[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] +public class AnalyticsCampaignAsset +{ + [Key] + [Column("CampaignAssetID")] + public int CampaignAssetId { get; set; } + + public Guid CampaignAssetGuid { get; set; } + + public DateTime CampaignAssetLastModified { get; set; } + + public Guid CampaignAssetAssetGuid { get; set; } + + [Column("CampaignAssetCampaignID")] + public int CampaignAssetCampaignId { get; set; } + + [StringLength(200)] + public string CampaignAssetType { get; set; } = null!; + + [InverseProperty("CampaignAssetUrlCampaignAsset")] + public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); + + [ForeignKey("CampaignAssetCampaignId")] + [InverseProperty("AnalyticsCampaignAssets")] + public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs index 438936c1..0df35d2b 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignAssetUrl.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignAssetUrl")] -[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] -public partial class AnalyticsCampaignAssetUrl -{ - [Key] - [Column("CampaignAssetUrlID")] - public int CampaignAssetUrlId { get; set; } - - public Guid CampaignAssetUrlGuid { get; set; } - - public string CampaignAssetUrlTarget { get; set; } = null!; - - [StringLength(200)] - public string CampaignAssetUrlPageTitle { get; set; } = null!; - - [Column("CampaignAssetUrlCampaignAssetID")] - public int CampaignAssetUrlCampaignAssetId { get; set; } - - [ForeignKey("CampaignAssetUrlCampaignAssetId")] - [InverseProperty("AnalyticsCampaignAssetUrls")] - public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_CampaignAssetUrl")] +[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] +public class AnalyticsCampaignAssetUrl +{ + [Key] + [Column("CampaignAssetUrlID")] + public int CampaignAssetUrlId { get; set; } + + public Guid CampaignAssetUrlGuid { get; set; } + + public string CampaignAssetUrlTarget { get; set; } = null!; + + [StringLength(200)] + public string CampaignAssetUrlPageTitle { get; set; } = null!; + + [Column("CampaignAssetUrlCampaignAssetID")] + public int CampaignAssetUrlCampaignAssetId { get; set; } + + [ForeignKey("CampaignAssetUrlCampaignAssetId")] + [InverseProperty("AnalyticsCampaignAssetUrls")] + public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs index 7107488b..7442bf5d 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversion.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignConversion")] -[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] -public partial class AnalyticsCampaignConversion -{ - [Key] - [Column("CampaignConversionID")] - public int CampaignConversionId { get; set; } - - public Guid CampaignConversionGuid { get; set; } - - public DateTime CampaignConversionLastModified { get; set; } - - [StringLength(100)] - public string CampaignConversionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string CampaignConversionName { get; set; } = null!; - - [Column("CampaignConversionCampaignID")] - public int CampaignConversionCampaignId { get; set; } - - public int CampaignConversionOrder { get; set; } - - [StringLength(250)] - public string CampaignConversionActivityType { get; set; } = null!; - - public int CampaignConversionHits { get; set; } - - [Column("CampaignConversionItemID")] - public int? CampaignConversionItemId { get; set; } - - public double CampaignConversionValue { get; set; } - - public bool CampaignConversionIsFunnelStep { get; set; } - - [Column("CampaignConversionURL")] - public string? CampaignConversionUrl { get; set; } - - [InverseProperty("CampaignConversionHitsConversion")] - public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaignConversion")] - public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); - - [ForeignKey("CampaignConversionCampaignId")] - [InverseProperty("AnalyticsCampaignConversions")] - public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_CampaignConversion")] +[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] +public class AnalyticsCampaignConversion +{ + [Key] + [Column("CampaignConversionID")] + public int CampaignConversionId { get; set; } + + public Guid CampaignConversionGuid { get; set; } + + public DateTime CampaignConversionLastModified { get; set; } + + [StringLength(100)] + public string CampaignConversionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string CampaignConversionName { get; set; } = null!; + + [Column("CampaignConversionCampaignID")] + public int CampaignConversionCampaignId { get; set; } + + public int CampaignConversionOrder { get; set; } + + [StringLength(250)] + public string CampaignConversionActivityType { get; set; } = null!; + + public int CampaignConversionHits { get; set; } + + [Column("CampaignConversionItemID")] + public int? CampaignConversionItemId { get; set; } + + public double CampaignConversionValue { get; set; } + + public bool CampaignConversionIsFunnelStep { get; set; } + + [Column("CampaignConversionURL")] + public string? CampaignConversionUrl { get; set; } + + [InverseProperty("CampaignConversionHitsConversion")] + public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaignConversion")] + public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); + + [ForeignKey("CampaignConversionCampaignId")] + [InverseProperty("AnalyticsCampaignConversions")] + public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs index c7b6ed4c..2caee981 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignConversionHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignConversionHits")] -[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] -public partial class AnalyticsCampaignConversionHit -{ - [Key] - [Column("CampaignConversionHitsID")] - public int CampaignConversionHitsId { get; set; } - - [Column("CampaignConversionHitsConversionID")] - public int CampaignConversionHitsConversionId { get; set; } - - public int CampaignConversionHitsCount { get; set; } - - [StringLength(200)] - public string CampaignConversionHitsSourceName { get; set; } = null!; - - [StringLength(200)] - public string? CampaignConversionHitsContentName { get; set; } - - [ForeignKey("CampaignConversionHitsConversionId")] - [InverseProperty("AnalyticsCampaignConversionHits")] - public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_CampaignConversionHits")] +[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] +public class AnalyticsCampaignConversionHit +{ + [Key] + [Column("CampaignConversionHitsID")] + public int CampaignConversionHitsId { get; set; } + + [Column("CampaignConversionHitsConversionID")] + public int CampaignConversionHitsConversionId { get; set; } + + public int CampaignConversionHitsCount { get; set; } + + [StringLength(200)] + public string CampaignConversionHitsSourceName { get; set; } = null!; + + [StringLength(200)] + public string? CampaignConversionHitsContentName { get; set; } + + [ForeignKey("CampaignConversionHitsConversionId")] + [InverseProperty("AnalyticsCampaignConversionHits")] + public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs index 9bf23a8d..1144bba1 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsCampaignObjective.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_CampaignObjective")] -[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] -[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] -public partial class AnalyticsCampaignObjective -{ - [Key] - [Column("CampaignObjectiveID")] - public int CampaignObjectiveId { get; set; } - - public Guid CampaignObjectiveGuid { get; set; } - - public DateTime CampaignObjectiveLastModified { get; set; } - - [Column("CampaignObjectiveCampaignID")] - public int CampaignObjectiveCampaignId { get; set; } - - public int? CampaignObjectiveValue { get; set; } - - [Column("CampaignObjectiveCampaignConversionID")] - public int CampaignObjectiveCampaignConversionId { get; set; } - - [ForeignKey("CampaignObjectiveCampaignId")] - [InverseProperty("AnalyticsCampaignObjective")] - public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; - - [ForeignKey("CampaignObjectiveCampaignConversionId")] - [InverseProperty("AnalyticsCampaignObjectives")] - public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_CampaignObjective")] +[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] +[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] +public class AnalyticsCampaignObjective +{ + [Key] + [Column("CampaignObjectiveID")] + public int CampaignObjectiveId { get; set; } + + public Guid CampaignObjectiveGuid { get; set; } + + public DateTime CampaignObjectiveLastModified { get; set; } + + [Column("CampaignObjectiveCampaignID")] + public int CampaignObjectiveCampaignId { get; set; } + + public int? CampaignObjectiveValue { get; set; } + + [Column("CampaignObjectiveCampaignConversionID")] + public int CampaignObjectiveCampaignConversionId { get; set; } + + [ForeignKey("CampaignObjectiveCampaignId")] + [InverseProperty("AnalyticsCampaignObjective")] + public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; + + [ForeignKey("CampaignObjectiveCampaignConversionId")] + [InverseProperty("AnalyticsCampaignObjectives")] + public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs b/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs index 50c210aa..360bcee8 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsConversion.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_Conversion")] -[Index("ConversionSiteId", Name = "IX_Analytics_Conversion_ConversionSiteID")] -public partial class AnalyticsConversion -{ - [Key] - [Column("ConversionID")] - public int ConversionId { get; set; } - - [StringLength(200)] - public string ConversionName { get; set; } = null!; - - [StringLength(200)] - public string ConversionDisplayName { get; set; } = null!; - - public string? ConversionDescription { get; set; } - - [Column("ConversionGUID")] - public Guid ConversionGuid { get; set; } - - public DateTime ConversionLastModified { get; set; } - - [Column("ConversionSiteID")] - public int ConversionSiteId { get; set; } - - [ForeignKey("ConversionSiteId")] - [InverseProperty("AnalyticsConversions")] - public virtual CmsSite ConversionSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_Conversion")] +[Index("ConversionSiteId", Name = "IX_Analytics_Conversion_ConversionSiteID")] +public class AnalyticsConversion +{ + [Key] + [Column("ConversionID")] + public int ConversionId { get; set; } + + [StringLength(200)] + public string ConversionName { get; set; } = null!; + + [StringLength(200)] + public string ConversionDisplayName { get; set; } = null!; + + public string? ConversionDescription { get; set; } + + [Column("ConversionGUID")] + public Guid ConversionGuid { get; set; } + + public DateTime ConversionLastModified { get; set; } + + [Column("ConversionSiteID")] + public int ConversionSiteId { get; set; } + + [ForeignKey("ConversionSiteId")] + [InverseProperty("AnalyticsConversions")] + public virtual CmsSite ConversionSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs index 9ac49fc6..8c43e292 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsDayHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_DayHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] -public partial class AnalyticsDayHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsDayHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_DayHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] +public class AnalyticsDayHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsDayHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs b/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs index bc8d0a04..e67194d4 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsExitPage.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_ExitPages")] -[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] -public partial class AnalyticsExitPage -{ - [Key] - [StringLength(200)] - public string SessionIdentificator { get; set; } = null!; - - [Column("ExitPageNodeID")] - public int ExitPageNodeId { get; set; } - - public DateTime ExitPageLastModified { get; set; } - - [Column("ExitPageSiteID")] - public int ExitPageSiteId { get; set; } - - [StringLength(10)] - public string? ExitPageCulture { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_ExitPages")] +[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] +public class AnalyticsExitPage +{ + [Key] + [StringLength(200)] + public string SessionIdentificator { get; set; } = null!; + + [Column("ExitPageNodeID")] + public int ExitPageNodeId { get; set; } + + public DateTime ExitPageLastModified { get; set; } + + [Column("ExitPageSiteID")] + public int ExitPageSiteId { get; set; } + + [StringLength(10)] + public string? ExitPageCulture { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs index 731cc103..977f2efb 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsHourHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_HourHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] -public partial class AnalyticsHourHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsHourHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_HourHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] +public class AnalyticsHourHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsHourHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs index 6c2249ee..40e9b0ce 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsMonthHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_MonthHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] -public partial class AnalyticsMonthHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsMonthHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_MonthHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] +public class AnalyticsMonthHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsMonthHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs b/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs index 3c367b89..86f47f59 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsStatistic.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_Statistics")] -[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] -public partial class AnalyticsStatistic -{ - [Key] - [Column("StatisticsID")] - public int StatisticsId { get; set; } - - [Column("StatisticsSiteID")] - public int? StatisticsSiteId { get; set; } - - [StringLength(400)] - public string StatisticsCode { get; set; } = null!; - - [StringLength(450)] - public string? StatisticsObjectName { get; set; } - - [Column("StatisticsObjectID")] - public int? StatisticsObjectId { get; set; } - - [StringLength(10)] - public string? StatisticsObjectCulture { get; set; } - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsDayHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsHourHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsYearHits { get; set; } = new List(); - - [ForeignKey("StatisticsSiteId")] - [InverseProperty("AnalyticsStatistics")] - public virtual CmsSite? StatisticsSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_Statistics")] +[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] +public class AnalyticsStatistic +{ + [Key] + [Column("StatisticsID")] + public int StatisticsId { get; set; } + + [Column("StatisticsSiteID")] + public int? StatisticsSiteId { get; set; } + + [StringLength(400)] + public string StatisticsCode { get; set; } = null!; + + [StringLength(450)] + public string? StatisticsObjectName { get; set; } + + [Column("StatisticsObjectID")] + public int? StatisticsObjectId { get; set; } + + [StringLength(10)] + public string? StatisticsObjectCulture { get; set; } + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsDayHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsHourHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsYearHits { get; set; } = new List(); + + [ForeignKey("StatisticsSiteId")] + [InverseProperty("AnalyticsStatistics")] + public virtual CmsSite? StatisticsSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs index c8cea73a..42ec7702 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsWeekHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_WeekHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] -public partial class AnalyticsWeekHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsWeekHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_WeekHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] +public class AnalyticsWeekHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsWeekHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs b/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs index eabc35dc..583eabdf 100644 --- a/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs +++ b/Migration.Toolkit.KX12/Models/AnalyticsYearHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Analytics_YearHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] -public partial class AnalyticsYearHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsYearHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Analytics_YearHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] +public class AnalyticsYearHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsYearHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/BadWordsWord.cs b/Migration.Toolkit.KX12/Models/BadWordsWord.cs index 4e0a875d..02bcd559 100644 --- a/Migration.Toolkit.KX12/Models/BadWordsWord.cs +++ b/Migration.Toolkit.KX12/Models/BadWordsWord.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("BadWords_Word")] -[Index("WordIsGlobal", Name = "IX_BadWords_Word_WordIsGlobal")] -public partial class BadWordsWord -{ - [Key] - [Column("WordID")] - public int WordId { get; set; } - - [Column("WordGUID")] - public Guid WordGuid { get; set; } - - public DateTime WordLastModified { get; set; } - - [StringLength(200)] - public string WordExpression { get; set; } = null!; - - [StringLength(200)] - public string? WordReplacement { get; set; } - - public int? WordAction { get; set; } - - public bool WordIsGlobal { get; set; } - - public bool WordIsRegularExpression { get; set; } - - public bool? WordMatchWholeWord { get; set; } - - [ForeignKey("WordId")] - [InverseProperty("Words")] - public virtual ICollection Cultures { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("BadWords_Word")] +[Index("WordIsGlobal", Name = "IX_BadWords_Word_WordIsGlobal")] +public class BadWordsWord +{ + [Key] + [Column("WordID")] + public int WordId { get; set; } + + [Column("WordGUID")] + public Guid WordGuid { get; set; } + + public DateTime WordLastModified { get; set; } + + [StringLength(200)] + public string WordExpression { get; set; } = null!; + + [StringLength(200)] + public string? WordReplacement { get; set; } + + public int? WordAction { get; set; } + + public bool WordIsGlobal { get; set; } + + public bool WordIsRegularExpression { get; set; } + + public bool? WordMatchWholeWord { get; set; } + + [ForeignKey("WordId")] + [InverseProperty("Words")] + public virtual ICollection Cultures { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/BlogComment.cs b/Migration.Toolkit.KX12/Models/BlogComment.cs index 5aff6dbc..d71681b3 100644 --- a/Migration.Toolkit.KX12/Models/BlogComment.cs +++ b/Migration.Toolkit.KX12/Models/BlogComment.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Blog_Comment")] -[Index("CommentApprovedByUserId", Name = "IX_Blog_Comment_CommentApprovedByUserID")] -[Index("CommentPostDocumentId", Name = "IX_Blog_Comment_CommentPostDocumentID")] -[Index("CommentUserId", Name = "IX_Blog_Comment_CommentUserID")] -public partial class BlogComment -{ - [Key] - [Column("CommentID")] - public int CommentId { get; set; } - - [StringLength(200)] - public string CommentUserName { get; set; } = null!; - - [Column("CommentUserID")] - public int? CommentUserId { get; set; } - - [StringLength(450)] - public string? CommentUrl { get; set; } - - public string CommentText { get; set; } = null!; - - [Column("CommentApprovedByUserID")] - public int? CommentApprovedByUserId { get; set; } - - [Column("CommentPostDocumentID")] - public int CommentPostDocumentId { get; set; } - - public DateTime CommentDate { get; set; } - - public bool? CommentIsSpam { get; set; } - - public bool? CommentApproved { get; set; } - - [StringLength(254)] - public string? CommentEmail { get; set; } - - public string? CommentInfo { get; set; } - - [Column("CommentGUID")] - public Guid CommentGuid { get; set; } - - [ForeignKey("CommentApprovedByUserId")] - [InverseProperty("BlogCommentCommentApprovedByUsers")] - public virtual CmsUser? CommentApprovedByUser { get; set; } - - [ForeignKey("CommentPostDocumentId")] - [InverseProperty("BlogComments")] - public virtual CmsDocument CommentPostDocument { get; set; } = null!; - - [ForeignKey("CommentUserId")] - [InverseProperty("BlogCommentCommentUsers")] - public virtual CmsUser? CommentUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Blog_Comment")] +[Index("CommentApprovedByUserId", Name = "IX_Blog_Comment_CommentApprovedByUserID")] +[Index("CommentPostDocumentId", Name = "IX_Blog_Comment_CommentPostDocumentID")] +[Index("CommentUserId", Name = "IX_Blog_Comment_CommentUserID")] +public class BlogComment +{ + [Key] + [Column("CommentID")] + public int CommentId { get; set; } + + [StringLength(200)] + public string CommentUserName { get; set; } = null!; + + [Column("CommentUserID")] + public int? CommentUserId { get; set; } + + [StringLength(450)] + public string? CommentUrl { get; set; } + + public string CommentText { get; set; } = null!; + + [Column("CommentApprovedByUserID")] + public int? CommentApprovedByUserId { get; set; } + + [Column("CommentPostDocumentID")] + public int CommentPostDocumentId { get; set; } + + public DateTime CommentDate { get; set; } + + public bool? CommentIsSpam { get; set; } + + public bool? CommentApproved { get; set; } + + [StringLength(254)] + public string? CommentEmail { get; set; } + + public string? CommentInfo { get; set; } + + [Column("CommentGUID")] + public Guid CommentGuid { get; set; } + + [ForeignKey("CommentApprovedByUserId")] + [InverseProperty("BlogCommentCommentApprovedByUsers")] + public virtual CmsUser? CommentApprovedByUser { get; set; } + + [ForeignKey("CommentPostDocumentId")] + [InverseProperty("BlogComments")] + public virtual CmsDocument CommentPostDocument { get; set; } = null!; + + [ForeignKey("CommentUserId")] + [InverseProperty("BlogCommentCommentUsers")] + public virtual CmsUser? CommentUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs b/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs index 33c20d58..b3a54967 100644 --- a/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs +++ b/Migration.Toolkit.KX12/Models/BlogPostSubscription.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Blog_PostSubscription")] -[Index("SubscriptionPostDocumentId", Name = "IX_Blog_PostSubscription_SubscriptionPostDocumentID")] -[Index("SubscriptionUserId", Name = "IX_Blog_PostSubscription_SubscriptionUserID")] -public partial class BlogPostSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionPostDocumentID")] - public int SubscriptionPostDocumentId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string? SubscriptionEmail { get; set; } - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionPostDocumentId")] - [InverseProperty("BlogPostSubscriptions")] - public virtual CmsDocument SubscriptionPostDocument { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("BlogPostSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Blog_PostSubscription")] +[Index("SubscriptionPostDocumentId", Name = "IX_Blog_PostSubscription_SubscriptionPostDocumentID")] +[Index("SubscriptionUserId", Name = "IX_Blog_PostSubscription_SubscriptionUserID")] +public class BlogPostSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionPostDocumentID")] + public int SubscriptionPostDocumentId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string? SubscriptionEmail { get; set; } + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionPostDocumentId")] + [InverseProperty("BlogPostSubscriptions")] + public virtual CmsDocument SubscriptionPostDocument { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("BlogPostSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/BoardBoard.cs b/Migration.Toolkit.KX12/Models/BoardBoard.cs index 29bfce38..7237dba6 100644 --- a/Migration.Toolkit.KX12/Models/BoardBoard.cs +++ b/Migration.Toolkit.KX12/Models/BoardBoard.cs @@ -1,117 +1,116 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Board_Board")] -[Index("BoardDocumentId", "BoardName", Name = "IX_Board_Board_BoardDocumentID_BoardName", IsUnique = true)] -[Index("BoardGroupId", "BoardName", Name = "IX_Board_Board_BoardGroupID_BoardName")] -[Index("BoardSiteId", Name = "IX_Board_Board_BoardSiteID")] -[Index("BoardUserId", "BoardName", Name = "IX_Board_Board_BoardUserID_BoardName")] -public partial class BoardBoard -{ - [Key] - [Column("BoardID")] - public int BoardId { get; set; } - - [StringLength(250)] - public string BoardName { get; set; } = null!; - - [StringLength(250)] - public string BoardDisplayName { get; set; } = null!; - - public string BoardDescription { get; set; } = null!; - - public bool BoardOpened { get; set; } - - public DateTime? BoardOpenedFrom { get; set; } - - public DateTime? BoardOpenedTo { get; set; } - - public bool BoardEnabled { get; set; } - - public int BoardAccess { get; set; } - - public bool BoardModerated { get; set; } - - public bool BoardUseCaptcha { get; set; } - - public int BoardMessages { get; set; } - - public DateTime BoardLastModified { get; set; } - - [Column("BoardGUID")] - public Guid BoardGuid { get; set; } - - [Column("BoardDocumentID")] - public int BoardDocumentId { get; set; } - - [Column("BoardUserID")] - public int? BoardUserId { get; set; } - - [Column("BoardGroupID")] - public int? BoardGroupId { get; set; } - - public DateTime? BoardLastMessageTime { get; set; } - - [StringLength(250)] - public string? BoardLastMessageUserName { get; set; } - - [Column("BoardUnsubscriptionURL")] - [StringLength(450)] - public string? BoardUnsubscriptionUrl { get; set; } - - public bool? BoardRequireEmails { get; set; } - - [Column("BoardSiteID")] - public int BoardSiteId { get; set; } - - public bool BoardEnableSubscriptions { get; set; } - - [Column("BoardBaseURL")] - [StringLength(450)] - public string? BoardBaseUrl { get; set; } - - public bool? BoardLogActivity { get; set; } - - public bool? BoardEnableOptIn { get; set; } - - public bool? BoardSendOptInConfirmation { get; set; } - - [Column("BoardOptInApprovalURL")] - [StringLength(450)] - public string? BoardOptInApprovalUrl { get; set; } - - [ForeignKey("BoardDocumentId")] - [InverseProperty("BoardBoards")] - public virtual CmsDocument BoardDocument { get; set; } = null!; - - [ForeignKey("BoardGroupId")] - [InverseProperty("BoardBoards")] - public virtual CommunityGroup? BoardGroup { get; set; } - - [InverseProperty("MessageBoard")] - public virtual ICollection BoardMessagesNavigation { get; set; } = new List(); - - [ForeignKey("BoardSiteId")] - [InverseProperty("BoardBoards")] - public virtual CmsSite BoardSite { get; set; } = null!; - - [InverseProperty("SubscriptionBoard")] - public virtual ICollection BoardSubscriptions { get; set; } = new List(); - - [ForeignKey("BoardUserId")] - [InverseProperty("BoardBoards")] - public virtual CmsUser? BoardUser { get; set; } - - [ForeignKey("BoardId")] - [InverseProperty("Boards")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("BoardId")] - [InverseProperty("Boards")] - public virtual ICollection Users { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Board_Board")] +[Index("BoardDocumentId", "BoardName", Name = "IX_Board_Board_BoardDocumentID_BoardName", IsUnique = true)] +[Index("BoardGroupId", "BoardName", Name = "IX_Board_Board_BoardGroupID_BoardName")] +[Index("BoardSiteId", Name = "IX_Board_Board_BoardSiteID")] +[Index("BoardUserId", "BoardName", Name = "IX_Board_Board_BoardUserID_BoardName")] +public class BoardBoard +{ + [Key] + [Column("BoardID")] + public int BoardId { get; set; } + + [StringLength(250)] + public string BoardName { get; set; } = null!; + + [StringLength(250)] + public string BoardDisplayName { get; set; } = null!; + + public string BoardDescription { get; set; } = null!; + + public bool BoardOpened { get; set; } + + public DateTime? BoardOpenedFrom { get; set; } + + public DateTime? BoardOpenedTo { get; set; } + + public bool BoardEnabled { get; set; } + + public int BoardAccess { get; set; } + + public bool BoardModerated { get; set; } + + public bool BoardUseCaptcha { get; set; } + + public int BoardMessages { get; set; } + + public DateTime BoardLastModified { get; set; } + + [Column("BoardGUID")] + public Guid BoardGuid { get; set; } + + [Column("BoardDocumentID")] + public int BoardDocumentId { get; set; } + + [Column("BoardUserID")] + public int? BoardUserId { get; set; } + + [Column("BoardGroupID")] + public int? BoardGroupId { get; set; } + + public DateTime? BoardLastMessageTime { get; set; } + + [StringLength(250)] + public string? BoardLastMessageUserName { get; set; } + + [Column("BoardUnsubscriptionURL")] + [StringLength(450)] + public string? BoardUnsubscriptionUrl { get; set; } + + public bool? BoardRequireEmails { get; set; } + + [Column("BoardSiteID")] + public int BoardSiteId { get; set; } + + public bool BoardEnableSubscriptions { get; set; } + + [Column("BoardBaseURL")] + [StringLength(450)] + public string? BoardBaseUrl { get; set; } + + public bool? BoardLogActivity { get; set; } + + public bool? BoardEnableOptIn { get; set; } + + public bool? BoardSendOptInConfirmation { get; set; } + + [Column("BoardOptInApprovalURL")] + [StringLength(450)] + public string? BoardOptInApprovalUrl { get; set; } + + [ForeignKey("BoardDocumentId")] + [InverseProperty("BoardBoards")] + public virtual CmsDocument BoardDocument { get; set; } = null!; + + [ForeignKey("BoardGroupId")] + [InverseProperty("BoardBoards")] + public virtual CommunityGroup? BoardGroup { get; set; } + + [InverseProperty("MessageBoard")] + public virtual ICollection BoardMessagesNavigation { get; set; } = new List(); + + [ForeignKey("BoardSiteId")] + [InverseProperty("BoardBoards")] + public virtual CmsSite BoardSite { get; set; } = null!; + + [InverseProperty("SubscriptionBoard")] + public virtual ICollection BoardSubscriptions { get; set; } = new List(); + + [ForeignKey("BoardUserId")] + [InverseProperty("BoardBoards")] + public virtual CmsUser? BoardUser { get; set; } + + [ForeignKey("BoardId")] + [InverseProperty("Boards")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("BoardId")] + [InverseProperty("Boards")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/BoardMessage.cs b/Migration.Toolkit.KX12/Models/BoardMessage.cs index 7894d01a..8db10c6c 100644 --- a/Migration.Toolkit.KX12/Models/BoardMessage.cs +++ b/Migration.Toolkit.KX12/Models/BoardMessage.cs @@ -1,70 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Board_Message")] -[Index("MessageApprovedByUserId", Name = "IX_Board_Message_MessageApprovedByUserID")] -[Index("MessageApproved", "MessageIsSpam", Name = "IX_Board_Message_MessageApproved_MessageIsSpam")] -[Index("MessageBoardId", "MessageGuid", Name = "IX_Board_Message_MessageBoardID_MessageGUID", IsUnique = true)] -[Index("MessageUserId", Name = "IX_Board_Message_MessageUserID")] -public partial class BoardMessage -{ - [Key] - [Column("MessageID")] - public int MessageId { get; set; } - - [StringLength(250)] - public string MessageUserName { get; set; } = null!; - - public string MessageText { get; set; } = null!; - - [StringLength(254)] - public string MessageEmail { get; set; } = null!; - - [Column("MessageURL")] - [StringLength(450)] - public string MessageUrl { get; set; } = null!; - - public bool MessageIsSpam { get; set; } - - [Column("MessageBoardID")] - public int MessageBoardId { get; set; } - - public bool MessageApproved { get; set; } - - [Column("MessageApprovedByUserID")] - public int? MessageApprovedByUserId { get; set; } - - [Column("MessageUserID")] - public int? MessageUserId { get; set; } - - public string MessageUserInfo { get; set; } = null!; - - [Column("MessageAvatarGUID")] - public Guid? MessageAvatarGuid { get; set; } - - public DateTime MessageInserted { get; set; } - - public DateTime MessageLastModified { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public double? MessageRatingValue { get; set; } - - [ForeignKey("MessageApprovedByUserId")] - [InverseProperty("BoardMessageMessageApprovedByUsers")] - public virtual CmsUser? MessageApprovedByUser { get; set; } - - [ForeignKey("MessageBoardId")] - [InverseProperty("BoardMessagesNavigation")] - public virtual BoardBoard MessageBoard { get; set; } = null!; - - [ForeignKey("MessageUserId")] - [InverseProperty("BoardMessageMessageUsers")] - public virtual CmsUser? MessageUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Board_Message")] +[Index("MessageApprovedByUserId", Name = "IX_Board_Message_MessageApprovedByUserID")] +[Index("MessageApproved", "MessageIsSpam", Name = "IX_Board_Message_MessageApproved_MessageIsSpam")] +[Index("MessageBoardId", "MessageGuid", Name = "IX_Board_Message_MessageBoardID_MessageGUID", IsUnique = true)] +[Index("MessageUserId", Name = "IX_Board_Message_MessageUserID")] +public class BoardMessage +{ + [Key] + [Column("MessageID")] + public int MessageId { get; set; } + + [StringLength(250)] + public string MessageUserName { get; set; } = null!; + + public string MessageText { get; set; } = null!; + + [StringLength(254)] + public string MessageEmail { get; set; } = null!; + + [Column("MessageURL")] + [StringLength(450)] + public string MessageUrl { get; set; } = null!; + + public bool MessageIsSpam { get; set; } + + [Column("MessageBoardID")] + public int MessageBoardId { get; set; } + + public bool MessageApproved { get; set; } + + [Column("MessageApprovedByUserID")] + public int? MessageApprovedByUserId { get; set; } + + [Column("MessageUserID")] + public int? MessageUserId { get; set; } + + public string MessageUserInfo { get; set; } = null!; + + [Column("MessageAvatarGUID")] + public Guid? MessageAvatarGuid { get; set; } + + public DateTime MessageInserted { get; set; } + + public DateTime MessageLastModified { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public double? MessageRatingValue { get; set; } + + [ForeignKey("MessageApprovedByUserId")] + [InverseProperty("BoardMessageMessageApprovedByUsers")] + public virtual CmsUser? MessageApprovedByUser { get; set; } + + [ForeignKey("MessageBoardId")] + [InverseProperty("BoardMessagesNavigation")] + public virtual BoardBoard MessageBoard { get; set; } = null!; + + [ForeignKey("MessageUserId")] + [InverseProperty("BoardMessageMessageUsers")] + public virtual CmsUser? MessageUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/BoardSubscription.cs b/Migration.Toolkit.KX12/Models/BoardSubscription.cs index 6fffd986..9c53ab06 100644 --- a/Migration.Toolkit.KX12/Models/BoardSubscription.cs +++ b/Migration.Toolkit.KX12/Models/BoardSubscription.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Board_Subscription")] -[Index("SubscriptionBoardId", Name = "IX_Board_Subscription_SubscriptionBoardID")] -[Index("SubscriptionUserId", Name = "IX_Board_Subscription_SubscriptionUserID")] -public partial class BoardSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionBoardID")] - public int SubscriptionBoardId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string SubscriptionEmail { get; set; } = null!; - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionBoardId")] - [InverseProperty("BoardSubscriptions")] - public virtual BoardBoard SubscriptionBoard { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("BoardSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Board_Subscription")] +[Index("SubscriptionBoardId", Name = "IX_Board_Subscription_SubscriptionBoardID")] +[Index("SubscriptionUserId", Name = "IX_Board_Subscription_SubscriptionUserID")] +public class BoardSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionBoardID")] + public int SubscriptionBoardId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string SubscriptionEmail { get; set; } = null!; + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionBoardId")] + [InverseProperty("BoardSubscriptions")] + public virtual BoardBoard SubscriptionBoard { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("BoardSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs b/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs index f58cd3c4..d90ae21b 100644 --- a/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs +++ b/Migration.Toolkit.KX12/Models/ChatInitiatedChatRequest.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_InitiatedChatRequest")] -[Index("InitiatedChatRequestInitiatorChatUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestInitiatorChatUserID")] -[Index("InitiatedChatRequestUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestUserID")] -[Index("InitiatedChatRequestRoomId", Name = "UQ_Chat_InitiatedChatRequest_RoomID", IsUnique = true)] -[Index("InitiatedChatRequestUserId", "InitiatedChatRequestContactId", Name = "UQ_Chat_InitiatedChatRequest_UserIDContactID", IsUnique = true)] -public partial class ChatInitiatedChatRequest -{ - [Key] - [Column("InitiatedChatRequestID")] - public int InitiatedChatRequestId { get; set; } - - [Column("InitiatedChatRequestUserID")] - public int? InitiatedChatRequestUserId { get; set; } - - [Column("InitiatedChatRequestContactID")] - public int? InitiatedChatRequestContactId { get; set; } - - [Column("InitiatedChatRequestRoomID")] - public int InitiatedChatRequestRoomId { get; set; } - - public int InitiatedChatRequestState { get; set; } - - [StringLength(100)] - public string InitiatedChatRequestInitiatorName { get; set; } = null!; - - [Column("InitiatedChatRequestInitiatorChatUserID")] - public int InitiatedChatRequestInitiatorChatUserId { get; set; } - - public DateTime InitiatedChatRequestLastModification { get; set; } - - [ForeignKey("InitiatedChatRequestInitiatorChatUserId")] - [InverseProperty("ChatInitiatedChatRequests")] - public virtual ChatUser InitiatedChatRequestInitiatorChatUser { get; set; } = null!; - - [ForeignKey("InitiatedChatRequestRoomId")] - [InverseProperty("ChatInitiatedChatRequest")] - public virtual ChatRoom InitiatedChatRequestRoom { get; set; } = null!; - - [ForeignKey("InitiatedChatRequestUserId")] - [InverseProperty("ChatInitiatedChatRequests")] - public virtual CmsUser? InitiatedChatRequestUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_InitiatedChatRequest")] +[Index("InitiatedChatRequestInitiatorChatUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestInitiatorChatUserID")] +[Index("InitiatedChatRequestUserId", Name = "IX_Chat_InitiatedChatRequest_InitiatedChatRequestUserID")] +[Index("InitiatedChatRequestRoomId", Name = "UQ_Chat_InitiatedChatRequest_RoomID", IsUnique = true)] +[Index("InitiatedChatRequestUserId", "InitiatedChatRequestContactId", Name = "UQ_Chat_InitiatedChatRequest_UserIDContactID", IsUnique = true)] +public class ChatInitiatedChatRequest +{ + [Key] + [Column("InitiatedChatRequestID")] + public int InitiatedChatRequestId { get; set; } + + [Column("InitiatedChatRequestUserID")] + public int? InitiatedChatRequestUserId { get; set; } + + [Column("InitiatedChatRequestContactID")] + public int? InitiatedChatRequestContactId { get; set; } + + [Column("InitiatedChatRequestRoomID")] + public int InitiatedChatRequestRoomId { get; set; } + + public int InitiatedChatRequestState { get; set; } + + [StringLength(100)] + public string InitiatedChatRequestInitiatorName { get; set; } = null!; + + [Column("InitiatedChatRequestInitiatorChatUserID")] + public int InitiatedChatRequestInitiatorChatUserId { get; set; } + + public DateTime InitiatedChatRequestLastModification { get; set; } + + [ForeignKey("InitiatedChatRequestInitiatorChatUserId")] + [InverseProperty("ChatInitiatedChatRequests")] + public virtual ChatUser InitiatedChatRequestInitiatorChatUser { get; set; } = null!; + + [ForeignKey("InitiatedChatRequestRoomId")] + [InverseProperty("ChatInitiatedChatRequest")] + public virtual ChatRoom InitiatedChatRequestRoom { get; set; } = null!; + + [ForeignKey("InitiatedChatRequestUserId")] + [InverseProperty("ChatInitiatedChatRequests")] + public virtual CmsUser? InitiatedChatRequestUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ChatMessage.cs b/Migration.Toolkit.KX12/Models/ChatMessage.cs index 538997e2..c00deedf 100644 --- a/Migration.Toolkit.KX12/Models/ChatMessage.cs +++ b/Migration.Toolkit.KX12/Models/ChatMessage.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_Message")] -[Index("ChatMessageLastModified", Name = "IX_Chat_Message_ChatMessageLastModified")] -[Index("ChatMessageRecipientId", Name = "IX_Chat_Message_ChatMessageRecipientID")] -[Index("ChatMessageRoomId", Name = "IX_Chat_Message_ChatMessageRoomID")] -[Index("ChatMessageSystemMessageType", Name = "IX_Chat_Message_ChatMessageSystemMessageType")] -[Index("ChatMessageUserId", Name = "IX_Chat_Message_ChatMessageUserID")] -public partial class ChatMessage -{ - [Key] - [Column("ChatMessageID")] - public int ChatMessageId { get; set; } - - public DateTime ChatMessageCreatedWhen { get; set; } - - [Column("ChatMessageIPAddress")] - public string ChatMessageIpaddress { get; set; } = null!; - - [Column("ChatMessageUserID")] - public int? ChatMessageUserId { get; set; } - - [Column("ChatMessageRoomID")] - public int ChatMessageRoomId { get; set; } - - public bool ChatMessageRejected { get; set; } - - public DateTime ChatMessageLastModified { get; set; } - - public string ChatMessageText { get; set; } = null!; - - public int ChatMessageSystemMessageType { get; set; } - - [Column("ChatMessageRecipientID")] - public int? ChatMessageRecipientId { get; set; } - - [ForeignKey("ChatMessageRecipientId")] - [InverseProperty("ChatMessageChatMessageRecipients")] - public virtual ChatUser? ChatMessageRecipient { get; set; } - - [ForeignKey("ChatMessageRoomId")] - [InverseProperty("ChatMessages")] - public virtual ChatRoom ChatMessageRoom { get; set; } = null!; - - [ForeignKey("ChatMessageUserId")] - [InverseProperty("ChatMessageChatMessageUsers")] - public virtual ChatUser? ChatMessageUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_Message")] +[Index("ChatMessageLastModified", Name = "IX_Chat_Message_ChatMessageLastModified")] +[Index("ChatMessageRecipientId", Name = "IX_Chat_Message_ChatMessageRecipientID")] +[Index("ChatMessageRoomId", Name = "IX_Chat_Message_ChatMessageRoomID")] +[Index("ChatMessageSystemMessageType", Name = "IX_Chat_Message_ChatMessageSystemMessageType")] +[Index("ChatMessageUserId", Name = "IX_Chat_Message_ChatMessageUserID")] +public class ChatMessage +{ + [Key] + [Column("ChatMessageID")] + public int ChatMessageId { get; set; } + + public DateTime ChatMessageCreatedWhen { get; set; } + + [Column("ChatMessageIPAddress")] + public string ChatMessageIpaddress { get; set; } = null!; + + [Column("ChatMessageUserID")] + public int? ChatMessageUserId { get; set; } + + [Column("ChatMessageRoomID")] + public int ChatMessageRoomId { get; set; } + + public bool ChatMessageRejected { get; set; } + + public DateTime ChatMessageLastModified { get; set; } + + public string ChatMessageText { get; set; } = null!; + + public int ChatMessageSystemMessageType { get; set; } + + [Column("ChatMessageRecipientID")] + public int? ChatMessageRecipientId { get; set; } + + [ForeignKey("ChatMessageRecipientId")] + [InverseProperty("ChatMessageChatMessageRecipients")] + public virtual ChatUser? ChatMessageRecipient { get; set; } + + [ForeignKey("ChatMessageRoomId")] + [InverseProperty("ChatMessages")] + public virtual ChatRoom ChatMessageRoom { get; set; } = null!; + + [ForeignKey("ChatMessageUserId")] + [InverseProperty("ChatMessageChatMessageUsers")] + public virtual ChatUser? ChatMessageUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ChatNotification.cs b/Migration.Toolkit.KX12/Models/ChatNotification.cs index 18ac0eec..21a4e56c 100644 --- a/Migration.Toolkit.KX12/Models/ChatNotification.cs +++ b/Migration.Toolkit.KX12/Models/ChatNotification.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_Notification")] -[Index("ChatNotificationReceiverId", Name = "IX_Chat_Notification_ChatNotificationReceiverID")] -[Index("ChatNotificationRoomId", Name = "IX_Chat_Notification_ChatNotificationRoomID")] -[Index("ChatNotificationSenderId", Name = "IX_Chat_Notification_ChatNotificationSenderID")] -[Index("ChatNotificationSiteId", Name = "IX_Chat_Notification_ChatNotificationSiteID")] -public partial class ChatNotification -{ - [Key] - [Column("ChatNotificationID")] - public int ChatNotificationId { get; set; } - - [Column("ChatNotificationSenderID")] - public int ChatNotificationSenderId { get; set; } - - [Column("ChatNotificationReceiverID")] - public int ChatNotificationReceiverId { get; set; } - - public bool ChatNotificationIsRead { get; set; } - - public int ChatNotificationType { get; set; } - - [Column("ChatNotificationRoomID")] - public int? ChatNotificationRoomId { get; set; } - - public DateTime ChatNotificationSendDateTime { get; set; } - - public DateTime? ChatNotificationReadDateTime { get; set; } - - [Column("ChatNotificationSiteID")] - public int? ChatNotificationSiteId { get; set; } - - [ForeignKey("ChatNotificationReceiverId")] - [InverseProperty("ChatNotificationChatNotificationReceivers")] - public virtual ChatUser ChatNotificationReceiver { get; set; } = null!; - - [ForeignKey("ChatNotificationRoomId")] - [InverseProperty("ChatNotifications")] - public virtual ChatRoom? ChatNotificationRoom { get; set; } - - [ForeignKey("ChatNotificationSenderId")] - [InverseProperty("ChatNotificationChatNotificationSenders")] - public virtual ChatUser ChatNotificationSender { get; set; } = null!; - - [ForeignKey("ChatNotificationSiteId")] - [InverseProperty("ChatNotifications")] - public virtual CmsSite? ChatNotificationSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_Notification")] +[Index("ChatNotificationReceiverId", Name = "IX_Chat_Notification_ChatNotificationReceiverID")] +[Index("ChatNotificationRoomId", Name = "IX_Chat_Notification_ChatNotificationRoomID")] +[Index("ChatNotificationSenderId", Name = "IX_Chat_Notification_ChatNotificationSenderID")] +[Index("ChatNotificationSiteId", Name = "IX_Chat_Notification_ChatNotificationSiteID")] +public class ChatNotification +{ + [Key] + [Column("ChatNotificationID")] + public int ChatNotificationId { get; set; } + + [Column("ChatNotificationSenderID")] + public int ChatNotificationSenderId { get; set; } + + [Column("ChatNotificationReceiverID")] + public int ChatNotificationReceiverId { get; set; } + + public bool ChatNotificationIsRead { get; set; } + + public int ChatNotificationType { get; set; } + + [Column("ChatNotificationRoomID")] + public int? ChatNotificationRoomId { get; set; } + + public DateTime ChatNotificationSendDateTime { get; set; } + + public DateTime? ChatNotificationReadDateTime { get; set; } + + [Column("ChatNotificationSiteID")] + public int? ChatNotificationSiteId { get; set; } + + [ForeignKey("ChatNotificationReceiverId")] + [InverseProperty("ChatNotificationChatNotificationReceivers")] + public virtual ChatUser ChatNotificationReceiver { get; set; } = null!; + + [ForeignKey("ChatNotificationRoomId")] + [InverseProperty("ChatNotifications")] + public virtual ChatRoom? ChatNotificationRoom { get; set; } + + [ForeignKey("ChatNotificationSenderId")] + [InverseProperty("ChatNotificationChatNotificationSenders")] + public virtual ChatUser ChatNotificationSender { get; set; } = null!; + + [ForeignKey("ChatNotificationSiteId")] + [InverseProperty("ChatNotifications")] + public virtual CmsSite? ChatNotificationSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs b/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs index 1a3ef89c..79bc7a24 100644 --- a/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs +++ b/Migration.Toolkit.KX12/Models/ChatOnlineSupport.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_OnlineSupport")] -[Index("ChatOnlineSupportChatUserId", Name = "IX_Chat_OnlineSupport_ChatOnlineSupportChatUserID")] -[Index("ChatOnlineSupportSiteId", Name = "IX_Chat_OnlineSupport_SiteID")] -[Index("ChatOnlineSupportChatUserId", "ChatOnlineSupportSiteId", Name = "UQ_Chat_OnlineSupport_ChatUserID-SiteID", IsUnique = true)] -public partial class ChatOnlineSupport -{ - [Key] - [Column("ChatOnlineSupportID")] - public int ChatOnlineSupportId { get; set; } - - [Column("ChatOnlineSupportChatUserID")] - public int ChatOnlineSupportChatUserId { get; set; } - - public DateTime ChatOnlineSupportLastChecking { get; set; } - - [Column("ChatOnlineSupportSiteID")] - public int ChatOnlineSupportSiteId { get; set; } - - [StringLength(50)] - public string? ChatOnlineSupportToken { get; set; } - - [ForeignKey("ChatOnlineSupportChatUserId")] - [InverseProperty("ChatOnlineSupports")] - public virtual ChatUser ChatOnlineSupportChatUser { get; set; } = null!; - - [ForeignKey("ChatOnlineSupportSiteId")] - [InverseProperty("ChatOnlineSupports")] - public virtual CmsSite ChatOnlineSupportSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_OnlineSupport")] +[Index("ChatOnlineSupportChatUserId", Name = "IX_Chat_OnlineSupport_ChatOnlineSupportChatUserID")] +[Index("ChatOnlineSupportSiteId", Name = "IX_Chat_OnlineSupport_SiteID")] +[Index("ChatOnlineSupportChatUserId", "ChatOnlineSupportSiteId", Name = "UQ_Chat_OnlineSupport_ChatUserID-SiteID", IsUnique = true)] +public class ChatOnlineSupport +{ + [Key] + [Column("ChatOnlineSupportID")] + public int ChatOnlineSupportId { get; set; } + + [Column("ChatOnlineSupportChatUserID")] + public int ChatOnlineSupportChatUserId { get; set; } + + public DateTime ChatOnlineSupportLastChecking { get; set; } + + [Column("ChatOnlineSupportSiteID")] + public int ChatOnlineSupportSiteId { get; set; } + + [StringLength(50)] + public string? ChatOnlineSupportToken { get; set; } + + [ForeignKey("ChatOnlineSupportChatUserId")] + [InverseProperty("ChatOnlineSupports")] + public virtual ChatUser ChatOnlineSupportChatUser { get; set; } = null!; + + [ForeignKey("ChatOnlineSupportSiteId")] + [InverseProperty("ChatOnlineSupports")] + public virtual CmsSite ChatOnlineSupportSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs b/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs index 91dcd35e..52f6b1a9 100644 --- a/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs +++ b/Migration.Toolkit.KX12/Models/ChatOnlineUser.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_OnlineUser")] -[Index("ChatOnlineUserChatUserId", Name = "IX_Chat_OnlineUser_ChatOnlineUserChatUserID")] -[Index("ChatOnlineUserSiteId", Name = "IX_Chat_OnlineUser_SiteID")] -[Index("ChatOnlineUserChatUserId", "ChatOnlineUserSiteId", Name = "UQ_Chat_OnlineUser_SiteID-ChatUserID", IsUnique = true)] -public partial class ChatOnlineUser -{ - [Key] - [Column("ChatOnlineUserID")] - public int ChatOnlineUserId { get; set; } - - [Column("ChatOnlineUserSiteID")] - public int ChatOnlineUserSiteId { get; set; } - - public DateTime? ChatOnlineUserLastChecking { get; set; } - - [Column("ChatOnlineUserChatUserID")] - public int ChatOnlineUserChatUserId { get; set; } - - public DateTime? ChatOnlineUserJoinTime { get; set; } - - public DateTime? ChatOnlineUserLeaveTime { get; set; } - - [StringLength(50)] - public string? ChatOnlineUserToken { get; set; } - - public bool ChatOnlineUserIsHidden { get; set; } - - [ForeignKey("ChatOnlineUserChatUserId")] - [InverseProperty("ChatOnlineUsers")] - public virtual ChatUser ChatOnlineUserChatUser { get; set; } = null!; - - [ForeignKey("ChatOnlineUserSiteId")] - [InverseProperty("ChatOnlineUsers")] - public virtual CmsSite ChatOnlineUserSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_OnlineUser")] +[Index("ChatOnlineUserChatUserId", Name = "IX_Chat_OnlineUser_ChatOnlineUserChatUserID")] +[Index("ChatOnlineUserSiteId", Name = "IX_Chat_OnlineUser_SiteID")] +[Index("ChatOnlineUserChatUserId", "ChatOnlineUserSiteId", Name = "UQ_Chat_OnlineUser_SiteID-ChatUserID", IsUnique = true)] +public class ChatOnlineUser +{ + [Key] + [Column("ChatOnlineUserID")] + public int ChatOnlineUserId { get; set; } + + [Column("ChatOnlineUserSiteID")] + public int ChatOnlineUserSiteId { get; set; } + + public DateTime? ChatOnlineUserLastChecking { get; set; } + + [Column("ChatOnlineUserChatUserID")] + public int ChatOnlineUserChatUserId { get; set; } + + public DateTime? ChatOnlineUserJoinTime { get; set; } + + public DateTime? ChatOnlineUserLeaveTime { get; set; } + + [StringLength(50)] + public string? ChatOnlineUserToken { get; set; } + + public bool ChatOnlineUserIsHidden { get; set; } + + [ForeignKey("ChatOnlineUserChatUserId")] + [InverseProperty("ChatOnlineUsers")] + public virtual ChatUser ChatOnlineUserChatUser { get; set; } = null!; + + [ForeignKey("ChatOnlineUserSiteId")] + [InverseProperty("ChatOnlineUsers")] + public virtual CmsSite ChatOnlineUserSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs b/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs index b0ced73f..6f5a0603 100644 --- a/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs +++ b/Migration.Toolkit.KX12/Models/ChatPopupWindowSetting.cs @@ -1,29 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_PopupWindowSettings")] -public partial class ChatPopupWindowSetting -{ - [Key] - [Column("ChatPopupWindowSettingsID")] - public int ChatPopupWindowSettingsId { get; set; } - - [StringLength(255)] - public string MessageTransformationName { get; set; } = null!; - - [StringLength(255)] - public string ErrorTransformationName { get; set; } = null!; - - [StringLength(255)] - public string ErrorClearTransformationName { get; set; } = null!; - - [StringLength(255)] - public string UserTransformationName { get; set; } = null!; - - public int ChatPopupWindowSettingsHashCode { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_PopupWindowSettings")] +public class ChatPopupWindowSetting +{ + [Key] + [Column("ChatPopupWindowSettingsID")] + public int ChatPopupWindowSettingsId { get; set; } + + [StringLength(255)] + public string MessageTransformationName { get; set; } = null!; + + [StringLength(255)] + public string ErrorTransformationName { get; set; } = null!; + + [StringLength(255)] + public string ErrorClearTransformationName { get; set; } = null!; + + [StringLength(255)] + public string UserTransformationName { get; set; } = null!; + + public int ChatPopupWindowSettingsHashCode { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ChatRoom.cs b/Migration.Toolkit.KX12/Models/ChatRoom.cs index ece1a022..3a001570 100644 --- a/Migration.Toolkit.KX12/Models/ChatRoom.cs +++ b/Migration.Toolkit.KX12/Models/ChatRoom.cs @@ -1,81 +1,80 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_Room")] -[Index("ChatRoomCreatedByChatUserId", Name = "IX_Chat_Room_ChatRoomCreatedByChatUserID")] -[Index("ChatRoomEnabled", Name = "IX_Chat_Room_Enabled")] -[Index("ChatRoomIsSupport", Name = "IX_Chat_Room_IsSupport")] -[Index("ChatRoomSiteId", Name = "IX_Chat_Room_SiteID")] -public partial class ChatRoom -{ - [Key] - [Column("ChatRoomID")] - public int ChatRoomId { get; set; } - - [StringLength(100)] - public string ChatRoomName { get; set; } = null!; - - [StringLength(100)] - public string ChatRoomDisplayName { get; set; } = null!; - - [Column("ChatRoomSiteID")] - public int? ChatRoomSiteId { get; set; } - - public bool ChatRoomEnabled { get; set; } - - public bool ChatRoomPrivate { get; set; } - - public bool ChatRoomAllowAnonym { get; set; } - - public DateTime ChatRoomCreatedWhen { get; set; } - - [StringLength(100)] - public string? ChatRoomPassword { get; set; } - - [Column("ChatRoomCreatedByChatUserID")] - public int? ChatRoomCreatedByChatUserId { get; set; } - - public bool ChatRoomIsSupport { get; set; } - - public bool ChatRoomIsOneToOne { get; set; } - - [StringLength(500)] - public string? ChatRoomDescription { get; set; } - - public DateTime ChatRoomLastModification { get; set; } - - public DateTime? ChatRoomScheduledToDelete { get; set; } - - public DateTime ChatRoomPrivateStateLastModification { get; set; } - - [Column("ChatRoomGUID")] - public Guid ChatRoomGuid { get; set; } - - [InverseProperty("InitiatedChatRequestRoom")] - public virtual ChatInitiatedChatRequest? ChatInitiatedChatRequest { get; set; } - - [InverseProperty("ChatMessageRoom")] - public virtual ICollection ChatMessages { get; set; } = new List(); - - [InverseProperty("ChatNotificationRoom")] - public virtual ICollection ChatNotifications { get; set; } = new List(); - - [ForeignKey("ChatRoomCreatedByChatUserId")] - [InverseProperty("ChatRooms")] - public virtual ChatUser? ChatRoomCreatedByChatUser { get; set; } - - [ForeignKey("ChatRoomSiteId")] - [InverseProperty("ChatRooms")] - public virtual CmsSite? ChatRoomSite { get; set; } - - [InverseProperty("ChatRoomUserRoom")] - public virtual ICollection ChatRoomUsers { get; set; } = new List(); - - [InverseProperty("ChatSupportTakenRoomRoom")] - public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_Room")] +[Index("ChatRoomCreatedByChatUserId", Name = "IX_Chat_Room_ChatRoomCreatedByChatUserID")] +[Index("ChatRoomEnabled", Name = "IX_Chat_Room_Enabled")] +[Index("ChatRoomIsSupport", Name = "IX_Chat_Room_IsSupport")] +[Index("ChatRoomSiteId", Name = "IX_Chat_Room_SiteID")] +public class ChatRoom +{ + [Key] + [Column("ChatRoomID")] + public int ChatRoomId { get; set; } + + [StringLength(100)] + public string ChatRoomName { get; set; } = null!; + + [StringLength(100)] + public string ChatRoomDisplayName { get; set; } = null!; + + [Column("ChatRoomSiteID")] + public int? ChatRoomSiteId { get; set; } + + public bool ChatRoomEnabled { get; set; } + + public bool ChatRoomPrivate { get; set; } + + public bool ChatRoomAllowAnonym { get; set; } + + public DateTime ChatRoomCreatedWhen { get; set; } + + [StringLength(100)] + public string? ChatRoomPassword { get; set; } + + [Column("ChatRoomCreatedByChatUserID")] + public int? ChatRoomCreatedByChatUserId { get; set; } + + public bool ChatRoomIsSupport { get; set; } + + public bool ChatRoomIsOneToOne { get; set; } + + [StringLength(500)] + public string? ChatRoomDescription { get; set; } + + public DateTime ChatRoomLastModification { get; set; } + + public DateTime? ChatRoomScheduledToDelete { get; set; } + + public DateTime ChatRoomPrivateStateLastModification { get; set; } + + [Column("ChatRoomGUID")] + public Guid ChatRoomGuid { get; set; } + + [InverseProperty("InitiatedChatRequestRoom")] + public virtual ChatInitiatedChatRequest? ChatInitiatedChatRequest { get; set; } + + [InverseProperty("ChatMessageRoom")] + public virtual ICollection ChatMessages { get; set; } = new List(); + + [InverseProperty("ChatNotificationRoom")] + public virtual ICollection ChatNotifications { get; set; } = new List(); + + [ForeignKey("ChatRoomCreatedByChatUserId")] + [InverseProperty("ChatRooms")] + public virtual ChatUser? ChatRoomCreatedByChatUser { get; set; } + + [ForeignKey("ChatRoomSiteId")] + [InverseProperty("ChatRooms")] + public virtual CmsSite? ChatRoomSite { get; set; } + + [InverseProperty("ChatRoomUserRoom")] + public virtual ICollection ChatRoomUsers { get; set; } = new List(); + + [InverseProperty("ChatSupportTakenRoomRoom")] + public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ChatRoomUser.cs b/Migration.Toolkit.KX12/Models/ChatRoomUser.cs index b3302424..5f0fb8b3 100644 --- a/Migration.Toolkit.KX12/Models/ChatRoomUser.cs +++ b/Migration.Toolkit.KX12/Models/ChatRoomUser.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_RoomUser")] -[Index("ChatRoomUserChatUserId", Name = "IX_Chat_RoomUser_ChatRoomUserChatUserID")] -[Index("ChatRoomUserRoomId", Name = "IX_Chat_RoomUser_ChatRoomUserRoomID")] -[Index("ChatRoomUserRoomId", "ChatRoomUserChatUserId", Name = "UQ_Chat_RoomUser_RoomID-ChatUserID", IsUnique = true)] -public partial class ChatRoomUser -{ - [Key] - [Column("ChatRoomUserID")] - public int ChatRoomUserId { get; set; } - - [Column("ChatRoomUserRoomID")] - public int ChatRoomUserRoomId { get; set; } - - [Column("ChatRoomUserChatUserID")] - public int ChatRoomUserChatUserId { get; set; } - - public DateTime? ChatRoomUserLastChecking { get; set; } - - public DateTime? ChatRoomUserKickExpiration { get; set; } - - public DateTime? ChatRoomUserJoinTime { get; set; } - - public DateTime? ChatRoomUserLeaveTime { get; set; } - - public int ChatRoomUserAdminLevel { get; set; } - - public DateTime ChatRoomUserLastModification { get; set; } - - [ForeignKey("ChatRoomUserChatUserId")] - [InverseProperty("ChatRoomUsers")] - public virtual ChatUser ChatRoomUserChatUser { get; set; } = null!; - - [ForeignKey("ChatRoomUserRoomId")] - [InverseProperty("ChatRoomUsers")] - public virtual ChatRoom ChatRoomUserRoom { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_RoomUser")] +[Index("ChatRoomUserChatUserId", Name = "IX_Chat_RoomUser_ChatRoomUserChatUserID")] +[Index("ChatRoomUserRoomId", Name = "IX_Chat_RoomUser_ChatRoomUserRoomID")] +[Index("ChatRoomUserRoomId", "ChatRoomUserChatUserId", Name = "UQ_Chat_RoomUser_RoomID-ChatUserID", IsUnique = true)] +public class ChatRoomUser +{ + [Key] + [Column("ChatRoomUserID")] + public int ChatRoomUserId { get; set; } + + [Column("ChatRoomUserRoomID")] + public int ChatRoomUserRoomId { get; set; } + + [Column("ChatRoomUserChatUserID")] + public int ChatRoomUserChatUserId { get; set; } + + public DateTime? ChatRoomUserLastChecking { get; set; } + + public DateTime? ChatRoomUserKickExpiration { get; set; } + + public DateTime? ChatRoomUserJoinTime { get; set; } + + public DateTime? ChatRoomUserLeaveTime { get; set; } + + public int ChatRoomUserAdminLevel { get; set; } + + public DateTime ChatRoomUserLastModification { get; set; } + + [ForeignKey("ChatRoomUserChatUserId")] + [InverseProperty("ChatRoomUsers")] + public virtual ChatUser ChatRoomUserChatUser { get; set; } = null!; + + [ForeignKey("ChatRoomUserRoomId")] + [InverseProperty("ChatRoomUsers")] + public virtual ChatRoom ChatRoomUserRoom { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs b/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs index 80890ec6..bc9fed6b 100644 --- a/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs +++ b/Migration.Toolkit.KX12/Models/ChatSupportCannedResponse.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_SupportCannedResponse")] -[Index("ChatSupportCannedResponseChatUserId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseChatUserID")] -[Index("ChatSupportCannedResponseSiteId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseSiteID")] -public partial class ChatSupportCannedResponse -{ - [Key] - [Column("ChatSupportCannedResponseID")] - public int ChatSupportCannedResponseId { get; set; } - - [Column("ChatSupportCannedResponseChatUserID")] - public int? ChatSupportCannedResponseChatUserId { get; set; } - - [StringLength(500)] - public string ChatSupportCannedResponseText { get; set; } = null!; - - [StringLength(50)] - public string ChatSupportCannedResponseTagName { get; set; } = null!; - - [Column("ChatSupportCannedResponseSiteID")] - public int? ChatSupportCannedResponseSiteId { get; set; } - - [StringLength(100)] - public string ChatSupportCannedResponseName { get; set; } = null!; - - [ForeignKey("ChatSupportCannedResponseChatUserId")] - [InverseProperty("ChatSupportCannedResponses")] - public virtual ChatUser? ChatSupportCannedResponseChatUser { get; set; } - - [ForeignKey("ChatSupportCannedResponseSiteId")] - [InverseProperty("ChatSupportCannedResponses")] - public virtual CmsSite? ChatSupportCannedResponseSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_SupportCannedResponse")] +[Index("ChatSupportCannedResponseChatUserId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseChatUserID")] +[Index("ChatSupportCannedResponseSiteId", Name = "IX_Chat_SupportCannedResponse_ChatSupportCannedResponseSiteID")] +public class ChatSupportCannedResponse +{ + [Key] + [Column("ChatSupportCannedResponseID")] + public int ChatSupportCannedResponseId { get; set; } + + [Column("ChatSupportCannedResponseChatUserID")] + public int? ChatSupportCannedResponseChatUserId { get; set; } + + [StringLength(500)] + public string ChatSupportCannedResponseText { get; set; } = null!; + + [StringLength(50)] + public string ChatSupportCannedResponseTagName { get; set; } = null!; + + [Column("ChatSupportCannedResponseSiteID")] + public int? ChatSupportCannedResponseSiteId { get; set; } + + [StringLength(100)] + public string ChatSupportCannedResponseName { get; set; } = null!; + + [ForeignKey("ChatSupportCannedResponseChatUserId")] + [InverseProperty("ChatSupportCannedResponses")] + public virtual ChatUser? ChatSupportCannedResponseChatUser { get; set; } + + [ForeignKey("ChatSupportCannedResponseSiteId")] + [InverseProperty("ChatSupportCannedResponses")] + public virtual CmsSite? ChatSupportCannedResponseSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs b/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs index 8d5c5970..449dbfd5 100644 --- a/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs +++ b/Migration.Toolkit.KX12/Models/ChatSupportTakenRoom.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_SupportTakenRoom")] -[Index("ChatSupportTakenRoomChatUserId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomChatUserID")] -[Index("ChatSupportTakenRoomRoomId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomRoomID")] -public partial class ChatSupportTakenRoom -{ - [Key] - [Column("ChatSupportTakenRoomID")] - public int ChatSupportTakenRoomId { get; set; } - - [Column("ChatSupportTakenRoomChatUserID")] - public int? ChatSupportTakenRoomChatUserId { get; set; } - - [Column("ChatSupportTakenRoomRoomID")] - public int ChatSupportTakenRoomRoomId { get; set; } - - public DateTime? ChatSupportTakenRoomResolvedDateTime { get; set; } - - public DateTime ChatSupportTakenRoomLastModification { get; set; } - - [ForeignKey("ChatSupportTakenRoomChatUserId")] - [InverseProperty("ChatSupportTakenRooms")] - public virtual ChatUser? ChatSupportTakenRoomChatUser { get; set; } - - [ForeignKey("ChatSupportTakenRoomRoomId")] - [InverseProperty("ChatSupportTakenRooms")] - public virtual ChatRoom ChatSupportTakenRoomRoom { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_SupportTakenRoom")] +[Index("ChatSupportTakenRoomChatUserId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomChatUserID")] +[Index("ChatSupportTakenRoomRoomId", Name = "IX_Chat_SupportTakenRoom_ChatSupportTakenRoomRoomID")] +public class ChatSupportTakenRoom +{ + [Key] + [Column("ChatSupportTakenRoomID")] + public int ChatSupportTakenRoomId { get; set; } + + [Column("ChatSupportTakenRoomChatUserID")] + public int? ChatSupportTakenRoomChatUserId { get; set; } + + [Column("ChatSupportTakenRoomRoomID")] + public int ChatSupportTakenRoomRoomId { get; set; } + + public DateTime? ChatSupportTakenRoomResolvedDateTime { get; set; } + + public DateTime ChatSupportTakenRoomLastModification { get; set; } + + [ForeignKey("ChatSupportTakenRoomChatUserId")] + [InverseProperty("ChatSupportTakenRooms")] + public virtual ChatUser? ChatSupportTakenRoomChatUser { get; set; } + + [ForeignKey("ChatSupportTakenRoomRoomId")] + [InverseProperty("ChatSupportTakenRooms")] + public virtual ChatRoom ChatSupportTakenRoomRoom { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ChatUser.cs b/Migration.Toolkit.KX12/Models/ChatUser.cs index 190968c6..7bd88146 100644 --- a/Migration.Toolkit.KX12/Models/ChatUser.cs +++ b/Migration.Toolkit.KX12/Models/ChatUser.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Chat_User")] -[Index("ChatUserUserId", Name = "IX_Chat_User_UserID")] -public partial class ChatUser -{ - [Key] - [Column("ChatUserID")] - public int ChatUserId { get; set; } - - [Column("ChatUserUserID")] - public int? ChatUserUserId { get; set; } - - [StringLength(50)] - public string ChatUserNickname { get; set; } = null!; - - public DateTime ChatUserLastModification { get; set; } - - [InverseProperty("InitiatedChatRequestInitiatorChatUser")] - public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); - - [InverseProperty("ChatMessageRecipient")] - public virtual ICollection ChatMessageChatMessageRecipients { get; set; } = new List(); - - [InverseProperty("ChatMessageUser")] - public virtual ICollection ChatMessageChatMessageUsers { get; set; } = new List(); - - [InverseProperty("ChatNotificationReceiver")] - public virtual ICollection ChatNotificationChatNotificationReceivers { get; set; } = new List(); - - [InverseProperty("ChatNotificationSender")] - public virtual ICollection ChatNotificationChatNotificationSenders { get; set; } = new List(); - - [InverseProperty("ChatOnlineSupportChatUser")] - public virtual ICollection ChatOnlineSupports { get; set; } = new List(); - - [InverseProperty("ChatOnlineUserChatUser")] - public virtual ICollection ChatOnlineUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomUserChatUser")] - public virtual ICollection ChatRoomUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomCreatedByChatUser")] - public virtual ICollection ChatRooms { get; set; } = new List(); - - [InverseProperty("ChatSupportCannedResponseChatUser")] - public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); - - [InverseProperty("ChatSupportTakenRoomChatUser")] - public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); - - [ForeignKey("ChatUserUserId")] - [InverseProperty("ChatUsers")] - public virtual CmsUser? ChatUserUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Chat_User")] +[Index("ChatUserUserId", Name = "IX_Chat_User_UserID")] +public class ChatUser +{ + [Key] + [Column("ChatUserID")] + public int ChatUserId { get; set; } + + [Column("ChatUserUserID")] + public int? ChatUserUserId { get; set; } + + [StringLength(50)] + public string ChatUserNickname { get; set; } = null!; + + public DateTime ChatUserLastModification { get; set; } + + [InverseProperty("InitiatedChatRequestInitiatorChatUser")] + public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); + + [InverseProperty("ChatMessageRecipient")] + public virtual ICollection ChatMessageChatMessageRecipients { get; set; } = new List(); + + [InverseProperty("ChatMessageUser")] + public virtual ICollection ChatMessageChatMessageUsers { get; set; } = new List(); + + [InverseProperty("ChatNotificationReceiver")] + public virtual ICollection ChatNotificationChatNotificationReceivers { get; set; } = new List(); + + [InverseProperty("ChatNotificationSender")] + public virtual ICollection ChatNotificationChatNotificationSenders { get; set; } = new List(); + + [InverseProperty("ChatOnlineSupportChatUser")] + public virtual ICollection ChatOnlineSupports { get; set; } = new List(); + + [InverseProperty("ChatOnlineUserChatUser")] + public virtual ICollection ChatOnlineUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomUserChatUser")] + public virtual ICollection ChatRoomUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomCreatedByChatUser")] + public virtual ICollection ChatRooms { get; set; } = new List(); + + [InverseProperty("ChatSupportCannedResponseChatUser")] + public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); + + [InverseProperty("ChatSupportTakenRoomChatUser")] + public virtual ICollection ChatSupportTakenRooms { get; set; } = new List(); + + [ForeignKey("ChatUserUserId")] + [InverseProperty("ChatUsers")] + public virtual CmsUser? ChatUserUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs b/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs index 72fe25ff..7cd26273 100644 --- a/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs +++ b/Migration.Toolkit.KX12/Models/CiFileMetadatum.cs @@ -1,22 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CI_FileMetadata")] -[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] -public partial class CiFileMetadatum -{ - [Key] - [Column("FileMetadataID")] - public int FileMetadataId { get; set; } - - [StringLength(260)] - public string FileLocation { get; set; } = null!; - - [StringLength(32)] - public string FileHash { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CI_FileMetadata")] +[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] +public class CiFileMetadatum +{ + [Key] + [Column("FileMetadataID")] + public int FileMetadataId { get; set; } + + [StringLength(260)] + public string FileLocation { get; set; } = null!; + + [StringLength(32)] + public string FileHash { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CiMigration.cs b/Migration.Toolkit.KX12/Models/CiMigration.cs index 9f191d87..2872df66 100644 --- a/Migration.Toolkit.KX12/Models/CiMigration.cs +++ b/Migration.Toolkit.KX12/Models/CiMigration.cs @@ -1,24 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CI_Migration")] -[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] -public partial class CiMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CI_Migration")] +[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] +public class CiMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs b/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs index 11de55ca..c1b3c619 100644 --- a/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs +++ b/Migration.Toolkit.KX12/Models/CmsAbuseReport.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AbuseReport")] -[Index("ReportSiteId", Name = "IX_CMS_AbuseReport_ReportSiteID")] -[Index("ReportStatus", Name = "IX_CMS_AbuseReport_ReportStatus")] -[Index("ReportUserId", Name = "IX_CMS_AbuseReport_ReportUserID")] -public partial class CmsAbuseReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - [StringLength(100)] - public string? ReportTitle { get; set; } - - [Column("ReportURL")] - [StringLength(1000)] - public string ReportUrl { get; set; } = null!; - - [StringLength(50)] - public string ReportCulture { get; set; } = null!; - - [Column("ReportObjectID")] - public int? ReportObjectId { get; set; } - - [StringLength(100)] - public string? ReportObjectType { get; set; } - - public string ReportComment { get; set; } = null!; - - [Column("ReportUserID")] - public int? ReportUserId { get; set; } - - public DateTime ReportWhen { get; set; } - - public int ReportStatus { get; set; } - - [Column("ReportSiteID")] - public int ReportSiteId { get; set; } - - [ForeignKey("ReportSiteId")] - [InverseProperty("CmsAbuseReports")] - public virtual CmsSite ReportSite { get; set; } = null!; - - [ForeignKey("ReportUserId")] - [InverseProperty("CmsAbuseReports")] - public virtual CmsUser? ReportUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_AbuseReport")] +[Index("ReportSiteId", Name = "IX_CMS_AbuseReport_ReportSiteID")] +[Index("ReportStatus", Name = "IX_CMS_AbuseReport_ReportStatus")] +[Index("ReportUserId", Name = "IX_CMS_AbuseReport_ReportUserID")] +public class CmsAbuseReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + [StringLength(100)] + public string? ReportTitle { get; set; } + + [Column("ReportURL")] + [StringLength(1000)] + public string ReportUrl { get; set; } = null!; + + [StringLength(50)] + public string ReportCulture { get; set; } = null!; + + [Column("ReportObjectID")] + public int? ReportObjectId { get; set; } + + [StringLength(100)] + public string? ReportObjectType { get; set; } + + public string ReportComment { get; set; } = null!; + + [Column("ReportUserID")] + public int? ReportUserId { get; set; } + + public DateTime ReportWhen { get; set; } + + public int ReportStatus { get; set; } + + [Column("ReportSiteID")] + public int ReportSiteId { get; set; } + + [ForeignKey("ReportSiteId")] + [InverseProperty("CmsAbuseReports")] + public virtual CmsSite ReportSite { get; set; } = null!; + + [ForeignKey("ReportUserId")] + [InverseProperty("CmsAbuseReports")] + public virtual CmsUser? ReportUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsAcl.cs b/Migration.Toolkit.KX12/Models/CmsAcl.cs index a4dc620e..be62ccbe 100644 --- a/Migration.Toolkit.KX12/Models/CmsAcl.cs +++ b/Migration.Toolkit.KX12/Models/CmsAcl.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ACL")] -[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] -[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] -public partial class CmsAcl -{ - [Key] - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("ACLInheritedACLs")] - public string AclinheritedAcls { get; set; } = null!; - - [Column("ACLGUID")] - public Guid Aclguid { get; set; } - - [Column("ACLLastModified")] - public DateTime AcllastModified { get; set; } - - [Column("ACLSiteID")] - public int? AclsiteId { get; set; } - - [ForeignKey("AclsiteId")] - [InverseProperty("CmsAcls")] - public virtual CmsSite? Aclsite { get; set; } - - [InverseProperty("Acl")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("NodeAcl")] - public virtual ICollection CmsTrees { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ACL")] +[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] +[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] +public class CmsAcl +{ + [Key] + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("ACLInheritedACLs")] + public string AclinheritedAcls { get; set; } = null!; + + [Column("ACLGUID")] + public Guid Aclguid { get; set; } + + [Column("ACLLastModified")] + public DateTime AcllastModified { get; set; } + + [Column("ACLSiteID")] + public int? AclsiteId { get; set; } + + [ForeignKey("AclsiteId")] + [InverseProperty("CmsAcls")] + public virtual CmsSite? Aclsite { get; set; } + + [InverseProperty("Acl")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("NodeAcl")] + public virtual ICollection CmsTrees { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsAclitem.cs b/Migration.Toolkit.KX12/Models/CmsAclitem.cs index 72e366bf..3c1cf3c8 100644 --- a/Migration.Toolkit.KX12/Models/CmsAclitem.cs +++ b/Migration.Toolkit.KX12/Models/CmsAclitem.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ACLItem")] -[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] -[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] -[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] -[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] -public partial class CmsAclitem -{ - [Key] - [Column("ACLItemID")] - public int AclitemId { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - public DateTime LastModified { get; set; } - - [Column("LastModifiedByUserID")] - public int? LastModifiedByUserId { get; set; } - - [Column("ACLItemGUID")] - public Guid AclitemGuid { get; set; } - - [ForeignKey("Aclid")] - [InverseProperty("CmsAclitems")] - public virtual CmsAcl Acl { get; set; } = null!; - - [ForeignKey("LastModifiedByUserId")] - [InverseProperty("CmsAclitemLastModifiedByUsers")] - public virtual CmsUser? LastModifiedByUser { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsAclitems")] - public virtual CmsRole? Role { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsAclitemUsers")] - public virtual CmsUser? User { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ACLItem")] +[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] +[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] +[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] +[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] +public class CmsAclitem +{ + [Key] + [Column("ACLItemID")] + public int AclitemId { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + public DateTime LastModified { get; set; } + + [Column("LastModifiedByUserID")] + public int? LastModifiedByUserId { get; set; } + + [Column("ACLItemGUID")] + public Guid AclitemGuid { get; set; } + + [ForeignKey("Aclid")] + [InverseProperty("CmsAclitems")] + public virtual CmsAcl Acl { get; set; } = null!; + + [ForeignKey("LastModifiedByUserId")] + [InverseProperty("CmsAclitemLastModifiedByUsers")] + public virtual CmsUser? LastModifiedByUser { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsAclitems")] + public virtual CmsRole? Role { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsAclitemUsers")] + public virtual CmsUser? User { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs index c330e57e..1e29a137 100644 --- a/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs +++ b/Migration.Toolkit.KX12/Models/CmsAlternativeForm.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AlternativeForm")] -[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] -[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] -public partial class CmsAlternativeForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(50)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public string? FormDefinition { get; set; } - - public string? FormLayout { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Column("FormCoupledClassID")] - public int? FormCoupledClassId { get; set; } - - public bool? FormHideNewParentFields { get; set; } - - [StringLength(50)] - public string? FormLayoutType { get; set; } - - [Column("FormVersionGUID")] - [StringLength(50)] - public string? FormVersionGuid { get; set; } - - [StringLength(400)] - public string? FormCustomizedColumns { get; set; } - - public bool? FormIsCustom { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsAlternativeFormFormClasses")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormCoupledClassId")] - [InverseProperty("CmsAlternativeFormFormCoupledClasses")] - public virtual CmsClass? FormCoupledClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_AlternativeForm")] +[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] +[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] +public class CmsAlternativeForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(50)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public string? FormDefinition { get; set; } + + public string? FormLayout { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Column("FormCoupledClassID")] + public int? FormCoupledClassId { get; set; } + + public bool? FormHideNewParentFields { get; set; } + + [StringLength(50)] + public string? FormLayoutType { get; set; } + + [Column("FormVersionGUID")] + [StringLength(50)] + public string? FormVersionGuid { get; set; } + + [StringLength(400)] + public string? FormCustomizedColumns { get; set; } + + public bool? FormIsCustom { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsAlternativeFormFormClasses")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormCoupledClassId")] + [InverseProperty("CmsAlternativeFormFormCoupledClasses")] + public virtual CmsClass? FormCoupledClass { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs b/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs index 030d8dff..528d2b5a 100644 --- a/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs +++ b/Migration.Toolkit.KX12/Models/CmsAlternativeUrl.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AlternativeUrl")] -[Index("AlternativeUrlDocumentId", Name = "IX_CMS_AlternativeUrl_AlternativeUrlDocumentID")] -[Index("AlternativeUrlSiteId", "AlternativeUrlUrl", Name = "IX_CMS_AlternativeUrl_AlternativeUrlSiteID_AlternativeUrlUrl", IsUnique = true)] -public partial class CmsAlternativeUrl -{ - [Key] - [Column("AlternativeUrlID")] - public int AlternativeUrlId { get; set; } - - [Column("AlternativeUrlGUID")] - public Guid AlternativeUrlGuid { get; set; } - - [Column("AlternativeUrlDocumentID")] - public int AlternativeUrlDocumentId { get; set; } - - [Column("AlternativeUrlSiteID")] - public int AlternativeUrlSiteId { get; set; } - - public string AlternativeUrlUrl { get; set; } = null!; - - public DateTime AlternativeUrlLastModified { get; set; } - - [ForeignKey("AlternativeUrlDocumentId")] - [InverseProperty("CmsAlternativeUrls")] - public virtual CmsDocument AlternativeUrlDocument { get; set; } = null!; - - [ForeignKey("AlternativeUrlSiteId")] - [InverseProperty("CmsAlternativeUrls")] - public virtual CmsSite AlternativeUrlSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_AlternativeUrl")] +[Index("AlternativeUrlDocumentId", Name = "IX_CMS_AlternativeUrl_AlternativeUrlDocumentID")] +[Index("AlternativeUrlSiteId", "AlternativeUrlUrl", Name = "IX_CMS_AlternativeUrl_AlternativeUrlSiteID_AlternativeUrlUrl", IsUnique = true)] +public class CmsAlternativeUrl +{ + [Key] + [Column("AlternativeUrlID")] + public int AlternativeUrlId { get; set; } + + [Column("AlternativeUrlGUID")] + public Guid AlternativeUrlGuid { get; set; } + + [Column("AlternativeUrlDocumentID")] + public int AlternativeUrlDocumentId { get; set; } + + [Column("AlternativeUrlSiteID")] + public int AlternativeUrlSiteId { get; set; } + + public string AlternativeUrlUrl { get; set; } = null!; + + public DateTime AlternativeUrlLastModified { get; set; } + + [ForeignKey("AlternativeUrlDocumentId")] + [InverseProperty("CmsAlternativeUrls")] + public virtual CmsDocument AlternativeUrlDocument { get; set; } = null!; + + [ForeignKey("AlternativeUrlSiteId")] + [InverseProperty("CmsAlternativeUrls")] + public virtual CmsSite AlternativeUrlSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsAttachment.cs b/Migration.Toolkit.KX12/Models/CmsAttachment.cs index 2bd9e99f..d063cb17 100644 --- a/Migration.Toolkit.KX12/Models/CmsAttachment.cs +++ b/Migration.Toolkit.KX12/Models/CmsAttachment.cs @@ -1,91 +1,90 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Attachment")] -[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] -[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] -public partial class CmsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int? AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [Column("AttachmentFormGUID")] - public Guid? AttachmentFormGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentDocumentId")] - [InverseProperty("CmsAttachments")] - public virtual CmsDocument? AttachmentDocument { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachment? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Attachment")] +[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] +[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] +public class CmsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int? AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [Column("AttachmentFormGUID")] + public Guid? AttachmentFormGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentDocumentId")] + [InverseProperty("CmsAttachments")] + public virtual CmsDocument? AttachmentDocument { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachment? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs index 22052ae3..a9ba70d3 100644 --- a/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsAttachmentHistory.cs @@ -1,90 +1,89 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AttachmentHistory")] -[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] -public partial class CmsAttachmentHistory -{ - [Key] - [Column("AttachmentHistoryID")] - public int AttachmentHistoryId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public DateTime? AttachmentLastModified { get; set; } - - [Column("AttachmentHistoryGUID")] - public Guid AttachmentHistoryGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachmentHistories")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); - - [ForeignKey("AttachmentHistoryId")] - [InverseProperty("AttachmentHistories")] - public virtual ICollection VersionHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_AttachmentHistory")] +[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] +public class CmsAttachmentHistory +{ + [Key] + [Column("AttachmentHistoryID")] + public int AttachmentHistoryId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public DateTime? AttachmentLastModified { get; set; } + + [Column("AttachmentHistoryGUID")] + public Guid AttachmentHistoryGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachmentHistories")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); + + [ForeignKey("AttachmentHistoryId")] + [InverseProperty("AttachmentHistories")] + public virtual ICollection VersionHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs index 19aee3c0..0ab49d0c 100644 --- a/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsAutomationHistory.cs @@ -1,82 +1,81 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AutomationHistory")] -[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] -[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] -[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] -[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] -[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] -[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] -public partial class CmsAutomationHistory -{ - [Key] - [Column("HistoryID")] - public int HistoryId { get; set; } - - [Column("HistoryStepID")] - public int? HistoryStepId { get; set; } - - [StringLength(440)] - public string? HistoryStepName { get; set; } - - [StringLength(450)] - public string HistoryStepDisplayName { get; set; } = null!; - - public int? HistoryStepType { get; set; } - - [Column("HistoryTargetStepID")] - public int? HistoryTargetStepId { get; set; } - - [StringLength(440)] - public string? HistoryTargetStepName { get; set; } - - [StringLength(450)] - public string? HistoryTargetStepDisplayName { get; set; } - - public int? HistoryTargetStepType { get; set; } - - [Column("HistoryApprovedByUserID")] - public int? HistoryApprovedByUserId { get; set; } - - public DateTime? HistoryApprovedWhen { get; set; } - - public string? HistoryComment { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - public bool HistoryWasRejected { get; set; } - - [Column("HistoryStateID")] - public int HistoryStateId { get; set; } - - [ForeignKey("HistoryApprovedByUserId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsUser? HistoryApprovedByUser { get; set; } - - [ForeignKey("HistoryStateId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsAutomationState HistoryState { get; set; } = null!; - - [ForeignKey("HistoryStepId")] - [InverseProperty("CmsAutomationHistoryHistorySteps")] - public virtual CmsWorkflowStep? HistoryStep { get; set; } - - [ForeignKey("HistoryTargetStepId")] - [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] - public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_AutomationHistory")] +[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] +[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] +[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] +[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] +[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] +[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] +public class CmsAutomationHistory +{ + [Key] + [Column("HistoryID")] + public int HistoryId { get; set; } + + [Column("HistoryStepID")] + public int? HistoryStepId { get; set; } + + [StringLength(440)] + public string? HistoryStepName { get; set; } + + [StringLength(450)] + public string HistoryStepDisplayName { get; set; } = null!; + + public int? HistoryStepType { get; set; } + + [Column("HistoryTargetStepID")] + public int? HistoryTargetStepId { get; set; } + + [StringLength(440)] + public string? HistoryTargetStepName { get; set; } + + [StringLength(450)] + public string? HistoryTargetStepDisplayName { get; set; } + + public int? HistoryTargetStepType { get; set; } + + [Column("HistoryApprovedByUserID")] + public int? HistoryApprovedByUserId { get; set; } + + public DateTime? HistoryApprovedWhen { get; set; } + + public string? HistoryComment { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + public bool HistoryWasRejected { get; set; } + + [Column("HistoryStateID")] + public int HistoryStateId { get; set; } + + [ForeignKey("HistoryApprovedByUserId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsUser? HistoryApprovedByUser { get; set; } + + [ForeignKey("HistoryStateId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsAutomationState HistoryState { get; set; } = null!; + + [ForeignKey("HistoryStepId")] + [InverseProperty("CmsAutomationHistoryHistorySteps")] + public virtual CmsWorkflowStep? HistoryStep { get; set; } + + [ForeignKey("HistoryTargetStepId")] + [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] + public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsAutomationState.cs b/Migration.Toolkit.KX12/Models/CmsAutomationState.cs index 8c1516d1..39af60d9 100644 --- a/Migration.Toolkit.KX12/Models/CmsAutomationState.cs +++ b/Migration.Toolkit.KX12/Models/CmsAutomationState.cs @@ -1,71 +1,70 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_AutomationState")] -[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] -[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] -[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] -[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] -[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] -public partial class CmsAutomationState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [Column("StateStepID")] - public int StateStepId { get; set; } - - [Column("StateObjectID")] - public int StateObjectId { get; set; } - - [StringLength(100)] - public string StateObjectType { get; set; } = null!; - - [StringLength(450)] - public string? StateActionStatus { get; set; } - - public DateTime? StateCreated { get; set; } - - public DateTime? StateLastModified { get; set; } - - [Column("StateWorkflowID")] - public int StateWorkflowId { get; set; } - - public int? StateStatus { get; set; } - - [Column("StateSiteID")] - public int? StateSiteId { get; set; } - - [Column("StateUserID")] - public int? StateUserId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public string? StateCustomData { get; set; } - - [InverseProperty("HistoryState")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [ForeignKey("StateSiteId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsSite? StateSite { get; set; } - - [ForeignKey("StateStepId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflowStep StateStep { get; set; } = null!; - - [ForeignKey("StateUserId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsUser? StateUser { get; set; } - - [ForeignKey("StateWorkflowId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflow StateWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_AutomationState")] +[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] +[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] +[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] +[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] +[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] +public class CmsAutomationState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [Column("StateStepID")] + public int StateStepId { get; set; } + + [Column("StateObjectID")] + public int StateObjectId { get; set; } + + [StringLength(100)] + public string StateObjectType { get; set; } = null!; + + [StringLength(450)] + public string? StateActionStatus { get; set; } + + public DateTime? StateCreated { get; set; } + + public DateTime? StateLastModified { get; set; } + + [Column("StateWorkflowID")] + public int StateWorkflowId { get; set; } + + public int? StateStatus { get; set; } + + [Column("StateSiteID")] + public int? StateSiteId { get; set; } + + [Column("StateUserID")] + public int? StateUserId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public string? StateCustomData { get; set; } + + [InverseProperty("HistoryState")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [ForeignKey("StateSiteId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsSite? StateSite { get; set; } + + [ForeignKey("StateStepId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflowStep StateStep { get; set; } = null!; + + [ForeignKey("StateUserId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsUser? StateUser { get; set; } + + [ForeignKey("StateWorkflowId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflow StateWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsAvatar.cs b/Migration.Toolkit.KX12/Models/CmsAvatar.cs index b4f5df87..90e76b1a 100644 --- a/Migration.Toolkit.KX12/Models/CmsAvatar.cs +++ b/Migration.Toolkit.KX12/Models/CmsAvatar.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Avatar")] -[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] -[Index("AvatarType", "AvatarIsCustom", Name = "IX_CMS_Avatar_AvatarType_AvatarIsCustom")] -public partial class CmsAvatar -{ - [Key] - [Column("AvatarID")] - public int AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } - - [StringLength(200)] - public string AvatarFileName { get; set; } = null!; - - [StringLength(10)] - public string AvatarFileExtension { get; set; } = null!; - - public byte[]? AvatarBinary { get; set; } - - [StringLength(50)] - public string AvatarType { get; set; } = null!; - - public bool AvatarIsCustom { get; set; } - - [Column("AvatarGUID")] - public Guid AvatarGuid { get; set; } - - public DateTime AvatarLastModified { get; set; } - - [StringLength(100)] - public string AvatarMimeType { get; set; } = null!; - - public int AvatarFileSize { get; set; } - - public int? AvatarImageHeight { get; set; } - - public int? AvatarImageWidth { get; set; } - - public bool? DefaultMaleUserAvatar { get; set; } - - public bool? DefaultFemaleUserAvatar { get; set; } - - public bool? DefaultGroupAvatar { get; set; } - - public bool? DefaultUserAvatar { get; set; } - - [InverseProperty("UserAvatar")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); - - [InverseProperty("GroupAvatar")] - public virtual ICollection CommunityGroups { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Avatar")] +[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] +[Index("AvatarType", "AvatarIsCustom", Name = "IX_CMS_Avatar_AvatarType_AvatarIsCustom")] +public class CmsAvatar +{ + [Key] + [Column("AvatarID")] + public int AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } + + [StringLength(200)] + public string AvatarFileName { get; set; } = null!; + + [StringLength(10)] + public string AvatarFileExtension { get; set; } = null!; + + public byte[]? AvatarBinary { get; set; } + + [StringLength(50)] + public string AvatarType { get; set; } = null!; + + public bool AvatarIsCustom { get; set; } + + [Column("AvatarGUID")] + public Guid AvatarGuid { get; set; } + + public DateTime AvatarLastModified { get; set; } + + [StringLength(100)] + public string AvatarMimeType { get; set; } = null!; + + public int AvatarFileSize { get; set; } + + public int? AvatarImageHeight { get; set; } + + public int? AvatarImageWidth { get; set; } + + public bool? DefaultMaleUserAvatar { get; set; } + + public bool? DefaultFemaleUserAvatar { get; set; } + + public bool? DefaultGroupAvatar { get; set; } + + public bool? DefaultUserAvatar { get; set; } + + [InverseProperty("UserAvatar")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); + + [InverseProperty("GroupAvatar")] + public virtual ICollection CommunityGroups { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsBadge.cs b/Migration.Toolkit.KX12/Models/CmsBadge.cs index 66b42199..0806556e 100644 --- a/Migration.Toolkit.KX12/Models/CmsBadge.cs +++ b/Migration.Toolkit.KX12/Models/CmsBadge.cs @@ -1,37 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Badge")] -public partial class CmsBadge -{ - [Key] - [Column("BadgeID")] - public int BadgeId { get; set; } - - [StringLength(100)] - public string BadgeName { get; set; } = null!; - - [StringLength(200)] - public string BadgeDisplayName { get; set; } = null!; - - [Column("BadgeImageURL")] - [StringLength(200)] - public string? BadgeImageUrl { get; set; } - - public bool BadgeIsAutomatic { get; set; } - - public int? BadgeTopLimit { get; set; } - - [Column("BadgeGUID")] - public Guid BadgeGuid { get; set; } - - public DateTime BadgeLastModified { get; set; } - - [InverseProperty("UserBadge")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Badge")] +public class CmsBadge +{ + [Key] + [Column("BadgeID")] + public int BadgeId { get; set; } + + [StringLength(100)] + public string BadgeName { get; set; } = null!; + + [StringLength(200)] + public string BadgeDisplayName { get; set; } = null!; + + [Column("BadgeImageURL")] + [StringLength(200)] + public string? BadgeImageUrl { get; set; } + + public bool BadgeIsAutomatic { get; set; } + + public int? BadgeTopLimit { get; set; } + + [Column("BadgeGUID")] + public Guid BadgeGuid { get; set; } + + public DateTime BadgeLastModified { get; set; } + + [InverseProperty("UserBadge")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsBannedIp.cs b/Migration.Toolkit.KX12/Models/CmsBannedIp.cs index ee10c1be..33ff9af5 100644 --- a/Migration.Toolkit.KX12/Models/CmsBannedIp.cs +++ b/Migration.Toolkit.KX12/Models/CmsBannedIp.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_BannedIP")] -[Index("IpaddressSiteId", Name = "IX_CMS_BannedIP_IPAddressSiteID")] -public partial class CmsBannedIp -{ - [Key] - [Column("IPAddressID")] - public int IpaddressId { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string Ipaddress { get; set; } = null!; - - [Column("IPAddressRegular")] - [StringLength(200)] - public string IpaddressRegular { get; set; } = null!; - - [Column("IPAddressAllowed")] - public bool IpaddressAllowed { get; set; } - - [Column("IPAddressAllowOverride")] - public bool IpaddressAllowOverride { get; set; } - - [Column("IPAddressBanReason")] - [StringLength(450)] - public string? IpaddressBanReason { get; set; } - - [Column("IPAddressBanType")] - [StringLength(100)] - public string IpaddressBanType { get; set; } = null!; - - [Column("IPAddressBanEnabled")] - public bool? IpaddressBanEnabled { get; set; } - - [Column("IPAddressSiteID")] - public int? IpaddressSiteId { get; set; } - - [Column("IPAddressGUID")] - public Guid IpaddressGuid { get; set; } - - [Column("IPAddressLastModified")] - public DateTime IpaddressLastModified { get; set; } - - [ForeignKey("IpaddressSiteId")] - [InverseProperty("CmsBannedIps")] - public virtual CmsSite? IpaddressSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_BannedIP")] +[Index("IpaddressSiteId", Name = "IX_CMS_BannedIP_IPAddressSiteID")] +public class CmsBannedIp +{ + [Key] + [Column("IPAddressID")] + public int IpaddressId { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string Ipaddress { get; set; } = null!; + + [Column("IPAddressRegular")] + [StringLength(200)] + public string IpaddressRegular { get; set; } = null!; + + [Column("IPAddressAllowed")] + public bool IpaddressAllowed { get; set; } + + [Column("IPAddressAllowOverride")] + public bool IpaddressAllowOverride { get; set; } + + [Column("IPAddressBanReason")] + [StringLength(450)] + public string? IpaddressBanReason { get; set; } + + [Column("IPAddressBanType")] + [StringLength(100)] + public string IpaddressBanType { get; set; } = null!; + + [Column("IPAddressBanEnabled")] + public bool? IpaddressBanEnabled { get; set; } + + [Column("IPAddressSiteID")] + public int? IpaddressSiteId { get; set; } + + [Column("IPAddressGUID")] + public Guid IpaddressGuid { get; set; } + + [Column("IPAddressLastModified")] + public DateTime IpaddressLastModified { get; set; } + + [ForeignKey("IpaddressSiteId")] + [InverseProperty("CmsBannedIps")] + public virtual CmsSite? IpaddressSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsBanner.cs b/Migration.Toolkit.KX12/Models/CmsBanner.cs index 5e4cb93c..3f091bab 100644 --- a/Migration.Toolkit.KX12/Models/CmsBanner.cs +++ b/Migration.Toolkit.KX12/Models/CmsBanner.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Banner")] -[Index("BannerCategoryId", Name = "IX_CMS_Banner_BannerCategoryID")] -[Index("BannerSiteId", Name = "IX_CMS_Banner_BannerSiteID")] -public partial class CmsBanner -{ - [Key] - [Column("BannerID")] - public int BannerId { get; set; } - - [StringLength(256)] - public string BannerName { get; set; } = null!; - - [StringLength(256)] - public string BannerDisplayName { get; set; } = null!; - - [Column("BannerCategoryID")] - public int BannerCategoryId { get; set; } - - [Required] - public bool? BannerEnabled { get; set; } - - public DateTime? BannerFrom { get; set; } - - public DateTime? BannerTo { get; set; } - - public Guid BannerGuid { get; set; } - - public DateTime BannerLastModified { get; set; } - - public int BannerType { get; set; } - - [Column("BannerURL")] - [StringLength(2083)] - public string BannerUrl { get; set; } = null!; - - public bool BannerBlank { get; set; } - - public double BannerWeight { get; set; } - - public int? BannerHitsLeft { get; set; } - - public int? BannerClicksLeft { get; set; } - - [Column("BannerSiteID")] - public int? BannerSiteId { get; set; } - - public string BannerContent { get; set; } = null!; - - [ForeignKey("BannerCategoryId")] - [InverseProperty("CmsBanners")] - public virtual CmsBannerCategory BannerCategory { get; set; } = null!; - - [ForeignKey("BannerSiteId")] - [InverseProperty("CmsBanners")] - public virtual CmsSite? BannerSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Banner")] +[Index("BannerCategoryId", Name = "IX_CMS_Banner_BannerCategoryID")] +[Index("BannerSiteId", Name = "IX_CMS_Banner_BannerSiteID")] +public class CmsBanner +{ + [Key] + [Column("BannerID")] + public int BannerId { get; set; } + + [StringLength(256)] + public string BannerName { get; set; } = null!; + + [StringLength(256)] + public string BannerDisplayName { get; set; } = null!; + + [Column("BannerCategoryID")] + public int BannerCategoryId { get; set; } + + [Required] + public bool? BannerEnabled { get; set; } + + public DateTime? BannerFrom { get; set; } + + public DateTime? BannerTo { get; set; } + + public Guid BannerGuid { get; set; } + + public DateTime BannerLastModified { get; set; } + + public int BannerType { get; set; } + + [Column("BannerURL")] + [StringLength(2083)] + public string BannerUrl { get; set; } = null!; + + public bool BannerBlank { get; set; } + + public double BannerWeight { get; set; } + + public int? BannerHitsLeft { get; set; } + + public int? BannerClicksLeft { get; set; } + + [Column("BannerSiteID")] + public int? BannerSiteId { get; set; } + + public string BannerContent { get; set; } = null!; + + [ForeignKey("BannerCategoryId")] + [InverseProperty("CmsBanners")] + public virtual CmsBannerCategory BannerCategory { get; set; } = null!; + + [ForeignKey("BannerSiteId")] + [InverseProperty("CmsBanners")] + public virtual CmsSite? BannerSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs b/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs index 273e924d..05d52a62 100644 --- a/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsBannerCategory.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_BannerCategory")] -[Index("BannerCategoryName", "BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategoryName_BannerCategorySiteID", IsUnique = true)] -[Index("BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategorySiteID")] -public partial class CmsBannerCategory -{ - [Key] - [Column("BannerCategoryID")] - public int BannerCategoryId { get; set; } - - [StringLength(100)] - public string BannerCategoryName { get; set; } = null!; - - [StringLength(200)] - public string BannerCategoryDisplayName { get; set; } = null!; - - [Column("BannerCategorySiteID")] - public int? BannerCategorySiteId { get; set; } - - public Guid BannerCategoryGuid { get; set; } - - public DateTime BannerCategoryLastModified { get; set; } - - [Required] - public bool? BannerCategoryEnabled { get; set; } - - [ForeignKey("BannerCategorySiteId")] - [InverseProperty("CmsBannerCategories")] - public virtual CmsSite? BannerCategorySite { get; set; } - - [InverseProperty("BannerCategory")] - public virtual ICollection CmsBanners { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_BannerCategory")] +[Index("BannerCategoryName", "BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategoryName_BannerCategorySiteID", IsUnique = true)] +[Index("BannerCategorySiteId", Name = "IX_CMS_BannerCategory_BannerCategorySiteID")] +public class CmsBannerCategory +{ + [Key] + [Column("BannerCategoryID")] + public int BannerCategoryId { get; set; } + + [StringLength(100)] + public string BannerCategoryName { get; set; } = null!; + + [StringLength(200)] + public string BannerCategoryDisplayName { get; set; } = null!; + + [Column("BannerCategorySiteID")] + public int? BannerCategorySiteId { get; set; } + + public Guid BannerCategoryGuid { get; set; } + + public DateTime BannerCategoryLastModified { get; set; } + + [Required] + public bool? BannerCategoryEnabled { get; set; } + + [ForeignKey("BannerCategorySiteId")] + [InverseProperty("CmsBannerCategories")] + public virtual CmsSite? BannerCategorySite { get; set; } + + [InverseProperty("BannerCategory")] + public virtual ICollection CmsBanners { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsCategory.cs b/Migration.Toolkit.KX12/Models/CmsCategory.cs index 9f77ad92..bd22a63a 100644 --- a/Migration.Toolkit.KX12/Models/CmsCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsCategory.cs @@ -1,67 +1,66 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Category")] -[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] -[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] -public partial class CmsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(250)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(250)] - public string? CategoryName { get; set; } - - public string? CategoryDescription { get; set; } - - public int? CategoryCount { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryUserID")] - public int? CategoryUserId { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - [StringLength(1500)] - public string? CategoryNamePath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryOrder { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("CmsCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [ForeignKey("CategoryUserId")] - [InverseProperty("CmsCategories")] - public virtual CmsUser? CategoryUser { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("Categories")] - public virtual ICollection Documents { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Category")] +[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] +[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] +public class CmsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(250)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(250)] + public string? CategoryName { get; set; } + + public string? CategoryDescription { get; set; } + + public int? CategoryCount { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryUserID")] + public int? CategoryUserId { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + [StringLength(1500)] + public string? CategoryNamePath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryOrder { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("CmsCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [ForeignKey("CategoryUserId")] + [InverseProperty("CmsCategories")] + public virtual CmsUser? CategoryUser { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("Categories")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsClass.cs b/Migration.Toolkit.KX12/Models/CmsClass.cs index d60af7e3..e4efa4d0 100644 --- a/Migration.Toolkit.KX12/Models/CmsClass.cs +++ b/Migration.Toolkit.KX12/Models/CmsClass.cs @@ -1,221 +1,220 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Class")] -[Index("ClassDefaultPageTemplateId", Name = "IX_CMS_Class_ClassDefaultPageTemplateID")] -[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] -[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] -[Index("ClassPageTemplateCategoryId", Name = "IX_CMS_Class_ClassPageTemplateCategoryID")] -[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] -[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] -public partial class CmsClass -{ - [Key] - [Column("ClassID")] - public int ClassId { get; set; } - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - public bool ClassUsesVersioning { get; set; } - - public bool ClassIsDocumentType { get; set; } - - public bool ClassIsCoupledClass { get; set; } - - public string ClassXmlSchema { get; set; } = null!; - - public string ClassFormDefinition { get; set; } = null!; - - [StringLength(450)] - public string? ClassEditingPageUrl { get; set; } - - [StringLength(450)] - public string? ClassListPageUrl { get; set; } - - [StringLength(100)] - public string ClassNodeNameSource { get; set; } = null!; - - [StringLength(100)] - public string? ClassTableName { get; set; } - - [StringLength(450)] - public string? ClassViewPageUrl { get; set; } - - [StringLength(450)] - public string? ClassPreviewPageUrl { get; set; } - - public string? ClassFormLayout { get; set; } - - [StringLength(450)] - public string? ClassNewPageUrl { get; set; } - - public bool? ClassShowAsSystemTable { get; set; } - - public bool? ClassUsePublishFromTo { get; set; } - - public bool? ClassShowTemplateSelection { get; set; } - - [Column("ClassSKUMappings")] - public string? ClassSkumappings { get; set; } - - public bool? ClassIsMenuItemType { get; set; } - - [StringLength(100)] - public string? ClassNodeAliasSource { get; set; } - - [Column("ClassDefaultPageTemplateID")] - public int? ClassDefaultPageTemplateId { get; set; } - - public DateTime ClassLastModified { get; set; } - - [Column("ClassGUID")] - public Guid ClassGuid { get; set; } - - [Column("ClassCreateSKU")] - public bool? ClassCreateSku { get; set; } - - public bool? ClassIsProduct { get; set; } - - public bool ClassIsCustomTable { get; set; } - - [StringLength(1000)] - public string? ClassShowColumns { get; set; } - - [StringLength(200)] - public string? ClassSearchTitleColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchContentColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchImageColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchCreationDateColumn { get; set; } - - public string? ClassSearchSettings { get; set; } - - [Column("ClassInheritsFromClassID")] - public int? ClassInheritsFromClassId { get; set; } - - public bool? ClassSearchEnabled { get; set; } - - [Column("ClassSKUDefaultDepartmentName")] - [StringLength(200)] - public string? ClassSkudefaultDepartmentName { get; set; } - - [Column("ClassSKUDefaultDepartmentID")] - public int? ClassSkudefaultDepartmentId { get; set; } - - public string? ClassContactMapping { get; set; } - - public bool? ClassContactOverwriteEnabled { get; set; } - - [Column("ClassSKUDefaultProductType")] - [StringLength(50)] - public string? ClassSkudefaultProductType { get; set; } - - [StringLength(100)] - public string? ClassConnectionString { get; set; } - - public bool? ClassIsProductSection { get; set; } - - [Column("ClassPageTemplateCategoryID")] - public int? ClassPageTemplateCategoryId { get; set; } - - [StringLength(50)] - public string? ClassFormLayoutType { get; set; } - - [Column("ClassVersionGUID")] - [StringLength(50)] - public string? ClassVersionGuid { get; set; } - - [StringLength(100)] - public string? ClassDefaultObjectType { get; set; } - - public bool? ClassIsForm { get; set; } - - [Column("ClassResourceID")] - public int? ClassResourceId { get; set; } - - [StringLength(400)] - public string? ClassCustomizedColumns { get; set; } - - public string? ClassCodeGenerationSettings { get; set; } - - [StringLength(200)] - public string? ClassIconClass { get; set; } - - public bool? ClassIsContentOnly { get; set; } - - [Column("ClassURLPattern")] - [StringLength(200)] - public string? ClassUrlpattern { get; set; } - - [ForeignKey("ClassDefaultPageTemplateId")] - [InverseProperty("CmsClasses")] - public virtual CmsPageTemplate? ClassDefaultPageTemplate { get; set; } - - [ForeignKey("ClassPageTemplateCategoryId")] - [InverseProperty("CmsClasses")] - public virtual CmsPageTemplateCategory? ClassPageTemplateCategory { get; set; } - - [ForeignKey("ClassResourceId")] - [InverseProperty("CmsClasses")] - public virtual CmsResource? ClassResource { get; set; } - - [InverseProperty("FormClass")] - public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); - - [InverseProperty("FormCoupledClass")] - public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); - - [InverseProperty("FormClass")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeClass")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsQueries { get; set; } = new List(); - - [InverseProperty("TransformationClass")] - public virtual ICollection CmsTransformations { get; set; } = new List(); - - [InverseProperty("NodeClass")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("VersionClass")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeClass")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("ParentClassId")] - [InverseProperty("ParentClasses")] - public virtual ICollection ChildClasses { get; set; } = new List(); - - [ForeignKey("ChildClassId")] - [InverseProperty("ChildClasses")] - public virtual ICollection ParentClasses { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Scopes { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Class")] +[Index("ClassDefaultPageTemplateId", Name = "IX_CMS_Class_ClassDefaultPageTemplateID")] +[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] +[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] +[Index("ClassPageTemplateCategoryId", Name = "IX_CMS_Class_ClassPageTemplateCategoryID")] +[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] +[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] +public class CmsClass +{ + [Key] + [Column("ClassID")] + public int ClassId { get; set; } + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + public bool ClassUsesVersioning { get; set; } + + public bool ClassIsDocumentType { get; set; } + + public bool ClassIsCoupledClass { get; set; } + + public string ClassXmlSchema { get; set; } = null!; + + public string ClassFormDefinition { get; set; } = null!; + + [StringLength(450)] + public string? ClassEditingPageUrl { get; set; } + + [StringLength(450)] + public string? ClassListPageUrl { get; set; } + + [StringLength(100)] + public string ClassNodeNameSource { get; set; } = null!; + + [StringLength(100)] + public string? ClassTableName { get; set; } + + [StringLength(450)] + public string? ClassViewPageUrl { get; set; } + + [StringLength(450)] + public string? ClassPreviewPageUrl { get; set; } + + public string? ClassFormLayout { get; set; } + + [StringLength(450)] + public string? ClassNewPageUrl { get; set; } + + public bool? ClassShowAsSystemTable { get; set; } + + public bool? ClassUsePublishFromTo { get; set; } + + public bool? ClassShowTemplateSelection { get; set; } + + [Column("ClassSKUMappings")] + public string? ClassSkumappings { get; set; } + + public bool? ClassIsMenuItemType { get; set; } + + [StringLength(100)] + public string? ClassNodeAliasSource { get; set; } + + [Column("ClassDefaultPageTemplateID")] + public int? ClassDefaultPageTemplateId { get; set; } + + public DateTime ClassLastModified { get; set; } + + [Column("ClassGUID")] + public Guid ClassGuid { get; set; } + + [Column("ClassCreateSKU")] + public bool? ClassCreateSku { get; set; } + + public bool? ClassIsProduct { get; set; } + + public bool ClassIsCustomTable { get; set; } + + [StringLength(1000)] + public string? ClassShowColumns { get; set; } + + [StringLength(200)] + public string? ClassSearchTitleColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchContentColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchImageColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchCreationDateColumn { get; set; } + + public string? ClassSearchSettings { get; set; } + + [Column("ClassInheritsFromClassID")] + public int? ClassInheritsFromClassId { get; set; } + + public bool? ClassSearchEnabled { get; set; } + + [Column("ClassSKUDefaultDepartmentName")] + [StringLength(200)] + public string? ClassSkudefaultDepartmentName { get; set; } + + [Column("ClassSKUDefaultDepartmentID")] + public int? ClassSkudefaultDepartmentId { get; set; } + + public string? ClassContactMapping { get; set; } + + public bool? ClassContactOverwriteEnabled { get; set; } + + [Column("ClassSKUDefaultProductType")] + [StringLength(50)] + public string? ClassSkudefaultProductType { get; set; } + + [StringLength(100)] + public string? ClassConnectionString { get; set; } + + public bool? ClassIsProductSection { get; set; } + + [Column("ClassPageTemplateCategoryID")] + public int? ClassPageTemplateCategoryId { get; set; } + + [StringLength(50)] + public string? ClassFormLayoutType { get; set; } + + [Column("ClassVersionGUID")] + [StringLength(50)] + public string? ClassVersionGuid { get; set; } + + [StringLength(100)] + public string? ClassDefaultObjectType { get; set; } + + public bool? ClassIsForm { get; set; } + + [Column("ClassResourceID")] + public int? ClassResourceId { get; set; } + + [StringLength(400)] + public string? ClassCustomizedColumns { get; set; } + + public string? ClassCodeGenerationSettings { get; set; } + + [StringLength(200)] + public string? ClassIconClass { get; set; } + + public bool? ClassIsContentOnly { get; set; } + + [Column("ClassURLPattern")] + [StringLength(200)] + public string? ClassUrlpattern { get; set; } + + [ForeignKey("ClassDefaultPageTemplateId")] + [InverseProperty("CmsClasses")] + public virtual CmsPageTemplate? ClassDefaultPageTemplate { get; set; } + + [ForeignKey("ClassPageTemplateCategoryId")] + [InverseProperty("CmsClasses")] + public virtual CmsPageTemplateCategory? ClassPageTemplateCategory { get; set; } + + [ForeignKey("ClassResourceId")] + [InverseProperty("CmsClasses")] + public virtual CmsResource? ClassResource { get; set; } + + [InverseProperty("FormClass")] + public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); + + [InverseProperty("FormCoupledClass")] + public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); + + [InverseProperty("FormClass")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeClass")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsQueries { get; set; } = new List(); + + [InverseProperty("TransformationClass")] + public virtual ICollection CmsTransformations { get; set; } = new List(); + + [InverseProperty("NodeClass")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("VersionClass")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeClass")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("ParentClassId")] + [InverseProperty("ParentClasses")] + public virtual ICollection ChildClasses { get; set; } = new List(); + + [ForeignKey("ChildClassId")] + [InverseProperty("ChildClasses")] + public virtual ICollection ParentClasses { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Scopes { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsConsent.cs b/Migration.Toolkit.KX12/Models/CmsConsent.cs index c36d2e91..3a53ff5c 100644 --- a/Migration.Toolkit.KX12/Models/CmsConsent.cs +++ b/Migration.Toolkit.KX12/Models/CmsConsent.cs @@ -1,36 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Consent")] -public partial class CmsConsent -{ - [Key] - [Column("ConsentID")] - public int ConsentId { get; set; } - - [StringLength(200)] - public string ConsentDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ConsentName { get; set; } = null!; - - public string ConsentContent { get; set; } = null!; - - public Guid ConsentGuid { get; set; } - - public DateTime ConsentLastModified { get; set; } - - [StringLength(100)] - public string ConsentHash { get; set; } = null!; - - [InverseProperty("ConsentAgreementConsent")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [InverseProperty("ConsentArchiveConsent")] - public virtual ICollection CmsConsentArchives { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Consent")] +public class CmsConsent +{ + [Key] + [Column("ConsentID")] + public int ConsentId { get; set; } + + [StringLength(200)] + public string ConsentDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ConsentName { get; set; } = null!; + + public string ConsentContent { get; set; } = null!; + + public Guid ConsentGuid { get; set; } + + public DateTime ConsentLastModified { get; set; } + + [StringLength(100)] + public string ConsentHash { get; set; } = null!; + + [InverseProperty("ConsentAgreementConsent")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [InverseProperty("ConsentArchiveConsent")] + public virtual ICollection CmsConsentArchives { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs index 8690fa2c..641bd286 100644 --- a/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs +++ b/Migration.Toolkit.KX12/Models/CmsConsentAgreement.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ConsentAgreement")] -[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] -public partial class CmsConsentAgreement -{ - [Key] - [Column("ConsentAgreementID")] - public int ConsentAgreementId { get; set; } - - public Guid ConsentAgreementGuid { get; set; } - - public bool ConsentAgreementRevoked { get; set; } - - [Column("ConsentAgreementContactID")] - public int ConsentAgreementContactId { get; set; } - - [Column("ConsentAgreementConsentID")] - public int ConsentAgreementConsentId { get; set; } - - [StringLength(100)] - public string? ConsentAgreementConsentHash { get; set; } - - public DateTime ConsentAgreementTime { get; set; } - - [ForeignKey("ConsentAgreementConsentId")] - [InverseProperty("CmsConsentAgreements")] - public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; - - [ForeignKey("ConsentAgreementContactId")] - [InverseProperty("CmsConsentAgreements")] - public virtual OmContact ConsentAgreementContact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ConsentAgreement")] +[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] +public class CmsConsentAgreement +{ + [Key] + [Column("ConsentAgreementID")] + public int ConsentAgreementId { get; set; } + + public Guid ConsentAgreementGuid { get; set; } + + public bool ConsentAgreementRevoked { get; set; } + + [Column("ConsentAgreementContactID")] + public int ConsentAgreementContactId { get; set; } + + [Column("ConsentAgreementConsentID")] + public int ConsentAgreementConsentId { get; set; } + + [StringLength(100)] + public string? ConsentAgreementConsentHash { get; set; } + + public DateTime ConsentAgreementTime { get; set; } + + [ForeignKey("ConsentAgreementConsentId")] + [InverseProperty("CmsConsentAgreements")] + public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; + + [ForeignKey("ConsentAgreementContactId")] + [InverseProperty("CmsConsentAgreements")] + public virtual OmContact ConsentAgreementContact { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs b/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs index fa3d1391..d56348eb 100644 --- a/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs +++ b/Migration.Toolkit.KX12/Models/CmsConsentArchive.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ConsentArchive")] -[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] -public partial class CmsConsentArchive -{ - [Key] - [Column("ConsentArchiveID")] - public int ConsentArchiveId { get; set; } - - public Guid ConsentArchiveGuid { get; set; } - - public DateTime ConsentArchiveLastModified { get; set; } - - [Column("ConsentArchiveConsentID")] - public int ConsentArchiveConsentId { get; set; } - - [StringLength(100)] - public string ConsentArchiveHash { get; set; } = null!; - - public string ConsentArchiveContent { get; set; } = null!; - - [ForeignKey("ConsentArchiveConsentId")] - [InverseProperty("CmsConsentArchives")] - public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ConsentArchive")] +[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] +public class CmsConsentArchive +{ + [Key] + [Column("ConsentArchiveID")] + public int ConsentArchiveId { get; set; } + + public Guid ConsentArchiveGuid { get; set; } + + public DateTime ConsentArchiveLastModified { get; set; } + + [Column("ConsentArchiveConsentID")] + public int ConsentArchiveConsentId { get; set; } + + [StringLength(100)] + public string ConsentArchiveHash { get; set; } = null!; + + public string ConsentArchiveContent { get; set; } = null!; + + [ForeignKey("ConsentArchiveConsentId")] + [InverseProperty("CmsConsentArchives")] + public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsCountry.cs b/Migration.Toolkit.KX12/Models/CmsCountry.cs index f90b9ea6..0a388c7f 100644 --- a/Migration.Toolkit.KX12/Models/CmsCountry.cs +++ b/Migration.Toolkit.KX12/Models/CmsCountry.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Country")] -public partial class CmsCountry -{ - [Key] - [Column("CountryID")] - public int CountryId { get; set; } - - [StringLength(200)] - public string CountryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CountryName { get; set; } = null!; - - [Column("CountryGUID")] - public Guid CountryGuid { get; set; } - - public DateTime CountryLastModified { get; set; } - - [StringLength(2)] - public string? CountryTwoLetterCode { get; set; } - - [StringLength(3)] - public string? CountryThreeLetterCode { get; set; } - - [InverseProperty("Country")] - public virtual ICollection CmsStates { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("Country")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("AccountCountry")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactCountry")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Country")] +public class CmsCountry +{ + [Key] + [Column("CountryID")] + public int CountryId { get; set; } + + [StringLength(200)] + public string CountryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CountryName { get; set; } = null!; + + [Column("CountryGUID")] + public Guid CountryGuid { get; set; } + + public DateTime CountryLastModified { get; set; } + + [StringLength(2)] + public string? CountryTwoLetterCode { get; set; } + + [StringLength(3)] + public string? CountryThreeLetterCode { get; set; } + + [InverseProperty("Country")] + public virtual ICollection CmsStates { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("Country")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("AccountCountry")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactCountry")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs b/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs index fedab3d2..20235d51 100644 --- a/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs +++ b/Migration.Toolkit.KX12/Models/CmsCssStylesheet.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_CssStylesheet")] -[Index("StylesheetName", Name = "IX_CMS_CssStylesheet_StylesheetName")] -public partial class CmsCssStylesheet -{ - [Key] - [Column("StylesheetID")] - public int StylesheetId { get; set; } - - [StringLength(200)] - public string StylesheetDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StylesheetName { get; set; } = null!; - - public string? StylesheetText { get; set; } - - [Column("StylesheetVersionGUID")] - public Guid? StylesheetVersionGuid { get; set; } - - [Column("StylesheetGUID")] - public Guid? StylesheetGuid { get; set; } - - public DateTime StylesheetLastModified { get; set; } - - public string? StylesheetDynamicCode { get; set; } - - [StringLength(200)] - public string? StylesheetDynamicLanguage { get; set; } - - [InverseProperty("DocumentStylesheet")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("SiteDefaultEditorStylesheetNavigation")] - public virtual ICollection CmsSiteSiteDefaultEditorStylesheetNavigations { get; set; } = new List(); - - [InverseProperty("SiteDefaultStylesheet")] - public virtual ICollection CmsSiteSiteDefaultStylesheets { get; set; } = new List(); - - [ForeignKey("StylesheetId")] - [InverseProperty("Stylesheets")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_CssStylesheet")] +[Index("StylesheetName", Name = "IX_CMS_CssStylesheet_StylesheetName")] +public class CmsCssStylesheet +{ + [Key] + [Column("StylesheetID")] + public int StylesheetId { get; set; } + + [StringLength(200)] + public string StylesheetDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StylesheetName { get; set; } = null!; + + public string? StylesheetText { get; set; } + + [Column("StylesheetVersionGUID")] + public Guid? StylesheetVersionGuid { get; set; } + + [Column("StylesheetGUID")] + public Guid? StylesheetGuid { get; set; } + + public DateTime StylesheetLastModified { get; set; } + + public string? StylesheetDynamicCode { get; set; } + + [StringLength(200)] + public string? StylesheetDynamicLanguage { get; set; } + + [InverseProperty("DocumentStylesheet")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("SiteDefaultEditorStylesheetNavigation")] + public virtual ICollection CmsSiteSiteDefaultEditorStylesheetNavigations { get; set; } = new List(); + + [InverseProperty("SiteDefaultStylesheet")] + public virtual ICollection CmsSiteSiteDefaultStylesheets { get; set; } = new List(); + + [ForeignKey("StylesheetId")] + [InverseProperty("Stylesheets")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsCulture.cs b/Migration.Toolkit.KX12/Models/CmsCulture.cs index 753bb968..14814c96 100644 --- a/Migration.Toolkit.KX12/Models/CmsCulture.cs +++ b/Migration.Toolkit.KX12/Models/CmsCulture.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Culture")] -[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] -[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] -public partial class CmsCulture -{ - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; - - [StringLength(200)] - public string CultureShortName { get; set; } = null!; - - [Column("CultureGUID")] - public Guid CultureGuid { get; set; } - - public DateTime CultureLastModified { get; set; } - - [StringLength(100)] - public string? CultureAlias { get; set; } - - [Column("CultureIsUICulture")] - public bool? CultureIsUiculture { get; set; } - - [InverseProperty("PageTemplateScopeCulture")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("TranslationCulture")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); - - [InverseProperty("Culture")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("ScopeCulture")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("IndexCultureId")] - [InverseProperty("IndexCultures")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Sites { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Words { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Culture")] +[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] +[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] +public class CmsCulture +{ + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; + + [StringLength(200)] + public string CultureShortName { get; set; } = null!; + + [Column("CultureGUID")] + public Guid CultureGuid { get; set; } + + public DateTime CultureLastModified { get; set; } + + [StringLength(100)] + public string? CultureAlias { get; set; } + + [Column("CultureIsUICulture")] + public bool? CultureIsUiculture { get; set; } + + [InverseProperty("PageTemplateScopeCulture")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("TranslationCulture")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); + + [InverseProperty("Culture")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("ScopeCulture")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("IndexCultureId")] + [InverseProperty("IndexCultures")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Sites { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Words { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs b/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs index 9a28ac97..d33cf7dc 100644 --- a/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs +++ b/Migration.Toolkit.KX12/Models/CmsDeviceProfile.cs @@ -1,45 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_DeviceProfile")] -public partial class CmsDeviceProfile -{ - [Key] - [Column("ProfileID")] - public int ProfileId { get; set; } - - [StringLength(100)] - public string ProfileName { get; set; } = null!; - - [StringLength(200)] - public string ProfileDisplayName { get; set; } = null!; - - public int? ProfileOrder { get; set; } - - public string? ProfileMacro { get; set; } - - public string? ProfileUserAgents { get; set; } - - [Required] - public bool? ProfileEnabled { get; set; } - - public int? ProfilePreviewWidth { get; set; } - - public int? ProfilePreviewHeight { get; set; } - - [Column("ProfileGUID")] - public Guid? ProfileGuid { get; set; } - - public DateTime? ProfileLastModified { get; set; } - - [InverseProperty("DeviceProfile")] - public virtual ICollection CmsDeviceProfileLayouts { get; set; } = new List(); - - [InverseProperty("Profile")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_DeviceProfile")] +public class CmsDeviceProfile +{ + [Key] + [Column("ProfileID")] + public int ProfileId { get; set; } + + [StringLength(100)] + public string ProfileName { get; set; } = null!; + + [StringLength(200)] + public string ProfileDisplayName { get; set; } = null!; + + public int? ProfileOrder { get; set; } + + public string? ProfileMacro { get; set; } + + public string? ProfileUserAgents { get; set; } + + [Required] + public bool? ProfileEnabled { get; set; } + + public int? ProfilePreviewWidth { get; set; } + + public int? ProfilePreviewHeight { get; set; } + + [Column("ProfileGUID")] + public Guid? ProfileGuid { get; set; } + + public DateTime? ProfileLastModified { get; set; } + + [InverseProperty("DeviceProfile")] + public virtual ICollection CmsDeviceProfileLayouts { get; set; } = new List(); + + [InverseProperty("Profile")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs b/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs index b56676b2..4c94c56f 100644 --- a/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs +++ b/Migration.Toolkit.KX12/Models/CmsDeviceProfileLayout.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_DeviceProfileLayout")] -[Index("DeviceProfileId", Name = "IX_CMS_DeviceProfileLayout_DeviceProfileID")] -[Index("SourceLayoutId", Name = "IX_CMS_DeviceProfileLayout_SourceLayoutID")] -[Index("TargetLayoutId", Name = "IX_CMS_DeviceProfileLayout_TargetLayoutID")] -public partial class CmsDeviceProfileLayout -{ - [Key] - [Column("DeviceProfileLayoutID")] - public int DeviceProfileLayoutId { get; set; } - - [Column("DeviceProfileID")] - public int DeviceProfileId { get; set; } - - [Column("SourceLayoutID")] - public int SourceLayoutId { get; set; } - - [Column("TargetLayoutID")] - public int TargetLayoutId { get; set; } - - [Column("DeviceProfileLayoutGUID")] - public Guid DeviceProfileLayoutGuid { get; set; } - - public DateTime DeviceProfileLayoutLastModified { get; set; } - - [ForeignKey("DeviceProfileId")] - [InverseProperty("CmsDeviceProfileLayouts")] - public virtual CmsDeviceProfile DeviceProfile { get; set; } = null!; - - [ForeignKey("SourceLayoutId")] - [InverseProperty("CmsDeviceProfileLayoutSourceLayouts")] - public virtual CmsLayout SourceLayout { get; set; } = null!; - - [ForeignKey("TargetLayoutId")] - [InverseProperty("CmsDeviceProfileLayoutTargetLayouts")] - public virtual CmsLayout TargetLayout { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_DeviceProfileLayout")] +[Index("DeviceProfileId", Name = "IX_CMS_DeviceProfileLayout_DeviceProfileID")] +[Index("SourceLayoutId", Name = "IX_CMS_DeviceProfileLayout_SourceLayoutID")] +[Index("TargetLayoutId", Name = "IX_CMS_DeviceProfileLayout_TargetLayoutID")] +public class CmsDeviceProfileLayout +{ + [Key] + [Column("DeviceProfileLayoutID")] + public int DeviceProfileLayoutId { get; set; } + + [Column("DeviceProfileID")] + public int DeviceProfileId { get; set; } + + [Column("SourceLayoutID")] + public int SourceLayoutId { get; set; } + + [Column("TargetLayoutID")] + public int TargetLayoutId { get; set; } + + [Column("DeviceProfileLayoutGUID")] + public Guid DeviceProfileLayoutGuid { get; set; } + + public DateTime DeviceProfileLayoutLastModified { get; set; } + + [ForeignKey("DeviceProfileId")] + [InverseProperty("CmsDeviceProfileLayouts")] + public virtual CmsDeviceProfile DeviceProfile { get; set; } = null!; + + [ForeignKey("SourceLayoutId")] + [InverseProperty("CmsDeviceProfileLayoutSourceLayouts")] + public virtual CmsLayout SourceLayout { get; set; } = null!; + + [ForeignKey("TargetLayoutId")] + [InverseProperty("CmsDeviceProfileLayoutTargetLayouts")] + public virtual CmsLayout TargetLayout { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsDocument.cs b/Migration.Toolkit.KX12/Models/CmsDocument.cs index 1b3b9b7b..a5c56a21 100644 --- a/Migration.Toolkit.KX12/Models/CmsDocument.cs +++ b/Migration.Toolkit.KX12/Models/CmsDocument.cs @@ -1,294 +1,293 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Document")] -[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] -[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] -[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] -[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] -[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] -[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] -[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] -[Index("DocumentPageTemplateId", Name = "IX_CMS_Document_DocumentPageTemplateID")] -[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] -[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] -[Index("DocumentUrlPath", Name = "IX_CMS_Document_DocumentUrlPath_DocumentID_DocumentNodeID")] -[Index("DocumentWildcardRule", "DocumentPriority", Name = "IX_CMS_Document_DocumentWildcardRule_DocumentPriority")] -[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] -public partial class CmsDocument -{ - [Key] - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - public string? DocumentUrlPath { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public bool DocumentShowInSiteMap { get; set; } - - public bool DocumentMenuItemHideInNavigation { get; set; } - - [StringLength(200)] - public string? DocumentMenuCaption { get; set; } - - [StringLength(100)] - public string? DocumentMenuStyle { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImage { get; set; } - - [Column("DocumentPageTemplateID")] - public int? DocumentPageTemplateId { get; set; } - - [StringLength(450)] - public string? DocumentMenuJavascript { get; set; } - - [StringLength(450)] - public string? DocumentMenuRedirectUrl { get; set; } - - public bool? DocumentUseNamePathForUrlPath { get; set; } - - [Column("DocumentStylesheetID")] - public int? DocumentStylesheetId { get; set; } - - public string? DocumentContent { get; set; } - - [StringLength(100)] - public string? DocumentMenuClass { get; set; } - - [StringLength(200)] - public string? DocumentMenuStyleHighlighted { get; set; } - - [StringLength(100)] - public string? DocumentMenuClassHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImageHighlighted { get; set; } - - public bool? DocumentMenuItemInactive { get; set; } - - public string? DocumentCustomData { get; set; } - - [StringLength(100)] - public string? DocumentExtensions { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - [StringLength(440)] - public string? DocumentWildcardRule { get; set; } - - public string? DocumentWebParts { get; set; } - - public double? DocumentRatingValue { get; set; } - - public int? DocumentRatings { get; set; } - - public int? DocumentPriority { get; set; } - - [StringLength(50)] - public string? DocumentType { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentUseCustomExtensions { get; set; } - - public string? DocumentGroupWebParts { get; set; } - - public bool? DocumentCheckedOutAutomatically { get; set; } - - [StringLength(200)] - public string? DocumentTrackConversionName { get; set; } - - [StringLength(100)] - public string? DocumentConversionValue { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [StringLength(32)] - public string? DocumentHash { get; set; } - - public bool? DocumentLogVisitActivity { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - [StringLength(100)] - public string? DocumentSitemapSettings { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool? DocumentMenuRedirectToFirstChild { get; set; } - - [Required] - public bool? DocumentCanBePublished { get; set; } - - [Required] - public bool? DocumentInheritsStylesheet { get; set; } - - public string? DocumentPageBuilderWidgets { get; set; } - - public string? DocumentPageTemplateConfiguration { get; set; } - - [Column("DocumentABTestConfiguration")] - public string? DocumentAbtestConfiguration { get; set; } - - [InverseProperty("CommentPostDocument")] - public virtual ICollection BlogComments { get; set; } = new List(); - - [InverseProperty("SubscriptionPostDocument")] - public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); - - [InverseProperty("BoardDocument")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("AlternativeUrlDocument")] - public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); - - [InverseProperty("AttachmentDocument")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("PersonalizationDocument")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [ForeignKey("DocumentCheckedOutByUserId")] - [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] - public virtual CmsUser? DocumentCheckedOutByUser { get; set; } - - [ForeignKey("DocumentCheckedOutVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] - public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } - - [ForeignKey("DocumentCreatedByUserId")] - [InverseProperty("CmsDocumentDocumentCreatedByUsers")] - public virtual CmsUser? DocumentCreatedByUser { get; set; } - - [ForeignKey("DocumentModifiedByUserId")] - [InverseProperty("CmsDocumentDocumentModifiedByUsers")] - public virtual CmsUser? DocumentModifiedByUser { get; set; } - - [ForeignKey("DocumentNodeId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTree DocumentNode { get; set; } = null!; - - [ForeignKey("DocumentPageTemplateId")] - [InverseProperty("CmsDocuments")] - public virtual CmsPageTemplate? DocumentPageTemplate { get; set; } - - [ForeignKey("DocumentPublishedVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] - public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } - - [ForeignKey("DocumentStylesheetId")] - [InverseProperty("CmsDocuments")] - public virtual CmsCssStylesheet? DocumentStylesheet { get; set; } - - [ForeignKey("DocumentTagGroupId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTagGroup? DocumentTagGroup { get; set; } - - [ForeignKey("DocumentWorkflowStepId")] - [InverseProperty("CmsDocuments")] - public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } - - [InverseProperty("ForumDocument")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [InverseProperty("VariantDocument")] - public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Categories { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Tags { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Document")] +[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] +[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] +[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] +[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] +[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] +[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] +[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] +[Index("DocumentPageTemplateId", Name = "IX_CMS_Document_DocumentPageTemplateID")] +[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] +[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] +[Index("DocumentUrlPath", Name = "IX_CMS_Document_DocumentUrlPath_DocumentID_DocumentNodeID")] +[Index("DocumentWildcardRule", "DocumentPriority", Name = "IX_CMS_Document_DocumentWildcardRule_DocumentPriority")] +[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] +public class CmsDocument +{ + [Key] + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + public string? DocumentUrlPath { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public bool DocumentShowInSiteMap { get; set; } + + public bool DocumentMenuItemHideInNavigation { get; set; } + + [StringLength(200)] + public string? DocumentMenuCaption { get; set; } + + [StringLength(100)] + public string? DocumentMenuStyle { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImage { get; set; } + + [Column("DocumentPageTemplateID")] + public int? DocumentPageTemplateId { get; set; } + + [StringLength(450)] + public string? DocumentMenuJavascript { get; set; } + + [StringLength(450)] + public string? DocumentMenuRedirectUrl { get; set; } + + public bool? DocumentUseNamePathForUrlPath { get; set; } + + [Column("DocumentStylesheetID")] + public int? DocumentStylesheetId { get; set; } + + public string? DocumentContent { get; set; } + + [StringLength(100)] + public string? DocumentMenuClass { get; set; } + + [StringLength(200)] + public string? DocumentMenuStyleHighlighted { get; set; } + + [StringLength(100)] + public string? DocumentMenuClassHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImageHighlighted { get; set; } + + public bool? DocumentMenuItemInactive { get; set; } + + public string? DocumentCustomData { get; set; } + + [StringLength(100)] + public string? DocumentExtensions { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + [StringLength(440)] + public string? DocumentWildcardRule { get; set; } + + public string? DocumentWebParts { get; set; } + + public double? DocumentRatingValue { get; set; } + + public int? DocumentRatings { get; set; } + + public int? DocumentPriority { get; set; } + + [StringLength(50)] + public string? DocumentType { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentUseCustomExtensions { get; set; } + + public string? DocumentGroupWebParts { get; set; } + + public bool? DocumentCheckedOutAutomatically { get; set; } + + [StringLength(200)] + public string? DocumentTrackConversionName { get; set; } + + [StringLength(100)] + public string? DocumentConversionValue { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [StringLength(32)] + public string? DocumentHash { get; set; } + + public bool? DocumentLogVisitActivity { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + [StringLength(100)] + public string? DocumentSitemapSettings { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool? DocumentMenuRedirectToFirstChild { get; set; } + + [Required] + public bool? DocumentCanBePublished { get; set; } + + [Required] + public bool? DocumentInheritsStylesheet { get; set; } + + public string? DocumentPageBuilderWidgets { get; set; } + + public string? DocumentPageTemplateConfiguration { get; set; } + + [Column("DocumentABTestConfiguration")] + public string? DocumentAbtestConfiguration { get; set; } + + [InverseProperty("CommentPostDocument")] + public virtual ICollection BlogComments { get; set; } = new List(); + + [InverseProperty("SubscriptionPostDocument")] + public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); + + [InverseProperty("BoardDocument")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("AlternativeUrlDocument")] + public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); + + [InverseProperty("AttachmentDocument")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("PersonalizationDocument")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [ForeignKey("DocumentCheckedOutByUserId")] + [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] + public virtual CmsUser? DocumentCheckedOutByUser { get; set; } + + [ForeignKey("DocumentCheckedOutVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] + public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } + + [ForeignKey("DocumentCreatedByUserId")] + [InverseProperty("CmsDocumentDocumentCreatedByUsers")] + public virtual CmsUser? DocumentCreatedByUser { get; set; } + + [ForeignKey("DocumentModifiedByUserId")] + [InverseProperty("CmsDocumentDocumentModifiedByUsers")] + public virtual CmsUser? DocumentModifiedByUser { get; set; } + + [ForeignKey("DocumentNodeId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTree DocumentNode { get; set; } = null!; + + [ForeignKey("DocumentPageTemplateId")] + [InverseProperty("CmsDocuments")] + public virtual CmsPageTemplate? DocumentPageTemplate { get; set; } + + [ForeignKey("DocumentPublishedVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] + public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } + + [ForeignKey("DocumentStylesheetId")] + [InverseProperty("CmsDocuments")] + public virtual CmsCssStylesheet? DocumentStylesheet { get; set; } + + [ForeignKey("DocumentTagGroupId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTagGroup? DocumentTagGroup { get; set; } + + [ForeignKey("DocumentWorkflowStepId")] + [InverseProperty("CmsDocuments")] + public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } + + [InverseProperty("ForumDocument")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [InverseProperty("VariantDocument")] + public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Categories { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Tags { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs b/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs index 97625480..72a4bf79 100644 --- a/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs +++ b/Migration.Toolkit.KX12/Models/CmsDocumentAlias.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_DocumentAlias")] -[Index("AliasNodeId", Name = "IX_CMS_DocumentAlias_AliasNodeID")] -[Index("AliasSiteId", Name = "IX_CMS_DocumentAlias_AliasSiteID")] -[Index("AliasWildcardRule", "AliasPriority", Name = "IX_CMS_DocumentAlias_AliasWildcardRule_AliasPriority")] -[Index("AliasCulture", Name = "IX_CMS_Document_AliasCulture")] -public partial class CmsDocumentAlias -{ - [Key] - [Column("AliasID")] - public int AliasId { get; set; } - - [Column("AliasNodeID")] - public int AliasNodeId { get; set; } - - [StringLength(20)] - public string? AliasCulture { get; set; } - - [Column("AliasURLPath")] - public string? AliasUrlpath { get; set; } - - [StringLength(100)] - public string? AliasExtensions { get; set; } - - [StringLength(440)] - public string? AliasWildcardRule { get; set; } - - public int? AliasPriority { get; set; } - - [Column("AliasGUID")] - public Guid? AliasGuid { get; set; } - - public DateTime AliasLastModified { get; set; } - - [Column("AliasSiteID")] - public int AliasSiteId { get; set; } - - [StringLength(50)] - public string? AliasActionMode { get; set; } - - [ForeignKey("AliasNodeId")] - [InverseProperty("CmsDocumentAliases")] - public virtual CmsTree AliasNode { get; set; } = null!; - - [ForeignKey("AliasSiteId")] - [InverseProperty("CmsDocumentAliases")] - public virtual CmsSite AliasSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_DocumentAlias")] +[Index("AliasNodeId", Name = "IX_CMS_DocumentAlias_AliasNodeID")] +[Index("AliasSiteId", Name = "IX_CMS_DocumentAlias_AliasSiteID")] +[Index("AliasWildcardRule", "AliasPriority", Name = "IX_CMS_DocumentAlias_AliasWildcardRule_AliasPriority")] +[Index("AliasCulture", Name = "IX_CMS_Document_AliasCulture")] +public class CmsDocumentAlias +{ + [Key] + [Column("AliasID")] + public int AliasId { get; set; } + + [Column("AliasNodeID")] + public int AliasNodeId { get; set; } + + [StringLength(20)] + public string? AliasCulture { get; set; } + + [Column("AliasURLPath")] + public string? AliasUrlpath { get; set; } + + [StringLength(100)] + public string? AliasExtensions { get; set; } + + [StringLength(440)] + public string? AliasWildcardRule { get; set; } + + public int? AliasPriority { get; set; } + + [Column("AliasGUID")] + public Guid? AliasGuid { get; set; } + + public DateTime AliasLastModified { get; set; } + + [Column("AliasSiteID")] + public int AliasSiteId { get; set; } + + [StringLength(50)] + public string? AliasActionMode { get; set; } + + [ForeignKey("AliasNodeId")] + [InverseProperty("CmsDocumentAliases")] + public virtual CmsTree AliasNode { get; set; } = null!; + + [ForeignKey("AliasSiteId")] + [InverseProperty("CmsDocumentAliases")] + public virtual CmsSite AliasSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs index 4d87ac14..66f9fdc8 100644 --- a/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs +++ b/Migration.Toolkit.KX12/Models/CmsDocumentTypeScope.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_DocumentTypeScope")] -[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] -public partial class CmsDocumentTypeScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopePath { get; set; } = null!; - - [Column("ScopeSiteID")] - public int? ScopeSiteId { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeGUID")] - public Guid? ScopeGuid { get; set; } - - public bool? ScopeIncludeChildren { get; set; } - - public bool? ScopeAllowAllTypes { get; set; } - - public bool? ScopeAllowLinks { get; set; } - - [Column("ScopeAllowABVariant")] - public bool? ScopeAllowAbvariant { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsDocumentTypeScopes")] - public virtual CmsSite? ScopeSite { get; set; } - - [ForeignKey("ScopeId")] - [InverseProperty("Scopes")] - public virtual ICollection Classes { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_DocumentTypeScope")] +[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] +public class CmsDocumentTypeScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopePath { get; set; } = null!; + + [Column("ScopeSiteID")] + public int? ScopeSiteId { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeGUID")] + public Guid? ScopeGuid { get; set; } + + public bool? ScopeIncludeChildren { get; set; } + + public bool? ScopeAllowAllTypes { get; set; } + + public bool? ScopeAllowLinks { get; set; } + + [Column("ScopeAllowABVariant")] + public bool? ScopeAllowAbvariant { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsDocumentTypeScopes")] + public virtual CmsSite? ScopeSite { get; set; } + + [ForeignKey("ScopeId")] + [InverseProperty("Scopes")] + public virtual ICollection Classes { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsEmail.cs b/Migration.Toolkit.KX12/Models/CmsEmail.cs index 545b82ad..a5c961b1 100644 --- a/Migration.Toolkit.KX12/Models/CmsEmail.cs +++ b/Migration.Toolkit.KX12/Models/CmsEmail.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Email")] -[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] -public partial class CmsEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [StringLength(254)] - public string EmailFrom { get; set; } = null!; - - [StringLength(998)] - public string? EmailTo { get; set; } - - [StringLength(998)] - public string? EmailCc { get; set; } - - [StringLength(998)] - public string? EmailBcc { get; set; } - - [StringLength(450)] - public string EmailSubject { get; set; } = null!; - - public string? EmailBody { get; set; } - - public string? EmailPlainTextBody { get; set; } - - public int EmailFormat { get; set; } - - public int EmailPriority { get; set; } - - [Column("EmailSiteID")] - public int? EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - public DateTime EmailLastModified { get; set; } - - public int? EmailStatus { get; set; } - - public bool? EmailIsMass { get; set; } - - [StringLength(254)] - public string? EmailReplyTo { get; set; } - - public string? EmailHeaders { get; set; } - - public DateTime? EmailCreated { get; set; } - - [InverseProperty("Email")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [ForeignKey("EmailId")] - [InverseProperty("Emails")] - public virtual ICollection Attachments { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Email")] +[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] +public class CmsEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [StringLength(254)] + public string EmailFrom { get; set; } = null!; + + [StringLength(998)] + public string? EmailTo { get; set; } + + [StringLength(998)] + public string? EmailCc { get; set; } + + [StringLength(998)] + public string? EmailBcc { get; set; } + + [StringLength(450)] + public string EmailSubject { get; set; } = null!; + + public string? EmailBody { get; set; } + + public string? EmailPlainTextBody { get; set; } + + public int EmailFormat { get; set; } + + public int EmailPriority { get; set; } + + [Column("EmailSiteID")] + public int? EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + public DateTime EmailLastModified { get; set; } + + public int? EmailStatus { get; set; } + + public bool? EmailIsMass { get; set; } + + [StringLength(254)] + public string? EmailReplyTo { get; set; } + + public string? EmailHeaders { get; set; } + + public DateTime? EmailCreated { get; set; } + + [InverseProperty("Email")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [ForeignKey("EmailId")] + [InverseProperty("Emails")] + public virtual ICollection Attachments { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs index 9f141cb6..c17bd8d9 100644 --- a/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs +++ b/Migration.Toolkit.KX12/Models/CmsEmailAttachment.cs @@ -1,44 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_EmailAttachment")] -public partial class CmsEmailAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[] AttachmentBinary { get; set; } = null!; - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [Column("AttachmentContentID")] - [StringLength(255)] - public string? AttachmentContentId { get; set; } - - [Column("AttachmentSiteID")] - public int? AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentId")] - [InverseProperty("Attachments")] - public virtual ICollection Emails { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_EmailAttachment")] +public class CmsEmailAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[] AttachmentBinary { get; set; } = null!; + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [Column("AttachmentContentID")] + [StringLength(255)] + public string? AttachmentContentId { get; set; } + + [Column("AttachmentSiteID")] + public int? AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentId")] + [InverseProperty("Attachments")] + public virtual ICollection Emails { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs b/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs index d46e194b..8006b6c8 100644 --- a/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs +++ b/Migration.Toolkit.KX12/Models/CmsEmailTemplate.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_EmailTemplate")] -[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] -[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] -public partial class CmsEmailTemplate -{ - [Key] - [Column("EmailTemplateID")] - public int EmailTemplateId { get; set; } - - [StringLength(200)] - public string EmailTemplateName { get; set; } = null!; - - [StringLength(200)] - public string EmailTemplateDisplayName { get; set; } = null!; - - public string? EmailTemplateText { get; set; } - - [Column("EmailTemplateSiteID")] - public int? EmailTemplateSiteId { get; set; } - - [Column("EmailTemplateGUID")] - public Guid EmailTemplateGuid { get; set; } - - public DateTime EmailTemplateLastModified { get; set; } - - public string? EmailTemplatePlainText { get; set; } - - [StringLength(250)] - public string? EmailTemplateSubject { get; set; } - - [StringLength(254)] - public string? EmailTemplateFrom { get; set; } - - [StringLength(998)] - public string? EmailTemplateCc { get; set; } - - [StringLength(998)] - public string? EmailTemplateBcc { get; set; } - - [StringLength(100)] - public string? EmailTemplateType { get; set; } - - public string? EmailTemplateDescription { get; set; } - - [StringLength(254)] - public string? EmailTemplateReplyTo { get; set; } - - [ForeignKey("EmailTemplateSiteId")] - [InverseProperty("CmsEmailTemplates")] - public virtual CmsSite? EmailTemplateSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_EmailTemplate")] +[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] +[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] +public class CmsEmailTemplate +{ + [Key] + [Column("EmailTemplateID")] + public int EmailTemplateId { get; set; } + + [StringLength(200)] + public string EmailTemplateName { get; set; } = null!; + + [StringLength(200)] + public string EmailTemplateDisplayName { get; set; } = null!; + + public string? EmailTemplateText { get; set; } + + [Column("EmailTemplateSiteID")] + public int? EmailTemplateSiteId { get; set; } + + [Column("EmailTemplateGUID")] + public Guid EmailTemplateGuid { get; set; } + + public DateTime EmailTemplateLastModified { get; set; } + + public string? EmailTemplatePlainText { get; set; } + + [StringLength(250)] + public string? EmailTemplateSubject { get; set; } + + [StringLength(254)] + public string? EmailTemplateFrom { get; set; } + + [StringLength(998)] + public string? EmailTemplateCc { get; set; } + + [StringLength(998)] + public string? EmailTemplateBcc { get; set; } + + [StringLength(100)] + public string? EmailTemplateType { get; set; } + + public string? EmailTemplateDescription { get; set; } + + [StringLength(254)] + public string? EmailTemplateReplyTo { get; set; } + + [ForeignKey("EmailTemplateSiteId")] + [InverseProperty("CmsEmailTemplates")] + public virtual CmsSite? EmailTemplateSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsEmailUser.cs b/Migration.Toolkit.KX12/Models/CmsEmailUser.cs index 185c7e92..53a65c96 100644 --- a/Migration.Toolkit.KX12/Models/CmsEmailUser.cs +++ b/Migration.Toolkit.KX12/Models/CmsEmailUser.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("EmailId", "UserId")] -[Table("CMS_EmailUser")] -[Index("Status", Name = "IX_CMS_EmailUser_Status")] -[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] -public partial class CmsEmailUser -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Key] - [Column("UserID")] - public int UserId { get; set; } - - public string? LastSendResult { get; set; } - - public DateTime? LastSendAttempt { get; set; } - - public int? Status { get; set; } - - [ForeignKey("EmailId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsEmail Email { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("EmailId", "UserId")] +[Table("CMS_EmailUser")] +[Index("Status", Name = "IX_CMS_EmailUser_Status")] +[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] +public class CmsEmailUser +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Key] + [Column("UserID")] + public int UserId { get; set; } + + public string? LastSendResult { get; set; } + + public DateTime? LastSendAttempt { get; set; } + + public int? Status { get; set; } + + [ForeignKey("EmailId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsEmail Email { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsEventLog.cs b/Migration.Toolkit.KX12/Models/CmsEventLog.cs index 49aea67e..7b0c05c7 100644 --- a/Migration.Toolkit.KX12/Models/CmsEventLog.cs +++ b/Migration.Toolkit.KX12/Models/CmsEventLog.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_EventLog")] -[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] -public partial class CmsEventLog -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(5)] - public string EventType { get; set; } = null!; - - public DateTime EventTime { get; set; } - - [StringLength(100)] - public string Source { get; set; } = null!; - - [StringLength(100)] - public string EventCode { get; set; } = null!; - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(250)] - public string? UserName { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string? Ipaddress { get; set; } - - [Column("NodeID")] - public int? NodeId { get; set; } - - [StringLength(100)] - public string? DocumentName { get; set; } - - public string? EventDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - public string? EventUrl { get; set; } - - [StringLength(100)] - public string? EventMachineName { get; set; } - - public string? EventUserAgent { get; set; } - - public string? EventUrlReferrer { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_EventLog")] +[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] +public class CmsEventLog +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(5)] + public string EventType { get; set; } = null!; + + public DateTime EventTime { get; set; } + + [StringLength(100)] + public string Source { get; set; } = null!; + + [StringLength(100)] + public string EventCode { get; set; } = null!; + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(250)] + public string? UserName { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string? Ipaddress { get; set; } + + [Column("NodeID")] + public int? NodeId { get; set; } + + [StringLength(100)] + public string? DocumentName { get; set; } + + public string? EventDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + public string? EventUrl { get; set; } + + [StringLength(100)] + public string? EventMachineName { get; set; } + + public string? EventUserAgent { get; set; } + + public string? EventUrlReferrer { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs b/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs index d3128692..064b9784 100644 --- a/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs +++ b/Migration.Toolkit.KX12/Models/CmsExternalLogin.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ExternalLogin")] -[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] -public partial class CmsExternalLogin -{ - [Key] - [Column("ExternalLoginID")] - public int ExternalLoginId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(200)] - public string? LoginProvider { get; set; } - - [StringLength(200)] - public string? IdentityKey { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsExternalLogins")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ExternalLogin")] +[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] +public class CmsExternalLogin +{ + [Key] + [Column("ExternalLoginID")] + public int ExternalLoginId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(200)] + public string? LoginProvider { get; set; } + + [StringLength(200)] + public string? IdentityKey { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsExternalLogins")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsForm.cs b/Migration.Toolkit.KX12/Models/CmsForm.cs index 0b238b65..5eef29cf 100644 --- a/Migration.Toolkit.KX12/Models/CmsForm.cs +++ b/Migration.Toolkit.KX12/Models/CmsForm.cs @@ -1,95 +1,94 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Form")] -[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] -[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] -public partial class CmsForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(100)] - public string FormName { get; set; } = null!; - - [StringLength(998)] - public string? FormSendToEmail { get; set; } - - [StringLength(254)] - public string? FormSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormEmailSubject { get; set; } - - public string? FormEmailTemplate { get; set; } - - public bool? FormEmailAttachUploadedDocs { get; set; } - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public int FormItems { get; set; } - - public string? FormReportFields { get; set; } - - [StringLength(400)] - public string? FormRedirectToUrl { get; set; } - - public string? FormDisplayText { get; set; } - - public bool FormClearAfterSave { get; set; } - - [StringLength(400)] - public string? FormSubmitButtonText { get; set; } - - [Column("FormSiteID")] - public int FormSiteId { get; set; } - - [StringLength(254)] - public string? FormConfirmationEmailField { get; set; } - - public string? FormConfirmationTemplate { get; set; } - - [StringLength(254)] - public string? FormConfirmationSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormConfirmationEmailSubject { get; set; } - - public int? FormAccess { get; set; } - - [StringLength(255)] - public string? FormSubmitButtonImage { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - public bool? FormLogActivity { get; set; } - - public int FormDevelopmentModel { get; set; } - - public string? FormBuilderLayout { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsForms")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormSiteId")] - [InverseProperty("CmsForms")] - public virtual CmsSite FormSite { get; set; } = null!; - - [ForeignKey("FormId")] - [InverseProperty("Forms")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Form")] +[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] +[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] +public class CmsForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(100)] + public string FormName { get; set; } = null!; + + [StringLength(998)] + public string? FormSendToEmail { get; set; } + + [StringLength(254)] + public string? FormSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormEmailSubject { get; set; } + + public string? FormEmailTemplate { get; set; } + + public bool? FormEmailAttachUploadedDocs { get; set; } + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public int FormItems { get; set; } + + public string? FormReportFields { get; set; } + + [StringLength(400)] + public string? FormRedirectToUrl { get; set; } + + public string? FormDisplayText { get; set; } + + public bool FormClearAfterSave { get; set; } + + [StringLength(400)] + public string? FormSubmitButtonText { get; set; } + + [Column("FormSiteID")] + public int FormSiteId { get; set; } + + [StringLength(254)] + public string? FormConfirmationEmailField { get; set; } + + public string? FormConfirmationTemplate { get; set; } + + [StringLength(254)] + public string? FormConfirmationSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormConfirmationEmailSubject { get; set; } + + public int? FormAccess { get; set; } + + [StringLength(255)] + public string? FormSubmitButtonImage { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + public bool? FormLogActivity { get; set; } + + public int FormDevelopmentModel { get; set; } + + public string? FormBuilderLayout { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsForms")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormSiteId")] + [InverseProperty("CmsForms")] + public virtual CmsSite FormSite { get; set; } = null!; + + [ForeignKey("FormId")] + [InverseProperty("Forms")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs b/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs index 35ac02e8..d4acc5a2 100644 --- a/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs +++ b/Migration.Toolkit.KX12/Models/CmsFormUserControl.cs @@ -1,109 +1,108 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_FormUserControl")] -[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] -[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] -[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] -public partial class CmsFormUserControl -{ - [Key] - [Column("UserControlID")] - public int UserControlId { get; set; } - - [StringLength(200)] - public string UserControlDisplayName { get; set; } = null!; - - [StringLength(200)] - public string UserControlCodeName { get; set; } = null!; - - [StringLength(400)] - public string UserControlFileName { get; set; } = null!; - - public bool UserControlForText { get; set; } - - public bool UserControlForLongText { get; set; } - - public bool UserControlForInteger { get; set; } - - public bool UserControlForDecimal { get; set; } - - public bool UserControlForDateTime { get; set; } - - public bool UserControlForBoolean { get; set; } - - public bool UserControlForFile { get; set; } - - public bool UserControlShowInBizForms { get; set; } - - [StringLength(50)] - public string UserControlDefaultDataType { get; set; } = null!; - - public int? UserControlDefaultDataTypeSize { get; set; } - - public bool? UserControlShowInDocumentTypes { get; set; } - - public bool? UserControlShowInSystemTables { get; set; } - - public bool? UserControlShowInWebParts { get; set; } - - public bool? UserControlShowInReports { get; set; } - - [Column("UserControlGUID")] - public Guid UserControlGuid { get; set; } - - public DateTime UserControlLastModified { get; set; } - - public bool UserControlForGuid { get; set; } - - public bool? UserControlShowInCustomTables { get; set; } - - public bool UserControlForVisibility { get; set; } - - public string? UserControlParameters { get; set; } - - public bool UserControlForDocAttachments { get; set; } - - [Column("UserControlResourceID")] - public int? UserControlResourceId { get; set; } - - public int? UserControlType { get; set; } - - [Column("UserControlParentID")] - public int? UserControlParentId { get; set; } - - public string? UserControlDescription { get; set; } - - [Column("UserControlThumbnailGUID")] - public Guid? UserControlThumbnailGuid { get; set; } - - public int? UserControlPriority { get; set; } - - public bool? UserControlIsSystem { get; set; } - - public bool UserControlForBinary { get; set; } - - public bool UserControlForDocRelationships { get; set; } - - [StringLength(200)] - public string? UserControlAssemblyName { get; set; } - - [StringLength(200)] - public string? UserControlClassName { get; set; } - - [InverseProperty("UserControlParent")] - public virtual ICollection InverseUserControlParent { get; set; } = new List(); - - [ForeignKey("UserControlParentId")] - [InverseProperty("InverseUserControlParent")] - public virtual CmsFormUserControl? UserControlParent { get; set; } - - [ForeignKey("UserControlResourceId")] - [InverseProperty("CmsFormUserControls")] - public virtual CmsResource? UserControlResource { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_FormUserControl")] +[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] +[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] +[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] +public class CmsFormUserControl +{ + [Key] + [Column("UserControlID")] + public int UserControlId { get; set; } + + [StringLength(200)] + public string UserControlDisplayName { get; set; } = null!; + + [StringLength(200)] + public string UserControlCodeName { get; set; } = null!; + + [StringLength(400)] + public string UserControlFileName { get; set; } = null!; + + public bool UserControlForText { get; set; } + + public bool UserControlForLongText { get; set; } + + public bool UserControlForInteger { get; set; } + + public bool UserControlForDecimal { get; set; } + + public bool UserControlForDateTime { get; set; } + + public bool UserControlForBoolean { get; set; } + + public bool UserControlForFile { get; set; } + + public bool UserControlShowInBizForms { get; set; } + + [StringLength(50)] + public string UserControlDefaultDataType { get; set; } = null!; + + public int? UserControlDefaultDataTypeSize { get; set; } + + public bool? UserControlShowInDocumentTypes { get; set; } + + public bool? UserControlShowInSystemTables { get; set; } + + public bool? UserControlShowInWebParts { get; set; } + + public bool? UserControlShowInReports { get; set; } + + [Column("UserControlGUID")] + public Guid UserControlGuid { get; set; } + + public DateTime UserControlLastModified { get; set; } + + public bool UserControlForGuid { get; set; } + + public bool? UserControlShowInCustomTables { get; set; } + + public bool UserControlForVisibility { get; set; } + + public string? UserControlParameters { get; set; } + + public bool UserControlForDocAttachments { get; set; } + + [Column("UserControlResourceID")] + public int? UserControlResourceId { get; set; } + + public int? UserControlType { get; set; } + + [Column("UserControlParentID")] + public int? UserControlParentId { get; set; } + + public string? UserControlDescription { get; set; } + + [Column("UserControlThumbnailGUID")] + public Guid? UserControlThumbnailGuid { get; set; } + + public int? UserControlPriority { get; set; } + + public bool? UserControlIsSystem { get; set; } + + public bool UserControlForBinary { get; set; } + + public bool UserControlForDocRelationships { get; set; } + + [StringLength(200)] + public string? UserControlAssemblyName { get; set; } + + [StringLength(200)] + public string? UserControlClassName { get; set; } + + [InverseProperty("UserControlParent")] + public virtual ICollection InverseUserControlParent { get; set; } = new List(); + + [ForeignKey("UserControlParentId")] + [InverseProperty("InverseUserControlParent")] + public virtual CmsFormUserControl? UserControlParent { get; set; } + + [ForeignKey("UserControlResourceId")] + [InverseProperty("CmsFormUserControls")] + public virtual CmsResource? UserControlResource { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs b/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs index be4ea86f..2686bb05 100644 --- a/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs +++ b/Migration.Toolkit.KX12/Models/CmsHelpTopic.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_HelpTopic")] -[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] -public partial class CmsHelpTopic -{ - [Key] - [Column("HelpTopicID")] - public int HelpTopicId { get; set; } - - [Column("HelpTopicUIElementID")] - public int HelpTopicUielementId { get; set; } - - [StringLength(200)] - public string HelpTopicName { get; set; } = null!; - - [StringLength(1023)] - public string HelpTopicLink { get; set; } = null!; - - public DateTime HelpTopicLastModified { get; set; } - - [Column("HelpTopicGUID")] - public Guid HelpTopicGuid { get; set; } - - public int? HelpTopicOrder { get; set; } - - public string? HelpTopicVisibilityCondition { get; set; } - - [ForeignKey("HelpTopicUielementId")] - [InverseProperty("CmsHelpTopics")] - public virtual CmsUielement HelpTopicUielement { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_HelpTopic")] +[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] +public class CmsHelpTopic +{ + [Key] + [Column("HelpTopicID")] + public int HelpTopicId { get; set; } + + [Column("HelpTopicUIElementID")] + public int HelpTopicUielementId { get; set; } + + [StringLength(200)] + public string HelpTopicName { get; set; } = null!; + + [StringLength(1023)] + public string HelpTopicLink { get; set; } = null!; + + public DateTime HelpTopicLastModified { get; set; } + + [Column("HelpTopicGUID")] + public Guid HelpTopicGuid { get; set; } + + public int? HelpTopicOrder { get; set; } + + public string? HelpTopicVisibilityCondition { get; set; } + + [ForeignKey("HelpTopicUielementId")] + [InverseProperty("CmsHelpTopics")] + public virtual CmsUielement HelpTopicUielement { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsLayout.cs b/Migration.Toolkit.KX12/Models/CmsLayout.cs index 883bbb61..82e36314 100644 --- a/Migration.Toolkit.KX12/Models/CmsLayout.cs +++ b/Migration.Toolkit.KX12/Models/CmsLayout.cs @@ -1,63 +1,62 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Layout")] -[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] -public partial class CmsLayout -{ - [Key] - [Column("LayoutID")] - public int LayoutId { get; set; } - - [StringLength(100)] - public string LayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string LayoutDisplayName { get; set; } = null!; - - public string? LayoutDescription { get; set; } - - public string LayoutCode { get; set; } = null!; - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - [Column("LayoutThumbnailGUID")] - public Guid? LayoutThumbnailGuid { get; set; } - - public int? LayoutZoneCount { get; set; } - - public bool? LayoutIsConvertible { get; set; } - - [StringLength(200)] - public string? LayoutIconClass { get; set; } - - [InverseProperty("SourceLayout")] - public virtual ICollection CmsDeviceProfileLayoutSourceLayouts { get; set; } = new List(); - - [InverseProperty("TargetLayout")] - public virtual ICollection CmsDeviceProfileLayoutTargetLayouts { get; set; } = new List(); - - [InverseProperty("PageTemplateLayoutNavigation")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("Layout")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Layout")] +[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] +public class CmsLayout +{ + [Key] + [Column("LayoutID")] + public int LayoutId { get; set; } + + [StringLength(100)] + public string LayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string LayoutDisplayName { get; set; } = null!; + + public string? LayoutDescription { get; set; } + + public string LayoutCode { get; set; } = null!; + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + [Column("LayoutThumbnailGUID")] + public Guid? LayoutThumbnailGuid { get; set; } + + public int? LayoutZoneCount { get; set; } + + public bool? LayoutIsConvertible { get; set; } + + [StringLength(200)] + public string? LayoutIconClass { get; set; } + + [InverseProperty("SourceLayout")] + public virtual ICollection CmsDeviceProfileLayoutSourceLayouts { get; set; } = new List(); + + [InverseProperty("TargetLayout")] + public virtual ICollection CmsDeviceProfileLayoutTargetLayouts { get; set; } = new List(); + + [InverseProperty("PageTemplateLayoutNavigation")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("Layout")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs b/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs index 0aa50dd3..59c2a859 100644 --- a/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs +++ b/Migration.Toolkit.KX12/Models/CmsLicenseKey.cs @@ -1,28 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_LicenseKey")] -public partial class CmsLicenseKey -{ - [Key] - [Column("LicenseKeyID")] - public int LicenseKeyId { get; set; } - - [StringLength(255)] - public string? LicenseDomain { get; set; } - - public string? LicenseKey { get; set; } - - [StringLength(200)] - public string? LicenseEdition { get; set; } - - [StringLength(200)] - public string? LicenseExpiration { get; set; } - - public int? LicenseServers { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_LicenseKey")] +public class CmsLicenseKey +{ + [Key] + [Column("LicenseKeyID")] + public int LicenseKeyId { get; set; } + + [StringLength(255)] + public string? LicenseDomain { get; set; } + + public string? LicenseKey { get; set; } + + [StringLength(200)] + public string? LicenseEdition { get; set; } + + [StringLength(200)] + public string? LicenseExpiration { get; set; } + + public int? LicenseServers { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs index f174c505..039a0858 100644 --- a/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs +++ b/Migration.Toolkit.KX12/Models/CmsMacroIdentity.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_MacroIdentity")] -[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] -public partial class CmsMacroIdentity -{ - [Key] - [Column("MacroIdentityID")] - public int MacroIdentityId { get; set; } - - public Guid MacroIdentityGuid { get; set; } - - public DateTime MacroIdentityLastModified { get; set; } - - [StringLength(200)] - public string MacroIdentityName { get; set; } = null!; - - [Column("MacroIdentityEffectiveUserID")] - public int? MacroIdentityEffectiveUserId { get; set; } - - [InverseProperty("UserMacroIdentityMacroIdentity")] - public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); - - [ForeignKey("MacroIdentityEffectiveUserId")] - [InverseProperty("CmsMacroIdentities")] - public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_MacroIdentity")] +[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] +public class CmsMacroIdentity +{ + [Key] + [Column("MacroIdentityID")] + public int MacroIdentityId { get; set; } + + public Guid MacroIdentityGuid { get; set; } + + public DateTime MacroIdentityLastModified { get; set; } + + [StringLength(200)] + public string MacroIdentityName { get; set; } = null!; + + [Column("MacroIdentityEffectiveUserID")] + public int? MacroIdentityEffectiveUserId { get; set; } + + [InverseProperty("UserMacroIdentityMacroIdentity")] + public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); + + [ForeignKey("MacroIdentityEffectiveUserId")] + [InverseProperty("CmsMacroIdentities")] + public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsMacroRule.cs b/Migration.Toolkit.KX12/Models/CmsMacroRule.cs index cd58722c..71d0e8d3 100644 --- a/Migration.Toolkit.KX12/Models/CmsMacroRule.cs +++ b/Migration.Toolkit.KX12/Models/CmsMacroRule.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_MacroRule")] -public partial class CmsMacroRule -{ - [Key] - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [StringLength(200)] - public string MacroRuleName { get; set; } = null!; - - [StringLength(1000)] - public string MacroRuleText { get; set; } = null!; - - public string? MacroRuleParameters { get; set; } - - [StringLength(100)] - public string? MacroRuleResourceName { get; set; } - - public DateTime MacroRuleLastModified { get; set; } - - [Column("MacroRuleGUID")] - public Guid MacroRuleGuid { get; set; } - - public string MacroRuleCondition { get; set; } = null!; - - [StringLength(500)] - public string MacroRuleDisplayName { get; set; } = null!; - - public bool? MacroRuleIsCustom { get; set; } - - public bool MacroRuleRequiresContext { get; set; } - - [StringLength(450)] - public string? MacroRuleDescription { get; set; } - - [StringLength(2500)] - public string? MacroRuleRequiredData { get; set; } - - public bool? MacroRuleEnabled { get; set; } - - public int? MacroRuleAvailability { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_MacroRule")] +public class CmsMacroRule +{ + [Key] + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [StringLength(200)] + public string MacroRuleName { get; set; } = null!; + + [StringLength(1000)] + public string MacroRuleText { get; set; } = null!; + + public string? MacroRuleParameters { get; set; } + + [StringLength(100)] + public string? MacroRuleResourceName { get; set; } + + public DateTime MacroRuleLastModified { get; set; } + + [Column("MacroRuleGUID")] + public Guid MacroRuleGuid { get; set; } + + public string MacroRuleCondition { get; set; } = null!; + + [StringLength(500)] + public string MacroRuleDisplayName { get; set; } = null!; + + public bool? MacroRuleIsCustom { get; set; } + + public bool MacroRuleRequiresContext { get; set; } + + [StringLength(450)] + public string? MacroRuleDescription { get; set; } + + [StringLength(2500)] + public string? MacroRuleRequiredData { get; set; } + + public bool? MacroRuleEnabled { get; set; } + + public int? MacroRuleAvailability { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsMembership.cs b/Migration.Toolkit.KX12/Models/CmsMembership.cs index c7a305df..5404094e 100644 --- a/Migration.Toolkit.KX12/Models/CmsMembership.cs +++ b/Migration.Toolkit.KX12/Models/CmsMembership.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Membership")] -[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] -public partial class CmsMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [StringLength(200)] - public string MembershipName { get; set; } = null!; - - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - public string? MembershipDescription { get; set; } - - public DateTime MembershipLastModified { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } - - [InverseProperty("Membership")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [ForeignKey("MembershipSiteId")] - [InverseProperty("CmsMemberships")] - public virtual CmsSite? MembershipSite { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("Memberships")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Membership")] +[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] +public class CmsMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [StringLength(200)] + public string MembershipName { get; set; } = null!; + + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + public string? MembershipDescription { get; set; } + + public DateTime MembershipLastModified { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } + + [InverseProperty("Membership")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [ForeignKey("MembershipSiteId")] + [InverseProperty("CmsMemberships")] + public virtual CmsSite? MembershipSite { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("Memberships")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs b/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs index ecbc1938..55b13044 100644 --- a/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs +++ b/Migration.Toolkit.KX12/Models/CmsMembershipUser.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_MembershipUser")] -[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] -[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] -public partial class CmsMembershipUser -{ - [Key] - [Column("MembershipUserID")] - public int MembershipUserId { get; set; } - - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } - - public bool? SendNotification { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsMembership Membership { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_MembershipUser")] +[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] +[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] +public class CmsMembershipUser +{ + [Key] + [Column("MembershipUserID")] + public int MembershipUserId { get; set; } + + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } + + public bool? SendNotification { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsMembership Membership { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsMetaFile.cs b/Migration.Toolkit.KX12/Models/CmsMetaFile.cs index a3a8638e..9d17727d 100644 --- a/Migration.Toolkit.KX12/Models/CmsMetaFile.cs +++ b/Migration.Toolkit.KX12/Models/CmsMetaFile.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_MetaFile")] -[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] -[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] -public partial class CmsMetaFile -{ - [Key] - [Column("MetaFileID")] - public int MetaFileId { get; set; } - - [Column("MetaFileObjectID")] - public int MetaFileObjectId { get; set; } - - [StringLength(100)] - public string MetaFileObjectType { get; set; } = null!; - - [StringLength(100)] - public string? MetaFileGroupName { get; set; } - - [StringLength(250)] - public string MetaFileName { get; set; } = null!; - - [StringLength(50)] - public string MetaFileExtension { get; set; } = null!; - - public int MetaFileSize { get; set; } - - [StringLength(100)] - public string MetaFileMimeType { get; set; } = null!; - - public byte[]? MetaFileBinary { get; set; } - - public int? MetaFileImageWidth { get; set; } - - public int? MetaFileImageHeight { get; set; } - - [Column("MetaFileGUID")] - public Guid MetaFileGuid { get; set; } - - public DateTime MetaFileLastModified { get; set; } - - [Column("MetaFileSiteID")] - public int? MetaFileSiteId { get; set; } - - [StringLength(250)] - public string? MetaFileTitle { get; set; } - - public string? MetaFileDescription { get; set; } - - public string? MetaFileCustomData { get; set; } - - [ForeignKey("MetaFileSiteId")] - [InverseProperty("CmsMetaFiles")] - public virtual CmsSite? MetaFileSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_MetaFile")] +[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] +[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] +public class CmsMetaFile +{ + [Key] + [Column("MetaFileID")] + public int MetaFileId { get; set; } + + [Column("MetaFileObjectID")] + public int MetaFileObjectId { get; set; } + + [StringLength(100)] + public string MetaFileObjectType { get; set; } = null!; + + [StringLength(100)] + public string? MetaFileGroupName { get; set; } + + [StringLength(250)] + public string MetaFileName { get; set; } = null!; + + [StringLength(50)] + public string MetaFileExtension { get; set; } = null!; + + public int MetaFileSize { get; set; } + + [StringLength(100)] + public string MetaFileMimeType { get; set; } = null!; + + public byte[]? MetaFileBinary { get; set; } + + public int? MetaFileImageWidth { get; set; } + + public int? MetaFileImageHeight { get; set; } + + [Column("MetaFileGUID")] + public Guid MetaFileGuid { get; set; } + + public DateTime MetaFileLastModified { get; set; } + + [Column("MetaFileSiteID")] + public int? MetaFileSiteId { get; set; } + + [StringLength(250)] + public string? MetaFileTitle { get; set; } + + public string? MetaFileDescription { get; set; } + + public string? MetaFileCustomData { get; set; } + + [ForeignKey("MetaFileSiteId")] + [InverseProperty("CmsMetaFiles")] + public virtual CmsSite? MetaFileSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs index 60a3fead..11d1ebe3 100644 --- a/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs +++ b/Migration.Toolkit.KX12/Models/CmsModuleLicenseKey.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ModuleLicenseKey")] -[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] -public partial class CmsModuleLicenseKey -{ - [Key] - [Column("ModuleLicenseKeyID")] - public int ModuleLicenseKeyId { get; set; } - - public Guid ModuleLicenseKeyGuid { get; set; } - - public DateTime ModuleLicenseKeyLastModified { get; set; } - - public string ModuleLicenseKeyLicense { get; set; } = null!; - - [Column("ModuleLicenseKeyResourceID")] - public int ModuleLicenseKeyResourceId { get; set; } - - [ForeignKey("ModuleLicenseKeyResourceId")] - [InverseProperty("CmsModuleLicenseKeys")] - public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ModuleLicenseKey")] +[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] +public class CmsModuleLicenseKey +{ + [Key] + [Column("ModuleLicenseKeyID")] + public int ModuleLicenseKeyId { get; set; } + + public Guid ModuleLicenseKeyGuid { get; set; } + + public DateTime ModuleLicenseKeyLastModified { get; set; } + + public string ModuleLicenseKeyLicense { get; set; } = null!; + + [Column("ModuleLicenseKeyResourceID")] + public int ModuleLicenseKeyResourceId { get; set; } + + [ForeignKey("ModuleLicenseKeyResourceId")] + [InverseProperty("CmsModuleLicenseKeys")] + public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs index 563c3f04..aeaa0778 100644 --- a/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs +++ b/Migration.Toolkit.KX12/Models/CmsModuleUsageCounter.cs @@ -1,20 +1,19 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -[Table("CMS_ModuleUsageCounter")] -public partial class CmsModuleUsageCounter -{ - [Column("ModuleUsageCounterID")] - public int ModuleUsageCounterId { get; set; } - - [StringLength(200)] - public string ModuleUsageCounterName { get; set; } = null!; - - public long ModuleUsageCounterValue { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +[Table("CMS_ModuleUsageCounter")] +public class CmsModuleUsageCounter +{ + [Column("ModuleUsageCounterID")] + public int ModuleUsageCounterId { get; set; } + + [StringLength(200)] + public string ModuleUsageCounterName { get; set; } = null!; + + public long ModuleUsageCounterValue { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs b/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs index 5da3cfc6..7fd7f175 100644 --- a/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs +++ b/Migration.Toolkit.KX12/Models/CmsObjectSetting.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ObjectSettings")] -[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] -[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] -[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] -[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] -[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] -public partial class CmsObjectSetting -{ - [Key] - [Column("ObjectSettingsID")] - public int ObjectSettingsId { get; set; } - - public string? ObjectTags { get; set; } - - [Column("ObjectCheckedOutByUserID")] - public int? ObjectCheckedOutByUserId { get; set; } - - public DateTime? ObjectCheckedOutWhen { get; set; } - - [Column("ObjectCheckedOutVersionHistoryID")] - public int? ObjectCheckedOutVersionHistoryId { get; set; } - - [Column("ObjectWorkflowStepID")] - public int? ObjectWorkflowStepId { get; set; } - - [Column("ObjectPublishedVersionHistoryID")] - public int? ObjectPublishedVersionHistoryId { get; set; } - - [Column("ObjectSettingsObjectID")] - public int ObjectSettingsObjectId { get; set; } - - [StringLength(100)] - public string ObjectSettingsObjectType { get; set; } = null!; - - public string? ObjectComments { get; set; } - - public bool? ObjectWorkflowSendEmails { get; set; } - - [ForeignKey("ObjectCheckedOutByUserId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsUser? ObjectCheckedOutByUser { get; set; } - - [ForeignKey("ObjectCheckedOutVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } - - [ForeignKey("ObjectPublishedVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } - - [ForeignKey("ObjectWorkflowStepId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ObjectSettings")] +[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] +[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] +[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] +[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] +[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] +public class CmsObjectSetting +{ + [Key] + [Column("ObjectSettingsID")] + public int ObjectSettingsId { get; set; } + + public string? ObjectTags { get; set; } + + [Column("ObjectCheckedOutByUserID")] + public int? ObjectCheckedOutByUserId { get; set; } + + public DateTime? ObjectCheckedOutWhen { get; set; } + + [Column("ObjectCheckedOutVersionHistoryID")] + public int? ObjectCheckedOutVersionHistoryId { get; set; } + + [Column("ObjectWorkflowStepID")] + public int? ObjectWorkflowStepId { get; set; } + + [Column("ObjectPublishedVersionHistoryID")] + public int? ObjectPublishedVersionHistoryId { get; set; } + + [Column("ObjectSettingsObjectID")] + public int ObjectSettingsObjectId { get; set; } + + [StringLength(100)] + public string ObjectSettingsObjectType { get; set; } = null!; + + public string? ObjectComments { get; set; } + + public bool? ObjectWorkflowSendEmails { get; set; } + + [ForeignKey("ObjectCheckedOutByUserId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsUser? ObjectCheckedOutByUser { get; set; } + + [ForeignKey("ObjectCheckedOutVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } + + [ForeignKey("ObjectPublishedVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } + + [ForeignKey("ObjectWorkflowStepId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs index 0e321dda..71727c6d 100644 --- a/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsObjectVersionHistory.cs @@ -1,73 +1,72 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ObjectVersionHistory")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] -[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] -public partial class CmsObjectVersionHistory -{ - [Key] - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [InverseProperty("ObjectCheckedOutVersionHistory")] - public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("ObjectPublishedVersionHistory")] - public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionModifiedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] - public virtual CmsUser? VersionModifiedByUser { get; set; } - - [ForeignKey("VersionObjectSiteId")] - [InverseProperty("CmsObjectVersionHistories")] - public virtual CmsSite? VersionObjectSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ObjectVersionHistory")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] +[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] +public class CmsObjectVersionHistory +{ + [Key] + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [InverseProperty("ObjectCheckedOutVersionHistory")] + public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("ObjectPublishedVersionHistory")] + public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionModifiedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] + public virtual CmsUser? VersionModifiedByUser { get; set; } + + [ForeignKey("VersionObjectSiteId")] + [InverseProperty("CmsObjectVersionHistories")] + public virtual CmsSite? VersionObjectSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs index aba1bb7f..0ab21e83 100644 --- a/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs +++ b/Migration.Toolkit.KX12/Models/CmsObjectWorkflowTrigger.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ObjectWorkflowTrigger")] -[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] -public partial class CmsObjectWorkflowTrigger -{ - [Key] - [Column("TriggerID")] - public int TriggerId { get; set; } - - [Column("TriggerGUID")] - public Guid TriggerGuid { get; set; } - - public DateTime TriggerLastModified { get; set; } - - public int TriggerType { get; set; } - - public string? TriggerMacroCondition { get; set; } - - [Column("TriggerWorkflowID")] - public int TriggerWorkflowId { get; set; } - - [StringLength(450)] - public string TriggerDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TriggerObjectType { get; set; } = null!; - - public string? TriggerParameters { get; set; } - - [StringLength(100)] - public string? TriggerTargetObjectType { get; set; } - - [Column("TriggerTargetObjectID")] - public int? TriggerTargetObjectId { get; set; } - - [ForeignKey("TriggerWorkflowId")] - [InverseProperty("CmsObjectWorkflowTriggers")] - public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ObjectWorkflowTrigger")] +[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] +public class CmsObjectWorkflowTrigger +{ + [Key] + [Column("TriggerID")] + public int TriggerId { get; set; } + + [Column("TriggerGUID")] + public Guid TriggerGuid { get; set; } + + public DateTime TriggerLastModified { get; set; } + + public int TriggerType { get; set; } + + public string? TriggerMacroCondition { get; set; } + + [Column("TriggerWorkflowID")] + public int TriggerWorkflowId { get; set; } + + [StringLength(450)] + public string TriggerDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TriggerObjectType { get; set; } = null!; + + public string? TriggerParameters { get; set; } + + [StringLength(100)] + public string? TriggerTargetObjectType { get; set; } + + [Column("TriggerTargetObjectID")] + public int? TriggerTargetObjectId { get; set; } + + [ForeignKey("TriggerWorkflowId")] + [InverseProperty("CmsObjectWorkflowTriggers")] + public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs b/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs index 6bbf655a..0b58d415 100644 --- a/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs +++ b/Migration.Toolkit.KX12/Models/CmsOpenIduser.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_OpenIDUser")] -[Index("OpenId", Name = "IX_CMS_OpenIDUser_OpenID")] -[Index("UserId", Name = "IX_CMS_OpenIDUser_UserID")] -public partial class CmsOpenIduser -{ - [Key] - [Column("OpenIDUserID")] - public int OpenIduserId { get; set; } - - [Column("OpenID")] - public string OpenId { get; set; } = null!; - - [Column("OpenIDProviderURL")] - [StringLength(450)] - public string? OpenIdproviderUrl { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsOpenIdusers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_OpenIDUser")] +[Index("OpenId", Name = "IX_CMS_OpenIDUser_OpenID")] +[Index("UserId", Name = "IX_CMS_OpenIDUser_UserID")] +public class CmsOpenIduser +{ + [Key] + [Column("OpenIDUserID")] + public int OpenIduserId { get; set; } + + [Column("OpenID")] + public string OpenId { get; set; } = null!; + + [Column("OpenIDProviderURL")] + [StringLength(450)] + public string? OpenIdproviderUrl { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsOpenIdusers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs index 77e1fcf3..a7201cb3 100644 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs +++ b/Migration.Toolkit.KX12/Models/CmsPageTemplate.cs @@ -1,136 +1,135 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_PageTemplate")] -[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] -[Index("PageTemplateIsReusable", "PageTemplateForAllPages", "PageTemplateShowAsMasterTemplate", Name = "IX_CMS_PageTemplate_PageTemplateIsReusable_PageTemplateForAllPages_PageTemplateShowAsMasterTemplate")] -[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] -[Index("PageTemplateSiteId", "PageTemplateCodeName", "PageTemplateGuid", Name = "IX_CMS_PageTemplate_PageTemplateSiteID_PageTemplateCodeName_PageTemplateGUID")] -public partial class CmsPageTemplate -{ - [Key] - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [StringLength(200)] - public string PageTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PageTemplateCodeName { get; set; } = null!; - - public string? PageTemplateDescription { get; set; } - - [StringLength(400)] - public string? PageTemplateFile { get; set; } - - [Column("PageTemplateCategoryID")] - public int? PageTemplateCategoryId { get; set; } - - [Column("PageTemplateLayoutID")] - public int? PageTemplateLayoutId { get; set; } - - public string? PageTemplateWebParts { get; set; } - - public bool? PageTemplateIsReusable { get; set; } - - public bool? PageTemplateShowAsMasterTemplate { get; set; } - - [StringLength(200)] - public string? PageTemplateInheritPageLevels { get; set; } - - public string? PageTemplateLayout { get; set; } - - [Column("PageTemplateVersionGUID")] - [StringLength(200)] - public string? PageTemplateVersionGuid { get; set; } - - public string? PageTemplateHeader { get; set; } - - [Column("PageTemplateGUID")] - public Guid PageTemplateGuid { get; set; } - - public DateTime PageTemplateLastModified { get; set; } - - [Column("PageTemplateSiteID")] - public int? PageTemplateSiteId { get; set; } - - public bool? PageTemplateForAllPages { get; set; } - - [StringLength(10)] - public string PageTemplateType { get; set; } = null!; - - [StringLength(50)] - public string? PageTemplateLayoutType { get; set; } - - [Column("PageTemplateCSS")] - public string? PageTemplateCss { get; set; } - - public bool? PageTemplateIsAllowedForProductSection { get; set; } - - public bool? PageTemplateInheritParentHeader { get; set; } - - public bool? PageTemplateAllowInheritHeader { get; set; } - - [Column("PageTemplateThumbnailGUID")] - public Guid? PageTemplateThumbnailGuid { get; set; } - - public bool? PageTemplateCloneAsAdHoc { get; set; } - - [Column("PageTemplateNodeGUID")] - public Guid? PageTemplateNodeGuid { get; set; } - - [Column("PageTemplateMasterPageTemplateID")] - public int? PageTemplateMasterPageTemplateId { get; set; } - - public string? PageTemplateProperties { get; set; } - - public bool? PageTemplateIsLayout { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } - - [InverseProperty("ClassDefaultPageTemplate")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("DocumentPageTemplate")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeTemplate")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("PageTemplate")] - public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); - - [InverseProperty("NodeTemplate")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("ElementPageTemplate")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("MvtvariantPageTemplate")] - public virtual ICollection OmMvtvariants { get; set; } = new List(); - - [InverseProperty("VariantPageTemplate")] - public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); - - [ForeignKey("PageTemplateCategoryId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } - - [ForeignKey("PageTemplateLayoutId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } - - [ForeignKey("PageTemplateSiteId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsSite? PageTemplateSite { get; set; } - - [ForeignKey("PageTemplateId")] - [InverseProperty("PageTemplates")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_PageTemplate")] +[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] +[Index("PageTemplateIsReusable", "PageTemplateForAllPages", "PageTemplateShowAsMasterTemplate", Name = "IX_CMS_PageTemplate_PageTemplateIsReusable_PageTemplateForAllPages_PageTemplateShowAsMasterTemplate")] +[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] +[Index("PageTemplateSiteId", "PageTemplateCodeName", "PageTemplateGuid", Name = "IX_CMS_PageTemplate_PageTemplateSiteID_PageTemplateCodeName_PageTemplateGUID")] +public class CmsPageTemplate +{ + [Key] + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [StringLength(200)] + public string PageTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PageTemplateCodeName { get; set; } = null!; + + public string? PageTemplateDescription { get; set; } + + [StringLength(400)] + public string? PageTemplateFile { get; set; } + + [Column("PageTemplateCategoryID")] + public int? PageTemplateCategoryId { get; set; } + + [Column("PageTemplateLayoutID")] + public int? PageTemplateLayoutId { get; set; } + + public string? PageTemplateWebParts { get; set; } + + public bool? PageTemplateIsReusable { get; set; } + + public bool? PageTemplateShowAsMasterTemplate { get; set; } + + [StringLength(200)] + public string? PageTemplateInheritPageLevels { get; set; } + + public string? PageTemplateLayout { get; set; } + + [Column("PageTemplateVersionGUID")] + [StringLength(200)] + public string? PageTemplateVersionGuid { get; set; } + + public string? PageTemplateHeader { get; set; } + + [Column("PageTemplateGUID")] + public Guid PageTemplateGuid { get; set; } + + public DateTime PageTemplateLastModified { get; set; } + + [Column("PageTemplateSiteID")] + public int? PageTemplateSiteId { get; set; } + + public bool? PageTemplateForAllPages { get; set; } + + [StringLength(10)] + public string PageTemplateType { get; set; } = null!; + + [StringLength(50)] + public string? PageTemplateLayoutType { get; set; } + + [Column("PageTemplateCSS")] + public string? PageTemplateCss { get; set; } + + public bool? PageTemplateIsAllowedForProductSection { get; set; } + + public bool? PageTemplateInheritParentHeader { get; set; } + + public bool? PageTemplateAllowInheritHeader { get; set; } + + [Column("PageTemplateThumbnailGUID")] + public Guid? PageTemplateThumbnailGuid { get; set; } + + public bool? PageTemplateCloneAsAdHoc { get; set; } + + [Column("PageTemplateNodeGUID")] + public Guid? PageTemplateNodeGuid { get; set; } + + [Column("PageTemplateMasterPageTemplateID")] + public int? PageTemplateMasterPageTemplateId { get; set; } + + public string? PageTemplateProperties { get; set; } + + public bool? PageTemplateIsLayout { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } + + [InverseProperty("ClassDefaultPageTemplate")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("DocumentPageTemplate")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeTemplate")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("PageTemplate")] + public virtual ICollection CmsTemplateDeviceLayouts { get; set; } = new List(); + + [InverseProperty("NodeTemplate")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("ElementPageTemplate")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("MvtvariantPageTemplate")] + public virtual ICollection OmMvtvariants { get; set; } = new List(); + + [InverseProperty("VariantPageTemplate")] + public virtual ICollection OmPersonalizationVariants { get; set; } = new List(); + + [ForeignKey("PageTemplateCategoryId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } + + [ForeignKey("PageTemplateLayoutId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } + + [ForeignKey("PageTemplateSiteId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsSite? PageTemplateSite { get; set; } + + [ForeignKey("PageTemplateId")] + [InverseProperty("PageTemplates")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs index 903c65b9..f829034e 100644 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsPageTemplateCategory.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_PageTemplateCategory")] -[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] -[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] -public partial class CmsPageTemplateCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(200)] - public string? CategoryName { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public string? CategoryPath { get; set; } - - public int? CategoryLevel { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsPageTemplateCategory? CategoryParent { get; set; } - - [InverseProperty("ClassPageTemplateCategory")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("PageTemplateCategory")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_PageTemplateCategory")] +[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] +[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] +public class CmsPageTemplateCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(200)] + public string? CategoryName { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public string? CategoryPath { get; set; } + + public int? CategoryLevel { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsPageTemplateCategory? CategoryParent { get; set; } + + [InverseProperty("ClassPageTemplateCategory")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("PageTemplateCategory")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs index b66db74e..a9a24a65 100644 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs +++ b/Migration.Toolkit.KX12/Models/CmsPageTemplateConfiguration.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_PageTemplateConfiguration")] -[Index("PageTemplateConfigurationSiteId", Name = "IX_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID")] -public partial class CmsPageTemplateConfiguration -{ - [Key] - [Column("PageTemplateConfigurationID")] - public int PageTemplateConfigurationId { get; set; } - - [Column("PageTemplateConfigurationGUID")] - public Guid PageTemplateConfigurationGuid { get; set; } - - [Column("PageTemplateConfigurationSiteID")] - public int PageTemplateConfigurationSiteId { get; set; } - - public DateTime PageTemplateConfigurationLastModified { get; set; } - - [StringLength(200)] - public string PageTemplateConfigurationName { get; set; } = null!; - - public string? PageTemplateConfigurationDescription { get; set; } - - [Column("PageTemplateConfigurationThumbnailGUID")] - public Guid? PageTemplateConfigurationThumbnailGuid { get; set; } - - public string PageTemplateConfigurationTemplate { get; set; } = null!; - - public string? PageTemplateConfigurationWidgets { get; set; } - - [ForeignKey("PageTemplateConfigurationSiteId")] - [InverseProperty("CmsPageTemplateConfigurations")] - public virtual CmsSite PageTemplateConfigurationSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_PageTemplateConfiguration")] +[Index("PageTemplateConfigurationSiteId", Name = "IX_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID")] +public class CmsPageTemplateConfiguration +{ + [Key] + [Column("PageTemplateConfigurationID")] + public int PageTemplateConfigurationId { get; set; } + + [Column("PageTemplateConfigurationGUID")] + public Guid PageTemplateConfigurationGuid { get; set; } + + [Column("PageTemplateConfigurationSiteID")] + public int PageTemplateConfigurationSiteId { get; set; } + + public DateTime PageTemplateConfigurationLastModified { get; set; } + + [StringLength(200)] + public string PageTemplateConfigurationName { get; set; } = null!; + + public string? PageTemplateConfigurationDescription { get; set; } + + [Column("PageTemplateConfigurationThumbnailGUID")] + public Guid? PageTemplateConfigurationThumbnailGuid { get; set; } + + public string PageTemplateConfigurationTemplate { get; set; } = null!; + + public string? PageTemplateConfigurationWidgets { get; set; } + + [ForeignKey("PageTemplateConfigurationSiteId")] + [InverseProperty("CmsPageTemplateConfigurations")] + public virtual CmsSite PageTemplateConfigurationSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs b/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs index b9637852..68cbab30 100644 --- a/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs +++ b/Migration.Toolkit.KX12/Models/CmsPageTemplateScope.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_PageTemplateScope")] -[Index("PageTemplateScopeClassId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeClassID")] -[Index("PageTemplateScopeCultureId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeCultureID")] -[Index("PageTemplateScopeLevels", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeLevels")] -[Index("PageTemplateScopeSiteId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeSiteID")] -[Index("PageTemplateScopeTemplateId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeTemplateID")] -public partial class CmsPageTemplateScope -{ - [Key] - [Column("PageTemplateScopeID")] - public int PageTemplateScopeId { get; set; } - - public string PageTemplateScopePath { get; set; } = null!; - - public string? PageTemplateScopeLevels { get; set; } - - [Column("PageTemplateScopeCultureID")] - public int? PageTemplateScopeCultureId { get; set; } - - [Column("PageTemplateScopeClassID")] - public int? PageTemplateScopeClassId { get; set; } - - [Column("PageTemplateScopeTemplateID")] - public int PageTemplateScopeTemplateId { get; set; } - - [Column("PageTemplateScopeSiteID")] - public int? PageTemplateScopeSiteId { get; set; } - - public DateTime PageTemplateScopeLastModified { get; set; } - - [Column("PageTemplateScopeGUID")] - public Guid PageTemplateScopeGuid { get; set; } - - [ForeignKey("PageTemplateScopeClassId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsClass? PageTemplateScopeClass { get; set; } - - [ForeignKey("PageTemplateScopeCultureId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsCulture? PageTemplateScopeCulture { get; set; } - - [ForeignKey("PageTemplateScopeSiteId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsSite? PageTemplateScopeSite { get; set; } - - [ForeignKey("PageTemplateScopeTemplateId")] - [InverseProperty("CmsPageTemplateScopes")] - public virtual CmsPageTemplate PageTemplateScopeTemplate { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_PageTemplateScope")] +[Index("PageTemplateScopeClassId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeClassID")] +[Index("PageTemplateScopeCultureId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeCultureID")] +[Index("PageTemplateScopeLevels", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeLevels")] +[Index("PageTemplateScopeSiteId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeSiteID")] +[Index("PageTemplateScopeTemplateId", Name = "IX_CMS_PageTemplateScope_PageTemplateScopeTemplateID")] +public class CmsPageTemplateScope +{ + [Key] + [Column("PageTemplateScopeID")] + public int PageTemplateScopeId { get; set; } + + public string PageTemplateScopePath { get; set; } = null!; + + public string? PageTemplateScopeLevels { get; set; } + + [Column("PageTemplateScopeCultureID")] + public int? PageTemplateScopeCultureId { get; set; } + + [Column("PageTemplateScopeClassID")] + public int? PageTemplateScopeClassId { get; set; } + + [Column("PageTemplateScopeTemplateID")] + public int PageTemplateScopeTemplateId { get; set; } + + [Column("PageTemplateScopeSiteID")] + public int? PageTemplateScopeSiteId { get; set; } + + public DateTime PageTemplateScopeLastModified { get; set; } + + [Column("PageTemplateScopeGUID")] + public Guid PageTemplateScopeGuid { get; set; } + + [ForeignKey("PageTemplateScopeClassId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsClass? PageTemplateScopeClass { get; set; } + + [ForeignKey("PageTemplateScopeCultureId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsCulture? PageTemplateScopeCulture { get; set; } + + [ForeignKey("PageTemplateScopeSiteId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsSite? PageTemplateScopeSite { get; set; } + + [ForeignKey("PageTemplateScopeTemplateId")] + [InverseProperty("CmsPageTemplateScopes")] + public virtual CmsPageTemplate PageTemplateScopeTemplate { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsPermission.cs b/Migration.Toolkit.KX12/Models/CmsPermission.cs index e1168bbf..ca3d9537 100644 --- a/Migration.Toolkit.KX12/Models/CmsPermission.cs +++ b/Migration.Toolkit.KX12/Models/CmsPermission.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Permission")] -[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] -[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] -public partial class CmsPermission -{ - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [StringLength(100)] - public string PermissionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("ClassID")] - public int? ClassId { get; set; } - - [Column("ResourceID")] - public int? ResourceId { get; set; } - - [Column("PermissionGUID")] - public Guid PermissionGuid { get; set; } - - public DateTime PermissionLastModified { get; set; } - - public string? PermissionDescription { get; set; } - - public bool? PermissionDisplayInMatrix { get; set; } - - public int? PermissionOrder { get; set; } - - public bool? PermissionEditableByGlobalAdmin { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsPermissions")] - public virtual CmsClass? Class { get; set; } - - [InverseProperty("Permission")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("CmsPermissions")] - public virtual CmsResource? Resource { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("Permissions")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Permission")] +[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] +[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] +public class CmsPermission +{ + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [StringLength(100)] + public string PermissionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("ClassID")] + public int? ClassId { get; set; } + + [Column("ResourceID")] + public int? ResourceId { get; set; } + + [Column("PermissionGUID")] + public Guid PermissionGuid { get; set; } + + public DateTime PermissionLastModified { get; set; } + + public string? PermissionDescription { get; set; } + + public bool? PermissionDisplayInMatrix { get; set; } + + public int? PermissionOrder { get; set; } + + public bool? PermissionEditableByGlobalAdmin { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsPermissions")] + public virtual CmsClass? Class { get; set; } + + [InverseProperty("Permission")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("CmsPermissions")] + public virtual CmsResource? Resource { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("Permissions")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsPersonalization.cs b/Migration.Toolkit.KX12/Models/CmsPersonalization.cs index 0e0c2a56..4806b696 100644 --- a/Migration.Toolkit.KX12/Models/CmsPersonalization.cs +++ b/Migration.Toolkit.KX12/Models/CmsPersonalization.cs @@ -1,49 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Personalization")] -[Index("PersonalizationId", "PersonalizationUserId", "PersonalizationDocumentId", "PersonalizationDashboardName", Name = "IX_CMS_Personalization_PersonalizationID_PersonalizationUserID_PersonalizationDocumentID_PersonalizationDashboardName", IsUnique = true)] -[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] -[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] -public partial class CmsPersonalization -{ - [Key] - [Column("PersonalizationID")] - public int PersonalizationId { get; set; } - - [Column("PersonalizationGUID")] - public Guid PersonalizationGuid { get; set; } - - public DateTime PersonalizationLastModified { get; set; } - - [Column("PersonalizationUserID")] - public int? PersonalizationUserId { get; set; } - - [Column("PersonalizationDocumentID")] - public int? PersonalizationDocumentId { get; set; } - - public string? PersonalizationWebParts { get; set; } - - [StringLength(200)] - public string? PersonalizationDashboardName { get; set; } - - [Column("PersonalizationSiteID")] - public int? PersonalizationSiteId { get; set; } - - [ForeignKey("PersonalizationDocumentId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsDocument? PersonalizationDocument { get; set; } - - [ForeignKey("PersonalizationSiteId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsSite? PersonalizationSite { get; set; } - - [ForeignKey("PersonalizationUserId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsUser? PersonalizationUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Personalization")] +[Index("PersonalizationId", "PersonalizationUserId", "PersonalizationDocumentId", "PersonalizationDashboardName", Name = "IX_CMS_Personalization_PersonalizationID_PersonalizationUserID_PersonalizationDocumentID_PersonalizationDashboardName", + IsUnique = true)] +[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] +[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] +public class CmsPersonalization +{ + [Key] + [Column("PersonalizationID")] + public int PersonalizationId { get; set; } + + [Column("PersonalizationGUID")] + public Guid PersonalizationGuid { get; set; } + + public DateTime PersonalizationLastModified { get; set; } + + [Column("PersonalizationUserID")] + public int? PersonalizationUserId { get; set; } + + [Column("PersonalizationDocumentID")] + public int? PersonalizationDocumentId { get; set; } + + public string? PersonalizationWebParts { get; set; } + + [StringLength(200)] + public string? PersonalizationDashboardName { get; set; } + + [Column("PersonalizationSiteID")] + public int? PersonalizationSiteId { get; set; } + + [ForeignKey("PersonalizationDocumentId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsDocument? PersonalizationDocument { get; set; } + + [ForeignKey("PersonalizationSiteId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsSite? PersonalizationSite { get; set; } + + [ForeignKey("PersonalizationUserId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsUser? PersonalizationUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsQuery.cs b/Migration.Toolkit.KX12/Models/CmsQuery.cs index fecffa57..b7d28199 100644 --- a/Migration.Toolkit.KX12/Models/CmsQuery.cs +++ b/Migration.Toolkit.KX12/Models/CmsQuery.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Query")] -[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] -public partial class CmsQuery -{ - [Key] - [Column("QueryID")] - public int QueryId { get; set; } - - [StringLength(100)] - public string QueryName { get; set; } = null!; - - [Column("QueryTypeID")] - public int QueryTypeId { get; set; } - - public string QueryText { get; set; } = null!; - - public bool QueryRequiresTransaction { get; set; } - - [Column("ClassID")] - public int? ClassId { get; set; } - - public bool QueryIsLocked { get; set; } - - public DateTime QueryLastModified { get; set; } - - [Column("QueryGUID")] - public Guid QueryGuid { get; set; } - - public bool? QueryIsCustom { get; set; } - - [StringLength(100)] - public string? QueryConnectionString { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsQueries")] - public virtual CmsClass? Class { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Query")] +[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] +public class CmsQuery +{ + [Key] + [Column("QueryID")] + public int QueryId { get; set; } + + [StringLength(100)] + public string QueryName { get; set; } = null!; + + [Column("QueryTypeID")] + public int QueryTypeId { get; set; } + + public string QueryText { get; set; } = null!; + + public bool QueryRequiresTransaction { get; set; } + + [Column("ClassID")] + public int? ClassId { get; set; } + + public bool QueryIsLocked { get; set; } + + public DateTime QueryLastModified { get; set; } + + [Column("QueryGUID")] + public Guid QueryGuid { get; set; } + + public bool? QueryIsCustom { get; set; } + + [StringLength(100)] + public string? QueryConnectionString { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsQueries")] + public virtual CmsClass? Class { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsRelationship.cs b/Migration.Toolkit.KX12/Models/CmsRelationship.cs index 0bbc060a..9d7de1f5 100644 --- a/Migration.Toolkit.KX12/Models/CmsRelationship.cs +++ b/Migration.Toolkit.KX12/Models/CmsRelationship.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Relationship")] -[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] -[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] -[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] -public partial class CmsRelationship -{ - [Key] - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - public string? RelationshipCustomData { get; set; } - - public int? RelationshipOrder { get; set; } - - public bool? RelationshipIsAdHoc { get; set; } - - [ForeignKey("LeftNodeId")] - [InverseProperty("CmsRelationshipLeftNodes")] - public virtual CmsTree LeftNode { get; set; } = null!; - - [ForeignKey("RelationshipNameId")] - [InverseProperty("CmsRelationships")] - public virtual CmsRelationshipName RelationshipName { get; set; } = null!; - - [ForeignKey("RightNodeId")] - [InverseProperty("CmsRelationshipRightNodes")] - public virtual CmsTree RightNode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Relationship")] +[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] +[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] +[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] +public class CmsRelationship +{ + [Key] + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + public string? RelationshipCustomData { get; set; } + + public int? RelationshipOrder { get; set; } + + public bool? RelationshipIsAdHoc { get; set; } + + [ForeignKey("LeftNodeId")] + [InverseProperty("CmsRelationshipLeftNodes")] + public virtual CmsTree LeftNode { get; set; } = null!; + + [ForeignKey("RelationshipNameId")] + [InverseProperty("CmsRelationships")] + public virtual CmsRelationshipName RelationshipName { get; set; } = null!; + + [ForeignKey("RightNodeId")] + [InverseProperty("CmsRelationshipRightNodes")] + public virtual CmsTree RightNode { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs b/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs index 78c0eac6..21dee9dd 100644 --- a/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs +++ b/Migration.Toolkit.KX12/Models/CmsRelationshipName.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_RelationshipName")] -[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] -[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] -public partial class CmsRelationshipName -{ - [Key] - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - public string? RelationshipAllowedObjects { get; set; } - - [Column("RelationshipGUID")] - public Guid RelationshipGuid { get; set; } - - public DateTime RelationshipLastModified { get; set; } - - public bool? RelationshipNameIsAdHoc { get; set; } - - [InverseProperty("RelationshipName")] - public virtual ICollection CmsRelationships { get; set; } = new List(); - - [ForeignKey("RelationshipNameId")] - [InverseProperty("RelationshipNames")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_RelationshipName")] +[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] +[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] +public class CmsRelationshipName +{ + [Key] + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + public string? RelationshipAllowedObjects { get; set; } + + [Column("RelationshipGUID")] + public Guid RelationshipGuid { get; set; } + + public DateTime RelationshipLastModified { get; set; } + + public bool? RelationshipNameIsAdHoc { get; set; } + + [InverseProperty("RelationshipName")] + public virtual ICollection CmsRelationships { get; set; } = new List(); + + [ForeignKey("RelationshipNameId")] + [InverseProperty("RelationshipNames")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsResource.cs b/Migration.Toolkit.KX12/Models/CmsResource.cs index c94c700d..c479b411 100644 --- a/Migration.Toolkit.KX12/Models/CmsResource.cs +++ b/Migration.Toolkit.KX12/Models/CmsResource.cs @@ -1,85 +1,84 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Resource")] -[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] -public partial class CmsResource -{ - [Key] - [Column("ResourceID")] - public int ResourceId { get; set; } - - [StringLength(100)] - public string ResourceDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - public string? ResourceDescription { get; set; } - - public bool? ShowInDevelopment { get; set; } - - [Column("ResourceURL")] - [StringLength(1000)] - public string? ResourceUrl { get; set; } - - [Column("ResourceGUID")] - public Guid ResourceGuid { get; set; } - - public DateTime ResourceLastModified { get; set; } - - public bool? ResourceIsInDevelopment { get; set; } - - public bool? ResourceHasFiles { get; set; } - - [StringLength(200)] - public string? ResourceVersion { get; set; } - - [StringLength(200)] - public string? ResourceAuthor { get; set; } - - [StringLength(50)] - public string? ResourceInstallationState { get; set; } - - [StringLength(50)] - public string? ResourceInstalledVersion { get; set; } - - [InverseProperty("ClassResource")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("UserControlResource")] - public virtual ICollection CmsFormUserControls { get; set; } = new List(); - - [InverseProperty("ModuleLicenseKeyResource")] - public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); - - [InverseProperty("Resource")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("ResourceLibraryResource")] - public virtual ICollection CmsResourceLibraries { get; set; } = new List(); - - [InverseProperty("TaskResource")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("CategoryResource")] - public virtual ICollection CmsSettingsCategories { get; set; } = new List(); - - [InverseProperty("ElementResource")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("WebPartResource")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("ActionResource")] - public virtual ICollection CmsWorkflowActions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("Resources")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Resource")] +[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] +public class CmsResource +{ + [Key] + [Column("ResourceID")] + public int ResourceId { get; set; } + + [StringLength(100)] + public string ResourceDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + public string? ResourceDescription { get; set; } + + public bool? ShowInDevelopment { get; set; } + + [Column("ResourceURL")] + [StringLength(1000)] + public string? ResourceUrl { get; set; } + + [Column("ResourceGUID")] + public Guid ResourceGuid { get; set; } + + public DateTime ResourceLastModified { get; set; } + + public bool? ResourceIsInDevelopment { get; set; } + + public bool? ResourceHasFiles { get; set; } + + [StringLength(200)] + public string? ResourceVersion { get; set; } + + [StringLength(200)] + public string? ResourceAuthor { get; set; } + + [StringLength(50)] + public string? ResourceInstallationState { get; set; } + + [StringLength(50)] + public string? ResourceInstalledVersion { get; set; } + + [InverseProperty("ClassResource")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("UserControlResource")] + public virtual ICollection CmsFormUserControls { get; set; } = new List(); + + [InverseProperty("ModuleLicenseKeyResource")] + public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); + + [InverseProperty("Resource")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("ResourceLibraryResource")] + public virtual ICollection CmsResourceLibraries { get; set; } = new List(); + + [InverseProperty("TaskResource")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("CategoryResource")] + public virtual ICollection CmsSettingsCategories { get; set; } = new List(); + + [InverseProperty("ElementResource")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("WebPartResource")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("ActionResource")] + public virtual ICollection CmsWorkflowActions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("Resources")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs b/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs index 0049e857..dd90f9d1 100644 --- a/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs +++ b/Migration.Toolkit.KX12/Models/CmsResourceLibrary.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ResourceLibrary")] -[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] -public partial class CmsResourceLibrary -{ - [Key] - [Column("ResourceLibraryID")] - public int ResourceLibraryId { get; set; } - - [Column("ResourceLibraryResourceID")] - public int ResourceLibraryResourceId { get; set; } - - [StringLength(200)] - public string ResourceLibraryPath { get; set; } = null!; - - [ForeignKey("ResourceLibraryResourceId")] - [InverseProperty("CmsResourceLibraries")] - public virtual CmsResource ResourceLibraryResource { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ResourceLibrary")] +[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] +public class CmsResourceLibrary +{ + [Key] + [Column("ResourceLibraryID")] + public int ResourceLibraryId { get; set; } + + [Column("ResourceLibraryResourceID")] + public int ResourceLibraryResourceId { get; set; } + + [StringLength(200)] + public string ResourceLibraryPath { get; set; } = null!; + + [ForeignKey("ResourceLibraryResourceId")] + [InverseProperty("CmsResourceLibraries")] + public virtual CmsResource ResourceLibraryResource { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsResourceString.cs b/Migration.Toolkit.KX12/Models/CmsResourceString.cs index 1bcb23d1..1453437b 100644 --- a/Migration.Toolkit.KX12/Models/CmsResourceString.cs +++ b/Migration.Toolkit.KX12/Models/CmsResourceString.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ResourceString")] -[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] -public partial class CmsResourceString -{ - [Key] - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("StringGUID")] - public Guid StringGuid { get; set; } - - [InverseProperty("TranslationString")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ResourceString")] +[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] +public class CmsResourceString +{ + [Key] + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("StringGUID")] + public Guid StringGuid { get; set; } + + [InverseProperty("TranslationString")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs index bc08911f..491ae5d3 100644 --- a/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs +++ b/Migration.Toolkit.KX12/Models/CmsResourceTranslation.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ResourceTranslation")] -[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] -[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] -public partial class CmsResourceTranslation -{ - [Key] - [Column("TranslationID")] - public int TranslationId { get; set; } - - [Column("TranslationStringID")] - public int TranslationStringId { get; set; } - - public string? TranslationText { get; set; } - - [Column("TranslationCultureID")] - public int TranslationCultureId { get; set; } - - [ForeignKey("TranslationCultureId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsCulture TranslationCulture { get; set; } = null!; - - [ForeignKey("TranslationStringId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsResourceString TranslationString { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ResourceTranslation")] +[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] +[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] +public class CmsResourceTranslation +{ + [Key] + [Column("TranslationID")] + public int TranslationId { get; set; } + + [Column("TranslationStringID")] + public int TranslationStringId { get; set; } + + public string? TranslationText { get; set; } + + [Column("TranslationCultureID")] + public int TranslationCultureId { get; set; } + + [ForeignKey("TranslationCultureId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsCulture TranslationCulture { get; set; } = null!; + + [ForeignKey("TranslationStringId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsResourceString TranslationString { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsRole.cs b/Migration.Toolkit.KX12/Models/CmsRole.cs index e83b945f..e6e2ba1a 100644 --- a/Migration.Toolkit.KX12/Models/CmsRole.cs +++ b/Migration.Toolkit.KX12/Models/CmsRole.cs @@ -1,98 +1,97 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Role")] -[Index("RoleGroupId", Name = "IX_CMS_Role_RoleGroupID")] -[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] -[Index("SiteId", "RoleName", "RoleGroupId", Name = "IX_CMS_Role_SiteID_RoleName_RoleGroupID", IsUnique = true)] -public partial class CmsRole -{ - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - public DateTime RoleLastModified { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - public bool? RoleIsGroupAdministrator { get; set; } - - public bool? RoleIsDomain { get; set; } - - [InverseProperty("Role")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("RoleGroupId")] - [InverseProperty("CmsRoles")] - public virtual CommunityGroup? RoleGroup { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsRoles")] - public virtual CmsSite? Site { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Boards { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Elements { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("RolesNavigation")] - public virtual ICollection ElementsNavigation { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Forms { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Memberships { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Permissions { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Polls { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Role")] +[Index("RoleGroupId", Name = "IX_CMS_Role_RoleGroupID")] +[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] +[Index("SiteId", "RoleName", "RoleGroupId", Name = "IX_CMS_Role_SiteID_RoleName_RoleGroupID", IsUnique = true)] +public class CmsRole +{ + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + public DateTime RoleLastModified { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + public bool? RoleIsGroupAdministrator { get; set; } + + public bool? RoleIsDomain { get; set; } + + [InverseProperty("Role")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("RoleGroupId")] + [InverseProperty("CmsRoles")] + public virtual CommunityGroup? RoleGroup { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsRoles")] + public virtual CmsSite? Site { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Boards { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Elements { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("RolesNavigation")] + public virtual ICollection ElementsNavigation { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Forms { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Memberships { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Permissions { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Polls { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs b/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs index fedd7c9d..c9f3da6a 100644 --- a/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs +++ b/Migration.Toolkit.KX12/Models/CmsScheduledTask.cs @@ -1,112 +1,111 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_ScheduledTask")] -[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] -[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] -[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] -[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] -public partial class CmsScheduledTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(200)] - public string TaskName { get; set; } = null!; - - [StringLength(200)] - public string TaskDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TaskAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string? TaskClass { get; set; } - - [StringLength(1000)] - public string TaskInterval { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime? TaskLastRunTime { get; set; } - - public DateTime? TaskNextRunTime { get; set; } - - public string? TaskLastResult { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - public bool? TaskDeleteAfterLastRun { get; set; } - - [StringLength(100)] - public string? TaskServerName { get; set; } - - [Column("TaskGUID")] - public Guid TaskGuid { get; set; } - - public DateTime TaskLastModified { get; set; } - - public int? TaskExecutions { get; set; } - - [Column("TaskResourceID")] - public int? TaskResourceId { get; set; } - - public bool? TaskRunInSeparateThread { get; set; } - - public bool? TaskUseExternalService { get; set; } - - public bool? TaskAllowExternalService { get; set; } - - public DateTime? TaskLastExecutionReset { get; set; } - - [StringLength(400)] - public string? TaskCondition { get; set; } - - public bool? TaskRunIndividually { get; set; } - - [Column("TaskUserID")] - public int? TaskUserId { get; set; } - - public int? TaskType { get; set; } - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [StringLength(200)] - public string? TaskExecutingServerName { get; set; } - - public bool TaskEnabled { get; set; } - - public bool TaskIsRunning { get; set; } - - [InverseProperty("CampaignScheduledTask")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("TestWinnerScheduledTask")] - public virtual ICollection NewsletterAbtests { get; set; } = new List(); - - [InverseProperty("NewsletterDynamicScheduledTask")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [ForeignKey("TaskResourceId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsResource? TaskResource { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsSite? TaskSite { get; set; } - - [ForeignKey("TaskUserId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsUser? TaskUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_ScheduledTask")] +[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] +[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] +[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] +[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] +public class CmsScheduledTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(200)] + public string TaskName { get; set; } = null!; + + [StringLength(200)] + public string TaskDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TaskAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string? TaskClass { get; set; } + + [StringLength(1000)] + public string TaskInterval { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime? TaskLastRunTime { get; set; } + + public DateTime? TaskNextRunTime { get; set; } + + public string? TaskLastResult { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + public bool? TaskDeleteAfterLastRun { get; set; } + + [StringLength(100)] + public string? TaskServerName { get; set; } + + [Column("TaskGUID")] + public Guid TaskGuid { get; set; } + + public DateTime TaskLastModified { get; set; } + + public int? TaskExecutions { get; set; } + + [Column("TaskResourceID")] + public int? TaskResourceId { get; set; } + + public bool? TaskRunInSeparateThread { get; set; } + + public bool? TaskUseExternalService { get; set; } + + public bool? TaskAllowExternalService { get; set; } + + public DateTime? TaskLastExecutionReset { get; set; } + + [StringLength(400)] + public string? TaskCondition { get; set; } + + public bool? TaskRunIndividually { get; set; } + + [Column("TaskUserID")] + public int? TaskUserId { get; set; } + + public int? TaskType { get; set; } + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [StringLength(200)] + public string? TaskExecutingServerName { get; set; } + + public bool TaskEnabled { get; set; } + + public bool TaskIsRunning { get; set; } + + [InverseProperty("CampaignScheduledTask")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("TestWinnerScheduledTask")] + public virtual ICollection NewsletterAbtests { get; set; } = new List(); + + [InverseProperty("NewsletterDynamicScheduledTask")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [ForeignKey("TaskResourceId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsResource? TaskResource { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsSite? TaskSite { get; set; } + + [ForeignKey("TaskUserId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsUser? TaskUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs b/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs index 1ff3570d..59269d3d 100644 --- a/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs +++ b/Migration.Toolkit.KX12/Models/CmsSearchEngine.cs @@ -1,35 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SearchEngine")] -public partial class CmsSearchEngine -{ - [Key] - [Column("SearchEngineID")] - public int SearchEngineId { get; set; } - - [StringLength(200)] - public string SearchEngineDisplayName { get; set; } = null!; - - [StringLength(200)] - public string SearchEngineName { get; set; } = null!; - - [StringLength(450)] - public string SearchEngineDomainRule { get; set; } = null!; - - [StringLength(200)] - public string? SearchEngineKeywordParameter { get; set; } - - [Column("SearchEngineGUID")] - public Guid SearchEngineGuid { get; set; } - - public DateTime SearchEngineLastModified { get; set; } - - [StringLength(200)] - public string? SearchEngineCrawler { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_SearchEngine")] +public class CmsSearchEngine +{ + [Key] + [Column("SearchEngineID")] + public int SearchEngineId { get; set; } + + [StringLength(200)] + public string SearchEngineDisplayName { get; set; } = null!; + + [StringLength(200)] + public string SearchEngineName { get; set; } = null!; + + [StringLength(450)] + public string SearchEngineDomainRule { get; set; } = null!; + + [StringLength(200)] + public string? SearchEngineKeywordParameter { get; set; } + + [Column("SearchEngineGUID")] + public Guid SearchEngineGuid { get; set; } + + public DateTime SearchEngineLastModified { get; set; } + + [StringLength(200)] + public string? SearchEngineCrawler { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs b/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs index a65a6ac5..62749e36 100644 --- a/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs +++ b/Migration.Toolkit.KX12/Models/CmsSearchIndex.cs @@ -1,88 +1,85 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SearchIndex")] -public partial class CmsSearchIndex -{ - [Key] - [Column("IndexID")] - public int IndexId { get; set; } - - [StringLength(200)] - public string IndexName { get; set; } = null!; - - [StringLength(200)] - public string IndexDisplayName { get; set; } = null!; - - [StringLength(200)] - public string? IndexAnalyzerType { get; set; } - - public bool IndexIsCommunityGroup { get; set; } - - public string? IndexSettings { get; set; } - - [Column("IndexGUID")] - public Guid IndexGuid { get; set; } - - public DateTime IndexLastModified { get; set; } - - public DateTime? IndexLastRebuildTime { get; set; } - - [StringLength(200)] - public string IndexType { get; set; } = null!; - - [StringLength(200)] - public string? IndexStopWordsFile { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerAssemblyName { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerClassName { get; set; } - - public int? IndexBatchSize { get; set; } - - [StringLength(10)] - public string? IndexStatus { get; set; } - - public DateTime? IndexLastUpdate { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUserName { get; set; } - - [StringLength(200)] - public string? IndexCrawlerFormsUserName { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUserPassword { get; set; } - - [StringLength(200)] - public string? IndexCrawlerDomain { get; set; } - - public bool? IndexIsOutdated { get; set; } - - [StringLength(200)] - public string IndexProvider { get; set; } = null!; - - [StringLength(200)] - public string? IndexSearchServiceName { get; set; } - - [StringLength(200)] - public string? IndexAdminKey { get; set; } - - [StringLength(200)] - public string? IndexQueryKey { get; set; } - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexCultures { get; set; } = new List(); - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexSites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_SearchIndex")] +public class CmsSearchIndex +{ + [Key] + [Column("IndexID")] + public int IndexId { get; set; } + + [StringLength(200)] + public string IndexName { get; set; } = null!; + + [StringLength(200)] + public string IndexDisplayName { get; set; } = null!; + + [StringLength(200)] + public string? IndexAnalyzerType { get; set; } + + public bool IndexIsCommunityGroup { get; set; } + + public string? IndexSettings { get; set; } + + [Column("IndexGUID")] + public Guid IndexGuid { get; set; } + + public DateTime IndexLastModified { get; set; } + + public DateTime? IndexLastRebuildTime { get; set; } + + [StringLength(200)] + public string IndexType { get; set; } = null!; + + [StringLength(200)] + public string? IndexStopWordsFile { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerAssemblyName { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerClassName { get; set; } + + public int? IndexBatchSize { get; set; } + + [StringLength(10)] + public string? IndexStatus { get; set; } + + public DateTime? IndexLastUpdate { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUserName { get; set; } + + [StringLength(200)] + public string? IndexCrawlerFormsUserName { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUserPassword { get; set; } + + [StringLength(200)] + public string? IndexCrawlerDomain { get; set; } + + public bool? IndexIsOutdated { get; set; } + + [StringLength(200)] + public string IndexProvider { get; set; } = null!; + + [StringLength(200)] + public string? IndexSearchServiceName { get; set; } + + [StringLength(200)] + public string? IndexAdminKey { get; set; } + + [StringLength(200)] + public string? IndexQueryKey { get; set; } + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexCultures { get; set; } = new List(); + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexSites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsSearchTask.cs b/Migration.Toolkit.KX12/Models/CmsSearchTask.cs index 62084292..2dfc1854 100644 --- a/Migration.Toolkit.KX12/Models/CmsSearchTask.cs +++ b/Migration.Toolkit.KX12/Models/CmsSearchTask.cs @@ -1,42 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SearchTask")] -public partial class CmsSearchTask -{ - [Key] - [Column("SearchTaskID")] - public int SearchTaskId { get; set; } - - [StringLength(100)] - public string SearchTaskType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskField { get; set; } - - [StringLength(600)] - public string SearchTaskValue { get; set; } = null!; - - [StringLength(200)] - public string? SearchTaskServerName { get; set; } - - [StringLength(100)] - public string SearchTaskStatus { get; set; } = null!; - - public int SearchTaskPriority { get; set; } - - public DateTime SearchTaskCreated { get; set; } - - public string? SearchTaskErrorMessage { get; set; } - - [Column("SearchTaskRelatedObjectID")] - public int? SearchTaskRelatedObjectId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_SearchTask")] +public class CmsSearchTask +{ + [Key] + [Column("SearchTaskID")] + public int SearchTaskId { get; set; } + + [StringLength(100)] + public string SearchTaskType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskField { get; set; } + + [StringLength(600)] + public string SearchTaskValue { get; set; } = null!; + + [StringLength(200)] + public string? SearchTaskServerName { get; set; } + + [StringLength(100)] + public string SearchTaskStatus { get; set; } = null!; + + public int SearchTaskPriority { get; set; } + + public DateTime SearchTaskCreated { get; set; } + + public string? SearchTaskErrorMessage { get; set; } + + [Column("SearchTaskRelatedObjectID")] + public int? SearchTaskRelatedObjectId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs index cbe90045..cd2209f9 100644 --- a/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs +++ b/Migration.Toolkit.KX12/Models/CmsSearchTaskAzure.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SearchTaskAzure")] -[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] -public partial class CmsSearchTaskAzure -{ - [Key] - [Column("SearchTaskAzureID")] - public int SearchTaskAzureId { get; set; } - - [StringLength(100)] - public string SearchTaskAzureType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskAzureObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskAzureMetadata { get; set; } - - [StringLength(600)] - public string SearchTaskAzureAdditionalData { get; set; } = null!; - - [Column("SearchTaskAzureInitiatorObjectID")] - public int? SearchTaskAzureInitiatorObjectId { get; set; } - - public int SearchTaskAzurePriority { get; set; } - - public string? SearchTaskAzureErrorMessage { get; set; } - - public DateTime SearchTaskAzureCreated { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_SearchTaskAzure")] +[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] +public class CmsSearchTaskAzure +{ + [Key] + [Column("SearchTaskAzureID")] + public int SearchTaskAzureId { get; set; } + + [StringLength(100)] + public string SearchTaskAzureType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskAzureObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskAzureMetadata { get; set; } + + [StringLength(600)] + public string SearchTaskAzureAdditionalData { get; set; } = null!; + + [Column("SearchTaskAzureInitiatorObjectID")] + public int? SearchTaskAzureInitiatorObjectId { get; set; } + + public int SearchTaskAzurePriority { get; set; } + + public string? SearchTaskAzureErrorMessage { get; set; } + + public DateTime SearchTaskAzureCreated { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsSession.cs b/Migration.Toolkit.KX12/Models/CmsSession.cs index f2a80e9f..98b28756 100644 --- a/Migration.Toolkit.KX12/Models/CmsSession.cs +++ b/Migration.Toolkit.KX12/Models/CmsSession.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Session")] -[Index("SessionIdentificator", Name = "IX_CMS_Session_SessionIdentificator", IsUnique = true)] -[Index("SessionSiteId", Name = "IX_CMS_Session_SessionSiteID")] -[Index("SessionUserId", Name = "IX_CMS_Session_SessionUserID")] -[Index("SessionUserIsHidden", Name = "IX_CMS_Session_SessionUserIsHidden")] -public partial class CmsSession -{ - [StringLength(50)] - public string SessionIdentificator { get; set; } = null!; - - [Column("SessionUserID")] - public int? SessionUserId { get; set; } - - [StringLength(450)] - public string? SessionLocation { get; set; } - - public DateTime SessionLastActive { get; set; } - - public DateTime? SessionLastLogon { get; set; } - - public DateTime SessionExpires { get; set; } - - public bool SessionExpired { get; set; } - - [Column("SessionSiteID")] - public int? SessionSiteId { get; set; } - - public bool SessionUserIsHidden { get; set; } - - [StringLength(450)] - public string? SessionFullName { get; set; } - - [StringLength(254)] - public string? SessionEmail { get; set; } - - [StringLength(254)] - public string? SessionUserName { get; set; } - - [StringLength(254)] - public string? SessionNickName { get; set; } - - public DateTime? SessionUserCreated { get; set; } - - [Column("SessionContactID")] - public int? SessionContactId { get; set; } - - [Key] - [Column("SessionID")] - public int SessionId { get; set; } - - [ForeignKey("SessionSiteId")] - [InverseProperty("CmsSessions")] - public virtual CmsSite? SessionSite { get; set; } - - [ForeignKey("SessionUserId")] - [InverseProperty("CmsSessions")] - public virtual CmsUser? SessionUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Session")] +[Index("SessionIdentificator", Name = "IX_CMS_Session_SessionIdentificator", IsUnique = true)] +[Index("SessionSiteId", Name = "IX_CMS_Session_SessionSiteID")] +[Index("SessionUserId", Name = "IX_CMS_Session_SessionUserID")] +[Index("SessionUserIsHidden", Name = "IX_CMS_Session_SessionUserIsHidden")] +public class CmsSession +{ + [StringLength(50)] + public string SessionIdentificator { get; set; } = null!; + + [Column("SessionUserID")] + public int? SessionUserId { get; set; } + + [StringLength(450)] + public string? SessionLocation { get; set; } + + public DateTime SessionLastActive { get; set; } + + public DateTime? SessionLastLogon { get; set; } + + public DateTime SessionExpires { get; set; } + + public bool SessionExpired { get; set; } + + [Column("SessionSiteID")] + public int? SessionSiteId { get; set; } + + public bool SessionUserIsHidden { get; set; } + + [StringLength(450)] + public string? SessionFullName { get; set; } + + [StringLength(254)] + public string? SessionEmail { get; set; } + + [StringLength(254)] + public string? SessionUserName { get; set; } + + [StringLength(254)] + public string? SessionNickName { get; set; } + + public DateTime? SessionUserCreated { get; set; } + + [Column("SessionContactID")] + public int? SessionContactId { get; set; } + + [Key] + [Column("SessionID")] + public int SessionId { get; set; } + + [ForeignKey("SessionSiteId")] + [InverseProperty("CmsSessions")] + public virtual CmsSite? SessionSite { get; set; } + + [ForeignKey("SessionUserId")] + [InverseProperty("CmsSessions")] + public virtual CmsUser? SessionUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs index 7175d95f..95c70713 100644 --- a/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsSettingsCategory.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SettingsCategory")] -[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] -[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] -public partial class CmsSettingsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - public int? CategoryOrder { get; set; } - - [StringLength(100)] - public string? CategoryName { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - [StringLength(200)] - public string? CategoryIconPath { get; set; } - - public bool? CategoryIsGroup { get; set; } - - public bool? CategoryIsCustom { get; set; } - - [Column("CategoryResourceID")] - public int? CategoryResourceId { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsSettingsCategory? CategoryParent { get; set; } - - [ForeignKey("CategoryResourceId")] - [InverseProperty("CmsSettingsCategories")] - public virtual CmsResource? CategoryResource { get; set; } - - [InverseProperty("KeyCategory")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_SettingsCategory")] +[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] +[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] +public class CmsSettingsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + public int? CategoryOrder { get; set; } + + [StringLength(100)] + public string? CategoryName { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + [StringLength(200)] + public string? CategoryIconPath { get; set; } + + public bool? CategoryIsGroup { get; set; } + + public bool? CategoryIsCustom { get; set; } + + [Column("CategoryResourceID")] + public int? CategoryResourceId { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsSettingsCategory? CategoryParent { get; set; } + + [ForeignKey("CategoryResourceId")] + [InverseProperty("CmsSettingsCategories")] + public virtual CmsResource? CategoryResource { get; set; } + + [InverseProperty("KeyCategory")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs b/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs index b9a10ceb..aa148dc7 100644 --- a/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs +++ b/Migration.Toolkit.KX12/Models/CmsSettingsKey.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SettingsKey")] -[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] -[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] -public partial class CmsSettingsKey -{ - [Key] - [Column("KeyID")] - public int KeyId { get; set; } - - [StringLength(100)] - public string KeyName { get; set; } = null!; - - [StringLength(200)] - public string KeyDisplayName { get; set; } = null!; - - public string? KeyDescription { get; set; } - - public string? KeyValue { get; set; } - - [StringLength(50)] - public string KeyType { get; set; } = null!; - - [Column("KeyCategoryID")] - public int? KeyCategoryId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("KeyGUID")] - public Guid KeyGuid { get; set; } - - public DateTime KeyLastModified { get; set; } - - public int? KeyOrder { get; set; } - - public string? KeyDefaultValue { get; set; } - - [StringLength(255)] - public string? KeyValidation { get; set; } - - [StringLength(200)] - public string? KeyEditingControlPath { get; set; } - - public bool? KeyIsGlobal { get; set; } - - public bool? KeyIsCustom { get; set; } - - public bool? KeyIsHidden { get; set; } - - public string? KeyFormControlSettings { get; set; } - - public string? KeyExplanationText { get; set; } - - [ForeignKey("KeyCategoryId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSettingsCategory? KeyCategory { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSite? Site { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_SettingsKey")] +[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] +[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] +public class CmsSettingsKey +{ + [Key] + [Column("KeyID")] + public int KeyId { get; set; } + + [StringLength(100)] + public string KeyName { get; set; } = null!; + + [StringLength(200)] + public string KeyDisplayName { get; set; } = null!; + + public string? KeyDescription { get; set; } + + public string? KeyValue { get; set; } + + [StringLength(50)] + public string KeyType { get; set; } = null!; + + [Column("KeyCategoryID")] + public int? KeyCategoryId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("KeyGUID")] + public Guid KeyGuid { get; set; } + + public DateTime KeyLastModified { get; set; } + + public int? KeyOrder { get; set; } + + public string? KeyDefaultValue { get; set; } + + [StringLength(255)] + public string? KeyValidation { get; set; } + + [StringLength(200)] + public string? KeyEditingControlPath { get; set; } + + public bool? KeyIsGlobal { get; set; } + + public bool? KeyIsCustom { get; set; } + + public bool? KeyIsHidden { get; set; } + + public string? KeyFormControlSettings { get; set; } + + public string? KeyExplanationText { get; set; } + + [ForeignKey("KeyCategoryId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSettingsCategory? KeyCategory { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSite? Site { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsSite.cs b/Migration.Toolkit.KX12/Models/CmsSite.cs index cfb63d59..a79fe0eb 100644 --- a/Migration.Toolkit.KX12/Models/CmsSite.cs +++ b/Migration.Toolkit.KX12/Models/CmsSite.cs @@ -1,414 +1,413 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Site")] -[Index("SiteDefaultEditorStylesheet", Name = "IX_CMS_Site_SiteDefaultEditorStylesheet")] -[Index("SiteDefaultStylesheetId", Name = "IX_CMS_Site_SiteDefaultStylesheetID")] -[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] -[Index("SiteName", Name = "IX_CMS_Site_SiteName")] -public partial class CmsSite -{ - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [Column("SiteDefaultStylesheetID")] - public int? SiteDefaultStylesheetId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - public int? SiteDefaultEditorStylesheet { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - public bool? SiteIsOffline { get; set; } - - [Column("SiteOfflineRedirectURL")] - [StringLength(400)] - public string? SiteOfflineRedirectUrl { get; set; } - - public string? SiteOfflineMessage { get; set; } - - [Column("SitePresentationURL")] - [StringLength(400)] - public string? SitePresentationUrl { get; set; } - - public bool? SiteIsContentOnly { get; set; } - - [InverseProperty("CampaignSite")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("ConversionSite")] - public virtual ICollection AnalyticsConversions { get; set; } = new List(); - - [InverseProperty("StatisticsSite")] - public virtual ICollection AnalyticsStatistics { get; set; } = new List(); - - [InverseProperty("BoardSite")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("ChatNotificationSite")] - public virtual ICollection ChatNotifications { get; set; } = new List(); - - [InverseProperty("ChatOnlineSupportSite")] - public virtual ICollection ChatOnlineSupports { get; set; } = new List(); - - [InverseProperty("ChatOnlineUserSite")] - public virtual ICollection ChatOnlineUsers { get; set; } = new List(); - - [InverseProperty("ChatRoomSite")] - public virtual ICollection ChatRooms { get; set; } = new List(); - - [InverseProperty("ChatSupportCannedResponseSite")] - public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); - - [InverseProperty("ReportSite")] - public virtual ICollection CmsAbuseReports { get; set; } = new List(); - - [InverseProperty("Aclsite")] - public virtual ICollection CmsAcls { get; set; } = new List(); - - [InverseProperty("AlternativeUrlSite")] - public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("StateSite")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("IpaddressSite")] - public virtual ICollection CmsBannedIps { get; set; } = new List(); - - [InverseProperty("BannerCategorySite")] - public virtual ICollection CmsBannerCategories { get; set; } = new List(); - - [InverseProperty("BannerSite")] - public virtual ICollection CmsBanners { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("AliasSite")] - public virtual ICollection CmsDocumentAliases { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); - - [InverseProperty("EmailTemplateSite")] - public virtual ICollection CmsEmailTemplates { get; set; } = new List(); - - [InverseProperty("FormSite")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("MembershipSite")] - public virtual ICollection CmsMemberships { get; set; } = new List(); - - [InverseProperty("MetaFileSite")] - public virtual ICollection CmsMetaFiles { get; set; } = new List(); - - [InverseProperty("VersionObjectSite")] - public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); - - [InverseProperty("PageTemplateConfigurationSite")] - public virtual ICollection CmsPageTemplateConfigurations { get; set; } = new List(); - - [InverseProperty("PageTemplateScopeSite")] - public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); - - [InverseProperty("PageTemplateSite")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("PersonalizationSite")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SessionSite")] - public virtual ICollection CmsSessions { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); - - [InverseProperty("TagGroupSite")] - public virtual ICollection CmsTagGroups { get; set; } = new List(); - - [InverseProperty("NodeLinkedNodeSite")] - public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("BrandSite")] - public virtual ICollection ComBrands { get; set; } = new List(); - - [InverseProperty("CarrierSite")] - public virtual ICollection ComCarriers { get; set; } = new List(); - - [InverseProperty("CollectionSite")] - public virtual ICollection ComCollections { get; set; } = new List(); - - [InverseProperty("CurrencySite")] - public virtual ICollection ComCurrencies { get; set; } = new List(); - - [InverseProperty("EventSite")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("CustomerSite")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("DepartmentSite")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("DiscountSite")] - public virtual ICollection ComDiscounts { get; set; } = new List(); - - [InverseProperty("ExchangeTableSite")] - public virtual ICollection ComExchangeTables { get; set; } = new List(); - - [InverseProperty("GiftCardSite")] - public virtual ICollection ComGiftCards { get; set; } = new List(); - - [InverseProperty("InternalStatusSite")] - public virtual ICollection ComInternalStatuses { get; set; } = new List(); - - [InverseProperty("ManufacturerSite")] - public virtual ICollection ComManufacturers { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountSite")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection ComOptionCategories { get; set; } = new List(); - - [InverseProperty("StatusSite")] - public virtual ICollection ComOrderStatuses { get; set; } = new List(); - - [InverseProperty("OrderSite")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionSite")] - public virtual ICollection ComPaymentOptions { get; set; } = new List(); - - [InverseProperty("PublicStatusSite")] - public virtual ICollection ComPublicStatuses { get; set; } = new List(); - - [InverseProperty("ShippingOptionSite")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("ShoppingCartSite")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("Skusite")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("SupplierSite")] - public virtual ICollection ComSuppliers { get; set; } = new List(); - - [InverseProperty("TaxClassSite")] - public virtual ICollection ComTaxClasses { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("GroupSite")] - public virtual ICollection CommunityGroups { get; set; } = new List(); - - [InverseProperty("ExportSite")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection ExportTasks { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection ForumsAttachments { get; set; } = new List(); - - [InverseProperty("GroupSite")] - public virtual ICollection ForumsForumGroups { get; set; } = new List(); - - [InverseProperty("ForumSite")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection IntegrationTasks { get; set; } = new List(); - - [InverseProperty("FileSite")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("LibrarySite")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); - - [InverseProperty("EmailWidgetSite")] - public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); - - [InverseProperty("EmailSite")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("IssueSite")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterSite")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [InverseProperty("SubscriberSite")] - public virtual ICollection NewsletterSubscribers { get; set; } = new List(); - - [InverseProperty("SubscriptionSite")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NotificationTemplates { get; set; } = new List(); - - [InverseProperty("AbtestSite")] - public virtual ICollection OmAbtests { get; set; } = new List(); - - [InverseProperty("AbvariantSite")] - public virtual ICollection OmAbvariants { get; set; } = new List(); - - [InverseProperty("MvtestSite")] - public virtual ICollection OmMvtests { get; set; } = new List(); - - [InverseProperty("PollSite")] - public virtual ICollection PollsPolls { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionSite")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SharePointConnectionSite")] - public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); - - [InverseProperty("SharePointFileSite")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); - - [InverseProperty("SharePointLibrarySite")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); - - [ForeignKey("SiteDefaultEditorStylesheet")] - [InverseProperty("CmsSiteSiteDefaultEditorStylesheetNavigations")] - public virtual CmsCssStylesheet? SiteDefaultEditorStylesheetNavigation { get; set; } - - [ForeignKey("SiteDefaultStylesheetId")] - [InverseProperty("CmsSiteSiteDefaultStylesheets")] - public virtual CmsCssStylesheet? SiteDefaultStylesheet { get; set; } - - [InverseProperty("FacebookAccountSite")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); - - [InverseProperty("FacebookApplicationSite")] - public virtual ICollection SmFacebookApplications { get; set; } = new List(); - - [InverseProperty("FacebookPostSite")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInApplicationSite")] - public virtual ICollection SmLinkedInApplications { get; set; } = new List(); - - [InverseProperty("LinkedInPostSite")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterAccountSite")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [InverseProperty("TwitterApplicationSite")] - public virtual ICollection SmTwitterApplications { get; set; } = new List(); - - [InverseProperty("TwitterPostSite")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [InverseProperty("ServerSite")] - public virtual ICollection StagingServers { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection StagingTasks { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Classes { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Containers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Cultures { get; set; } = new List(); - - [ForeignKey("IndexSiteId")] - [InverseProperty("IndexSites")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection PageTemplates { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Polls { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection RelationshipNames { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Resources { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Servers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Stylesheets { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Site")] +[Index("SiteDefaultEditorStylesheet", Name = "IX_CMS_Site_SiteDefaultEditorStylesheet")] +[Index("SiteDefaultStylesheetId", Name = "IX_CMS_Site_SiteDefaultStylesheetID")] +[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] +[Index("SiteName", Name = "IX_CMS_Site_SiteName")] +public class CmsSite +{ + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [Column("SiteDefaultStylesheetID")] + public int? SiteDefaultStylesheetId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + public int? SiteDefaultEditorStylesheet { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + public bool? SiteIsOffline { get; set; } + + [Column("SiteOfflineRedirectURL")] + [StringLength(400)] + public string? SiteOfflineRedirectUrl { get; set; } + + public string? SiteOfflineMessage { get; set; } + + [Column("SitePresentationURL")] + [StringLength(400)] + public string? SitePresentationUrl { get; set; } + + public bool? SiteIsContentOnly { get; set; } + + [InverseProperty("CampaignSite")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("ConversionSite")] + public virtual ICollection AnalyticsConversions { get; set; } = new List(); + + [InverseProperty("StatisticsSite")] + public virtual ICollection AnalyticsStatistics { get; set; } = new List(); + + [InverseProperty("BoardSite")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("ChatNotificationSite")] + public virtual ICollection ChatNotifications { get; set; } = new List(); + + [InverseProperty("ChatOnlineSupportSite")] + public virtual ICollection ChatOnlineSupports { get; set; } = new List(); + + [InverseProperty("ChatOnlineUserSite")] + public virtual ICollection ChatOnlineUsers { get; set; } = new List(); + + [InverseProperty("ChatRoomSite")] + public virtual ICollection ChatRooms { get; set; } = new List(); + + [InverseProperty("ChatSupportCannedResponseSite")] + public virtual ICollection ChatSupportCannedResponses { get; set; } = new List(); + + [InverseProperty("ReportSite")] + public virtual ICollection CmsAbuseReports { get; set; } = new List(); + + [InverseProperty("Aclsite")] + public virtual ICollection CmsAcls { get; set; } = new List(); + + [InverseProperty("AlternativeUrlSite")] + public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("StateSite")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("IpaddressSite")] + public virtual ICollection CmsBannedIps { get; set; } = new List(); + + [InverseProperty("BannerCategorySite")] + public virtual ICollection CmsBannerCategories { get; set; } = new List(); + + [InverseProperty("BannerSite")] + public virtual ICollection CmsBanners { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("AliasSite")] + public virtual ICollection CmsDocumentAliases { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); + + [InverseProperty("EmailTemplateSite")] + public virtual ICollection CmsEmailTemplates { get; set; } = new List(); + + [InverseProperty("FormSite")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("MembershipSite")] + public virtual ICollection CmsMemberships { get; set; } = new List(); + + [InverseProperty("MetaFileSite")] + public virtual ICollection CmsMetaFiles { get; set; } = new List(); + + [InverseProperty("VersionObjectSite")] + public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); + + [InverseProperty("PageTemplateConfigurationSite")] + public virtual ICollection CmsPageTemplateConfigurations { get; set; } = new List(); + + [InverseProperty("PageTemplateScopeSite")] + public virtual ICollection CmsPageTemplateScopes { get; set; } = new List(); + + [InverseProperty("PageTemplateSite")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("PersonalizationSite")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SessionSite")] + public virtual ICollection CmsSessions { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); + + [InverseProperty("TagGroupSite")] + public virtual ICollection CmsTagGroups { get; set; } = new List(); + + [InverseProperty("NodeLinkedNodeSite")] + public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("BrandSite")] + public virtual ICollection ComBrands { get; set; } = new List(); + + [InverseProperty("CarrierSite")] + public virtual ICollection ComCarriers { get; set; } = new List(); + + [InverseProperty("CollectionSite")] + public virtual ICollection ComCollections { get; set; } = new List(); + + [InverseProperty("CurrencySite")] + public virtual ICollection ComCurrencies { get; set; } = new List(); + + [InverseProperty("EventSite")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("CustomerSite")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("DepartmentSite")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("DiscountSite")] + public virtual ICollection ComDiscounts { get; set; } = new List(); + + [InverseProperty("ExchangeTableSite")] + public virtual ICollection ComExchangeTables { get; set; } = new List(); + + [InverseProperty("GiftCardSite")] + public virtual ICollection ComGiftCards { get; set; } = new List(); + + [InverseProperty("InternalStatusSite")] + public virtual ICollection ComInternalStatuses { get; set; } = new List(); + + [InverseProperty("ManufacturerSite")] + public virtual ICollection ComManufacturers { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountSite")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection ComOptionCategories { get; set; } = new List(); + + [InverseProperty("StatusSite")] + public virtual ICollection ComOrderStatuses { get; set; } = new List(); + + [InverseProperty("OrderSite")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionSite")] + public virtual ICollection ComPaymentOptions { get; set; } = new List(); + + [InverseProperty("PublicStatusSite")] + public virtual ICollection ComPublicStatuses { get; set; } = new List(); + + [InverseProperty("ShippingOptionSite")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("ShoppingCartSite")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("Skusite")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("SupplierSite")] + public virtual ICollection ComSuppliers { get; set; } = new List(); + + [InverseProperty("TaxClassSite")] + public virtual ICollection ComTaxClasses { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("GroupSite")] + public virtual ICollection CommunityGroups { get; set; } = new List(); + + [InverseProperty("ExportSite")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection ExportTasks { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection ForumsAttachments { get; set; } = new List(); + + [InverseProperty("GroupSite")] + public virtual ICollection ForumsForumGroups { get; set; } = new List(); + + [InverseProperty("ForumSite")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection IntegrationTasks { get; set; } = new List(); + + [InverseProperty("FileSite")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("LibrarySite")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); + + [InverseProperty("EmailWidgetSite")] + public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); + + [InverseProperty("EmailSite")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("IssueSite")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterSite")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [InverseProperty("SubscriberSite")] + public virtual ICollection NewsletterSubscribers { get; set; } = new List(); + + [InverseProperty("SubscriptionSite")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NotificationTemplates { get; set; } = new List(); + + [InverseProperty("AbtestSite")] + public virtual ICollection OmAbtests { get; set; } = new List(); + + [InverseProperty("AbvariantSite")] + public virtual ICollection OmAbvariants { get; set; } = new List(); + + [InverseProperty("MvtestSite")] + public virtual ICollection OmMvtests { get; set; } = new List(); + + [InverseProperty("PollSite")] + public virtual ICollection PollsPolls { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionSite")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SharePointConnectionSite")] + public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); + + [InverseProperty("SharePointFileSite")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); + + [InverseProperty("SharePointLibrarySite")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); + + [ForeignKey("SiteDefaultEditorStylesheet")] + [InverseProperty("CmsSiteSiteDefaultEditorStylesheetNavigations")] + public virtual CmsCssStylesheet? SiteDefaultEditorStylesheetNavigation { get; set; } + + [ForeignKey("SiteDefaultStylesheetId")] + [InverseProperty("CmsSiteSiteDefaultStylesheets")] + public virtual CmsCssStylesheet? SiteDefaultStylesheet { get; set; } + + [InverseProperty("FacebookAccountSite")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); + + [InverseProperty("FacebookApplicationSite")] + public virtual ICollection SmFacebookApplications { get; set; } = new List(); + + [InverseProperty("FacebookPostSite")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInApplicationSite")] + public virtual ICollection SmLinkedInApplications { get; set; } = new List(); + + [InverseProperty("LinkedInPostSite")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterAccountSite")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [InverseProperty("TwitterApplicationSite")] + public virtual ICollection SmTwitterApplications { get; set; } = new List(); + + [InverseProperty("TwitterPostSite")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [InverseProperty("ServerSite")] + public virtual ICollection StagingServers { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection StagingTasks { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Classes { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Containers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Cultures { get; set; } = new List(); + + [ForeignKey("IndexSiteId")] + [InverseProperty("IndexSites")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection PageTemplates { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Polls { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection RelationshipNames { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Resources { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Servers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Stylesheets { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs index 872ceaff..d2cb035f 100644 --- a/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs +++ b/Migration.Toolkit.KX12/Models/CmsSiteDomainAlias.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SiteDomainAlias")] -[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] -[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] -public partial class CmsSiteDomainAlias -{ - [Key] - [Column("SiteDomainAliasID")] - public int SiteDomainAliasId { get; set; } - - [StringLength(400)] - public string SiteDomainAliasName { get; set; } = null!; - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteDomainGUID")] - public Guid? SiteDomainGuid { get; set; } - - public DateTime SiteDomainLastModified { get; set; } - - [StringLength(450)] - public string? SiteDomainDefaultAliasPath { get; set; } - - [StringLength(450)] - public string? SiteDomainRedirectUrl { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSiteDomainAliases")] - public virtual CmsSite Site { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_SiteDomainAlias")] +[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] +[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] +public class CmsSiteDomainAlias +{ + [Key] + [Column("SiteDomainAliasID")] + public int SiteDomainAliasId { get; set; } + + [StringLength(400)] + public string SiteDomainAliasName { get; set; } = null!; + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteDomainGUID")] + public Guid? SiteDomainGuid { get; set; } + + public DateTime SiteDomainLastModified { get; set; } + + [StringLength(450)] + public string? SiteDomainDefaultAliasPath { get; set; } + + [StringLength(450)] + public string? SiteDomainRedirectUrl { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSiteDomainAliases")] + public virtual CmsSite Site { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs b/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs index 7cbdab43..497b96df 100644 --- a/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs +++ b/Migration.Toolkit.KX12/Models/CmsSmtpserver.cs @@ -1,47 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_SMTPServer")] -public partial class CmsSmtpserver -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(200)] - public string ServerName { get; set; } = null!; - - [StringLength(50)] - public string? ServerUserName { get; set; } - - [StringLength(200)] - public string? ServerPassword { get; set; } - - [Column("ServerUseSSL")] - public bool ServerUseSsl { get; set; } - - public bool ServerEnabled { get; set; } - - public bool ServerIsGlobal { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public int? ServerPriority { get; set; } - - public int? ServerDeliveryMethod { get; set; } - - [StringLength(450)] - public string? ServerPickupDirectory { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("Servers")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_SMTPServer")] +public class CmsSmtpserver +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(200)] + public string ServerName { get; set; } = null!; + + [StringLength(50)] + public string? ServerUserName { get; set; } + + [StringLength(200)] + public string? ServerPassword { get; set; } + + [Column("ServerUseSSL")] + public bool ServerUseSsl { get; set; } + + public bool ServerEnabled { get; set; } + + public bool ServerIsGlobal { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public int? ServerPriority { get; set; } + + public int? ServerDeliveryMethod { get; set; } + + [StringLength(450)] + public string? ServerPickupDirectory { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("Servers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsState.cs b/Migration.Toolkit.KX12/Models/CmsState.cs index 23ef9a90..76100b3b 100644 --- a/Migration.Toolkit.KX12/Models/CmsState.cs +++ b/Migration.Toolkit.KX12/Models/CmsState.cs @@ -1,53 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_State")] -[Index("CountryId", Name = "IX_CMS_State_CountryID")] -[Index("StateCode", Name = "IX_CMS_State_StateCode")] -public partial class CmsState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [StringLength(200)] - public string StateDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StateName { get; set; } = null!; - - [StringLength(100)] - public string? StateCode { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public DateTime StateLastModified { get; set; } - - [InverseProperty("AddressState")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressState")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("State")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("CountryId")] - [InverseProperty("CmsStates")] - public virtual CmsCountry Country { get; set; } = null!; - - [InverseProperty("AccountState")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactState")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_State")] +[Index("CountryId", Name = "IX_CMS_State_CountryID")] +[Index("StateCode", Name = "IX_CMS_State_StateCode")] +public class CmsState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [StringLength(200)] + public string StateDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StateName { get; set; } = null!; + + [StringLength(100)] + public string? StateCode { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public DateTime StateLastModified { get; set; } + + [InverseProperty("AddressState")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressState")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("State")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("CountryId")] + [InverseProperty("CmsStates")] + public virtual CmsCountry Country { get; set; } = null!; + + [InverseProperty("AccountState")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactState")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsTag.cs b/Migration.Toolkit.KX12/Models/CmsTag.cs index 21a4a6b7..d1db2cc2 100644 --- a/Migration.Toolkit.KX12/Models/CmsTag.cs +++ b/Migration.Toolkit.KX12/Models/CmsTag.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Tag")] -[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] -public partial class CmsTag -{ - [Key] - [Column("TagID")] - public int TagId { get; set; } - - [StringLength(250)] - public string TagName { get; set; } = null!; - - public int TagCount { get; set; } - - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [Column("TagGUID")] - public Guid TagGuid { get; set; } - - [ForeignKey("TagGroupId")] - [InverseProperty("CmsTags")] - public virtual CmsTagGroup TagGroup { get; set; } = null!; - - [ForeignKey("TagId")] - [InverseProperty("Tags")] - public virtual ICollection Documents { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Tag")] +[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] +public class CmsTag +{ + [Key] + [Column("TagID")] + public int TagId { get; set; } + + [StringLength(250)] + public string TagName { get; set; } = null!; + + public int TagCount { get; set; } + + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [Column("TagGUID")] + public Guid TagGuid { get; set; } + + [ForeignKey("TagGroupId")] + [InverseProperty("CmsTags")] + public virtual CmsTagGroup TagGroup { get; set; } = null!; + + [ForeignKey("TagId")] + [InverseProperty("Tags")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsTagGroup.cs b/Migration.Toolkit.KX12/Models/CmsTagGroup.cs index 784f91dd..68bdc0c5 100644 --- a/Migration.Toolkit.KX12/Models/CmsTagGroup.cs +++ b/Migration.Toolkit.KX12/Models/CmsTagGroup.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TagGroup")] -[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] -public partial class CmsTagGroup -{ - [Key] - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [StringLength(250)] - public string TagGroupDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TagGroupName { get; set; } = null!; - - public string? TagGroupDescription { get; set; } - - [Column("TagGroupSiteID")] - public int TagGroupSiteId { get; set; } - - public bool TagGroupIsAdHoc { get; set; } - - public DateTime TagGroupLastModified { get; set; } - - [Column("TagGroupGUID")] - public Guid TagGroupGuid { get; set; } - - [InverseProperty("DocumentTagGroup")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("TagGroup")] - public virtual ICollection CmsTags { get; set; } = new List(); - - [ForeignKey("TagGroupSiteId")] - [InverseProperty("CmsTagGroups")] - public virtual CmsSite TagGroupSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_TagGroup")] +[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] +public class CmsTagGroup +{ + [Key] + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [StringLength(250)] + public string TagGroupDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TagGroupName { get; set; } = null!; + + public string? TagGroupDescription { get; set; } + + [Column("TagGroupSiteID")] + public int TagGroupSiteId { get; set; } + + public bool TagGroupIsAdHoc { get; set; } + + public DateTime TagGroupLastModified { get; set; } + + [Column("TagGroupGUID")] + public Guid TagGroupGuid { get; set; } + + [InverseProperty("DocumentTagGroup")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("TagGroup")] + public virtual ICollection CmsTags { get; set; } = new List(); + + [ForeignKey("TagGroupSiteId")] + [InverseProperty("CmsTagGroups")] + public virtual CmsSite TagGroupSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs b/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs index 291372d9..ea9d34f1 100644 --- a/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs +++ b/Migration.Toolkit.KX12/Models/CmsTemplateDeviceLayout.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TemplateDeviceLayout")] -[Index("LayoutId", Name = "IX_CMS_TemplateDeviceLayout_LayoutID")] -[Index("PageTemplateId", "ProfileId", Name = "IX_CMS_TemplateDeviceLayout_PageTemplateID_ProfileID", IsUnique = true)] -[Index("ProfileId", Name = "IX_CMS_TemplateDeviceLayout_ProfileID")] -public partial class CmsTemplateDeviceLayout -{ - [Key] - [Column("TemplateDeviceLayoutID")] - public int TemplateDeviceLayoutId { get; set; } - - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [Column("ProfileID")] - public int ProfileId { get; set; } - - [Column("LayoutID")] - public int? LayoutId { get; set; } - - public string? LayoutCode { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [ForeignKey("LayoutId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsLayout? Layout { get; set; } - - [ForeignKey("PageTemplateId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsPageTemplate PageTemplate { get; set; } = null!; - - [ForeignKey("ProfileId")] - [InverseProperty("CmsTemplateDeviceLayouts")] - public virtual CmsDeviceProfile Profile { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_TemplateDeviceLayout")] +[Index("LayoutId", Name = "IX_CMS_TemplateDeviceLayout_LayoutID")] +[Index("PageTemplateId", "ProfileId", Name = "IX_CMS_TemplateDeviceLayout_PageTemplateID_ProfileID", IsUnique = true)] +[Index("ProfileId", Name = "IX_CMS_TemplateDeviceLayout_ProfileID")] +public class CmsTemplateDeviceLayout +{ + [Key] + [Column("TemplateDeviceLayoutID")] + public int TemplateDeviceLayoutId { get; set; } + + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [Column("ProfileID")] + public int ProfileId { get; set; } + + [Column("LayoutID")] + public int? LayoutId { get; set; } + + public string? LayoutCode { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [ForeignKey("LayoutId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsLayout? Layout { get; set; } + + [ForeignKey("PageTemplateId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsPageTemplate PageTemplate { get; set; } = null!; + + [ForeignKey("ProfileId")] + [InverseProperty("CmsTemplateDeviceLayouts")] + public virtual CmsDeviceProfile Profile { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsTimeZone.cs b/Migration.Toolkit.KX12/Models/CmsTimeZone.cs index 5d5d7563..192b8a5f 100644 --- a/Migration.Toolkit.KX12/Models/CmsTimeZone.cs +++ b/Migration.Toolkit.KX12/Models/CmsTimeZone.cs @@ -1,44 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TimeZone")] -public partial class CmsTimeZone -{ - [Key] - [Column("TimeZoneID")] - public int TimeZoneId { get; set; } - - [StringLength(200)] - public string TimeZoneName { get; set; } = null!; - - [StringLength(200)] - public string TimeZoneDisplayName { get; set; } = null!; - - [Column("TimeZoneGMT")] - public double TimeZoneGmt { get; set; } - - public bool? TimeZoneDaylight { get; set; } - - public DateTime TimeZoneRuleStartIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleStartRule { get; set; } = null!; - - public DateTime TimeZoneRuleEndIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleEndRule { get; set; } = null!; - - [Column("TimeZoneGUID")] - public Guid TimeZoneGuid { get; set; } - - public DateTime TimeZoneLastModified { get; set; } - - [InverseProperty("UserTimeZone")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_TimeZone")] +public class CmsTimeZone +{ + [Key] + [Column("TimeZoneID")] + public int TimeZoneId { get; set; } + + [StringLength(200)] + public string TimeZoneName { get; set; } = null!; + + [StringLength(200)] + public string TimeZoneDisplayName { get; set; } = null!; + + [Column("TimeZoneGMT")] + public double TimeZoneGmt { get; set; } + + public bool? TimeZoneDaylight { get; set; } + + public DateTime TimeZoneRuleStartIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleStartRule { get; set; } = null!; + + public DateTime TimeZoneRuleEndIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleEndRule { get; set; } = null!; + + [Column("TimeZoneGUID")] + public Guid TimeZoneGuid { get; set; } + + public DateTime TimeZoneLastModified { get; set; } + + [InverseProperty("UserTimeZone")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsTransformation.cs b/Migration.Toolkit.KX12/Models/CmsTransformation.cs index 9e0feb94..eae8ff3a 100644 --- a/Migration.Toolkit.KX12/Models/CmsTransformation.cs +++ b/Migration.Toolkit.KX12/Models/CmsTransformation.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Transformation")] -[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] -public partial class CmsTransformation -{ - [Key] - [Column("TransformationID")] - public int TransformationId { get; set; } - - [StringLength(100)] - public string TransformationName { get; set; } = null!; - - public string TransformationCode { get; set; } = null!; - - [StringLength(50)] - public string TransformationType { get; set; } = null!; - - [Column("TransformationClassID")] - public int TransformationClassId { get; set; } - - [Column("TransformationVersionGUID")] - [StringLength(50)] - public string? TransformationVersionGuid { get; set; } - - [Column("TransformationGUID")] - public Guid TransformationGuid { get; set; } - - public DateTime TransformationLastModified { get; set; } - - public bool? TransformationIsHierarchical { get; set; } - - [Column("TransformationHierarchicalXML")] - public string? TransformationHierarchicalXml { get; set; } - - [Column("TransformationCSS")] - public string? TransformationCss { get; set; } - - [StringLength(700)] - public string? TransformationPreferredDocument { get; set; } - - [ForeignKey("TransformationClassId")] - [InverseProperty("CmsTransformations")] - public virtual CmsClass TransformationClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Transformation")] +[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] +public class CmsTransformation +{ + [Key] + [Column("TransformationID")] + public int TransformationId { get; set; } + + [StringLength(100)] + public string TransformationName { get; set; } = null!; + + public string TransformationCode { get; set; } = null!; + + [StringLength(50)] + public string TransformationType { get; set; } = null!; + + [Column("TransformationClassID")] + public int TransformationClassId { get; set; } + + [Column("TransformationVersionGUID")] + [StringLength(50)] + public string? TransformationVersionGuid { get; set; } + + [Column("TransformationGUID")] + public Guid TransformationGuid { get; set; } + + public DateTime TransformationLastModified { get; set; } + + public bool? TransformationIsHierarchical { get; set; } + + [Column("TransformationHierarchicalXML")] + public string? TransformationHierarchicalXml { get; set; } + + [Column("TransformationCSS")] + public string? TransformationCss { get; set; } + + [StringLength(700)] + public string? TransformationPreferredDocument { get; set; } + + [ForeignKey("TransformationClassId")] + [InverseProperty("CmsTransformations")] + public virtual CmsClass TransformationClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationService.cs b/Migration.Toolkit.KX12/Models/CmsTranslationService.cs index 659d6b53..8facdd17 100644 --- a/Migration.Toolkit.KX12/Models/CmsTranslationService.cs +++ b/Migration.Toolkit.KX12/Models/CmsTranslationService.cs @@ -1,54 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TranslationService")] -public partial class CmsTranslationService -{ - [Key] - [Column("TranslationServiceID")] - public int TranslationServiceId { get; set; } - - [StringLength(200)] - public string TranslationServiceAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceClassName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceDisplayName { get; set; } = null!; - - public bool TranslationServiceIsMachine { get; set; } - - public DateTime TranslationServiceLastModified { get; set; } - - [Column("TranslationServiceGUID")] - public Guid TranslationServiceGuid { get; set; } - - public bool TranslationServiceEnabled { get; set; } - - public bool? TranslationServiceSupportsInstructions { get; set; } - - public bool? TranslationServiceSupportsPriority { get; set; } - - public bool? TranslationServiceSupportsDeadline { get; set; } - - public bool? TranslationServiceGenerateTargetTag { get; set; } - - [StringLength(1000)] - public string? TranslationServiceParameter { get; set; } - - public bool? TranslationServiceSupportsStatusUpdate { get; set; } - - public bool? TranslationServiceSupportsCancel { get; set; } - - [InverseProperty("SubmissionService")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_TranslationService")] +public class CmsTranslationService +{ + [Key] + [Column("TranslationServiceID")] + public int TranslationServiceId { get; set; } + + [StringLength(200)] + public string TranslationServiceAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceClassName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceDisplayName { get; set; } = null!; + + public bool TranslationServiceIsMachine { get; set; } + + public DateTime TranslationServiceLastModified { get; set; } + + [Column("TranslationServiceGUID")] + public Guid TranslationServiceGuid { get; set; } + + public bool TranslationServiceEnabled { get; set; } + + public bool? TranslationServiceSupportsInstructions { get; set; } + + public bool? TranslationServiceSupportsPriority { get; set; } + + public bool? TranslationServiceSupportsDeadline { get; set; } + + public bool? TranslationServiceGenerateTargetTag { get; set; } + + [StringLength(1000)] + public string? TranslationServiceParameter { get; set; } + + public bool? TranslationServiceSupportsStatusUpdate { get; set; } + + public bool? TranslationServiceSupportsCancel { get; set; } + + [InverseProperty("SubmissionService")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs index 91f6a264..09b99ba9 100644 --- a/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs +++ b/Migration.Toolkit.KX12/Models/CmsTranslationSubmission.cs @@ -1,76 +1,75 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TranslationSubmission")] -[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] -[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] -public partial class CmsTranslationSubmission -{ - [Key] - [Column("SubmissionID")] - public int SubmissionId { get; set; } - - [StringLength(200)] - public string SubmissionName { get; set; } = null!; - - [StringLength(200)] - public string? SubmissionTicket { get; set; } - - public int SubmissionStatus { get; set; } - - [Column("SubmissionServiceID")] - public int SubmissionServiceId { get; set; } - - [StringLength(10)] - public string SubmissionSourceCulture { get; set; } = null!; - - public string SubmissionTargetCulture { get; set; } = null!; - - public int SubmissionPriority { get; set; } - - public DateTime? SubmissionDeadline { get; set; } - - [StringLength(500)] - public string? SubmissionInstructions { get; set; } - - public DateTime SubmissionLastModified { get; set; } - - [Column("SubmissionGUID")] - public Guid SubmissionGuid { get; set; } - - [Column("SubmissionSiteID")] - public int? SubmissionSiteId { get; set; } - - public double? SubmissionPrice { get; set; } - - public string? SubmissionStatusMessage { get; set; } - - public bool? SubmissionTranslateAttachments { get; set; } - - public int SubmissionItemCount { get; set; } - - public DateTime SubmissionDate { get; set; } - - public int? SubmissionWordCount { get; set; } - - public int? SubmissionCharCount { get; set; } - - [Column("SubmissionSubmittedByUserID")] - public int? SubmissionSubmittedByUserId { get; set; } - - [InverseProperty("SubmissionItemSubmission")] - public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); - - [ForeignKey("SubmissionServiceId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsTranslationService SubmissionService { get; set; } = null!; - - [ForeignKey("SubmissionSubmittedByUserId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsUser? SubmissionSubmittedByUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_TranslationSubmission")] +[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] +[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] +public class CmsTranslationSubmission +{ + [Key] + [Column("SubmissionID")] + public int SubmissionId { get; set; } + + [StringLength(200)] + public string SubmissionName { get; set; } = null!; + + [StringLength(200)] + public string? SubmissionTicket { get; set; } + + public int SubmissionStatus { get; set; } + + [Column("SubmissionServiceID")] + public int SubmissionServiceId { get; set; } + + [StringLength(10)] + public string SubmissionSourceCulture { get; set; } = null!; + + public string SubmissionTargetCulture { get; set; } = null!; + + public int SubmissionPriority { get; set; } + + public DateTime? SubmissionDeadline { get; set; } + + [StringLength(500)] + public string? SubmissionInstructions { get; set; } + + public DateTime SubmissionLastModified { get; set; } + + [Column("SubmissionGUID")] + public Guid SubmissionGuid { get; set; } + + [Column("SubmissionSiteID")] + public int? SubmissionSiteId { get; set; } + + public double? SubmissionPrice { get; set; } + + public string? SubmissionStatusMessage { get; set; } + + public bool? SubmissionTranslateAttachments { get; set; } + + public int SubmissionItemCount { get; set; } + + public DateTime SubmissionDate { get; set; } + + public int? SubmissionWordCount { get; set; } + + public int? SubmissionCharCount { get; set; } + + [Column("SubmissionSubmittedByUserID")] + public int? SubmissionSubmittedByUserId { get; set; } + + [InverseProperty("SubmissionItemSubmission")] + public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); + + [ForeignKey("SubmissionServiceId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsTranslationService SubmissionService { get; set; } = null!; + + [ForeignKey("SubmissionSubmittedByUserId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsUser? SubmissionSubmittedByUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs index 329d67f0..824f47e6 100644 --- a/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs +++ b/Migration.Toolkit.KX12/Models/CmsTranslationSubmissionItem.cs @@ -1,58 +1,57 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_TranslationSubmissionItem")] -[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] -public partial class CmsTranslationSubmissionItem -{ - [Key] - [Column("SubmissionItemID")] - public int SubmissionItemId { get; set; } - - [Column("SubmissionItemSubmissionID")] - public int SubmissionItemSubmissionId { get; set; } - - [Column("SubmissionItemSourceXLIFF")] - public string? SubmissionItemSourceXliff { get; set; } - - [Column("SubmissionItemTargetXLIFF")] - public string? SubmissionItemTargetXliff { get; set; } - - [StringLength(100)] - public string SubmissionItemObjectType { get; set; } = null!; - - [Column("SubmissionItemObjectID")] - public int SubmissionItemObjectId { get; set; } - - [Column("SubmissionItemGUID")] - public Guid SubmissionItemGuid { get; set; } - - public DateTime SubmissionItemLastModified { get; set; } - - [StringLength(200)] - public string SubmissionItemName { get; set; } = null!; - - public int? SubmissionItemWordCount { get; set; } - - public int? SubmissionItemCharCount { get; set; } - - public string? SubmissionItemCustomData { get; set; } - - [Column("SubmissionItemTargetObjectID")] - public int SubmissionItemTargetObjectId { get; set; } - - [StringLength(50)] - public string? SubmissionItemType { get; set; } - - [StringLength(10)] - public string? SubmissionItemTargetCulture { get; set; } - - [ForeignKey("SubmissionItemSubmissionId")] - [InverseProperty("CmsTranslationSubmissionItems")] - public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_TranslationSubmissionItem")] +[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] +public class CmsTranslationSubmissionItem +{ + [Key] + [Column("SubmissionItemID")] + public int SubmissionItemId { get; set; } + + [Column("SubmissionItemSubmissionID")] + public int SubmissionItemSubmissionId { get; set; } + + [Column("SubmissionItemSourceXLIFF")] + public string? SubmissionItemSourceXliff { get; set; } + + [Column("SubmissionItemTargetXLIFF")] + public string? SubmissionItemTargetXliff { get; set; } + + [StringLength(100)] + public string SubmissionItemObjectType { get; set; } = null!; + + [Column("SubmissionItemObjectID")] + public int SubmissionItemObjectId { get; set; } + + [Column("SubmissionItemGUID")] + public Guid SubmissionItemGuid { get; set; } + + public DateTime SubmissionItemLastModified { get; set; } + + [StringLength(200)] + public string SubmissionItemName { get; set; } = null!; + + public int? SubmissionItemWordCount { get; set; } + + public int? SubmissionItemCharCount { get; set; } + + public string? SubmissionItemCustomData { get; set; } + + [Column("SubmissionItemTargetObjectID")] + public int SubmissionItemTargetObjectId { get; set; } + + [StringLength(50)] + public string? SubmissionItemType { get; set; } + + [StringLength(10)] + public string? SubmissionItemTargetCulture { get; set; } + + [ForeignKey("SubmissionItemSubmissionId")] + [InverseProperty("CmsTranslationSubmissionItems")] + public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsTree.cs b/Migration.Toolkit.KX12/Models/CmsTree.cs index ae9acbac..efd7c2bd 100644 --- a/Migration.Toolkit.KX12/Models/CmsTree.cs +++ b/Migration.Toolkit.KX12/Models/CmsTree.cs @@ -1,184 +1,183 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Tree")] -[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] -[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] -[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] -[Index("NodeGroupId", Name = "IX_CMS_Tree_NodeGroupID")] -[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] -[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] -[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] -[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] -[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] -[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] -[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] -[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] -[Index("NodeTemplateId", Name = "IX_CMS_Tree_NodeTemplateID")] -public partial class CmsTree -{ - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - public int? NodeCacheMinutes { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - public string? NodeDocType { get; set; } - - public string? NodeHeadTags { get; set; } - - public string? NodeBodyElementAttributes { get; set; } - - [StringLength(200)] - public string? NodeInheritPageLevels { get; set; } - - [Column("RequiresSSL")] - public int? RequiresSsl { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeGroupID")] - public int? NodeGroupId { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - [Column("NodeTemplateID")] - public int? NodeTemplateId { get; set; } - - public bool? NodeTemplateForAllCultures { get; set; } - - public bool? NodeInheritPageTemplate { get; set; } - - public bool? NodeAllowCacheInFileSystem { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - public bool NodeIsContentOnly { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - public string? NodeBodyScripts { get; set; } - - [InverseProperty("AliasNode")] - public virtual ICollection CmsDocumentAliases { get; set; } = new List(); - - [InverseProperty("DocumentNode")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("LeftNode")] - public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); - - [InverseProperty("RightNode")] - public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); - - [InverseProperty("Node")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [InverseProperty("AttendeeEventNode")] - public virtual ICollection EventsAttendees { get; set; } = new List(); - - [InverseProperty("NodeLinkedNode")] - public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); - - [InverseProperty("NodeOriginalNode")] - public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); - - [InverseProperty("NodeParent")] - public virtual ICollection InverseNodeParent { get; set; } = new List(); - - [ForeignKey("NodeAclid")] - [InverseProperty("CmsTrees")] - public virtual CmsAcl? NodeAcl { get; set; } - - [ForeignKey("NodeClassId")] - [InverseProperty("CmsTrees")] - public virtual CmsClass NodeClass { get; set; } = null!; - - [ForeignKey("NodeGroupId")] - [InverseProperty("CmsTrees")] - public virtual CommunityGroup? NodeGroup { get; set; } - - [ForeignKey("NodeLinkedNodeId")] - [InverseProperty("InverseNodeLinkedNode")] - public virtual CmsTree? NodeLinkedNode { get; set; } - - [ForeignKey("NodeLinkedNodeSiteId")] - [InverseProperty("CmsTreeNodeLinkedNodeSites")] - public virtual CmsSite? NodeLinkedNodeSite { get; set; } - - [ForeignKey("NodeOriginalNodeId")] - [InverseProperty("InverseNodeOriginalNode")] - public virtual CmsTree? NodeOriginalNode { get; set; } - - [ForeignKey("NodeOwner")] - [InverseProperty("CmsTrees")] - public virtual CmsUser? NodeOwnerNavigation { get; set; } - - [ForeignKey("NodeParentId")] - [InverseProperty("InverseNodeParent")] - public virtual CmsTree? NodeParent { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsTreeNodeSites")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("NodeSkuid")] - [InverseProperty("CmsTrees")] - public virtual ComSku? NodeSku { get; set; } - - [ForeignKey("NodeTemplateId")] - [InverseProperty("CmsTrees")] - public virtual CmsPageTemplate? NodeTemplate { get; set; } - - [InverseProperty("Node")] - public virtual ICollection PersonasPersonaNodes { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Tree")] +[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] +[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] +[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] +[Index("NodeGroupId", Name = "IX_CMS_Tree_NodeGroupID")] +[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] +[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] +[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] +[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] +[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] +[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] +[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] +[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] +[Index("NodeTemplateId", Name = "IX_CMS_Tree_NodeTemplateID")] +public class CmsTree +{ + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + public int? NodeCacheMinutes { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + public string? NodeDocType { get; set; } + + public string? NodeHeadTags { get; set; } + + public string? NodeBodyElementAttributes { get; set; } + + [StringLength(200)] + public string? NodeInheritPageLevels { get; set; } + + [Column("RequiresSSL")] + public int? RequiresSsl { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeGroupID")] + public int? NodeGroupId { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + [Column("NodeTemplateID")] + public int? NodeTemplateId { get; set; } + + public bool? NodeTemplateForAllCultures { get; set; } + + public bool? NodeInheritPageTemplate { get; set; } + + public bool? NodeAllowCacheInFileSystem { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + public bool NodeIsContentOnly { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + public string? NodeBodyScripts { get; set; } + + [InverseProperty("AliasNode")] + public virtual ICollection CmsDocumentAliases { get; set; } = new List(); + + [InverseProperty("DocumentNode")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("LeftNode")] + public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); + + [InverseProperty("RightNode")] + public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); + + [InverseProperty("Node")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [InverseProperty("AttendeeEventNode")] + public virtual ICollection EventsAttendees { get; set; } = new List(); + + [InverseProperty("NodeLinkedNode")] + public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); + + [InverseProperty("NodeOriginalNode")] + public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); + + [InverseProperty("NodeParent")] + public virtual ICollection InverseNodeParent { get; set; } = new List(); + + [ForeignKey("NodeAclid")] + [InverseProperty("CmsTrees")] + public virtual CmsAcl? NodeAcl { get; set; } + + [ForeignKey("NodeClassId")] + [InverseProperty("CmsTrees")] + public virtual CmsClass NodeClass { get; set; } = null!; + + [ForeignKey("NodeGroupId")] + [InverseProperty("CmsTrees")] + public virtual CommunityGroup? NodeGroup { get; set; } + + [ForeignKey("NodeLinkedNodeId")] + [InverseProperty("InverseNodeLinkedNode")] + public virtual CmsTree? NodeLinkedNode { get; set; } + + [ForeignKey("NodeLinkedNodeSiteId")] + [InverseProperty("CmsTreeNodeLinkedNodeSites")] + public virtual CmsSite? NodeLinkedNodeSite { get; set; } + + [ForeignKey("NodeOriginalNodeId")] + [InverseProperty("InverseNodeOriginalNode")] + public virtual CmsTree? NodeOriginalNode { get; set; } + + [ForeignKey("NodeOwner")] + [InverseProperty("CmsTrees")] + public virtual CmsUser? NodeOwnerNavigation { get; set; } + + [ForeignKey("NodeParentId")] + [InverseProperty("InverseNodeParent")] + public virtual CmsTree? NodeParent { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsTreeNodeSites")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("NodeSkuid")] + [InverseProperty("CmsTrees")] + public virtual ComSku? NodeSku { get; set; } + + [ForeignKey("NodeTemplateId")] + [InverseProperty("CmsTrees")] + public virtual CmsPageTemplate? NodeTemplate { get; set; } + + [InverseProperty("Node")] + public virtual ICollection PersonasPersonaNodes { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsUielement.cs b/Migration.Toolkit.KX12/Models/CmsUielement.cs index b63198de..ce44343c 100644 --- a/Migration.Toolkit.KX12/Models/CmsUielement.cs +++ b/Migration.Toolkit.KX12/Models/CmsUielement.cs @@ -1,116 +1,115 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UIElement")] -[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] -[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] -[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] -public partial class CmsUielement -{ - [Key] - [Column("ElementID")] - public int ElementId { get; set; } - - [StringLength(200)] - public string ElementDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(200)] - public string? ElementCaption { get; set; } - - [Column("ElementTargetURL")] - [StringLength(650)] - public string? ElementTargetUrl { get; set; } - - [Column("ElementResourceID")] - public int ElementResourceId { get; set; } - - [Column("ElementParentID")] - public int? ElementParentId { get; set; } - - public int ElementChildCount { get; set; } - - public int? ElementOrder { get; set; } - - public int ElementLevel { get; set; } - - [Column("ElementIDPath")] - [StringLength(450)] - public string ElementIdpath { get; set; } = null!; - - [StringLength(200)] - public string? ElementIconPath { get; set; } - - public bool? ElementIsCustom { get; set; } - - public DateTime ElementLastModified { get; set; } - - [Column("ElementGUID")] - public Guid ElementGuid { get; set; } - - public int? ElementSize { get; set; } - - public string? ElementDescription { get; set; } - - [StringLength(20)] - public string? ElementFromVersion { get; set; } - - [Column("ElementPageTemplateID")] - public int? ElementPageTemplateId { get; set; } - - [StringLength(50)] - public string? ElementType { get; set; } - - public string? ElementProperties { get; set; } - - public bool? ElementIsMenu { get; set; } - - [StringLength(200)] - public string? ElementFeature { get; set; } - - [StringLength(100)] - public string? ElementIconClass { get; set; } - - public bool? ElementIsGlobalApplication { get; set; } - - public bool? ElementCheckModuleReadPermission { get; set; } - - public string? ElementAccessCondition { get; set; } - - public string? ElementVisibilityCondition { get; set; } - - public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } - - [InverseProperty("HelpTopicUielement")] - public virtual ICollection CmsHelpTopics { get; set; } = new List(); - - [ForeignKey("ElementPageTemplateId")] - [InverseProperty("CmsUielements")] - public virtual CmsPageTemplate? ElementPageTemplate { get; set; } - - [ForeignKey("ElementParentId")] - [InverseProperty("InverseElementParent")] - public virtual CmsUielement? ElementParent { get; set; } - - [ForeignKey("ElementResourceId")] - [InverseProperty("CmsUielements")] - public virtual CmsResource ElementResource { get; set; } = null!; - - [InverseProperty("ElementParent")] - public virtual ICollection InverseElementParent { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("Elements")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("ElementsNavigation")] - public virtual ICollection RolesNavigation { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_UIElement")] +[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] +[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] +[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] +public class CmsUielement +{ + [Key] + [Column("ElementID")] + public int ElementId { get; set; } + + [StringLength(200)] + public string ElementDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(200)] + public string? ElementCaption { get; set; } + + [Column("ElementTargetURL")] + [StringLength(650)] + public string? ElementTargetUrl { get; set; } + + [Column("ElementResourceID")] + public int ElementResourceId { get; set; } + + [Column("ElementParentID")] + public int? ElementParentId { get; set; } + + public int ElementChildCount { get; set; } + + public int? ElementOrder { get; set; } + + public int ElementLevel { get; set; } + + [Column("ElementIDPath")] + [StringLength(450)] + public string ElementIdpath { get; set; } = null!; + + [StringLength(200)] + public string? ElementIconPath { get; set; } + + public bool? ElementIsCustom { get; set; } + + public DateTime ElementLastModified { get; set; } + + [Column("ElementGUID")] + public Guid ElementGuid { get; set; } + + public int? ElementSize { get; set; } + + public string? ElementDescription { get; set; } + + [StringLength(20)] + public string? ElementFromVersion { get; set; } + + [Column("ElementPageTemplateID")] + public int? ElementPageTemplateId { get; set; } + + [StringLength(50)] + public string? ElementType { get; set; } + + public string? ElementProperties { get; set; } + + public bool? ElementIsMenu { get; set; } + + [StringLength(200)] + public string? ElementFeature { get; set; } + + [StringLength(100)] + public string? ElementIconClass { get; set; } + + public bool? ElementIsGlobalApplication { get; set; } + + public bool? ElementCheckModuleReadPermission { get; set; } + + public string? ElementAccessCondition { get; set; } + + public string? ElementVisibilityCondition { get; set; } + + public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } + + [InverseProperty("HelpTopicUielement")] + public virtual ICollection CmsHelpTopics { get; set; } = new List(); + + [ForeignKey("ElementPageTemplateId")] + [InverseProperty("CmsUielements")] + public virtual CmsPageTemplate? ElementPageTemplate { get; set; } + + [ForeignKey("ElementParentId")] + [InverseProperty("InverseElementParent")] + public virtual CmsUielement? ElementParent { get; set; } + + [ForeignKey("ElementResourceId")] + [InverseProperty("CmsUielements")] + public virtual CmsResource ElementResource { get; set; } = null!; + + [InverseProperty("ElementParent")] + public virtual ICollection InverseElementParent { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("Elements")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("ElementsNavigation")] + public virtual ICollection RolesNavigation { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsUser.cs b/Migration.Toolkit.KX12/Models/CmsUser.cs index feb20825..67f1ad12 100644 --- a/Migration.Toolkit.KX12/Models/CmsUser.cs +++ b/Migration.Toolkit.KX12/Models/CmsUser.cs @@ -1,306 +1,305 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_User")] -[Index("Email", Name = "IX_CMS_User_Email")] -[Index("FullName", Name = "IX_CMS_User_FullName")] -[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] -[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] -[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] -[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] -public partial class CmsUser -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [InverseProperty("CommentApprovedByUser")] - public virtual ICollection BlogCommentCommentApprovedByUsers { get; set; } = new List(); - - [InverseProperty("CommentUser")] - public virtual ICollection BlogCommentCommentUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); - - [InverseProperty("BoardUser")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("MessageApprovedByUser")] - public virtual ICollection BoardMessageMessageApprovedByUsers { get; set; } = new List(); - - [InverseProperty("MessageUser")] - public virtual ICollection BoardMessageMessageUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection BoardSubscriptions { get; set; } = new List(); - - [InverseProperty("InitiatedChatRequestUser")] - public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); - - [InverseProperty("ChatUserUser")] - public virtual ICollection ChatUsers { get; set; } = new List(); - - [InverseProperty("ReportUser")] - public virtual ICollection CmsAbuseReports { get; set; } = new List(); - - [InverseProperty("LastModifiedByUser")] - public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsAclitemUsers { get; set; } = new List(); - - [InverseProperty("HistoryApprovedByUser")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateUser")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("CategoryUser")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("DocumentCheckedOutByUser")] - public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); - - [InverseProperty("DocumentCreatedByUser")] - public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); - - [InverseProperty("DocumentModifiedByUser")] - public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsExternalLogins { get; set; } = new List(); - - [InverseProperty("MacroIdentityEffectiveUser")] - public virtual ICollection CmsMacroIdentities { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [InverseProperty("ObjectCheckedOutByUser")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("VersionModifiedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsOpenIdusers { get; set; } = new List(); - - [InverseProperty("PersonalizationUser")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("TaskUser")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SessionUser")] - public virtual ICollection CmsSessions { get; set; } = new List(); - - [InverseProperty("SubmissionSubmittedByUser")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); - - [InverseProperty("NodeOwnerNavigation")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("UserMacroIdentityUser")] - public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } - - [InverseProperty("User")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("UserActivatedByUser")] - public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); - - [InverseProperty("UserSettingsUserNavigation")] - public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } - - public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("ModifiedByUser")] - public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("ApprovedByUser")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("CustomerUser")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("ChangedByUser")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [InverseProperty("OrderCreatedByUser")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartUser")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("GroupApprovedByUser")] - public virtual ICollection CommunityGroupGroupApprovedByUsers { get; set; } = new List(); - - [InverseProperty("GroupCreatedByUser")] - public virtual ICollection CommunityGroupGroupCreatedByUsers { get; set; } = new List(); - - [InverseProperty("MemberApprovedByUser")] - public virtual ICollection CommunityGroupMemberMemberApprovedByUsers { get; set; } = new List(); - - [InverseProperty("MemberInvitedByUser")] - public virtual ICollection CommunityGroupMemberMemberInvitedByUsers { get; set; } = new List(); - - [InverseProperty("MemberUser")] - public virtual ICollection CommunityGroupMemberMemberUsers { get; set; } = new List(); - - [InverseProperty("InvitedByUser")] - public virtual ICollection CommunityInvitationInvitedByUsers { get; set; } = new List(); - - [InverseProperty("InvitedUser")] - public virtual ICollection CommunityInvitationInvitedUsers { get; set; } = new List(); - - [InverseProperty("ExportUser")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("PostApprovedByUser")] - public virtual ICollection ForumsForumPostPostApprovedByUsers { get; set; } = new List(); - - [InverseProperty("PostUser")] - public virtual ICollection ForumsForumPostPostUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("FileCreatedByUser")] - public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); - - [InverseProperty("FileModifiedByUser")] - public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); - - [InverseProperty("SubscriptionUser")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("AccountOwnerUser")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactOwnerUser")] - public virtual ICollection OmContacts { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionUser")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SavedReportCreatedByUser")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); - - [InverseProperty("User")] - public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } - - [InverseProperty("User")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Boards { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Forums { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Workflows { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_User")] +[Index("Email", Name = "IX_CMS_User_Email")] +[Index("FullName", Name = "IX_CMS_User_FullName")] +[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] +[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] +[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] +[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] +public class CmsUser +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [InverseProperty("CommentApprovedByUser")] + public virtual ICollection BlogCommentCommentApprovedByUsers { get; set; } = new List(); + + [InverseProperty("CommentUser")] + public virtual ICollection BlogCommentCommentUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection BlogPostSubscriptions { get; set; } = new List(); + + [InverseProperty("BoardUser")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("MessageApprovedByUser")] + public virtual ICollection BoardMessageMessageApprovedByUsers { get; set; } = new List(); + + [InverseProperty("MessageUser")] + public virtual ICollection BoardMessageMessageUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection BoardSubscriptions { get; set; } = new List(); + + [InverseProperty("InitiatedChatRequestUser")] + public virtual ICollection ChatInitiatedChatRequests { get; set; } = new List(); + + [InverseProperty("ChatUserUser")] + public virtual ICollection ChatUsers { get; set; } = new List(); + + [InverseProperty("ReportUser")] + public virtual ICollection CmsAbuseReports { get; set; } = new List(); + + [InverseProperty("LastModifiedByUser")] + public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsAclitemUsers { get; set; } = new List(); + + [InverseProperty("HistoryApprovedByUser")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateUser")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("CategoryUser")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("DocumentCheckedOutByUser")] + public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); + + [InverseProperty("DocumentCreatedByUser")] + public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); + + [InverseProperty("DocumentModifiedByUser")] + public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsExternalLogins { get; set; } = new List(); + + [InverseProperty("MacroIdentityEffectiveUser")] + public virtual ICollection CmsMacroIdentities { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [InverseProperty("ObjectCheckedOutByUser")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("VersionModifiedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsOpenIdusers { get; set; } = new List(); + + [InverseProperty("PersonalizationUser")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("TaskUser")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SessionUser")] + public virtual ICollection CmsSessions { get; set; } = new List(); + + [InverseProperty("SubmissionSubmittedByUser")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); + + [InverseProperty("NodeOwnerNavigation")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("UserMacroIdentityUser")] + public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } + + [InverseProperty("User")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("UserActivatedByUser")] + public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); + + [InverseProperty("UserSettingsUserNavigation")] + public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } + + public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("ModifiedByUser")] + public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("ApprovedByUser")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("CustomerUser")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("ChangedByUser")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [InverseProperty("OrderCreatedByUser")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartUser")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("GroupApprovedByUser")] + public virtual ICollection CommunityGroupGroupApprovedByUsers { get; set; } = new List(); + + [InverseProperty("GroupCreatedByUser")] + public virtual ICollection CommunityGroupGroupCreatedByUsers { get; set; } = new List(); + + [InverseProperty("MemberApprovedByUser")] + public virtual ICollection CommunityGroupMemberMemberApprovedByUsers { get; set; } = new List(); + + [InverseProperty("MemberInvitedByUser")] + public virtual ICollection CommunityGroupMemberMemberInvitedByUsers { get; set; } = new List(); + + [InverseProperty("MemberUser")] + public virtual ICollection CommunityGroupMemberMemberUsers { get; set; } = new List(); + + [InverseProperty("InvitedByUser")] + public virtual ICollection CommunityInvitationInvitedByUsers { get; set; } = new List(); + + [InverseProperty("InvitedUser")] + public virtual ICollection CommunityInvitationInvitedUsers { get; set; } = new List(); + + [InverseProperty("ExportUser")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("PostApprovedByUser")] + public virtual ICollection ForumsForumPostPostApprovedByUsers { get; set; } = new List(); + + [InverseProperty("PostUser")] + public virtual ICollection ForumsForumPostPostUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("FileCreatedByUser")] + public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); + + [InverseProperty("FileModifiedByUser")] + public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); + + [InverseProperty("SubscriptionUser")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("AccountOwnerUser")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactOwnerUser")] + public virtual ICollection OmContacts { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionUser")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SavedReportCreatedByUser")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); + + [InverseProperty("User")] + public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } + + [InverseProperty("User")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Boards { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Forums { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Workflows { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsUserCulture.cs b/Migration.Toolkit.KX12/Models/CmsUserCulture.cs index 9820849e..5cc04704 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserCulture.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserCulture.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("UserId", "CultureId", "SiteId")] -[Table("CMS_UserCulture")] -[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] -[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] -public partial class CmsUserCulture -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("CultureId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsCulture Culture { get; set; } = null!; - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("UserId", "CultureId", "SiteId")] +[Table("CMS_UserCulture")] +[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] +[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] +public class CmsUserCulture +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("CultureId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsCulture Culture { get; set; } = null!; + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs index 45021856..b58dd1e2 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserMacroIdentity.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UserMacroIdentity")] -[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] -[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] -public partial class CmsUserMacroIdentity -{ - [Key] - [Column("UserMacroIdentityID")] - public int UserMacroIdentityId { get; set; } - - public DateTime UserMacroIdentityLastModified { get; set; } - - [Column("UserMacroIdentityUserID")] - public int UserMacroIdentityUserId { get; set; } - - [Column("UserMacroIdentityMacroIdentityID")] - public int? UserMacroIdentityMacroIdentityId { get; set; } - - public Guid UserMacroIdentityUserGuid { get; set; } - - [ForeignKey("UserMacroIdentityMacroIdentityId")] - [InverseProperty("CmsUserMacroIdentities")] - public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } - - [ForeignKey("UserMacroIdentityUserId")] - [InverseProperty("CmsUserMacroIdentity")] - public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_UserMacroIdentity")] +[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] +[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] +public class CmsUserMacroIdentity +{ + [Key] + [Column("UserMacroIdentityID")] + public int UserMacroIdentityId { get; set; } + + public DateTime UserMacroIdentityLastModified { get; set; } + + [Column("UserMacroIdentityUserID")] + public int UserMacroIdentityUserId { get; set; } + + [Column("UserMacroIdentityMacroIdentityID")] + public int? UserMacroIdentityMacroIdentityId { get; set; } + + public Guid UserMacroIdentityUserGuid { get; set; } + + [ForeignKey("UserMacroIdentityMacroIdentityId")] + [InverseProperty("CmsUserMacroIdentities")] + public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } + + [ForeignKey("UserMacroIdentityUserId")] + [InverseProperty("CmsUserMacroIdentity")] + public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsUserRole.cs b/Migration.Toolkit.KX12/Models/CmsUserRole.cs index 61d5cdec..af52db96 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserRole.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserRole.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UserRole")] -[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] -[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] -[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] -public partial class CmsUserRole -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Key] - [Column("UserRoleID")] - public int UserRoleId { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_UserRole")] +[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] +[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] +[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] +public class CmsUserRole +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Key] + [Column("UserRoleID")] + public int UserRoleId { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsUserSetting.cs b/Migration.Toolkit.KX12/Models/CmsUserSetting.cs index c7a1f8c0..2a6d0fe9 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserSetting.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserSetting.cs @@ -1,168 +1,167 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UserSettings")] -[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] -[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] -[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] -[Index("UserBadgeId", Name = "IX_CMS_UserSettings_UserBadgeID")] -[Index("UserFacebookId", Name = "IX_CMS_UserSettings_UserFacebookID")] -[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] -[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] -[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] -[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] -[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] -[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] -[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] -[Index("WindowsLiveId", Name = "IX_CMS_UserSettings_WindowsLiveID")] -public partial class CmsUserSetting -{ - [Key] - [Column("UserSettingsID")] - public int UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [ForeignKey("UserActivatedByUserId")] - [InverseProperty("CmsUserSettingUserActivatedByUsers")] - public virtual CmsUser? UserActivatedByUser { get; set; } - - [ForeignKey("UserAvatarId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsAvatar? UserAvatar { get; set; } - - [ForeignKey("UserBadgeId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsBadge? UserBadge { get; set; } - - public virtual CmsUser UserSettingsUser { get; set; } = null!; - - [ForeignKey("UserSettingsUserId")] - [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] - public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; - - [ForeignKey("UserTimeZoneId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsTimeZone? UserTimeZone { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_UserSettings")] +[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] +[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] +[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] +[Index("UserBadgeId", Name = "IX_CMS_UserSettings_UserBadgeID")] +[Index("UserFacebookId", Name = "IX_CMS_UserSettings_UserFacebookID")] +[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] +[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] +[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] +[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] +[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] +[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] +[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] +[Index("WindowsLiveId", Name = "IX_CMS_UserSettings_WindowsLiveID")] +public class CmsUserSetting +{ + [Key] + [Column("UserSettingsID")] + public int UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [ForeignKey("UserActivatedByUserId")] + [InverseProperty("CmsUserSettingUserActivatedByUsers")] + public virtual CmsUser? UserActivatedByUser { get; set; } + + [ForeignKey("UserAvatarId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsAvatar? UserAvatar { get; set; } + + [ForeignKey("UserBadgeId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsBadge? UserBadge { get; set; } + + public virtual CmsUser UserSettingsUser { get; set; } = null!; + + [ForeignKey("UserSettingsUserId")] + [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] + public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; + + [ForeignKey("UserTimeZoneId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsTimeZone? UserTimeZone { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsUserSite.cs b/Migration.Toolkit.KX12/Models/CmsUserSite.cs index b160ca9d..f77fb99b 100644 --- a/Migration.Toolkit.KX12/Models/CmsUserSite.cs +++ b/Migration.Toolkit.KX12/Models/CmsUserSite.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_UserSite")] -[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] -[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] -public partial class CmsUserSite -{ - [Key] - [Column("UserSiteID")] - public int UserSiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserSites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserSites")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_UserSite")] +[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] +[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] +public class CmsUserSite +{ + [Key] + [Column("UserSiteID")] + public int UserSiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserSites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserSites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs b/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs index 68202ff2..a72363b5 100644 --- a/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsVersionHistory.cs @@ -1,117 +1,116 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_VersionHistory")] -[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] -[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] -[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] -[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] -[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] -public partial class CmsVersionHistory -{ - [Key] - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("DocumentID")] - public int? DocumentId { get; set; } - - [StringLength(450)] - public string DocumentNamePath { get; set; } = null!; - - [Column("NodeXML")] - public string NodeXml { get; set; } = null!; - - [Column("ModifiedByUserID")] - public int? ModifiedByUserId { get; set; } - - public DateTime ModifiedWhen { get; set; } - - [StringLength(50)] - public string? VersionNumber { get; set; } - - public string? VersionComment { get; set; } - - public bool ToBePublished { get; set; } - - public DateTime? PublishFrom { get; set; } - - public DateTime? PublishTo { get; set; } - - public DateTime? WasPublishedFrom { get; set; } - - public DateTime? WasPublishedTo { get; set; } - - [StringLength(100)] - public string? VersionDocumentName { get; set; } - - [StringLength(50)] - public string? VersionDocumentType { get; set; } - - [Column("VersionClassID")] - public int? VersionClassId { get; set; } - - [StringLength(450)] - public string? VersionMenuRedirectUrl { get; set; } - - [Column("VersionWorkflowID")] - public int? VersionWorkflowId { get; set; } - - [Column("VersionWorkflowStepID")] - public int? VersionWorkflowStepId { get; set; } - - [StringLength(450)] - public string? VersionNodeAliasPath { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [InverseProperty("DocumentCheckedOutVersionHistory")] - public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("DocumentPublishedVersionHistory")] - public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); - - [InverseProperty("VersionHistory")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [ForeignKey("ModifiedByUserId")] - [InverseProperty("CmsVersionHistoryModifiedByUsers")] - public virtual CmsUser? ModifiedByUser { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("VersionClassId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsClass? VersionClass { get; set; } - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionWorkflowId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflow? VersionWorkflow { get; set; } - - [ForeignKey("VersionWorkflowStepId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("VersionHistories")] - public virtual ICollection AttachmentHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_VersionHistory")] +[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] +[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] +[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] +[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] +[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] +public class CmsVersionHistory +{ + [Key] + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("DocumentID")] + public int? DocumentId { get; set; } + + [StringLength(450)] + public string DocumentNamePath { get; set; } = null!; + + [Column("NodeXML")] + public string NodeXml { get; set; } = null!; + + [Column("ModifiedByUserID")] + public int? ModifiedByUserId { get; set; } + + public DateTime ModifiedWhen { get; set; } + + [StringLength(50)] + public string? VersionNumber { get; set; } + + public string? VersionComment { get; set; } + + public bool ToBePublished { get; set; } + + public DateTime? PublishFrom { get; set; } + + public DateTime? PublishTo { get; set; } + + public DateTime? WasPublishedFrom { get; set; } + + public DateTime? WasPublishedTo { get; set; } + + [StringLength(100)] + public string? VersionDocumentName { get; set; } + + [StringLength(50)] + public string? VersionDocumentType { get; set; } + + [Column("VersionClassID")] + public int? VersionClassId { get; set; } + + [StringLength(450)] + public string? VersionMenuRedirectUrl { get; set; } + + [Column("VersionWorkflowID")] + public int? VersionWorkflowId { get; set; } + + [Column("VersionWorkflowStepID")] + public int? VersionWorkflowStepId { get; set; } + + [StringLength(450)] + public string? VersionNodeAliasPath { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [InverseProperty("DocumentCheckedOutVersionHistory")] + public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("DocumentPublishedVersionHistory")] + public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); + + [InverseProperty("VersionHistory")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [ForeignKey("ModifiedByUserId")] + [InverseProperty("CmsVersionHistoryModifiedByUsers")] + public virtual CmsUser? ModifiedByUser { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("VersionClassId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsClass? VersionClass { get; set; } + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionWorkflowId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflow? VersionWorkflow { get; set; } + + [ForeignKey("VersionWorkflowStepId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("VersionHistories")] + public virtual ICollection AttachmentHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs index d6b6c126..a1a9a7c8 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmServer.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebFarmServer")] -[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] -public partial class CmsWebFarmServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(300)] - public string ServerDisplayName { get; set; } = null!; - - [StringLength(300)] - public string ServerName { get; set; } = null!; - - [Column("ServerGUID")] - public Guid? ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public bool ServerEnabled { get; set; } - - public bool IsExternalWebAppServer { get; set; } - - [InverseProperty("Server")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebFarmServer")] +[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] +public class CmsWebFarmServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(300)] + public string ServerDisplayName { get; set; } = null!; + + [StringLength(300)] + public string ServerName { get; set; } = null!; + + [Column("ServerGUID")] + public Guid? ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public bool ServerEnabled { get; set; } + + public bool IsExternalWebAppServer { get; set; } + + [InverseProperty("Server")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs index 60db41a3..0e1ec544 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmServerLog.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebFarmServerLog")] -public partial class CmsWebFarmServerLog -{ - [Key] - [Column("WebFarmServerLogID")] - public int WebFarmServerLogId { get; set; } - - public DateTime LogTime { get; set; } - - [StringLength(200)] - public string LogCode { get; set; } = null!; - - [Column("ServerID")] - public int ServerId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebFarmServerLog")] +public class CmsWebFarmServerLog +{ + [Key] + [Column("WebFarmServerLogID")] + public int WebFarmServerLogId { get; set; } + + public DateTime LogTime { get; set; } + + [StringLength(200)] + public string LogCode { get; set; } = null!; + + [Column("ServerID")] + public int ServerId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs index 23ac32f2..553bfa16 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmServerMonitoring.cs @@ -1,20 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebFarmServerMonitoring")] -public partial class CmsWebFarmServerMonitoring -{ - [Key] - [Column("WebFarmServerMonitoringID")] - public int WebFarmServerMonitoringId { get; set; } - - [Column("ServerID")] - public int ServerId { get; set; } - - public DateTime? ServerPing { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebFarmServerMonitoring")] +public class CmsWebFarmServerMonitoring +{ + [Key] + [Column("WebFarmServerMonitoringID")] + public int WebFarmServerMonitoringId { get; set; } + + [Column("ServerID")] + public int ServerId { get; set; } + + public DateTime? ServerPing { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs index b9006f57..d74cc100 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmServerTask.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("ServerId", "TaskId")] -[Table("CMS_WebFarmServerTask")] -[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] -public partial class CmsWebFarmServerTask -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - public string? ErrorMessage { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmServer Server { get; set; } = null!; - - [ForeignKey("TaskId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmTask Task { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("ServerId", "TaskId")] +[Table("CMS_WebFarmServerTask")] +[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] +public class CmsWebFarmServerTask +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + public string? ErrorMessage { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmServer Server { get; set; } = null!; + + [ForeignKey("TaskId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmTask Task { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs index eb142c23..ee4ad347 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebFarmTask.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebFarmTask")] -[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] -public partial class CmsWebFarmTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(100)] - public string TaskType { get; set; } = null!; - - public string? TaskTextData { get; set; } - - public byte[]? TaskBinaryData { get; set; } - - public DateTime? TaskCreated { get; set; } - - public string? TaskTarget { get; set; } - - [StringLength(450)] - public string? TaskMachineName { get; set; } - - [Column("TaskGUID")] - public Guid? TaskGuid { get; set; } - - public bool? TaskIsAnonymous { get; set; } - - public string? TaskErrorMessage { get; set; } - - public bool? TaskIsMemory { get; set; } - - [InverseProperty("Task")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebFarmTask")] +[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] +public class CmsWebFarmTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(100)] + public string TaskType { get; set; } = null!; + + public string? TaskTextData { get; set; } + + public byte[]? TaskBinaryData { get; set; } + + public DateTime? TaskCreated { get; set; } + + public string? TaskTarget { get; set; } + + [StringLength(450)] + public string? TaskMachineName { get; set; } + + [Column("TaskGUID")] + public Guid? TaskGuid { get; set; } + + public bool? TaskIsAnonymous { get; set; } + + public string? TaskErrorMessage { get; set; } + + public bool? TaskIsMemory { get; set; } + + [InverseProperty("Task")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebPart.cs b/Migration.Toolkit.KX12/Models/CmsWebPart.cs index ac733a47..98c4a2fc 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebPart.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebPart.cs @@ -1,86 +1,85 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebPart")] -[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] -[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] -[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] -[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] -public partial class CmsWebPart -{ - [Key] - [Column("WebPartID")] - public int WebPartId { get; set; } - - [StringLength(100)] - public string WebPartName { get; set; } = null!; - - [StringLength(100)] - public string WebPartDisplayName { get; set; } = null!; - - public string? WebPartDescription { get; set; } - - [StringLength(100)] - public string WebPartFileName { get; set; } = null!; - - public string WebPartProperties { get; set; } = null!; - - [Column("WebPartCategoryID")] - public int WebPartCategoryId { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - public string? WebPartDocumentation { get; set; } - - [Column("WebPartGUID")] - public Guid WebPartGuid { get; set; } - - public DateTime WebPartLastModified { get; set; } - - public int? WebPartType { get; set; } - - public string? WebPartDefaultValues { get; set; } - - [Column("WebPartResourceID")] - public int? WebPartResourceId { get; set; } - - [Column("WebPartCSS")] - public string? WebPartCss { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } - - [Column("WebPartThumbnailGUID")] - public Guid? WebPartThumbnailGuid { get; set; } - - public string? WebPartDefaultConfiguration { get; set; } - - [StringLength(200)] - public string? WebPartIconClass { get; set; } - - [InverseProperty("WebPartLayoutWebPart")] - public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); - - [InverseProperty("WidgetWebPart")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WebPartParent")] - public virtual ICollection InverseWebPartParent { get; set; } = new List(); - - [ForeignKey("WebPartCategoryId")] - [InverseProperty("CmsWebParts")] - public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; - - [ForeignKey("WebPartParentId")] - [InverseProperty("InverseWebPartParent")] - public virtual CmsWebPart? WebPartParent { get; set; } - - [ForeignKey("WebPartResourceId")] - [InverseProperty("CmsWebParts")] - public virtual CmsResource? WebPartResource { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebPart")] +[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] +[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] +[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] +[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] +public class CmsWebPart +{ + [Key] + [Column("WebPartID")] + public int WebPartId { get; set; } + + [StringLength(100)] + public string WebPartName { get; set; } = null!; + + [StringLength(100)] + public string WebPartDisplayName { get; set; } = null!; + + public string? WebPartDescription { get; set; } + + [StringLength(100)] + public string WebPartFileName { get; set; } = null!; + + public string WebPartProperties { get; set; } = null!; + + [Column("WebPartCategoryID")] + public int WebPartCategoryId { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + public string? WebPartDocumentation { get; set; } + + [Column("WebPartGUID")] + public Guid WebPartGuid { get; set; } + + public DateTime WebPartLastModified { get; set; } + + public int? WebPartType { get; set; } + + public string? WebPartDefaultValues { get; set; } + + [Column("WebPartResourceID")] + public int? WebPartResourceId { get; set; } + + [Column("WebPartCSS")] + public string? WebPartCss { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } + + [Column("WebPartThumbnailGUID")] + public Guid? WebPartThumbnailGuid { get; set; } + + public string? WebPartDefaultConfiguration { get; set; } + + [StringLength(200)] + public string? WebPartIconClass { get; set; } + + [InverseProperty("WebPartLayoutWebPart")] + public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); + + [InverseProperty("WidgetWebPart")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WebPartParent")] + public virtual ICollection InverseWebPartParent { get; set; } = new List(); + + [ForeignKey("WebPartCategoryId")] + [InverseProperty("CmsWebParts")] + public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; + + [ForeignKey("WebPartParentId")] + [InverseProperty("InverseWebPartParent")] + public virtual CmsWebPart? WebPartParent { get; set; } + + [ForeignKey("WebPartResourceId")] + [InverseProperty("CmsWebParts")] + public virtual CmsResource? WebPartResource { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs b/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs index 0793cb55..5f061225 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebPartCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebPartCategory")] -[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] -public partial class CmsWebPartCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(100)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(100)] - public string CategoryName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsWebPartCategory? CategoryParent { get; set; } - - [InverseProperty("WebPartCategory")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebPartCategory")] +[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] +public class CmsWebPartCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(100)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(100)] + public string CategoryName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsWebPartCategory? CategoryParent { get; set; } + + [InverseProperty("WebPartCategory")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs b/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs index 41f5de6b..4758df2a 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebPartContainer.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebPartContainer")] -[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] -public partial class CmsWebPartContainer -{ - [Key] - [Column("ContainerID")] - public int ContainerId { get; set; } - - [StringLength(200)] - public string ContainerDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContainerName { get; set; } = null!; - - public string? ContainerTextBefore { get; set; } - - public string? ContainerTextAfter { get; set; } - - [Column("ContainerGUID")] - public Guid ContainerGuid { get; set; } - - public DateTime ContainerLastModified { get; set; } - - [Column("ContainerCSS")] - public string? ContainerCss { get; set; } - - [ForeignKey("ContainerId")] - [InverseProperty("Containers")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebPartContainer")] +[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] +public class CmsWebPartContainer +{ + [Key] + [Column("ContainerID")] + public int ContainerId { get; set; } + + [StringLength(200)] + public string ContainerDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContainerName { get; set; } = null!; + + public string? ContainerTextBefore { get; set; } + + public string? ContainerTextAfter { get; set; } + + [Column("ContainerGUID")] + public Guid ContainerGuid { get; set; } + + public DateTime ContainerLastModified { get; set; } + + [Column("ContainerCSS")] + public string? ContainerCss { get; set; } + + [ForeignKey("ContainerId")] + [InverseProperty("Containers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs b/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs index 48fc5536..23ae7339 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebPartLayout.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebPartLayout")] -[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] -public partial class CmsWebPartLayout -{ - [Key] - [Column("WebPartLayoutID")] - public int WebPartLayoutId { get; set; } - - [StringLength(200)] - public string WebPartLayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string WebPartLayoutDisplayName { get; set; } = null!; - - public string? WebPartLayoutDescription { get; set; } - - public string? WebPartLayoutCode { get; set; } - - [Column("WebPartLayoutVersionGUID")] - [StringLength(100)] - public string? WebPartLayoutVersionGuid { get; set; } - - [Column("WebPartLayoutWebPartID")] - public int WebPartLayoutWebPartId { get; set; } - - [Column("WebPartLayoutGUID")] - public Guid WebPartLayoutGuid { get; set; } - - public DateTime WebPartLayoutLastModified { get; set; } - - [Column("WebPartLayoutCSS")] - public string? WebPartLayoutCss { get; set; } - - public bool? WebPartLayoutIsDefault { get; set; } - - [InverseProperty("WidgetLayout")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [ForeignKey("WebPartLayoutWebPartId")] - [InverseProperty("CmsWebPartLayouts")] - public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebPartLayout")] +[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] +public class CmsWebPartLayout +{ + [Key] + [Column("WebPartLayoutID")] + public int WebPartLayoutId { get; set; } + + [StringLength(200)] + public string WebPartLayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string WebPartLayoutDisplayName { get; set; } = null!; + + public string? WebPartLayoutDescription { get; set; } + + public string? WebPartLayoutCode { get; set; } + + [Column("WebPartLayoutVersionGUID")] + [StringLength(100)] + public string? WebPartLayoutVersionGuid { get; set; } + + [Column("WebPartLayoutWebPartID")] + public int WebPartLayoutWebPartId { get; set; } + + [Column("WebPartLayoutGUID")] + public Guid WebPartLayoutGuid { get; set; } + + public DateTime WebPartLayoutLastModified { get; set; } + + [Column("WebPartLayoutCSS")] + public string? WebPartLayoutCss { get; set; } + + public bool? WebPartLayoutIsDefault { get; set; } + + [InverseProperty("WidgetLayout")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [ForeignKey("WebPartLayoutWebPartId")] + [InverseProperty("CmsWebPartLayouts")] + public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs b/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs index a6cf8095..ef3e5469 100644 --- a/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs +++ b/Migration.Toolkit.KX12/Models/CmsWebTemplate.cs @@ -1,41 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WebTemplate")] -public partial class CmsWebTemplate -{ - [Key] - [Column("WebTemplateID")] - public int WebTemplateId { get; set; } - - [StringLength(200)] - public string WebTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WebTemplateFileName { get; set; } = null!; - - public string WebTemplateDescription { get; set; } = null!; - - [Column("WebTemplateGUID")] - public Guid WebTemplateGuid { get; set; } - - public DateTime WebTemplateLastModified { get; set; } - - [StringLength(100)] - public string WebTemplateName { get; set; } = null!; - - public int WebTemplateOrder { get; set; } - - [StringLength(200)] - public string WebTemplateLicenses { get; set; } = null!; - - [Column("WebTemplateThumbnailGUID")] - public Guid? WebTemplateThumbnailGuid { get; set; } - - public string? WebTemplateShortDescription { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WebTemplate")] +public class CmsWebTemplate +{ + [Key] + [Column("WebTemplateID")] + public int WebTemplateId { get; set; } + + [StringLength(200)] + public string WebTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WebTemplateFileName { get; set; } = null!; + + public string WebTemplateDescription { get; set; } = null!; + + [Column("WebTemplateGUID")] + public Guid WebTemplateGuid { get; set; } + + public DateTime WebTemplateLastModified { get; set; } + + [StringLength(100)] + public string WebTemplateName { get; set; } = null!; + + public int WebTemplateOrder { get; set; } + + [StringLength(200)] + public string WebTemplateLicenses { get; set; } = null!; + + [Column("WebTemplateThumbnailGUID")] + public Guid? WebTemplateThumbnailGuid { get; set; } + + public string? WebTemplateShortDescription { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsWidget.cs b/Migration.Toolkit.KX12/Models/CmsWidget.cs index 67794017..ec075cbb 100644 --- a/Migration.Toolkit.KX12/Models/CmsWidget.cs +++ b/Migration.Toolkit.KX12/Models/CmsWidget.cs @@ -1,84 +1,83 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Widget")] -[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] -[Index("WidgetIsEnabled", "WidgetForGroup", "WidgetForEditor", "WidgetForUser", Name = "IX_CMS_Widget_WidgetIsEnabled_WidgetForGroup_WidgetForEditor_WidgetForUser")] -[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] -[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] -public partial class CmsWidget -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Column("WidgetWebPartID")] - public int WidgetWebPartId { get; set; } - - [StringLength(100)] - public string WidgetDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WidgetName { get; set; } = null!; - - public string? WidgetDescription { get; set; } - - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - public string? WidgetProperties { get; set; } - - public int WidgetSecurity { get; set; } - - [Column("WidgetGUID")] - public Guid WidgetGuid { get; set; } - - public DateTime WidgetLastModified { get; set; } - - public bool WidgetIsEnabled { get; set; } - - public bool WidgetForGroup { get; set; } - - public bool WidgetForEditor { get; set; } - - public bool WidgetForUser { get; set; } - - public bool WidgetForDashboard { get; set; } - - public bool WidgetForInline { get; set; } - - public string? WidgetDocumentation { get; set; } - - public string? WidgetDefaultValues { get; set; } - - [Column("WidgetLayoutID")] - public int? WidgetLayoutId { get; set; } - - public bool? WidgetSkipInsertProperties { get; set; } - - [Column("WidgetThumbnailGUID")] - public Guid? WidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? WidgetIconClass { get; set; } - - [InverseProperty("Widget")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [ForeignKey("WidgetCategoryId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; - - [ForeignKey("WidgetLayoutId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPartLayout? WidgetLayout { get; set; } - - [ForeignKey("WidgetWebPartId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPart WidgetWebPart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Widget")] +[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] +[Index("WidgetIsEnabled", "WidgetForGroup", "WidgetForEditor", "WidgetForUser", Name = "IX_CMS_Widget_WidgetIsEnabled_WidgetForGroup_WidgetForEditor_WidgetForUser")] +[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] +[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] +public class CmsWidget +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Column("WidgetWebPartID")] + public int WidgetWebPartId { get; set; } + + [StringLength(100)] + public string WidgetDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WidgetName { get; set; } = null!; + + public string? WidgetDescription { get; set; } + + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + public string? WidgetProperties { get; set; } + + public int WidgetSecurity { get; set; } + + [Column("WidgetGUID")] + public Guid WidgetGuid { get; set; } + + public DateTime WidgetLastModified { get; set; } + + public bool WidgetIsEnabled { get; set; } + + public bool WidgetForGroup { get; set; } + + public bool WidgetForEditor { get; set; } + + public bool WidgetForUser { get; set; } + + public bool WidgetForDashboard { get; set; } + + public bool WidgetForInline { get; set; } + + public string? WidgetDocumentation { get; set; } + + public string? WidgetDefaultValues { get; set; } + + [Column("WidgetLayoutID")] + public int? WidgetLayoutId { get; set; } + + public bool? WidgetSkipInsertProperties { get; set; } + + [Column("WidgetThumbnailGUID")] + public Guid? WidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? WidgetIconClass { get; set; } + + [InverseProperty("Widget")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [ForeignKey("WidgetCategoryId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; + + [ForeignKey("WidgetLayoutId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPartLayout? WidgetLayout { get; set; } + + [ForeignKey("WidgetWebPartId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPart WidgetWebPart { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs b/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs index e4d85d8c..0a9bfd57 100644 --- a/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs +++ b/Migration.Toolkit.KX12/Models/CmsWidgetCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WidgetCategory")] -[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] -public partial class CmsWidgetCategory -{ - [Key] - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - [StringLength(100)] - public string WidgetCategoryName { get; set; } = null!; - - [StringLength(100)] - public string WidgetCategoryDisplayName { get; set; } = null!; - - [Column("WidgetCategoryParentID")] - public int? WidgetCategoryParentId { get; set; } - - public string WidgetCategoryPath { get; set; } = null!; - - public int WidgetCategoryLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [Column("WidgetCategoryGUID")] - public Guid WidgetCategoryGuid { get; set; } - - public DateTime WidgetCategoryLastModified { get; set; } - - [InverseProperty("WidgetCategory")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WidgetCategoryParent")] - public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); - - [ForeignKey("WidgetCategoryParentId")] - [InverseProperty("InverseWidgetCategoryParent")] - public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WidgetCategory")] +[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] +public class CmsWidgetCategory +{ + [Key] + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + [StringLength(100)] + public string WidgetCategoryName { get; set; } = null!; + + [StringLength(100)] + public string WidgetCategoryDisplayName { get; set; } = null!; + + [Column("WidgetCategoryParentID")] + public int? WidgetCategoryParentId { get; set; } + + public string WidgetCategoryPath { get; set; } = null!; + + public int WidgetCategoryLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [Column("WidgetCategoryGUID")] + public Guid WidgetCategoryGuid { get; set; } + + public DateTime WidgetCategoryLastModified { get; set; } + + [InverseProperty("WidgetCategory")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WidgetCategoryParent")] + public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); + + [ForeignKey("WidgetCategoryParentId")] + [InverseProperty("InverseWidgetCategoryParent")] + public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs b/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs index dc3c4666..055d60d4 100644 --- a/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs +++ b/Migration.Toolkit.KX12/Models/CmsWidgetRole.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("WidgetId", "RoleId", "PermissionId")] -[Table("CMS_WidgetRole")] -[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] -[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] -public partial class CmsWidgetRole -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("WidgetId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsWidget Widget { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("WidgetId", "RoleId", "PermissionId")] +[Table("CMS_WidgetRole")] +[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] +[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] +public class CmsWidgetRole +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("WidgetId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsWidget Widget { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflow.cs b/Migration.Toolkit.KX12/Models/CmsWorkflow.cs index 927427f7..0edcfa70 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflow.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflow.cs @@ -1,96 +1,93 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_Workflow")] -public partial class CmsWorkflow -{ - [Key] - [Column("WorkflowID")] - public int WorkflowId { get; set; } - - public string WorkflowDisplayName { get; set; } = null!; - - [StringLength(450)] - public string WorkflowName { get; set; } = null!; - - [Column("WorkflowGUID")] - public Guid WorkflowGuid { get; set; } - - public DateTime WorkflowLastModified { get; set; } - - public bool? WorkflowAutoPublishChanges { get; set; } - - public bool? WorkflowUseCheckinCheckout { get; set; } - - public int? WorkflowType { get; set; } - - public bool? WorkflowSendEmails { get; set; } - - public bool? WorkflowSendApproveEmails { get; set; } - - public bool? WorkflowSendRejectEmails { get; set; } - - public bool? WorkflowSendPublishEmails { get; set; } - - public bool? WorkflowSendArchiveEmails { get; set; } - - [StringLength(200)] - public string? WorkflowApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowPublishedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowArchivedTemplateName { get; set; } - - public bool? WorkflowSendReadyForApprovalEmails { get; set; } - - [StringLength(200)] - public string? WorkflowReadyForApprovalTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowNotificationTemplateName { get; set; } - - public string? WorkflowAllowedObjects { get; set; } - - public int? WorkflowRecurrenceType { get; set; } - - [Required] - public bool? WorkflowEnabled { get; set; } - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateWorkflow")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TriggerWorkflow")] - public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); - - [InverseProperty("VersionWorkflow")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("ScopeWorkflow")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("StepWorkflow")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); - - [InverseProperty("TransitionWorkflow")] - public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); - - [ForeignKey("WorkflowId")] - [InverseProperty("Workflows")] - public virtual ICollection Users { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_Workflow")] +public class CmsWorkflow +{ + [Key] + [Column("WorkflowID")] + public int WorkflowId { get; set; } + + public string WorkflowDisplayName { get; set; } = null!; + + [StringLength(450)] + public string WorkflowName { get; set; } = null!; + + [Column("WorkflowGUID")] + public Guid WorkflowGuid { get; set; } + + public DateTime WorkflowLastModified { get; set; } + + public bool? WorkflowAutoPublishChanges { get; set; } + + public bool? WorkflowUseCheckinCheckout { get; set; } + + public int? WorkflowType { get; set; } + + public bool? WorkflowSendEmails { get; set; } + + public bool? WorkflowSendApproveEmails { get; set; } + + public bool? WorkflowSendRejectEmails { get; set; } + + public bool? WorkflowSendPublishEmails { get; set; } + + public bool? WorkflowSendArchiveEmails { get; set; } + + [StringLength(200)] + public string? WorkflowApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowPublishedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowArchivedTemplateName { get; set; } + + public bool? WorkflowSendReadyForApprovalEmails { get; set; } + + [StringLength(200)] + public string? WorkflowReadyForApprovalTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowNotificationTemplateName { get; set; } + + public string? WorkflowAllowedObjects { get; set; } + + public int? WorkflowRecurrenceType { get; set; } + + [Required] + public bool? WorkflowEnabled { get; set; } + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateWorkflow")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TriggerWorkflow")] + public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); + + [InverseProperty("VersionWorkflow")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("ScopeWorkflow")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("StepWorkflow")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); + + [InverseProperty("TransitionWorkflow")] + public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); + + [ForeignKey("WorkflowId")] + [InverseProperty("Workflows")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs index 2a8dcb5f..592d0ca4 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowAction.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowAction")] -[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] -public partial class CmsWorkflowAction -{ - [Key] - [Column("ActionID")] - public int ActionId { get; set; } - - [StringLength(200)] - public string ActionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ActionName { get; set; } = null!; - - public string? ActionParameters { get; set; } - - public string? ActionDescription { get; set; } - - [StringLength(200)] - public string ActionAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string ActionClass { get; set; } = null!; - - [Column("ActionResourceID")] - public int? ActionResourceId { get; set; } - - [Column("ActionThumbnailGUID")] - public Guid? ActionThumbnailGuid { get; set; } - - [Column("ActionGUID")] - public Guid ActionGuid { get; set; } - - public DateTime ActionLastModified { get; set; } - - [Required] - public bool? ActionEnabled { get; set; } - - public string? ActionAllowedObjects { get; set; } - - [Column("ActionIconGUID")] - public Guid? ActionIconGuid { get; set; } - - public int? ActionWorkflowType { get; set; } - - [StringLength(200)] - public string? ActionIconClass { get; set; } - - [StringLength(200)] - public string? ActionThumbnailClass { get; set; } - - [ForeignKey("ActionResourceId")] - [InverseProperty("CmsWorkflowActions")] - public virtual CmsResource? ActionResource { get; set; } - - [InverseProperty("StepAction")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WorkflowAction")] +[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] +public class CmsWorkflowAction +{ + [Key] + [Column("ActionID")] + public int ActionId { get; set; } + + [StringLength(200)] + public string ActionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ActionName { get; set; } = null!; + + public string? ActionParameters { get; set; } + + public string? ActionDescription { get; set; } + + [StringLength(200)] + public string ActionAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string ActionClass { get; set; } = null!; + + [Column("ActionResourceID")] + public int? ActionResourceId { get; set; } + + [Column("ActionThumbnailGUID")] + public Guid? ActionThumbnailGuid { get; set; } + + [Column("ActionGUID")] + public Guid ActionGuid { get; set; } + + public DateTime ActionLastModified { get; set; } + + [Required] + public bool? ActionEnabled { get; set; } + + public string? ActionAllowedObjects { get; set; } + + [Column("ActionIconGUID")] + public Guid? ActionIconGuid { get; set; } + + public int? ActionWorkflowType { get; set; } + + [StringLength(200)] + public string? ActionIconClass { get; set; } + + [StringLength(200)] + public string? ActionThumbnailClass { get; set; } + + [ForeignKey("ActionResourceId")] + [InverseProperty("CmsWorkflowActions")] + public virtual CmsResource? ActionResource { get; set; } + + [InverseProperty("StepAction")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs index 90ac7d0c..e40dd5dd 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowHistory.cs @@ -1,88 +1,87 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowHistory")] -[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] -[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] -[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] -[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] -[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] -[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] -public partial class CmsWorkflowHistory -{ - [Key] - [Column("WorkflowHistoryID")] - public int WorkflowHistoryId { get; set; } - - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("StepID")] - public int? StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [Column("ApprovedByUserID")] - public int? ApprovedByUserId { get; set; } - - public DateTime? ApprovedWhen { get; set; } - - public string? Comment { get; set; } - - public bool WasRejected { get; set; } - - [StringLength(440)] - public string? StepName { get; set; } - - [Column("TargetStepID")] - public int? TargetStepId { get; set; } - - [StringLength(440)] - public string? TargetStepName { get; set; } - - [StringLength(450)] - public string? TargetStepDisplayName { get; set; } - - public int? StepType { get; set; } - - public int? TargetStepType { get; set; } - - [StringLength(100)] - public string? HistoryObjectType { get; set; } - - [Column("HistoryObjectID")] - public int? HistoryObjectId { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int? HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - [ForeignKey("ApprovedByUserId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsUser? ApprovedByUser { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsWorkflow? HistoryWorkflow { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowHistorySteps")] - public virtual CmsWorkflowStep? Step { get; set; } - - [ForeignKey("TargetStepId")] - [InverseProperty("CmsWorkflowHistoryTargetSteps")] - public virtual CmsWorkflowStep? TargetStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsVersionHistory VersionHistory { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WorkflowHistory")] +[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] +[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] +[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] +[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] +[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] +[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] +public class CmsWorkflowHistory +{ + [Key] + [Column("WorkflowHistoryID")] + public int WorkflowHistoryId { get; set; } + + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("StepID")] + public int? StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [Column("ApprovedByUserID")] + public int? ApprovedByUserId { get; set; } + + public DateTime? ApprovedWhen { get; set; } + + public string? Comment { get; set; } + + public bool WasRejected { get; set; } + + [StringLength(440)] + public string? StepName { get; set; } + + [Column("TargetStepID")] + public int? TargetStepId { get; set; } + + [StringLength(440)] + public string? TargetStepName { get; set; } + + [StringLength(450)] + public string? TargetStepDisplayName { get; set; } + + public int? StepType { get; set; } + + public int? TargetStepType { get; set; } + + [StringLength(100)] + public string? HistoryObjectType { get; set; } + + [Column("HistoryObjectID")] + public int? HistoryObjectId { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int? HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + [ForeignKey("ApprovedByUserId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsUser? ApprovedByUser { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsWorkflow? HistoryWorkflow { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowHistorySteps")] + public virtual CmsWorkflowStep? Step { get; set; } + + [ForeignKey("TargetStepId")] + [InverseProperty("CmsWorkflowHistoryTargetSteps")] + public virtual CmsWorkflowStep? TargetStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsVersionHistory VersionHistory { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs index cb6ae3d8..5f3147c9 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowScope.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowScope")] -[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] -[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] -[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] -[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] -public partial class CmsWorkflowScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopeStartingPath { get; set; } = null!; - - [Column("ScopeWorkflowID")] - public int ScopeWorkflowId { get; set; } - - [Column("ScopeClassID")] - public int? ScopeClassId { get; set; } - - [Column("ScopeSiteID")] - public int ScopeSiteId { get; set; } - - [Column("ScopeGUID")] - public Guid ScopeGuid { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeCultureID")] - public int? ScopeCultureId { get; set; } - - public bool? ScopeExcludeChildren { get; set; } - - public bool ScopeExcluded { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeClassId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsClass? ScopeClass { get; set; } - - [ForeignKey("ScopeCultureId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsCulture? ScopeCulture { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsSite ScopeSite { get; set; } = null!; - - [ForeignKey("ScopeWorkflowId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WorkflowScope")] +[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] +[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] +[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] +[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] +public class CmsWorkflowScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopeStartingPath { get; set; } = null!; + + [Column("ScopeWorkflowID")] + public int ScopeWorkflowId { get; set; } + + [Column("ScopeClassID")] + public int? ScopeClassId { get; set; } + + [Column("ScopeSiteID")] + public int ScopeSiteId { get; set; } + + [Column("ScopeGUID")] + public Guid ScopeGuid { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeCultureID")] + public int? ScopeCultureId { get; set; } + + public bool? ScopeExcludeChildren { get; set; } + + public bool ScopeExcluded { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeClassId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsClass? ScopeClass { get; set; } + + [ForeignKey("ScopeCultureId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsCulture? ScopeCulture { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsSite ScopeSite { get; set; } = null!; + + [ForeignKey("ScopeWorkflowId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs index 9e6b2261..a9abf9a1 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowStep.cs @@ -1,115 +1,114 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowStep")] -[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] -[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] -[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] -[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] -public partial class CmsWorkflowStep -{ - [Key] - [Column("StepID")] - public int StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [StringLength(440)] - public string? StepName { get; set; } - - public int? StepOrder { get; set; } - - [Column("StepWorkflowID")] - public int StepWorkflowId { get; set; } - - [Column("StepGUID")] - public Guid StepGuid { get; set; } - - public DateTime StepLastModified { get; set; } - - public int? StepType { get; set; } - - public bool? StepAllowReject { get; set; } - - public string? StepDefinition { get; set; } - - public int? StepRolesSecurity { get; set; } - - public int? StepUsersSecurity { get; set; } - - [StringLength(200)] - public string? StepApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? StepRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? StepReadyforApprovalTemplateName { get; set; } - - public bool? StepSendApproveEmails { get; set; } - - public bool? StepSendRejectEmails { get; set; } - - public bool? StepSendReadyForApprovalEmails { get; set; } - - public bool? StepSendEmails { get; set; } - - public bool? StepAllowPublish { get; set; } - - [Column("StepActionID")] - public int? StepActionId { get; set; } - - public string? StepActionParameters { get; set; } - - public int? StepWorkflowType { get; set; } - - [InverseProperty("HistoryStep")] - public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); - - [InverseProperty("HistoryTargetStep")] - public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("StateStep")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("DocumentWorkflowStep")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("ObjectWorkflowStep")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionWorkflowStep")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); - - [InverseProperty("TargetStep")] - public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("TransitionEndStep")] - public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); - - [InverseProperty("TransitionStartStep")] - public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); - - [ForeignKey("StepActionId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflowAction? StepAction { get; set; } - - [ForeignKey("StepWorkflowId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflow StepWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WorkflowStep")] +[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] +[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] +[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] +[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] +public class CmsWorkflowStep +{ + [Key] + [Column("StepID")] + public int StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [StringLength(440)] + public string? StepName { get; set; } + + public int? StepOrder { get; set; } + + [Column("StepWorkflowID")] + public int StepWorkflowId { get; set; } + + [Column("StepGUID")] + public Guid StepGuid { get; set; } + + public DateTime StepLastModified { get; set; } + + public int? StepType { get; set; } + + public bool? StepAllowReject { get; set; } + + public string? StepDefinition { get; set; } + + public int? StepRolesSecurity { get; set; } + + public int? StepUsersSecurity { get; set; } + + [StringLength(200)] + public string? StepApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? StepRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? StepReadyforApprovalTemplateName { get; set; } + + public bool? StepSendApproveEmails { get; set; } + + public bool? StepSendRejectEmails { get; set; } + + public bool? StepSendReadyForApprovalEmails { get; set; } + + public bool? StepSendEmails { get; set; } + + public bool? StepAllowPublish { get; set; } + + [Column("StepActionID")] + public int? StepActionId { get; set; } + + public string? StepActionParameters { get; set; } + + public int? StepWorkflowType { get; set; } + + [InverseProperty("HistoryStep")] + public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); + + [InverseProperty("HistoryTargetStep")] + public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("StateStep")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("DocumentWorkflowStep")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("ObjectWorkflowStep")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionWorkflowStep")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); + + [InverseProperty("TargetStep")] + public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("TransitionEndStep")] + public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); + + [InverseProperty("TransitionStartStep")] + public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); + + [ForeignKey("StepActionId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflowAction? StepAction { get; set; } + + [ForeignKey("StepWorkflowId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflow StepWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs index 269fe0d9..affcb3e5 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowStepRole.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowStepRoles")] -[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] -public partial class CmsWorkflowStepRole -{ - [Key] - [Column("WorkflowStepRoleID")] - public int WorkflowStepRoleId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsWorkflowStep Step { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WorkflowStepRoles")] +[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] +public class CmsWorkflowStepRole +{ + [Key] + [Column("WorkflowStepRoleID")] + public int WorkflowStepRoleId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsWorkflowStep Step { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs index b071c627..585f691c 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowStepUser.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowStepUser")] -[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] -public partial class CmsWorkflowStepUser -{ - [Key] - [Column("WorkflowStepUserID")] - public int WorkflowStepUserId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsWorkflowStep Step { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WorkflowStepUser")] +[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] +public class CmsWorkflowStepUser +{ + [Key] + [Column("WorkflowStepUserID")] + public int WorkflowStepUserId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsWorkflowStep Step { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs index 591f04c7..8addb31c 100644 --- a/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs +++ b/Migration.Toolkit.KX12/Models/CmsWorkflowTransition.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CMS_WorkflowTransition")] -[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] -[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] -[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] -public partial class CmsWorkflowTransition -{ - [Key] - [Column("TransitionID")] - public int TransitionId { get; set; } - - [Column("TransitionStartStepID")] - public int TransitionStartStepId { get; set; } - - [Column("TransitionEndStepID")] - public int TransitionEndStepId { get; set; } - - public int TransitionType { get; set; } - - public DateTime TransitionLastModified { get; set; } - - [Column("TransitionSourcePointGUID")] - public Guid? TransitionSourcePointGuid { get; set; } - - [Column("TransitionWorkflowID")] - public int TransitionWorkflowId { get; set; } - - [ForeignKey("TransitionEndStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] - public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; - - [ForeignKey("TransitionStartStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] - public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; - - [ForeignKey("TransitionWorkflowId")] - [InverseProperty("CmsWorkflowTransitions")] - public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CMS_WorkflowTransition")] +[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] +[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] +[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] +public class CmsWorkflowTransition +{ + [Key] + [Column("TransitionID")] + public int TransitionId { get; set; } + + [Column("TransitionStartStepID")] + public int TransitionStartStepId { get; set; } + + [Column("TransitionEndStepID")] + public int TransitionEndStepId { get; set; } + + public int TransitionType { get; set; } + + public DateTime TransitionLastModified { get; set; } + + [Column("TransitionSourcePointGUID")] + public Guid? TransitionSourcePointGuid { get; set; } + + [Column("TransitionWorkflowID")] + public int TransitionWorkflowId { get; set; } + + [ForeignKey("TransitionEndStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] + public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; + + [ForeignKey("TransitionStartStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] + public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; + + [ForeignKey("TransitionWorkflowId")] + [InverseProperty("CmsWorkflowTransitions")] + public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComAddress.cs b/Migration.Toolkit.KX12/Models/ComAddress.cs index 556a5dea..8a922a3d 100644 --- a/Migration.Toolkit.KX12/Models/ComAddress.cs +++ b/Migration.Toolkit.KX12/Models/ComAddress.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Address")] -[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] -[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] -[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] -public partial class ComAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(200)] - public string AddressName { get; set; } = null!; - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCustomerID")] - public int AddressCustomerId { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressCustomerId")] - [InverseProperty("ComAddresses")] - public virtual ComCustomer AddressCustomer { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComAddresses")] - public virtual CmsState? AddressState { get; set; } - - [InverseProperty("ShoppingCartBillingAddress")] - public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartCompanyAddress")] - public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingAddress")] - public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Address")] +[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] +[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] +[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] +public class ComAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(200)] + public string AddressName { get; set; } = null!; + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCustomerID")] + public int AddressCustomerId { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressCustomerId")] + [InverseProperty("ComAddresses")] + public virtual ComCustomer AddressCustomer { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComAddresses")] + public virtual CmsState? AddressState { get; set; } + + [InverseProperty("ShoppingCartBillingAddress")] + public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartCompanyAddress")] + public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingAddress")] + public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ComBrand.cs b/Migration.Toolkit.KX12/Models/ComBrand.cs index 0b5b7af6..17b0eedc 100644 --- a/Migration.Toolkit.KX12/Models/ComBrand.cs +++ b/Migration.Toolkit.KX12/Models/ComBrand.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Brand")] -[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] -[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] -public partial class ComBrand -{ - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [StringLength(200)] - public string BrandDisplayName { get; set; } = null!; - - [StringLength(200)] - public string BrandName { get; set; } = null!; - - public string? BrandDescription { get; set; } - - [StringLength(400)] - public string? BrandHomepage { get; set; } - - [Column("BrandThumbnailGUID")] - public Guid? BrandThumbnailGuid { get; set; } - - [Column("BrandSiteID")] - public int BrandSiteId { get; set; } - - [Required] - public bool? BrandEnabled { get; set; } - - public Guid BrandGuid { get; set; } - - public DateTime BrandLastModified { get; set; } - - [ForeignKey("BrandSiteId")] - [InverseProperty("ComBrands")] - public virtual CmsSite BrandSite { get; set; } = null!; - - [InverseProperty("Brand")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("Skubrand")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Brand")] +[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] +[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] +public class ComBrand +{ + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [StringLength(200)] + public string BrandDisplayName { get; set; } = null!; + + [StringLength(200)] + public string BrandName { get; set; } = null!; + + public string? BrandDescription { get; set; } + + [StringLength(400)] + public string? BrandHomepage { get; set; } + + [Column("BrandThumbnailGUID")] + public Guid? BrandThumbnailGuid { get; set; } + + [Column("BrandSiteID")] + public int BrandSiteId { get; set; } + + [Required] + public bool? BrandEnabled { get; set; } + + public Guid BrandGuid { get; set; } + + public DateTime BrandLastModified { get; set; } + + [ForeignKey("BrandSiteId")] + [InverseProperty("ComBrands")] + public virtual CmsSite BrandSite { get; set; } = null!; + + [InverseProperty("Brand")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("Skubrand")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ComCarrier.cs b/Migration.Toolkit.KX12/Models/ComCarrier.cs index b7b83155..24913c84 100644 --- a/Migration.Toolkit.KX12/Models/ComCarrier.cs +++ b/Migration.Toolkit.KX12/Models/ComCarrier.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Carrier")] -[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] -public partial class ComCarrier -{ - [Key] - [Column("CarrierID")] - public int CarrierId { get; set; } - - [StringLength(200)] - public string CarrierDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CarrierName { get; set; } = null!; - - [Column("CarrierSiteID")] - public int CarrierSiteId { get; set; } - - [Column("CarrierGUID")] - public Guid CarrierGuid { get; set; } - - [StringLength(200)] - public string CarrierAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string CarrierClassName { get; set; } = null!; - - public DateTime CarrierLastModified { get; set; } - - [ForeignKey("CarrierSiteId")] - [InverseProperty("ComCarriers")] - public virtual CmsSite CarrierSite { get; set; } = null!; - - [InverseProperty("ShippingOptionCarrier")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Carrier")] +[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] +public class ComCarrier +{ + [Key] + [Column("CarrierID")] + public int CarrierId { get; set; } + + [StringLength(200)] + public string CarrierDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CarrierName { get; set; } = null!; + + [Column("CarrierSiteID")] + public int CarrierSiteId { get; set; } + + [Column("CarrierGUID")] + public Guid CarrierGuid { get; set; } + + [StringLength(200)] + public string CarrierAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string CarrierClassName { get; set; } = null!; + + public DateTime CarrierLastModified { get; set; } + + [ForeignKey("CarrierSiteId")] + [InverseProperty("ComCarriers")] + public virtual CmsSite CarrierSite { get; set; } = null!; + + [InverseProperty("ShippingOptionCarrier")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ComCollection.cs b/Migration.Toolkit.KX12/Models/ComCollection.cs index ac8a4e17..c32244fb 100644 --- a/Migration.Toolkit.KX12/Models/ComCollection.cs +++ b/Migration.Toolkit.KX12/Models/ComCollection.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Collection")] -[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] -[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] -public partial class ComCollection -{ - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [StringLength(200)] - public string CollectionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CollectionName { get; set; } = null!; - - public string? CollectionDescription { get; set; } - - [Column("CollectionSiteID")] - public int CollectionSiteId { get; set; } - - [Required] - public bool? CollectionEnabled { get; set; } - - public Guid CollectionGuid { get; set; } - - public DateTime CollectionLastModified { get; set; } - - [ForeignKey("CollectionSiteId")] - [InverseProperty("ComCollections")] - public virtual CmsSite CollectionSite { get; set; } = null!; - - [InverseProperty("Collection")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("Skucollection")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Collection")] +[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] +[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] +public class ComCollection +{ + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [StringLength(200)] + public string CollectionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CollectionName { get; set; } = null!; + + public string? CollectionDescription { get; set; } + + [Column("CollectionSiteID")] + public int CollectionSiteId { get; set; } + + [Required] + public bool? CollectionEnabled { get; set; } + + public Guid CollectionGuid { get; set; } + + public DateTime CollectionLastModified { get; set; } + + [ForeignKey("CollectionSiteId")] + [InverseProperty("ComCollections")] + public virtual CmsSite CollectionSite { get; set; } = null!; + + [InverseProperty("Collection")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("Skucollection")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ComCouponCode.cs b/Migration.Toolkit.KX12/Models/ComCouponCode.cs index 438ffa7b..b86b754e 100644 --- a/Migration.Toolkit.KX12/Models/ComCouponCode.cs +++ b/Migration.Toolkit.KX12/Models/ComCouponCode.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_CouponCode")] -[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] -public partial class ComCouponCode -{ - [Key] - [Column("CouponCodeID")] - public int CouponCodeId { get; set; } - - [StringLength(200)] - public string CouponCodeCode { get; set; } = null!; - - public int? CouponCodeUseCount { get; set; } - - public int? CouponCodeUseLimit { get; set; } - - [Column("CouponCodeDiscountID")] - public int CouponCodeDiscountId { get; set; } - - public DateTime CouponCodeLastModified { get; set; } - - [Column("CouponCodeGUID")] - public Guid CouponCodeGuid { get; set; } - - [ForeignKey("CouponCodeDiscountId")] - [InverseProperty("ComCouponCodes")] - public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_CouponCode")] +[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] +public class ComCouponCode +{ + [Key] + [Column("CouponCodeID")] + public int CouponCodeId { get; set; } + + [StringLength(200)] + public string CouponCodeCode { get; set; } = null!; + + public int? CouponCodeUseCount { get; set; } + + public int? CouponCodeUseLimit { get; set; } + + [Column("CouponCodeDiscountID")] + public int CouponCodeDiscountId { get; set; } + + public DateTime CouponCodeLastModified { get; set; } + + [Column("CouponCodeGUID")] + public Guid CouponCodeGuid { get; set; } + + [ForeignKey("CouponCodeDiscountId")] + [InverseProperty("ComCouponCodes")] + public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComCurrency.cs b/Migration.Toolkit.KX12/Models/ComCurrency.cs index 3a8b9c01..5cd61cd4 100644 --- a/Migration.Toolkit.KX12/Models/ComCurrency.cs +++ b/Migration.Toolkit.KX12/Models/ComCurrency.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Currency")] -[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] -[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] -public partial class ComCurrency -{ - [Key] - [Column("CurrencyID")] - public int CurrencyId { get; set; } - - [StringLength(200)] - public string CurrencyName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyCode { get; set; } = null!; - - public int? CurrencyRoundTo { get; set; } - - public bool CurrencyEnabled { get; set; } - - [StringLength(200)] - public string CurrencyFormatString { get; set; } = null!; - - public bool CurrencyIsMain { get; set; } - - [Column("CurrencyGUID")] - public Guid? CurrencyGuid { get; set; } - - public DateTime CurrencyLastModified { get; set; } - - [Column("CurrencySiteID")] - public int? CurrencySiteId { get; set; } - - [InverseProperty("ExchangeRateToCurrency")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [InverseProperty("OrderCurrency")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCurrency")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CurrencySiteId")] - [InverseProperty("ComCurrencies")] - public virtual CmsSite? CurrencySite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Currency")] +[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] +[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] +public class ComCurrency +{ + [Key] + [Column("CurrencyID")] + public int CurrencyId { get; set; } + + [StringLength(200)] + public string CurrencyName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyCode { get; set; } = null!; + + public int? CurrencyRoundTo { get; set; } + + public bool CurrencyEnabled { get; set; } + + [StringLength(200)] + public string CurrencyFormatString { get; set; } = null!; + + public bool CurrencyIsMain { get; set; } + + [Column("CurrencyGUID")] + public Guid? CurrencyGuid { get; set; } + + public DateTime CurrencyLastModified { get; set; } + + [Column("CurrencySiteID")] + public int? CurrencySiteId { get; set; } + + [InverseProperty("ExchangeRateToCurrency")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [InverseProperty("OrderCurrency")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCurrency")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CurrencySiteId")] + [InverseProperty("ComCurrencies")] + public virtual CmsSite? CurrencySite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs index e3e1ad17..6e6d04ba 100644 --- a/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs +++ b/Migration.Toolkit.KX12/Models/ComCurrencyExchangeRate.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_CurrencyExchangeRate")] -[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] -[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] -public partial class ComCurrencyExchangeRate -{ - [Key] - [Column("ExchagneRateID")] - public int ExchagneRateId { get; set; } - - [Column("ExchangeRateToCurrencyID")] - public int ExchangeRateToCurrencyId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ExchangeRateValue { get; set; } - - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [Column("ExchangeRateGUID")] - public Guid ExchangeRateGuid { get; set; } - - public DateTime ExchangeRateLastModified { get; set; } - - [ForeignKey("ExchangeRateToCurrencyId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; - - [ForeignKey("ExchangeTableId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComExchangeTable ExchangeTable { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_CurrencyExchangeRate")] +[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] +[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] +public class ComCurrencyExchangeRate +{ + [Key] + [Column("ExchagneRateID")] + public int ExchagneRateId { get; set; } + + [Column("ExchangeRateToCurrencyID")] + public int ExchangeRateToCurrencyId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ExchangeRateValue { get; set; } + + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [Column("ExchangeRateGUID")] + public Guid ExchangeRateGuid { get; set; } + + public DateTime ExchangeRateLastModified { get; set; } + + [ForeignKey("ExchangeRateToCurrencyId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; + + [ForeignKey("ExchangeTableId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComExchangeTable ExchangeTable { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComCustomer.cs b/Migration.Toolkit.KX12/Models/ComCustomer.cs index 16971ff2..005c6c11 100644 --- a/Migration.Toolkit.KX12/Models/ComCustomer.cs +++ b/Migration.Toolkit.KX12/Models/ComCustomer.cs @@ -1,79 +1,78 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Customer")] -[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] -[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] -[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] -[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] -[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] -public partial class ComCustomer -{ - [Key] - [Column("CustomerID")] - public int CustomerId { get; set; } - - [StringLength(200)] - public string CustomerFirstName { get; set; } = null!; - - [StringLength(200)] - public string CustomerLastName { get; set; } = null!; - - [StringLength(254)] - public string? CustomerEmail { get; set; } - - [StringLength(26)] - public string? CustomerPhone { get; set; } - - [StringLength(50)] - public string? CustomerFax { get; set; } - - [StringLength(200)] - public string? CustomerCompany { get; set; } - - [Column("CustomerUserID")] - public int? CustomerUserId { get; set; } - - [Column("CustomerGUID")] - public Guid CustomerGuid { get; set; } - - [Column("CustomerTaxRegistrationID")] - [StringLength(50)] - public string? CustomerTaxRegistrationId { get; set; } - - [Column("CustomerOrganizationID")] - [StringLength(50)] - public string? CustomerOrganizationId { get; set; } - - public DateTime CustomerLastModified { get; set; } - - [Column("CustomerSiteID")] - public int? CustomerSiteId { get; set; } - - public DateTime? CustomerCreated { get; set; } - - [InverseProperty("AddressCustomer")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("EventCustomer")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("OrderCustomer")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCustomer")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CustomerSiteId")] - [InverseProperty("ComCustomers")] - public virtual CmsSite? CustomerSite { get; set; } - - [ForeignKey("CustomerUserId")] - [InverseProperty("ComCustomers")] - public virtual CmsUser? CustomerUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Customer")] +[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] +[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] +[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] +[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] +[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] +public class ComCustomer +{ + [Key] + [Column("CustomerID")] + public int CustomerId { get; set; } + + [StringLength(200)] + public string CustomerFirstName { get; set; } = null!; + + [StringLength(200)] + public string CustomerLastName { get; set; } = null!; + + [StringLength(254)] + public string? CustomerEmail { get; set; } + + [StringLength(26)] + public string? CustomerPhone { get; set; } + + [StringLength(50)] + public string? CustomerFax { get; set; } + + [StringLength(200)] + public string? CustomerCompany { get; set; } + + [Column("CustomerUserID")] + public int? CustomerUserId { get; set; } + + [Column("CustomerGUID")] + public Guid CustomerGuid { get; set; } + + [Column("CustomerTaxRegistrationID")] + [StringLength(50)] + public string? CustomerTaxRegistrationId { get; set; } + + [Column("CustomerOrganizationID")] + [StringLength(50)] + public string? CustomerOrganizationId { get; set; } + + public DateTime CustomerLastModified { get; set; } + + [Column("CustomerSiteID")] + public int? CustomerSiteId { get; set; } + + public DateTime? CustomerCreated { get; set; } + + [InverseProperty("AddressCustomer")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("EventCustomer")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("OrderCustomer")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCustomer")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CustomerSiteId")] + [InverseProperty("ComCustomers")] + public virtual CmsSite? CustomerSite { get; set; } + + [ForeignKey("CustomerUserId")] + [InverseProperty("ComCustomers")] + public virtual CmsUser? CustomerUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs index 830e8f45..3d597d99 100644 --- a/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs +++ b/Migration.Toolkit.KX12/Models/ComCustomerCreditHistory.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_CustomerCreditHistory")] -[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] -[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] -public partial class ComCustomerCreditHistory -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(200)] - public string EventName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal EventCreditChange { get; set; } - - public DateTime EventDate { get; set; } - - public string? EventDescription { get; set; } - - [Column("EventCustomerID")] - public int EventCustomerId { get; set; } - - [Column("EventCreditGUID")] - public Guid? EventCreditGuid { get; set; } - - public DateTime EventCreditLastModified { get; set; } - - [Column("EventSiteID")] - public int? EventSiteId { get; set; } - - [ForeignKey("EventCustomerId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual ComCustomer EventCustomer { get; set; } = null!; - - [ForeignKey("EventSiteId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual CmsSite? EventSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_CustomerCreditHistory")] +[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] +[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] +public class ComCustomerCreditHistory +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(200)] + public string EventName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal EventCreditChange { get; set; } + + public DateTime EventDate { get; set; } + + public string? EventDescription { get; set; } + + [Column("EventCustomerID")] + public int EventCustomerId { get; set; } + + [Column("EventCreditGUID")] + public Guid? EventCreditGuid { get; set; } + + public DateTime EventCreditLastModified { get; set; } + + [Column("EventSiteID")] + public int? EventSiteId { get; set; } + + [ForeignKey("EventCustomerId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual ComCustomer EventCustomer { get; set; } = null!; + + [ForeignKey("EventSiteId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual CmsSite? EventSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComDepartment.cs b/Migration.Toolkit.KX12/Models/ComDepartment.cs index 9d2911d8..e37c85ec 100644 --- a/Migration.Toolkit.KX12/Models/ComDepartment.cs +++ b/Migration.Toolkit.KX12/Models/ComDepartment.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Department")] -[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] -[Index("DepartmentDisplayName", Name = "IX_COM_Department_DepartmentDisplayName")] -[Index("DepartmentName", "DepartmentSiteId", Name = "IX_COM_Department_DepartmentName_DepartmentSiteID", IsUnique = true)] -[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] -public partial class ComDepartment -{ - [Key] - [Column("DepartmentID")] - public int DepartmentId { get; set; } - - [StringLength(200)] - public string DepartmentName { get; set; } = null!; - - [StringLength(200)] - public string DepartmentDisplayName { get; set; } = null!; - - [Column("DepartmentDefaultTaxClassID")] - public int? DepartmentDefaultTaxClassId { get; set; } - - [Column("DepartmentGUID")] - public Guid DepartmentGuid { get; set; } - - public DateTime DepartmentLastModified { get; set; } - - [Column("DepartmentSiteID")] - public int? DepartmentSiteId { get; set; } - - [InverseProperty("Skudepartment")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("DepartmentDefaultTaxClassId")] - [InverseProperty("ComDepartments")] - public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } - - [ForeignKey("DepartmentSiteId")] - [InverseProperty("ComDepartments")] - public virtual CmsSite? DepartmentSite { get; set; } - - [ForeignKey("DepartmentId")] - [InverseProperty("Departments")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Department")] +[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] +[Index("DepartmentDisplayName", Name = "IX_COM_Department_DepartmentDisplayName")] +[Index("DepartmentName", "DepartmentSiteId", Name = "IX_COM_Department_DepartmentName_DepartmentSiteID", IsUnique = true)] +[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] +public class ComDepartment +{ + [Key] + [Column("DepartmentID")] + public int DepartmentId { get; set; } + + [StringLength(200)] + public string DepartmentName { get; set; } = null!; + + [StringLength(200)] + public string DepartmentDisplayName { get; set; } = null!; + + [Column("DepartmentDefaultTaxClassID")] + public int? DepartmentDefaultTaxClassId { get; set; } + + [Column("DepartmentGUID")] + public Guid DepartmentGuid { get; set; } + + public DateTime DepartmentLastModified { get; set; } + + [Column("DepartmentSiteID")] + public int? DepartmentSiteId { get; set; } + + [InverseProperty("Skudepartment")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("DepartmentDefaultTaxClassId")] + [InverseProperty("ComDepartments")] + public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } + + [ForeignKey("DepartmentSiteId")] + [InverseProperty("ComDepartments")] + public virtual CmsSite? DepartmentSite { get; set; } + + [ForeignKey("DepartmentId")] + [InverseProperty("Departments")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ComDiscount.cs b/Migration.Toolkit.KX12/Models/ComDiscount.cs index 108d1347..a0456109 100644 --- a/Migration.Toolkit.KX12/Models/ComDiscount.cs +++ b/Migration.Toolkit.KX12/Models/ComDiscount.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Discount")] -[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] -public partial class ComDiscount -{ - [Key] - [Column("DiscountID")] - public int DiscountId { get; set; } - - [StringLength(200)] - public string DiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string DiscountName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal DiscountValue { get; set; } - - [Required] - public bool? DiscountEnabled { get; set; } - - [Column("DiscountGUID")] - public Guid DiscountGuid { get; set; } - - public DateTime DiscountLastModified { get; set; } - - [Column("DiscountSiteID")] - public int DiscountSiteId { get; set; } - - public string? DiscountDescription { get; set; } - - public DateTime? DiscountValidFrom { get; set; } - - public DateTime? DiscountValidTo { get; set; } - - public double DiscountOrder { get; set; } - - public string? DiscountProductCondition { get; set; } - - [StringLength(400)] - public string? DiscountRoles { get; set; } - - [StringLength(200)] - public string? DiscountCustomerRestriction { get; set; } - - public bool DiscountIsFlat { get; set; } - - public string? DiscountCartCondition { get; set; } - - [StringLength(100)] - public string DiscountApplyTo { get; set; } = null!; - - [Required] - public bool? DiscountApplyFurtherDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? DiscountOrderAmount { get; set; } - - public bool DiscountUsesCoupons { get; set; } - - [InverseProperty("CouponCodeDiscount")] - public virtual ICollection ComCouponCodes { get; set; } = new List(); - - [ForeignKey("DiscountSiteId")] - [InverseProperty("ComDiscounts")] - public virtual CmsSite DiscountSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Discount")] +[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] +public class ComDiscount +{ + [Key] + [Column("DiscountID")] + public int DiscountId { get; set; } + + [StringLength(200)] + public string DiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string DiscountName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal DiscountValue { get; set; } + + [Required] + public bool? DiscountEnabled { get; set; } + + [Column("DiscountGUID")] + public Guid DiscountGuid { get; set; } + + public DateTime DiscountLastModified { get; set; } + + [Column("DiscountSiteID")] + public int DiscountSiteId { get; set; } + + public string? DiscountDescription { get; set; } + + public DateTime? DiscountValidFrom { get; set; } + + public DateTime? DiscountValidTo { get; set; } + + public double DiscountOrder { get; set; } + + public string? DiscountProductCondition { get; set; } + + [StringLength(400)] + public string? DiscountRoles { get; set; } + + [StringLength(200)] + public string? DiscountCustomerRestriction { get; set; } + + public bool DiscountIsFlat { get; set; } + + public string? DiscountCartCondition { get; set; } + + [StringLength(100)] + public string DiscountApplyTo { get; set; } = null!; + + [Required] + public bool? DiscountApplyFurtherDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? DiscountOrderAmount { get; set; } + + public bool DiscountUsesCoupons { get; set; } + + [InverseProperty("CouponCodeDiscount")] + public virtual ICollection ComCouponCodes { get; set; } = new List(); + + [ForeignKey("DiscountSiteId")] + [InverseProperty("ComDiscounts")] + public virtual CmsSite DiscountSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComExchangeTable.cs b/Migration.Toolkit.KX12/Models/ComExchangeTable.cs index 4cf63e14..9f397979 100644 --- a/Migration.Toolkit.KX12/Models/ComExchangeTable.cs +++ b/Migration.Toolkit.KX12/Models/ComExchangeTable.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ExchangeTable")] -[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] -public partial class ComExchangeTable -{ - [Key] - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [StringLength(200)] - public string ExchangeTableDisplayName { get; set; } = null!; - - public DateTime? ExchangeTableValidFrom { get; set; } - - public DateTime? ExchangeTableValidTo { get; set; } - - [Column("ExchangeTableGUID")] - public Guid ExchangeTableGuid { get; set; } - - public DateTime ExchangeTableLastModified { get; set; } - - [Column("ExchangeTableSiteID")] - public int? ExchangeTableSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } - - [InverseProperty("ExchangeTable")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [ForeignKey("ExchangeTableSiteId")] - [InverseProperty("ComExchangeTables")] - public virtual CmsSite? ExchangeTableSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_ExchangeTable")] +[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] +public class ComExchangeTable +{ + [Key] + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [StringLength(200)] + public string ExchangeTableDisplayName { get; set; } = null!; + + public DateTime? ExchangeTableValidFrom { get; set; } + + public DateTime? ExchangeTableValidTo { get; set; } + + [Column("ExchangeTableGUID")] + public Guid ExchangeTableGuid { get; set; } + + public DateTime ExchangeTableLastModified { get; set; } + + [Column("ExchangeTableSiteID")] + public int? ExchangeTableSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } + + [InverseProperty("ExchangeTable")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [ForeignKey("ExchangeTableSiteId")] + [InverseProperty("ComExchangeTables")] + public virtual CmsSite? ExchangeTableSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComGiftCard.cs b/Migration.Toolkit.KX12/Models/ComGiftCard.cs index d2f2115e..20480743 100644 --- a/Migration.Toolkit.KX12/Models/ComGiftCard.cs +++ b/Migration.Toolkit.KX12/Models/ComGiftCard.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_GiftCard")] -[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] -public partial class ComGiftCard -{ - [Key] - [Column("GiftCardID")] - public int GiftCardId { get; set; } - - public Guid GiftCardGuid { get; set; } - - [StringLength(200)] - public string GiftCardDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GiftCardName { get; set; } = null!; - - public string? GiftCardDescription { get; set; } - - [Required] - public bool? GiftCardEnabled { get; set; } - - public DateTime GiftCardLastModified { get; set; } - - [Column("GiftCardSiteID")] - public int GiftCardSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardValue { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? GiftCardMinimumOrderPrice { get; set; } - - public string? GiftCardCartCondition { get; set; } - - public DateTime? GiftCardValidFrom { get; set; } - - public DateTime? GiftCardValidTo { get; set; } - - [StringLength(200)] - public string? GiftCardCustomerRestriction { get; set; } - - [StringLength(400)] - public string? GiftCardRoles { get; set; } - - [InverseProperty("GiftCardCouponCodeGiftCard")] - public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); - - [ForeignKey("GiftCardSiteId")] - [InverseProperty("ComGiftCards")] - public virtual CmsSite GiftCardSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_GiftCard")] +[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] +public class ComGiftCard +{ + [Key] + [Column("GiftCardID")] + public int GiftCardId { get; set; } + + public Guid GiftCardGuid { get; set; } + + [StringLength(200)] + public string GiftCardDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GiftCardName { get; set; } = null!; + + public string? GiftCardDescription { get; set; } + + [Required] + public bool? GiftCardEnabled { get; set; } + + public DateTime GiftCardLastModified { get; set; } + + [Column("GiftCardSiteID")] + public int GiftCardSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardValue { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? GiftCardMinimumOrderPrice { get; set; } + + public string? GiftCardCartCondition { get; set; } + + public DateTime? GiftCardValidFrom { get; set; } + + public DateTime? GiftCardValidTo { get; set; } + + [StringLength(200)] + public string? GiftCardCustomerRestriction { get; set; } + + [StringLength(400)] + public string? GiftCardRoles { get; set; } + + [InverseProperty("GiftCardCouponCodeGiftCard")] + public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); + + [ForeignKey("GiftCardSiteId")] + [InverseProperty("ComGiftCards")] + public virtual CmsSite GiftCardSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs index 14c8708c..8e6a61ce 100644 --- a/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs +++ b/Migration.Toolkit.KX12/Models/ComGiftCardCouponCode.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_GiftCardCouponCode")] -[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] -public partial class ComGiftCardCouponCode -{ - [Key] - [Column("GiftCardCouponCodeID")] - public int GiftCardCouponCodeId { get; set; } - - [StringLength(200)] - public string GiftCardCouponCodeCode { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardCouponCodeRemainingValue { get; set; } - - [Column("GiftCardCouponCodeGiftCardID")] - public int GiftCardCouponCodeGiftCardId { get; set; } - - public Guid GiftCardCouponCodeGuid { get; set; } - - public DateTime GiftCardCouponCodeLastModified { get; set; } - - [ForeignKey("GiftCardCouponCodeGiftCardId")] - [InverseProperty("ComGiftCardCouponCodes")] - public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_GiftCardCouponCode")] +[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] +public class ComGiftCardCouponCode +{ + [Key] + [Column("GiftCardCouponCodeID")] + public int GiftCardCouponCodeId { get; set; } + + [StringLength(200)] + public string GiftCardCouponCodeCode { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardCouponCodeRemainingValue { get; set; } + + [Column("GiftCardCouponCodeGiftCardID")] + public int GiftCardCouponCodeGiftCardId { get; set; } + + public Guid GiftCardCouponCodeGuid { get; set; } + + public DateTime GiftCardCouponCodeLastModified { get; set; } + + [ForeignKey("GiftCardCouponCodeGiftCardId")] + [InverseProperty("ComGiftCardCouponCodes")] + public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComInternalStatus.cs b/Migration.Toolkit.KX12/Models/ComInternalStatus.cs index ffaa3797..5d107f94 100644 --- a/Migration.Toolkit.KX12/Models/ComInternalStatus.cs +++ b/Migration.Toolkit.KX12/Models/ComInternalStatus.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_InternalStatus")] -[Index("InternalStatusSiteId", "InternalStatusDisplayName", "InternalStatusEnabled", Name = "IX_COM_InternalStatus_InternalStatusSiteID_InternalStatusDisplayName_InternalStatusEnabled")] -public partial class ComInternalStatus -{ - [Key] - [Column("InternalStatusID")] - public int InternalStatusId { get; set; } - - [StringLength(200)] - public string InternalStatusName { get; set; } = null!; - - [StringLength(200)] - public string InternalStatusDisplayName { get; set; } = null!; - - [Required] - public bool? InternalStatusEnabled { get; set; } - - [Column("InternalStatusGUID")] - public Guid InternalStatusGuid { get; set; } - - public DateTime InternalStatusLastModified { get; set; } - - [Column("InternalStatusSiteID")] - public int? InternalStatusSiteId { get; set; } - - [InverseProperty("SkuinternalStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("InternalStatusSiteId")] - [InverseProperty("ComInternalStatuses")] - public virtual CmsSite? InternalStatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_InternalStatus")] +[Index("InternalStatusSiteId", "InternalStatusDisplayName", "InternalStatusEnabled", Name = "IX_COM_InternalStatus_InternalStatusSiteID_InternalStatusDisplayName_InternalStatusEnabled")] +public class ComInternalStatus +{ + [Key] + [Column("InternalStatusID")] + public int InternalStatusId { get; set; } + + [StringLength(200)] + public string InternalStatusName { get; set; } = null!; + + [StringLength(200)] + public string InternalStatusDisplayName { get; set; } = null!; + + [Required] + public bool? InternalStatusEnabled { get; set; } + + [Column("InternalStatusGUID")] + public Guid InternalStatusGuid { get; set; } + + public DateTime InternalStatusLastModified { get; set; } + + [Column("InternalStatusSiteID")] + public int? InternalStatusSiteId { get; set; } + + [InverseProperty("SkuinternalStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("InternalStatusSiteId")] + [InverseProperty("ComInternalStatuses")] + public virtual CmsSite? InternalStatusSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComManufacturer.cs b/Migration.Toolkit.KX12/Models/ComManufacturer.cs index bf78c74a..f9811b76 100644 --- a/Migration.Toolkit.KX12/Models/ComManufacturer.cs +++ b/Migration.Toolkit.KX12/Models/ComManufacturer.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Manufacturer")] -[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] -public partial class ComManufacturer -{ - [Key] - [Column("ManufacturerID")] - public int ManufacturerId { get; set; } - - [StringLength(200)] - public string ManufacturerDisplayName { get; set; } = null!; - - [StringLength(400)] - public string? ManufactureHomepage { get; set; } - - [Required] - public bool? ManufacturerEnabled { get; set; } - - [Column("ManufacturerGUID")] - public Guid ManufacturerGuid { get; set; } - - public DateTime ManufacturerLastModified { get; set; } - - [Column("ManufacturerSiteID")] - public int? ManufacturerSiteId { get; set; } - - [Column("ManufacturerThumbnailGUID")] - public Guid? ManufacturerThumbnailGuid { get; set; } - - public string? ManufacturerDescription { get; set; } - - [StringLength(200)] - public string? ManufacturerName { get; set; } - - [InverseProperty("Skumanufacturer")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("ManufacturerSiteId")] - [InverseProperty("ComManufacturers")] - public virtual CmsSite? ManufacturerSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Manufacturer")] +[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] +public class ComManufacturer +{ + [Key] + [Column("ManufacturerID")] + public int ManufacturerId { get; set; } + + [StringLength(200)] + public string ManufacturerDisplayName { get; set; } = null!; + + [StringLength(400)] + public string? ManufactureHomepage { get; set; } + + [Required] + public bool? ManufacturerEnabled { get; set; } + + [Column("ManufacturerGUID")] + public Guid ManufacturerGuid { get; set; } + + public DateTime ManufacturerLastModified { get; set; } + + [Column("ManufacturerSiteID")] + public int? ManufacturerSiteId { get; set; } + + [Column("ManufacturerThumbnailGUID")] + public Guid? ManufacturerThumbnailGuid { get; set; } + + public string? ManufacturerDescription { get; set; } + + [StringLength(200)] + public string? ManufacturerName { get; set; } + + [InverseProperty("Skumanufacturer")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("ManufacturerSiteId")] + [InverseProperty("ComManufacturers")] + public virtual CmsSite? ManufacturerSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs index 745dc4f3..8a2ae371 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyCouponCode.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_MultiBuyCouponCode")] -[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] -public partial class ComMultiBuyCouponCode -{ - [Key] - [Column("MultiBuyCouponCodeID")] - public int MultiBuyCouponCodeId { get; set; } - - [StringLength(200)] - public string MultiBuyCouponCodeCode { get; set; } = null!; - - public int? MultiBuyCouponCodeUseLimit { get; set; } - - public int? MultiBuyCouponCodeUseCount { get; set; } - - [Column("MultiBuyCouponCodeMultiBuyDiscountID")] - public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } - - public DateTime MultiBuyCouponCodeLastModified { get; set; } - - [Column("MultiBuyCouponCodeGUID")] - public Guid MultiBuyCouponCodeGuid { get; set; } - - [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] - [InverseProperty("ComMultiBuyCouponCodes")] - public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_MultiBuyCouponCode")] +[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] +public class ComMultiBuyCouponCode +{ + [Key] + [Column("MultiBuyCouponCodeID")] + public int MultiBuyCouponCodeId { get; set; } + + [StringLength(200)] + public string MultiBuyCouponCodeCode { get; set; } = null!; + + public int? MultiBuyCouponCodeUseLimit { get; set; } + + public int? MultiBuyCouponCodeUseCount { get; set; } + + [Column("MultiBuyCouponCodeMultiBuyDiscountID")] + public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } + + public DateTime MultiBuyCouponCodeLastModified { get; set; } + + [Column("MultiBuyCouponCodeGUID")] + public Guid MultiBuyCouponCodeGuid { get; set; } + + [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] + [InverseProperty("ComMultiBuyCouponCodes")] + public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs index d9b19701..54c7ab3d 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscount.cs @@ -1,98 +1,97 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_MultiBuyDiscount")] -[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] -[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] -public partial class ComMultiBuyDiscount -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string MultiBuyDiscountName { get; set; } = null!; - - public string? MultiBuyDiscountDescription { get; set; } - - [Required] - public bool? MultiBuyDiscountEnabled { get; set; } - - [Column("MultiBuyDiscountGUID")] - public Guid MultiBuyDiscountGuid { get; set; } - - public DateTime MultiBuyDiscountLastModified { get; set; } - - [Column("MultiBuyDiscountSiteID")] - public int MultiBuyDiscountSiteId { get; set; } - - [Required] - public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } - - public int MultiBuyDiscountMinimumBuyCount { get; set; } - - public DateTime? MultiBuyDiscountValidFrom { get; set; } - - public DateTime? MultiBuyDiscountValidTo { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; - - [StringLength(400)] - public string? MultiBuyDiscountRoles { get; set; } - - [Column("MultiBuyDiscountApplyToSKUID")] - public int? MultiBuyDiscountApplyToSkuid { get; set; } - - public int? MultiBuyDiscountLimitPerOrder { get; set; } - - public bool? MultiBuyDiscountUsesCoupons { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? MultiBuyDiscountValue { get; set; } - - public bool? MultiBuyDiscountIsFlat { get; set; } - - [Required] - public bool? MultiBuyDiscountAutoAddEnabled { get; set; } - - public int? MultiBuyDiscountPriority { get; set; } - - public bool MultiBuyDiscountIsProductCoupon { get; set; } - - [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] - public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("MultibuyDiscount")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountApplyToSkuid")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } - - [ForeignKey("MultiBuyDiscountSiteId")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Departments { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Skus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_MultiBuyDiscount")] +[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] +[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] +public class ComMultiBuyDiscount +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string MultiBuyDiscountName { get; set; } = null!; + + public string? MultiBuyDiscountDescription { get; set; } + + [Required] + public bool? MultiBuyDiscountEnabled { get; set; } + + [Column("MultiBuyDiscountGUID")] + public Guid MultiBuyDiscountGuid { get; set; } + + public DateTime MultiBuyDiscountLastModified { get; set; } + + [Column("MultiBuyDiscountSiteID")] + public int MultiBuyDiscountSiteId { get; set; } + + [Required] + public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } + + public int MultiBuyDiscountMinimumBuyCount { get; set; } + + public DateTime? MultiBuyDiscountValidFrom { get; set; } + + public DateTime? MultiBuyDiscountValidTo { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; + + [StringLength(400)] + public string? MultiBuyDiscountRoles { get; set; } + + [Column("MultiBuyDiscountApplyToSKUID")] + public int? MultiBuyDiscountApplyToSkuid { get; set; } + + public int? MultiBuyDiscountLimitPerOrder { get; set; } + + public bool? MultiBuyDiscountUsesCoupons { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? MultiBuyDiscountValue { get; set; } + + public bool? MultiBuyDiscountIsFlat { get; set; } + + [Required] + public bool? MultiBuyDiscountAutoAddEnabled { get; set; } + + public int? MultiBuyDiscountPriority { get; set; } + + public bool MultiBuyDiscountIsProductCoupon { get; set; } + + [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] + public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("MultibuyDiscount")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountApplyToSkuid")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } + + [ForeignKey("MultiBuyDiscountSiteId")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Departments { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Skus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs index 62e7186f..fe57bc00 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountBrand.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("MultiBuyDiscountId", "BrandId")] -[Table("COM_MultiBuyDiscountBrand")] -[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] -public partial class ComMultiBuyDiscountBrand -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [Required] - public bool? BrandIncluded { get; set; } - - [ForeignKey("BrandId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComBrand Brand { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("MultiBuyDiscountId", "BrandId")] +[Table("COM_MultiBuyDiscountBrand")] +[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] +public class ComMultiBuyDiscountBrand +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [Required] + public bool? BrandIncluded { get; set; } + + [ForeignKey("BrandId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComBrand Brand { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs index 3b314b1f..cc1e08a1 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountCollection.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("MultibuyDiscountId", "CollectionId")] -[Table("COM_MultiBuyDiscountCollection")] -[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] -public partial class ComMultiBuyDiscountCollection -{ - [Key] - [Column("MultibuyDiscountID")] - public int MultibuyDiscountId { get; set; } - - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [Required] - public bool? CollectionIncluded { get; set; } - - [ForeignKey("CollectionId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComCollection Collection { get; set; } = null!; - - [ForeignKey("MultibuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("MultibuyDiscountId", "CollectionId")] +[Table("COM_MultiBuyDiscountCollection")] +[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] +public class ComMultiBuyDiscountCollection +{ + [Key] + [Column("MultibuyDiscountID")] + public int MultibuyDiscountId { get; set; } + + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [Required] + public bool? CollectionIncluded { get; set; } + + [ForeignKey("CollectionId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComCollection Collection { get; set; } = null!; + + [ForeignKey("MultibuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs index c26a3a49..916b60dc 100644 --- a/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs +++ b/Migration.Toolkit.KX12/Models/ComMultiBuyDiscountTree.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("MultiBuyDiscountId", "NodeId")] -[Table("COM_MultiBuyDiscountTree")] -[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] -public partial class ComMultiBuyDiscountTree -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [Required] - public bool? NodeIncluded { get; set; } - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; - - [ForeignKey("NodeId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual CmsTree Node { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("MultiBuyDiscountId", "NodeId")] +[Table("COM_MultiBuyDiscountTree")] +[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] +public class ComMultiBuyDiscountTree +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [Required] + public bool? NodeIncluded { get; set; } + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; + + [ForeignKey("NodeId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComOptionCategory.cs b/Migration.Toolkit.KX12/Models/ComOptionCategory.cs index 8c44f940..381158a1 100644 --- a/Migration.Toolkit.KX12/Models/ComOptionCategory.cs +++ b/Migration.Toolkit.KX12/Models/ComOptionCategory.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OptionCategory")] -[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] -public partial class ComOptionCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("ComOptionCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [InverseProperty("Category")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("SkuoptionCategory")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_OptionCategory")] +[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] +public class ComOptionCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("ComOptionCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [InverseProperty("Category")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("SkuoptionCategory")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ComOrder.cs b/Migration.Toolkit.KX12/Models/ComOrder.cs index 4ab513cd..c07b574c 100644 --- a/Migration.Toolkit.KX12/Models/ComOrder.cs +++ b/Migration.Toolkit.KX12/Models/ComOrder.cs @@ -1,132 +1,131 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Order")] -[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] -[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] -[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] -[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] -[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] -[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] -[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] -public partial class ComOrder -{ - [Key] - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("OrderShippingOptionID")] - public int? OrderShippingOptionId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalShipping { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalPrice { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalTax { get; set; } - - public DateTime OrderDate { get; set; } - - [Column("OrderStatusID")] - public int? OrderStatusId { get; set; } - - [Column("OrderCurrencyID")] - public int? OrderCurrencyId { get; set; } - - [Column("OrderCustomerID")] - public int OrderCustomerId { get; set; } - - [Column("OrderCreatedByUserID")] - public int? OrderCreatedByUserId { get; set; } - - public string? OrderNote { get; set; } - - [Column("OrderSiteID")] - public int OrderSiteId { get; set; } - - [Column("OrderPaymentOptionID")] - public int? OrderPaymentOptionId { get; set; } - - public string? OrderInvoice { get; set; } - - [StringLength(200)] - public string? OrderInvoiceNumber { get; set; } - - [StringLength(100)] - public string? OrderTrackingNumber { get; set; } - - public string? OrderCustomData { get; set; } - - public string? OrderPaymentResult { get; set; } - - [Column("OrderGUID")] - public Guid OrderGuid { get; set; } - - public DateTime OrderLastModified { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalPriceInMainCurrency { get; set; } - - public bool? OrderIsPaid { get; set; } - - [StringLength(10)] - public string? OrderCulture { get; set; } - - public string? OrderDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderGrandTotal { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderGrandTotalInMainCurrency { get; set; } - - public string? OrderOtherPayments { get; set; } - - public string? OrderTaxSummary { get; set; } - - public string? OrderCouponCodes { get; set; } - - [InverseProperty("AddressOrder")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("OrderItemOrder")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Order")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [ForeignKey("OrderCreatedByUserId")] - [InverseProperty("ComOrders")] - public virtual CmsUser? OrderCreatedByUser { get; set; } - - [ForeignKey("OrderCurrencyId")] - [InverseProperty("ComOrders")] - public virtual ComCurrency? OrderCurrency { get; set; } - - [ForeignKey("OrderCustomerId")] - [InverseProperty("ComOrders")] - public virtual ComCustomer OrderCustomer { get; set; } = null!; - - [ForeignKey("OrderPaymentOptionId")] - [InverseProperty("ComOrders")] - public virtual ComPaymentOption? OrderPaymentOption { get; set; } - - [ForeignKey("OrderShippingOptionId")] - [InverseProperty("ComOrders")] - public virtual ComShippingOption? OrderShippingOption { get; set; } - - [ForeignKey("OrderSiteId")] - [InverseProperty("ComOrders")] - public virtual CmsSite OrderSite { get; set; } = null!; - - [ForeignKey("OrderStatusId")] - [InverseProperty("ComOrders")] - public virtual ComOrderStatus? OrderStatus { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Order")] +[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] +[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] +[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] +[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] +[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] +[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] +[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] +public class ComOrder +{ + [Key] + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("OrderShippingOptionID")] + public int? OrderShippingOptionId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalShipping { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalPrice { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalTax { get; set; } + + public DateTime OrderDate { get; set; } + + [Column("OrderStatusID")] + public int? OrderStatusId { get; set; } + + [Column("OrderCurrencyID")] + public int? OrderCurrencyId { get; set; } + + [Column("OrderCustomerID")] + public int OrderCustomerId { get; set; } + + [Column("OrderCreatedByUserID")] + public int? OrderCreatedByUserId { get; set; } + + public string? OrderNote { get; set; } + + [Column("OrderSiteID")] + public int OrderSiteId { get; set; } + + [Column("OrderPaymentOptionID")] + public int? OrderPaymentOptionId { get; set; } + + public string? OrderInvoice { get; set; } + + [StringLength(200)] + public string? OrderInvoiceNumber { get; set; } + + [StringLength(100)] + public string? OrderTrackingNumber { get; set; } + + public string? OrderCustomData { get; set; } + + public string? OrderPaymentResult { get; set; } + + [Column("OrderGUID")] + public Guid OrderGuid { get; set; } + + public DateTime OrderLastModified { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalPriceInMainCurrency { get; set; } + + public bool? OrderIsPaid { get; set; } + + [StringLength(10)] + public string? OrderCulture { get; set; } + + public string? OrderDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderGrandTotal { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderGrandTotalInMainCurrency { get; set; } + + public string? OrderOtherPayments { get; set; } + + public string? OrderTaxSummary { get; set; } + + public string? OrderCouponCodes { get; set; } + + [InverseProperty("AddressOrder")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("OrderItemOrder")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Order")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [ForeignKey("OrderCreatedByUserId")] + [InverseProperty("ComOrders")] + public virtual CmsUser? OrderCreatedByUser { get; set; } + + [ForeignKey("OrderCurrencyId")] + [InverseProperty("ComOrders")] + public virtual ComCurrency? OrderCurrency { get; set; } + + [ForeignKey("OrderCustomerId")] + [InverseProperty("ComOrders")] + public virtual ComCustomer OrderCustomer { get; set; } = null!; + + [ForeignKey("OrderPaymentOptionId")] + [InverseProperty("ComOrders")] + public virtual ComPaymentOption? OrderPaymentOption { get; set; } + + [ForeignKey("OrderShippingOptionId")] + [InverseProperty("ComOrders")] + public virtual ComShippingOption? OrderShippingOption { get; set; } + + [ForeignKey("OrderSiteId")] + [InverseProperty("ComOrders")] + public virtual CmsSite OrderSite { get; set; } = null!; + + [ForeignKey("OrderStatusId")] + [InverseProperty("ComOrders")] + public virtual ComOrderStatus? OrderStatus { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComOrderAddress.cs b/Migration.Toolkit.KX12/Models/ComOrderAddress.cs index 47925767..d2011dd1 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderAddress.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderAddress.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderAddress")] -[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] -[Index("AddressOrderId", "AddressType", Name = "IX_COM_OrderAddress_AddressOrderID_AddressType", IsUnique = true)] -[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] -public partial class ComOrderAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [Column("AddressOrderID")] - public int AddressOrderId { get; set; } - - public int AddressType { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressOrderId")] - [InverseProperty("ComOrderAddresses")] - public virtual ComOrder AddressOrder { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsState? AddressState { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_OrderAddress")] +[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] +[Index("AddressOrderId", "AddressType", Name = "IX_COM_OrderAddress_AddressOrderID_AddressType", IsUnique = true)] +[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] +public class ComOrderAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [Column("AddressOrderID")] + public int AddressOrderId { get; set; } + + public int AddressType { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressOrderId")] + [InverseProperty("ComOrderAddresses")] + public virtual ComOrder AddressOrder { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsState? AddressState { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComOrderItem.cs b/Migration.Toolkit.KX12/Models/ComOrderItem.cs index cdf6e1ae..ffb82f88 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderItem.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderItem.cs @@ -1,70 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderItem")] -[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] -[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] -public partial class ComOrderItem -{ - [Key] - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("OrderItemOrderID")] - public int OrderItemOrderId { get; set; } - - [Column("OrderItemSKUID")] - public int OrderItemSkuid { get; set; } - - [Column("OrderItemSKUName")] - [StringLength(450)] - public string OrderItemSkuname { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemUnitPrice { get; set; } - - public int OrderItemUnitCount { get; set; } - - public string? OrderItemCustomData { get; set; } - - public Guid OrderItemGuid { get; set; } - - public Guid? OrderItemParentGuid { get; set; } - - public DateTime OrderItemLastModified { get; set; } - - public DateTime? OrderItemValidTo { get; set; } - - [Column("OrderItemBundleGUID")] - public Guid? OrderItemBundleGuid { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderItemTotalPriceInMainCurrency { get; set; } - - public bool? OrderItemSendNotification { get; set; } - - public string? OrderItemText { get; set; } - - public string? OrderItemProductDiscounts { get; set; } - - public string? OrderItemDiscountSummary { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemTotalPrice { get; set; } - - [InverseProperty("OrderItem")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("OrderItemOrderId")] - [InverseProperty("ComOrderItems")] - public virtual ComOrder OrderItemOrder { get; set; } = null!; - - [ForeignKey("OrderItemSkuid")] - [InverseProperty("ComOrderItems")] - public virtual ComSku OrderItemSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_OrderItem")] +[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] +[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] +public class ComOrderItem +{ + [Key] + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("OrderItemOrderID")] + public int OrderItemOrderId { get; set; } + + [Column("OrderItemSKUID")] + public int OrderItemSkuid { get; set; } + + [Column("OrderItemSKUName")] + [StringLength(450)] + public string OrderItemSkuname { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemUnitPrice { get; set; } + + public int OrderItemUnitCount { get; set; } + + public string? OrderItemCustomData { get; set; } + + public Guid OrderItemGuid { get; set; } + + public Guid? OrderItemParentGuid { get; set; } + + public DateTime OrderItemLastModified { get; set; } + + public DateTime? OrderItemValidTo { get; set; } + + [Column("OrderItemBundleGUID")] + public Guid? OrderItemBundleGuid { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderItemTotalPriceInMainCurrency { get; set; } + + public bool? OrderItemSendNotification { get; set; } + + public string? OrderItemText { get; set; } + + public string? OrderItemProductDiscounts { get; set; } + + public string? OrderItemDiscountSummary { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemTotalPrice { get; set; } + + [InverseProperty("OrderItem")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("OrderItemOrderId")] + [InverseProperty("ComOrderItems")] + public virtual ComOrder OrderItemOrder { get; set; } = null!; + + [ForeignKey("OrderItemSkuid")] + [InverseProperty("ComOrderItems")] + public virtual ComSku OrderItemSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs index 78734f25..9ee4a61b 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderItemSkufile.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderItemSKUFile")] -[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] -[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] -public partial class ComOrderItemSkufile -{ - [Key] - [Column("OrderItemSKUFileID")] - public int OrderItemSkufileId { get; set; } - - public Guid Token { get; set; } - - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("FileID")] - public int FileId { get; set; } - - [ForeignKey("FileId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComSkufile File { get; set; } = null!; - - [ForeignKey("OrderItemId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComOrderItem OrderItem { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_OrderItemSKUFile")] +[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] +[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] +public class ComOrderItemSkufile +{ + [Key] + [Column("OrderItemSKUFileID")] + public int OrderItemSkufileId { get; set; } + + public Guid Token { get; set; } + + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("FileID")] + public int FileId { get; set; } + + [ForeignKey("FileId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComSkufile File { get; set; } = null!; + + [ForeignKey("OrderItemId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComOrderItem OrderItem { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComOrderStatus.cs b/Migration.Toolkit.KX12/Models/ComOrderStatus.cs index df9473bc..82baf65e 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderStatus.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderStatus.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderStatus")] -[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] -public partial class ComOrderStatus -{ - [Key] - [Column("StatusID")] - public int StatusId { get; set; } - - [StringLength(200)] - public string StatusName { get; set; } = null!; - - [StringLength(200)] - public string StatusDisplayName { get; set; } = null!; - - public int? StatusOrder { get; set; } - - [Required] - public bool? StatusEnabled { get; set; } - - [StringLength(7)] - public string? StatusColor { get; set; } - - [Column("StatusGUID")] - public Guid StatusGuid { get; set; } - - public DateTime StatusLastModified { get; set; } - - public bool? StatusSendNotification { get; set; } - - [Column("StatusSiteID")] - public int? StatusSiteId { get; set; } - - public bool? StatusOrderIsPaid { get; set; } - - [InverseProperty("FromStatus")] - public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); - - [InverseProperty("ToStatus")] - public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); - - [InverseProperty("OrderStatus")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionAuthorizedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionFailedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionSucceededOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); - - [ForeignKey("StatusSiteId")] - [InverseProperty("ComOrderStatuses")] - public virtual CmsSite? StatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_OrderStatus")] +[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] +public class ComOrderStatus +{ + [Key] + [Column("StatusID")] + public int StatusId { get; set; } + + [StringLength(200)] + public string StatusName { get; set; } = null!; + + [StringLength(200)] + public string StatusDisplayName { get; set; } = null!; + + public int? StatusOrder { get; set; } + + [Required] + public bool? StatusEnabled { get; set; } + + [StringLength(7)] + public string? StatusColor { get; set; } + + [Column("StatusGUID")] + public Guid StatusGuid { get; set; } + + public DateTime StatusLastModified { get; set; } + + public bool? StatusSendNotification { get; set; } + + [Column("StatusSiteID")] + public int? StatusSiteId { get; set; } + + public bool? StatusOrderIsPaid { get; set; } + + [InverseProperty("FromStatus")] + public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); + + [InverseProperty("ToStatus")] + public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); + + [InverseProperty("OrderStatus")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionAuthorizedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionFailedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionSucceededOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); + + [ForeignKey("StatusSiteId")] + [InverseProperty("ComOrderStatuses")] + public virtual CmsSite? StatusSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs b/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs index 523016b4..cb1d432e 100644 --- a/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs +++ b/Migration.Toolkit.KX12/Models/ComOrderStatusUser.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_OrderStatusUser")] -[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] -[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] -[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] -[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] -public partial class ComOrderStatusUser -{ - [Key] - [Column("OrderStatusUserID")] - public int OrderStatusUserId { get; set; } - - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("FromStatusID")] - public int? FromStatusId { get; set; } - - [Column("ToStatusID")] - public int ToStatusId { get; set; } - - [Column("ChangedByUserID")] - public int? ChangedByUserId { get; set; } - - public DateTime Date { get; set; } - - public string? Note { get; set; } - - [ForeignKey("ChangedByUserId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual CmsUser? ChangedByUser { get; set; } - - [ForeignKey("FromStatusId")] - [InverseProperty("ComOrderStatusUserFromStatuses")] - public virtual ComOrderStatus? FromStatus { get; set; } - - [ForeignKey("OrderId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual ComOrder Order { get; set; } = null!; - - [ForeignKey("ToStatusId")] - [InverseProperty("ComOrderStatusUserToStatuses")] - public virtual ComOrderStatus ToStatus { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_OrderStatusUser")] +[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] +[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] +[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] +[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] +public class ComOrderStatusUser +{ + [Key] + [Column("OrderStatusUserID")] + public int OrderStatusUserId { get; set; } + + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("FromStatusID")] + public int? FromStatusId { get; set; } + + [Column("ToStatusID")] + public int ToStatusId { get; set; } + + [Column("ChangedByUserID")] + public int? ChangedByUserId { get; set; } + + public DateTime Date { get; set; } + + public string? Note { get; set; } + + [ForeignKey("ChangedByUserId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual CmsUser? ChangedByUser { get; set; } + + [ForeignKey("FromStatusId")] + [InverseProperty("ComOrderStatusUserFromStatuses")] + public virtual ComOrderStatus? FromStatus { get; set; } + + [ForeignKey("OrderId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual ComOrder Order { get; set; } = null!; + + [ForeignKey("ToStatusId")] + [InverseProperty("ComOrderStatusUserToStatuses")] + public virtual ComOrderStatus ToStatus { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComPaymentOption.cs b/Migration.Toolkit.KX12/Models/ComPaymentOption.cs index b6b4b868..46a01f77 100644 --- a/Migration.Toolkit.KX12/Models/ComPaymentOption.cs +++ b/Migration.Toolkit.KX12/Models/ComPaymentOption.cs @@ -1,83 +1,82 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_PaymentOption")] -[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] -[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] -[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] -[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] -public partial class ComPaymentOption -{ - [Key] - [Column("PaymentOptionID")] - public int PaymentOptionId { get; set; } - - [StringLength(200)] - public string PaymentOptionName { get; set; } = null!; - - [StringLength(200)] - public string PaymentOptionDisplayName { get; set; } = null!; - - [Required] - public bool? PaymentOptionEnabled { get; set; } - - [Column("PaymentOptionSiteID")] - public int? PaymentOptionSiteId { get; set; } - - [StringLength(500)] - public string? PaymentOptionPaymentGateUrl { get; set; } - - [StringLength(200)] - public string? PaymentOptionAssemblyName { get; set; } - - [StringLength(200)] - public string? PaymentOptionClassName { get; set; } - - [Column("PaymentOptionSucceededOrderStatusID")] - public int? PaymentOptionSucceededOrderStatusId { get; set; } - - [Column("PaymentOptionFailedOrderStatusID")] - public int? PaymentOptionFailedOrderStatusId { get; set; } - - [Column("PaymentOptionGUID")] - public Guid PaymentOptionGuid { get; set; } - - public DateTime PaymentOptionLastModified { get; set; } - - public bool? PaymentOptionAllowIfNoShipping { get; set; } - - [Column("PaymentOptionThumbnailGUID")] - public Guid? PaymentOptionThumbnailGuid { get; set; } - - public string? PaymentOptionDescription { get; set; } - - [Column("PaymentOptionAuthorizedOrderStatusID")] - public int? PaymentOptionAuthorizedOrderStatusId { get; set; } - - [InverseProperty("OrderPaymentOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartPaymentOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionFailedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionSiteId")] - [InverseProperty("ComPaymentOptions")] - public virtual CmsSite? PaymentOptionSite { get; set; } - - [ForeignKey("PaymentOptionSucceededOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_PaymentOption")] +[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] +[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] +[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] +[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] +public class ComPaymentOption +{ + [Key] + [Column("PaymentOptionID")] + public int PaymentOptionId { get; set; } + + [StringLength(200)] + public string PaymentOptionName { get; set; } = null!; + + [StringLength(200)] + public string PaymentOptionDisplayName { get; set; } = null!; + + [Required] + public bool? PaymentOptionEnabled { get; set; } + + [Column("PaymentOptionSiteID")] + public int? PaymentOptionSiteId { get; set; } + + [StringLength(500)] + public string? PaymentOptionPaymentGateUrl { get; set; } + + [StringLength(200)] + public string? PaymentOptionAssemblyName { get; set; } + + [StringLength(200)] + public string? PaymentOptionClassName { get; set; } + + [Column("PaymentOptionSucceededOrderStatusID")] + public int? PaymentOptionSucceededOrderStatusId { get; set; } + + [Column("PaymentOptionFailedOrderStatusID")] + public int? PaymentOptionFailedOrderStatusId { get; set; } + + [Column("PaymentOptionGUID")] + public Guid PaymentOptionGuid { get; set; } + + public DateTime PaymentOptionLastModified { get; set; } + + public bool? PaymentOptionAllowIfNoShipping { get; set; } + + [Column("PaymentOptionThumbnailGUID")] + public Guid? PaymentOptionThumbnailGuid { get; set; } + + public string? PaymentOptionDescription { get; set; } + + [Column("PaymentOptionAuthorizedOrderStatusID")] + public int? PaymentOptionAuthorizedOrderStatusId { get; set; } + + [InverseProperty("OrderPaymentOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartPaymentOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionFailedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionSiteId")] + [InverseProperty("ComPaymentOptions")] + public virtual CmsSite? PaymentOptionSite { get; set; } + + [ForeignKey("PaymentOptionSucceededOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComPublicStatus.cs b/Migration.Toolkit.KX12/Models/ComPublicStatus.cs index 7ca61205..701e3d3c 100644 --- a/Migration.Toolkit.KX12/Models/ComPublicStatus.cs +++ b/Migration.Toolkit.KX12/Models/ComPublicStatus.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_PublicStatus")] -[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] -public partial class ComPublicStatus -{ - [Key] - [Column("PublicStatusID")] - public int PublicStatusId { get; set; } - - [StringLength(200)] - public string PublicStatusName { get; set; } = null!; - - [StringLength(200)] - public string PublicStatusDisplayName { get; set; } = null!; - - [Required] - public bool? PublicStatusEnabled { get; set; } - - [Column("PublicStatusGUID")] - public Guid? PublicStatusGuid { get; set; } - - public DateTime PublicStatusLastModified { get; set; } - - [Column("PublicStatusSiteID")] - public int? PublicStatusSiteId { get; set; } - - [InverseProperty("SkupublicStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("PublicStatusSiteId")] - [InverseProperty("ComPublicStatuses")] - public virtual CmsSite? PublicStatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_PublicStatus")] +[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] +public class ComPublicStatus +{ + [Key] + [Column("PublicStatusID")] + public int PublicStatusId { get; set; } + + [StringLength(200)] + public string PublicStatusName { get; set; } = null!; + + [StringLength(200)] + public string PublicStatusDisplayName { get; set; } = null!; + + [Required] + public bool? PublicStatusEnabled { get; set; } + + [Column("PublicStatusGUID")] + public Guid? PublicStatusGuid { get; set; } + + public DateTime PublicStatusLastModified { get; set; } + + [Column("PublicStatusSiteID")] + public int? PublicStatusSiteId { get; set; } + + [InverseProperty("SkupublicStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("PublicStatusSiteId")] + [InverseProperty("ComPublicStatuses")] + public virtual CmsSite? PublicStatusSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComShippingCost.cs b/Migration.Toolkit.KX12/Models/ComShippingCost.cs index 12152a09..031f783e 100644 --- a/Migration.Toolkit.KX12/Models/ComShippingCost.cs +++ b/Migration.Toolkit.KX12/Models/ComShippingCost.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShippingCost")] -[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] -public partial class ComShippingCost -{ - [Key] - [Column("ShippingCostID")] - public int ShippingCostId { get; set; } - - [Column("ShippingCostShippingOptionID")] - public int ShippingCostShippingOptionId { get; set; } - - public double ShippingCostMinWeight { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ShippingCostValue { get; set; } - - [Column("ShippingCostGUID")] - public Guid ShippingCostGuid { get; set; } - - public DateTime ShippingCostLastModified { get; set; } - - [ForeignKey("ShippingCostShippingOptionId")] - [InverseProperty("ComShippingCosts")] - public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_ShippingCost")] +[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] +public class ComShippingCost +{ + [Key] + [Column("ShippingCostID")] + public int ShippingCostId { get; set; } + + [Column("ShippingCostShippingOptionID")] + public int ShippingCostShippingOptionId { get; set; } + + public double ShippingCostMinWeight { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ShippingCostValue { get; set; } + + [Column("ShippingCostGUID")] + public Guid ShippingCostGuid { get; set; } + + public DateTime ShippingCostLastModified { get; set; } + + [ForeignKey("ShippingCostShippingOptionId")] + [InverseProperty("ComShippingCosts")] + public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComShippingOption.cs b/Migration.Toolkit.KX12/Models/ComShippingOption.cs index 5bd5ef31..69714e06 100644 --- a/Migration.Toolkit.KX12/Models/ComShippingOption.cs +++ b/Migration.Toolkit.KX12/Models/ComShippingOption.cs @@ -1,70 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShippingOption")] -[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] -[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] -[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] -public partial class ComShippingOption -{ - [Key] - [Column("ShippingOptionID")] - public int ShippingOptionId { get; set; } - - [StringLength(200)] - public string ShippingOptionName { get; set; } = null!; - - [StringLength(200)] - public string ShippingOptionDisplayName { get; set; } = null!; - - [Required] - public bool? ShippingOptionEnabled { get; set; } - - [Column("ShippingOptionSiteID")] - public int? ShippingOptionSiteId { get; set; } - - [Column("ShippingOptionGUID")] - public Guid ShippingOptionGuid { get; set; } - - public DateTime ShippingOptionLastModified { get; set; } - - [Column("ShippingOptionThumbnailGUID")] - public Guid? ShippingOptionThumbnailGuid { get; set; } - - public string? ShippingOptionDescription { get; set; } - - [Column("ShippingOptionCarrierID")] - public int? ShippingOptionCarrierId { get; set; } - - [StringLength(200)] - public string? ShippingOptionCarrierServiceName { get; set; } - - [Column("ShippingOptionTaxClassID")] - public int? ShippingOptionTaxClassId { get; set; } - - [InverseProperty("OrderShippingOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShippingCostShippingOption")] - public virtual ICollection ComShippingCosts { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("ShippingOptionCarrierId")] - [InverseProperty("ComShippingOptions")] - public virtual ComCarrier? ShippingOptionCarrier { get; set; } - - [ForeignKey("ShippingOptionSiteId")] - [InverseProperty("ComShippingOptions")] - public virtual CmsSite? ShippingOptionSite { get; set; } - - [ForeignKey("ShippingOptionTaxClassId")] - [InverseProperty("ComShippingOptions")] - public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_ShippingOption")] +[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] +[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] +[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] +public class ComShippingOption +{ + [Key] + [Column("ShippingOptionID")] + public int ShippingOptionId { get; set; } + + [StringLength(200)] + public string ShippingOptionName { get; set; } = null!; + + [StringLength(200)] + public string ShippingOptionDisplayName { get; set; } = null!; + + [Required] + public bool? ShippingOptionEnabled { get; set; } + + [Column("ShippingOptionSiteID")] + public int? ShippingOptionSiteId { get; set; } + + [Column("ShippingOptionGUID")] + public Guid ShippingOptionGuid { get; set; } + + public DateTime ShippingOptionLastModified { get; set; } + + [Column("ShippingOptionThumbnailGUID")] + public Guid? ShippingOptionThumbnailGuid { get; set; } + + public string? ShippingOptionDescription { get; set; } + + [Column("ShippingOptionCarrierID")] + public int? ShippingOptionCarrierId { get; set; } + + [StringLength(200)] + public string? ShippingOptionCarrierServiceName { get; set; } + + [Column("ShippingOptionTaxClassID")] + public int? ShippingOptionTaxClassId { get; set; } + + [InverseProperty("OrderShippingOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShippingCostShippingOption")] + public virtual ICollection ComShippingCosts { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("ShippingOptionCarrierId")] + [InverseProperty("ComShippingOptions")] + public virtual ComCarrier? ShippingOptionCarrier { get; set; } + + [ForeignKey("ShippingOptionSiteId")] + [InverseProperty("ComShippingOptions")] + public virtual CmsSite? ShippingOptionSite { get; set; } + + [ForeignKey("ShippingOptionTaxClassId")] + [InverseProperty("ComShippingOptions")] + public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCart.cs b/Migration.Toolkit.KX12/Models/ComShoppingCart.cs index 4c733227..d4ca901a 100644 --- a/Migration.Toolkit.KX12/Models/ComShoppingCart.cs +++ b/Migration.Toolkit.KX12/Models/ComShoppingCart.cs @@ -1,107 +1,106 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShoppingCart")] -[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] -[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] -[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] -[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] -[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] -[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] -[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] -[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] -[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] -[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] -[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] -public partial class ComShoppingCart -{ - [Key] - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("ShoppingCartGUID")] - public Guid ShoppingCartGuid { get; set; } - - [Column("ShoppingCartUserID")] - public int? ShoppingCartUserId { get; set; } - - [Column("ShoppingCartSiteID")] - public int ShoppingCartSiteId { get; set; } - - public DateTime ShoppingCartLastUpdate { get; set; } - - [Column("ShoppingCartCurrencyID")] - public int? ShoppingCartCurrencyId { get; set; } - - [Column("ShoppingCartPaymentOptionID")] - public int? ShoppingCartPaymentOptionId { get; set; } - - [Column("ShoppingCartShippingOptionID")] - public int? ShoppingCartShippingOptionId { get; set; } - - [Column("ShoppingCartBillingAddressID")] - public int? ShoppingCartBillingAddressId { get; set; } - - [Column("ShoppingCartShippingAddressID")] - public int? ShoppingCartShippingAddressId { get; set; } - - [Column("ShoppingCartCustomerID")] - public int? ShoppingCartCustomerId { get; set; } - - public string? ShoppingCartNote { get; set; } - - [Column("ShoppingCartCompanyAddressID")] - public int? ShoppingCartCompanyAddressId { get; set; } - - public string? ShoppingCartCustomData { get; set; } - - [Column("ShoppingCartContactID")] - public int? ShoppingCartContactId { get; set; } - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [ForeignKey("ShoppingCartBillingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] - public virtual ComAddress? ShoppingCartBillingAddress { get; set; } - - [ForeignKey("ShoppingCartCompanyAddressId")] - [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] - public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } - - [ForeignKey("ShoppingCartCurrencyId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCurrency? ShoppingCartCurrency { get; set; } - - [ForeignKey("ShoppingCartCustomerId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCustomer? ShoppingCartCustomer { get; set; } - - [ForeignKey("ShoppingCartPaymentOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } - - [ForeignKey("ShoppingCartShippingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] - public virtual ComAddress? ShoppingCartShippingAddress { get; set; } - - [ForeignKey("ShoppingCartShippingOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } - - [ForeignKey("ShoppingCartSiteId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsSite ShoppingCartSite { get; set; } = null!; - - [ForeignKey("ShoppingCartUserId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsUser? ShoppingCartUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_ShoppingCart")] +[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] +[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] +[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] +[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] +[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] +[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] +[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] +[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] +[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] +[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] +[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] +public class ComShoppingCart +{ + [Key] + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("ShoppingCartGUID")] + public Guid ShoppingCartGuid { get; set; } + + [Column("ShoppingCartUserID")] + public int? ShoppingCartUserId { get; set; } + + [Column("ShoppingCartSiteID")] + public int ShoppingCartSiteId { get; set; } + + public DateTime ShoppingCartLastUpdate { get; set; } + + [Column("ShoppingCartCurrencyID")] + public int? ShoppingCartCurrencyId { get; set; } + + [Column("ShoppingCartPaymentOptionID")] + public int? ShoppingCartPaymentOptionId { get; set; } + + [Column("ShoppingCartShippingOptionID")] + public int? ShoppingCartShippingOptionId { get; set; } + + [Column("ShoppingCartBillingAddressID")] + public int? ShoppingCartBillingAddressId { get; set; } + + [Column("ShoppingCartShippingAddressID")] + public int? ShoppingCartShippingAddressId { get; set; } + + [Column("ShoppingCartCustomerID")] + public int? ShoppingCartCustomerId { get; set; } + + public string? ShoppingCartNote { get; set; } + + [Column("ShoppingCartCompanyAddressID")] + public int? ShoppingCartCompanyAddressId { get; set; } + + public string? ShoppingCartCustomData { get; set; } + + [Column("ShoppingCartContactID")] + public int? ShoppingCartContactId { get; set; } + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [ForeignKey("ShoppingCartBillingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] + public virtual ComAddress? ShoppingCartBillingAddress { get; set; } + + [ForeignKey("ShoppingCartCompanyAddressId")] + [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] + public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } + + [ForeignKey("ShoppingCartCurrencyId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCurrency? ShoppingCartCurrency { get; set; } + + [ForeignKey("ShoppingCartCustomerId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCustomer? ShoppingCartCustomer { get; set; } + + [ForeignKey("ShoppingCartPaymentOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } + + [ForeignKey("ShoppingCartShippingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] + public virtual ComAddress? ShoppingCartShippingAddress { get; set; } + + [ForeignKey("ShoppingCartShippingOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } + + [ForeignKey("ShoppingCartSiteId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsSite ShoppingCartSite { get; set; } = null!; + + [ForeignKey("ShoppingCartUserId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsUser? ShoppingCartUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs index 8267282f..e9196a53 100644 --- a/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs +++ b/Migration.Toolkit.KX12/Models/ComShoppingCartCouponCode.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShoppingCartCouponCode")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] -public partial class ComShoppingCartCouponCode -{ - [Key] - [Column("ShoppingCartCouponCodeID")] - public int ShoppingCartCouponCodeId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [StringLength(200)] - public string CouponCode { get; set; } = null!; - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartCouponCodes")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_ShoppingCartCouponCode")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] +public class ComShoppingCartCouponCode +{ + [Key] + [Column("ShoppingCartCouponCodeID")] + public int ShoppingCartCouponCodeId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [StringLength(200)] + public string CouponCode { get; set; } = null!; + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartCouponCodes")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs b/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs index ee21968e..e79e3030 100644 --- a/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs +++ b/Migration.Toolkit.KX12/Models/ComShoppingCartSku.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_ShoppingCartSKU")] -[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] -public partial class ComShoppingCartSku -{ - [Key] - [Column("CartItemID")] - public int CartItemId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUUnits")] - public int Skuunits { get; set; } - - public string? CartItemCustomData { get; set; } - - public Guid? CartItemGuid { get; set; } - - public Guid? CartItemParentGuid { get; set; } - - public DateTime? CartItemValidTo { get; set; } - - [Column("CartItemBundleGUID")] - public Guid? CartItemBundleGuid { get; set; } - - public string? CartItemText { get; set; } - - public int? CartItemAutoAddedUnits { get; set; } - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComSku Sku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_ShoppingCartSKU")] +[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] +public class ComShoppingCartSku +{ + [Key] + [Column("CartItemID")] + public int CartItemId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUUnits")] + public int Skuunits { get; set; } + + public string? CartItemCustomData { get; set; } + + public Guid? CartItemGuid { get; set; } + + public Guid? CartItemParentGuid { get; set; } + + public DateTime? CartItemValidTo { get; set; } + + [Column("CartItemBundleGUID")] + public Guid? CartItemBundleGuid { get; set; } + + public string? CartItemText { get; set; } + + public int? CartItemAutoAddedUnits { get; set; } + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComSku.cs b/Migration.Toolkit.KX12/Models/ComSku.cs index 4a01fc39..48d9b877 100644 --- a/Migration.Toolkit.KX12/Models/ComSku.cs +++ b/Migration.Toolkit.KX12/Models/ComSku.cs @@ -1,278 +1,277 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_SKU")] -[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] -[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] -[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] -[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] -[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] -[Index("Skuname", Name = "IX_COM_SKU_SKUName")] -[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] -[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] -[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] -[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] -[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] -[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] -[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] -public partial class ComSku -{ - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUNumber")] - [StringLength(200)] - public string? Skunumber { get; set; } - - [Column("SKUName")] - [StringLength(440)] - public string Skuname { get; set; } = null!; - - [Column("SKUDescription")] - public string? Skudescription { get; set; } - - [Column("SKUPrice", TypeName = "decimal(18, 9)")] - public decimal Skuprice { get; set; } - - [Required] - [Column("SKUEnabled")] - public bool? Skuenabled { get; set; } - - [Column("SKUDepartmentID")] - public int? SkudepartmentId { get; set; } - - [Column("SKUManufacturerID")] - public int? SkumanufacturerId { get; set; } - - [Column("SKUInternalStatusID")] - public int? SkuinternalStatusId { get; set; } - - [Column("SKUPublicStatusID")] - public int? SkupublicStatusId { get; set; } - - [Column("SKUSupplierID")] - public int? SkusupplierId { get; set; } - - [Column("SKUAvailableInDays")] - public int? SkuavailableInDays { get; set; } - - [Column("SKUGUID")] - public Guid Skuguid { get; set; } - - [Column("SKUImagePath")] - [StringLength(450)] - public string? SkuimagePath { get; set; } - - [Column("SKUWeight")] - public double? Skuweight { get; set; } - - [Column("SKUWidth")] - public double? Skuwidth { get; set; } - - [Column("SKUDepth")] - public double? Skudepth { get; set; } - - [Column("SKUHeight")] - public double? Skuheight { get; set; } - - [Column("SKUAvailableItems")] - public int? SkuavailableItems { get; set; } - - [Column("SKUSellOnlyAvailable")] - public bool? SkusellOnlyAvailable { get; set; } - - [Column("SKUCustomData")] - public string? SkucustomData { get; set; } - - [Column("SKUOptionCategoryID")] - public int? SkuoptionCategoryId { get; set; } - - [Column("SKUOrder")] - public int? Skuorder { get; set; } - - [Column("SKULastModified")] - public DateTime SkulastModified { get; set; } - - [Column("SKUCreated")] - public DateTime? Skucreated { get; set; } - - [Column("SKUSiteID")] - public int? SkusiteId { get; set; } - - [Column("SKUNeedsShipping")] - public bool? SkuneedsShipping { get; set; } - - [Column("SKUValidUntil")] - public DateTime? SkuvalidUntil { get; set; } - - [Column("SKUProductType")] - [StringLength(50)] - public string? SkuproductType { get; set; } - - [Column("SKUMaxItemsInOrder")] - public int? SkumaxItemsInOrder { get; set; } - - [Column("SKUValidity")] - [StringLength(50)] - public string? Skuvalidity { get; set; } - - [Column("SKUValidFor")] - public int? SkuvalidFor { get; set; } - - [Column("SKUMembershipGUID")] - public Guid? SkumembershipGuid { get; set; } - - [Column("SKUConversionName")] - [StringLength(100)] - public string? SkuconversionName { get; set; } - - [Column("SKUConversionValue")] - [StringLength(200)] - public string? SkuconversionValue { get; set; } - - [Column("SKUBundleInventoryType")] - [StringLength(50)] - public string? SkubundleInventoryType { get; set; } - - [Column("SKUMinItemsInOrder")] - public int? SkuminItemsInOrder { get; set; } - - [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] - public decimal? SkuretailPrice { get; set; } - - [Column("SKUParentSKUID")] - public int? SkuparentSkuid { get; set; } - - [Column("SKUShortDescription")] - public string? SkushortDescription { get; set; } - - [Column("SKUEproductFilesCount")] - public int? SkueproductFilesCount { get; set; } - - [Column("SKUBundleItemsCount")] - public int? SkubundleItemsCount { get; set; } - - [Column("SKUInStoreFrom")] - public DateTime? SkuinStoreFrom { get; set; } - - [Column("SKUReorderAt")] - public int? SkureorderAt { get; set; } - - [Column("SKUTrackInventory")] - [StringLength(50)] - public string? SkutrackInventory { get; set; } - - [Column("SKUTaxClassID")] - public int? SkutaxClassId { get; set; } - - [Column("SKUBrandID")] - public int? SkubrandId { get; set; } - - [Column("SKUCollectionID")] - public int? SkucollectionId { get; set; } - - [InverseProperty("NodeSku")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountApplyToSku")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("OrderItemSku")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [InverseProperty("FileSku")] - public virtual ICollection ComSkufiles { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("VolumeDiscountSku")] - public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("SkuparentSku")] - public virtual ICollection InverseSkuparentSku { get; set; } = new List(); - - [ForeignKey("SkubrandId")] - [InverseProperty("ComSkus")] - public virtual ComBrand? Skubrand { get; set; } - - [ForeignKey("SkucollectionId")] - [InverseProperty("ComSkus")] - public virtual ComCollection? Skucollection { get; set; } - - [ForeignKey("SkudepartmentId")] - [InverseProperty("ComSkus")] - public virtual ComDepartment? Skudepartment { get; set; } - - [ForeignKey("SkuinternalStatusId")] - [InverseProperty("ComSkus")] - public virtual ComInternalStatus? SkuinternalStatus { get; set; } - - [ForeignKey("SkumanufacturerId")] - [InverseProperty("ComSkus")] - public virtual ComManufacturer? Skumanufacturer { get; set; } - - [ForeignKey("SkuoptionCategoryId")] - [InverseProperty("ComSkus")] - public virtual ComOptionCategory? SkuoptionCategory { get; set; } - - [ForeignKey("SkuparentSkuid")] - [InverseProperty("InverseSkuparentSku")] - public virtual ComSku? SkuparentSku { get; set; } - - [ForeignKey("SkupublicStatusId")] - [InverseProperty("ComSkus")] - public virtual ComPublicStatus? SkupublicStatus { get; set; } - - [ForeignKey("SkusiteId")] - [InverseProperty("ComSkus")] - public virtual CmsSite? Skusite { get; set; } - - [ForeignKey("SkusupplierId")] - [InverseProperty("ComSkus")] - public virtual ComSupplier? Skusupplier { get; set; } - - [ForeignKey("SkutaxClassId")] - [InverseProperty("ComSkus")] - public virtual ComTaxClass? SkutaxClass { get; set; } - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection Bundles { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("SkusNavigation")] - public virtual ICollection OptionSkus { get; set; } = new List(); - - [ForeignKey("VariantSkuid")] - [InverseProperty("VariantSkus")] - public virtual ICollection OptionSkusNavigation { get; set; } = new List(); - - [ForeignKey("BundleId")] - [InverseProperty("Bundles")] - public virtual ICollection Skus { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkus")] - public virtual ICollection SkusNavigation { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkusNavigation")] - public virtual ICollection VariantSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_SKU")] +[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] +[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] +[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] +[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] +[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] +[Index("Skuname", Name = "IX_COM_SKU_SKUName")] +[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] +[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] +[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] +[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] +[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] +[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] +[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] +public class ComSku +{ + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUNumber")] + [StringLength(200)] + public string? Skunumber { get; set; } + + [Column("SKUName")] + [StringLength(440)] + public string Skuname { get; set; } = null!; + + [Column("SKUDescription")] + public string? Skudescription { get; set; } + + [Column("SKUPrice", TypeName = "decimal(18, 9)")] + public decimal Skuprice { get; set; } + + [Required] + [Column("SKUEnabled")] + public bool? Skuenabled { get; set; } + + [Column("SKUDepartmentID")] + public int? SkudepartmentId { get; set; } + + [Column("SKUManufacturerID")] + public int? SkumanufacturerId { get; set; } + + [Column("SKUInternalStatusID")] + public int? SkuinternalStatusId { get; set; } + + [Column("SKUPublicStatusID")] + public int? SkupublicStatusId { get; set; } + + [Column("SKUSupplierID")] + public int? SkusupplierId { get; set; } + + [Column("SKUAvailableInDays")] + public int? SkuavailableInDays { get; set; } + + [Column("SKUGUID")] + public Guid Skuguid { get; set; } + + [Column("SKUImagePath")] + [StringLength(450)] + public string? SkuimagePath { get; set; } + + [Column("SKUWeight")] + public double? Skuweight { get; set; } + + [Column("SKUWidth")] + public double? Skuwidth { get; set; } + + [Column("SKUDepth")] + public double? Skudepth { get; set; } + + [Column("SKUHeight")] + public double? Skuheight { get; set; } + + [Column("SKUAvailableItems")] + public int? SkuavailableItems { get; set; } + + [Column("SKUSellOnlyAvailable")] + public bool? SkusellOnlyAvailable { get; set; } + + [Column("SKUCustomData")] + public string? SkucustomData { get; set; } + + [Column("SKUOptionCategoryID")] + public int? SkuoptionCategoryId { get; set; } + + [Column("SKUOrder")] + public int? Skuorder { get; set; } + + [Column("SKULastModified")] + public DateTime SkulastModified { get; set; } + + [Column("SKUCreated")] + public DateTime? Skucreated { get; set; } + + [Column("SKUSiteID")] + public int? SkusiteId { get; set; } + + [Column("SKUNeedsShipping")] + public bool? SkuneedsShipping { get; set; } + + [Column("SKUValidUntil")] + public DateTime? SkuvalidUntil { get; set; } + + [Column("SKUProductType")] + [StringLength(50)] + public string? SkuproductType { get; set; } + + [Column("SKUMaxItemsInOrder")] + public int? SkumaxItemsInOrder { get; set; } + + [Column("SKUValidity")] + [StringLength(50)] + public string? Skuvalidity { get; set; } + + [Column("SKUValidFor")] + public int? SkuvalidFor { get; set; } + + [Column("SKUMembershipGUID")] + public Guid? SkumembershipGuid { get; set; } + + [Column("SKUConversionName")] + [StringLength(100)] + public string? SkuconversionName { get; set; } + + [Column("SKUConversionValue")] + [StringLength(200)] + public string? SkuconversionValue { get; set; } + + [Column("SKUBundleInventoryType")] + [StringLength(50)] + public string? SkubundleInventoryType { get; set; } + + [Column("SKUMinItemsInOrder")] + public int? SkuminItemsInOrder { get; set; } + + [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] + public decimal? SkuretailPrice { get; set; } + + [Column("SKUParentSKUID")] + public int? SkuparentSkuid { get; set; } + + [Column("SKUShortDescription")] + public string? SkushortDescription { get; set; } + + [Column("SKUEproductFilesCount")] + public int? SkueproductFilesCount { get; set; } + + [Column("SKUBundleItemsCount")] + public int? SkubundleItemsCount { get; set; } + + [Column("SKUInStoreFrom")] + public DateTime? SkuinStoreFrom { get; set; } + + [Column("SKUReorderAt")] + public int? SkureorderAt { get; set; } + + [Column("SKUTrackInventory")] + [StringLength(50)] + public string? SkutrackInventory { get; set; } + + [Column("SKUTaxClassID")] + public int? SkutaxClassId { get; set; } + + [Column("SKUBrandID")] + public int? SkubrandId { get; set; } + + [Column("SKUCollectionID")] + public int? SkucollectionId { get; set; } + + [InverseProperty("NodeSku")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountApplyToSku")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("OrderItemSku")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [InverseProperty("FileSku")] + public virtual ICollection ComSkufiles { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("VolumeDiscountSku")] + public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("SkuparentSku")] + public virtual ICollection InverseSkuparentSku { get; set; } = new List(); + + [ForeignKey("SkubrandId")] + [InverseProperty("ComSkus")] + public virtual ComBrand? Skubrand { get; set; } + + [ForeignKey("SkucollectionId")] + [InverseProperty("ComSkus")] + public virtual ComCollection? Skucollection { get; set; } + + [ForeignKey("SkudepartmentId")] + [InverseProperty("ComSkus")] + public virtual ComDepartment? Skudepartment { get; set; } + + [ForeignKey("SkuinternalStatusId")] + [InverseProperty("ComSkus")] + public virtual ComInternalStatus? SkuinternalStatus { get; set; } + + [ForeignKey("SkumanufacturerId")] + [InverseProperty("ComSkus")] + public virtual ComManufacturer? Skumanufacturer { get; set; } + + [ForeignKey("SkuoptionCategoryId")] + [InverseProperty("ComSkus")] + public virtual ComOptionCategory? SkuoptionCategory { get; set; } + + [ForeignKey("SkuparentSkuid")] + [InverseProperty("InverseSkuparentSku")] + public virtual ComSku? SkuparentSku { get; set; } + + [ForeignKey("SkupublicStatusId")] + [InverseProperty("ComSkus")] + public virtual ComPublicStatus? SkupublicStatus { get; set; } + + [ForeignKey("SkusiteId")] + [InverseProperty("ComSkus")] + public virtual CmsSite? Skusite { get; set; } + + [ForeignKey("SkusupplierId")] + [InverseProperty("ComSkus")] + public virtual ComSupplier? Skusupplier { get; set; } + + [ForeignKey("SkutaxClassId")] + [InverseProperty("ComSkus")] + public virtual ComTaxClass? SkutaxClass { get; set; } + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection Bundles { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("SkusNavigation")] + public virtual ICollection OptionSkus { get; set; } = new List(); + + [ForeignKey("VariantSkuid")] + [InverseProperty("VariantSkus")] + public virtual ICollection OptionSkusNavigation { get; set; } = new List(); + + [ForeignKey("BundleId")] + [InverseProperty("Bundles")] + public virtual ICollection Skus { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkus")] + public virtual ICollection SkusNavigation { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkusNavigation")] + public virtual ICollection VariantSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ComSkufile.cs b/Migration.Toolkit.KX12/Models/ComSkufile.cs index 1b75c82c..c7052c3f 100644 --- a/Migration.Toolkit.KX12/Models/ComSkufile.cs +++ b/Migration.Toolkit.KX12/Models/ComSkufile.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_SKUFile")] -[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] -public partial class ComSkufile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileSKUID")] - public int FileSkuid { get; set; } - - [StringLength(450)] - public string FilePath { get; set; } = null!; - - [StringLength(50)] - public string FileType { get; set; } = null!; - - public DateTime FileLastModified { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [Column("FileMetaFileGUID")] - public Guid? FileMetaFileGuid { get; set; } - - [InverseProperty("File")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("FileSkuid")] - [InverseProperty("ComSkufiles")] - public virtual ComSku FileSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_SKUFile")] +[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] +public class ComSkufile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileSKUID")] + public int FileSkuid { get; set; } + + [StringLength(450)] + public string FilePath { get; set; } = null!; + + [StringLength(50)] + public string FileType { get; set; } = null!; + + public DateTime FileLastModified { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [Column("FileMetaFileGUID")] + public Guid? FileMetaFileGuid { get; set; } + + [InverseProperty("File")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("FileSkuid")] + [InverseProperty("ComSkufiles")] + public virtual ComSku FileSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs index 30ca56af..976a6216 100644 --- a/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs +++ b/Migration.Toolkit.KX12/Models/ComSkuoptionCategory.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_SKUOptionCategory")] -[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] -[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] -public partial class ComSkuoptionCategory -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Key] - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComOptionCategory Category { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComSku Sku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_SKUOptionCategory")] +[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] +[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] +public class ComSkuoptionCategory +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Key] + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComOptionCategory Category { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComSupplier.cs b/Migration.Toolkit.KX12/Models/ComSupplier.cs index b07c367e..f45f3508 100644 --- a/Migration.Toolkit.KX12/Models/ComSupplier.cs +++ b/Migration.Toolkit.KX12/Models/ComSupplier.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_Supplier")] -[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] -public partial class ComSupplier -{ - [Key] - [Column("SupplierID")] - public int SupplierId { get; set; } - - [StringLength(200)] - public string SupplierDisplayName { get; set; } = null!; - - [StringLength(50)] - public string? SupplierPhone { get; set; } - - [StringLength(254)] - public string? SupplierEmail { get; set; } - - [StringLength(50)] - public string? SupplierFax { get; set; } - - [Required] - public bool? SupplierEnabled { get; set; } - - [Column("SupplierGUID")] - public Guid SupplierGuid { get; set; } - - public DateTime SupplierLastModified { get; set; } - - [Column("SupplierSiteID")] - public int? SupplierSiteId { get; set; } - - [StringLength(200)] - public string? SupplierName { get; set; } - - [InverseProperty("Skusupplier")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("SupplierSiteId")] - [InverseProperty("ComSuppliers")] - public virtual CmsSite? SupplierSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_Supplier")] +[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] +public class ComSupplier +{ + [Key] + [Column("SupplierID")] + public int SupplierId { get; set; } + + [StringLength(200)] + public string SupplierDisplayName { get; set; } = null!; + + [StringLength(50)] + public string? SupplierPhone { get; set; } + + [StringLength(254)] + public string? SupplierEmail { get; set; } + + [StringLength(50)] + public string? SupplierFax { get; set; } + + [Required] + public bool? SupplierEnabled { get; set; } + + [Column("SupplierGUID")] + public Guid SupplierGuid { get; set; } + + public DateTime SupplierLastModified { get; set; } + + [Column("SupplierSiteID")] + public int? SupplierSiteId { get; set; } + + [StringLength(200)] + public string? SupplierName { get; set; } + + [InverseProperty("Skusupplier")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("SupplierSiteId")] + [InverseProperty("ComSuppliers")] + public virtual CmsSite? SupplierSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComTaxClass.cs b/Migration.Toolkit.KX12/Models/ComTaxClass.cs index f62d540a..da7bef6c 100644 --- a/Migration.Toolkit.KX12/Models/ComTaxClass.cs +++ b/Migration.Toolkit.KX12/Models/ComTaxClass.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_TaxClass")] -[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] -public partial class ComTaxClass -{ - [Key] - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [StringLength(200)] - public string TaxClassName { get; set; } = null!; - - [StringLength(200)] - public string TaxClassDisplayName { get; set; } = null!; - - [Column("TaxClassZeroIfIDSupplied")] - public bool? TaxClassZeroIfIdsupplied { get; set; } - - [Column("TaxClassGUID")] - public Guid TaxClassGuid { get; set; } - - public DateTime TaxClassLastModified { get; set; } - - [Column("TaxClassSiteID")] - public int? TaxClassSiteId { get; set; } - - [InverseProperty("DepartmentDefaultTaxClass")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("ShippingOptionTaxClass")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("SkutaxClass")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("TaxClassSiteId")] - [InverseProperty("ComTaxClasses")] - public virtual CmsSite? TaxClassSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_TaxClass")] +[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] +public class ComTaxClass +{ + [Key] + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [StringLength(200)] + public string TaxClassName { get; set; } = null!; + + [StringLength(200)] + public string TaxClassDisplayName { get; set; } = null!; + + [Column("TaxClassZeroIfIDSupplied")] + public bool? TaxClassZeroIfIdsupplied { get; set; } + + [Column("TaxClassGUID")] + public Guid TaxClassGuid { get; set; } + + public DateTime TaxClassLastModified { get; set; } + + [Column("TaxClassSiteID")] + public int? TaxClassSiteId { get; set; } + + [InverseProperty("DepartmentDefaultTaxClass")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("ShippingOptionTaxClass")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("SkutaxClass")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("TaxClassSiteId")] + [InverseProperty("ComTaxClasses")] + public virtual CmsSite? TaxClassSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs b/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs index fe7a869a..af0a43db 100644 --- a/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs +++ b/Migration.Toolkit.KX12/Models/ComTaxClassCountry.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_TaxClassCountry")] -[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] -[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] -public partial class ComTaxClassCountry -{ - [Key] - [Column("TaxClassCountryID")] - public int TaxClassCountryId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("CountryId")] - [InverseProperty("ComTaxClassCountries")] - public virtual CmsCountry Country { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassCountries")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_TaxClassCountry")] +[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] +[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] +public class ComTaxClassCountry +{ + [Key] + [Column("TaxClassCountryID")] + public int TaxClassCountryId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("CountryId")] + [InverseProperty("ComTaxClassCountries")] + public virtual CmsCountry Country { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassCountries")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComTaxClassState.cs b/Migration.Toolkit.KX12/Models/ComTaxClassState.cs index 2026489e..65de2de2 100644 --- a/Migration.Toolkit.KX12/Models/ComTaxClassState.cs +++ b/Migration.Toolkit.KX12/Models/ComTaxClassState.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_TaxClassState")] -[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] -[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] -public partial class ComTaxClassState -{ - [Key] - [Column("TaxClassStateID")] - public int TaxClassStateId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("StateID")] - public int StateId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("StateId")] - [InverseProperty("ComTaxClassStates")] - public virtual CmsState State { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassStates")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_TaxClassState")] +[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] +[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] +public class ComTaxClassState +{ + [Key] + [Column("TaxClassStateID")] + public int TaxClassStateId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("StateID")] + public int StateId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("StateId")] + [InverseProperty("ComTaxClassStates")] + public virtual CmsState State { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassStates")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs b/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs index dd120646..61a2f654 100644 --- a/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs +++ b/Migration.Toolkit.KX12/Models/ComVolumeDiscount.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("COM_VolumeDiscount")] -[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] -public partial class ComVolumeDiscount -{ - [Key] - [Column("VolumeDiscountID")] - public int VolumeDiscountId { get; set; } - - [Column("VolumeDiscountSKUID")] - public int VolumeDiscountSkuid { get; set; } - - public int VolumeDiscountMinCount { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal VolumeDiscountValue { get; set; } - - public bool VolumeDiscountIsFlatValue { get; set; } - - [Column("VolumeDiscountGUID")] - public Guid VolumeDiscountGuid { get; set; } - - public DateTime VolumeDiscountLastModified { get; set; } - - [ForeignKey("VolumeDiscountSkuid")] - [InverseProperty("ComVolumeDiscounts")] - public virtual ComSku VolumeDiscountSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("COM_VolumeDiscount")] +[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] +public class ComVolumeDiscount +{ + [Key] + [Column("VolumeDiscountID")] + public int VolumeDiscountId { get; set; } + + [Column("VolumeDiscountSKUID")] + public int VolumeDiscountSkuid { get; set; } + + public int VolumeDiscountMinCount { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal VolumeDiscountValue { get; set; } + + public bool VolumeDiscountIsFlatValue { get; set; } + + [Column("VolumeDiscountGUID")] + public Guid VolumeDiscountGuid { get; set; } + + public DateTime VolumeDiscountLastModified { get; set; } + + [ForeignKey("VolumeDiscountSkuid")] + [InverseProperty("ComVolumeDiscounts")] + public virtual ComSku VolumeDiscountSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ComWishlist.cs b/Migration.Toolkit.KX12/Models/ComWishlist.cs index 8c061814..1065a935 100644 --- a/Migration.Toolkit.KX12/Models/ComWishlist.cs +++ b/Migration.Toolkit.KX12/Models/ComWishlist.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("UserId", "Skuid", "SiteId")] -[Table("COM_Wishlist")] -[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] -[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] -public partial class ComWishlist -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ComWishlists")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComWishlists")] - public virtual ComSku Sku { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ComWishlists")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("UserId", "Skuid", "SiteId")] +[Table("COM_Wishlist")] +[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] +[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] +public class ComWishlist +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ComWishlists")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComWishlists")] + public virtual ComSku Sku { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ComWishlists")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CommunityGroup.cs b/Migration.Toolkit.KX12/Models/CommunityGroup.cs index 5ced4c3d..95a87924 100644 --- a/Migration.Toolkit.KX12/Models/CommunityGroup.cs +++ b/Migration.Toolkit.KX12/Models/CommunityGroup.cs @@ -1,110 +1,109 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Community_Group")] -[Index("GroupApproved", Name = "IX_Community_Group_GroupApproved")] -[Index("GroupApprovedByUserId", Name = "IX_Community_Group_GroupApprovedByUserID")] -[Index("GroupAvatarId", Name = "IX_Community_Group_GroupAvatarID")] -[Index("GroupCreatedByUserId", Name = "IX_Community_Group_GroupCreatedByUserID")] -[Index("GroupSiteId", "GroupName", Name = "IX_Community_Group_GroupSiteID_GroupName")] -public partial class CommunityGroup -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - [StringLength(100)] - public string GroupName { get; set; } = null!; - - public string GroupDescription { get; set; } = null!; - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int GroupApproveMembers { get; set; } - - public int GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } - - public bool? GroupLogActivity { get; set; } - - [InverseProperty("BoardGroup")] - public virtual ICollection BoardBoards { get; set; } = new List(); - - [InverseProperty("RoleGroup")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("NodeGroup")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MemberGroup")] - public virtual ICollection CommunityGroupMembers { get; set; } = new List(); - - [InverseProperty("Group")] - public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); - - [InverseProperty("InvitationGroup")] - public virtual ICollection CommunityInvitations { get; set; } = new List(); - - [InverseProperty("GroupGroup")] - public virtual ICollection ForumsForumGroups { get; set; } = new List(); - - [InverseProperty("ForumCommunityGroup")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [ForeignKey("GroupApprovedByUserId")] - [InverseProperty("CommunityGroupGroupApprovedByUsers")] - public virtual CmsUser? GroupApprovedByUser { get; set; } - - [ForeignKey("GroupAvatarId")] - [InverseProperty("CommunityGroups")] - public virtual CmsAvatar? GroupAvatar { get; set; } - - [ForeignKey("GroupCreatedByUserId")] - [InverseProperty("CommunityGroupGroupCreatedByUsers")] - public virtual CmsUser? GroupCreatedByUser { get; set; } - - [ForeignKey("GroupSiteId")] - [InverseProperty("CommunityGroups")] - public virtual CmsSite GroupSite { get; set; } = null!; - - [InverseProperty("LibraryGroup")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("PollGroup")] - public virtual ICollection PollsPolls { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Community_Group")] +[Index("GroupApproved", Name = "IX_Community_Group_GroupApproved")] +[Index("GroupApprovedByUserId", Name = "IX_Community_Group_GroupApprovedByUserID")] +[Index("GroupAvatarId", Name = "IX_Community_Group_GroupAvatarID")] +[Index("GroupCreatedByUserId", Name = "IX_Community_Group_GroupCreatedByUserID")] +[Index("GroupSiteId", "GroupName", Name = "IX_Community_Group_GroupSiteID_GroupName")] +public class CommunityGroup +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + [StringLength(100)] + public string GroupName { get; set; } = null!; + + public string GroupDescription { get; set; } = null!; + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int GroupApproveMembers { get; set; } + + public int GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } + + public bool? GroupLogActivity { get; set; } + + [InverseProperty("BoardGroup")] + public virtual ICollection BoardBoards { get; set; } = new List(); + + [InverseProperty("RoleGroup")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("NodeGroup")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MemberGroup")] + public virtual ICollection CommunityGroupMembers { get; set; } = new List(); + + [InverseProperty("Group")] + public virtual ICollection CommunityGroupRolePermissions { get; set; } = new List(); + + [InverseProperty("InvitationGroup")] + public virtual ICollection CommunityInvitations { get; set; } = new List(); + + [InverseProperty("GroupGroup")] + public virtual ICollection ForumsForumGroups { get; set; } = new List(); + + [InverseProperty("ForumCommunityGroup")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [ForeignKey("GroupApprovedByUserId")] + [InverseProperty("CommunityGroupGroupApprovedByUsers")] + public virtual CmsUser? GroupApprovedByUser { get; set; } + + [ForeignKey("GroupAvatarId")] + [InverseProperty("CommunityGroups")] + public virtual CmsAvatar? GroupAvatar { get; set; } + + [ForeignKey("GroupCreatedByUserId")] + [InverseProperty("CommunityGroupGroupCreatedByUsers")] + public virtual CmsUser? GroupCreatedByUser { get; set; } + + [ForeignKey("GroupSiteId")] + [InverseProperty("CommunityGroups")] + public virtual CmsSite GroupSite { get; set; } = null!; + + [InverseProperty("LibraryGroup")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("PollGroup")] + public virtual ICollection PollsPolls { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs b/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs index 14faa9c9..a3ba57ec 100644 --- a/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs +++ b/Migration.Toolkit.KX12/Models/CommunityGroupMember.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Community_GroupMember")] -[Index("MemberApprovedByUserId", Name = "IX_Community_GroupMember_MemberApprovedByUserID")] -[Index("MemberGroupId", Name = "IX_Community_GroupMember_MemberGroupID")] -[Index("MemberInvitedByUserId", Name = "IX_Community_GroupMember_MemberInvitedByUserID")] -[Index("MemberStatus", Name = "IX_Community_GroupMember_MemberStatus")] -[Index("MemberUserId", Name = "IX_Community_GroupMember_MemberUserID")] -public partial class CommunityGroupMember -{ - [Key] - [Column("MemberID")] - public int MemberId { get; set; } - - [Column("MemberGUID")] - public Guid MemberGuid { get; set; } - - [Column("MemberUserID")] - public int MemberUserId { get; set; } - - [Column("MemberGroupID")] - public int MemberGroupId { get; set; } - - public DateTime MemberJoined { get; set; } - - public DateTime? MemberApprovedWhen { get; set; } - - public DateTime? MemberRejectedWhen { get; set; } - - [Column("MemberApprovedByUserID")] - public int? MemberApprovedByUserId { get; set; } - - public string? MemberComment { get; set; } - - [Column("MemberInvitedByUserID")] - public int? MemberInvitedByUserId { get; set; } - - public int? MemberStatus { get; set; } - - [ForeignKey("MemberApprovedByUserId")] - [InverseProperty("CommunityGroupMemberMemberApprovedByUsers")] - public virtual CmsUser? MemberApprovedByUser { get; set; } - - [ForeignKey("MemberGroupId")] - [InverseProperty("CommunityGroupMembers")] - public virtual CommunityGroup MemberGroup { get; set; } = null!; - - [ForeignKey("MemberInvitedByUserId")] - [InverseProperty("CommunityGroupMemberMemberInvitedByUsers")] - public virtual CmsUser? MemberInvitedByUser { get; set; } - - [ForeignKey("MemberUserId")] - [InverseProperty("CommunityGroupMemberMemberUsers")] - public virtual CmsUser MemberUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Community_GroupMember")] +[Index("MemberApprovedByUserId", Name = "IX_Community_GroupMember_MemberApprovedByUserID")] +[Index("MemberGroupId", Name = "IX_Community_GroupMember_MemberGroupID")] +[Index("MemberInvitedByUserId", Name = "IX_Community_GroupMember_MemberInvitedByUserID")] +[Index("MemberStatus", Name = "IX_Community_GroupMember_MemberStatus")] +[Index("MemberUserId", Name = "IX_Community_GroupMember_MemberUserID")] +public class CommunityGroupMember +{ + [Key] + [Column("MemberID")] + public int MemberId { get; set; } + + [Column("MemberGUID")] + public Guid MemberGuid { get; set; } + + [Column("MemberUserID")] + public int MemberUserId { get; set; } + + [Column("MemberGroupID")] + public int MemberGroupId { get; set; } + + public DateTime MemberJoined { get; set; } + + public DateTime? MemberApprovedWhen { get; set; } + + public DateTime? MemberRejectedWhen { get; set; } + + [Column("MemberApprovedByUserID")] + public int? MemberApprovedByUserId { get; set; } + + public string? MemberComment { get; set; } + + [Column("MemberInvitedByUserID")] + public int? MemberInvitedByUserId { get; set; } + + public int? MemberStatus { get; set; } + + [ForeignKey("MemberApprovedByUserId")] + [InverseProperty("CommunityGroupMemberMemberApprovedByUsers")] + public virtual CmsUser? MemberApprovedByUser { get; set; } + + [ForeignKey("MemberGroupId")] + [InverseProperty("CommunityGroupMembers")] + public virtual CommunityGroup MemberGroup { get; set; } = null!; + + [ForeignKey("MemberInvitedByUserId")] + [InverseProperty("CommunityGroupMemberMemberInvitedByUsers")] + public virtual CmsUser? MemberInvitedByUser { get; set; } + + [ForeignKey("MemberUserId")] + [InverseProperty("CommunityGroupMemberMemberUsers")] + public virtual CmsUser MemberUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs b/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs index fd1f7079..31661208 100644 --- a/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs +++ b/Migration.Toolkit.KX12/Models/CommunityGroupRolePermission.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("GroupId", "RoleId", "PermissionId")] -[Table("Community_GroupRolePermission")] -[Index("PermissionId", Name = "IX_Community_GroupRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Community_GroupRolePermission_RoleID")] -public partial class CommunityGroupRolePermission -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("GroupId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CommunityGroup Group { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CommunityGroupRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("GroupId", "RoleId", "PermissionId")] +[Table("Community_GroupRolePermission")] +[Index("PermissionId", Name = "IX_Community_GroupRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Community_GroupRolePermission_RoleID")] +public class CommunityGroupRolePermission +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("GroupId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CommunityGroup Group { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CommunityGroupRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/CommunityInvitation.cs b/Migration.Toolkit.KX12/Models/CommunityInvitation.cs index f346b369..2ade8741 100644 --- a/Migration.Toolkit.KX12/Models/CommunityInvitation.cs +++ b/Migration.Toolkit.KX12/Models/CommunityInvitation.cs @@ -1,53 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Community_Invitation")] -[Index("InvitationGroupId", Name = "IX_Community_Invitation_InvitationGroupID")] -[Index("InvitedByUserId", Name = "IX_Community_Invitation_InvitedByUserID")] -[Index("InvitedUserId", Name = "IX_Community_Invitation_InvitedUserID")] -public partial class CommunityInvitation -{ - [Key] - [Column("InvitationID")] - public int InvitationId { get; set; } - - [Column("InvitedUserID")] - public int? InvitedUserId { get; set; } - - [Column("InvitedByUserID")] - public int InvitedByUserId { get; set; } - - [Column("InvitationGroupID")] - public int? InvitationGroupId { get; set; } - - public DateTime? InvitationCreated { get; set; } - - public DateTime? InvitationValidTo { get; set; } - - public string? InvitationComment { get; set; } - - [Column("InvitationGUID")] - public Guid InvitationGuid { get; set; } - - public DateTime InvitationLastModified { get; set; } - - [StringLength(254)] - public string? InvitationUserEmail { get; set; } - - [ForeignKey("InvitationGroupId")] - [InverseProperty("CommunityInvitations")] - public virtual CommunityGroup? InvitationGroup { get; set; } - - [ForeignKey("InvitedByUserId")] - [InverseProperty("CommunityInvitationInvitedByUsers")] - public virtual CmsUser InvitedByUser { get; set; } = null!; - - [ForeignKey("InvitedUserId")] - [InverseProperty("CommunityInvitationInvitedUsers")] - public virtual CmsUser? InvitedUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Community_Invitation")] +[Index("InvitationGroupId", Name = "IX_Community_Invitation_InvitationGroupID")] +[Index("InvitedByUserId", Name = "IX_Community_Invitation_InvitedByUserID")] +[Index("InvitedUserId", Name = "IX_Community_Invitation_InvitedUserID")] +public class CommunityInvitation +{ + [Key] + [Column("InvitationID")] + public int InvitationId { get; set; } + + [Column("InvitedUserID")] + public int? InvitedUserId { get; set; } + + [Column("InvitedByUserID")] + public int InvitedByUserId { get; set; } + + [Column("InvitationGroupID")] + public int? InvitationGroupId { get; set; } + + public DateTime? InvitationCreated { get; set; } + + public DateTime? InvitationValidTo { get; set; } + + public string? InvitationComment { get; set; } + + [Column("InvitationGUID")] + public Guid InvitationGuid { get; set; } + + public DateTime InvitationLastModified { get; set; } + + [StringLength(254)] + public string? InvitationUserEmail { get; set; } + + [ForeignKey("InvitationGroupId")] + [InverseProperty("CommunityInvitations")] + public virtual CommunityGroup? InvitationGroup { get; set; } + + [ForeignKey("InvitedByUserId")] + [InverseProperty("CommunityInvitationInvitedByUsers")] + public virtual CmsUser InvitedByUser { get; set; } = null!; + + [ForeignKey("InvitedUserId")] + [InverseProperty("CommunityInvitationInvitedUsers")] + public virtual CmsUser? InvitedUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ContentFile.cs b/Migration.Toolkit.KX12/Models/ContentFile.cs index d5cd26f2..43432949 100644 --- a/Migration.Toolkit.KX12/Models/ContentFile.cs +++ b/Migration.Toolkit.KX12/Models/ContentFile.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("CONTENT_File")] -public partial class ContentFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(500)] - public string? FileDescription { get; set; } - - [StringLength(100)] - public string FileName { get; set; } = null!; - - public Guid? FileAttachment { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("CONTENT_File")] +public class ContentFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(500)] + public string? FileDescription { get; set; } + + [StringLength(100)] + public string FileName { get; set; } = null!; + + public Guid? FileAttachment { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/EventsAttendee.cs b/Migration.Toolkit.KX12/Models/EventsAttendee.cs index 50b60148..8f826fac 100644 --- a/Migration.Toolkit.KX12/Models/EventsAttendee.cs +++ b/Migration.Toolkit.KX12/Models/EventsAttendee.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Events_Attendee")] -[Index("AttendeeEventNodeId", Name = "IX_Events_Attendee_AttendeeEventNodeID")] -public partial class EventsAttendee -{ - [Key] - [Column("AttendeeID")] - public int AttendeeId { get; set; } - - [StringLength(254)] - public string AttendeeEmail { get; set; } = null!; - - [StringLength(100)] - public string? AttendeeFirstName { get; set; } - - [StringLength(100)] - public string? AttendeeLastName { get; set; } - - [StringLength(50)] - public string? AttendeePhone { get; set; } - - [Column("AttendeeEventNodeID")] - public int AttendeeEventNodeId { get; set; } - - [Column("AttendeeGUID")] - public Guid AttendeeGuid { get; set; } - - public DateTime AttendeeLastModified { get; set; } - - [ForeignKey("AttendeeEventNodeId")] - [InverseProperty("EventsAttendees")] - public virtual CmsTree AttendeeEventNode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Events_Attendee")] +[Index("AttendeeEventNodeId", Name = "IX_Events_Attendee_AttendeeEventNodeID")] +public class EventsAttendee +{ + [Key] + [Column("AttendeeID")] + public int AttendeeId { get; set; } + + [StringLength(254)] + public string AttendeeEmail { get; set; } = null!; + + [StringLength(100)] + public string? AttendeeFirstName { get; set; } + + [StringLength(100)] + public string? AttendeeLastName { get; set; } + + [StringLength(50)] + public string? AttendeePhone { get; set; } + + [Column("AttendeeEventNodeID")] + public int AttendeeEventNodeId { get; set; } + + [Column("AttendeeGUID")] + public Guid AttendeeGuid { get; set; } + + public DateTime AttendeeLastModified { get; set; } + + [ForeignKey("AttendeeEventNodeId")] + [InverseProperty("EventsAttendees")] + public virtual CmsTree AttendeeEventNode { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ExportHistory.cs b/Migration.Toolkit.KX12/Models/ExportHistory.cs index 5e0a6236..362bcc17 100644 --- a/Migration.Toolkit.KX12/Models/ExportHistory.cs +++ b/Migration.Toolkit.KX12/Models/ExportHistory.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Export_History")] -[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] -[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] -public partial class ExportHistory -{ - [Key] - [Column("ExportID")] - public int ExportId { get; set; } - - public DateTime ExportDateTime { get; set; } - - [StringLength(450)] - public string ExportFileName { get; set; } = null!; - - [Column("ExportSiteID")] - public int? ExportSiteId { get; set; } - - [Column("ExportUserID")] - public int? ExportUserId { get; set; } - - public string? ExportSettings { get; set; } - - [ForeignKey("ExportSiteId")] - [InverseProperty("ExportHistories")] - public virtual CmsSite? ExportSite { get; set; } - - [ForeignKey("ExportUserId")] - [InverseProperty("ExportHistories")] - public virtual CmsUser? ExportUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Export_History")] +[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] +[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] +public class ExportHistory +{ + [Key] + [Column("ExportID")] + public int ExportId { get; set; } + + public DateTime ExportDateTime { get; set; } + + [StringLength(450)] + public string ExportFileName { get; set; } = null!; + + [Column("ExportSiteID")] + public int? ExportSiteId { get; set; } + + [Column("ExportUserID")] + public int? ExportUserId { get; set; } + + public string? ExportSettings { get; set; } + + [ForeignKey("ExportSiteId")] + [InverseProperty("ExportHistories")] + public virtual CmsSite? ExportSite { get; set; } + + [ForeignKey("ExportUserId")] + [InverseProperty("ExportHistories")] + public virtual CmsUser? ExportUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ExportTask.cs b/Migration.Toolkit.KX12/Models/ExportTask.cs index c3aa7b02..d9a99a49 100644 --- a/Migration.Toolkit.KX12/Models/ExportTask.cs +++ b/Migration.Toolkit.KX12/Models/ExportTask.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Export_Task")] -[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] -public partial class ExportTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("ExportTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Export_Task")] +[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] +public class ExportTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("ExportTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ForumsAttachment.cs b/Migration.Toolkit.KX12/Models/ForumsAttachment.cs index 6e652a65..a97f92d1 100644 --- a/Migration.Toolkit.KX12/Models/ForumsAttachment.cs +++ b/Migration.Toolkit.KX12/Models/ForumsAttachment.cs @@ -1,53 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_Attachment")] -[Index("AttachmentSiteId", "AttachmentGuid", Name = "IX_Forums_Attachment_AttachmentGUID", IsUnique = true)] -[Index("AttachmentPostId", Name = "IX_Forums_Attachment_AttachmentPostID")] -public partial class ForumsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(200)] - public string AttachmentFileName { get; set; } = null!; - - [StringLength(10)] - public string AttachmentFileExtension { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public int AttachmentFileSize { get; set; } - - public int? AttachmentImageHeight { get; set; } - - public int? AttachmentImageWidth { get; set; } - - [Column("AttachmentPostID")] - public int AttachmentPostId { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentPostId")] - [InverseProperty("ForumsAttachments")] - public virtual ForumsForumPost AttachmentPost { get; set; } = null!; - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("ForumsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Forums_Attachment")] +[Index("AttachmentSiteId", "AttachmentGuid", Name = "IX_Forums_Attachment_AttachmentGUID", IsUnique = true)] +[Index("AttachmentPostId", Name = "IX_Forums_Attachment_AttachmentPostID")] +public class ForumsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(200)] + public string AttachmentFileName { get; set; } = null!; + + [StringLength(10)] + public string AttachmentFileExtension { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public int AttachmentFileSize { get; set; } + + public int? AttachmentImageHeight { get; set; } + + public int? AttachmentImageWidth { get; set; } + + [Column("AttachmentPostID")] + public int AttachmentPostId { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentPostId")] + [InverseProperty("ForumsAttachments")] + public virtual ForumsForumPost AttachmentPost { get; set; } = null!; + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("ForumsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ForumsForum.cs b/Migration.Toolkit.KX12/Models/ForumsForum.cs index badd3bea..29e2aba5 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForum.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForum.cs @@ -1,147 +1,146 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_Forum")] -[Index("ForumCommunityGroupId", Name = "IX_Forums_Forum_ForumCommunityGroupID")] -[Index("ForumDocumentId", Name = "IX_Forums_Forum_ForumDocumentID")] -[Index("ForumSiteId", "ForumName", Name = "IX_Forums_Forum_ForumSiteID_ForumName")] -public partial class ForumsForum -{ - [Key] - [Column("ForumID")] - public int ForumId { get; set; } - - [Column("ForumGroupID")] - public int ForumGroupId { get; set; } - - [StringLength(200)] - public string ForumName { get; set; } = null!; - - [StringLength(200)] - public string ForumDisplayName { get; set; } = null!; - - public string? ForumDescription { get; set; } - - public int? ForumOrder { get; set; } - - [Column("ForumDocumentID")] - public int? ForumDocumentId { get; set; } - - public bool ForumOpen { get; set; } - - public bool ForumModerated { get; set; } - - public bool? ForumDisplayEmails { get; set; } - - public bool? ForumRequireEmail { get; set; } - - public int ForumAccess { get; set; } - - public int ForumThreads { get; set; } - - public int ForumPosts { get; set; } - - public DateTime? ForumLastPostTime { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserName { get; set; } - - [StringLength(200)] - public string? ForumBaseUrl { get; set; } - - public bool? ForumAllowChangeName { get; set; } - - [Column("ForumHTMLEditor")] - public bool? ForumHtmleditor { get; set; } - - [Column("ForumUseCAPTCHA")] - public bool? ForumUseCaptcha { get; set; } - - [Column("ForumGUID")] - public Guid ForumGuid { get; set; } - - public DateTime ForumLastModified { get; set; } - - [StringLength(200)] - public string? ForumUnsubscriptionUrl { get; set; } - - public bool? ForumIsLocked { get; set; } - - public string? ForumSettings { get; set; } - - public bool? ForumAuthorEdit { get; set; } - - public bool? ForumAuthorDelete { get; set; } - - public int? ForumType { get; set; } - - public int? ForumIsAnswerLimit { get; set; } - - public int? ForumImageMaxSideSize { get; set; } - - public DateTime? ForumLastPostTimeAbsolute { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserNameAbsolute { get; set; } - - public int? ForumPostsAbsolute { get; set; } - - public int? ForumThreadsAbsolute { get; set; } - - public int? ForumAttachmentMaxFileSize { get; set; } - - public int? ForumDiscussionActions { get; set; } - - [Column("ForumSiteID")] - public int ForumSiteId { get; set; } - - public bool? ForumLogActivity { get; set; } - - [Column("ForumCommunityGroupID")] - public int? ForumCommunityGroupId { get; set; } - - public bool? ForumEnableOptIn { get; set; } - - public bool? ForumSendOptInConfirmation { get; set; } - - [Column("ForumOptInApprovalURL")] - [StringLength(450)] - public string? ForumOptInApprovalUrl { get; set; } - - [ForeignKey("ForumCommunityGroupId")] - [InverseProperty("ForumsForums")] - public virtual CommunityGroup? ForumCommunityGroup { get; set; } - - [ForeignKey("ForumDocumentId")] - [InverseProperty("ForumsForums")] - public virtual CmsDocument? ForumDocument { get; set; } - - [ForeignKey("ForumGroupId")] - [InverseProperty("ForumsForums")] - public virtual ForumsForumGroup ForumGroup { get; set; } = null!; - - [ForeignKey("ForumSiteId")] - [InverseProperty("ForumsForums")] - public virtual CmsSite ForumSite { get; set; } = null!; - - [InverseProperty("PostForum")] - public virtual ICollection ForumsForumPosts { get; set; } = new List(); - - [InverseProperty("Forum")] - public virtual ICollection ForumsForumRoles { get; set; } = new List(); - - [InverseProperty("SubscriptionForum")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("Forum")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [ForeignKey("ForumId")] - [InverseProperty("Forums")] - public virtual ICollection Users { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Forums_Forum")] +[Index("ForumCommunityGroupId", Name = "IX_Forums_Forum_ForumCommunityGroupID")] +[Index("ForumDocumentId", Name = "IX_Forums_Forum_ForumDocumentID")] +[Index("ForumSiteId", "ForumName", Name = "IX_Forums_Forum_ForumSiteID_ForumName")] +public class ForumsForum +{ + [Key] + [Column("ForumID")] + public int ForumId { get; set; } + + [Column("ForumGroupID")] + public int ForumGroupId { get; set; } + + [StringLength(200)] + public string ForumName { get; set; } = null!; + + [StringLength(200)] + public string ForumDisplayName { get; set; } = null!; + + public string? ForumDescription { get; set; } + + public int? ForumOrder { get; set; } + + [Column("ForumDocumentID")] + public int? ForumDocumentId { get; set; } + + public bool ForumOpen { get; set; } + + public bool ForumModerated { get; set; } + + public bool? ForumDisplayEmails { get; set; } + + public bool? ForumRequireEmail { get; set; } + + public int ForumAccess { get; set; } + + public int ForumThreads { get; set; } + + public int ForumPosts { get; set; } + + public DateTime? ForumLastPostTime { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserName { get; set; } + + [StringLength(200)] + public string? ForumBaseUrl { get; set; } + + public bool? ForumAllowChangeName { get; set; } + + [Column("ForumHTMLEditor")] + public bool? ForumHtmleditor { get; set; } + + [Column("ForumUseCAPTCHA")] + public bool? ForumUseCaptcha { get; set; } + + [Column("ForumGUID")] + public Guid ForumGuid { get; set; } + + public DateTime ForumLastModified { get; set; } + + [StringLength(200)] + public string? ForumUnsubscriptionUrl { get; set; } + + public bool? ForumIsLocked { get; set; } + + public string? ForumSettings { get; set; } + + public bool? ForumAuthorEdit { get; set; } + + public bool? ForumAuthorDelete { get; set; } + + public int? ForumType { get; set; } + + public int? ForumIsAnswerLimit { get; set; } + + public int? ForumImageMaxSideSize { get; set; } + + public DateTime? ForumLastPostTimeAbsolute { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserNameAbsolute { get; set; } + + public int? ForumPostsAbsolute { get; set; } + + public int? ForumThreadsAbsolute { get; set; } + + public int? ForumAttachmentMaxFileSize { get; set; } + + public int? ForumDiscussionActions { get; set; } + + [Column("ForumSiteID")] + public int ForumSiteId { get; set; } + + public bool? ForumLogActivity { get; set; } + + [Column("ForumCommunityGroupID")] + public int? ForumCommunityGroupId { get; set; } + + public bool? ForumEnableOptIn { get; set; } + + public bool? ForumSendOptInConfirmation { get; set; } + + [Column("ForumOptInApprovalURL")] + [StringLength(450)] + public string? ForumOptInApprovalUrl { get; set; } + + [ForeignKey("ForumCommunityGroupId")] + [InverseProperty("ForumsForums")] + public virtual CommunityGroup? ForumCommunityGroup { get; set; } + + [ForeignKey("ForumDocumentId")] + [InverseProperty("ForumsForums")] + public virtual CmsDocument? ForumDocument { get; set; } + + [ForeignKey("ForumGroupId")] + [InverseProperty("ForumsForums")] + public virtual ForumsForumGroup ForumGroup { get; set; } = null!; + + [ForeignKey("ForumSiteId")] + [InverseProperty("ForumsForums")] + public virtual CmsSite ForumSite { get; set; } = null!; + + [InverseProperty("PostForum")] + public virtual ICollection ForumsForumPosts { get; set; } = new List(); + + [InverseProperty("Forum")] + public virtual ICollection ForumsForumRoles { get; set; } = new List(); + + [InverseProperty("SubscriptionForum")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("Forum")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [ForeignKey("ForumId")] + [InverseProperty("Forums")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs b/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs index e4c95dd7..cd33d010 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForumGroup.cs @@ -1,89 +1,88 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_ForumGroup")] -[Index("GroupGroupId", Name = "IX_Forums_ForumGroup_GroupGroupID")] -[Index("GroupSiteId", "GroupName", Name = "IX_Forums_ForumGroup_GroupSiteID_GroupName")] -public partial class ForumsForumGroup -{ - [Key] - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupName { get; set; } = null!; - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - public int? GroupOrder { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [StringLength(200)] - public string? GroupBaseUrl { get; set; } - - [StringLength(200)] - public string? GroupUnsubscriptionUrl { get; set; } - - [Column("GroupGroupID")] - public int? GroupGroupId { get; set; } - - public bool? GroupAuthorEdit { get; set; } - - public bool? GroupAuthorDelete { get; set; } - - public int? GroupType { get; set; } - - public int? GroupIsAnswerLimit { get; set; } - - public int? GroupImageMaxSideSize { get; set; } - - public bool? GroupDisplayEmails { get; set; } - - public bool? GroupRequireEmail { get; set; } - - [Column("GroupHTMLEditor")] - public bool? GroupHtmleditor { get; set; } - - [Column("GroupUseCAPTCHA")] - public bool? GroupUseCaptcha { get; set; } - - public int? GroupAttachmentMaxFileSize { get; set; } - - public int? GroupDiscussionActions { get; set; } - - public bool? GroupLogActivity { get; set; } - - public bool? GroupEnableOptIn { get; set; } - - public bool? GroupSendOptInConfirmation { get; set; } - - [Column("GroupOptInApprovalURL")] - [StringLength(450)] - public string? GroupOptInApprovalUrl { get; set; } - - [InverseProperty("ForumGroup")] - public virtual ICollection ForumsForums { get; set; } = new List(); - - [ForeignKey("GroupGroupId")] - [InverseProperty("ForumsForumGroups")] - public virtual CommunityGroup? GroupGroup { get; set; } - - [ForeignKey("GroupSiteId")] - [InverseProperty("ForumsForumGroups")] - public virtual CmsSite GroupSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Forums_ForumGroup")] +[Index("GroupGroupId", Name = "IX_Forums_ForumGroup_GroupGroupID")] +[Index("GroupSiteId", "GroupName", Name = "IX_Forums_ForumGroup_GroupSiteID_GroupName")] +public class ForumsForumGroup +{ + [Key] + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupName { get; set; } = null!; + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + public int? GroupOrder { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [StringLength(200)] + public string? GroupBaseUrl { get; set; } + + [StringLength(200)] + public string? GroupUnsubscriptionUrl { get; set; } + + [Column("GroupGroupID")] + public int? GroupGroupId { get; set; } + + public bool? GroupAuthorEdit { get; set; } + + public bool? GroupAuthorDelete { get; set; } + + public int? GroupType { get; set; } + + public int? GroupIsAnswerLimit { get; set; } + + public int? GroupImageMaxSideSize { get; set; } + + public bool? GroupDisplayEmails { get; set; } + + public bool? GroupRequireEmail { get; set; } + + [Column("GroupHTMLEditor")] + public bool? GroupHtmleditor { get; set; } + + [Column("GroupUseCAPTCHA")] + public bool? GroupUseCaptcha { get; set; } + + public int? GroupAttachmentMaxFileSize { get; set; } + + public int? GroupDiscussionActions { get; set; } + + public bool? GroupLogActivity { get; set; } + + public bool? GroupEnableOptIn { get; set; } + + public bool? GroupSendOptInConfirmation { get; set; } + + [Column("GroupOptInApprovalURL")] + [StringLength(450)] + public string? GroupOptInApprovalUrl { get; set; } + + [InverseProperty("ForumGroup")] + public virtual ICollection ForumsForums { get; set; } = new List(); + + [ForeignKey("GroupGroupId")] + [InverseProperty("ForumsForumGroups")] + public virtual CommunityGroup? GroupGroup { get; set; } + + [ForeignKey("GroupSiteId")] + [InverseProperty("ForumsForumGroups")] + public virtual CmsSite GroupSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ForumsForumPost.cs b/Migration.Toolkit.KX12/Models/ForumsForumPost.cs index f4d8ad5e..6835d04d 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForumPost.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForumPost.cs @@ -1,124 +1,123 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_ForumPost")] -[Index("PostApproved", Name = "IX_Forums_ForumPost_PostApproved")] -[Index("PostApprovedByUserId", Name = "IX_Forums_ForumPost_PostApprovedByUserID")] -[Index("PostForumId", Name = "IX_Forums_ForumPost_PostForumID")] -[Index("PostLevel", Name = "IX_Forums_ForumPost_PostLevel")] -[Index("PostParentId", Name = "IX_Forums_ForumPost_PostParentID")] -[Index("PostUserId", Name = "IX_Forums_ForumPost_PostUserID")] -public partial class ForumsForumPost -{ - [Key] - public int PostId { get; set; } - - [Column("PostForumID")] - public int PostForumId { get; set; } - - [Column("PostParentID")] - public int? PostParentId { get; set; } - - [Column("PostIDPath")] - public string PostIdpath { get; set; } = null!; - - public int PostLevel { get; set; } - - [StringLength(450)] - public string PostSubject { get; set; } = null!; - - [Column("PostUserID")] - public int? PostUserId { get; set; } - - [StringLength(200)] - public string PostUserName { get; set; } = null!; - - [StringLength(254)] - public string? PostUserMail { get; set; } - - public string? PostText { get; set; } - - public DateTime PostTime { get; set; } - - [Column("PostApprovedByUserID")] - public int? PostApprovedByUserId { get; set; } - - public int? PostThreadPosts { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserName { get; set; } - - public DateTime? PostThreadLastPostTime { get; set; } - - public string? PostUserSignature { get; set; } - - [Column("PostGUID")] - public Guid PostGuid { get; set; } - - public DateTime PostLastModified { get; set; } - - public bool? PostApproved { get; set; } - - public bool? PostIsLocked { get; set; } - - public int? PostIsAnswer { get; set; } - - public int PostStickOrder { get; set; } - - public int? PostViews { get; set; } - - public DateTime? PostLastEdit { get; set; } - - public string? PostInfo { get; set; } - - public int? PostAttachmentCount { get; set; } - - public int? PostType { get; set; } - - public int? PostThreadPostsAbsolute { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserNameAbsolute { get; set; } - - public DateTime? PostThreadLastPostTimeAbsolute { get; set; } - - public bool? PostQuestionSolved { get; set; } - - public int? PostIsNotAnswer { get; set; } - - [Column("PostSiteID")] - public int? PostSiteId { get; set; } - - [InverseProperty("AttachmentPost")] - public virtual ICollection ForumsAttachments { get; set; } = new List(); - - [InverseProperty("SubscriptionPost")] - public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); - - [InverseProperty("Post")] - public virtual ICollection ForumsUserFavorites { get; set; } = new List(); - - [InverseProperty("PostParent")] - public virtual ICollection InversePostParent { get; set; } = new List(); - - [ForeignKey("PostApprovedByUserId")] - [InverseProperty("ForumsForumPostPostApprovedByUsers")] - public virtual CmsUser? PostApprovedByUser { get; set; } - - [ForeignKey("PostForumId")] - [InverseProperty("ForumsForumPosts")] - public virtual ForumsForum PostForum { get; set; } = null!; - - [ForeignKey("PostParentId")] - [InverseProperty("InversePostParent")] - public virtual ForumsForumPost? PostParent { get; set; } - - [ForeignKey("PostUserId")] - [InverseProperty("ForumsForumPostPostUsers")] - public virtual CmsUser? PostUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Forums_ForumPost")] +[Index("PostApproved", Name = "IX_Forums_ForumPost_PostApproved")] +[Index("PostApprovedByUserId", Name = "IX_Forums_ForumPost_PostApprovedByUserID")] +[Index("PostForumId", Name = "IX_Forums_ForumPost_PostForumID")] +[Index("PostLevel", Name = "IX_Forums_ForumPost_PostLevel")] +[Index("PostParentId", Name = "IX_Forums_ForumPost_PostParentID")] +[Index("PostUserId", Name = "IX_Forums_ForumPost_PostUserID")] +public class ForumsForumPost +{ + [Key] + public int PostId { get; set; } + + [Column("PostForumID")] + public int PostForumId { get; set; } + + [Column("PostParentID")] + public int? PostParentId { get; set; } + + [Column("PostIDPath")] + public string PostIdpath { get; set; } = null!; + + public int PostLevel { get; set; } + + [StringLength(450)] + public string PostSubject { get; set; } = null!; + + [Column("PostUserID")] + public int? PostUserId { get; set; } + + [StringLength(200)] + public string PostUserName { get; set; } = null!; + + [StringLength(254)] + public string? PostUserMail { get; set; } + + public string? PostText { get; set; } + + public DateTime PostTime { get; set; } + + [Column("PostApprovedByUserID")] + public int? PostApprovedByUserId { get; set; } + + public int? PostThreadPosts { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserName { get; set; } + + public DateTime? PostThreadLastPostTime { get; set; } + + public string? PostUserSignature { get; set; } + + [Column("PostGUID")] + public Guid PostGuid { get; set; } + + public DateTime PostLastModified { get; set; } + + public bool? PostApproved { get; set; } + + public bool? PostIsLocked { get; set; } + + public int? PostIsAnswer { get; set; } + + public int PostStickOrder { get; set; } + + public int? PostViews { get; set; } + + public DateTime? PostLastEdit { get; set; } + + public string? PostInfo { get; set; } + + public int? PostAttachmentCount { get; set; } + + public int? PostType { get; set; } + + public int? PostThreadPostsAbsolute { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserNameAbsolute { get; set; } + + public DateTime? PostThreadLastPostTimeAbsolute { get; set; } + + public bool? PostQuestionSolved { get; set; } + + public int? PostIsNotAnswer { get; set; } + + [Column("PostSiteID")] + public int? PostSiteId { get; set; } + + [InverseProperty("AttachmentPost")] + public virtual ICollection ForumsAttachments { get; set; } = new List(); + + [InverseProperty("SubscriptionPost")] + public virtual ICollection ForumsForumSubscriptions { get; set; } = new List(); + + [InverseProperty("Post")] + public virtual ICollection ForumsUserFavorites { get; set; } = new List(); + + [InverseProperty("PostParent")] + public virtual ICollection InversePostParent { get; set; } = new List(); + + [ForeignKey("PostApprovedByUserId")] + [InverseProperty("ForumsForumPostPostApprovedByUsers")] + public virtual CmsUser? PostApprovedByUser { get; set; } + + [ForeignKey("PostForumId")] + [InverseProperty("ForumsForumPosts")] + public virtual ForumsForum PostForum { get; set; } = null!; + + [ForeignKey("PostParentId")] + [InverseProperty("InversePostParent")] + public virtual ForumsForumPost? PostParent { get; set; } + + [ForeignKey("PostUserId")] + [InverseProperty("ForumsForumPostPostUsers")] + public virtual CmsUser? PostUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ForumsForumRole.cs b/Migration.Toolkit.KX12/Models/ForumsForumRole.cs index a7cf931e..9bb70b81 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForumRole.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForumRole.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("ForumId", "RoleId", "PermissionId")] -[Table("Forums_ForumRoles")] -[Index("PermissionId", Name = "IX_Forums_ForumRoles_PermissionID")] -[Index("RoleId", Name = "IX_Forums_ForumRoles_RoleID")] -public partial class ForumsForumRole -{ - [Key] - [Column("ForumID")] - public int ForumId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("ForumId")] - [InverseProperty("ForumsForumRoles")] - public virtual ForumsForum Forum { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("ForumsForumRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("ForumsForumRoles")] - public virtual CmsRole Role { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("ForumId", "RoleId", "PermissionId")] +[Table("Forums_ForumRoles")] +[Index("PermissionId", Name = "IX_Forums_ForumRoles_PermissionID")] +[Index("RoleId", Name = "IX_Forums_ForumRoles_RoleID")] +public class ForumsForumRole +{ + [Key] + [Column("ForumID")] + public int ForumId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("ForumId")] + [InverseProperty("ForumsForumRoles")] + public virtual ForumsForum Forum { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("ForumsForumRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("ForumsForumRoles")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs b/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs index 64d766da..c770d86a 100644 --- a/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs +++ b/Migration.Toolkit.KX12/Models/ForumsForumSubscription.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_ForumSubscription")] -[Index("SubscriptionForumId", Name = "IX_Forums_ForumSubscription_SubscriptionForumID")] -[Index("SubscriptionPostId", Name = "IX_Forums_ForumSubscription_SubscriptionPostID")] -[Index("SubscriptionUserId", Name = "IX_Forums_ForumSubscription_SubscriptionUserID")] -public partial class ForumsForumSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionUserID")] - public int? SubscriptionUserId { get; set; } - - [StringLength(254)] - public string? SubscriptionEmail { get; set; } - - [Column("SubscriptionForumID")] - public int SubscriptionForumId { get; set; } - - [Column("SubscriptionPostID")] - public int? SubscriptionPostId { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public DateTime SubscriptionLastModified { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [ForeignKey("SubscriptionForumId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual ForumsForum SubscriptionForum { get; set; } = null!; - - [ForeignKey("SubscriptionPostId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual ForumsForumPost? SubscriptionPost { get; set; } - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("ForumsForumSubscriptions")] - public virtual CmsUser? SubscriptionUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Forums_ForumSubscription")] +[Index("SubscriptionForumId", Name = "IX_Forums_ForumSubscription_SubscriptionForumID")] +[Index("SubscriptionPostId", Name = "IX_Forums_ForumSubscription_SubscriptionPostID")] +[Index("SubscriptionUserId", Name = "IX_Forums_ForumSubscription_SubscriptionUserID")] +public class ForumsForumSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionUserID")] + public int? SubscriptionUserId { get; set; } + + [StringLength(254)] + public string? SubscriptionEmail { get; set; } + + [Column("SubscriptionForumID")] + public int SubscriptionForumId { get; set; } + + [Column("SubscriptionPostID")] + public int? SubscriptionPostId { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public DateTime SubscriptionLastModified { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [ForeignKey("SubscriptionForumId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual ForumsForum SubscriptionForum { get; set; } = null!; + + [ForeignKey("SubscriptionPostId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual ForumsForumPost? SubscriptionPost { get; set; } + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("ForumsForumSubscriptions")] + public virtual CmsUser? SubscriptionUser { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs b/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs index 45101ba1..d0687ebc 100644 --- a/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs +++ b/Migration.Toolkit.KX12/Models/ForumsUserFavorite.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Forums_UserFavorites")] -[Index("ForumId", Name = "IX_Forums_UserFavorites_ForumID")] -[Index("PostId", Name = "IX_Forums_UserFavorites_PostID")] -[Index("SiteId", Name = "IX_Forums_UserFavorites_SiteID")] -[Index("UserId", Name = "IX_Forums_UserFavorites_UserID")] -[Index("UserId", "PostId", "ForumId", Name = "IX_Forums_UserFavorites_UserID_PostID_ForumID", IsUnique = true)] -public partial class ForumsUserFavorite -{ - [Key] - [Column("FavoriteID")] - public int FavoriteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("PostID")] - public int? PostId { get; set; } - - [Column("ForumID")] - public int? ForumId { get; set; } - - [StringLength(100)] - public string? FavoriteName { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [Column("FavoriteGUID")] - public Guid FavoriteGuid { get; set; } - - public DateTime FavoriteLastModified { get; set; } - - [ForeignKey("ForumId")] - [InverseProperty("ForumsUserFavorites")] - public virtual ForumsForum? Forum { get; set; } - - [ForeignKey("PostId")] - [InverseProperty("ForumsUserFavorites")] - public virtual ForumsForumPost? Post { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ForumsUserFavorites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ForumsUserFavorites")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Forums_UserFavorites")] +[Index("ForumId", Name = "IX_Forums_UserFavorites_ForumID")] +[Index("PostId", Name = "IX_Forums_UserFavorites_PostID")] +[Index("SiteId", Name = "IX_Forums_UserFavorites_SiteID")] +[Index("UserId", Name = "IX_Forums_UserFavorites_UserID")] +[Index("UserId", "PostId", "ForumId", Name = "IX_Forums_UserFavorites_UserID_PostID_ForumID", IsUnique = true)] +public class ForumsUserFavorite +{ + [Key] + [Column("FavoriteID")] + public int FavoriteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("PostID")] + public int? PostId { get; set; } + + [Column("ForumID")] + public int? ForumId { get; set; } + + [StringLength(100)] + public string? FavoriteName { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [Column("FavoriteGUID")] + public Guid FavoriteGuid { get; set; } + + public DateTime FavoriteLastModified { get; set; } + + [ForeignKey("ForumId")] + [InverseProperty("ForumsUserFavorites")] + public virtual ForumsForum? Forum { get; set; } + + [ForeignKey("PostId")] + [InverseProperty("ForumsUserFavorites")] + public virtual ForumsForumPost? Post { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ForumsUserFavorites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ForumsUserFavorites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/IntegrationConnector.cs b/Migration.Toolkit.KX12/Models/IntegrationConnector.cs index 0f3ed25d..a6395be1 100644 --- a/Migration.Toolkit.KX12/Models/IntegrationConnector.cs +++ b/Migration.Toolkit.KX12/Models/IntegrationConnector.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Integration_Connector")] -[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] -public partial class IntegrationConnector -{ - [Key] - [Column("ConnectorID")] - public int ConnectorId { get; set; } - - [StringLength(100)] - public string ConnectorName { get; set; } = null!; - - [StringLength(440)] - public string ConnectorDisplayName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorAssemblyName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorClassName { get; set; } = null!; - - [Required] - public bool? ConnectorEnabled { get; set; } - - public DateTime ConnectorLastModified { get; set; } - - [InverseProperty("SynchronizationConnector")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Integration_Connector")] +[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] +public class IntegrationConnector +{ + [Key] + [Column("ConnectorID")] + public int ConnectorId { get; set; } + + [StringLength(100)] + public string ConnectorName { get; set; } = null!; + + [StringLength(440)] + public string ConnectorDisplayName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorAssemblyName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorClassName { get; set; } = null!; + + [Required] + public bool? ConnectorEnabled { get; set; } + + public DateTime ConnectorLastModified { get; set; } + + [InverseProperty("SynchronizationConnector")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs b/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs index 96e6d8ff..a632396c 100644 --- a/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs +++ b/Migration.Toolkit.KX12/Models/IntegrationSyncLog.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Integration_SyncLog")] -[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] -public partial class IntegrationSyncLog -{ - [Key] - [Column("SyncLogID")] - public int SyncLogId { get; set; } - - [Column("SyncLogSynchronizationID")] - public int SyncLogSynchronizationId { get; set; } - - public DateTime SyncLogTime { get; set; } - - public string? SyncLogErrorMessage { get; set; } - - [ForeignKey("SyncLogSynchronizationId")] - [InverseProperty("IntegrationSyncLogs")] - public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Integration_SyncLog")] +[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] +public class IntegrationSyncLog +{ + [Key] + [Column("SyncLogID")] + public int SyncLogId { get; set; } + + [Column("SyncLogSynchronizationID")] + public int SyncLogSynchronizationId { get; set; } + + public DateTime SyncLogTime { get; set; } + + public string? SyncLogErrorMessage { get; set; } + + [ForeignKey("SyncLogSynchronizationId")] + [InverseProperty("IntegrationSyncLogs")] + public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs b/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs index 0e7828b5..ea98f81d 100644 --- a/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs +++ b/Migration.Toolkit.KX12/Models/IntegrationSynchronization.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Integration_Synchronization")] -[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] -[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] -public partial class IntegrationSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int SynchronizationConnectorId { get; set; } - - public DateTime SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [InverseProperty("SyncLogSynchronization")] - public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); - - [ForeignKey("SynchronizationConnectorId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationTask SynchronizationTask { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Integration_Synchronization")] +[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] +[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] +public class IntegrationSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int SynchronizationConnectorId { get; set; } + + public DateTime SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [InverseProperty("SyncLogSynchronization")] + public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); + + [ForeignKey("SynchronizationConnectorId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/IntegrationTask.cs b/Migration.Toolkit.KX12/Models/IntegrationTask.cs index 01c2f047..cd737e21 100644 --- a/Migration.Toolkit.KX12/Models/IntegrationTask.cs +++ b/Migration.Toolkit.KX12/Models/IntegrationTask.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Integration_Task")] -[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] -[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Integration_Task_TaskType")] -public partial class IntegrationTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("IntegrationTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Integration_Task")] +[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] +[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Integration_Task_TaskType")] +public class IntegrationTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("IntegrationTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/MediaFile.cs b/Migration.Toolkit.KX12/Models/MediaFile.cs index a97d0fca..3ca31ac6 100644 --- a/Migration.Toolkit.KX12/Models/MediaFile.cs +++ b/Migration.Toolkit.KX12/Models/MediaFile.cs @@ -1,78 +1,77 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Media_File")] -[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] -[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] -[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] -[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] -public partial class MediaFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string FileTitle { get; set; } = null!; - - public string FileDescription { get; set; } = null!; - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public string FilePath { get; set; } = null!; - - public long FileSize { get; set; } - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileLibraryID")] - public int FileLibraryId { get; set; } - - [Column("FileSiteID")] - public int FileSiteId { get; set; } - - [Column("FileCreatedByUserID")] - public int? FileCreatedByUserId { get; set; } - - public DateTime FileCreatedWhen { get; set; } - - [Column("FileModifiedByUserID")] - public int? FileModifiedByUserId { get; set; } - - public DateTime FileModifiedWhen { get; set; } - - public string? FileCustomData { get; set; } - - [ForeignKey("FileCreatedByUserId")] - [InverseProperty("MediaFileFileCreatedByUsers")] - public virtual CmsUser? FileCreatedByUser { get; set; } - - [ForeignKey("FileLibraryId")] - [InverseProperty("MediaFiles")] - public virtual MediaLibrary FileLibrary { get; set; } = null!; - - [ForeignKey("FileModifiedByUserId")] - [InverseProperty("MediaFileFileModifiedByUsers")] - public virtual CmsUser? FileModifiedByUser { get; set; } - - [ForeignKey("FileSiteId")] - [InverseProperty("MediaFiles")] - public virtual CmsSite FileSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Media_File")] +[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] +[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] +[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] +[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] +public class MediaFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string FileTitle { get; set; } = null!; + + public string FileDescription { get; set; } = null!; + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public string FilePath { get; set; } = null!; + + public long FileSize { get; set; } + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileLibraryID")] + public int FileLibraryId { get; set; } + + [Column("FileSiteID")] + public int FileSiteId { get; set; } + + [Column("FileCreatedByUserID")] + public int? FileCreatedByUserId { get; set; } + + public DateTime FileCreatedWhen { get; set; } + + [Column("FileModifiedByUserID")] + public int? FileModifiedByUserId { get; set; } + + public DateTime FileModifiedWhen { get; set; } + + public string? FileCustomData { get; set; } + + [ForeignKey("FileCreatedByUserId")] + [InverseProperty("MediaFileFileCreatedByUsers")] + public virtual CmsUser? FileCreatedByUser { get; set; } + + [ForeignKey("FileLibraryId")] + [InverseProperty("MediaFiles")] + public virtual MediaLibrary FileLibrary { get; set; } = null!; + + [ForeignKey("FileModifiedByUserId")] + [InverseProperty("MediaFileFileModifiedByUsers")] + public virtual CmsUser? FileModifiedByUser { get; set; } + + [ForeignKey("FileSiteId")] + [InverseProperty("MediaFiles")] + public virtual CmsSite FileSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/MediaLibrary.cs b/Migration.Toolkit.KX12/Models/MediaLibrary.cs index e22d9b13..a5cf7f7a 100644 --- a/Migration.Toolkit.KX12/Models/MediaLibrary.cs +++ b/Migration.Toolkit.KX12/Models/MediaLibrary.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Media_Library")] -[Index("LibraryGroupId", Name = "IX_Media_Library_LibraryGroupID")] -[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] -public partial class MediaLibrary -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [StringLength(250)] - public string LibraryName { get; set; } = null!; - - [StringLength(250)] - public string LibraryDisplayName { get; set; } = null!; - - public string? LibraryDescription { get; set; } - - [StringLength(250)] - public string LibraryFolder { get; set; } = null!; - - public int? LibraryAccess { get; set; } - - [Column("LibraryGroupID")] - public int? LibraryGroupId { get; set; } - - [Column("LibrarySiteID")] - public int LibrarySiteId { get; set; } - - [Column("LibraryGUID")] - public Guid? LibraryGuid { get; set; } - - public DateTime? LibraryLastModified { get; set; } - - [StringLength(450)] - public string? LibraryTeaserPath { get; set; } - - [Column("LibraryTeaserGUID")] - public Guid? LibraryTeaserGuid { get; set; } - - [ForeignKey("LibraryGroupId")] - [InverseProperty("MediaLibraries")] - public virtual CommunityGroup? LibraryGroup { get; set; } - - [ForeignKey("LibrarySiteId")] - [InverseProperty("MediaLibraries")] - public virtual CmsSite LibrarySite { get; set; } = null!; - - [InverseProperty("FileLibrary")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("Library")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Media_Library")] +[Index("LibraryGroupId", Name = "IX_Media_Library_LibraryGroupID")] +[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] +public class MediaLibrary +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [StringLength(250)] + public string LibraryName { get; set; } = null!; + + [StringLength(250)] + public string LibraryDisplayName { get; set; } = null!; + + public string? LibraryDescription { get; set; } + + [StringLength(250)] + public string LibraryFolder { get; set; } = null!; + + public int? LibraryAccess { get; set; } + + [Column("LibraryGroupID")] + public int? LibraryGroupId { get; set; } + + [Column("LibrarySiteID")] + public int LibrarySiteId { get; set; } + + [Column("LibraryGUID")] + public Guid? LibraryGuid { get; set; } + + public DateTime? LibraryLastModified { get; set; } + + [StringLength(450)] + public string? LibraryTeaserPath { get; set; } + + [Column("LibraryTeaserGUID")] + public Guid? LibraryTeaserGuid { get; set; } + + [ForeignKey("LibraryGroupId")] + [InverseProperty("MediaLibraries")] + public virtual CommunityGroup? LibraryGroup { get; set; } + + [ForeignKey("LibrarySiteId")] + [InverseProperty("MediaLibraries")] + public virtual CmsSite LibrarySite { get; set; } = null!; + + [InverseProperty("FileLibrary")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("Library")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs index 139aed60..2965822f 100644 --- a/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs +++ b/Migration.Toolkit.KX12/Models/MediaLibraryRolePermission.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("LibraryId", "RoleId", "PermissionId")] -[Table("Media_LibraryRolePermission")] -[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] -public partial class MediaLibraryRolePermission -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("LibraryId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual MediaLibrary Library { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("LibraryId", "RoleId", "PermissionId")] +[Table("Media_LibraryRolePermission")] +[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] +public class MediaLibraryRolePermission +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("LibraryId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual MediaLibrary Library { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs b/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs index d22ea57d..1a8f7cd7 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterAbtest.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_ABTest")] -[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] -[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] -[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] -public partial class NewsletterAbtest -{ - [Key] - [Column("TestID")] - public int TestId { get; set; } - - [Column("TestIssueID")] - public int TestIssueId { get; set; } - - public int TestWinnerOption { get; set; } - - public int? TestSelectWinnerAfter { get; set; } - - [Column("TestWinnerIssueID")] - public int? TestWinnerIssueId { get; set; } - - public DateTime? TestWinnerSelected { get; set; } - - public DateTime TestLastModified { get; set; } - - [Column("TestGUID")] - public Guid TestGuid { get; set; } - - [Column("TestWinnerScheduledTaskID")] - public int? TestWinnerScheduledTaskId { get; set; } - - public int TestSizePercentage { get; set; } - - public int? TestNumberPerVariantEmails { get; set; } - - [ForeignKey("TestIssueId")] - [InverseProperty("NewsletterAbtestTestIssue")] - public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; - - [ForeignKey("TestWinnerIssueId")] - [InverseProperty("NewsletterAbtestTestWinnerIssues")] - public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } - - [ForeignKey("TestWinnerScheduledTaskId")] - [InverseProperty("NewsletterAbtests")] - public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_ABTest")] +[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] +[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] +[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] +public class NewsletterAbtest +{ + [Key] + [Column("TestID")] + public int TestId { get; set; } + + [Column("TestIssueID")] + public int TestIssueId { get; set; } + + public int TestWinnerOption { get; set; } + + public int? TestSelectWinnerAfter { get; set; } + + [Column("TestWinnerIssueID")] + public int? TestWinnerIssueId { get; set; } + + public DateTime? TestWinnerSelected { get; set; } + + public DateTime TestLastModified { get; set; } + + [Column("TestGUID")] + public Guid TestGuid { get; set; } + + [Column("TestWinnerScheduledTaskID")] + public int? TestWinnerScheduledTaskId { get; set; } + + public int TestSizePercentage { get; set; } + + public int? TestNumberPerVariantEmails { get; set; } + + [ForeignKey("TestIssueId")] + [InverseProperty("NewsletterAbtestTestIssue")] + public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; + + [ForeignKey("TestWinnerIssueId")] + [InverseProperty("NewsletterAbtestTestWinnerIssues")] + public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } + + [ForeignKey("TestWinnerScheduledTaskId")] + [InverseProperty("NewsletterAbtests")] + public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs b/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs index 31cb9fc0..e4376616 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterClickedLink.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_ClickedLink")] -[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] -public partial class NewsletterClickedLink -{ - [Key] - [Column("ClickedLinkID")] - public int ClickedLinkId { get; set; } - - public Guid ClickedLinkGuid { get; set; } - - [StringLength(254)] - public string ClickedLinkEmail { get; set; } = null!; - - [Column("ClickedLinkNewsletterLinkID")] - public int ClickedLinkNewsletterLinkId { get; set; } - - public DateTime? ClickedLinkTime { get; set; } - - [ForeignKey("ClickedLinkNewsletterLinkId")] - [InverseProperty("NewsletterClickedLinks")] - public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_ClickedLink")] +[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] +public class NewsletterClickedLink +{ + [Key] + [Column("ClickedLinkID")] + public int ClickedLinkId { get; set; } + + public Guid ClickedLinkGuid { get; set; } + + [StringLength(254)] + public string ClickedLinkEmail { get; set; } = null!; + + [Column("ClickedLinkNewsletterLinkID")] + public int ClickedLinkNewsletterLinkId { get; set; } + + public DateTime? ClickedLinkTime { get; set; } + + [ForeignKey("ClickedLinkNewsletterLinkId")] + [InverseProperty("NewsletterClickedLinks")] + public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmail.cs b/Migration.Toolkit.KX12/Models/NewsletterEmail.cs index 4fba7ba5..630678b2 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterEmail.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterEmail.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Emails")] -[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] -[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] -[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] -[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] -[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] -public partial class NewsletterEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Column("EmailNewsletterIssueID")] - public int EmailNewsletterIssueId { get; set; } - - [Column("EmailSubscriberID")] - public int? EmailSubscriberId { get; set; } - - [Column("EmailSiteID")] - public int EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - public bool? EmailSending { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - [Column("EmailContactID")] - public int? EmailContactId { get; set; } - - [StringLength(254)] - public string? EmailAddress { get; set; } - - [ForeignKey("EmailNewsletterIssueId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; - - [ForeignKey("EmailSiteId")] - [InverseProperty("NewsletterEmails")] - public virtual CmsSite EmailSite { get; set; } = null!; - - [ForeignKey("EmailSubscriberId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterSubscriber? EmailSubscriber { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_Emails")] +[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] +[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] +[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] +[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] +[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] +public class NewsletterEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Column("EmailNewsletterIssueID")] + public int EmailNewsletterIssueId { get; set; } + + [Column("EmailSubscriberID")] + public int? EmailSubscriberId { get; set; } + + [Column("EmailSiteID")] + public int EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + public bool? EmailSending { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + [Column("EmailContactID")] + public int? EmailContactId { get; set; } + + [StringLength(254)] + public string? EmailAddress { get; set; } + + [ForeignKey("EmailNewsletterIssueId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; + + [ForeignKey("EmailSiteId")] + [InverseProperty("NewsletterEmails")] + public virtual CmsSite EmailSite { get; set; } = null!; + + [ForeignKey("EmailSubscriberId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterSubscriber? EmailSubscriber { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs index fc7ac7cc..8043ed53 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterEmailTemplate.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_EmailTemplate")] -[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] -public partial class NewsletterEmailTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TemplateName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int TemplateSiteId { get; set; } - - [StringLength(50)] - public string TemplateType { get; set; } = null!; - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [StringLength(450)] - public string? TemplateSubject { get; set; } - - [Column("TemplateThumbnailGUID")] - public Guid? TemplateThumbnailGuid { get; set; } - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateCode { get; set; } - - [Column("TemplateInlineCSS")] - public bool TemplateInlineCss { get; set; } - - [InverseProperty("Template")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); - - [InverseProperty("IssueTemplate")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterOptInTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); - - [InverseProperty("NewsletterUnsubscriptionTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NewsletterEmailTemplates")] - public virtual CmsSite TemplateSite { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("Templates")] - public virtual ICollection Newsletters { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_EmailTemplate")] +[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] +public class NewsletterEmailTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TemplateName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int TemplateSiteId { get; set; } + + [StringLength(50)] + public string TemplateType { get; set; } = null!; + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [StringLength(450)] + public string? TemplateSubject { get; set; } + + [Column("TemplateThumbnailGUID")] + public Guid? TemplateThumbnailGuid { get; set; } + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateCode { get; set; } + + [Column("TemplateInlineCSS")] + public bool TemplateInlineCss { get; set; } + + [InverseProperty("Template")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); + + [InverseProperty("IssueTemplate")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterOptInTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); + + [InverseProperty("NewsletterUnsubscriptionTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NewsletterEmailTemplates")] + public virtual CmsSite TemplateSite { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("Templates")] + public virtual ICollection Newsletters { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs index de07f81a..94195f26 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterEmailWidget.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_EmailWidget")] -[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] -public partial class NewsletterEmailWidget -{ - [Key] - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - public Guid EmailWidgetGuid { get; set; } - - public DateTime EmailWidgetLastModified { get; set; } - - [StringLength(250)] - public string EmailWidgetDisplayName { get; set; } = null!; - - [StringLength(250)] - public string EmailWidgetName { get; set; } = null!; - - public string? EmailWidgetDescription { get; set; } - - public string? EmailWidgetCode { get; set; } - - [Column("EmailWidgetSiteID")] - public int EmailWidgetSiteId { get; set; } - - [Column("EmailWidgetThumbnailGUID")] - public Guid? EmailWidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? EmailWidgetIconCssClass { get; set; } - - public string? EmailWidgetProperties { get; set; } - - [ForeignKey("EmailWidgetSiteId")] - [InverseProperty("NewsletterEmailWidgets")] - public virtual CmsSite EmailWidgetSite { get; set; } = null!; - - [InverseProperty("EmailWidget")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_EmailWidget")] +[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] +public class NewsletterEmailWidget +{ + [Key] + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + public Guid EmailWidgetGuid { get; set; } + + public DateTime EmailWidgetLastModified { get; set; } + + [StringLength(250)] + public string EmailWidgetDisplayName { get; set; } = null!; + + [StringLength(250)] + public string EmailWidgetName { get; set; } = null!; + + public string? EmailWidgetDescription { get; set; } + + public string? EmailWidgetCode { get; set; } + + [Column("EmailWidgetSiteID")] + public int EmailWidgetSiteId { get; set; } + + [Column("EmailWidgetThumbnailGUID")] + public Guid? EmailWidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? EmailWidgetIconCssClass { get; set; } + + public string? EmailWidgetProperties { get; set; } + + [ForeignKey("EmailWidgetSiteId")] + [InverseProperty("NewsletterEmailWidgets")] + public virtual CmsSite EmailWidgetSite { get; set; } = null!; + + [InverseProperty("EmailWidget")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs index 36dc4765..0df6e78d 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterEmailWidgetTemplate.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_EmailWidgetTemplate")] -[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] -[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] -public partial class NewsletterEmailWidgetTemplate -{ - [Key] - [Column("EmailWidgetTemplateID")] - public int EmailWidgetTemplateId { get; set; } - - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [ForeignKey("EmailWidgetId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailTemplate Template { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_EmailWidgetTemplate")] +[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] +[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] +public class NewsletterEmailWidgetTemplate +{ + [Key] + [Column("EmailWidgetTemplateID")] + public int EmailWidgetTemplateId { get; set; } + + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [ForeignKey("EmailWidgetId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailTemplate Template { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs index f0f08904..343c00d8 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterIssueContactGroup.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_IssueContactGroup")] -[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] -public partial class NewsletterIssueContactGroup -{ - [Key] - [Column("IssueContactGroupID")] - public int IssueContactGroupId { get; set; } - - [Column("IssueID")] - public int IssueId { get; set; } - - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [ForeignKey("ContactGroupId")] - [InverseProperty("NewsletterIssueContactGroups")] - public virtual OmContactGroup ContactGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_IssueContactGroup")] +[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] +public class NewsletterIssueContactGroup +{ + [Key] + [Column("IssueContactGroupID")] + public int IssueContactGroupId { get; set; } + + [Column("IssueID")] + public int IssueId { get; set; } + + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [ForeignKey("ContactGroupId")] + [InverseProperty("NewsletterIssueContactGroups")] + public virtual OmContactGroup ContactGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterLink.cs b/Migration.Toolkit.KX12/Models/NewsletterLink.cs index 6533d1bc..b9c2cd64 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterLink.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterLink.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Link")] -[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] -public partial class NewsletterLink -{ - [Key] - [Column("LinkID")] - public int LinkId { get; set; } - - [Column("LinkIssueID")] - public int LinkIssueId { get; set; } - - public string LinkTarget { get; set; } = null!; - - [StringLength(450)] - public string LinkDescription { get; set; } = null!; - - [Column("LinkGUID")] - public Guid LinkGuid { get; set; } - - [ForeignKey("LinkIssueId")] - [InverseProperty("NewsletterLinks")] - public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; - - [InverseProperty("ClickedLinkNewsletterLink")] - public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_Link")] +[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] +public class NewsletterLink +{ + [Key] + [Column("LinkID")] + public int LinkId { get; set; } + + [Column("LinkIssueID")] + public int LinkIssueId { get; set; } + + public string LinkTarget { get; set; } = null!; + + [StringLength(450)] + public string LinkDescription { get; set; } = null!; + + [Column("LinkGUID")] + public Guid LinkGuid { get; set; } + + [ForeignKey("LinkIssueId")] + [InverseProperty("NewsletterLinks")] + public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; + + [InverseProperty("ClickedLinkNewsletterLink")] + public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs b/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs index 39afeafd..11377899 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterNewsletter.cs @@ -1,116 +1,115 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Newsletter")] -[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] -[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] -[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] -[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] -[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] -public partial class NewsletterNewsletter -{ - [Key] - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [StringLength(250)] - public string NewsletterName { get; set; } = null!; - - [Column("NewsletterSubscriptionTemplateID")] - public int? NewsletterSubscriptionTemplateId { get; set; } - - [Column("NewsletterUnsubscriptionTemplateID")] - public int NewsletterUnsubscriptionTemplateId { get; set; } - - [StringLength(200)] - public string NewsletterSenderName { get; set; } = null!; - - [StringLength(254)] - public string NewsletterSenderEmail { get; set; } = null!; - - [StringLength(100)] - public string? NewsletterDynamicSubject { get; set; } - - [Column("NewsletterDynamicURL")] - [StringLength(500)] - public string? NewsletterDynamicUrl { get; set; } - - [Column("NewsletterDynamicScheduledTaskID")] - public int? NewsletterDynamicScheduledTaskId { get; set; } - - [Column("NewsletterSiteID")] - public int NewsletterSiteId { get; set; } - - [Column("NewsletterGUID")] - public Guid NewsletterGuid { get; set; } - - [StringLength(1000)] - public string? NewsletterUnsubscribeUrl { get; set; } - - [StringLength(500)] - public string? NewsletterBaseUrl { get; set; } - - public DateTime NewsletterLastModified { get; set; } - - public bool? NewsletterEnableOptIn { get; set; } - - [Column("NewsletterOptInTemplateID")] - public int? NewsletterOptInTemplateId { get; set; } - - public bool? NewsletterSendOptInConfirmation { get; set; } - - [Column("NewsletterOptInApprovalURL")] - [StringLength(450)] - public string? NewsletterOptInApprovalUrl { get; set; } - - public bool? NewsletterTrackOpenEmails { get; set; } - - public bool? NewsletterTrackClickedLinks { get; set; } - - [StringLength(998)] - public string? NewsletterDraftEmails { get; set; } - - public bool? NewsletterLogActivity { get; set; } - - [StringLength(5)] - public string NewsletterSource { get; set; } = null!; - - public int NewsletterType { get; set; } - - [ForeignKey("NewsletterDynamicScheduledTaskId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } - - [InverseProperty("IssueNewsletter")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [ForeignKey("NewsletterOptInTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] - public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } - - [ForeignKey("NewsletterSiteId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsSite NewsletterSite { get; set; } = null!; - - [InverseProperty("Newsletter")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("NewsletterUnsubscriptionTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] - public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; - - [InverseProperty("UnsubscriptionNewsletter")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); - - [ForeignKey("NewsletterId")] - [InverseProperty("Newsletters")] - public virtual ICollection Templates { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_Newsletter")] +[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] +[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] +[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] +[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] +[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] +public class NewsletterNewsletter +{ + [Key] + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [StringLength(250)] + public string NewsletterName { get; set; } = null!; + + [Column("NewsletterSubscriptionTemplateID")] + public int? NewsletterSubscriptionTemplateId { get; set; } + + [Column("NewsletterUnsubscriptionTemplateID")] + public int NewsletterUnsubscriptionTemplateId { get; set; } + + [StringLength(200)] + public string NewsletterSenderName { get; set; } = null!; + + [StringLength(254)] + public string NewsletterSenderEmail { get; set; } = null!; + + [StringLength(100)] + public string? NewsletterDynamicSubject { get; set; } + + [Column("NewsletterDynamicURL")] + [StringLength(500)] + public string? NewsletterDynamicUrl { get; set; } + + [Column("NewsletterDynamicScheduledTaskID")] + public int? NewsletterDynamicScheduledTaskId { get; set; } + + [Column("NewsletterSiteID")] + public int NewsletterSiteId { get; set; } + + [Column("NewsletterGUID")] + public Guid NewsletterGuid { get; set; } + + [StringLength(1000)] + public string? NewsletterUnsubscribeUrl { get; set; } + + [StringLength(500)] + public string? NewsletterBaseUrl { get; set; } + + public DateTime NewsletterLastModified { get; set; } + + public bool? NewsletterEnableOptIn { get; set; } + + [Column("NewsletterOptInTemplateID")] + public int? NewsletterOptInTemplateId { get; set; } + + public bool? NewsletterSendOptInConfirmation { get; set; } + + [Column("NewsletterOptInApprovalURL")] + [StringLength(450)] + public string? NewsletterOptInApprovalUrl { get; set; } + + public bool? NewsletterTrackOpenEmails { get; set; } + + public bool? NewsletterTrackClickedLinks { get; set; } + + [StringLength(998)] + public string? NewsletterDraftEmails { get; set; } + + public bool? NewsletterLogActivity { get; set; } + + [StringLength(5)] + public string NewsletterSource { get; set; } = null!; + + public int NewsletterType { get; set; } + + [ForeignKey("NewsletterDynamicScheduledTaskId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } + + [InverseProperty("IssueNewsletter")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [ForeignKey("NewsletterOptInTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] + public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } + + [ForeignKey("NewsletterSiteId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsSite NewsletterSite { get; set; } = null!; + + [InverseProperty("Newsletter")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("NewsletterUnsubscriptionTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] + public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; + + [InverseProperty("UnsubscriptionNewsletter")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); + + [ForeignKey("NewsletterId")] + [InverseProperty("Newsletters")] + public virtual ICollection Templates { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs index 8b2ed491..2b2ab877 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterNewsletterIssue.cs @@ -1,126 +1,125 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_NewsletterIssue")] -[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] -[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] -[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] -[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] -[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] -public partial class NewsletterNewsletterIssue -{ - [Key] - [Column("IssueID")] - public int IssueId { get; set; } - - [StringLength(450)] - public string IssueSubject { get; set; } = null!; - - public string IssueText { get; set; } = null!; - - public int IssueUnsubscribed { get; set; } - - [Column("IssueNewsletterID")] - public int IssueNewsletterId { get; set; } - - [Column("IssueTemplateID")] - public int? IssueTemplateId { get; set; } - - public int IssueSentEmails { get; set; } - - public DateTime? IssueMailoutTime { get; set; } - - [Column("IssueGUID")] - public Guid IssueGuid { get; set; } - - public DateTime IssueLastModified { get; set; } - - [Column("IssueSiteID")] - public int IssueSiteId { get; set; } - - public int? IssueOpenedEmails { get; set; } - - public int? IssueBounces { get; set; } - - public int? IssueStatus { get; set; } - - [Column("IssueIsABTest")] - public bool? IssueIsAbtest { get; set; } - - [Column("IssueVariantOfIssueID")] - public int? IssueVariantOfIssueId { get; set; } - - [StringLength(200)] - public string? IssueVariantName { get; set; } - - [StringLength(200)] - public string? IssueSenderName { get; set; } - - [StringLength(254)] - public string? IssueSenderEmail { get; set; } - - [Column("IssueScheduledTaskID")] - public int? IssueScheduledTaskId { get; set; } - - [Column("IssueUTMSource")] - [StringLength(200)] - public string? IssueUtmsource { get; set; } - - [Column("IssueUseUTM")] - public bool IssueUseUtm { get; set; } - - [Column("IssueUTMCampaign")] - [StringLength(200)] - public string? IssueUtmcampaign { get; set; } - - [StringLength(200)] - public string IssueDisplayName { get; set; } = null!; - - public string? IssueWidgets { get; set; } - - public string? IssuePreheader { get; set; } - - public string? IssuePlainText { get; set; } - - [InverseProperty("IssueVariantOfIssue")] - public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); - - [ForeignKey("IssueNewsletterId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; - - [ForeignKey("IssueSiteId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual CmsSite IssueSite { get; set; } = null!; - - [ForeignKey("IssueTemplateId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } - - [ForeignKey("IssueVariantOfIssueId")] - [InverseProperty("InverseIssueVariantOfIssue")] - public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } - - [InverseProperty("TestIssue")] - public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } - - [InverseProperty("TestWinnerIssue")] - public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); - - [InverseProperty("EmailNewsletterIssue")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("LinkIssue")] - public virtual ICollection NewsletterLinks { get; set; } = new List(); - - [InverseProperty("OpenedEmailIssue")] - public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); - - [InverseProperty("UnsubscriptionFromIssue")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_NewsletterIssue")] +[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] +[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] +[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] +[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] +[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] +public class NewsletterNewsletterIssue +{ + [Key] + [Column("IssueID")] + public int IssueId { get; set; } + + [StringLength(450)] + public string IssueSubject { get; set; } = null!; + + public string IssueText { get; set; } = null!; + + public int IssueUnsubscribed { get; set; } + + [Column("IssueNewsletterID")] + public int IssueNewsletterId { get; set; } + + [Column("IssueTemplateID")] + public int? IssueTemplateId { get; set; } + + public int IssueSentEmails { get; set; } + + public DateTime? IssueMailoutTime { get; set; } + + [Column("IssueGUID")] + public Guid IssueGuid { get; set; } + + public DateTime IssueLastModified { get; set; } + + [Column("IssueSiteID")] + public int IssueSiteId { get; set; } + + public int? IssueOpenedEmails { get; set; } + + public int? IssueBounces { get; set; } + + public int? IssueStatus { get; set; } + + [Column("IssueIsABTest")] + public bool? IssueIsAbtest { get; set; } + + [Column("IssueVariantOfIssueID")] + public int? IssueVariantOfIssueId { get; set; } + + [StringLength(200)] + public string? IssueVariantName { get; set; } + + [StringLength(200)] + public string? IssueSenderName { get; set; } + + [StringLength(254)] + public string? IssueSenderEmail { get; set; } + + [Column("IssueScheduledTaskID")] + public int? IssueScheduledTaskId { get; set; } + + [Column("IssueUTMSource")] + [StringLength(200)] + public string? IssueUtmsource { get; set; } + + [Column("IssueUseUTM")] + public bool IssueUseUtm { get; set; } + + [Column("IssueUTMCampaign")] + [StringLength(200)] + public string? IssueUtmcampaign { get; set; } + + [StringLength(200)] + public string IssueDisplayName { get; set; } = null!; + + public string? IssueWidgets { get; set; } + + public string? IssuePreheader { get; set; } + + public string? IssuePlainText { get; set; } + + [InverseProperty("IssueVariantOfIssue")] + public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); + + [ForeignKey("IssueNewsletterId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; + + [ForeignKey("IssueSiteId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual CmsSite IssueSite { get; set; } = null!; + + [ForeignKey("IssueTemplateId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } + + [ForeignKey("IssueVariantOfIssueId")] + [InverseProperty("InverseIssueVariantOfIssue")] + public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } + + [InverseProperty("TestIssue")] + public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } + + [InverseProperty("TestWinnerIssue")] + public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); + + [InverseProperty("EmailNewsletterIssue")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("LinkIssue")] + public virtual ICollection NewsletterLinks { get; set; } = new List(); + + [InverseProperty("OpenedEmailIssue")] + public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); + + [InverseProperty("UnsubscriptionFromIssue")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs index 330e0f3f..430ffcbf 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterOpenedEmail.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_OpenedEmail")] -[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] -public partial class NewsletterOpenedEmail -{ - [Key] - [Column("OpenedEmailID")] - public int OpenedEmailId { get; set; } - - [StringLength(254)] - public string OpenedEmailEmail { get; set; } = null!; - - public Guid OpenedEmailGuid { get; set; } - - public DateTime? OpenedEmailTime { get; set; } - - [Column("OpenedEmailIssueID")] - public int OpenedEmailIssueId { get; set; } - - [ForeignKey("OpenedEmailIssueId")] - [InverseProperty("NewsletterOpenedEmails")] - public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_OpenedEmail")] +[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] +public class NewsletterOpenedEmail +{ + [Key] + [Column("OpenedEmailID")] + public int OpenedEmailId { get; set; } + + [StringLength(254)] + public string OpenedEmailEmail { get; set; } = null!; + + public Guid OpenedEmailGuid { get; set; } + + public DateTime? OpenedEmailTime { get; set; } + + [Column("OpenedEmailIssueID")] + public int OpenedEmailIssueId { get; set; } + + [ForeignKey("OpenedEmailIssueId")] + [InverseProperty("NewsletterOpenedEmails")] + public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs b/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs index 85024aed..cb248d03 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterSubscriber.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Subscriber")] -[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] -[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] -public partial class NewsletterSubscriber -{ - [Key] - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - [StringLength(200)] - public string? SubscriberFirstName { get; set; } - - [StringLength(200)] - public string? SubscriberLastName { get; set; } - - [Column("SubscriberSiteID")] - public int SubscriberSiteId { get; set; } - - [Column("SubscriberGUID")] - public Guid SubscriberGuid { get; set; } - - public string? SubscriberCustomData { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - public DateTime SubscriberLastModified { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - public int? SubscriberBounces { get; set; } - - [InverseProperty("EmailSubscriber")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("Subscriber")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("SubscriberSiteId")] - [InverseProperty("NewsletterSubscribers")] - public virtual CmsSite SubscriberSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_Subscriber")] +[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] +[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] +public class NewsletterSubscriber +{ + [Key] + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + [StringLength(200)] + public string? SubscriberFirstName { get; set; } + + [StringLength(200)] + public string? SubscriberLastName { get; set; } + + [Column("SubscriberSiteID")] + public int SubscriberSiteId { get; set; } + + [Column("SubscriberGUID")] + public Guid SubscriberGuid { get; set; } + + public string? SubscriberCustomData { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + public DateTime SubscriberLastModified { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + public int? SubscriberBounces { get; set; } + + [InverseProperty("EmailSubscriber")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("Subscriber")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("SubscriberSiteId")] + [InverseProperty("NewsletterSubscribers")] + public virtual CmsSite SubscriberSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs index bf2ead71..5f303806 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterSubscriberNewsletter.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_SubscriberNewsletter")] -[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] -[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] -public partial class NewsletterSubscriberNewsletter -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - public DateTime SubscribedWhen { get; set; } - - public bool? SubscriptionApproved { get; set; } - - public DateTime? SubscriptionApprovedWhen { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [Key] - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } - - [ForeignKey("NewsletterId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterNewsletter Newsletter { get; set; } = null!; - - [ForeignKey("SubscriberId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterSubscriber Subscriber { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_SubscriberNewsletter")] +[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] +[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] +public class NewsletterSubscriberNewsletter +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + public DateTime SubscribedWhen { get; set; } + + public bool? SubscriptionApproved { get; set; } + + public DateTime? SubscriptionApprovedWhen { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [Key] + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } + + [ForeignKey("NewsletterId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterNewsletter Newsletter { get; set; } = null!; + + [ForeignKey("SubscriberId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterSubscriber Subscriber { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs index 136a523d..e9467fdf 100644 --- a/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs +++ b/Migration.Toolkit.KX12/Models/NewsletterUnsubscription.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Newsletter_Unsubscription")] -[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] -[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] -[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] -public partial class NewsletterUnsubscription -{ - [Key] - [Column("UnsubscriptionID")] - public int UnsubscriptionId { get; set; } - - [StringLength(254)] - public string UnsubscriptionEmail { get; set; } = null!; - - public DateTime UnsubscriptionCreated { get; set; } - - [Column("UnsubscriptionNewsletterID")] - public int? UnsubscriptionNewsletterId { get; set; } - - [Column("UnsubscriptionFromIssueID")] - public int? UnsubscriptionFromIssueId { get; set; } - - [Column("UnsubscriptionGUID")] - public Guid UnsubscriptionGuid { get; set; } - - [ForeignKey("UnsubscriptionFromIssueId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } - - [ForeignKey("UnsubscriptionNewsletterId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Newsletter_Unsubscription")] +[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] +[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] +[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] +public class NewsletterUnsubscription +{ + [Key] + [Column("UnsubscriptionID")] + public int UnsubscriptionId { get; set; } + + [StringLength(254)] + public string UnsubscriptionEmail { get; set; } = null!; + + public DateTime UnsubscriptionCreated { get; set; } + + [Column("UnsubscriptionNewsletterID")] + public int? UnsubscriptionNewsletterId { get; set; } + + [Column("UnsubscriptionFromIssueID")] + public int? UnsubscriptionFromIssueId { get; set; } + + [Column("UnsubscriptionGUID")] + public Guid UnsubscriptionGuid { get; set; } + + [ForeignKey("UnsubscriptionFromIssueId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } + + [ForeignKey("UnsubscriptionNewsletterId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/NotificationGateway.cs b/Migration.Toolkit.KX12/Models/NotificationGateway.cs index 79d12b62..134829bc 100644 --- a/Migration.Toolkit.KX12/Models/NotificationGateway.cs +++ b/Migration.Toolkit.KX12/Models/NotificationGateway.cs @@ -1,49 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Notification_Gateway")] -public partial class NotificationGateway -{ - [Key] - [Column("GatewayID")] - public int GatewayId { get; set; } - - [StringLength(200)] - public string GatewayName { get; set; } = null!; - - [StringLength(200)] - public string GatewayDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GatewayAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string GatewayClassName { get; set; } = null!; - - public string? GatewayDescription { get; set; } - - public bool? GatewaySupportsEmail { get; set; } - - public bool? GatewaySupportsPlainText { get; set; } - - [Column("GatewaySupportsHTMLText")] - public bool? GatewaySupportsHtmltext { get; set; } - - public DateTime GatewayLastModified { get; set; } - - [Column("GatewayGUID")] - public Guid GatewayGuid { get; set; } - - public bool? GatewayEnabled { get; set; } - - [InverseProperty("SubscriptionGateway")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("Gateway")] - public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Notification_Gateway")] +public class NotificationGateway +{ + [Key] + [Column("GatewayID")] + public int GatewayId { get; set; } + + [StringLength(200)] + public string GatewayName { get; set; } = null!; + + [StringLength(200)] + public string GatewayDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GatewayAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string GatewayClassName { get; set; } = null!; + + public string? GatewayDescription { get; set; } + + public bool? GatewaySupportsEmail { get; set; } + + public bool? GatewaySupportsPlainText { get; set; } + + [Column("GatewaySupportsHTMLText")] + public bool? GatewaySupportsHtmltext { get; set; } + + public DateTime GatewayLastModified { get; set; } + + [Column("GatewayGUID")] + public Guid GatewayGuid { get; set; } + + public bool? GatewayEnabled { get; set; } + + [InverseProperty("SubscriptionGateway")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("Gateway")] + public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/NotificationSubscription.cs b/Migration.Toolkit.KX12/Models/NotificationSubscription.cs index 7d482033..31111c7a 100644 --- a/Migration.Toolkit.KX12/Models/NotificationSubscription.cs +++ b/Migration.Toolkit.KX12/Models/NotificationSubscription.cs @@ -1,77 +1,76 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Notification_Subscription")] -[Index("SubscriptionEventSource", "SubscriptionEventCode", "SubscriptionEventObjectId", Name = "IX_Notification_Subscription_SubscriptionEventSource_SubscriptionEventCode_SubscriptionEventObjectID")] -[Index("SubscriptionGatewayId", Name = "IX_Notification_Subscription_SubscriptionGatewayID")] -[Index("SubscriptionSiteId", Name = "IX_Notification_Subscription_SubscriptionSiteID")] -[Index("SubscriptionTemplateId", Name = "IX_Notification_Subscription_SubscriptionTemplateID")] -[Index("SubscriptionUserId", Name = "IX_Notification_Subscription_SubscriptionUserID")] -public partial class NotificationSubscription -{ - [Key] - [Column("SubscriptionID")] - public int SubscriptionId { get; set; } - - [Column("SubscriptionGatewayID")] - public int SubscriptionGatewayId { get; set; } - - [Column("SubscriptionTemplateID")] - public int SubscriptionTemplateId { get; set; } - - [StringLength(100)] - public string? SubscriptionEventSource { get; set; } - - [StringLength(100)] - public string? SubscriptionEventCode { get; set; } - - [StringLength(250)] - public string SubscriptionEventDisplayName { get; set; } = null!; - - [Column("SubscriptionEventObjectID")] - public int? SubscriptionEventObjectId { get; set; } - - public DateTime SubscriptionTime { get; set; } - - [Column("SubscriptionUserID")] - public int SubscriptionUserId { get; set; } - - [StringLength(250)] - public string SubscriptionTarget { get; set; } = null!; - - public DateTime SubscriptionLastModified { get; set; } - - [Column("SubscriptionGUID")] - public Guid SubscriptionGuid { get; set; } - - public string? SubscriptionEventData1 { get; set; } - - public string? SubscriptionEventData2 { get; set; } - - [Column("SubscriptionUseHTML")] - public bool? SubscriptionUseHtml { get; set; } - - [Column("SubscriptionSiteID")] - public int? SubscriptionSiteId { get; set; } - - [ForeignKey("SubscriptionGatewayId")] - [InverseProperty("NotificationSubscriptions")] - public virtual NotificationGateway SubscriptionGateway { get; set; } = null!; - - [ForeignKey("SubscriptionSiteId")] - [InverseProperty("NotificationSubscriptions")] - public virtual CmsSite? SubscriptionSite { get; set; } - - [ForeignKey("SubscriptionTemplateId")] - [InverseProperty("NotificationSubscriptions")] - public virtual NotificationTemplate SubscriptionTemplate { get; set; } = null!; - - [ForeignKey("SubscriptionUserId")] - [InverseProperty("NotificationSubscriptions")] - public virtual CmsUser SubscriptionUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Notification_Subscription")] +[Index("SubscriptionEventSource", "SubscriptionEventCode", "SubscriptionEventObjectId", Name = "IX_Notification_Subscription_SubscriptionEventSource_SubscriptionEventCode_SubscriptionEventObjectID")] +[Index("SubscriptionGatewayId", Name = "IX_Notification_Subscription_SubscriptionGatewayID")] +[Index("SubscriptionSiteId", Name = "IX_Notification_Subscription_SubscriptionSiteID")] +[Index("SubscriptionTemplateId", Name = "IX_Notification_Subscription_SubscriptionTemplateID")] +[Index("SubscriptionUserId", Name = "IX_Notification_Subscription_SubscriptionUserID")] +public class NotificationSubscription +{ + [Key] + [Column("SubscriptionID")] + public int SubscriptionId { get; set; } + + [Column("SubscriptionGatewayID")] + public int SubscriptionGatewayId { get; set; } + + [Column("SubscriptionTemplateID")] + public int SubscriptionTemplateId { get; set; } + + [StringLength(100)] + public string? SubscriptionEventSource { get; set; } + + [StringLength(100)] + public string? SubscriptionEventCode { get; set; } + + [StringLength(250)] + public string SubscriptionEventDisplayName { get; set; } = null!; + + [Column("SubscriptionEventObjectID")] + public int? SubscriptionEventObjectId { get; set; } + + public DateTime SubscriptionTime { get; set; } + + [Column("SubscriptionUserID")] + public int SubscriptionUserId { get; set; } + + [StringLength(250)] + public string SubscriptionTarget { get; set; } = null!; + + public DateTime SubscriptionLastModified { get; set; } + + [Column("SubscriptionGUID")] + public Guid SubscriptionGuid { get; set; } + + public string? SubscriptionEventData1 { get; set; } + + public string? SubscriptionEventData2 { get; set; } + + [Column("SubscriptionUseHTML")] + public bool? SubscriptionUseHtml { get; set; } + + [Column("SubscriptionSiteID")] + public int? SubscriptionSiteId { get; set; } + + [ForeignKey("SubscriptionGatewayId")] + [InverseProperty("NotificationSubscriptions")] + public virtual NotificationGateway SubscriptionGateway { get; set; } = null!; + + [ForeignKey("SubscriptionSiteId")] + [InverseProperty("NotificationSubscriptions")] + public virtual CmsSite? SubscriptionSite { get; set; } + + [ForeignKey("SubscriptionTemplateId")] + [InverseProperty("NotificationSubscriptions")] + public virtual NotificationTemplate SubscriptionTemplate { get; set; } = null!; + + [ForeignKey("SubscriptionUserId")] + [InverseProperty("NotificationSubscriptions")] + public virtual CmsUser SubscriptionUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/NotificationTemplate.cs b/Migration.Toolkit.KX12/Models/NotificationTemplate.cs index 675efac8..c58de4d0 100644 --- a/Migration.Toolkit.KX12/Models/NotificationTemplate.cs +++ b/Migration.Toolkit.KX12/Models/NotificationTemplate.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Notification_Template")] -[Index("TemplateSiteId", Name = "IX_Notification_Template_TemplateSiteID")] -public partial class NotificationTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(200)] - public string TemplateName { get; set; } = null!; - - [StringLength(200)] - public string TemplateDisplayName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int? TemplateSiteId { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - [InverseProperty("SubscriptionTemplate")] - public virtual ICollection NotificationSubscriptions { get; set; } = new List(); - - [InverseProperty("Template")] - public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NotificationTemplates")] - public virtual CmsSite? TemplateSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Notification_Template")] +[Index("TemplateSiteId", Name = "IX_Notification_Template_TemplateSiteID")] +public class NotificationTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(200)] + public string TemplateName { get; set; } = null!; + + [StringLength(200)] + public string TemplateDisplayName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int? TemplateSiteId { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + [InverseProperty("SubscriptionTemplate")] + public virtual ICollection NotificationSubscriptions { get; set; } = new List(); + + [InverseProperty("Template")] + public virtual ICollection NotificationTemplateTexts { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NotificationTemplates")] + public virtual CmsSite? TemplateSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs b/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs index e592397d..a3d7e31f 100644 --- a/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs +++ b/Migration.Toolkit.KX12/Models/NotificationTemplateText.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Notification_TemplateText")] -[Index("GatewayId", Name = "IX_Notification_TemplateText_GatewayID")] -[Index("TemplateId", Name = "IX_Notification_TemplateText_TemplateID")] -public partial class NotificationTemplateText -{ - [Key] - [Column("TemplateTextID")] - public int TemplateTextId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [Column("GatewayID")] - public int GatewayId { get; set; } - - [StringLength(250)] - public string TemplateSubject { get; set; } = null!; - - [Column("TemplateHTMLText")] - public string TemplateHtmltext { get; set; } = null!; - - public string TemplatePlainText { get; set; } = null!; - - [Column("TemplateTextGUID")] - public Guid TemplateTextGuid { get; set; } - - public DateTime TemplateTextLastModified { get; set; } - - [ForeignKey("GatewayId")] - [InverseProperty("NotificationTemplateTexts")] - public virtual NotificationGateway Gateway { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NotificationTemplateTexts")] - public virtual NotificationTemplate Template { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Notification_TemplateText")] +[Index("GatewayId", Name = "IX_Notification_TemplateText_GatewayID")] +[Index("TemplateId", Name = "IX_Notification_TemplateText_TemplateID")] +public class NotificationTemplateText +{ + [Key] + [Column("TemplateTextID")] + public int TemplateTextId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [Column("GatewayID")] + public int GatewayId { get; set; } + + [StringLength(250)] + public string TemplateSubject { get; set; } = null!; + + [Column("TemplateHTMLText")] + public string TemplateHtmltext { get; set; } = null!; + + public string TemplatePlainText { get; set; } = null!; + + [Column("TemplateTextGUID")] + public Guid TemplateTextGuid { get; set; } + + public DateTime TemplateTextLastModified { get; set; } + + [ForeignKey("GatewayId")] + [InverseProperty("NotificationTemplateTexts")] + public virtual NotificationGateway Gateway { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NotificationTemplateTexts")] + public virtual NotificationTemplate Template { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmAbtest.cs b/Migration.Toolkit.KX12/Models/OmAbtest.cs index e86410b8..aa099383 100644 --- a/Migration.Toolkit.KX12/Models/OmAbtest.cs +++ b/Migration.Toolkit.KX12/Models/OmAbtest.cs @@ -1,72 +1,71 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ABTest")] -[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] -public partial class OmAbtest -{ - [Key] - [Column("ABTestID")] - public int AbtestId { get; set; } - - [Column("ABTestName")] - [StringLength(50)] - public string AbtestName { get; set; } = null!; - - [Column("ABTestDescription")] - public string? AbtestDescription { get; set; } - - [Column("ABTestCulture")] - [StringLength(50)] - public string? AbtestCulture { get; set; } - - [Column("ABTestOriginalPage")] - [StringLength(450)] - public string AbtestOriginalPage { get; set; } = null!; - - [Column("ABTestOpenFrom")] - public DateTime? AbtestOpenFrom { get; set; } - - [Column("ABTestOpenTo")] - public DateTime? AbtestOpenTo { get; set; } - - [Column("ABTestSiteID")] - public int AbtestSiteId { get; set; } - - [Column("ABTestGUID")] - public Guid AbtestGuid { get; set; } - - [Column("ABTestLastModified")] - public DateTime AbtestLastModified { get; set; } - - [Column("ABTestDisplayName")] - [StringLength(100)] - public string AbtestDisplayName { get; set; } = null!; - - [Column("ABTestIncludedTraffic")] - public int AbtestIncludedTraffic { get; set; } - - [Column("ABTestVisitorTargeting")] - public string? AbtestVisitorTargeting { get; set; } - - [Column("ABTestConversions")] - public string? AbtestConversions { get; set; } - - [Column("ABTestWinnerGUID")] - public Guid? AbtestWinnerGuid { get; set; } - - [ForeignKey("AbtestSiteId")] - [InverseProperty("OmAbtests")] - public virtual CmsSite AbtestSite { get; set; } = null!; - - [InverseProperty("AbvariantTest")] - public virtual ICollection OmAbvariantData { get; set; } = new List(); - - [InverseProperty("AbvariantTest")] - public virtual ICollection OmAbvariants { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ABTest")] +[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] +public class OmAbtest +{ + [Key] + [Column("ABTestID")] + public int AbtestId { get; set; } + + [Column("ABTestName")] + [StringLength(50)] + public string AbtestName { get; set; } = null!; + + [Column("ABTestDescription")] + public string? AbtestDescription { get; set; } + + [Column("ABTestCulture")] + [StringLength(50)] + public string? AbtestCulture { get; set; } + + [Column("ABTestOriginalPage")] + [StringLength(450)] + public string AbtestOriginalPage { get; set; } = null!; + + [Column("ABTestOpenFrom")] + public DateTime? AbtestOpenFrom { get; set; } + + [Column("ABTestOpenTo")] + public DateTime? AbtestOpenTo { get; set; } + + [Column("ABTestSiteID")] + public int AbtestSiteId { get; set; } + + [Column("ABTestGUID")] + public Guid AbtestGuid { get; set; } + + [Column("ABTestLastModified")] + public DateTime AbtestLastModified { get; set; } + + [Column("ABTestDisplayName")] + [StringLength(100)] + public string AbtestDisplayName { get; set; } = null!; + + [Column("ABTestIncludedTraffic")] + public int AbtestIncludedTraffic { get; set; } + + [Column("ABTestVisitorTargeting")] + public string? AbtestVisitorTargeting { get; set; } + + [Column("ABTestConversions")] + public string? AbtestConversions { get; set; } + + [Column("ABTestWinnerGUID")] + public Guid? AbtestWinnerGuid { get; set; } + + [ForeignKey("AbtestSiteId")] + [InverseProperty("OmAbtests")] + public virtual CmsSite AbtestSite { get; set; } = null!; + + [InverseProperty("AbvariantTest")] + public virtual ICollection OmAbvariantData { get; set; } = new List(); + + [InverseProperty("AbvariantTest")] + public virtual ICollection OmAbvariants { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmAbvariant.cs b/Migration.Toolkit.KX12/Models/OmAbvariant.cs index 91207159..74a3614e 100644 --- a/Migration.Toolkit.KX12/Models/OmAbvariant.cs +++ b/Migration.Toolkit.KX12/Models/OmAbvariant.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ABVariant")] -[Index("AbvariantSiteId", Name = "IX_OM_ABVariant_ABVariantSiteID")] -[Index("AbvariantTestId", Name = "IX_OM_ABVariant_ABVariantTestID")] -public partial class OmAbvariant -{ - [Key] - [Column("ABVariantID")] - public int AbvariantId { get; set; } - - [Column("ABVariantDisplayName")] - [StringLength(110)] - public string AbvariantDisplayName { get; set; } = null!; - - [Column("ABVariantName")] - [StringLength(50)] - public string AbvariantName { get; set; } = null!; - - [Column("ABVariantTestID")] - public int AbvariantTestId { get; set; } - - [Column("ABVariantPath")] - [StringLength(450)] - public string AbvariantPath { get; set; } = null!; - - [Column("ABVariantGUID")] - public Guid AbvariantGuid { get; set; } - - [Column("ABVariantLastModified")] - public DateTime AbvariantLastModified { get; set; } - - [Column("ABVariantSiteID")] - public int AbvariantSiteId { get; set; } - - [ForeignKey("AbvariantSiteId")] - [InverseProperty("OmAbvariants")] - public virtual CmsSite AbvariantSite { get; set; } = null!; - - [ForeignKey("AbvariantTestId")] - [InverseProperty("OmAbvariants")] - public virtual OmAbtest AbvariantTest { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ABVariant")] +[Index("AbvariantSiteId", Name = "IX_OM_ABVariant_ABVariantSiteID")] +[Index("AbvariantTestId", Name = "IX_OM_ABVariant_ABVariantTestID")] +public class OmAbvariant +{ + [Key] + [Column("ABVariantID")] + public int AbvariantId { get; set; } + + [Column("ABVariantDisplayName")] + [StringLength(110)] + public string AbvariantDisplayName { get; set; } = null!; + + [Column("ABVariantName")] + [StringLength(50)] + public string AbvariantName { get; set; } = null!; + + [Column("ABVariantTestID")] + public int AbvariantTestId { get; set; } + + [Column("ABVariantPath")] + [StringLength(450)] + public string AbvariantPath { get; set; } = null!; + + [Column("ABVariantGUID")] + public Guid AbvariantGuid { get; set; } + + [Column("ABVariantLastModified")] + public DateTime AbvariantLastModified { get; set; } + + [Column("ABVariantSiteID")] + public int AbvariantSiteId { get; set; } + + [ForeignKey("AbvariantSiteId")] + [InverseProperty("OmAbvariants")] + public virtual CmsSite AbvariantSite { get; set; } = null!; + + [ForeignKey("AbvariantTestId")] + [InverseProperty("OmAbvariants")] + public virtual OmAbtest AbvariantTest { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs b/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs index f085164d..9f648b2b 100644 --- a/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs +++ b/Migration.Toolkit.KX12/Models/OmAbvariantDatum.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ABVariantData")] -[Index("AbvariantTestId", "AbvariantGuid", Name = "IX_OM_ABVariantData_ABVariantTestID_ABVariantGUID")] -public partial class OmAbvariantDatum -{ - [Key] - [Column("ABVariantID")] - public int AbvariantId { get; set; } - - [Column("ABVariantDisplayName")] - [StringLength(100)] - public string AbvariantDisplayName { get; set; } = null!; - - [Column("ABVariantGUID")] - public Guid AbvariantGuid { get; set; } - - [Column("ABVariantTestID")] - public int AbvariantTestId { get; set; } - - [Column("ABVariantIsOriginal")] - public bool AbvariantIsOriginal { get; set; } - - [ForeignKey("AbvariantTestId")] - [InverseProperty("OmAbvariantData")] - public virtual OmAbtest AbvariantTest { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ABVariantData")] +[Index("AbvariantTestId", "AbvariantGuid", Name = "IX_OM_ABVariantData_ABVariantTestID_ABVariantGUID")] +public class OmAbvariantDatum +{ + [Key] + [Column("ABVariantID")] + public int AbvariantId { get; set; } + + [Column("ABVariantDisplayName")] + [StringLength(100)] + public string AbvariantDisplayName { get; set; } = null!; + + [Column("ABVariantGUID")] + public Guid AbvariantGuid { get; set; } + + [Column("ABVariantTestID")] + public int AbvariantTestId { get; set; } + + [Column("ABVariantIsOriginal")] + public bool AbvariantIsOriginal { get; set; } + + [ForeignKey("AbvariantTestId")] + [InverseProperty("OmAbvariantData")] + public virtual OmAbtest AbvariantTest { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmAccount.cs b/Migration.Toolkit.KX12/Models/OmAccount.cs index 128ac1b8..a5a3cf2a 100644 --- a/Migration.Toolkit.KX12/Models/OmAccount.cs +++ b/Migration.Toolkit.KX12/Models/OmAccount.cs @@ -1,114 +1,113 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Account")] -[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] -[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] -[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] -[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] -[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] -[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] -[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] -public partial class OmAccount -{ - [Key] - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [ForeignKey("AccountCountryId")] - [InverseProperty("OmAccounts")] - public virtual CmsCountry? AccountCountry { get; set; } - - [ForeignKey("AccountOwnerUserId")] - [InverseProperty("OmAccounts")] - public virtual CmsUser? AccountOwnerUser { get; set; } - - [ForeignKey("AccountPrimaryContactId")] - [InverseProperty("OmAccountAccountPrimaryContacts")] - public virtual OmContact? AccountPrimaryContact { get; set; } - - [ForeignKey("AccountSecondaryContactId")] - [InverseProperty("OmAccountAccountSecondaryContacts")] - public virtual OmContact? AccountSecondaryContact { get; set; } - - [ForeignKey("AccountStateId")] - [InverseProperty("OmAccounts")] - public virtual CmsState? AccountState { get; set; } - - [ForeignKey("AccountStatusId")] - [InverseProperty("OmAccounts")] - public virtual OmAccountStatus? AccountStatus { get; set; } - - [ForeignKey("AccountSubsidiaryOfId")] - [InverseProperty("InverseAccountSubsidiaryOf")] - public virtual OmAccount? AccountSubsidiaryOf { get; set; } - - [InverseProperty("AccountSubsidiaryOf")] - public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); - - [InverseProperty("Account")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_Account")] +[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] +[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] +[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] +[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] +[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] +[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] +[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] +public class OmAccount +{ + [Key] + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [ForeignKey("AccountCountryId")] + [InverseProperty("OmAccounts")] + public virtual CmsCountry? AccountCountry { get; set; } + + [ForeignKey("AccountOwnerUserId")] + [InverseProperty("OmAccounts")] + public virtual CmsUser? AccountOwnerUser { get; set; } + + [ForeignKey("AccountPrimaryContactId")] + [InverseProperty("OmAccountAccountPrimaryContacts")] + public virtual OmContact? AccountPrimaryContact { get; set; } + + [ForeignKey("AccountSecondaryContactId")] + [InverseProperty("OmAccountAccountSecondaryContacts")] + public virtual OmContact? AccountSecondaryContact { get; set; } + + [ForeignKey("AccountStateId")] + [InverseProperty("OmAccounts")] + public virtual CmsState? AccountState { get; set; } + + [ForeignKey("AccountStatusId")] + [InverseProperty("OmAccounts")] + public virtual OmAccountStatus? AccountStatus { get; set; } + + [ForeignKey("AccountSubsidiaryOfId")] + [InverseProperty("InverseAccountSubsidiaryOf")] + public virtual OmAccount? AccountSubsidiaryOf { get; set; } + + [InverseProperty("AccountSubsidiaryOf")] + public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); + + [InverseProperty("Account")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmAccountContact.cs b/Migration.Toolkit.KX12/Models/OmAccountContact.cs index 9327c274..2352813c 100644 --- a/Migration.Toolkit.KX12/Models/OmAccountContact.cs +++ b/Migration.Toolkit.KX12/Models/OmAccountContact.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_AccountContact")] -[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] -[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] -[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] -public partial class OmAccountContact -{ - [Key] - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("AccountId")] - [InverseProperty("OmAccountContacts")] - public virtual OmAccount Account { get; set; } = null!; - - [ForeignKey("ContactId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("ContactRoleId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContactRole? ContactRole { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_AccountContact")] +[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] +[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] +[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] +public class OmAccountContact +{ + [Key] + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("AccountId")] + [InverseProperty("OmAccountContacts")] + public virtual OmAccount Account { get; set; } = null!; + + [ForeignKey("ContactId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("ContactRoleId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContactRole? ContactRole { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/OmAccountStatus.cs b/Migration.Toolkit.KX12/Models/OmAccountStatus.cs index d3487abe..14a7a6c2 100644 --- a/Migration.Toolkit.KX12/Models/OmAccountStatus.cs +++ b/Migration.Toolkit.KX12/Models/OmAccountStatus.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_AccountStatus")] -public partial class OmAccountStatus -{ - [Key] - [Column("AccountStatusID")] - public int AccountStatusId { get; set; } - - [StringLength(200)] - public string AccountStatusName { get; set; } = null!; - - [StringLength(200)] - public string AccountStatusDisplayName { get; set; } = null!; - - public string? AccountStatusDescription { get; set; } - - [InverseProperty("AccountStatus")] - public virtual ICollection OmAccounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_AccountStatus")] +public class OmAccountStatus +{ + [Key] + [Column("AccountStatusID")] + public int AccountStatusId { get; set; } + + [StringLength(200)] + public string AccountStatusName { get; set; } = null!; + + [StringLength(200)] + public string AccountStatusDisplayName { get; set; } = null!; + + public string? AccountStatusDescription { get; set; } + + [InverseProperty("AccountStatus")] + public virtual ICollection OmAccounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmActivity.cs b/Migration.Toolkit.KX12/Models/OmActivity.cs index 036c33a9..2bc32eee 100644 --- a/Migration.Toolkit.KX12/Models/OmActivity.cs +++ b/Migration.Toolkit.KX12/Models/OmActivity.cs @@ -1,79 +1,78 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Activity")] -[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] -[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] -[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] -[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] -[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] -public partial class OmActivity -{ - [Key] - [Column("ActivityID")] - public int ActivityId { get; set; } - - [Column("ActivityContactID")] - public int ActivityContactId { get; set; } - - public DateTime? ActivityCreated { get; set; } - - [StringLength(250)] - public string ActivityType { get; set; } = null!; - - [Column("ActivityItemID")] - public int? ActivityItemId { get; set; } - - [Column("ActivityItemDetailID")] - public int? ActivityItemDetailId { get; set; } - - [StringLength(250)] - public string? ActivityValue { get; set; } - - [Column("ActivityURL")] - public string? ActivityUrl { get; set; } - - [StringLength(250)] - public string? ActivityTitle { get; set; } - - [Column("ActivitySiteID")] - public int ActivitySiteId { get; set; } - - public string? ActivityComment { get; set; } - - [StringLength(200)] - public string? ActivityCampaign { get; set; } - - [Column("ActivityURLReferrer")] - public string? ActivityUrlreferrer { get; set; } - - [StringLength(10)] - public string? ActivityCulture { get; set; } - - [Column("ActivityNodeID")] - public int? ActivityNodeId { get; set; } - - [Column("ActivityUTMSource")] - [StringLength(200)] - public string? ActivityUtmsource { get; set; } - - [Column("ActivityABVariantName")] - [StringLength(200)] - public string? ActivityAbvariantName { get; set; } - - [Column("ActivityMVTCombinationName")] - [StringLength(200)] - public string? ActivityMvtcombinationName { get; set; } - - [Column("ActivityURLHash")] - public long ActivityUrlhash { get; set; } - - [Column("ActivityUTMContent")] - [StringLength(200)] - public string? ActivityUtmcontent { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_Activity")] +[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] +[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] +[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] +[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] +[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] +public class OmActivity +{ + [Key] + [Column("ActivityID")] + public int ActivityId { get; set; } + + [Column("ActivityContactID")] + public int ActivityContactId { get; set; } + + public DateTime? ActivityCreated { get; set; } + + [StringLength(250)] + public string ActivityType { get; set; } = null!; + + [Column("ActivityItemID")] + public int? ActivityItemId { get; set; } + + [Column("ActivityItemDetailID")] + public int? ActivityItemDetailId { get; set; } + + [StringLength(250)] + public string? ActivityValue { get; set; } + + [Column("ActivityURL")] + public string? ActivityUrl { get; set; } + + [StringLength(250)] + public string? ActivityTitle { get; set; } + + [Column("ActivitySiteID")] + public int ActivitySiteId { get; set; } + + public string? ActivityComment { get; set; } + + [StringLength(200)] + public string? ActivityCampaign { get; set; } + + [Column("ActivityURLReferrer")] + public string? ActivityUrlreferrer { get; set; } + + [StringLength(10)] + public string? ActivityCulture { get; set; } + + [Column("ActivityNodeID")] + public int? ActivityNodeId { get; set; } + + [Column("ActivityUTMSource")] + [StringLength(200)] + public string? ActivityUtmsource { get; set; } + + [Column("ActivityABVariantName")] + [StringLength(200)] + public string? ActivityAbvariantName { get; set; } + + [Column("ActivityMVTCombinationName")] + [StringLength(200)] + public string? ActivityMvtcombinationName { get; set; } + + [Column("ActivityURLHash")] + public long ActivityUrlhash { get; set; } + + [Column("ActivityUTMContent")] + [StringLength(200)] + public string? ActivityUtmcontent { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs index 691d7f26..6b42c68e 100644 --- a/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs +++ b/Migration.Toolkit.KX12/Models/OmActivityRecalculationQueue.cs @@ -1,18 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ActivityRecalculationQueue")] -public partial class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ActivityRecalculationQueue")] +public class OmActivityRecalculationQueue +{ + [Key] + [Column("ActivityRecalculationQueueID")] + public int ActivityRecalculationQueueId { get; set; } + + [Column("ActivityRecalculationQueueActivityID")] + public int ActivityRecalculationQueueActivityId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/OmActivityType.cs b/Migration.Toolkit.KX12/Models/OmActivityType.cs index 21beb153..1e953ff5 100644 --- a/Migration.Toolkit.KX12/Models/OmActivityType.cs +++ b/Migration.Toolkit.KX12/Models/OmActivityType.cs @@ -1,40 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ActivityType")] -public partial class OmActivityType -{ - [Key] - [Column("ActivityTypeID")] - public int ActivityTypeId { get; set; } - - [StringLength(250)] - public string ActivityTypeDisplayName { get; set; } = null!; - - [StringLength(250)] - public string ActivityTypeName { get; set; } = null!; - - public bool? ActivityTypeEnabled { get; set; } - - public bool? ActivityTypeIsCustom { get; set; } - - public string? ActivityTypeDescription { get; set; } - - public bool? ActivityTypeManualCreationAllowed { get; set; } - - [StringLength(200)] - public string? ActivityTypeMainFormControl { get; set; } - - [StringLength(200)] - public string? ActivityTypeDetailFormControl { get; set; } - - public bool ActivityTypeIsHiddenInContentOnly { get; set; } - - [StringLength(7)] - public string? ActivityTypeColor { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ActivityType")] +public class OmActivityType +{ + [Key] + [Column("ActivityTypeID")] + public int ActivityTypeId { get; set; } + + [StringLength(250)] + public string ActivityTypeDisplayName { get; set; } = null!; + + [StringLength(250)] + public string ActivityTypeName { get; set; } = null!; + + public bool? ActivityTypeEnabled { get; set; } + + public bool? ActivityTypeIsCustom { get; set; } + + public string? ActivityTypeDescription { get; set; } + + public bool? ActivityTypeManualCreationAllowed { get; set; } + + [StringLength(200)] + public string? ActivityTypeMainFormControl { get; set; } + + [StringLength(200)] + public string? ActivityTypeDetailFormControl { get; set; } + + public bool ActivityTypeIsHiddenInContentOnly { get; set; } + + [StringLength(7)] + public string? ActivityTypeColor { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/OmContact.cs b/Migration.Toolkit.KX12/Models/OmContact.cs index 5e3973a9..7d3aa539 100644 --- a/Migration.Toolkit.KX12/Models/OmContact.cs +++ b/Migration.Toolkit.KX12/Models/OmContact.cs @@ -1,141 +1,140 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Contact")] -[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] -[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] -[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] -[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] -[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] -[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] -[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] -[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] -public partial class OmContact -{ - [Key] - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactSalesForceLeadID")] - [StringLength(18)] - public string? ContactSalesForceLeadId { get; set; } - - public bool? ContactSalesForceLeadReplicationDisabled { get; set; } - - public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } - - public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } - - public bool? ContactSalesForceLeadReplicationRequired { get; set; } - - [Column("ContactPersonaID")] - public int? ContactPersonaId { get; set; } - - [InverseProperty("ConsentAgreementContact")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [ForeignKey("ContactCountryId")] - [InverseProperty("OmContacts")] - public virtual CmsCountry? ContactCountry { get; set; } - - [ForeignKey("ContactOwnerUserId")] - [InverseProperty("OmContacts")] - public virtual CmsUser? ContactOwnerUser { get; set; } - - [ForeignKey("ContactStateId")] - [InverseProperty("OmContacts")] - public virtual CmsState? ContactState { get; set; } - - [ForeignKey("ContactStatusId")] - [InverseProperty("OmContacts")] - public virtual OmContactStatus? ContactStatus { get; set; } - - [InverseProperty("AccountPrimaryContact")] - public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); - - [InverseProperty("AccountSecondaryContact")] - public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmMemberships { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [InverseProperty("VisitorToContactContact")] - public virtual ICollection OmVisitorToContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_Contact")] +[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] +[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] +[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] +[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] +[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] +[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] +[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] +[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] +public class OmContact +{ + [Key] + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactSalesForceLeadID")] + [StringLength(18)] + public string? ContactSalesForceLeadId { get; set; } + + public bool? ContactSalesForceLeadReplicationDisabled { get; set; } + + public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } + + public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } + + public bool? ContactSalesForceLeadReplicationRequired { get; set; } + + [Column("ContactPersonaID")] + public int? ContactPersonaId { get; set; } + + [InverseProperty("ConsentAgreementContact")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [ForeignKey("ContactCountryId")] + [InverseProperty("OmContacts")] + public virtual CmsCountry? ContactCountry { get; set; } + + [ForeignKey("ContactOwnerUserId")] + [InverseProperty("OmContacts")] + public virtual CmsUser? ContactOwnerUser { get; set; } + + [ForeignKey("ContactStateId")] + [InverseProperty("OmContacts")] + public virtual CmsState? ContactState { get; set; } + + [ForeignKey("ContactStatusId")] + [InverseProperty("OmContacts")] + public virtual OmContactStatus? ContactStatus { get; set; } + + [InverseProperty("AccountPrimaryContact")] + public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); + + [InverseProperty("AccountSecondaryContact")] + public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmMemberships { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [InverseProperty("VisitorToContactContact")] + public virtual ICollection OmVisitorToContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs index a3e5f9bc..c0218ee4 100644 --- a/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs +++ b/Migration.Toolkit.KX12/Models/OmContactChangeRecalculationQueue.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactChangeRecalculationQueue")] -public partial class OmContactChangeRecalculationQueue -{ - [Key] - [Column("ContactChangeRecalculationQueueID")] - public int ContactChangeRecalculationQueueId { get; set; } - - [Column("ContactChangeRecalculationQueueContactID")] - public int ContactChangeRecalculationQueueContactId { get; set; } - - public string? ContactChangeRecalculationQueueChangedColumns { get; set; } - - public bool ContactChangeRecalculationQueueContactIsNew { get; set; } - - public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ContactChangeRecalculationQueue")] +public class OmContactChangeRecalculationQueue +{ + [Key] + [Column("ContactChangeRecalculationQueueID")] + public int ContactChangeRecalculationQueueId { get; set; } + + [Column("ContactChangeRecalculationQueueContactID")] + public int ContactChangeRecalculationQueueContactId { get; set; } + + public string? ContactChangeRecalculationQueueChangedColumns { get; set; } + + public bool ContactChangeRecalculationQueueContactIsNew { get; set; } + + public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/OmContactGroup.cs b/Migration.Toolkit.KX12/Models/OmContactGroup.cs index 665f9dd6..091710c2 100644 --- a/Migration.Toolkit.KX12/Models/OmContactGroup.cs +++ b/Migration.Toolkit.KX12/Models/OmContactGroup.cs @@ -1,40 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactGroup")] -public partial class OmContactGroup -{ - [Key] - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - public string? ContactGroupDescription { get; set; } - - public string? ContactGroupDynamicCondition { get; set; } - - public bool? ContactGroupEnabled { get; set; } - - public DateTime? ContactGroupLastModified { get; set; } - - [Column("ContactGroupGUID")] - public Guid? ContactGroupGuid { get; set; } - - public int? ContactGroupStatus { get; set; } - - [InverseProperty("ContactGroup")] - public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); - - [InverseProperty("ContactGroupMemberContactGroup")] - public virtual ICollection OmContactGroupMembers { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ContactGroup")] +public class OmContactGroup +{ + [Key] + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + public string? ContactGroupDescription { get; set; } + + public string? ContactGroupDynamicCondition { get; set; } + + public bool? ContactGroupEnabled { get; set; } + + public DateTime? ContactGroupLastModified { get; set; } + + [Column("ContactGroupGUID")] + public Guid? ContactGroupGuid { get; set; } + + public int? ContactGroupStatus { get; set; } + + [InverseProperty("ContactGroup")] + public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); + + [InverseProperty("ContactGroupMemberContactGroup")] + public virtual ICollection OmContactGroupMembers { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs b/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs index 625e3468..3cbd38cc 100644 --- a/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs +++ b/Migration.Toolkit.KX12/Models/OmContactGroupMember.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactGroupMember")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] -[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] -public partial class OmContactGroupMember -{ - [Key] - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public int ContactGroupMemberType { get; set; } - - [Column("ContactGroupMemberRelatedID")] - public int ContactGroupMemberRelatedId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [ForeignKey("ContactGroupMemberContactGroupId")] - [InverseProperty("OmContactGroupMembers")] - public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ContactGroupMember")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] +[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] +public class OmContactGroupMember +{ + [Key] + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public int ContactGroupMemberType { get; set; } + + [Column("ContactGroupMemberRelatedID")] + public int ContactGroupMemberRelatedId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [ForeignKey("ContactGroupMemberContactGroupId")] + [InverseProperty("OmContactGroupMembers")] + public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmContactRole.cs b/Migration.Toolkit.KX12/Models/OmContactRole.cs index 3cf30f61..c375bdd1 100644 --- a/Migration.Toolkit.KX12/Models/OmContactRole.cs +++ b/Migration.Toolkit.KX12/Models/OmContactRole.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactRole")] -public partial class OmContactRole -{ - [Key] - [Column("ContactRoleID")] - public int ContactRoleId { get; set; } - - [StringLength(200)] - public string ContactRoleName { get; set; } = null!; - - [StringLength(200)] - public string ContactRoleDisplayName { get; set; } = null!; - - public string? ContactRoleDescription { get; set; } - - [InverseProperty("ContactRole")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ContactRole")] +public class OmContactRole +{ + [Key] + [Column("ContactRoleID")] + public int ContactRoleId { get; set; } + + [StringLength(200)] + public string ContactRoleName { get; set; } = null!; + + [StringLength(200)] + public string ContactRoleDisplayName { get; set; } = null!; + + public string? ContactRoleDescription { get; set; } + + [InverseProperty("ContactRole")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmContactStatus.cs b/Migration.Toolkit.KX12/Models/OmContactStatus.cs index af7cb884..cddd6ee9 100644 --- a/Migration.Toolkit.KX12/Models/OmContactStatus.cs +++ b/Migration.Toolkit.KX12/Models/OmContactStatus.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ContactStatus")] -public partial class OmContactStatus -{ - [Key] - [Column("ContactStatusID")] - public int ContactStatusId { get; set; } - - [StringLength(200)] - public string ContactStatusName { get; set; } = null!; - - [StringLength(200)] - public string ContactStatusDisplayName { get; set; } = null!; - - public string? ContactStatusDescription { get; set; } - - [InverseProperty("ContactStatus")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ContactStatus")] +public class OmContactStatus +{ + [Key] + [Column("ContactStatusID")] + public int ContactStatusId { get; set; } + + [StringLength(200)] + public string ContactStatusName { get; set; } = null!; + + [StringLength(200)] + public string ContactStatusDisplayName { get; set; } = null!; + + public string? ContactStatusDescription { get; set; } + + [InverseProperty("ContactStatus")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmMembership.cs b/Migration.Toolkit.KX12/Models/OmMembership.cs index 66361156..102abce9 100644 --- a/Migration.Toolkit.KX12/Models/OmMembership.cs +++ b/Migration.Toolkit.KX12/Models/OmMembership.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Membership")] -[Index("ContactId", Name = "IX_OM_Membership_ContactID")] -[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] -public partial class OmMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("RelatedID")] - public int RelatedId { get; set; } - - public int MemberType { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - public DateTime MembershipCreated { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmMemberships")] - public virtual OmContact Contact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_Membership")] +[Index("ContactId", Name = "IX_OM_Membership_ContactID")] +[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] +public class OmMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("RelatedID")] + public int RelatedId { get; set; } + + public int MemberType { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + public DateTime MembershipCreated { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmMemberships")] + public virtual OmContact Contact { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmMvtcombination.cs b/Migration.Toolkit.KX12/Models/OmMvtcombination.cs index 8972e017..c978ae98 100644 --- a/Migration.Toolkit.KX12/Models/OmMvtcombination.cs +++ b/Migration.Toolkit.KX12/Models/OmMvtcombination.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_MVTCombination")] -[Index("MvtcombinationPageTemplateId", Name = "IX_OM_MVTCombination_MVTCombinationPageTemplateID")] -public partial class OmMvtcombination -{ - [Key] - [Column("MVTCombinationID")] - public int MvtcombinationId { get; set; } - - [Column("MVTCombinationName")] - [StringLength(200)] - public string MvtcombinationName { get; set; } = null!; - - [Column("MVTCombinationCustomName")] - [StringLength(200)] - public string? MvtcombinationCustomName { get; set; } - - [Column("MVTCombinationPageTemplateID")] - public int MvtcombinationPageTemplateId { get; set; } - - [Column("MVTCombinationEnabled")] - public bool MvtcombinationEnabled { get; set; } - - [Column("MVTCombinationGUID")] - public Guid MvtcombinationGuid { get; set; } - - [Column("MVTCombinationLastModified")] - public DateTime MvtcombinationLastModified { get; set; } - - [Column("MVTCombinationIsDefault")] - public bool? MvtcombinationIsDefault { get; set; } - - [Column("MVTCombinationConversions")] - public int? MvtcombinationConversions { get; set; } - - [Column("MVTCombinationDocumentID")] - public int? MvtcombinationDocumentId { get; set; } - - [ForeignKey("MvtcombinationId")] - [InverseProperty("Mvtcombinations")] - public virtual ICollection Mvtvariants { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_MVTCombination")] +[Index("MvtcombinationPageTemplateId", Name = "IX_OM_MVTCombination_MVTCombinationPageTemplateID")] +public class OmMvtcombination +{ + [Key] + [Column("MVTCombinationID")] + public int MvtcombinationId { get; set; } + + [Column("MVTCombinationName")] + [StringLength(200)] + public string MvtcombinationName { get; set; } = null!; + + [Column("MVTCombinationCustomName")] + [StringLength(200)] + public string? MvtcombinationCustomName { get; set; } + + [Column("MVTCombinationPageTemplateID")] + public int MvtcombinationPageTemplateId { get; set; } + + [Column("MVTCombinationEnabled")] + public bool MvtcombinationEnabled { get; set; } + + [Column("MVTCombinationGUID")] + public Guid MvtcombinationGuid { get; set; } + + [Column("MVTCombinationLastModified")] + public DateTime MvtcombinationLastModified { get; set; } + + [Column("MVTCombinationIsDefault")] + public bool? MvtcombinationIsDefault { get; set; } + + [Column("MVTCombinationConversions")] + public int? MvtcombinationConversions { get; set; } + + [Column("MVTCombinationDocumentID")] + public int? MvtcombinationDocumentId { get; set; } + + [ForeignKey("MvtcombinationId")] + [InverseProperty("Mvtcombinations")] + public virtual ICollection Mvtvariants { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmMvtest.cs b/Migration.Toolkit.KX12/Models/OmMvtest.cs index c5d73e97..ff7a874d 100644 --- a/Migration.Toolkit.KX12/Models/OmMvtest.cs +++ b/Migration.Toolkit.KX12/Models/OmMvtest.cs @@ -1,67 +1,66 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_MVTest")] -[Index("MvtestSiteId", Name = "IX_OM_MVTest_MVTestSiteID")] -public partial class OmMvtest -{ - [Key] - [Column("MVTestID")] - public int MvtestId { get; set; } - - [Column("MVTestName")] - [StringLength(50)] - public string MvtestName { get; set; } = null!; - - [Column("MVTestDescription")] - public string? MvtestDescription { get; set; } - - [Column("MVTestPage")] - [StringLength(450)] - public string MvtestPage { get; set; } = null!; - - [Column("MVTestSiteID")] - public int MvtestSiteId { get; set; } - - [Column("MVTestCulture")] - [StringLength(50)] - public string? MvtestCulture { get; set; } - - [Column("MVTestOpenFrom")] - public DateTime? MvtestOpenFrom { get; set; } - - [Column("MVTestOpenTo")] - public DateTime? MvtestOpenTo { get; set; } - - [Column("MVTestMaxConversions")] - public int? MvtestMaxConversions { get; set; } - - [Column("MVTestConversions")] - public int? MvtestConversions { get; set; } - - [Column("MVTestTargetConversionType")] - [StringLength(100)] - public string? MvtestTargetConversionType { get; set; } - - [Column("MVTestGUID")] - public Guid MvtestGuid { get; set; } - - [Column("MVTestLastModified")] - public DateTime MvtestLastModified { get; set; } - - [Column("MVTestEnabled")] - public bool MvtestEnabled { get; set; } - - [Column("MVTestDisplayName")] - [StringLength(100)] - public string MvtestDisplayName { get; set; } = null!; - - [ForeignKey("MvtestSiteId")] - [InverseProperty("OmMvtests")] - public virtual CmsSite MvtestSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_MVTest")] +[Index("MvtestSiteId", Name = "IX_OM_MVTest_MVTestSiteID")] +public class OmMvtest +{ + [Key] + [Column("MVTestID")] + public int MvtestId { get; set; } + + [Column("MVTestName")] + [StringLength(50)] + public string MvtestName { get; set; } = null!; + + [Column("MVTestDescription")] + public string? MvtestDescription { get; set; } + + [Column("MVTestPage")] + [StringLength(450)] + public string MvtestPage { get; set; } = null!; + + [Column("MVTestSiteID")] + public int MvtestSiteId { get; set; } + + [Column("MVTestCulture")] + [StringLength(50)] + public string? MvtestCulture { get; set; } + + [Column("MVTestOpenFrom")] + public DateTime? MvtestOpenFrom { get; set; } + + [Column("MVTestOpenTo")] + public DateTime? MvtestOpenTo { get; set; } + + [Column("MVTestMaxConversions")] + public int? MvtestMaxConversions { get; set; } + + [Column("MVTestConversions")] + public int? MvtestConversions { get; set; } + + [Column("MVTestTargetConversionType")] + [StringLength(100)] + public string? MvtestTargetConversionType { get; set; } + + [Column("MVTestGUID")] + public Guid MvtestGuid { get; set; } + + [Column("MVTestLastModified")] + public DateTime MvtestLastModified { get; set; } + + [Column("MVTestEnabled")] + public bool MvtestEnabled { get; set; } + + [Column("MVTestDisplayName")] + [StringLength(100)] + public string MvtestDisplayName { get; set; } = null!; + + [ForeignKey("MvtestSiteId")] + [InverseProperty("OmMvtests")] + public virtual CmsSite MvtestSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmMvtvariant.cs b/Migration.Toolkit.KX12/Models/OmMvtvariant.cs index 35b7f868..34f13480 100644 --- a/Migration.Toolkit.KX12/Models/OmMvtvariant.cs +++ b/Migration.Toolkit.KX12/Models/OmMvtvariant.cs @@ -1,61 +1,60 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_MVTVariant")] -[Index("MvtvariantPageTemplateId", Name = "IX_OM_MVTVariant_MVTVariantPageTemplateID")] -public partial class OmMvtvariant -{ - [Key] - [Column("MVTVariantID")] - public int MvtvariantId { get; set; } - - [Column("MVTVariantName")] - [StringLength(100)] - public string MvtvariantName { get; set; } = null!; - - [Column("MVTVariantDisplayName")] - [StringLength(200)] - public string MvtvariantDisplayName { get; set; } = null!; - - [Column("MVTVariantInstanceGUID")] - public Guid? MvtvariantInstanceGuid { get; set; } - - [Column("MVTVariantZoneID")] - [StringLength(200)] - public string? MvtvariantZoneId { get; set; } - - [Column("MVTVariantPageTemplateID")] - public int MvtvariantPageTemplateId { get; set; } - - [Required] - [Column("MVTVariantEnabled")] - public bool? MvtvariantEnabled { get; set; } - - [Column("MVTVariantWebParts")] - public string? MvtvariantWebParts { get; set; } - - [Column("MVTVariantGUID")] - public Guid MvtvariantGuid { get; set; } - - [Column("MVTVariantLastModified")] - public DateTime MvtvariantLastModified { get; set; } - - [Column("MVTVariantDescription")] - public string? MvtvariantDescription { get; set; } - - [Column("MVTVariantDocumentID")] - public int? MvtvariantDocumentId { get; set; } - - [ForeignKey("MvtvariantPageTemplateId")] - [InverseProperty("OmMvtvariants")] - public virtual CmsPageTemplate MvtvariantPageTemplate { get; set; } = null!; - - [ForeignKey("MvtvariantId")] - [InverseProperty("Mvtvariants")] - public virtual ICollection Mvtcombinations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_MVTVariant")] +[Index("MvtvariantPageTemplateId", Name = "IX_OM_MVTVariant_MVTVariantPageTemplateID")] +public class OmMvtvariant +{ + [Key] + [Column("MVTVariantID")] + public int MvtvariantId { get; set; } + + [Column("MVTVariantName")] + [StringLength(100)] + public string MvtvariantName { get; set; } = null!; + + [Column("MVTVariantDisplayName")] + [StringLength(200)] + public string MvtvariantDisplayName { get; set; } = null!; + + [Column("MVTVariantInstanceGUID")] + public Guid? MvtvariantInstanceGuid { get; set; } + + [Column("MVTVariantZoneID")] + [StringLength(200)] + public string? MvtvariantZoneId { get; set; } + + [Column("MVTVariantPageTemplateID")] + public int MvtvariantPageTemplateId { get; set; } + + [Required] + [Column("MVTVariantEnabled")] + public bool? MvtvariantEnabled { get; set; } + + [Column("MVTVariantWebParts")] + public string? MvtvariantWebParts { get; set; } + + [Column("MVTVariantGUID")] + public Guid MvtvariantGuid { get; set; } + + [Column("MVTVariantLastModified")] + public DateTime MvtvariantLastModified { get; set; } + + [Column("MVTVariantDescription")] + public string? MvtvariantDescription { get; set; } + + [Column("MVTVariantDocumentID")] + public int? MvtvariantDocumentId { get; set; } + + [ForeignKey("MvtvariantPageTemplateId")] + [InverseProperty("OmMvtvariants")] + public virtual CmsPageTemplate MvtvariantPageTemplate { get; set; } = null!; + + [ForeignKey("MvtvariantId")] + [InverseProperty("Mvtvariants")] + public virtual ICollection Mvtcombinations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs b/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs index af3d08e8..1aac027d 100644 --- a/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs +++ b/Migration.Toolkit.KX12/Models/OmPersonalizationVariant.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_PersonalizationVariant")] -[Index("VariantPageTemplateId", Name = "IX_OM_PersonalizationVariant_VariantDocumentID")] -[Index("VariantDocumentId", Name = "IX_OM_PersonalizationVariant_VariantPageTemplateID")] -public partial class OmPersonalizationVariant -{ - [Key] - [Column("VariantID")] - public int VariantId { get; set; } - - [Required] - public bool? VariantEnabled { get; set; } - - [StringLength(200)] - public string VariantName { get; set; } = null!; - - [StringLength(200)] - public string VariantDisplayName { get; set; } = null!; - - [Column("VariantInstanceGUID")] - public Guid? VariantInstanceGuid { get; set; } - - [Column("VariantZoneID")] - [StringLength(200)] - public string? VariantZoneId { get; set; } - - [Column("VariantPageTemplateID")] - public int VariantPageTemplateId { get; set; } - - public string VariantWebParts { get; set; } = null!; - - public int? VariantPosition { get; set; } - - [Column("VariantGUID")] - public Guid VariantGuid { get; set; } - - public DateTime VariantLastModified { get; set; } - - public string? VariantDescription { get; set; } - - [Column("VariantDocumentID")] - public int? VariantDocumentId { get; set; } - - public string VariantDisplayCondition { get; set; } = null!; - - [ForeignKey("VariantDocumentId")] - [InverseProperty("OmPersonalizationVariants")] - public virtual CmsDocument? VariantDocument { get; set; } - - [ForeignKey("VariantPageTemplateId")] - [InverseProperty("OmPersonalizationVariants")] - public virtual CmsPageTemplate VariantPageTemplate { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_PersonalizationVariant")] +[Index("VariantPageTemplateId", Name = "IX_OM_PersonalizationVariant_VariantDocumentID")] +[Index("VariantDocumentId", Name = "IX_OM_PersonalizationVariant_VariantPageTemplateID")] +public class OmPersonalizationVariant +{ + [Key] + [Column("VariantID")] + public int VariantId { get; set; } + + [Required] + public bool? VariantEnabled { get; set; } + + [StringLength(200)] + public string VariantName { get; set; } = null!; + + [StringLength(200)] + public string VariantDisplayName { get; set; } = null!; + + [Column("VariantInstanceGUID")] + public Guid? VariantInstanceGuid { get; set; } + + [Column("VariantZoneID")] + [StringLength(200)] + public string? VariantZoneId { get; set; } + + [Column("VariantPageTemplateID")] + public int VariantPageTemplateId { get; set; } + + public string VariantWebParts { get; set; } = null!; + + public int? VariantPosition { get; set; } + + [Column("VariantGUID")] + public Guid VariantGuid { get; set; } + + public DateTime VariantLastModified { get; set; } + + public string? VariantDescription { get; set; } + + [Column("VariantDocumentID")] + public int? VariantDocumentId { get; set; } + + public string VariantDisplayCondition { get; set; } = null!; + + [ForeignKey("VariantDocumentId")] + [InverseProperty("OmPersonalizationVariants")] + public virtual CmsDocument? VariantDocument { get; set; } + + [ForeignKey("VariantPageTemplateId")] + [InverseProperty("OmPersonalizationVariants")] + public virtual CmsPageTemplate VariantPageTemplate { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmRule.cs b/Migration.Toolkit.KX12/Models/OmRule.cs index 3eddffad..508929c7 100644 --- a/Migration.Toolkit.KX12/Models/OmRule.cs +++ b/Migration.Toolkit.KX12/Models/OmRule.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Rule")] -[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] -public partial class OmRule -{ - [Key] - [Column("RuleID")] - public int RuleId { get; set; } - - [Column("RuleScoreID")] - public int RuleScoreId { get; set; } - - [StringLength(200)] - public string RuleDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RuleName { get; set; } = null!; - - public int RuleValue { get; set; } - - public bool? RuleIsRecurring { get; set; } - - public int? RuleMaxPoints { get; set; } - - public DateTime? RuleValidUntil { get; set; } - - [StringLength(50)] - public string? RuleValidity { get; set; } - - public int? RuleValidFor { get; set; } - - public int RuleType { get; set; } - - [StringLength(250)] - public string? RuleParameter { get; set; } - - public string RuleCondition { get; set; } = null!; - - public DateTime RuleLastModified { get; set; } - - [Column("RuleGUID")] - public Guid RuleGuid { get; set; } - - public bool RuleBelongsToPersona { get; set; } - - [InverseProperty("Rule")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [ForeignKey("RuleScoreId")] - [InverseProperty("OmRules")] - public virtual OmScore RuleScore { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_Rule")] +[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] +public class OmRule +{ + [Key] + [Column("RuleID")] + public int RuleId { get; set; } + + [Column("RuleScoreID")] + public int RuleScoreId { get; set; } + + [StringLength(200)] + public string RuleDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RuleName { get; set; } = null!; + + public int RuleValue { get; set; } + + public bool? RuleIsRecurring { get; set; } + + public int? RuleMaxPoints { get; set; } + + public DateTime? RuleValidUntil { get; set; } + + [StringLength(50)] + public string? RuleValidity { get; set; } + + public int? RuleValidFor { get; set; } + + public int RuleType { get; set; } + + [StringLength(250)] + public string? RuleParameter { get; set; } + + public string RuleCondition { get; set; } = null!; + + public DateTime RuleLastModified { get; set; } + + [Column("RuleGUID")] + public Guid RuleGuid { get; set; } + + public bool RuleBelongsToPersona { get; set; } + + [InverseProperty("Rule")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [ForeignKey("RuleScoreId")] + [InverseProperty("OmRules")] + public virtual OmScore RuleScore { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmScore.cs b/Migration.Toolkit.KX12/Models/OmScore.cs index 515c46c7..4652def2 100644 --- a/Migration.Toolkit.KX12/Models/OmScore.cs +++ b/Migration.Toolkit.KX12/Models/OmScore.cs @@ -1,48 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_Score")] -public partial class OmScore -{ - [Key] - [Column("ScoreID")] - public int ScoreId { get; set; } - - [StringLength(200)] - public string ScoreName { get; set; } = null!; - - [StringLength(200)] - public string ScoreDisplayName { get; set; } = null!; - - public string? ScoreDescription { get; set; } - - public bool ScoreEnabled { get; set; } - - public int? ScoreEmailAtScore { get; set; } - - [StringLength(998)] - public string? ScoreNotificationEmail { get; set; } - - public DateTime ScoreLastModified { get; set; } - - [Column("ScoreGUID")] - public Guid ScoreGuid { get; set; } - - public int? ScoreStatus { get; set; } - - [Column("ScoreScheduledTaskID")] - public int? ScoreScheduledTaskId { get; set; } - - public bool ScoreBelongsToPersona { get; set; } - - [InverseProperty("RuleScore")] - public virtual ICollection OmRules { get; set; } = new List(); - - [InverseProperty("Score")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_Score")] +public class OmScore +{ + [Key] + [Column("ScoreID")] + public int ScoreId { get; set; } + + [StringLength(200)] + public string ScoreName { get; set; } = null!; + + [StringLength(200)] + public string ScoreDisplayName { get; set; } = null!; + + public string? ScoreDescription { get; set; } + + public bool ScoreEnabled { get; set; } + + public int? ScoreEmailAtScore { get; set; } + + [StringLength(998)] + public string? ScoreNotificationEmail { get; set; } + + public DateTime ScoreLastModified { get; set; } + + [Column("ScoreGUID")] + public Guid ScoreGuid { get; set; } + + public int? ScoreStatus { get; set; } + + [Column("ScoreScheduledTaskID")] + public int? ScoreScheduledTaskId { get; set; } + + public bool ScoreBelongsToPersona { get; set; } + + [InverseProperty("RuleScore")] + public virtual ICollection OmRules { get; set; } = new List(); + + [InverseProperty("Score")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs b/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs index bbc72aa5..a38690c6 100644 --- a/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs +++ b/Migration.Toolkit.KX12/Models/OmScoreContactRule.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_ScoreContactRule")] -[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] -[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] -[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] -[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] -public partial class OmScoreContactRule -{ - [Column("ScoreID")] - public int ScoreId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("RuleID")] - public int RuleId { get; set; } - - public int Value { get; set; } - - public DateTime? Expiration { get; set; } - - [Key] - [Column("ScoreContactRuleID")] - public int ScoreContactRuleId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("RuleId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmRule Rule { get; set; } = null!; - - [ForeignKey("ScoreId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmScore Score { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_ScoreContactRule")] +[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] +[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] +[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] +[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] +public class OmScoreContactRule +{ + [Column("ScoreID")] + public int ScoreId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("RuleID")] + public int RuleId { get; set; } + + public int Value { get; set; } + + public DateTime? Expiration { get; set; } + + [Key] + [Column("ScoreContactRuleID")] + public int ScoreContactRuleId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("RuleId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmRule Rule { get; set; } = null!; + + [ForeignKey("ScoreId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmScore Score { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs b/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs index 897846a6..cf5422f5 100644 --- a/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs +++ b/Migration.Toolkit.KX12/Models/OmVisitorToContact.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("OM_VisitorToContact")] -[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] -[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] -public partial class OmVisitorToContact -{ - [Key] - [Column("VisitorToContactID")] - public int VisitorToContactId { get; set; } - - [Column("VisitorToContactVisitorGUID")] - public Guid VisitorToContactVisitorGuid { get; set; } - - [Column("VisitorToContactContactID")] - public int VisitorToContactContactId { get; set; } - - [ForeignKey("VisitorToContactContactId")] - [InverseProperty("OmVisitorToContacts")] - public virtual OmContact VisitorToContactContact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("OM_VisitorToContact")] +[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] +[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] +public class OmVisitorToContact +{ + [Key] + [Column("VisitorToContactID")] + public int VisitorToContactId { get; set; } + + [Column("VisitorToContactVisitorGUID")] + public Guid VisitorToContactVisitorGuid { get; set; } + + [Column("VisitorToContactContactID")] + public int VisitorToContactContactId { get; set; } + + [ForeignKey("VisitorToContactContactId")] + [InverseProperty("OmVisitorToContacts")] + public virtual OmContact VisitorToContactContact { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/PersonasPersona.cs b/Migration.Toolkit.KX12/Models/PersonasPersona.cs index 8ea4fb86..93727922 100644 --- a/Migration.Toolkit.KX12/Models/PersonasPersona.cs +++ b/Migration.Toolkit.KX12/Models/PersonasPersona.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Personas_Persona")] -[Index("PersonaScoreId", Name = "IX_Personas_Persona_PersonaScoreID")] -public partial class PersonasPersona -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [StringLength(200)] - public string PersonaDisplayName { get; set; } = null!; - - [StringLength(200)] - public string PersonaName { get; set; } = null!; - - public string? PersonaDescription { get; set; } - - [Required] - public bool? PersonaEnabled { get; set; } - - [Column("PersonaGUID")] - public Guid PersonaGuid { get; set; } - - [Column("PersonaScoreID")] - public int PersonaScoreId { get; set; } - - [Column("PersonaPictureMetafileGUID")] - public Guid? PersonaPictureMetafileGuid { get; set; } - - public int PersonaPointsThreshold { get; set; } - - [InverseProperty("PersonaContactHistoryPersona")] - public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Personas_Persona")] +[Index("PersonaScoreId", Name = "IX_Personas_Persona_PersonaScoreID")] +public class PersonasPersona +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [StringLength(200)] + public string PersonaDisplayName { get; set; } = null!; + + [StringLength(200)] + public string PersonaName { get; set; } = null!; + + public string? PersonaDescription { get; set; } + + [Required] + public bool? PersonaEnabled { get; set; } + + [Column("PersonaGUID")] + public Guid PersonaGuid { get; set; } + + [Column("PersonaScoreID")] + public int PersonaScoreId { get; set; } + + [Column("PersonaPictureMetafileGUID")] + public Guid? PersonaPictureMetafileGuid { get; set; } + + public int PersonaPointsThreshold { get; set; } + + [InverseProperty("PersonaContactHistoryPersona")] + public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs index 8860cf4b..2217d947 100644 --- a/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs +++ b/Migration.Toolkit.KX12/Models/PersonasPersonaContactHistory.cs @@ -1,28 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Personas_PersonaContactHistory")] -[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] -public partial class PersonasPersonaContactHistory -{ - [Key] - [Column("PersonaContactHistoryID")] - public int PersonaContactHistoryId { get; set; } - - [Column("PersonaContactHistoryPersonaID")] - public int? PersonaContactHistoryPersonaId { get; set; } - - [Column(TypeName = "date")] - public DateTime PersonaContactHistoryDate { get; set; } - - public int PersonaContactHistoryContacts { get; set; } - - [ForeignKey("PersonaContactHistoryPersonaId")] - [InverseProperty("PersonasPersonaContactHistories")] - public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Personas_PersonaContactHistory")] +[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] +public class PersonasPersonaContactHistory +{ + [Key] + [Column("PersonaContactHistoryID")] + public int PersonaContactHistoryId { get; set; } + + [Column("PersonaContactHistoryPersonaID")] + public int? PersonaContactHistoryPersonaId { get; set; } + + [Column(TypeName = "date")] + public DateTime PersonaContactHistoryDate { get; set; } + + public int PersonaContactHistoryContacts { get; set; } + + [ForeignKey("PersonaContactHistoryPersonaId")] + [InverseProperty("PersonasPersonaContactHistories")] + public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs b/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs index 438e9d92..9cda840c 100644 --- a/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs +++ b/Migration.Toolkit.KX12/Models/PersonasPersonaNode.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[PrimaryKey("PersonaId", "NodeId")] -[Table("Personas_PersonaNode")] -[Index("NodeId", Name = "IX_Personas_PersonaNode_NodeID")] -[Index("PersonaId", Name = "IX_Personas_PersonaNode_PersonaID")] -public partial class PersonasPersonaNode -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [ForeignKey("NodeId")] - [InverseProperty("PersonasPersonaNodes")] - public virtual CmsTree Node { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[PrimaryKey("PersonaId", "NodeId")] +[Table("Personas_PersonaNode")] +[Index("NodeId", Name = "IX_Personas_PersonaNode_NodeID")] +[Index("PersonaId", Name = "IX_Personas_PersonaNode_PersonaID")] +public class PersonasPersonaNode +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [ForeignKey("NodeId")] + [InverseProperty("PersonasPersonaNodes")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/PollsPoll.cs b/Migration.Toolkit.KX12/Models/PollsPoll.cs index 63ddea6c..6aeeba43 100644 --- a/Migration.Toolkit.KX12/Models/PollsPoll.cs +++ b/Migration.Toolkit.KX12/Models/PollsPoll.cs @@ -1,72 +1,71 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Polls_Poll")] -[Index("PollGroupId", Name = "IX_Polls_Poll_PollGroupID")] -[Index("PollSiteId", "PollCodeName", Name = "IX_Polls_Poll_PollSiteID_PollCodeName")] -public partial class PollsPoll -{ - [Key] - [Column("PollID")] - public int PollId { get; set; } - - [StringLength(200)] - public string PollCodeName { get; set; } = null!; - - [StringLength(200)] - public string PollDisplayName { get; set; } = null!; - - [StringLength(100)] - public string? PollTitle { get; set; } - - public DateTime? PollOpenFrom { get; set; } - - public DateTime? PollOpenTo { get; set; } - - public bool PollAllowMultipleAnswers { get; set; } - - [StringLength(450)] - public string PollQuestion { get; set; } = null!; - - public int PollAccess { get; set; } - - [StringLength(450)] - public string? PollResponseMessage { get; set; } - - [Column("PollGUID")] - public Guid PollGuid { get; set; } - - public DateTime PollLastModified { get; set; } - - [Column("PollGroupID")] - public int? PollGroupId { get; set; } - - [Column("PollSiteID")] - public int? PollSiteId { get; set; } - - public bool? PollLogActivity { get; set; } - - [ForeignKey("PollGroupId")] - [InverseProperty("PollsPolls")] - public virtual CommunityGroup? PollGroup { get; set; } - - [ForeignKey("PollSiteId")] - [InverseProperty("PollsPolls")] - public virtual CmsSite? PollSite { get; set; } - - [InverseProperty("AnswerPoll")] - public virtual ICollection PollsPollAnswers { get; set; } = new List(); - - [ForeignKey("PollId")] - [InverseProperty("Polls")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("PollId")] - [InverseProperty("Polls")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Polls_Poll")] +[Index("PollGroupId", Name = "IX_Polls_Poll_PollGroupID")] +[Index("PollSiteId", "PollCodeName", Name = "IX_Polls_Poll_PollSiteID_PollCodeName")] +public class PollsPoll +{ + [Key] + [Column("PollID")] + public int PollId { get; set; } + + [StringLength(200)] + public string PollCodeName { get; set; } = null!; + + [StringLength(200)] + public string PollDisplayName { get; set; } = null!; + + [StringLength(100)] + public string? PollTitle { get; set; } + + public DateTime? PollOpenFrom { get; set; } + + public DateTime? PollOpenTo { get; set; } + + public bool PollAllowMultipleAnswers { get; set; } + + [StringLength(450)] + public string PollQuestion { get; set; } = null!; + + public int PollAccess { get; set; } + + [StringLength(450)] + public string? PollResponseMessage { get; set; } + + [Column("PollGUID")] + public Guid PollGuid { get; set; } + + public DateTime PollLastModified { get; set; } + + [Column("PollGroupID")] + public int? PollGroupId { get; set; } + + [Column("PollSiteID")] + public int? PollSiteId { get; set; } + + public bool? PollLogActivity { get; set; } + + [ForeignKey("PollGroupId")] + [InverseProperty("PollsPolls")] + public virtual CommunityGroup? PollGroup { get; set; } + + [ForeignKey("PollSiteId")] + [InverseProperty("PollsPolls")] + public virtual CmsSite? PollSite { get; set; } + + [InverseProperty("AnswerPoll")] + public virtual ICollection PollsPollAnswers { get; set; } = new List(); + + [ForeignKey("PollId")] + [InverseProperty("Polls")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("PollId")] + [InverseProperty("Polls")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs b/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs index 04b4a777..b0c38236 100644 --- a/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs +++ b/Migration.Toolkit.KX12/Models/PollsPollAnswer.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Polls_PollAnswer")] -[Index("AnswerPollId", Name = "IX_Polls_PollAnswer_AnswerPollID")] -public partial class PollsPollAnswer -{ - [Key] - [Column("AnswerID")] - public int AnswerId { get; set; } - - [StringLength(200)] - public string AnswerText { get; set; } = null!; - - public int? AnswerOrder { get; set; } - - public int? AnswerCount { get; set; } - - public bool? AnswerEnabled { get; set; } - - [Column("AnswerPollID")] - public int AnswerPollId { get; set; } - - [Column("AnswerGUID")] - public Guid AnswerGuid { get; set; } - - public DateTime AnswerLastModified { get; set; } - - [StringLength(100)] - public string? AnswerForm { get; set; } - - [StringLength(100)] - public string? AnswerAlternativeForm { get; set; } - - public bool? AnswerHideForm { get; set; } - - [ForeignKey("AnswerPollId")] - [InverseProperty("PollsPollAnswers")] - public virtual PollsPoll AnswerPoll { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Polls_PollAnswer")] +[Index("AnswerPollId", Name = "IX_Polls_PollAnswer_AnswerPollID")] +public class PollsPollAnswer +{ + [Key] + [Column("AnswerID")] + public int AnswerId { get; set; } + + [StringLength(200)] + public string AnswerText { get; set; } = null!; + + public int? AnswerOrder { get; set; } + + public int? AnswerCount { get; set; } + + public bool? AnswerEnabled { get; set; } + + [Column("AnswerPollID")] + public int AnswerPollId { get; set; } + + [Column("AnswerGUID")] + public Guid AnswerGuid { get; set; } + + public DateTime AnswerLastModified { get; set; } + + [StringLength(100)] + public string? AnswerForm { get; set; } + + [StringLength(100)] + public string? AnswerAlternativeForm { get; set; } + + public bool? AnswerHideForm { get; set; } + + [ForeignKey("AnswerPollId")] + [InverseProperty("PollsPollAnswers")] + public virtual PollsPoll AnswerPoll { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ReportingReport.cs b/Migration.Toolkit.KX12/Models/ReportingReport.cs index 541c35d2..7503a998 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReport.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReport.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_Report")] -[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] -[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] -[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] -public partial class ReportingReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [StringLength(200)] - public string ReportName { get; set; } = null!; - - [StringLength(440)] - public string ReportDisplayName { get; set; } = null!; - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - [Column("ReportCategoryID")] - public int ReportCategoryId { get; set; } - - public int ReportAccess { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - public DateTime ReportLastModified { get; set; } - - public bool? ReportEnableSubscription { get; set; } - - [StringLength(100)] - public string? ReportConnectionString { get; set; } - - [ForeignKey("ReportCategoryId")] - [InverseProperty("ReportingReports")] - public virtual ReportingReportCategory ReportCategory { get; set; } = null!; - - [InverseProperty("GraphReport")] - public virtual ICollection ReportingReportGraphs { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionReport")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("TableReport")] - public virtual ICollection ReportingReportTables { get; set; } = new List(); - - [InverseProperty("ValueReport")] - public virtual ICollection ReportingReportValues { get; set; } = new List(); - - [InverseProperty("SavedReportReport")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Reporting_Report")] +[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] +[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] +[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] +public class ReportingReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [StringLength(200)] + public string ReportName { get; set; } = null!; + + [StringLength(440)] + public string ReportDisplayName { get; set; } = null!; + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + [Column("ReportCategoryID")] + public int ReportCategoryId { get; set; } + + public int ReportAccess { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + public DateTime ReportLastModified { get; set; } + + public bool? ReportEnableSubscription { get; set; } + + [StringLength(100)] + public string? ReportConnectionString { get; set; } + + [ForeignKey("ReportCategoryId")] + [InverseProperty("ReportingReports")] + public virtual ReportingReportCategory ReportCategory { get; set; } = null!; + + [InverseProperty("GraphReport")] + public virtual ICollection ReportingReportGraphs { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionReport")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("TableReport")] + public virtual ICollection ReportingReportTables { get; set; } = new List(); + + [InverseProperty("ValueReport")] + public virtual ICollection ReportingReportValues { get; set; } = new List(); + + [InverseProperty("SavedReportReport")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs b/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs index 4a91c52a..3b4dea64 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportCategory")] -[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] -public partial class ReportingReportCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryCodeName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual ReportingReportCategory? CategoryParent { get; set; } - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); - - [InverseProperty("ReportCategory")] - public virtual ICollection ReportingReports { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Reporting_ReportCategory")] +[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] +public class ReportingReportCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryCodeName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual ReportingReportCategory? CategoryParent { get; set; } + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); + + [InverseProperty("ReportCategory")] + public virtual ICollection ReportingReports { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs b/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs index 2e693e7f..46c2302c 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportGraph.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportGraph")] -[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] -[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] -public partial class ReportingReportGraph -{ - [Key] - [Column("GraphID")] - public int GraphId { get; set; } - - [StringLength(100)] - public string GraphName { get; set; } = null!; - - [StringLength(450)] - public string GraphDisplayName { get; set; } = null!; - - public string GraphQuery { get; set; } = null!; - - public bool GraphQueryIsStoredProcedure { get; set; } - - [StringLength(50)] - public string GraphType { get; set; } = null!; - - [Column("GraphReportID")] - public int GraphReportId { get; set; } - - [StringLength(200)] - public string? GraphTitle { get; set; } - - [Column("GraphXAxisTitle")] - [StringLength(200)] - public string? GraphXaxisTitle { get; set; } - - [Column("GraphYAxisTitle")] - [StringLength(200)] - public string? GraphYaxisTitle { get; set; } - - public int? GraphWidth { get; set; } - - public int? GraphHeight { get; set; } - - public int? GraphLegendPosition { get; set; } - - public string? GraphSettings { get; set; } - - [Column("GraphGUID")] - public Guid GraphGuid { get; set; } - - public DateTime GraphLastModified { get; set; } - - public bool? GraphIsHtml { get; set; } - - [StringLength(100)] - public string? GraphConnectionString { get; set; } - - [ForeignKey("GraphReportId")] - [InverseProperty("ReportingReportGraphs")] - public virtual ReportingReport GraphReport { get; set; } = null!; - - [InverseProperty("ReportSubscriptionGraph")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Reporting_ReportGraph")] +[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] +[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] +public class ReportingReportGraph +{ + [Key] + [Column("GraphID")] + public int GraphId { get; set; } + + [StringLength(100)] + public string GraphName { get; set; } = null!; + + [StringLength(450)] + public string GraphDisplayName { get; set; } = null!; + + public string GraphQuery { get; set; } = null!; + + public bool GraphQueryIsStoredProcedure { get; set; } + + [StringLength(50)] + public string GraphType { get; set; } = null!; + + [Column("GraphReportID")] + public int GraphReportId { get; set; } + + [StringLength(200)] + public string? GraphTitle { get; set; } + + [Column("GraphXAxisTitle")] + [StringLength(200)] + public string? GraphXaxisTitle { get; set; } + + [Column("GraphYAxisTitle")] + [StringLength(200)] + public string? GraphYaxisTitle { get; set; } + + public int? GraphWidth { get; set; } + + public int? GraphHeight { get; set; } + + public int? GraphLegendPosition { get; set; } + + public string? GraphSettings { get; set; } + + [Column("GraphGUID")] + public Guid GraphGuid { get; set; } + + public DateTime GraphLastModified { get; set; } + + public bool? GraphIsHtml { get; set; } + + [StringLength(100)] + public string? GraphConnectionString { get; set; } + + [ForeignKey("GraphReportId")] + [InverseProperty("ReportingReportGraphs")] + public virtual ReportingReport GraphReport { get; set; } = null!; + + [InverseProperty("ReportSubscriptionGraph")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs b/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs index 5a470e73..5810ecaf 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportSubscription.cs @@ -1,93 +1,92 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportSubscription")] -[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] -[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] -[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] -[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] -[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] -[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] -public partial class ReportingReportSubscription -{ - [Key] - [Column("ReportSubscriptionID")] - public int ReportSubscriptionId { get; set; } - - [Column("ReportSubscriptionReportID")] - public int ReportSubscriptionReportId { get; set; } - - [StringLength(1000)] - public string ReportSubscriptionInterval { get; set; } = null!; - - public string? ReportSubscriptionCondition { get; set; } - - [Required] - public bool? ReportSubscriptionEnabled { get; set; } - - public string? ReportSubscriptionParameters { get; set; } - - [Column("ReportSubscriptionGUID")] - public Guid ReportSubscriptionGuid { get; set; } - - public DateTime ReportSubscriptionLastModified { get; set; } - - [StringLength(200)] - public string? ReportSubscriptionSubject { get; set; } - - [Column("ReportSubscriptionGraphID")] - public int? ReportSubscriptionGraphId { get; set; } - - [Column("ReportSubscriptionTableID")] - public int? ReportSubscriptionTableId { get; set; } - - [Column("ReportSubscriptionValueID")] - public int? ReportSubscriptionValueId { get; set; } - - [Column("ReportSubscriptionUserID")] - public int ReportSubscriptionUserId { get; set; } - - [StringLength(400)] - public string ReportSubscriptionEmail { get; set; } = null!; - - [Required] - public bool? ReportSubscriptionOnlyNonEmpty { get; set; } - - public DateTime? ReportSubscriptionLastPostDate { get; set; } - - public DateTime? ReportSubscriptionNextPostDate { get; set; } - - [Column("ReportSubscriptionSiteID")] - public int ReportSubscriptionSiteId { get; set; } - - public string? ReportSubscriptionSettings { get; set; } - - [ForeignKey("ReportSubscriptionGraphId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } - - [ForeignKey("ReportSubscriptionReportId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; - - [ForeignKey("ReportSubscriptionSiteId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; - - [ForeignKey("ReportSubscriptionTableId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } - - [ForeignKey("ReportSubscriptionUserId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; - - [ForeignKey("ReportSubscriptionValueId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Reporting_ReportSubscription")] +[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] +[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] +[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] +[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] +[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] +[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] +public class ReportingReportSubscription +{ + [Key] + [Column("ReportSubscriptionID")] + public int ReportSubscriptionId { get; set; } + + [Column("ReportSubscriptionReportID")] + public int ReportSubscriptionReportId { get; set; } + + [StringLength(1000)] + public string ReportSubscriptionInterval { get; set; } = null!; + + public string? ReportSubscriptionCondition { get; set; } + + [Required] + public bool? ReportSubscriptionEnabled { get; set; } + + public string? ReportSubscriptionParameters { get; set; } + + [Column("ReportSubscriptionGUID")] + public Guid ReportSubscriptionGuid { get; set; } + + public DateTime ReportSubscriptionLastModified { get; set; } + + [StringLength(200)] + public string? ReportSubscriptionSubject { get; set; } + + [Column("ReportSubscriptionGraphID")] + public int? ReportSubscriptionGraphId { get; set; } + + [Column("ReportSubscriptionTableID")] + public int? ReportSubscriptionTableId { get; set; } + + [Column("ReportSubscriptionValueID")] + public int? ReportSubscriptionValueId { get; set; } + + [Column("ReportSubscriptionUserID")] + public int ReportSubscriptionUserId { get; set; } + + [StringLength(400)] + public string ReportSubscriptionEmail { get; set; } = null!; + + [Required] + public bool? ReportSubscriptionOnlyNonEmpty { get; set; } + + public DateTime? ReportSubscriptionLastPostDate { get; set; } + + public DateTime? ReportSubscriptionNextPostDate { get; set; } + + [Column("ReportSubscriptionSiteID")] + public int ReportSubscriptionSiteId { get; set; } + + public string? ReportSubscriptionSettings { get; set; } + + [ForeignKey("ReportSubscriptionGraphId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } + + [ForeignKey("ReportSubscriptionReportId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; + + [ForeignKey("ReportSubscriptionSiteId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; + + [ForeignKey("ReportSubscriptionTableId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } + + [ForeignKey("ReportSubscriptionUserId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; + + [ForeignKey("ReportSubscriptionValueId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportTable.cs b/Migration.Toolkit.KX12/Models/ReportingReportTable.cs index b61d553c..703f7a95 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportTable.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportTable.cs @@ -1,47 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportTable")] -[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] -[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] -public partial class ReportingReportTable -{ - [Key] - [Column("TableID")] - public int TableId { get; set; } - - [StringLength(100)] - public string TableName { get; set; } = null!; - - [StringLength(450)] - public string TableDisplayName { get; set; } = null!; - - public string TableQuery { get; set; } = null!; - - public bool TableQueryIsStoredProcedure { get; set; } - - [Column("TableReportID")] - public int TableReportId { get; set; } - - public string? TableSettings { get; set; } - - [Column("TableGUID")] - public Guid TableGuid { get; set; } - - public DateTime TableLastModified { get; set; } - - [StringLength(100)] - public string? TableConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionTable")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("TableReportId")] - [InverseProperty("ReportingReportTables")] - public virtual ReportingReport TableReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Reporting_ReportTable")] +[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] +[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] +public class ReportingReportTable +{ + [Key] + [Column("TableID")] + public int TableId { get; set; } + + [StringLength(100)] + public string TableName { get; set; } = null!; + + [StringLength(450)] + public string TableDisplayName { get; set; } = null!; + + public string TableQuery { get; set; } = null!; + + public bool TableQueryIsStoredProcedure { get; set; } + + [Column("TableReportID")] + public int TableReportId { get; set; } + + public string? TableSettings { get; set; } + + [Column("TableGUID")] + public Guid TableGuid { get; set; } + + public DateTime TableLastModified { get; set; } + + [StringLength(100)] + public string? TableConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionTable")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("TableReportId")] + [InverseProperty("ReportingReportTables")] + public virtual ReportingReport TableReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ReportingReportValue.cs b/Migration.Toolkit.KX12/Models/ReportingReportValue.cs index cdf884c6..b4954544 100644 --- a/Migration.Toolkit.KX12/Models/ReportingReportValue.cs +++ b/Migration.Toolkit.KX12/Models/ReportingReportValue.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_ReportValue")] -[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] -[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] -public partial class ReportingReportValue -{ - [Key] - [Column("ValueID")] - public int ValueId { get; set; } - - [StringLength(100)] - public string ValueName { get; set; } = null!; - - [StringLength(450)] - public string ValueDisplayName { get; set; } = null!; - - public string ValueQuery { get; set; } = null!; - - public bool ValueQueryIsStoredProcedure { get; set; } - - [StringLength(200)] - public string? ValueFormatString { get; set; } - - [Column("ValueReportID")] - public int ValueReportId { get; set; } - - [Column("ValueGUID")] - public Guid ValueGuid { get; set; } - - public DateTime ValueLastModified { get; set; } - - public string? ValueSettings { get; set; } - - [StringLength(100)] - public string? ValueConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionValue")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("ValueReportId")] - [InverseProperty("ReportingReportValues")] - public virtual ReportingReport ValueReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Reporting_ReportValue")] +[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] +[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] +public class ReportingReportValue +{ + [Key] + [Column("ValueID")] + public int ValueId { get; set; } + + [StringLength(100)] + public string ValueName { get; set; } = null!; + + [StringLength(450)] + public string ValueDisplayName { get; set; } = null!; + + public string ValueQuery { get; set; } = null!; + + public bool ValueQueryIsStoredProcedure { get; set; } + + [StringLength(200)] + public string? ValueFormatString { get; set; } + + [Column("ValueReportID")] + public int ValueReportId { get; set; } + + [Column("ValueGUID")] + public Guid ValueGuid { get; set; } + + public DateTime ValueLastModified { get; set; } + + public string? ValueSettings { get; set; } + + [StringLength(100)] + public string? ValueConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionValue")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("ValueReportId")] + [InverseProperty("ReportingReportValues")] + public virtual ReportingReport ValueReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs b/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs index 3074a69f..379e6a1d 100644 --- a/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs +++ b/Migration.Toolkit.KX12/Models/ReportingSavedGraph.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_SavedGraph")] -[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] -[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] -public partial class ReportingSavedGraph -{ - [Key] - [Column("SavedGraphID")] - public int SavedGraphId { get; set; } - - [Column("SavedGraphSavedReportID")] - public int SavedGraphSavedReportId { get; set; } - - [Column("SavedGraphGUID")] - public Guid SavedGraphGuid { get; set; } - - public byte[] SavedGraphBinary { get; set; } = null!; - - [StringLength(100)] - public string SavedGraphMimeType { get; set; } = null!; - - public DateTime SavedGraphLastModified { get; set; } - - [ForeignKey("SavedGraphSavedReportId")] - [InverseProperty("ReportingSavedGraphs")] - public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Reporting_SavedGraph")] +[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] +[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] +public class ReportingSavedGraph +{ + [Key] + [Column("SavedGraphID")] + public int SavedGraphId { get; set; } + + [Column("SavedGraphSavedReportID")] + public int SavedGraphSavedReportId { get; set; } + + [Column("SavedGraphGUID")] + public Guid SavedGraphGuid { get; set; } + + public byte[] SavedGraphBinary { get; set; } = null!; + + [StringLength(100)] + public string SavedGraphMimeType { get; set; } = null!; + + public DateTime SavedGraphLastModified { get; set; } + + [ForeignKey("SavedGraphSavedReportId")] + [InverseProperty("ReportingSavedGraphs")] + public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs b/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs index 2bfeccb9..f9a8c1fd 100644 --- a/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs +++ b/Migration.Toolkit.KX12/Models/ReportingSavedReport.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Reporting_SavedReport")] -[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] -public partial class ReportingSavedReport -{ - [Key] - [Column("SavedReportID")] - public int SavedReportId { get; set; } - - [Column("SavedReportReportID")] - public int SavedReportReportId { get; set; } - - [Column("SavedReportGUID")] - public Guid SavedReportGuid { get; set; } - - [StringLength(200)] - public string? SavedReportTitle { get; set; } - - public DateTime SavedReportDate { get; set; } - - [Column("SavedReportHTML")] - public string SavedReportHtml { get; set; } = null!; - - public string SavedReportParameters { get; set; } = null!; - - [Column("SavedReportCreatedByUserID")] - public int? SavedReportCreatedByUserId { get; set; } - - public DateTime SavedReportLastModified { get; set; } - - [InverseProperty("SavedGraphSavedReport")] - public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); - - [ForeignKey("SavedReportCreatedByUserId")] - [InverseProperty("ReportingSavedReports")] - public virtual CmsUser? SavedReportCreatedByUser { get; set; } - - [ForeignKey("SavedReportReportId")] - [InverseProperty("ReportingSavedReports")] - public virtual ReportingReport SavedReportReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Reporting_SavedReport")] +[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] +public class ReportingSavedReport +{ + [Key] + [Column("SavedReportID")] + public int SavedReportId { get; set; } + + [Column("SavedReportReportID")] + public int SavedReportReportId { get; set; } + + [Column("SavedReportGUID")] + public Guid SavedReportGuid { get; set; } + + [StringLength(200)] + public string? SavedReportTitle { get; set; } + + public DateTime SavedReportDate { get; set; } + + [Column("SavedReportHTML")] + public string SavedReportHtml { get; set; } = null!; + + public string SavedReportParameters { get; set; } = null!; + + [Column("SavedReportCreatedByUserID")] + public int? SavedReportCreatedByUserId { get; set; } + + public DateTime SavedReportLastModified { get; set; } + + [InverseProperty("SavedGraphSavedReport")] + public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); + + [ForeignKey("SavedReportCreatedByUserId")] + [InverseProperty("ReportingSavedReports")] + public virtual CmsUser? SavedReportCreatedByUser { get; set; } + + [ForeignKey("SavedReportReportId")] + [InverseProperty("ReportingSavedReports")] + public virtual ReportingReport SavedReportReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs index fb7a7cce..4d21f004 100644 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs +++ b/Migration.Toolkit.KX12/Models/SharePointSharePointConnection.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SharePoint_SharePointConnection")] -[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] -public partial class SharePointSharePointConnection -{ - [Key] - [Column("SharePointConnectionID")] - public int SharePointConnectionId { get; set; } - - [Column("SharePointConnectionGUID")] - public Guid SharePointConnectionGuid { get; set; } - - [Column("SharePointConnectionSiteID")] - public int SharePointConnectionSiteId { get; set; } - - [StringLength(512)] - public string SharePointConnectionSiteUrl { get; set; } = null!; - - [StringLength(30)] - public string SharePointConnectionAuthMode { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionName { get; set; } = null!; - - [StringLength(30)] - public string SharePointConnectionSharePointVersion { get; set; } = null!; - - [StringLength(100)] - public string? SharePointConnectionUserName { get; set; } - - [StringLength(100)] - public string? SharePointConnectionPassword { get; set; } - - [StringLength(100)] - public string? SharePointConnectionDomain { get; set; } - - public DateTime SharePointConnectionLastModified { get; set; } - - [ForeignKey("SharePointConnectionSiteId")] - [InverseProperty("SharePointSharePointConnections")] - public virtual CmsSite SharePointConnectionSite { get; set; } = null!; - - [InverseProperty("SharePointLibrarySharePointConnection")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SharePoint_SharePointConnection")] +[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] +public class SharePointSharePointConnection +{ + [Key] + [Column("SharePointConnectionID")] + public int SharePointConnectionId { get; set; } + + [Column("SharePointConnectionGUID")] + public Guid SharePointConnectionGuid { get; set; } + + [Column("SharePointConnectionSiteID")] + public int SharePointConnectionSiteId { get; set; } + + [StringLength(512)] + public string SharePointConnectionSiteUrl { get; set; } = null!; + + [StringLength(30)] + public string SharePointConnectionAuthMode { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionName { get; set; } = null!; + + [StringLength(30)] + public string SharePointConnectionSharePointVersion { get; set; } = null!; + + [StringLength(100)] + public string? SharePointConnectionUserName { get; set; } + + [StringLength(100)] + public string? SharePointConnectionPassword { get; set; } + + [StringLength(100)] + public string? SharePointConnectionDomain { get; set; } + + public DateTime SharePointConnectionLastModified { get; set; } + + [ForeignKey("SharePointConnectionSiteId")] + [InverseProperty("SharePointSharePointConnections")] + public virtual CmsSite SharePointConnectionSite { get; set; } = null!; + + [InverseProperty("SharePointLibrarySharePointConnection")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs index f0eb8fc5..76c0b033 100644 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs +++ b/Migration.Toolkit.KX12/Models/SharePointSharePointFile.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SharePoint_SharePointFile")] -[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] -[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] -public partial class SharePointSharePointFile -{ - [Key] - [Column("SharePointFileID")] - public int SharePointFileId { get; set; } - - [Column("SharePointFileGUID")] - public Guid SharePointFileGuid { get; set; } - - [Column("SharePointFileSiteID")] - public int SharePointFileSiteId { get; set; } - - [StringLength(150)] - public string SharePointFileName { get; set; } = null!; - - [StringLength(150)] - public string? SharePointFileExtension { get; set; } - - [StringLength(255)] - public string? SharePointFileMimeType { get; set; } - - [Column("SharePointFileETag")] - [StringLength(255)] - public string? SharePointFileEtag { get; set; } - - public long SharePointFileSize { get; set; } - - public DateTime SharePointFileServerLastModified { get; set; } - - [Column("SharePointFileServerRelativeURL")] - [StringLength(300)] - public string SharePointFileServerRelativeUrl { get; set; } = null!; - - [Column("SharePointFileSharePointLibraryID")] - public int SharePointFileSharePointLibraryId { get; set; } - - public byte[]? SharePointFileBinary { get; set; } - - [ForeignKey("SharePointFileSharePointLibraryId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; - - [ForeignKey("SharePointFileSiteId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual CmsSite SharePointFileSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SharePoint_SharePointFile")] +[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] +[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] +public class SharePointSharePointFile +{ + [Key] + [Column("SharePointFileID")] + public int SharePointFileId { get; set; } + + [Column("SharePointFileGUID")] + public Guid SharePointFileGuid { get; set; } + + [Column("SharePointFileSiteID")] + public int SharePointFileSiteId { get; set; } + + [StringLength(150)] + public string SharePointFileName { get; set; } = null!; + + [StringLength(150)] + public string? SharePointFileExtension { get; set; } + + [StringLength(255)] + public string? SharePointFileMimeType { get; set; } + + [Column("SharePointFileETag")] + [StringLength(255)] + public string? SharePointFileEtag { get; set; } + + public long SharePointFileSize { get; set; } + + public DateTime SharePointFileServerLastModified { get; set; } + + [Column("SharePointFileServerRelativeURL")] + [StringLength(300)] + public string SharePointFileServerRelativeUrl { get; set; } = null!; + + [Column("SharePointFileSharePointLibraryID")] + public int SharePointFileSharePointLibraryId { get; set; } + + public byte[]? SharePointFileBinary { get; set; } + + [ForeignKey("SharePointFileSharePointLibraryId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; + + [ForeignKey("SharePointFileSiteId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual CmsSite SharePointFileSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs index 90bcd8af..726bbd38 100644 --- a/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs +++ b/Migration.Toolkit.KX12/Models/SharePointSharePointLibrary.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SharePoint_SharePointLibrary")] -[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] -[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] -public partial class SharePointSharePointLibrary -{ - [Key] - [Column("SharePointLibraryID")] - public int SharePointLibraryId { get; set; } - - [StringLength(100)] - public string SharePointLibraryName { get; set; } = null!; - - [Column("SharePointLibrarySharePointConnectionID")] - public int? SharePointLibrarySharePointConnectionId { get; set; } - - [StringLength(100)] - public string SharePointLibraryListTitle { get; set; } = null!; - - public int SharePointLibrarySynchronizationPeriod { get; set; } - - [Column("SharePointLibraryGUID")] - public Guid SharePointLibraryGuid { get; set; } - - [Column("SharePointLibrarySiteID")] - public int SharePointLibrarySiteId { get; set; } - - [StringLength(100)] - public string SharePointLibraryDisplayName { get; set; } = null!; - - public DateTime SharePointLibraryLastModified { get; set; } - - public int SharePointLibraryListType { get; set; } - - [ForeignKey("SharePointLibrarySharePointConnectionId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } - - [ForeignKey("SharePointLibrarySiteId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual CmsSite SharePointLibrarySite { get; set; } = null!; - - [InverseProperty("SharePointFileSharePointLibrary")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SharePoint_SharePointLibrary")] +[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] +[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] +public class SharePointSharePointLibrary +{ + [Key] + [Column("SharePointLibraryID")] + public int SharePointLibraryId { get; set; } + + [StringLength(100)] + public string SharePointLibraryName { get; set; } = null!; + + [Column("SharePointLibrarySharePointConnectionID")] + public int? SharePointLibrarySharePointConnectionId { get; set; } + + [StringLength(100)] + public string SharePointLibraryListTitle { get; set; } = null!; + + public int SharePointLibrarySynchronizationPeriod { get; set; } + + [Column("SharePointLibraryGUID")] + public Guid SharePointLibraryGuid { get; set; } + + [Column("SharePointLibrarySiteID")] + public int SharePointLibrarySiteId { get; set; } + + [StringLength(100)] + public string SharePointLibraryDisplayName { get; set; } = null!; + + public DateTime SharePointLibraryLastModified { get; set; } + + public int SharePointLibraryListType { get; set; } + + [ForeignKey("SharePointLibrarySharePointConnectionId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } + + [ForeignKey("SharePointLibrarySiteId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual CmsSite SharePointLibrarySite { get; set; } = null!; + + [InverseProperty("SharePointFileSharePointLibrary")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs b/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs index e310ebdf..e1531034 100644 --- a/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs +++ b/Migration.Toolkit.KX12/Models/SmFacebookAccount.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_FacebookAccount")] -[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] -[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] -public partial class SmFacebookAccount -{ - [Key] - [Column("FacebookAccountID")] - public int FacebookAccountId { get; set; } - - [Column("FacebookAccountGUID")] - public Guid FacebookAccountGuid { get; set; } - - public DateTime FacebookAccountLastModified { get; set; } - - [Column("FacebookAccountSiteID")] - public int FacebookAccountSiteId { get; set; } - - [StringLength(200)] - public string FacebookAccountName { get; set; } = null!; - - [StringLength(200)] - public string FacebookAccountDisplayName { get; set; } = null!; - - [Column("FacebookAccountPageID")] - [StringLength(500)] - public string FacebookAccountPageId { get; set; } = null!; - - public string FacebookAccountPageAccessToken { get; set; } = null!; - - [Column("FacebookAccountFacebookApplicationID")] - public int FacebookAccountFacebookApplicationId { get; set; } - - public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } - - public bool? FacebookAccountIsDefault { get; set; } - - [ForeignKey("FacebookAccountFacebookApplicationId")] - [InverseProperty("SmFacebookAccounts")] - public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; - - [ForeignKey("FacebookAccountSiteId")] - [InverseProperty("SmFacebookAccounts")] - public virtual CmsSite FacebookAccountSite { get; set; } = null!; - - [InverseProperty("FacebookPostFacebookAccount")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_FacebookAccount")] +[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] +[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] +public class SmFacebookAccount +{ + [Key] + [Column("FacebookAccountID")] + public int FacebookAccountId { get; set; } + + [Column("FacebookAccountGUID")] + public Guid FacebookAccountGuid { get; set; } + + public DateTime FacebookAccountLastModified { get; set; } + + [Column("FacebookAccountSiteID")] + public int FacebookAccountSiteId { get; set; } + + [StringLength(200)] + public string FacebookAccountName { get; set; } = null!; + + [StringLength(200)] + public string FacebookAccountDisplayName { get; set; } = null!; + + [Column("FacebookAccountPageID")] + [StringLength(500)] + public string FacebookAccountPageId { get; set; } = null!; + + public string FacebookAccountPageAccessToken { get; set; } = null!; + + [Column("FacebookAccountFacebookApplicationID")] + public int FacebookAccountFacebookApplicationId { get; set; } + + public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } + + public bool? FacebookAccountIsDefault { get; set; } + + [ForeignKey("FacebookAccountFacebookApplicationId")] + [InverseProperty("SmFacebookAccounts")] + public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; + + [ForeignKey("FacebookAccountSiteId")] + [InverseProperty("SmFacebookAccounts")] + public virtual CmsSite FacebookAccountSite { get; set; } = null!; + + [InverseProperty("FacebookPostFacebookAccount")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs b/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs index 2e234d08..a33eb45e 100644 --- a/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs +++ b/Migration.Toolkit.KX12/Models/SmFacebookApplication.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_FacebookApplication")] -[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] -public partial class SmFacebookApplication -{ - [Key] - [Column("FacebookApplicationID")] - public int FacebookApplicationId { get; set; } - - [StringLength(500)] - public string FacebookApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string FacebookApplicationConsumerSecret { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationName { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationDisplayName { get; set; } = null!; - - [Column("FacebookApplicationGUID")] - public Guid FacebookApplicationGuid { get; set; } - - public DateTime FacebookApplicationLastModified { get; set; } - - [Column("FacebookApplicationSiteID")] - public int FacebookApplicationSiteId { get; set; } - - [ForeignKey("FacebookApplicationSiteId")] - [InverseProperty("SmFacebookApplications")] - public virtual CmsSite FacebookApplicationSite { get; set; } = null!; - - [InverseProperty("FacebookAccountFacebookApplication")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_FacebookApplication")] +[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] +public class SmFacebookApplication +{ + [Key] + [Column("FacebookApplicationID")] + public int FacebookApplicationId { get; set; } + + [StringLength(500)] + public string FacebookApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string FacebookApplicationConsumerSecret { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationName { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationDisplayName { get; set; } = null!; + + [Column("FacebookApplicationGUID")] + public Guid FacebookApplicationGuid { get; set; } + + public DateTime FacebookApplicationLastModified { get; set; } + + [Column("FacebookApplicationSiteID")] + public int FacebookApplicationSiteId { get; set; } + + [ForeignKey("FacebookApplicationSiteId")] + [InverseProperty("SmFacebookApplications")] + public virtual CmsSite FacebookApplicationSite { get; set; } = null!; + + [InverseProperty("FacebookAccountFacebookApplication")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/SmFacebookPost.cs b/Migration.Toolkit.KX12/Models/SmFacebookPost.cs index 420ae9a2..18304c2c 100644 --- a/Migration.Toolkit.KX12/Models/SmFacebookPost.cs +++ b/Migration.Toolkit.KX12/Models/SmFacebookPost.cs @@ -1,89 +1,88 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_FacebookPost")] -[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] -[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] -[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] -public partial class SmFacebookPost -{ - [Key] - [Column("FacebookPostID")] - public int FacebookPostId { get; set; } - - [Column("FacebookPostGUID")] - public Guid FacebookPostGuid { get; set; } - - public DateTime FacebookPostLastModified { get; set; } - - [Column("FacebookPostSiteID")] - public int FacebookPostSiteId { get; set; } - - [Column("FacebookPostFacebookAccountID")] - public int FacebookPostFacebookAccountId { get; set; } - - public string FacebookPostText { get; set; } = null!; - - [Column("FacebookPostURLShortenerType")] - public int? FacebookPostUrlshortenerType { get; set; } - - public int? FacebookPostErrorCode { get; set; } - - public int? FacebookPostErrorSubcode { get; set; } - - [Column("FacebookPostExternalID")] - public string? FacebookPostExternalId { get; set; } - - public DateTime? FacebookPostPublishedDateTime { get; set; } - - public DateTime? FacebookPostScheduledPublishDateTime { get; set; } - - [Column("FacebookPostCampaignID")] - public int? FacebookPostCampaignId { get; set; } - - public bool? FacebookPostPostAfterDocumentPublish { get; set; } - - public int? FacebookPostInsightPeopleReached { get; set; } - - public int? FacebookPostInsightLikesFromPage { get; set; } - - public int? FacebookPostInsightCommentsFromPage { get; set; } - - public int? FacebookPostInsightSharesFromPage { get; set; } - - public int? FacebookPostInsightLikesTotal { get; set; } - - public int? FacebookPostInsightCommentsTotal { get; set; } - - public int? FacebookPostInsightNegativeHidePost { get; set; } - - public int? FacebookPostInsightNegativeHideAllPosts { get; set; } - - public int? FacebookPostInsightNegativeReportSpam { get; set; } - - public int? FacebookPostInsightNegativeUnlikePage { get; set; } - - public DateTime? FacebookPostInsightsLastUpdated { get; set; } - - [Column("FacebookPostDocumentGUID")] - public Guid? FacebookPostDocumentGuid { get; set; } - - public bool? FacebookPostIsCreatedByUser { get; set; } - - [ForeignKey("FacebookPostCampaignId")] - [InverseProperty("SmFacebookPosts")] - public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } - - [ForeignKey("FacebookPostFacebookAccountId")] - [InverseProperty("SmFacebookPosts")] - public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; - - [ForeignKey("FacebookPostSiteId")] - [InverseProperty("SmFacebookPosts")] - public virtual CmsSite FacebookPostSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_FacebookPost")] +[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] +[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] +[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] +public class SmFacebookPost +{ + [Key] + [Column("FacebookPostID")] + public int FacebookPostId { get; set; } + + [Column("FacebookPostGUID")] + public Guid FacebookPostGuid { get; set; } + + public DateTime FacebookPostLastModified { get; set; } + + [Column("FacebookPostSiteID")] + public int FacebookPostSiteId { get; set; } + + [Column("FacebookPostFacebookAccountID")] + public int FacebookPostFacebookAccountId { get; set; } + + public string FacebookPostText { get; set; } = null!; + + [Column("FacebookPostURLShortenerType")] + public int? FacebookPostUrlshortenerType { get; set; } + + public int? FacebookPostErrorCode { get; set; } + + public int? FacebookPostErrorSubcode { get; set; } + + [Column("FacebookPostExternalID")] + public string? FacebookPostExternalId { get; set; } + + public DateTime? FacebookPostPublishedDateTime { get; set; } + + public DateTime? FacebookPostScheduledPublishDateTime { get; set; } + + [Column("FacebookPostCampaignID")] + public int? FacebookPostCampaignId { get; set; } + + public bool? FacebookPostPostAfterDocumentPublish { get; set; } + + public int? FacebookPostInsightPeopleReached { get; set; } + + public int? FacebookPostInsightLikesFromPage { get; set; } + + public int? FacebookPostInsightCommentsFromPage { get; set; } + + public int? FacebookPostInsightSharesFromPage { get; set; } + + public int? FacebookPostInsightLikesTotal { get; set; } + + public int? FacebookPostInsightCommentsTotal { get; set; } + + public int? FacebookPostInsightNegativeHidePost { get; set; } + + public int? FacebookPostInsightNegativeHideAllPosts { get; set; } + + public int? FacebookPostInsightNegativeReportSpam { get; set; } + + public int? FacebookPostInsightNegativeUnlikePage { get; set; } + + public DateTime? FacebookPostInsightsLastUpdated { get; set; } + + [Column("FacebookPostDocumentGUID")] + public Guid? FacebookPostDocumentGuid { get; set; } + + public bool? FacebookPostIsCreatedByUser { get; set; } + + [ForeignKey("FacebookPostCampaignId")] + [InverseProperty("SmFacebookPosts")] + public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } + + [ForeignKey("FacebookPostFacebookAccountId")] + [InverseProperty("SmFacebookPosts")] + public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; + + [ForeignKey("FacebookPostSiteId")] + [InverseProperty("SmFacebookPosts")] + public virtual CmsSite FacebookPostSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmInsight.cs b/Migration.Toolkit.KX12/Models/SmInsight.cs index 19962c0f..50465a82 100644 --- a/Migration.Toolkit.KX12/Models/SmInsight.cs +++ b/Migration.Toolkit.KX12/Models/SmInsight.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_Insight")] -[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] -public partial class SmInsight -{ - [Key] - [Column("InsightID")] - public int InsightId { get; set; } - - [StringLength(200)] - public string InsightCodeName { get; set; } = null!; - - [Column("InsightExternalID")] - public string InsightExternalId { get; set; } = null!; - - [StringLength(20)] - public string InsightPeriodType { get; set; } = null!; - - public string? InsightValueName { get; set; } - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitDays { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitMonths { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitYears { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_Insight")] +[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] +public class SmInsight +{ + [Key] + [Column("InsightID")] + public int InsightId { get; set; } + + [StringLength(200)] + public string InsightCodeName { get; set; } = null!; + + [Column("InsightExternalID")] + public string InsightExternalId { get; set; } = null!; + + [StringLength(20)] + public string InsightPeriodType { get; set; } = null!; + + public string? InsightValueName { get; set; } + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitDays { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitMonths { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitYears { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs b/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs index 00c6e9ec..446cd192 100644 --- a/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs +++ b/Migration.Toolkit.KX12/Models/SmInsightHitDay.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_InsightHit_Day")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitDay -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitDays")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_InsightHit_Day")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitDay +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitDays")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs b/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs index f584a3d8..cabfe51b 100644 --- a/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs +++ b/Migration.Toolkit.KX12/Models/SmInsightHitMonth.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_InsightHit_Month")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitMonth -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitMonths")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_InsightHit_Month")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitMonth +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitMonths")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs b/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs index 54cd9e78..526c46e2 100644 --- a/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs +++ b/Migration.Toolkit.KX12/Models/SmInsightHitWeek.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_InsightHit_Week")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitWeek -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitWeeks")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_InsightHit_Week")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitWeek +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitWeeks")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs b/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs index 43355108..3e6240f6 100644 --- a/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs +++ b/Migration.Toolkit.KX12/Models/SmInsightHitYear.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_InsightHit_Year")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitYear -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitYears")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_InsightHit_Year")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitYear +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitYears")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs b/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs index f922dac6..1d204344 100644 --- a/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs +++ b/Migration.Toolkit.KX12/Models/SmLinkedInAccount.cs @@ -1,49 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_LinkedInAccount")] -public partial class SmLinkedInAccount -{ - [Key] - [Column("LinkedInAccountID")] - public int LinkedInAccountId { get; set; } - - [StringLength(200)] - public string LinkedInAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInAccountName { get; set; } = null!; - - public bool? LinkedInAccountIsDefault { get; set; } - - [StringLength(500)] - public string LinkedInAccountAccessToken { get; set; } = null!; - - public DateTime LinkedInAccountLastModified { get; set; } - - [Column("LinkedInAccountGUID")] - public Guid LinkedInAccountGuid { get; set; } - - [Column("LinkedInAccountSiteID")] - public int LinkedInAccountSiteId { get; set; } - - [Column("LinkedInAccountProfileID")] - [StringLength(50)] - public string LinkedInAccountProfileId { get; set; } = null!; - - [Column("LinkedInAccountLinkedInApplicationID")] - public int LinkedInAccountLinkedInApplicationId { get; set; } - - [StringLength(200)] - public string? LinkedInAccountProfileName { get; set; } - - public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } - - [InverseProperty("LinkedInPostLinkedInAccount")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_LinkedInAccount")] +public class SmLinkedInAccount +{ + [Key] + [Column("LinkedInAccountID")] + public int LinkedInAccountId { get; set; } + + [StringLength(200)] + public string LinkedInAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInAccountName { get; set; } = null!; + + public bool? LinkedInAccountIsDefault { get; set; } + + [StringLength(500)] + public string LinkedInAccountAccessToken { get; set; } = null!; + + public DateTime LinkedInAccountLastModified { get; set; } + + [Column("LinkedInAccountGUID")] + public Guid LinkedInAccountGuid { get; set; } + + [Column("LinkedInAccountSiteID")] + public int LinkedInAccountSiteId { get; set; } + + [Column("LinkedInAccountProfileID")] + [StringLength(50)] + public string LinkedInAccountProfileId { get; set; } = null!; + + [Column("LinkedInAccountLinkedInApplicationID")] + public int LinkedInAccountLinkedInApplicationId { get; set; } + + [StringLength(200)] + public string? LinkedInAccountProfileName { get; set; } + + public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } + + [InverseProperty("LinkedInPostLinkedInAccount")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs b/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs index e8af2885..f755eb77 100644 --- a/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs +++ b/Migration.Toolkit.KX12/Models/SmLinkedInApplication.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_LinkedInApplication")] -[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] -public partial class SmLinkedInApplication -{ - [Key] - [Column("LinkedInApplicationID")] - public int LinkedInApplicationId { get; set; } - - [StringLength(200)] - public string LinkedInApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInApplicationName { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerSecret { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerKey { get; set; } = null!; - - public DateTime LinkedInApplicationLastModified { get; set; } - - [Column("LinkedInApplicationGUID")] - public Guid LinkedInApplicationGuid { get; set; } - - [Column("LinkedInApplicationSiteID")] - public int LinkedInApplicationSiteId { get; set; } - - [ForeignKey("LinkedInApplicationSiteId")] - [InverseProperty("SmLinkedInApplications")] - public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_LinkedInApplication")] +[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] +public class SmLinkedInApplication +{ + [Key] + [Column("LinkedInApplicationID")] + public int LinkedInApplicationId { get; set; } + + [StringLength(200)] + public string LinkedInApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInApplicationName { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerSecret { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerKey { get; set; } = null!; + + public DateTime LinkedInApplicationLastModified { get; set; } + + [Column("LinkedInApplicationGUID")] + public Guid LinkedInApplicationGuid { get; set; } + + [Column("LinkedInApplicationSiteID")] + public int LinkedInApplicationSiteId { get; set; } + + [ForeignKey("LinkedInApplicationSiteId")] + [InverseProperty("SmLinkedInApplications")] + public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs b/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs index 1305284d..64beec81 100644 --- a/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs +++ b/Migration.Toolkit.KX12/Models/SmLinkedInPost.cs @@ -1,85 +1,84 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_LinkedInPost")] -[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] -[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] -[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] -public partial class SmLinkedInPost -{ - [Key] - [Column("LinkedInPostID")] - public int LinkedInPostId { get; set; } - - [Column("LinkedInPostLinkedInAccountID")] - public int LinkedInPostLinkedInAccountId { get; set; } - - [StringLength(700)] - public string LinkedInPostComment { get; set; } = null!; - - [Column("LinkedInPostSiteID")] - public int LinkedInPostSiteId { get; set; } - - [Column("LinkedInPostGUID")] - public Guid LinkedInPostGuid { get; set; } - - public DateTime? LinkedInPostLastModified { get; set; } - - [StringLength(200)] - public string? LinkedInPostUpdateKey { get; set; } - - [Column("LinkedInPostURLShortenerType")] - public int? LinkedInPostUrlshortenerType { get; set; } - - public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } - - [Column("LinkedInPostCampaignID")] - public int? LinkedInPostCampaignId { get; set; } - - public DateTime? LinkedInPostPublishedDateTime { get; set; } - - [Column("LinkedInPostHTTPStatusCode")] - public int? LinkedInPostHttpstatusCode { get; set; } - - public int? LinkedInPostErrorCode { get; set; } - - public string? LinkedInPostErrorMessage { get; set; } - - [Column("LinkedInPostDocumentGUID")] - public Guid? LinkedInPostDocumentGuid { get; set; } - - public bool? LinkedInPostIsCreatedByUser { get; set; } - - public bool? LinkedInPostPostAfterDocumentPublish { get; set; } - - public DateTime? LinkedInPostInsightsLastUpdated { get; set; } - - public int? LinkedInPostCommentCount { get; set; } - - public int? LinkedInPostImpressionCount { get; set; } - - public int? LinkedInPostLikeCount { get; set; } - - public int? LinkedInPostShareCount { get; set; } - - public int? LinkedInPostClickCount { get; set; } - - public double? LinkedInPostEngagement { get; set; } - - [ForeignKey("LinkedInPostCampaignId")] - [InverseProperty("SmLinkedInPosts")] - public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } - - [ForeignKey("LinkedInPostLinkedInAccountId")] - [InverseProperty("SmLinkedInPosts")] - public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; - - [ForeignKey("LinkedInPostSiteId")] - [InverseProperty("SmLinkedInPosts")] - public virtual CmsSite LinkedInPostSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_LinkedInPost")] +[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] +[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] +[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] +public class SmLinkedInPost +{ + [Key] + [Column("LinkedInPostID")] + public int LinkedInPostId { get; set; } + + [Column("LinkedInPostLinkedInAccountID")] + public int LinkedInPostLinkedInAccountId { get; set; } + + [StringLength(700)] + public string LinkedInPostComment { get; set; } = null!; + + [Column("LinkedInPostSiteID")] + public int LinkedInPostSiteId { get; set; } + + [Column("LinkedInPostGUID")] + public Guid LinkedInPostGuid { get; set; } + + public DateTime? LinkedInPostLastModified { get; set; } + + [StringLength(200)] + public string? LinkedInPostUpdateKey { get; set; } + + [Column("LinkedInPostURLShortenerType")] + public int? LinkedInPostUrlshortenerType { get; set; } + + public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } + + [Column("LinkedInPostCampaignID")] + public int? LinkedInPostCampaignId { get; set; } + + public DateTime? LinkedInPostPublishedDateTime { get; set; } + + [Column("LinkedInPostHTTPStatusCode")] + public int? LinkedInPostHttpstatusCode { get; set; } + + public int? LinkedInPostErrorCode { get; set; } + + public string? LinkedInPostErrorMessage { get; set; } + + [Column("LinkedInPostDocumentGUID")] + public Guid? LinkedInPostDocumentGuid { get; set; } + + public bool? LinkedInPostIsCreatedByUser { get; set; } + + public bool? LinkedInPostPostAfterDocumentPublish { get; set; } + + public DateTime? LinkedInPostInsightsLastUpdated { get; set; } + + public int? LinkedInPostCommentCount { get; set; } + + public int? LinkedInPostImpressionCount { get; set; } + + public int? LinkedInPostLikeCount { get; set; } + + public int? LinkedInPostShareCount { get; set; } + + public int? LinkedInPostClickCount { get; set; } + + public double? LinkedInPostEngagement { get; set; } + + [ForeignKey("LinkedInPostCampaignId")] + [InverseProperty("SmLinkedInPosts")] + public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } + + [ForeignKey("LinkedInPostLinkedInAccountId")] + [InverseProperty("SmLinkedInPosts")] + public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; + + [ForeignKey("LinkedInPostSiteId")] + [InverseProperty("SmLinkedInPosts")] + public virtual CmsSite LinkedInPostSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs b/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs index 3a0f776a..c657173f 100644 --- a/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs +++ b/Migration.Toolkit.KX12/Models/SmTwitterAccount.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_TwitterAccount")] -[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] -[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] -public partial class SmTwitterAccount -{ - [Key] - [Column("TwitterAccountID")] - public int TwitterAccountId { get; set; } - - [StringLength(200)] - public string TwitterAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterAccountName { get; set; } = null!; - - public DateTime TwitterAccountLastModified { get; set; } - - [Column("TwitterAccountGUID")] - public Guid TwitterAccountGuid { get; set; } - - [Column("TwitterAccountSiteID")] - public int TwitterAccountSiteId { get; set; } - - [StringLength(500)] - public string TwitterAccountAccessToken { get; set; } = null!; - - [StringLength(500)] - public string TwitterAccountAccessTokenSecret { get; set; } = null!; - - [Column("TwitterAccountTwitterApplicationID")] - public int TwitterAccountTwitterApplicationId { get; set; } - - public int? TwitterAccountFollowers { get; set; } - - public int? TwitterAccountMentions { get; set; } - - [StringLength(40)] - public string? TwitterAccountMentionsRange { get; set; } - - [Column("TwitterAccountUserID")] - [StringLength(20)] - public string? TwitterAccountUserId { get; set; } - - public bool? TwitterAccountIsDefault { get; set; } - - [InverseProperty("TwitterPostTwitterAccount")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [ForeignKey("TwitterAccountSiteId")] - [InverseProperty("SmTwitterAccounts")] - public virtual CmsSite TwitterAccountSite { get; set; } = null!; - - [ForeignKey("TwitterAccountTwitterApplicationId")] - [InverseProperty("SmTwitterAccounts")] - public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_TwitterAccount")] +[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] +[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] +public class SmTwitterAccount +{ + [Key] + [Column("TwitterAccountID")] + public int TwitterAccountId { get; set; } + + [StringLength(200)] + public string TwitterAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterAccountName { get; set; } = null!; + + public DateTime TwitterAccountLastModified { get; set; } + + [Column("TwitterAccountGUID")] + public Guid TwitterAccountGuid { get; set; } + + [Column("TwitterAccountSiteID")] + public int TwitterAccountSiteId { get; set; } + + [StringLength(500)] + public string TwitterAccountAccessToken { get; set; } = null!; + + [StringLength(500)] + public string TwitterAccountAccessTokenSecret { get; set; } = null!; + + [Column("TwitterAccountTwitterApplicationID")] + public int TwitterAccountTwitterApplicationId { get; set; } + + public int? TwitterAccountFollowers { get; set; } + + public int? TwitterAccountMentions { get; set; } + + [StringLength(40)] + public string? TwitterAccountMentionsRange { get; set; } + + [Column("TwitterAccountUserID")] + [StringLength(20)] + public string? TwitterAccountUserId { get; set; } + + public bool? TwitterAccountIsDefault { get; set; } + + [InverseProperty("TwitterPostTwitterAccount")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [ForeignKey("TwitterAccountSiteId")] + [InverseProperty("SmTwitterAccounts")] + public virtual CmsSite TwitterAccountSite { get; set; } = null!; + + [ForeignKey("TwitterAccountTwitterApplicationId")] + [InverseProperty("SmTwitterAccounts")] + public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs b/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs index 17cd8566..869fd08e 100644 --- a/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs +++ b/Migration.Toolkit.KX12/Models/SmTwitterApplication.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_TwitterApplication")] -[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] -public partial class SmTwitterApplication -{ - [Key] - [Column("TwitterApplicationID")] - public int TwitterApplicationId { get; set; } - - [StringLength(200)] - public string TwitterApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterApplicationName { get; set; } = null!; - - public DateTime TwitterApplicationLastModified { get; set; } - - [Column("TwitterApplicationGUID")] - public Guid TwitterApplicationGuid { get; set; } - - [Column("TwitterApplicationSiteID")] - public int TwitterApplicationSiteId { get; set; } - - [StringLength(500)] - public string TwitterApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string TwitterApplicationConsumerSecret { get; set; } = null!; - - [InverseProperty("TwitterAccountTwitterApplication")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [ForeignKey("TwitterApplicationSiteId")] - [InverseProperty("SmTwitterApplications")] - public virtual CmsSite TwitterApplicationSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_TwitterApplication")] +[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] +public class SmTwitterApplication +{ + [Key] + [Column("TwitterApplicationID")] + public int TwitterApplicationId { get; set; } + + [StringLength(200)] + public string TwitterApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterApplicationName { get; set; } = null!; + + public DateTime TwitterApplicationLastModified { get; set; } + + [Column("TwitterApplicationGUID")] + public Guid TwitterApplicationGuid { get; set; } + + [Column("TwitterApplicationSiteID")] + public int TwitterApplicationSiteId { get; set; } + + [StringLength(500)] + public string TwitterApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string TwitterApplicationConsumerSecret { get; set; } = null!; + + [InverseProperty("TwitterAccountTwitterApplication")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [ForeignKey("TwitterApplicationSiteId")] + [InverseProperty("SmTwitterApplications")] + public virtual CmsSite TwitterApplicationSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/SmTwitterPost.cs b/Migration.Toolkit.KX12/Models/SmTwitterPost.cs index 619f984a..c7ed0162 100644 --- a/Migration.Toolkit.KX12/Models/SmTwitterPost.cs +++ b/Migration.Toolkit.KX12/Models/SmTwitterPost.cs @@ -1,71 +1,70 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("SM_TwitterPost")] -[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] -[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] -[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] -public partial class SmTwitterPost -{ - [Key] - [Column("TwitterPostID")] - public int TwitterPostId { get; set; } - - [Column("TwitterPostGUID")] - public Guid TwitterPostGuid { get; set; } - - public DateTime TwitterPostLastModified { get; set; } - - [Column("TwitterPostSiteID")] - public int TwitterPostSiteId { get; set; } - - [Column("TwitterPostTwitterAccountID")] - public int TwitterPostTwitterAccountId { get; set; } - - public string TwitterPostText { get; set; } = null!; - - [Column("TwitterPostURLShortenerType")] - public int? TwitterPostUrlshortenerType { get; set; } - - [Column("TwitterPostExternalID")] - public string? TwitterPostExternalId { get; set; } - - public int? TwitterPostErrorCode { get; set; } - - public DateTime? TwitterPostPublishedDateTime { get; set; } - - public DateTime? TwitterPostScheduledPublishDateTime { get; set; } - - [Column("TwitterPostCampaignID")] - public int? TwitterPostCampaignId { get; set; } - - public int? TwitterPostFavorites { get; set; } - - public int? TwitterPostRetweets { get; set; } - - public bool? TwitterPostPostAfterDocumentPublish { get; set; } - - public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } - - [Column("TwitterPostDocumentGUID")] - public Guid? TwitterPostDocumentGuid { get; set; } - - public bool? TwitterPostIsCreatedByUser { get; set; } - - [ForeignKey("TwitterPostCampaignId")] - [InverseProperty("SmTwitterPosts")] - public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } - - [ForeignKey("TwitterPostSiteId")] - [InverseProperty("SmTwitterPosts")] - public virtual CmsSite TwitterPostSite { get; set; } = null!; - - [ForeignKey("TwitterPostTwitterAccountId")] - [InverseProperty("SmTwitterPosts")] - public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("SM_TwitterPost")] +[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] +[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] +[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] +public class SmTwitterPost +{ + [Key] + [Column("TwitterPostID")] + public int TwitterPostId { get; set; } + + [Column("TwitterPostGUID")] + public Guid TwitterPostGuid { get; set; } + + public DateTime TwitterPostLastModified { get; set; } + + [Column("TwitterPostSiteID")] + public int TwitterPostSiteId { get; set; } + + [Column("TwitterPostTwitterAccountID")] + public int TwitterPostTwitterAccountId { get; set; } + + public string TwitterPostText { get; set; } = null!; + + [Column("TwitterPostURLShortenerType")] + public int? TwitterPostUrlshortenerType { get; set; } + + [Column("TwitterPostExternalID")] + public string? TwitterPostExternalId { get; set; } + + public int? TwitterPostErrorCode { get; set; } + + public DateTime? TwitterPostPublishedDateTime { get; set; } + + public DateTime? TwitterPostScheduledPublishDateTime { get; set; } + + [Column("TwitterPostCampaignID")] + public int? TwitterPostCampaignId { get; set; } + + public int? TwitterPostFavorites { get; set; } + + public int? TwitterPostRetweets { get; set; } + + public bool? TwitterPostPostAfterDocumentPublish { get; set; } + + public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } + + [Column("TwitterPostDocumentGUID")] + public Guid? TwitterPostDocumentGuid { get; set; } + + public bool? TwitterPostIsCreatedByUser { get; set; } + + [ForeignKey("TwitterPostCampaignId")] + [InverseProperty("SmTwitterPosts")] + public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } + + [ForeignKey("TwitterPostSiteId")] + [InverseProperty("SmTwitterPosts")] + public virtual CmsSite TwitterPostSite { get; set; } = null!; + + [ForeignKey("TwitterPostTwitterAccountId")] + [InverseProperty("SmTwitterPosts")] + public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/StagingServer.cs b/Migration.Toolkit.KX12/Models/StagingServer.cs index 11f1131c..f397e81b 100644 --- a/Migration.Toolkit.KX12/Models/StagingServer.cs +++ b/Migration.Toolkit.KX12/Models/StagingServer.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Staging_Server")] -[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] -[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] -public partial class StagingServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(100)] - public string ServerName { get; set; } = null!; - - [StringLength(440)] - public string ServerDisplayName { get; set; } = null!; - - [Column("ServerSiteID")] - public int ServerSiteId { get; set; } - - [Column("ServerURL")] - [StringLength(450)] - public string ServerUrl { get; set; } = null!; - - [Required] - public bool? ServerEnabled { get; set; } - - [StringLength(20)] - public string ServerAuthentication { get; set; } = null!; - - [StringLength(100)] - public string? ServerUsername { get; set; } - - [StringLength(100)] - public string? ServerPassword { get; set; } - - [Column("ServerX509ClientKeyID")] - [StringLength(200)] - public string? ServerX509clientKeyId { get; set; } - - [Column("ServerX509ServerKeyID")] - [StringLength(200)] - public string? ServerX509serverKeyId { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - [ForeignKey("ServerSiteId")] - [InverseProperty("StagingServers")] - public virtual CmsSite ServerSite { get; set; } = null!; - - [InverseProperty("SynchronizationServer")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Staging_Server")] +[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] +[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] +public class StagingServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(100)] + public string ServerName { get; set; } = null!; + + [StringLength(440)] + public string ServerDisplayName { get; set; } = null!; + + [Column("ServerSiteID")] + public int ServerSiteId { get; set; } + + [Column("ServerURL")] + [StringLength(450)] + public string ServerUrl { get; set; } = null!; + + [Required] + public bool? ServerEnabled { get; set; } + + [StringLength(20)] + public string ServerAuthentication { get; set; } = null!; + + [StringLength(100)] + public string? ServerUsername { get; set; } + + [StringLength(100)] + public string? ServerPassword { get; set; } + + [Column("ServerX509ClientKeyID")] + [StringLength(200)] + public string? ServerX509clientKeyId { get; set; } + + [Column("ServerX509ServerKeyID")] + [StringLength(200)] + public string? ServerX509serverKeyId { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + [ForeignKey("ServerSiteId")] + [InverseProperty("StagingServers")] + public virtual CmsSite ServerSite { get; set; } = null!; + + [InverseProperty("SynchronizationServer")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/StagingSynchronization.cs b/Migration.Toolkit.KX12/Models/StagingSynchronization.cs index 2ae2c62c..bf145fc7 100644 --- a/Migration.Toolkit.KX12/Models/StagingSynchronization.cs +++ b/Migration.Toolkit.KX12/Models/StagingSynchronization.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Staging_Synchronization")] -[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] -[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] -public partial class StagingSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationServerID")] - public int SynchronizationServerId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - [ForeignKey("SynchronizationServerId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingServer SynchronizationServer { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingTask SynchronizationTask { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Staging_Synchronization")] +[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] +[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] +public class StagingSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationServerID")] + public int SynchronizationServerId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + [ForeignKey("SynchronizationServerId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingServer SynchronizationServer { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/StagingTask.cs b/Migration.Toolkit.KX12/Models/StagingTask.cs index 6dd40a94..6b7539b7 100644 --- a/Migration.Toolkit.KX12/Models/StagingTask.cs +++ b/Migration.Toolkit.KX12/Models/StagingTask.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Staging_Task")] -[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] -[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] -[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Staging_Task_TaskType")] -public partial class StagingTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool? TaskRunning { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - public string? TaskServers { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("StagingTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Staging_Task")] +[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] +[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] +[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Staging_Task_TaskType")] +public class StagingTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool? TaskRunning { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + public string? TaskServers { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("StagingTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs index 78e19ae1..0922cfa8 100644 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs +++ b/Migration.Toolkit.KX12/Models/StagingTaskGroup.cs @@ -1,28 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("staging_TaskGroup")] -public partial class StagingTaskGroup -{ - [Key] - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [StringLength(50)] - public string TaskGroupCodeName { get; set; } = null!; - - public Guid TaskGroupGuid { get; set; } - - public string? TaskGroupDescription { get; set; } - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("staging_TaskGroup")] +public class StagingTaskGroup +{ + [Key] + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [StringLength(50)] + public string TaskGroupCodeName { get; set; } = null!; + + public Guid TaskGroupGuid { get; set; } + + public string? TaskGroupDescription { get; set; } + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs index 07a0feb5..89e27d07 100644 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs +++ b/Migration.Toolkit.KX12/Models/StagingTaskGroupTask.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("staging_TaskGroupTask")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] -[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] -public partial class StagingTaskGroupTask -{ - [Key] - [Column("TaskGroupTaskID")] - public int TaskGroupTaskId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("staging_TaskGroupTask")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] +[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] +public class StagingTaskGroupTask +{ + [Key] + [Column("TaskGroupTaskID")] + public int TaskGroupTaskId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs index d1e56def..c4ab0e10 100644 --- a/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs +++ b/Migration.Toolkit.KX12/Models/StagingTaskGroupUser.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("staging_TaskGroupUser")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] -[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] -public partial class StagingTaskGroupUser -{ - [Key] - [Column("TaskGroupUserID")] - public int TaskGroupUserId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupUsers")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskGroupUser")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("staging_TaskGroupUser")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] +[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] +public class StagingTaskGroupUser +{ + [Key] + [Column("TaskGroupUserID")] + public int TaskGroupUserId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupUsers")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskGroupUser")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/StagingTaskUser.cs b/Migration.Toolkit.KX12/Models/StagingTaskUser.cs index 42a7df04..0e5bdd05 100644 --- a/Migration.Toolkit.KX12/Models/StagingTaskUser.cs +++ b/Migration.Toolkit.KX12/Models/StagingTaskUser.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Staging_TaskUser")] -[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] -[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] -public partial class StagingTaskUser -{ - [Key] - [Column("TaskUserID")] - public int TaskUserId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskUsers")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Staging_TaskUser")] +[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] +[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] +public class StagingTaskUser +{ + [Key] + [Column("TaskUserID")] + public int TaskUserId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskUsers")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/TempFile.cs b/Migration.Toolkit.KX12/Models/TempFile.cs index 73fa95aa..a385ed49 100644 --- a/Migration.Toolkit.KX12/Models/TempFile.cs +++ b/Migration.Toolkit.KX12/Models/TempFile.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Temp_File")] -public partial class TempFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileParentGUID")] - public Guid FileParentGuid { get; set; } - - public int FileNumber { get; set; } - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - public long FileSize { get; set; } - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - public byte[]? FileBinary { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - public DateTime FileLastModified { get; set; } - - [StringLength(200)] - public string FileDirectory { get; set; } = null!; - - [StringLength(200)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string? FileTitle { get; set; } - - public string? FileDescription { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Temp_File")] +public class TempFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileParentGUID")] + public Guid FileParentGuid { get; set; } + + public int FileNumber { get; set; } + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + public long FileSize { get; set; } + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + public byte[]? FileBinary { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + public DateTime FileLastModified { get; set; } + + [StringLength(200)] + public string FileDirectory { get; set; } = null!; + + [StringLength(200)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string? FileTitle { get; set; } + + public string? FileDescription { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs index 84c8b631..495a3691 100644 --- a/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs +++ b/Migration.Toolkit.KX12/Models/TempPageBuilderWidget.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Table("Temp_PageBuilderWidgets")] -public partial class TempPageBuilderWidget -{ - [Key] - [Column("PageBuilderWidgetsID")] - public int PageBuilderWidgetsId { get; set; } - - public string? PageBuilderWidgetsConfiguration { get; set; } - - public Guid PageBuilderWidgetsGuid { get; set; } - - public DateTime PageBuilderWidgetsLastModified { get; set; } - - public string? PageBuilderTemplateConfiguration { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX12.Models; + +[Table("Temp_PageBuilderWidgets")] +public class TempPageBuilderWidget +{ + [Key] + [Column("PageBuilderWidgetsID")] + public int PageBuilderWidgetsId { get; set; } + + public string? PageBuilderWidgetsConfiguration { get; set; } + + public Guid PageBuilderWidgetsGuid { get; set; } + + public DateTime PageBuilderWidgetsLastModified { get; set; } + + public string? PageBuilderTemplateConfiguration { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs b/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs index cf031f70..6b715d91 100644 --- a/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewBoardsBoardMessageJoined.cs @@ -1,159 +1,158 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewBoardsBoardMessageJoined -{ - [Column("BoardID")] - public int BoardId { get; set; } - - [StringLength(250)] - public string BoardName { get; set; } = null!; - - [StringLength(250)] - public string BoardDisplayName { get; set; } = null!; - - public string BoardDescription { get; set; } = null!; - - public DateTime? BoardOpenedFrom { get; set; } - - public bool BoardOpened { get; set; } - - public DateTime? BoardOpenedTo { get; set; } - - public bool BoardEnabled { get; set; } - - public bool BoardModerated { get; set; } - - public int BoardAccess { get; set; } - - public bool BoardUseCaptcha { get; set; } - - public DateTime BoardLastModified { get; set; } - - public int BoardMessages { get; set; } - - [Column("BoardDocumentID")] - public int BoardDocumentId { get; set; } - - [Column("BoardGUID")] - public Guid BoardGuid { get; set; } - - [Column("BoardUserID")] - public int? BoardUserId { get; set; } - - [Column("BoardGroupID")] - public int? BoardGroupId { get; set; } - - public DateTime? BoardLastMessageTime { get; set; } - - [StringLength(250)] - public string? BoardLastMessageUserName { get; set; } - - [Column("BoardUnsubscriptionURL")] - [StringLength(450)] - public string? BoardUnsubscriptionUrl { get; set; } - - public bool? BoardRequireEmails { get; set; } - - [Column("BoardSiteID")] - public int BoardSiteId { get; set; } - - public bool BoardEnableSubscriptions { get; set; } - - [Column("BoardBaseURL")] - [StringLength(450)] - public string? BoardBaseUrl { get; set; } - - [Column("MessageID")] - public int MessageId { get; set; } - - [StringLength(250)] - public string MessageUserName { get; set; } = null!; - - public string MessageText { get; set; } = null!; - - [StringLength(254)] - public string MessageEmail { get; set; } = null!; - - [Column("MessageURL")] - [StringLength(450)] - public string MessageUrl { get; set; } = null!; - - public bool MessageIsSpam { get; set; } - - [Column("MessageBoardID")] - public int MessageBoardId { get; set; } - - public bool MessageApproved { get; set; } - - [Column("MessageUserID")] - public int? MessageUserId { get; set; } - - [Column("MessageApprovedByUserID")] - public int? MessageApprovedByUserId { get; set; } - - public string MessageUserInfo { get; set; } = null!; - - [Column("MessageAvatarGUID")] - public Guid? MessageAvatarGuid { get; set; } - - public DateTime MessageInserted { get; set; } - - public DateTime MessageLastModified { get; set; } - - [Column("MessageGUID")] - public Guid MessageGuid { get; set; } - - public double? MessageRatingValue { get; set; } - - [Column("GroupID")] - public int? GroupId { get; set; } - - [Column("GroupGUID")] - public Guid? GroupGuid { get; set; } - - public DateTime? GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int? GroupSiteId { get; set; } - - [StringLength(200)] - public string? GroupDisplayName { get; set; } - - [StringLength(100)] - public string? GroupName { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int? GroupApproveMembers { get; set; } - - public int? GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime? GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewBoardsBoardMessageJoined +{ + [Column("BoardID")] + public int BoardId { get; set; } + + [StringLength(250)] + public string BoardName { get; set; } = null!; + + [StringLength(250)] + public string BoardDisplayName { get; set; } = null!; + + public string BoardDescription { get; set; } = null!; + + public DateTime? BoardOpenedFrom { get; set; } + + public bool BoardOpened { get; set; } + + public DateTime? BoardOpenedTo { get; set; } + + public bool BoardEnabled { get; set; } + + public bool BoardModerated { get; set; } + + public int BoardAccess { get; set; } + + public bool BoardUseCaptcha { get; set; } + + public DateTime BoardLastModified { get; set; } + + public int BoardMessages { get; set; } + + [Column("BoardDocumentID")] + public int BoardDocumentId { get; set; } + + [Column("BoardGUID")] + public Guid BoardGuid { get; set; } + + [Column("BoardUserID")] + public int? BoardUserId { get; set; } + + [Column("BoardGroupID")] + public int? BoardGroupId { get; set; } + + public DateTime? BoardLastMessageTime { get; set; } + + [StringLength(250)] + public string? BoardLastMessageUserName { get; set; } + + [Column("BoardUnsubscriptionURL")] + [StringLength(450)] + public string? BoardUnsubscriptionUrl { get; set; } + + public bool? BoardRequireEmails { get; set; } + + [Column("BoardSiteID")] + public int BoardSiteId { get; set; } + + public bool BoardEnableSubscriptions { get; set; } + + [Column("BoardBaseURL")] + [StringLength(450)] + public string? BoardBaseUrl { get; set; } + + [Column("MessageID")] + public int MessageId { get; set; } + + [StringLength(250)] + public string MessageUserName { get; set; } = null!; + + public string MessageText { get; set; } = null!; + + [StringLength(254)] + public string MessageEmail { get; set; } = null!; + + [Column("MessageURL")] + [StringLength(450)] + public string MessageUrl { get; set; } = null!; + + public bool MessageIsSpam { get; set; } + + [Column("MessageBoardID")] + public int MessageBoardId { get; set; } + + public bool MessageApproved { get; set; } + + [Column("MessageUserID")] + public int? MessageUserId { get; set; } + + [Column("MessageApprovedByUserID")] + public int? MessageApprovedByUserId { get; set; } + + public string MessageUserInfo { get; set; } = null!; + + [Column("MessageAvatarGUID")] + public Guid? MessageAvatarGuid { get; set; } + + public DateTime MessageInserted { get; set; } + + public DateTime MessageLastModified { get; set; } + + [Column("MessageGUID")] + public Guid MessageGuid { get; set; } + + public double? MessageRatingValue { get; set; } + + [Column("GroupID")] + public int? GroupId { get; set; } + + [Column("GroupGUID")] + public Guid? GroupGuid { get; set; } + + public DateTime? GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int? GroupSiteId { get; set; } + + [StringLength(200)] + public string? GroupDisplayName { get; set; } + + [StringLength(100)] + public string? GroupName { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int? GroupApproveMembers { get; set; } + + public int? GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime? GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs index cd8bb71e..897ac4d0 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsAclitemItemsAndOperator.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsAclitemItemsAndOperator -{ - [Column("ACLOwnerNodeID")] - public int AclownerNodeId { get; set; } - - [Column("ACLItemID")] - public int AclitemId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - [StringLength(51)] - public string? Operator { get; set; } - - [StringLength(100)] - public string? OperatorName { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [StringLength(450)] - public string? OperatorFullName { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsAclitemItemsAndOperator +{ + [Column("ACLOwnerNodeID")] + public int AclownerNodeId { get; set; } + + [Column("ACLItemID")] + public int AclitemId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + [StringLength(51)] + public string? Operator { get; set; } + + [StringLength(100)] + public string? OperatorName { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [StringLength(450)] + public string? OperatorFullName { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs index b2142646..2fc43cac 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -1,124 +1,123 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsObjectVersionHistoryUserJoined -{ - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(100)] - public string? UserName { get; set; } - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string? UserPassword { get; set; } - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool? UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid? UserGuid { get; set; } - - public DateTime? UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int? UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsObjectVersionHistoryUserJoined +{ + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(100)] + public string? UserName { get; set; } + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string? UserPassword { get; set; } + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool? UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid? UserGuid { get; set; } + + public DateTime? UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int? UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs index 3c96bffe..6f30d28f 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -1,58 +1,57 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsPageTemplateCategoryPageTemplateJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string? CodeName { get; set; } - - [StringLength(200)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [StringLength(20)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - public bool? Parameter { get; set; } - - public int? PageTemplateForAllPages { get; set; } - - [StringLength(10)] - public string? PageTemplateType { get; set; } - - public int? PageTemplateIsReusable { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsPageTemplateCategoryPageTemplateJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string? CodeName { get; set; } + + [StringLength(200)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [StringLength(20)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + public bool? Parameter { get; set; } + + public int? PageTemplateForAllPages { get; set; } + + [StringLength(10)] + public string? PageTemplateType { get; set; } + + public int? PageTemplateIsReusable { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs index c1c7b027..187cae57 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsRelationshipJoined.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsRelationshipJoined -{ - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("LeftNodeGUID")] - public Guid LeftNodeGuid { get; set; } - - [StringLength(100)] - public string LeftNodeName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RightNodeGUID")] - public Guid RightNodeGuid { get; set; } - - [StringLength(100)] - public string RightNodeName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - public string? RelationshipCustomData { get; set; } - - [Column("LeftClassID")] - public int LeftClassId { get; set; } - - [Column("RightClassID")] - public int RightClassId { get; set; } - - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - public int? RelationshipOrder { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsRelationshipJoined +{ + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("LeftNodeGUID")] + public Guid LeftNodeGuid { get; set; } + + [StringLength(100)] + public string LeftNodeName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RightNodeGUID")] + public Guid RightNodeGuid { get; set; } + + [StringLength(100)] + public string RightNodeName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + public string? RelationshipCustomData { get; set; } + + [Column("LeftClassID")] + public int LeftClassId { get; set; } + + [Column("RightClassID")] + public int RightClassId { get; set; } + + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + public int? RelationshipOrder { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs index 7a027bee..800adb75 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsResourceStringJoined.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsResourceStringJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("TranslationID")] - public int? TranslationId { get; set; } - - [Column("TranslationStringID")] - public int? TranslationStringId { get; set; } - - [Column("TranslationCultureID")] - public int? TranslationCultureId { get; set; } - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int? CultureId { get; set; } - - [StringLength(200)] - public string? CultureName { get; set; } - - [StringLength(50)] - public string? CultureCode { get; set; } - - [Column("CultureGUID")] - public Guid? CultureGuid { get; set; } - - public DateTime? CultureLastModified { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsResourceStringJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("TranslationID")] + public int? TranslationId { get; set; } + + [Column("TranslationStringID")] + public int? TranslationStringId { get; set; } + + [Column("TranslationCultureID")] + public int? TranslationCultureId { get; set; } + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int? CultureId { get; set; } + + [StringLength(200)] + public string? CultureName { get; set; } + + [StringLength(50)] + public string? CultureCode { get; set; } + + [Column("CultureGUID")] + public Guid? CultureGuid { get; set; } + + public DateTime? CultureLastModified { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs index 7c3d7ad3..245bafe0 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsResourceTranslatedJoined.cs @@ -1,28 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsResourceTranslatedJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsResourceTranslatedJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs index 9ccffe05..eff53eab 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -1,23 +1,22 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsRoleResourcePermissionJoined -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("PermissionID")] - public int PermissionId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsRoleResourcePermissionJoined +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("PermissionID")] + public int PermissionId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs index d87e4399..f5179061 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsSiteDocumentCount.cs @@ -1,47 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsSiteDocumentCount -{ - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [Column("SiteDefaultStylesheetID")] - public int? SiteDefaultStylesheetId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - public int? SiteDefaultEditorStylesheet { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - public bool? SiteIsContentOnly { get; set; } - - public int? Documents { get; set; } - - public bool? SiteIsOffline { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsSiteDocumentCount +{ + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [Column("SiteDefaultStylesheetID")] + public int? SiteDefaultStylesheetId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + public int? SiteDefaultEditorStylesheet { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + public bool? SiteIsContentOnly { get; set; } + + public int? Documents { get; set; } + + public bool? SiteIsOffline { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs index 482d3dc8..1b4296ec 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsSiteRoleResourceUielementJoined -{ - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(100)] - public string? SiteName { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [Column("RoleSiteID")] - public int? RoleSiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsSiteRoleResourceUielementJoined +{ + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(100)] + public string? SiteName { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [Column("RoleSiteID")] + public int? RoleSiteId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs index ea0ee116..080db2ae 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsTreeJoined.cs @@ -1,299 +1,298 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsTreeJoined -{ - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - public int? NodeCacheMinutes { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - public string? NodeDocType { get; set; } - - public string? NodeHeadTags { get; set; } - - public string? NodeBodyElementAttributes { get; set; } - - [StringLength(200)] - public string? NodeInheritPageLevels { get; set; } - - [Column("RequiresSSL")] - public int? RequiresSsl { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeGroupID")] - public int? NodeGroupId { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - [Column("NodeTemplateID")] - public int? NodeTemplateId { get; set; } - - public bool? NodeTemplateForAllCultures { get; set; } - - public bool? NodeInheritPageTemplate { get; set; } - - public bool? NodeAllowCacheInFileSystem { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - public bool NodeIsContentOnly { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - public string? NodeBodyScripts { get; set; } - - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - [StringLength(450)] - public string? DocumentUrlPath { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public bool DocumentShowInSiteMap { get; set; } - - public bool DocumentMenuItemHideInNavigation { get; set; } - - [StringLength(200)] - public string? DocumentMenuCaption { get; set; } - - [StringLength(100)] - public string? DocumentMenuStyle { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImage { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImage { get; set; } - - [Column("DocumentPageTemplateID")] - public int? DocumentPageTemplateId { get; set; } - - [StringLength(450)] - public string? DocumentMenuJavascript { get; set; } - - [StringLength(450)] - public string? DocumentMenuRedirectUrl { get; set; } - - public bool? DocumentUseNamePathForUrlPath { get; set; } - - [Column("DocumentStylesheetID")] - public int? DocumentStylesheetId { get; set; } - - public string? DocumentContent { get; set; } - - [StringLength(100)] - public string? DocumentMenuClass { get; set; } - - [StringLength(200)] - public string? DocumentMenuStyleHighlighted { get; set; } - - [StringLength(100)] - public string? DocumentMenuClassHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemLeftImageHighlighted { get; set; } - - [StringLength(200)] - public string? DocumentMenuItemRightImageHighlighted { get; set; } - - public bool? DocumentMenuItemInactive { get; set; } - - public string? DocumentCustomData { get; set; } - - [StringLength(100)] - public string? DocumentExtensions { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - [StringLength(440)] - public string? DocumentWildcardRule { get; set; } - - public string? DocumentWebParts { get; set; } - - public double? DocumentRatingValue { get; set; } - - public int? DocumentRatings { get; set; } - - public int? DocumentPriority { get; set; } - - [StringLength(50)] - public string? DocumentType { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentUseCustomExtensions { get; set; } - - public string? DocumentGroupWebParts { get; set; } - - public bool? DocumentCheckedOutAutomatically { get; set; } - - [StringLength(200)] - public string? DocumentTrackConversionName { get; set; } - - [StringLength(100)] - public string? DocumentConversionValue { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [StringLength(32)] - public string? DocumentHash { get; set; } - - public bool? DocumentLogVisitActivity { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - [StringLength(100)] - public string? DocumentSitemapSettings { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool? DocumentMenuRedirectToFirstChild { get; set; } - - public bool DocumentCanBePublished { get; set; } - - public bool DocumentInheritsStylesheet { get; set; } - - public string? DocumentPageBuilderWidgets { get; set; } - - public string? DocumentPageTemplateConfiguration { get; set; } - - [Column("DocumentABTestConfiguration")] - public string? DocumentAbtestConfiguration { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsTreeJoined +{ + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + public int? NodeCacheMinutes { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + public string? NodeDocType { get; set; } + + public string? NodeHeadTags { get; set; } + + public string? NodeBodyElementAttributes { get; set; } + + [StringLength(200)] + public string? NodeInheritPageLevels { get; set; } + + [Column("RequiresSSL")] + public int? RequiresSsl { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeGroupID")] + public int? NodeGroupId { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + [Column("NodeTemplateID")] + public int? NodeTemplateId { get; set; } + + public bool? NodeTemplateForAllCultures { get; set; } + + public bool? NodeInheritPageTemplate { get; set; } + + public bool? NodeAllowCacheInFileSystem { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + public bool NodeIsContentOnly { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + public string? NodeBodyScripts { get; set; } + + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + [StringLength(450)] + public string? DocumentUrlPath { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public bool DocumentShowInSiteMap { get; set; } + + public bool DocumentMenuItemHideInNavigation { get; set; } + + [StringLength(200)] + public string? DocumentMenuCaption { get; set; } + + [StringLength(100)] + public string? DocumentMenuStyle { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImage { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImage { get; set; } + + [Column("DocumentPageTemplateID")] + public int? DocumentPageTemplateId { get; set; } + + [StringLength(450)] + public string? DocumentMenuJavascript { get; set; } + + [StringLength(450)] + public string? DocumentMenuRedirectUrl { get; set; } + + public bool? DocumentUseNamePathForUrlPath { get; set; } + + [Column("DocumentStylesheetID")] + public int? DocumentStylesheetId { get; set; } + + public string? DocumentContent { get; set; } + + [StringLength(100)] + public string? DocumentMenuClass { get; set; } + + [StringLength(200)] + public string? DocumentMenuStyleHighlighted { get; set; } + + [StringLength(100)] + public string? DocumentMenuClassHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemLeftImageHighlighted { get; set; } + + [StringLength(200)] + public string? DocumentMenuItemRightImageHighlighted { get; set; } + + public bool? DocumentMenuItemInactive { get; set; } + + public string? DocumentCustomData { get; set; } + + [StringLength(100)] + public string? DocumentExtensions { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + [StringLength(440)] + public string? DocumentWildcardRule { get; set; } + + public string? DocumentWebParts { get; set; } + + public double? DocumentRatingValue { get; set; } + + public int? DocumentRatings { get; set; } + + public int? DocumentPriority { get; set; } + + [StringLength(50)] + public string? DocumentType { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentUseCustomExtensions { get; set; } + + public string? DocumentGroupWebParts { get; set; } + + public bool? DocumentCheckedOutAutomatically { get; set; } + + [StringLength(200)] + public string? DocumentTrackConversionName { get; set; } + + [StringLength(100)] + public string? DocumentConversionValue { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [StringLength(32)] + public string? DocumentHash { get; set; } + + public bool? DocumentLogVisitActivity { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + [StringLength(100)] + public string? DocumentSitemapSettings { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool? DocumentMenuRedirectToFirstChild { get; set; } + + public bool DocumentCanBePublished { get; set; } + + public bool DocumentInheritsStylesheet { get; set; } + + public string? DocumentPageBuilderWidgets { get; set; } + + public string? DocumentPageTemplateConfiguration { get; set; } + + [Column("DocumentABTestConfiguration")] + public string? DocumentAbtestConfiguration { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUser.cs b/Migration.Toolkit.KX12/Models/ViewCmsUser.cs index 893a731e..bdbf827c 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUser.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUser.cs @@ -1,215 +1,214 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsUser -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsUser +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs index 4887bb89..4b538876 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserDocument.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsUserDocument -{ - [StringLength(450)] - public string DocumentName { get; set; } = null!; - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(1500)] - public string? DocumentNamePath { get; set; } - - public DateTime? DocumentModifiedWhen { get; set; } - - [StringLength(10)] - public string DocumentCulture { get; set; } = null!; - - [StringLength(200)] - public string? CultureName { get; set; } - - [Column("UserID1")] - public int? UserId1 { get; set; } - - [Column("UserID2")] - public int? UserId2 { get; set; } - - [Column("UserID3")] - public int? UserId3 { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(12)] - [Unicode(false)] - public string Type { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsUserDocument +{ + [StringLength(450)] + public string DocumentName { get; set; } = null!; + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(1500)] + public string? DocumentNamePath { get; set; } + + public DateTime? DocumentModifiedWhen { get; set; } + + [StringLength(10)] + public string DocumentCulture { get; set; } = null!; + + [StringLength(200)] + public string? CultureName { get; set; } + + [Column("UserID1")] + public int? UserId1 { get; set; } + + [Column("UserID2")] + public int? UserId2 { get; set; } + + [Column("UserID3")] + public int? UserId3 { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(12)] + [Unicode(false)] + public string Type { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs index 2c61a333..53c3c05b 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleJoined.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsUserRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - [Column("RoleGroupID")] - public int? RoleGroupId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [StringLength(100)] - public string? SiteName { get; set; } - - [Column("SiteGUID")] - public Guid? SiteGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsUserRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + [Column("RoleGroupID")] + public int? RoleGroupId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [StringLength(100)] + public string? SiteName { get; set; } + + [Column("SiteGUID")] + public Guid? SiteGuid { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs index af8f9baa..1d57ae5b 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRole.cs @@ -1,25 +1,24 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsUserRoleMembershipRole -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRole +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs index cc18e998..36b03f2c 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -1,19 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRoleValidOnlyJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs index 27939fad..c22f8a54 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsUserSettingsRoleJoined.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsUserSettingsRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - public bool UserEnabled { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsUserSettingsRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + public bool UserEnabled { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs index 2017441a..8b6d350a 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -1,68 +1,67 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsWebPartCategoryWebpartJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - [StringLength(100)] - public string? WebPartFileName { get; set; } - - [Column("WebPartGUID")] - public Guid? WebPartGuid { get; set; } - - public int? WebPartType { get; set; } - - [StringLength(1000)] - public string? WebPartDescription { get; set; } - - [StringLength(15)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - [Column("ThumbnailGUID")] - public Guid? ThumbnailGuid { get; set; } - - [StringLength(200)] - public string? IconClass { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsWebPartCategoryWebpartJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + [StringLength(100)] + public string? WebPartFileName { get; set; } + + [Column("WebPartGUID")] + public Guid? WebPartGuid { get; set; } + + public int? WebPartType { get; set; } + + [StringLength(1000)] + public string? WebPartDescription { get; set; } + + [StringLength(15)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + [Column("ThumbnailGUID")] + public Guid? ThumbnailGuid { get; set; } + + [StringLength(200)] + public string? IconClass { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs index 9a29d26e..c6325de5 100644 --- a/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCmsWidgetCategoryWidgetJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WidgetWebPartID")] - public int? WidgetWebPartId { get; set; } - - public int WidgetSecurity { get; set; } - - public bool? WidgetForGroup { get; set; } - - public bool? WidgetForInline { get; set; } - - public bool? WidgetForUser { get; set; } - - public bool? WidgetForEditor { get; set; } - - public bool? WidgetForDashboard { get; set; } - - [Column("WidgetGUID")] - public Guid? WidgetGuid { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCmsWidgetCategoryWidgetJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WidgetWebPartID")] + public int? WidgetWebPartId { get; set; } + + public int WidgetSecurity { get; set; } + + public bool? WidgetForGroup { get; set; } + + public bool? WidgetForInline { get; set; } + + public bool? WidgetForUser { get; set; } + + public bool? WidgetForEditor { get; set; } + + public bool? WidgetForDashboard { get; set; } + + [Column("WidgetGUID")] + public Guid? WidgetGuid { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs index 2cf6b1d9..2290cc5d 100644 --- a/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewComSkuoptionCategoryOptionCategoryJoined -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - public bool CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewComSkuoptionCategoryOptionCategoryJoined +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + public bool CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs b/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs index 6c701253..ff233687 100644 --- a/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs +++ b/Migration.Toolkit.KX12/Models/ViewCommunityGroup.cs @@ -1,67 +1,66 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCommunityGroup -{ - [Column("GroupID")] - public int GroupId { get; set; } - - [Column("GroupGUID")] - public Guid GroupGuid { get; set; } - - public DateTime GroupLastModified { get; set; } - - [Column("GroupSiteID")] - public int GroupSiteId { get; set; } - - [StringLength(200)] - public string GroupDisplayName { get; set; } = null!; - - [StringLength(100)] - public string GroupName { get; set; } = null!; - - public string GroupDescription { get; set; } = null!; - - [Column("GroupNodeGUID")] - public Guid? GroupNodeGuid { get; set; } - - public int GroupApproveMembers { get; set; } - - public int GroupAccess { get; set; } - - [Column("GroupCreatedByUserID")] - public int? GroupCreatedByUserId { get; set; } - - [Column("GroupApprovedByUserID")] - public int? GroupApprovedByUserId { get; set; } - - [Column("GroupAvatarID")] - public int? GroupAvatarId { get; set; } - - public bool? GroupApproved { get; set; } - - public DateTime GroupCreatedWhen { get; set; } - - public bool? GroupSendJoinLeaveNotification { get; set; } - - public bool? GroupSendWaitingForApprovalNotification { get; set; } - - public int? GroupSecurity { get; set; } - - public bool? GroupLogActivity { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCommunityGroup +{ + [Column("GroupID")] + public int GroupId { get; set; } + + [Column("GroupGUID")] + public Guid GroupGuid { get; set; } + + public DateTime GroupLastModified { get; set; } + + [Column("GroupSiteID")] + public int GroupSiteId { get; set; } + + [StringLength(200)] + public string GroupDisplayName { get; set; } = null!; + + [StringLength(100)] + public string GroupName { get; set; } = null!; + + public string GroupDescription { get; set; } = null!; + + [Column("GroupNodeGUID")] + public Guid? GroupNodeGuid { get; set; } + + public int GroupApproveMembers { get; set; } + + public int GroupAccess { get; set; } + + [Column("GroupCreatedByUserID")] + public int? GroupCreatedByUserId { get; set; } + + [Column("GroupApprovedByUserID")] + public int? GroupApprovedByUserId { get; set; } + + [Column("GroupAvatarID")] + public int? GroupAvatarId { get; set; } + + public bool? GroupApproved { get; set; } + + public DateTime GroupCreatedWhen { get; set; } + + public bool? GroupSendJoinLeaveNotification { get; set; } + + public bool? GroupSendWaitingForApprovalNotification { get; set; } + + public int? GroupSecurity { get; set; } + + public bool? GroupLogActivity { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs b/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs index ab8afeee..aec483bc 100644 --- a/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs +++ b/Migration.Toolkit.KX12/Models/ViewCommunityMember.cs @@ -1,246 +1,245 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewCommunityMember -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(10)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(10)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public string? UserVisibility { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - [StringLength(200)] - public string? UserPicture { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public string? UserPreferences { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - [Column("UserBadgeID")] - public int? UserBadgeId { get; set; } - - public int? UserActivityPoints { get; set; } - - public int? UserForumPosts { get; set; } - - public int? UserBlogComments { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - public int? UserMessageBoardPosts { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - [Column("WindowsLiveID")] - [StringLength(50)] - public string? WindowsLiveId { get; set; } - - public int? UserBlogPosts { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [StringLength(1000)] - public string? UserUsedWebParts { get; set; } - - [StringLength(1000)] - public string? UserUsedWidgets { get; set; } - - [Column("UserFacebookID")] - [StringLength(100)] - public string? UserFacebookId { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - [Column("UserLinkedInID")] - [StringLength(100)] - public string? UserLinkedInId { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - [StringLength(200)] - public string? UserAvatarType { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("MemberID")] - public int? MemberId { get; set; } - - [Column("MemberGUID")] - public Guid? MemberGuid { get; set; } - - [Column("MemberUserID")] - public int? MemberUserId { get; set; } - - [Column("MemberGroupID")] - public int? MemberGroupId { get; set; } - - public DateTime? MemberJoined { get; set; } - - public DateTime? MemberApprovedWhen { get; set; } - - public DateTime? MemberRejectedWhen { get; set; } - - [Column("MemberApprovedByUserID")] - public int? MemberApprovedByUserId { get; set; } - - public string? MemberComment { get; set; } - - [Column("MemberInvitedByUserID")] - public int? MemberInvitedByUserId { get; set; } - - public int? MemberStatus { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewCommunityMember +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(10)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(10)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public string? UserVisibility { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + [StringLength(200)] + public string? UserPicture { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public string? UserPreferences { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + [Column("UserBadgeID")] + public int? UserBadgeId { get; set; } + + public int? UserActivityPoints { get; set; } + + public int? UserForumPosts { get; set; } + + public int? UserBlogComments { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + public int? UserMessageBoardPosts { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + [Column("WindowsLiveID")] + [StringLength(50)] + public string? WindowsLiveId { get; set; } + + public int? UserBlogPosts { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [StringLength(1000)] + public string? UserUsedWebParts { get; set; } + + [StringLength(1000)] + public string? UserUsedWidgets { get; set; } + + [Column("UserFacebookID")] + [StringLength(100)] + public string? UserFacebookId { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + [Column("UserLinkedInID")] + [StringLength(100)] + public string? UserLinkedInId { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + [StringLength(200)] + public string? UserAvatarType { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("MemberID")] + public int? MemberId { get; set; } + + [Column("MemberGUID")] + public Guid? MemberGuid { get; set; } + + [Column("MemberUserID")] + public int? MemberUserId { get; set; } + + [Column("MemberGroupID")] + public int? MemberGroupId { get; set; } + + public DateTime? MemberJoined { get; set; } + + public DateTime? MemberApprovedWhen { get; set; } + + public DateTime? MemberRejectedWhen { get; set; } + + [Column("MemberApprovedByUserID")] + public int? MemberApprovedByUserId { get; set; } + + public string? MemberComment { get; set; } + + [Column("MemberInvitedByUserID")] + public int? MemberInvitedByUserId { get; set; } + + public int? MemberStatus { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs b/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs index 018090c2..19649d18 100644 --- a/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewForumsGroupForumPostJoined.cs @@ -1,228 +1,227 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewForumsGroupForumPostJoined -{ - [Column("ForumID")] - public int? ForumId { get; set; } - - [Column("ForumGroupID")] - public int? ForumGroupId { get; set; } - - [StringLength(200)] - public string? ForumName { get; set; } - - [StringLength(200)] - public string? ForumDisplayName { get; set; } - - public string? ForumDescription { get; set; } - - public int? ForumOrder { get; set; } - - [Column("ForumDocumentID")] - public int? ForumDocumentId { get; set; } - - public bool? ForumOpen { get; set; } - - public bool? ForumModerated { get; set; } - - public bool? ForumDisplayEmails { get; set; } - - public bool? ForumRequireEmail { get; set; } - - public int? ForumAccess { get; set; } - - public int? ForumThreads { get; set; } - - public int? ForumPosts { get; set; } - - public DateTime? ForumLastPostTime { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserName { get; set; } - - [StringLength(200)] - public string? ForumBaseUrl { get; set; } - - public bool? ForumAllowChangeName { get; set; } - - [Column("ForumHTMLEditor")] - public bool? ForumHtmleditor { get; set; } - - [Column("ForumUseCAPTCHA")] - public bool? ForumUseCaptcha { get; set; } - - [Column("ForumGUID")] - public Guid? ForumGuid { get; set; } - - public DateTime? ForumLastModified { get; set; } - - [StringLength(200)] - public string? ForumUnsubscriptionUrl { get; set; } - - public bool? ForumIsLocked { get; set; } - - public string? ForumSettings { get; set; } - - public bool? ForumAuthorEdit { get; set; } - - public bool? ForumAuthorDelete { get; set; } - - public int? ForumType { get; set; } - - public int? ForumIsAnswerLimit { get; set; } - - public int? ForumImageMaxSideSize { get; set; } - - public DateTime? ForumLastPostTimeAbsolute { get; set; } - - [StringLength(200)] - public string? ForumLastPostUserNameAbsolute { get; set; } - - public int? ForumPostsAbsolute { get; set; } - - public int? ForumThreadsAbsolute { get; set; } - - public int? ForumAttachmentMaxFileSize { get; set; } - - public int? ForumDiscussionActions { get; set; } - - [Column("ForumSiteID")] - public int? ForumSiteId { get; set; } - - [Column("GroupID")] - public int? GroupId { get; set; } - - [Column("GroupSiteID")] - public int? GroupSiteId { get; set; } - - [StringLength(200)] - public string? GroupName { get; set; } - - [StringLength(200)] - public string? GroupDisplayName { get; set; } - - public int? GroupOrder { get; set; } - - public string? GroupDescription { get; set; } - - [Column("GroupGUID")] - public Guid? GroupGuid { get; set; } - - public DateTime? GroupLastModified { get; set; } - - [StringLength(200)] - public string? GroupBaseUrl { get; set; } - - [StringLength(200)] - public string? GroupUnsubscriptionUrl { get; set; } - - [Column("GroupGroupID")] - public int? GroupGroupId { get; set; } - - public bool? GroupAuthorEdit { get; set; } - - public bool? GroupAuthorDelete { get; set; } - - public int? GroupType { get; set; } - - public int? GroupIsAnswerLimit { get; set; } - - public int? GroupImageMaxSideSize { get; set; } - - public bool? GroupDisplayEmails { get; set; } - - public bool? GroupRequireEmail { get; set; } - - [Column("GroupHTMLEditor")] - public bool? GroupHtmleditor { get; set; } - - [Column("GroupUseCAPTCHA")] - public bool? GroupUseCaptcha { get; set; } - - public int? GroupAttachmentMaxFileSize { get; set; } - - public int? GroupDiscussionActions { get; set; } - - public int PostId { get; set; } - - [Column("PostForumID")] - public int PostForumId { get; set; } - - [Column("PostParentID")] - public int? PostParentId { get; set; } - - [Column("PostIDPath")] - [StringLength(450)] - public string PostIdpath { get; set; } = null!; - - public int PostLevel { get; set; } - - [StringLength(450)] - public string PostSubject { get; set; } = null!; - - [Column("PostUserID")] - public int? PostUserId { get; set; } - - [StringLength(200)] - public string PostUserName { get; set; } = null!; - - [StringLength(254)] - public string? PostUserMail { get; set; } - - public string? PostText { get; set; } - - public DateTime PostTime { get; set; } - - [Column("PostApprovedByUserID")] - public int? PostApprovedByUserId { get; set; } - - public int? PostThreadPosts { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserName { get; set; } - - public DateTime? PostThreadLastPostTime { get; set; } - - public string? PostUserSignature { get; set; } - - [Column("PostGUID")] - public Guid PostGuid { get; set; } - - public DateTime PostLastModified { get; set; } - - public bool? PostApproved { get; set; } - - public bool? PostIsLocked { get; set; } - - public int? PostIsAnswer { get; set; } - - public int PostStickOrder { get; set; } - - public int? PostViews { get; set; } - - public DateTime? PostLastEdit { get; set; } - - public string? PostInfo { get; set; } - - public int? PostAttachmentCount { get; set; } - - public int? PostType { get; set; } - - public int? PostThreadPostsAbsolute { get; set; } - - [StringLength(200)] - public string? PostThreadLastPostUserNameAbsolute { get; set; } - - public DateTime? PostThreadLastPostTimeAbsolute { get; set; } - - public bool? PostQuestionSolved { get; set; } - - public int? PostIsNotAnswer { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewForumsGroupForumPostJoined +{ + [Column("ForumID")] + public int? ForumId { get; set; } + + [Column("ForumGroupID")] + public int? ForumGroupId { get; set; } + + [StringLength(200)] + public string? ForumName { get; set; } + + [StringLength(200)] + public string? ForumDisplayName { get; set; } + + public string? ForumDescription { get; set; } + + public int? ForumOrder { get; set; } + + [Column("ForumDocumentID")] + public int? ForumDocumentId { get; set; } + + public bool? ForumOpen { get; set; } + + public bool? ForumModerated { get; set; } + + public bool? ForumDisplayEmails { get; set; } + + public bool? ForumRequireEmail { get; set; } + + public int? ForumAccess { get; set; } + + public int? ForumThreads { get; set; } + + public int? ForumPosts { get; set; } + + public DateTime? ForumLastPostTime { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserName { get; set; } + + [StringLength(200)] + public string? ForumBaseUrl { get; set; } + + public bool? ForumAllowChangeName { get; set; } + + [Column("ForumHTMLEditor")] + public bool? ForumHtmleditor { get; set; } + + [Column("ForumUseCAPTCHA")] + public bool? ForumUseCaptcha { get; set; } + + [Column("ForumGUID")] + public Guid? ForumGuid { get; set; } + + public DateTime? ForumLastModified { get; set; } + + [StringLength(200)] + public string? ForumUnsubscriptionUrl { get; set; } + + public bool? ForumIsLocked { get; set; } + + public string? ForumSettings { get; set; } + + public bool? ForumAuthorEdit { get; set; } + + public bool? ForumAuthorDelete { get; set; } + + public int? ForumType { get; set; } + + public int? ForumIsAnswerLimit { get; set; } + + public int? ForumImageMaxSideSize { get; set; } + + public DateTime? ForumLastPostTimeAbsolute { get; set; } + + [StringLength(200)] + public string? ForumLastPostUserNameAbsolute { get; set; } + + public int? ForumPostsAbsolute { get; set; } + + public int? ForumThreadsAbsolute { get; set; } + + public int? ForumAttachmentMaxFileSize { get; set; } + + public int? ForumDiscussionActions { get; set; } + + [Column("ForumSiteID")] + public int? ForumSiteId { get; set; } + + [Column("GroupID")] + public int? GroupId { get; set; } + + [Column("GroupSiteID")] + public int? GroupSiteId { get; set; } + + [StringLength(200)] + public string? GroupName { get; set; } + + [StringLength(200)] + public string? GroupDisplayName { get; set; } + + public int? GroupOrder { get; set; } + + public string? GroupDescription { get; set; } + + [Column("GroupGUID")] + public Guid? GroupGuid { get; set; } + + public DateTime? GroupLastModified { get; set; } + + [StringLength(200)] + public string? GroupBaseUrl { get; set; } + + [StringLength(200)] + public string? GroupUnsubscriptionUrl { get; set; } + + [Column("GroupGroupID")] + public int? GroupGroupId { get; set; } + + public bool? GroupAuthorEdit { get; set; } + + public bool? GroupAuthorDelete { get; set; } + + public int? GroupType { get; set; } + + public int? GroupIsAnswerLimit { get; set; } + + public int? GroupImageMaxSideSize { get; set; } + + public bool? GroupDisplayEmails { get; set; } + + public bool? GroupRequireEmail { get; set; } + + [Column("GroupHTMLEditor")] + public bool? GroupHtmleditor { get; set; } + + [Column("GroupUseCAPTCHA")] + public bool? GroupUseCaptcha { get; set; } + + public int? GroupAttachmentMaxFileSize { get; set; } + + public int? GroupDiscussionActions { get; set; } + + public int PostId { get; set; } + + [Column("PostForumID")] + public int PostForumId { get; set; } + + [Column("PostParentID")] + public int? PostParentId { get; set; } + + [Column("PostIDPath")] + [StringLength(450)] + public string PostIdpath { get; set; } = null!; + + public int PostLevel { get; set; } + + [StringLength(450)] + public string PostSubject { get; set; } = null!; + + [Column("PostUserID")] + public int? PostUserId { get; set; } + + [StringLength(200)] + public string PostUserName { get; set; } = null!; + + [StringLength(254)] + public string? PostUserMail { get; set; } + + public string? PostText { get; set; } + + public DateTime PostTime { get; set; } + + [Column("PostApprovedByUserID")] + public int? PostApprovedByUserId { get; set; } + + public int? PostThreadPosts { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserName { get; set; } + + public DateTime? PostThreadLastPostTime { get; set; } + + public string? PostUserSignature { get; set; } + + [Column("PostGUID")] + public Guid PostGuid { get; set; } + + public DateTime PostLastModified { get; set; } + + public bool? PostApproved { get; set; } + + public bool? PostIsLocked { get; set; } + + public int? PostIsAnswer { get; set; } + + public int PostStickOrder { get; set; } + + public int? PostViews { get; set; } + + public DateTime? PostLastEdit { get; set; } + + public string? PostInfo { get; set; } + + public int? PostAttachmentCount { get; set; } + + public int? PostType { get; set; } + + public int? PostThreadPostsAbsolute { get; set; } + + [StringLength(200)] + public string? PostThreadLastPostUserNameAbsolute { get; set; } + + public DateTime? PostThreadLastPostTimeAbsolute { get; set; } + + public bool? PostQuestionSolved { get; set; } + + public int? PostIsNotAnswer { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs index 0fe3a913..36aae62c 100644 --- a/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewIntegrationTaskJoined.cs @@ -1,65 +1,64 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewIntegrationTaskJoined -{ - [Column("SynchronizationID")] - public int? SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int? SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int? SynchronizationConnectorId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewIntegrationTaskJoined +{ + [Column("SynchronizationID")] + public int? SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int? SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int? SynchronizationConnectorId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs index 8dbdc4b1..3d5c312a 100644 --- a/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewMembershipMembershipUserJoined.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewMembershipMembershipUserJoined -{ - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - [Column("MembershipID")] - public int MembershipId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewMembershipMembershipUserJoined +{ + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + [Column("MembershipID")] + public int MembershipId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs index cc8fe86c..ad0929aa 100644 --- a/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewNewsletterSubscriptionsJoined.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewNewsletterSubscriptionsJoined -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - public int? SubscriberBounces { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewNewsletterSubscriptionsJoined +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + public int? SubscriberBounces { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs index c80e4c28..77550d8d 100644 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewOmAccountContactAccountJoined.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewOmAccountContactAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewOmAccountContactAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs index f4595f75..a848ad6b 100644 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewOmAccountContactContactJoined.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewOmAccountContactContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewOmAccountContactContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs index c7d5c44c..fef7d016 100644 --- a/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewOmAccountJoined.cs @@ -1,102 +1,101 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewOmAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [StringLength(100)] - public string? PrimaryContactFirstName { get; set; } - - [StringLength(100)] - public string? PrimaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? PrimaryContactLastName { get; set; } - - [StringLength(100)] - public string? SecondaryContactFirstName { get; set; } - - [StringLength(100)] - public string? SecondaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? SecondaryContactLastName { get; set; } - - [StringLength(200)] - public string? SubsidiaryOfName { get; set; } - - [StringLength(302)] - public string PrimaryContactFullName { get; set; } = null!; - - [StringLength(302)] - public string SecondaryContactFullName { get; set; } = null!; - - [StringLength(201)] - public string AccountFullAddress { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewOmAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [StringLength(100)] + public string? PrimaryContactFirstName { get; set; } + + [StringLength(100)] + public string? PrimaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? PrimaryContactLastName { get; set; } + + [StringLength(100)] + public string? SecondaryContactFirstName { get; set; } + + [StringLength(100)] + public string? SecondaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? SecondaryContactLastName { get; set; } + + [StringLength(200)] + public string? SubsidiaryOfName { get; set; } + + [StringLength(302)] + public string PrimaryContactFullName { get; set; } = null!; + + [StringLength(302)] + public string SecondaryContactFullName { get; set; } = null!; + + [StringLength(201)] + public string AccountFullAddress { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs index 5be5678a..4234a4b1 100644 --- a/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -1,78 +1,77 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewOmContactGroupMemberAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewOmContactGroupMemberAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs b/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs index 9d6a0bf9..f15e3c36 100644 --- a/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs +++ b/Migration.Toolkit.KX12/Models/ViewPollAnswerCount.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewPollAnswerCount -{ - [Column("PollID")] - public int PollId { get; set; } - - [StringLength(200)] - public string PollCodeName { get; set; } = null!; - - [StringLength(200)] - public string PollDisplayName { get; set; } = null!; - - [StringLength(100)] - public string? PollTitle { get; set; } - - public DateTime? PollOpenFrom { get; set; } - - public DateTime? PollOpenTo { get; set; } - - public bool PollAllowMultipleAnswers { get; set; } - - [StringLength(450)] - public string PollQuestion { get; set; } = null!; - - public int PollAccess { get; set; } - - [StringLength(450)] - public string? PollResponseMessage { get; set; } - - [Column("PollGUID")] - public Guid PollGuid { get; set; } - - public DateTime PollLastModified { get; set; } - - [Column("PollGroupID")] - public int? PollGroupId { get; set; } - - [Column("PollSiteID")] - public int? PollSiteId { get; set; } - - public bool? PollLogActivity { get; set; } - - public int? AnswerCount { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewPollAnswerCount +{ + [Column("PollID")] + public int PollId { get; set; } + + [StringLength(200)] + public string PollCodeName { get; set; } = null!; + + [StringLength(200)] + public string PollDisplayName { get; set; } = null!; + + [StringLength(100)] + public string? PollTitle { get; set; } + + public DateTime? PollOpenFrom { get; set; } + + public DateTime? PollOpenTo { get; set; } + + public bool PollAllowMultipleAnswers { get; set; } + + [StringLength(450)] + public string PollQuestion { get; set; } = null!; + + public int PollAccess { get; set; } + + [StringLength(450)] + public string? PollResponseMessage { get; set; } + + [Column("PollGUID")] + public Guid PollGuid { get; set; } + + public DateTime PollLastModified { get; set; } + + [Column("PollGroupID")] + public int? PollGroupId { get; set; } + + [Column("PollSiteID")] + public int? PollSiteId { get; set; } + + public bool? PollLogActivity { get; set; } + + public int? AnswerCount { get; set; } +} diff --git a/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs index d8f6fcbe..e0ff7d7f 100644 --- a/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs +++ b/Migration.Toolkit.KX12/Models/ViewReportingCategoryReportJoined.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX12.Models; - -[Keyless] -public partial class ViewReportingCategoryReportJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string CodeName { get; set; } = null!; - - [StringLength(440)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(651)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - public int? ReportAccess { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX12.Models; + +[Keyless] +public class ViewReportingCategoryReportJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string CodeName { get; set; } = null!; + + [StringLength(440)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(651)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + public int? ReportAccess { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX12/SettingsKeys.cs b/Migration.Toolkit.KX12/SettingsKeys.cs index ba16c518..25a57748 100644 --- a/Migration.Toolkit.KX12/SettingsKeys.cs +++ b/Migration.Toolkit.KX12/SettingsKeys.cs @@ -1,749 +1,749 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo -namespace Migration.Toolkit.KX12; - -public static class SettingsKeys -{ - public const string CMSABTestingEnabled = "CMSABTestingEnabled"; - public const string CMSAccessDeniedPageURL = "CMSAccessDeniedPageURL"; - public const string CMSActivityPointsForBlogCommentPost = "CMSActivityPointsForBlogCommentPost"; - public const string CMSActivityPointsForBlogPost = "CMSActivityPointsForBlogPost"; - public const string CMSActivityPointsForForumPost = "CMSActivityPointsForForumPost"; - public const string CMSActivityPointsForMessageBoardPost = "CMSActivityPointsForMessageBoardPost"; - public const string CMSActivityTrackedExtensions = "CMSActivityTrackedExtensions"; - public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; - public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; - public const string CMSAllowComponentsCSS = "CMSAllowComponentsCSS"; - public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; - public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; - public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; - public const string CMSAllowGZip = "CMSAllowGZip"; - public const string CMSAllowOnSiteEditing = "CMSAllowOnSiteEditing"; - public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; - public const string CMSAllowPreviewMode = "CMSAllowPreviewMode"; - public const string CMSAllowUrlsWithoutLanguagePrefixes = "CMSAllowUrlsWithoutLanguagePrefixes"; - public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; - public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; - public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; - public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; - public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; - public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; - public const string CMSAnalyticsExcludedFileExtensions = "CMSAnalyticsExcludedFileExtensions"; - public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; - public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; - public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; - public const string CMSAnalyticsTrackAggregatedViews = "CMSAnalyticsTrackAggregatedViews"; - public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; - public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; - public const string CMSAnalyticsTrackFileDownloads = "CMSAnalyticsTrackFileDownloads"; - public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; - public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; - public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; - public const string CMSAnalyticsTrackRegisteredUsers = "CMSAnalyticsTrackRegisteredUsers"; - public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; - public const string CMSAnalyticsVisitorsSmartCheck = "CMSAnalyticsVisitorsSmartCheck"; - public const string CMSApplicationHealthMonitoringInterval = "CMSApplicationHealthMonitoringInterval"; - public const string CMSApplicationID = "CMSApplicationID"; - public const string CMSApplicationSecret = "CMSApplicationSecret"; - public const string CMSApplicationState = "CMSApplicationState"; - public const string CMSArchiveEmails = "CMSArchiveEmails"; - public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; - public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; - public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; - public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; - public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; - public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; - public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; - public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; - public const string CMSAvatarHeight = "CMSAvatarHeight"; - public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; - public const string CMSAvatarType = "CMSAvatarType"; - public const string CMSAvatarWidth = "CMSAvatarWidth"; - public const string CMSBadWordsAction = "CMSBadWordsAction"; - public const string CMSBadWordsReplacement = "CMSBadWordsReplacement"; - public const string CMSBannedIPEnabled = "CMSBannedIPEnabled"; - public const string CMSBannedIPRedirectURL = "CMSBannedIPRedirectURL"; - public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; - public const string CMSBitlyLogin = "CMSBitlyLogin"; - public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; - public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; - public const string CMSBlogEnableOptIn = "CMSBlogEnableOptIn"; - public const string CMSBlogEnableOptInConfirmation = "CMSBlogEnableOptInConfirmation"; - public const string CMSBlogOptInApprovalPath = "CMSBlogOptInApprovalPath"; - public const string CMSBlogOptInInterval = "CMSBlogOptInInterval"; - public const string CMSBlogsUnsubscriptionUrl = "CMSBlogsUnsubscriptionUrl"; - public const string CMSBoardBaseUrl = "CMSBoardBaseUrl"; - public const string CMSBoardEnableOptIn = "CMSBoardEnableOptIn"; - public const string CMSBoardEnableOptInConfirmation = "CMSBoardEnableOptInConfirmation"; - public const string CMSBoardOptInApprovalPath = "CMSBoardOptInApprovalPath"; - public const string CMSBoardOptInInterval = "CMSBoardOptInInterval"; - public const string CMSBoardUnsubsriptionURL = "CMSBoardUnsubsriptionURL"; - public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; - public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; - public const string CMSCacheImages = "CMSCacheImages"; - public const string CMSCacheMinutes = "CMSCacheMinutes"; - public const string CMSCachePageInfo = "CMSCachePageInfo"; - public const string CMSCampaignNewPageLocation = "CMSCampaignNewPageLocation"; - public const string CMSCaptchaControl = "CMSCaptchaControl"; - public const string CMSChatAllowAnonymGlobally = "CMSChatAllowAnonymGlobally"; - public const string CMSChatDaysNeededToDeleteRecods = "CMSChatDaysNeededToDeleteRecods"; - public const string CMSChatDisplayAnnouncementAtFirstLoad = "CMSChatDisplayAnnouncementAtFirstLoad"; - public const string CMSChatDisplayChangeNicknameAtFirstLoad = "CMSChatDisplayChangeNicknameAtFirstLoad"; - public const string CMSChatDisplayEnterAtFirstLoad = "CMSChatDisplayEnterAtFirstLoad"; - public const string CMSChatDisplayInvitedAtFirstLoad = "CMSChatDisplayInvitedAtFirstLoad"; - public const string CMSChatDisplayKickAtFirstLoad = "CMSChatDisplayKickAtFirstLoad"; - public const string CMSChatDisplayLeaveAtFirstLoad = "CMSChatDisplayLeaveAtFirstLoad"; - public const string CMSChatDisplaySupportGreetingAtFirstLoad = "CMSChatDisplaySupportGreetingAtFirstLoad"; - public const string CMSChatEnableBBCode = "CMSChatEnableBBCode"; - public const string CMSChatEnableFloodProtection = "CMSChatEnableFloodProtection"; - public const string CMSChatEnableSmileys = "CMSChatEnableSmileys"; - public const string CMSChatEnableSoundLiveChat = "CMSChatEnableSoundLiveChat"; - public const string CMSChatEnableSoundSupportChat = "CMSChatEnableSoundSupportChat"; - public const string CMSChatErrorDeleteAllTrans = "CMSChatErrorDeleteAllTrans"; - public const string CMSChatErrorTrans = "CMSChatErrorTrans"; - public const string CMSChatFirstLoadMessagesCount = "CMSChatFirstLoadMessagesCount"; - public const string CMSChatFloodProtectionChangeNickname = "CMSChatFloodProtectionChangeNickname"; - public const string CMSChatFloodProtectionCreateRoom = "CMSChatFloodProtectionCreateRoom"; - public const string CMSChatFloodProtectionJoinRoom = "CMSChatFloodProtectionJoinRoom"; - public const string CMSChatFloodProtectionPostMessage = "CMSChatFloodProtectionPostMessage"; - public const string CMSChatForceAnonymUniqueNicknames = "CMSChatForceAnonymUniqueNicknames"; - public const string CMSChatGlobalPingInterval = "CMSChatGlobalPingInterval"; - public const string CMSChatGuestPrefix = "CMSChatGuestPrefix"; - public const string CMSChatInitiatedChatTrans = "CMSChatInitiatedChatTrans"; - public const string CMSChatKickLastingTime = "CMSChatKickLastingTime"; - public const string CMSChatMaximumMessageLength = "CMSChatMaximumMessageLength"; - public const string CMSChatNotificationTrans = "CMSChatNotificationTrans"; - public const string CMSChatOnlineUserTrans = "CMSChatOnlineUserTrans"; - public const string CMSChatRedirectURLJoin = "CMSChatRedirectURLJoin"; - public const string CMSChatRedirectURLLeave = "CMSChatRedirectURLLeave"; - public const string CMSChatRedirectURLLogin = "CMSChatRedirectURLLogin"; - public const string CMSChatRedirectURLLogout = "CMSChatRedirectURLLogout"; - public const string CMSChatResolveURLEnabled = "CMSChatResolveURLEnabled"; - public const string CMSChatRoomMessageTrans = "CMSChatRoomMessageTrans"; - public const string CMSChatRoomNameTrans = "CMSChatRoomNameTrans"; - public const string CMSChatRoomPingInterval = "CMSChatRoomPingInterval"; - public const string CMSChatRoomPopupWindow = "CMSChatRoomPopupWindow"; - public const string CMSChatRoomTrans = "CMSChatRoomTrans"; - public const string CMSChatRoomUserTrans = "CMSChatRoomUserTrans"; - public const string CMSChatSendSupportMessagesTo = "CMSChatSendSupportMessagesTo"; - public const string CMSChatSupportEnabled = "CMSChatSupportEnabled"; - public const string CMSChatSupportEngineerLogoutTimeout = "CMSChatSupportEngineerLogoutTimeout"; - public const string CMSChatSupportRequestTrans = "CMSChatSupportRequestTrans"; - public const string CMSChatSupportTakenRoomReleaseTimeout = "CMSChatSupportTakenRoomReleaseTimeout"; - public const string CMSChatUserLogoutTimeout = "CMSChatUserLogoutTimeout"; - public const string CMSChatWPDefaultGroupPagesBy = "CMSChatWPDefaultGroupPagesBy"; - public const string CMSChatWPDefaultInviteModePagingItems = "CMSChatWPDefaultInviteModePagingItems"; - public const string CMSChatWPDefaultInviteModeSearchMode = "CMSChatWPDefaultInviteModeSearchMode"; - public const string CMSChatWPDefaultPagingItems = "CMSChatWPDefaultPagingItems"; - public const string CMSChatWPDefaultSearchOnlineMaxUsers = "CMSChatWPDefaultSearchOnlineMaxUsers"; - public const string CMSChatWPDefaultShowFilterLimit = "CMSChatWPDefaultShowFilterLimit"; - public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; - public const string CMSCheckBadWords = "CMSCheckBadWords"; - public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; - public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; - public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; - public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; - public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; - public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; - public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; - public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; - public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; - public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; - public const string CMSCMBlogPostComments = "CMSCMBlogPostComments"; - public const string CMSCMBlogPostSubscription = "CMSCMBlogPostSubscription"; - public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; - public const string CMSCMContentRating = "CMSCMContentRating"; - public const string CMSCMCustomActivities = "CMSCMCustomActivities"; - public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; - public const string CMSCMEmailOpening = "CMSCMEmailOpening"; - public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; - public const string CMSCMEventBooking = "CMSCMEventBooking"; - public const string CMSCMExternalSearch = "CMSCMExternalSearch"; - public const string CMSCMForumPosts = "CMSCMForumPosts"; - public const string CMSCMForumPostSubscription = "CMSCMForumPostSubscription"; - public const string CMSCMGeoCity = "CMSCMGeoCity"; - public const string CMSCMGeoCountry = "CMSCMGeoCountry"; - public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; - public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; - public const string CMSCMGeoMetro = "CMSCMGeoMetro"; - public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; - public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; - public const string CMSCMGeoPostal = "CMSCMGeoPostal"; - public const string CMSCMGeoState = "CMSCMGeoState"; - public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; - public const string CMSCMLandingPage = "CMSCMLandingPage"; - public const string CMSCMMessageBoardPosts = "CMSCMMessageBoardPosts"; - public const string CMSCMMessageBoardSubscription = "CMSCMMessageBoardSubscription"; - public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; - public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; - public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; - public const string CMSCMPageVisits = "CMSCMPageVisits"; - public const string CMSCMPollVoting = "CMSCMPollVoting"; - public const string CMSCMPurchase = "CMSCMPurchase"; - public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; - public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; - public const string CMSCMSearch = "CMSCMSearch"; - public const string CMSCMStamp = "CMSCMStamp"; - public const string CMSCMUserLogin = "CMSCMUserLogin"; - public const string CMSCMUserRegistration = "CMSCMUserRegistration"; - public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; - public const string CMSCombineComponentsCSS = "CMSCombineComponentsCSS"; - public const string CMSCombineImagesWithDefaultCulture = "CMSCombineImagesWithDefaultCulture"; - public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; - public const string CMSConfirmChanges = "CMSConfirmChanges"; - public const string CMSContentImageWatermark = "CMSContentImageWatermark"; - public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; - public const string CMSControlElement = "CMSControlElement"; - public const string CMSConvertTablesToDivs = "CMSConvertTablesToDivs"; - public const string CMSDataVersion = "CMSDataVersion"; - public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; - public const string CMSDBVersion = "CMSDBVersion"; - public const string CMSDebugAllCache = "CMSDebugAllCache"; - public const string CMSDebugAllFiles = "CMSDebugAllFiles"; - public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; - public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; - public const string CMSDebugAllMacros = "CMSDebugAllMacros"; - public const string CMSDebugAllOutput = "CMSDebugAllOutput"; - public const string CMSDebugAllRequests = "CMSDebugAllRequests"; - public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; - public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; - public const string CMSDebugAllViewState = "CMSDebugAllViewState"; - public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; - public const string CMSDebugAnalytics = "CMSDebugAnalytics"; - public const string CMSDebugAnalyticsLive = "CMSDebugAnalyticsLive"; - public const string CMSDebugAnalyticsLogLength = "CMSDebugAnalyticsLogLength"; - public const string CMSDebugAnalyticsStack = "CMSDebugAnalyticsStack"; - public const string CMSDebugCache = "CMSDebugCache"; - public const string CMSDebugCacheLive = "CMSDebugCacheLive"; - public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; - public const string CMSDebugCacheStack = "CMSDebugCacheStack"; - public const string CMSDebugEverything = "CMSDebugEverything"; - public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; - public const string CMSDebugEverythingLive = "CMSDebugEverythingLive"; - public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; - public const string CMSDebugFiles = "CMSDebugFiles"; - public const string CMSDebugFilesLive = "CMSDebugFilesLive"; - public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; - public const string CMSDebugFilesStack = "CMSDebugFilesStack"; - public const string CMSDebugHandlers = "CMSDebugHandlers"; - public const string CMSDebugHandlersLive = "CMSDebugHandlersLive"; - public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; - public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; - public const string CMSDebugImportExport = "CMSDebugImportExport"; - public const string CMSDebugMacros = "CMSDebugMacros"; - public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; - public const string CMSDebugMacrosLive = "CMSDebugMacrosLive"; - public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; - public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; - public const string CMSDebugOutput = "CMSDebugOutput"; - public const string CMSDebugOutputLive = "CMSDebugOutputLive"; - public const string CMSDebugOutputLogLength = "CMSDebugOutputLogLength"; - public const string CMSDebugRequests = "CMSDebugRequests"; - public const string CMSDebugRequestsLive = "CMSDebugRequestsLive"; - public const string CMSDebugRequestsLogLength = "CMSDebugRequestsLogLength"; - public const string CMSDebugRequestsStack = "CMSDebugRequestsStack"; - public const string CMSDebugResources = "CMSDebugResources"; - public const string CMSDebugScheduler = "CMSDebugScheduler"; - public const string CMSDebugSecurity = "CMSDebugSecurity"; - public const string CMSDebugSecurityLive = "CMSDebugSecurityLive"; - public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; - public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; - public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; - public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; - public const string CMSDebugSQLQueriesLive = "CMSDebugSQLQueriesLive"; - public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; - public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; - public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; - public const string CMSDebugViewState = "CMSDebugViewState"; - public const string CMSDebugViewStateLive = "CMSDebugViewStateLive"; - public const string CMSDebugViewStateLogLength = "CMSDebugViewStateLogLength"; - public const string CMSDebugWebFarm = "CMSDebugWebFarm"; - public const string CMSDebugWebFarmLive = "CMSDebugWebFarmLive"; - public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; - public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; - public const string CMSDefaulPage = "CMSDefaulPage"; - public const string CMSDefaultAliasPath = "CMSDefaultAliasPath"; - public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; - public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; - public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; - public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; - public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; - public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; - public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; - public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; - public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; - public const string CMSDefaultControlForText = "CMSDefaultControlForText"; - public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; - public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; - public const string CMSDefaultDeletedNodePath = "CMSDefaultDeletedNodePath"; - public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; - public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; - public const string CMSDefaultUrlPathPrefix = "CMSDefaultUrlPathPrefix"; - public const string CMSDefaultUserID = "CMSDefaultUserID"; - public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; - public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; - public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; - public const string CMSDenyLoginInterval = "CMSDenyLoginInterval"; - public const string CMSDepartmentTemplatePath = "CMSDepartmentTemplatePath"; - public const string CMSDeploymentMode = "CMSDeploymentMode"; - public const string CMSDeviceProfilesEnable = "CMSDeviceProfilesEnable"; - public const string CMSDisableDebug = "CMSDisableDebug"; - public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; - public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; - public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; - public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; - public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; - public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; - public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; - public const string CMSDisplayRedirectedIcon = "CMSDisplayRedirectedIcon"; - public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; - public const string CMSEmailBatchSize = "CMSEmailBatchSize"; - public const string CMSEmailEncoding = "CMSEmailEncoding"; - public const string CMSEmailFormat = "CMSEmailFormat"; - public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; - public const string CMSEmailsEnabled = "CMSEmailsEnabled"; - public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; - public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; - public const string CMSEnableCI = "CMSEnableCI"; - public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; - public const string CMSEnableDefaultAvatars = "CMSEnableDefaultAvatars"; - public const string CMSEnableFacebookConnect = "CMSEnableFacebookConnect"; - public const string CMSEnableHealthMonitoring = "CMSEnableHealthMonitoring"; - public const string CMSEnableLinkedIn = "CMSEnableLinkedIn"; - public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; - public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; - public const string CMSEnableOpenID = "CMSEnableOpenID"; - public const string CMSEnableOutputCache = "CMSEnableOutputCache"; - public const string CMSEnablePartialCache = "CMSEnablePartialCache"; - public const string CMSEnableSiteCounters = "CMSEnableSiteCounters"; - public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; - public const string CMSEnableTranslations = "CMSEnableTranslations"; - public const string CMSEnableUserCounts = "CMSEnableUserCounts"; - public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; - public const string CMSEnableVersioningCMSCssStylesheet = "CMSEnableVersioningCMSCssStylesheet"; - public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; - public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; - public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; - public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; - public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; - public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; - public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; - public const string CMSEnableVersioningCMSTemplateDeviceLayout = "CMSEnableVersioningCMSTemplateDeviceLayout"; - public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; - public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; - public const string CMSEnableVersioningCMSWebPartContainer = "CMSEnableVersioningCMSWebPartContainer"; - public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; - public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; - public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; - public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; - public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; - public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; - public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; - public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; - public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; - public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; - public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; - public const string CMSEnableWebDAV = "CMSEnableWebDAV"; - public const string CMSEnableWindowsLiveID = "CMSEnableWindowsLiveID"; - public const string CMSEventManagerInvitationFrom = "CMSEventManagerInvitationFrom"; - public const string CMSEventManagerInvitationSubject = "CMSEventManagerInvitationSubject"; - public const string CMSEventManagerSenderName = "CMSEventManagerSenderName"; - public const string CMSExcludedAttributesFilterURLs = "CMSExcludedAttributesFilterURLs"; - public const string CMSExcludedFormFilterURLs = "CMSExcludedFormFilterURLs"; - public const string CMSExcludedHTML5FilterURLs = "CMSExcludedHTML5FilterURLs"; - public const string CMSExcludedJavascriptFilterURLs = "CMSExcludedJavascriptFilterURLs"; - public const string CMSExcludedLowercaseFilterURLs = "CMSExcludedLowercaseFilterURLs"; - public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; - public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; - public const string CMSExcludedResolveFilterURLs = "CMSExcludedResolveFilterURLs"; - public const string CMSExcludedSelfcloseFilterURLs = "CMSExcludedSelfcloseFilterURLs"; - public const string CMSExcludedURLs = "CMSExcludedURLs"; - public const string CMSExcludedXHTMLFilterURLs = "CMSExcludedXHTMLFilterURLs"; - public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; - public const string CMSFacebookApplicationSecret = "CMSFacebookApplicationSecret"; - public const string CMSFacebookConnectApiKey = "CMSFacebookConnectApiKey"; - public const string CMSFacebookMapUserProfile = "CMSFacebookMapUserProfile"; - public const string CMSFacebookRoles = "CMSFacebookRoles"; - public const string CMSFacebookUserMapping = "CMSFacebookUserMapping"; - public const string CMSFaviconPath = "CMSFaviconPath"; - public const string CMSFilesFolder = "CMSFilesFolder"; - public const string CMSFilesFriendlyURLExtension = "CMSFilesFriendlyURLExtension"; - public const string CMSFilesLocationType = "CMSFilesLocationType"; - public const string CMSFileSystemOutputCacheMinutes = "CMSFileSystemOutputCacheMinutes"; - public const string CMSFloodInterval = "CMSFloodInterval"; - public const string CMSFloodProtectionEnabled = "CMSFloodProtectionEnabled"; - public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; - public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; - public const string CMSForumAttachmentExtensions = "CMSForumAttachmentExtensions"; - public const string CMSForumBaseUrl = "CMSForumBaseUrl"; - public const string CMSForumEnableOptIn = "CMSForumEnableOptIn"; - public const string CMSForumEnableOptInConfirmation = "CMSForumEnableOptInConfirmation"; - public const string CMSForumMaxPostNode = "CMSForumMaxPostNode"; - public const string CMSForumOptInApprovalPath = "CMSForumOptInApprovalPath"; - public const string CMSForumOptInInterval = "CMSForumOptInInterval"; - public const string CMSForumUnsubscriptionUrl = "CMSForumUnsubscriptionUrl"; - public const string CMSFriendlyURLExtension = "CMSFriendlyURLExtension"; - public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; - public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; - public const string CMSGoogleSitemapURL = "CMSGoogleSitemapURL"; - public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; - public const string CMSGravatarDefaultImage = "CMSGravatarDefaultImage"; - public const string CMSGravatarRating = "CMSGravatarRating"; - public const string CMSGroupAvatarHeight = "CMSGroupAvatarHeight"; - public const string CMSGroupAvatarMaxSideSize = "CMSGroupAvatarMaxSideSize"; - public const string CMSGroupAvatarWidth = "CMSGroupAvatarWidth"; - public const string CMSGroupManagementPath = "CMSGroupManagementPath"; - public const string CMSGroupProfilePath = "CMSGroupProfilePath"; - public const string CMSGroupsSecurityAccessPath = "CMSGroupsSecurityAccessPath"; - public const string CMSGroupTemplatePath = "CMSGroupTemplatePath"; - public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; - public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; - public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; - public const string CMSHotfixVersion = "CMSHotfixVersion"; - public const string CMSImageWatermark = "CMSImageWatermark"; - public const string CMSImageWatermarkPosition = "CMSImageWatermarkPosition"; - public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; - public const string CMSIndentOutputHtml = "CMSIndentOutputHtml"; - public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; - public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; - public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; - public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; - public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; - public const string CMSInvitationAcceptationPath = "CMSInvitationAcceptationPath"; - public const string CMSInvitationValidity = "CMSInvitationValidity"; - public const string CMSKeepChangedDocumentAccesible = "CMSKeepChangedDocumentAccesible"; - public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; - public const string CMSLayoutMappingEnable = "CMSLayoutMappingEnable"; - public const string CMSLinkedInAccessToken = "CMSLinkedInAccessToken"; - public const string CMSLinkedInApiKey = "CMSLinkedInApiKey"; - public const string CMSLinkedInApplicationSecret = "CMSLinkedInApplicationSecret"; - public const string CMSLinkedInRoles = "CMSLinkedInRoles"; - public const string CMSLinkedInSignInPermissionScope = "CMSLinkedInSignInPermissionScope"; - public const string CMSLiveIDRequiredUserDataPage = "CMSLiveIDRequiredUserDataPage"; - public const string CMSLiveIDRoles = "CMSLiveIDRoles"; - public const string CMSLogAnalytics = "CMSLogAnalytics"; - public const string CMSLogCache = "CMSLogCache"; - public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; - public const string CMSLogFiles = "CMSLogFiles"; - public const string CMSLogHandlers = "CMSLogHandlers"; - public const string CMSLogMacros = "CMSLogMacros"; - public const string CMSLogMetadata = "CMSLogMetadata"; - public const string CMSLogOutput = "CMSLogOutput"; - public const string CMSLogPageNotFoundException = "CMSLogPageNotFoundException"; - public const string CMSLogRequests = "CMSLogRequests"; - public const string CMSLogSecurity = "CMSLogSecurity"; - public const string CMSLogSize = "CMSLogSize"; - public const string CMSLogSQLQueries = "CMSLogSQLQueries"; - public const string CMSLogToDatabase = "CMSLogToDatabase"; - public const string CMSLogToFileSystem = "CMSLogToFileSystem"; - public const string CMSLogToTrace = "CMSLogToTrace"; - public const string CMSLogViewState = "CMSLogViewState"; - public const string CMSLogWebFarm = "CMSLogWebFarm"; - public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; - public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; - public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; - public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; - public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; - public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; - public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; - public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; - public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; - public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; - public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; - public const string CMSMediaImageWatermark = "CMSMediaImageWatermark"; - public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; - public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; - public const string CMSMediaUsePermanentURLs = "CMSMediaUsePermanentURLs"; - public const string CMSMemberManagementPath = "CMSMemberManagementPath"; - public const string CMSMemberProfilePath = "CMSMemberProfilePath"; - public const string CMSMembershipReminder = "CMSMembershipReminder"; - public const string CMSMetaImageWatermark = "CMSMetaImageWatermark"; - public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; - public const string CMSMFEnabled = "CMSMFEnabled"; - public const string CMSMFRequired = "CMSMFRequired"; - public const string CMSMinWatermarkImageHeight = "CMSMinWatermarkImageHeight"; - public const string CMSMinWatermarkImageWidth = "CMSMinWatermarkImageWidth"; - public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; - public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; - public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; - public const string CMSMoveViewStateToEnd = "CMSMoveViewStateToEnd"; - public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; - public const string CMSMVTEnabled = "CMSMVTEnabled"; - public const string CMSMyAccountURL = "CMSMyAccountURL"; - public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; - public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; - public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; - public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; - public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; - public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; - public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; - public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; - public const string CMSOnSiteEditButton = "CMSOnSiteEditButton"; - public const string CMSOpenIDRoles = "CMSOpenIDRoles"; - public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; - public const string CMSOptInInterval = "CMSOptInInterval"; - public const string CMSOutputCacheItems = "CMSOutputCacheItems"; - public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; - public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; - public const string CMSPageNotFoundForNonPublished = "CMSPageNotFoundForNonPublished"; - public const string CMSPageNotFoundUrl = "CMSPageNotFoundUrl"; - public const string CMSPageTitleFormat = "CMSPageTitleFormat"; - public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; - public const string CMSPartialCacheItems = "CMSPartialCacheItems"; - public const string CMSPasswordExpiration = "CMSPasswordExpiration"; - public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; - public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; - public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; - public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; - public const string CMSPasswordFormat = "CMSPasswordFormat"; - public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; - public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; - public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; - public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; - public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; - public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; - public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; - public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; - public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; - public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; - public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; - public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; - public const string CMSPollsAllowGlobal = "CMSPollsAllowGlobal"; - public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; - public const string CMSPOP3Password = "CMSPOP3Password"; - public const string CMSPOP3ServerName = "CMSPOP3ServerName"; - public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; - public const string CMSPOP3UserName = "CMSPOP3UserName"; - public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; - public const string CMSPriceRounding = "CMSPriceRounding"; - public const string CMSProcessDomainPrefix = "CMSProcessDomainPrefix"; - public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; - public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; - public const string CMSRedirectAliasesToMainURL = "CMSRedirectAliasesToMainURL"; - public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; - public const string CMSRedirectInvalidCasePages = "CMSRedirectInvalidCasePages"; - public const string CMSRedirectToMainExtension = "CMSRedirectToMainExtension"; - public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; - public const string CMSRegistrationApprovalPath = "CMSRegistrationApprovalPath"; - public const string CMSRegistrationEmailConfirmation = "CMSRegistrationEmailConfirmation"; - public const string CMSRememberUniGridState = "CMSRememberUniGridState"; - public const string CMSRequiredLinkedInPage = "CMSRequiredLinkedInPage"; - public const string CMSRequiredOpenIDPage = "CMSRequiredOpenIDPage"; - public const string CMSReservedUserNames = "CMSReservedUserNames"; - public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; - public const string CMSResetPasswordURL = "CMSResetPasswordURL"; - public const string CMSResizeImagesToDevice = "CMSResizeImagesToDevice"; - public const string CMSResolveMacrosInCSS = "CMSResolveMacrosInCSS"; - public const string CMSResourceCompressionEnabled = "CMSResourceCompressionEnabled"; - public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; - public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; - public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; - public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; - public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; - public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; - public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; - public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; - public const string CMSRestoreObjects = "CMSRestoreObjects"; - public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; - public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; - public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; - public const string CMSRobotsPath = "CMSRobotsPath"; - public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; - public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; - public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; - public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; - public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; - public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; - public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; - public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; - public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; - public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; - public const string CMSSchedulerInterval = "CMSSchedulerInterval"; - public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; - public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; - public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; - public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; - public const string CMSScreenLockInterval = "CMSScreenLockInterval"; - public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; - public const string CMSScriptMinificationEnabled = "CMSScriptMinificationEnabled"; - public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; - public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; - public const string CMSSecuredAreasLogonPage = "CMSSecuredAreasLogonPage"; - public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; - public const string CMSSendBlogEmailsFrom = "CMSSendBlogEmailsFrom"; - public const string CMSSendBoardEmailsFrom = "CMSSendBoardEmailsFrom"; - public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; - public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; - public const string CMSSendForumEmailsFrom = "CMSSendForumEmailsFrom"; - public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; - public const string CMSSendPasswordResetConfirmation = "CMSSendPasswordResetConfirmation"; - public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; - public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; - public const string CMSServerTimeZone = "CMSServerTimeZone"; - public const string CMSServiceHealthMonitoringInterval = "CMSServiceHealthMonitoringInterval"; - public const string CMSSessionManagerSchedulerInterval = "CMSSessionManagerSchedulerInterval"; - public const string CMSSessionUseDBRepository = "CMSSessionUseDBRepository"; - public const string CMSSharePointCache = "CMSSharePointCache"; - public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; - public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; - public const string CMSShoppingCartURL = "CMSShoppingCartURL"; - public const string CMSSitemapPath = "CMSSitemapPath"; - public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; - public const string CMSSiteTimeZone = "CMSSiteTimeZone"; - public const string CMSSMTPServer = "CMSSMTPServer"; - public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; - public const string CMSSMTPServerTip = "CMSSMTPServerTip"; - public const string CMSSMTPServerUser = "CMSSMTPServerUser"; - public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; - public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; - public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; - public const string CMSStagingLogChanges = "CMSStagingLogChanges"; - public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; - public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; - public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; - public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; - public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; - public const string CMSStagingServicePassword = "CMSStagingServicePassword"; - public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; - public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; - public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; - public const string CMSStoreAddToShoppingCartConversionName = "CMSStoreAddToShoppingCartConversionName"; - public const string CMSStoreAddToShoppingCartConversionValue = "CMSStoreAddToShoppingCartConversionValue"; - public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; - public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; - public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; - public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; - public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; - public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; - public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; - public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; - public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; - public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; - public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; - public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; - public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; - public const string CMSStoreCSSStylesheetsInFS = "CMSStoreCSSStylesheetsInFS"; - public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; - public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; - public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; - public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; - public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; - public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; - public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; - public const string CMSStoreMassUnit = "CMSStoreMassUnit"; - public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; - public const string CMSStoreOrderConversionName = "CMSStoreOrderConversionName"; - public const string CMSStoreOrderConversionValue = "CMSStoreOrderConversionValue"; - public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; - public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; - public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; - public const string CMSStoreProductsTree = "CMSStoreProductsTree"; - public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; - public const string CMSStoreRegistrationConversionName = "CMSStoreRegistrationConversionName"; - public const string CMSStoreRegistrationConversionValue = "CMSStoreRegistrationConversionValue"; - public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; - public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; - public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; - public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; - public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; - public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; - public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; - public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; - public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; - public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; - public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; - public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; - public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; - public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; - public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; - public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; - public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; - public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; - public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; - public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; - public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; - public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; - public const string CMSStrandsAPIID = "CMSStrandsAPIID"; - public const string CMSStrandsAutomaticCatalogUploadEnabled = "CMSStrandsAutomaticCatalogUploadEnabled"; - public const string CMSStrandsAutomaticUploadFrequency = "CMSStrandsAutomaticUploadFrequency"; - public const string CMSStrandsCatalogFeedPassword = "CMSStrandsCatalogFeedPassword"; - public const string CMSStrandsCatalogFeedUsername = "CMSStrandsCatalogFeedUsername"; - public const string CMSStrandsCatalogTransformation = "CMSStrandsCatalogTransformation"; - public const string CMSStrandsCatalogWhereCondition = "CMSStrandsCatalogWhereCondition"; - public const string CMSStrandsDocumentTypes = "CMSStrandsDocumentTypes"; - public const string CMSStrandsPath = "CMSStrandsPath"; - public const string CMSStrandsValidationToken = "CMSStrandsValidationToken"; - public const string CMSStylesheetMinificationEnabled = "CMSStylesheetMinificationEnabled"; - public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; - public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; - public const string CMSTrackExitPages = "CMSTrackExitPages"; - public const string CMSTrackLandingPages = "CMSTrackLandingPages"; - public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; - public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; - public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; - public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; - public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; - public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; - public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; - public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; - public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; - public const string CMSTranslateWebpartProperties = "CMSTranslateWebpartProperties"; - public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; - public const string CMSTranslationsComPassword = "CMSTranslationsComPassword"; - public const string CMSTranslationsComProjectCode = "CMSTranslationsComProjectCode"; - public const string CMSTranslationsComURL = "CMSTranslationsComURL"; - public const string CMSTranslationsComUserName = "CMSTranslationsComUserName"; - public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; - public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; - public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; - public const string CMSUploadExtensions = "CMSUploadExtensions"; - public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; - public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; - public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; - public const string CMSUseDomainForCulture = "CMSUseDomainForCulture"; - public const string CMSUseEventLogListener = "CMSUseEventLogListener"; - public const string CMSUseExternalService = "CMSUseExternalService"; - public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; - public const string CMSUseLangPrefixForUrls = "CMSUseLangPrefixForUrls"; - public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; - public const string CMSUseNamePathForUrlPath = "CMSUseNamePathForUrlPath"; - public const string CMSUseNoFollowForUsersLinks = "CMSUseNoFollowForUsersLinks"; - public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; - public const string CMSUseParentGroupIDForNewDocuments = "CMSUseParentGroupIDForNewDocuments"; - public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; - public const string CMSUsePermanentRedirect = "CMSUsePermanentRedirect"; - public const string CMSUsePermanentURLs = "CMSUsePermanentURLs"; - public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; - public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; - public const string CMSUseSessionManagement = "CMSUseSessionManagement"; - public const string CMSUseSitePrefixForUserName = "CMSUseSitePrefixForUserName"; - public const string CMSUseSSL = "CMSUseSSL"; - public const string CMSUseSSLForAdministrationInterface = "CMSUseSSLForAdministrationInterface"; - public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; - public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; - public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; - public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; - public const string CMSWebAnalyticsUseJavascriptLogging = "CMSWebAnalyticsUseJavascriptLogging"; - public const string CMSWebDAVExtensions = "CMSWebDAVExtensions"; - public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; - public const string CMSWebFarmMode = "CMSWebFarmMode"; - public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; - public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; - public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; - public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; - public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; - public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; - public const string CMSWebFarmSynchronizeForumAttachments = "CMSWebFarmSynchronizeForumAttachments"; - public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; - public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; - public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; - public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; - public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; - public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; - public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; - public const string CMSWIFEnabled = "CMSWIFEnabled"; - public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; - public const string CMSWIFRealm = "CMSWIFRealm"; - public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; - public const string CMSWishlistURL = "CMSWishlistURL"; -} \ No newline at end of file +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo +namespace Migration.Toolkit.KX12; + +public static class SettingsKeys +{ + public const string CMSABTestingEnabled = "CMSABTestingEnabled"; + public const string CMSAccessDeniedPageURL = "CMSAccessDeniedPageURL"; + public const string CMSActivityPointsForBlogCommentPost = "CMSActivityPointsForBlogCommentPost"; + public const string CMSActivityPointsForBlogPost = "CMSActivityPointsForBlogPost"; + public const string CMSActivityPointsForForumPost = "CMSActivityPointsForForumPost"; + public const string CMSActivityPointsForMessageBoardPost = "CMSActivityPointsForMessageBoardPost"; + public const string CMSActivityTrackedExtensions = "CMSActivityTrackedExtensions"; + public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; + public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; + public const string CMSAllowComponentsCSS = "CMSAllowComponentsCSS"; + public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; + public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; + public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; + public const string CMSAllowGZip = "CMSAllowGZip"; + public const string CMSAllowOnSiteEditing = "CMSAllowOnSiteEditing"; + public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; + public const string CMSAllowPreviewMode = "CMSAllowPreviewMode"; + public const string CMSAllowUrlsWithoutLanguagePrefixes = "CMSAllowUrlsWithoutLanguagePrefixes"; + public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; + public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; + public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; + public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; + public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; + public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; + public const string CMSAnalyticsExcludedFileExtensions = "CMSAnalyticsExcludedFileExtensions"; + public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; + public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; + public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; + public const string CMSAnalyticsTrackAggregatedViews = "CMSAnalyticsTrackAggregatedViews"; + public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; + public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; + public const string CMSAnalyticsTrackFileDownloads = "CMSAnalyticsTrackFileDownloads"; + public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; + public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; + public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; + public const string CMSAnalyticsTrackRegisteredUsers = "CMSAnalyticsTrackRegisteredUsers"; + public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; + public const string CMSAnalyticsVisitorsSmartCheck = "CMSAnalyticsVisitorsSmartCheck"; + public const string CMSApplicationHealthMonitoringInterval = "CMSApplicationHealthMonitoringInterval"; + public const string CMSApplicationID = "CMSApplicationID"; + public const string CMSApplicationSecret = "CMSApplicationSecret"; + public const string CMSApplicationState = "CMSApplicationState"; + public const string CMSArchiveEmails = "CMSArchiveEmails"; + public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; + public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; + public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; + public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; + public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; + public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; + public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; + public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; + public const string CMSAvatarHeight = "CMSAvatarHeight"; + public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; + public const string CMSAvatarType = "CMSAvatarType"; + public const string CMSAvatarWidth = "CMSAvatarWidth"; + public const string CMSBadWordsAction = "CMSBadWordsAction"; + public const string CMSBadWordsReplacement = "CMSBadWordsReplacement"; + public const string CMSBannedIPEnabled = "CMSBannedIPEnabled"; + public const string CMSBannedIPRedirectURL = "CMSBannedIPRedirectURL"; + public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; + public const string CMSBitlyLogin = "CMSBitlyLogin"; + public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; + public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; + public const string CMSBlogEnableOptIn = "CMSBlogEnableOptIn"; + public const string CMSBlogEnableOptInConfirmation = "CMSBlogEnableOptInConfirmation"; + public const string CMSBlogOptInApprovalPath = "CMSBlogOptInApprovalPath"; + public const string CMSBlogOptInInterval = "CMSBlogOptInInterval"; + public const string CMSBlogsUnsubscriptionUrl = "CMSBlogsUnsubscriptionUrl"; + public const string CMSBoardBaseUrl = "CMSBoardBaseUrl"; + public const string CMSBoardEnableOptIn = "CMSBoardEnableOptIn"; + public const string CMSBoardEnableOptInConfirmation = "CMSBoardEnableOptInConfirmation"; + public const string CMSBoardOptInApprovalPath = "CMSBoardOptInApprovalPath"; + public const string CMSBoardOptInInterval = "CMSBoardOptInInterval"; + public const string CMSBoardUnsubsriptionURL = "CMSBoardUnsubsriptionURL"; + public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; + public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; + public const string CMSCacheImages = "CMSCacheImages"; + public const string CMSCacheMinutes = "CMSCacheMinutes"; + public const string CMSCachePageInfo = "CMSCachePageInfo"; + public const string CMSCampaignNewPageLocation = "CMSCampaignNewPageLocation"; + public const string CMSCaptchaControl = "CMSCaptchaControl"; + public const string CMSChatAllowAnonymGlobally = "CMSChatAllowAnonymGlobally"; + public const string CMSChatDaysNeededToDeleteRecods = "CMSChatDaysNeededToDeleteRecods"; + public const string CMSChatDisplayAnnouncementAtFirstLoad = "CMSChatDisplayAnnouncementAtFirstLoad"; + public const string CMSChatDisplayChangeNicknameAtFirstLoad = "CMSChatDisplayChangeNicknameAtFirstLoad"; + public const string CMSChatDisplayEnterAtFirstLoad = "CMSChatDisplayEnterAtFirstLoad"; + public const string CMSChatDisplayInvitedAtFirstLoad = "CMSChatDisplayInvitedAtFirstLoad"; + public const string CMSChatDisplayKickAtFirstLoad = "CMSChatDisplayKickAtFirstLoad"; + public const string CMSChatDisplayLeaveAtFirstLoad = "CMSChatDisplayLeaveAtFirstLoad"; + public const string CMSChatDisplaySupportGreetingAtFirstLoad = "CMSChatDisplaySupportGreetingAtFirstLoad"; + public const string CMSChatEnableBBCode = "CMSChatEnableBBCode"; + public const string CMSChatEnableFloodProtection = "CMSChatEnableFloodProtection"; + public const string CMSChatEnableSmileys = "CMSChatEnableSmileys"; + public const string CMSChatEnableSoundLiveChat = "CMSChatEnableSoundLiveChat"; + public const string CMSChatEnableSoundSupportChat = "CMSChatEnableSoundSupportChat"; + public const string CMSChatErrorDeleteAllTrans = "CMSChatErrorDeleteAllTrans"; + public const string CMSChatErrorTrans = "CMSChatErrorTrans"; + public const string CMSChatFirstLoadMessagesCount = "CMSChatFirstLoadMessagesCount"; + public const string CMSChatFloodProtectionChangeNickname = "CMSChatFloodProtectionChangeNickname"; + public const string CMSChatFloodProtectionCreateRoom = "CMSChatFloodProtectionCreateRoom"; + public const string CMSChatFloodProtectionJoinRoom = "CMSChatFloodProtectionJoinRoom"; + public const string CMSChatFloodProtectionPostMessage = "CMSChatFloodProtectionPostMessage"; + public const string CMSChatForceAnonymUniqueNicknames = "CMSChatForceAnonymUniqueNicknames"; + public const string CMSChatGlobalPingInterval = "CMSChatGlobalPingInterval"; + public const string CMSChatGuestPrefix = "CMSChatGuestPrefix"; + public const string CMSChatInitiatedChatTrans = "CMSChatInitiatedChatTrans"; + public const string CMSChatKickLastingTime = "CMSChatKickLastingTime"; + public const string CMSChatMaximumMessageLength = "CMSChatMaximumMessageLength"; + public const string CMSChatNotificationTrans = "CMSChatNotificationTrans"; + public const string CMSChatOnlineUserTrans = "CMSChatOnlineUserTrans"; + public const string CMSChatRedirectURLJoin = "CMSChatRedirectURLJoin"; + public const string CMSChatRedirectURLLeave = "CMSChatRedirectURLLeave"; + public const string CMSChatRedirectURLLogin = "CMSChatRedirectURLLogin"; + public const string CMSChatRedirectURLLogout = "CMSChatRedirectURLLogout"; + public const string CMSChatResolveURLEnabled = "CMSChatResolveURLEnabled"; + public const string CMSChatRoomMessageTrans = "CMSChatRoomMessageTrans"; + public const string CMSChatRoomNameTrans = "CMSChatRoomNameTrans"; + public const string CMSChatRoomPingInterval = "CMSChatRoomPingInterval"; + public const string CMSChatRoomPopupWindow = "CMSChatRoomPopupWindow"; + public const string CMSChatRoomTrans = "CMSChatRoomTrans"; + public const string CMSChatRoomUserTrans = "CMSChatRoomUserTrans"; + public const string CMSChatSendSupportMessagesTo = "CMSChatSendSupportMessagesTo"; + public const string CMSChatSupportEnabled = "CMSChatSupportEnabled"; + public const string CMSChatSupportEngineerLogoutTimeout = "CMSChatSupportEngineerLogoutTimeout"; + public const string CMSChatSupportRequestTrans = "CMSChatSupportRequestTrans"; + public const string CMSChatSupportTakenRoomReleaseTimeout = "CMSChatSupportTakenRoomReleaseTimeout"; + public const string CMSChatUserLogoutTimeout = "CMSChatUserLogoutTimeout"; + public const string CMSChatWPDefaultGroupPagesBy = "CMSChatWPDefaultGroupPagesBy"; + public const string CMSChatWPDefaultInviteModePagingItems = "CMSChatWPDefaultInviteModePagingItems"; + public const string CMSChatWPDefaultInviteModeSearchMode = "CMSChatWPDefaultInviteModeSearchMode"; + public const string CMSChatWPDefaultPagingItems = "CMSChatWPDefaultPagingItems"; + public const string CMSChatWPDefaultSearchOnlineMaxUsers = "CMSChatWPDefaultSearchOnlineMaxUsers"; + public const string CMSChatWPDefaultShowFilterLimit = "CMSChatWPDefaultShowFilterLimit"; + public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; + public const string CMSCheckBadWords = "CMSCheckBadWords"; + public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; + public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; + public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; + public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; + public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; + public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; + public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; + public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; + public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; + public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; + public const string CMSCMBlogPostComments = "CMSCMBlogPostComments"; + public const string CMSCMBlogPostSubscription = "CMSCMBlogPostSubscription"; + public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; + public const string CMSCMContentRating = "CMSCMContentRating"; + public const string CMSCMCustomActivities = "CMSCMCustomActivities"; + public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; + public const string CMSCMEmailOpening = "CMSCMEmailOpening"; + public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; + public const string CMSCMEventBooking = "CMSCMEventBooking"; + public const string CMSCMExternalSearch = "CMSCMExternalSearch"; + public const string CMSCMForumPosts = "CMSCMForumPosts"; + public const string CMSCMForumPostSubscription = "CMSCMForumPostSubscription"; + public const string CMSCMGeoCity = "CMSCMGeoCity"; + public const string CMSCMGeoCountry = "CMSCMGeoCountry"; + public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; + public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; + public const string CMSCMGeoMetro = "CMSCMGeoMetro"; + public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; + public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; + public const string CMSCMGeoPostal = "CMSCMGeoPostal"; + public const string CMSCMGeoState = "CMSCMGeoState"; + public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; + public const string CMSCMLandingPage = "CMSCMLandingPage"; + public const string CMSCMMessageBoardPosts = "CMSCMMessageBoardPosts"; + public const string CMSCMMessageBoardSubscription = "CMSCMMessageBoardSubscription"; + public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; + public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; + public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; + public const string CMSCMPageVisits = "CMSCMPageVisits"; + public const string CMSCMPollVoting = "CMSCMPollVoting"; + public const string CMSCMPurchase = "CMSCMPurchase"; + public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; + public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; + public const string CMSCMSearch = "CMSCMSearch"; + public const string CMSCMStamp = "CMSCMStamp"; + public const string CMSCMUserLogin = "CMSCMUserLogin"; + public const string CMSCMUserRegistration = "CMSCMUserRegistration"; + public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; + public const string CMSCombineComponentsCSS = "CMSCombineComponentsCSS"; + public const string CMSCombineImagesWithDefaultCulture = "CMSCombineImagesWithDefaultCulture"; + public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; + public const string CMSConfirmChanges = "CMSConfirmChanges"; + public const string CMSContentImageWatermark = "CMSContentImageWatermark"; + public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; + public const string CMSControlElement = "CMSControlElement"; + public const string CMSConvertTablesToDivs = "CMSConvertTablesToDivs"; + public const string CMSDataVersion = "CMSDataVersion"; + public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; + public const string CMSDBVersion = "CMSDBVersion"; + public const string CMSDebugAllCache = "CMSDebugAllCache"; + public const string CMSDebugAllFiles = "CMSDebugAllFiles"; + public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; + public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; + public const string CMSDebugAllMacros = "CMSDebugAllMacros"; + public const string CMSDebugAllOutput = "CMSDebugAllOutput"; + public const string CMSDebugAllRequests = "CMSDebugAllRequests"; + public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; + public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; + public const string CMSDebugAllViewState = "CMSDebugAllViewState"; + public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; + public const string CMSDebugAnalytics = "CMSDebugAnalytics"; + public const string CMSDebugAnalyticsLive = "CMSDebugAnalyticsLive"; + public const string CMSDebugAnalyticsLogLength = "CMSDebugAnalyticsLogLength"; + public const string CMSDebugAnalyticsStack = "CMSDebugAnalyticsStack"; + public const string CMSDebugCache = "CMSDebugCache"; + public const string CMSDebugCacheLive = "CMSDebugCacheLive"; + public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; + public const string CMSDebugCacheStack = "CMSDebugCacheStack"; + public const string CMSDebugEverything = "CMSDebugEverything"; + public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; + public const string CMSDebugEverythingLive = "CMSDebugEverythingLive"; + public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; + public const string CMSDebugFiles = "CMSDebugFiles"; + public const string CMSDebugFilesLive = "CMSDebugFilesLive"; + public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; + public const string CMSDebugFilesStack = "CMSDebugFilesStack"; + public const string CMSDebugHandlers = "CMSDebugHandlers"; + public const string CMSDebugHandlersLive = "CMSDebugHandlersLive"; + public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; + public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; + public const string CMSDebugImportExport = "CMSDebugImportExport"; + public const string CMSDebugMacros = "CMSDebugMacros"; + public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; + public const string CMSDebugMacrosLive = "CMSDebugMacrosLive"; + public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; + public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; + public const string CMSDebugOutput = "CMSDebugOutput"; + public const string CMSDebugOutputLive = "CMSDebugOutputLive"; + public const string CMSDebugOutputLogLength = "CMSDebugOutputLogLength"; + public const string CMSDebugRequests = "CMSDebugRequests"; + public const string CMSDebugRequestsLive = "CMSDebugRequestsLive"; + public const string CMSDebugRequestsLogLength = "CMSDebugRequestsLogLength"; + public const string CMSDebugRequestsStack = "CMSDebugRequestsStack"; + public const string CMSDebugResources = "CMSDebugResources"; + public const string CMSDebugScheduler = "CMSDebugScheduler"; + public const string CMSDebugSecurity = "CMSDebugSecurity"; + public const string CMSDebugSecurityLive = "CMSDebugSecurityLive"; + public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; + public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; + public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; + public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; + public const string CMSDebugSQLQueriesLive = "CMSDebugSQLQueriesLive"; + public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; + public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; + public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; + public const string CMSDebugViewState = "CMSDebugViewState"; + public const string CMSDebugViewStateLive = "CMSDebugViewStateLive"; + public const string CMSDebugViewStateLogLength = "CMSDebugViewStateLogLength"; + public const string CMSDebugWebFarm = "CMSDebugWebFarm"; + public const string CMSDebugWebFarmLive = "CMSDebugWebFarmLive"; + public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; + public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; + public const string CMSDefaulPage = "CMSDefaulPage"; + public const string CMSDefaultAliasPath = "CMSDefaultAliasPath"; + public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; + public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; + public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; + public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; + public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; + public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; + public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; + public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; + public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; + public const string CMSDefaultControlForText = "CMSDefaultControlForText"; + public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; + public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; + public const string CMSDefaultDeletedNodePath = "CMSDefaultDeletedNodePath"; + public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; + public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; + public const string CMSDefaultUrlPathPrefix = "CMSDefaultUrlPathPrefix"; + public const string CMSDefaultUserID = "CMSDefaultUserID"; + public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; + public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; + public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; + public const string CMSDenyLoginInterval = "CMSDenyLoginInterval"; + public const string CMSDepartmentTemplatePath = "CMSDepartmentTemplatePath"; + public const string CMSDeploymentMode = "CMSDeploymentMode"; + public const string CMSDeviceProfilesEnable = "CMSDeviceProfilesEnable"; + public const string CMSDisableDebug = "CMSDisableDebug"; + public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; + public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; + public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; + public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; + public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; + public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; + public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; + public const string CMSDisplayRedirectedIcon = "CMSDisplayRedirectedIcon"; + public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; + public const string CMSEmailBatchSize = "CMSEmailBatchSize"; + public const string CMSEmailEncoding = "CMSEmailEncoding"; + public const string CMSEmailFormat = "CMSEmailFormat"; + public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; + public const string CMSEmailsEnabled = "CMSEmailsEnabled"; + public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; + public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; + public const string CMSEnableCI = "CMSEnableCI"; + public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; + public const string CMSEnableDefaultAvatars = "CMSEnableDefaultAvatars"; + public const string CMSEnableFacebookConnect = "CMSEnableFacebookConnect"; + public const string CMSEnableHealthMonitoring = "CMSEnableHealthMonitoring"; + public const string CMSEnableLinkedIn = "CMSEnableLinkedIn"; + public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; + public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; + public const string CMSEnableOpenID = "CMSEnableOpenID"; + public const string CMSEnableOutputCache = "CMSEnableOutputCache"; + public const string CMSEnablePartialCache = "CMSEnablePartialCache"; + public const string CMSEnableSiteCounters = "CMSEnableSiteCounters"; + public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; + public const string CMSEnableTranslations = "CMSEnableTranslations"; + public const string CMSEnableUserCounts = "CMSEnableUserCounts"; + public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; + public const string CMSEnableVersioningCMSCssStylesheet = "CMSEnableVersioningCMSCssStylesheet"; + public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; + public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; + public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; + public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; + public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; + public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; + public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; + public const string CMSEnableVersioningCMSTemplateDeviceLayout = "CMSEnableVersioningCMSTemplateDeviceLayout"; + public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; + public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; + public const string CMSEnableVersioningCMSWebPartContainer = "CMSEnableVersioningCMSWebPartContainer"; + public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; + public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; + public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; + public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; + public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; + public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; + public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; + public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; + public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; + public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; + public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; + public const string CMSEnableWebDAV = "CMSEnableWebDAV"; + public const string CMSEnableWindowsLiveID = "CMSEnableWindowsLiveID"; + public const string CMSEventManagerInvitationFrom = "CMSEventManagerInvitationFrom"; + public const string CMSEventManagerInvitationSubject = "CMSEventManagerInvitationSubject"; + public const string CMSEventManagerSenderName = "CMSEventManagerSenderName"; + public const string CMSExcludedAttributesFilterURLs = "CMSExcludedAttributesFilterURLs"; + public const string CMSExcludedFormFilterURLs = "CMSExcludedFormFilterURLs"; + public const string CMSExcludedHTML5FilterURLs = "CMSExcludedHTML5FilterURLs"; + public const string CMSExcludedJavascriptFilterURLs = "CMSExcludedJavascriptFilterURLs"; + public const string CMSExcludedLowercaseFilterURLs = "CMSExcludedLowercaseFilterURLs"; + public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; + public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; + public const string CMSExcludedResolveFilterURLs = "CMSExcludedResolveFilterURLs"; + public const string CMSExcludedSelfcloseFilterURLs = "CMSExcludedSelfcloseFilterURLs"; + public const string CMSExcludedURLs = "CMSExcludedURLs"; + public const string CMSExcludedXHTMLFilterURLs = "CMSExcludedXHTMLFilterURLs"; + public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; + public const string CMSFacebookApplicationSecret = "CMSFacebookApplicationSecret"; + public const string CMSFacebookConnectApiKey = "CMSFacebookConnectApiKey"; + public const string CMSFacebookMapUserProfile = "CMSFacebookMapUserProfile"; + public const string CMSFacebookRoles = "CMSFacebookRoles"; + public const string CMSFacebookUserMapping = "CMSFacebookUserMapping"; + public const string CMSFaviconPath = "CMSFaviconPath"; + public const string CMSFilesFolder = "CMSFilesFolder"; + public const string CMSFilesFriendlyURLExtension = "CMSFilesFriendlyURLExtension"; + public const string CMSFilesLocationType = "CMSFilesLocationType"; + public const string CMSFileSystemOutputCacheMinutes = "CMSFileSystemOutputCacheMinutes"; + public const string CMSFloodInterval = "CMSFloodInterval"; + public const string CMSFloodProtectionEnabled = "CMSFloodProtectionEnabled"; + public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; + public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; + public const string CMSForumAttachmentExtensions = "CMSForumAttachmentExtensions"; + public const string CMSForumBaseUrl = "CMSForumBaseUrl"; + public const string CMSForumEnableOptIn = "CMSForumEnableOptIn"; + public const string CMSForumEnableOptInConfirmation = "CMSForumEnableOptInConfirmation"; + public const string CMSForumMaxPostNode = "CMSForumMaxPostNode"; + public const string CMSForumOptInApprovalPath = "CMSForumOptInApprovalPath"; + public const string CMSForumOptInInterval = "CMSForumOptInInterval"; + public const string CMSForumUnsubscriptionUrl = "CMSForumUnsubscriptionUrl"; + public const string CMSFriendlyURLExtension = "CMSFriendlyURLExtension"; + public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; + public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; + public const string CMSGoogleSitemapURL = "CMSGoogleSitemapURL"; + public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; + public const string CMSGravatarDefaultImage = "CMSGravatarDefaultImage"; + public const string CMSGravatarRating = "CMSGravatarRating"; + public const string CMSGroupAvatarHeight = "CMSGroupAvatarHeight"; + public const string CMSGroupAvatarMaxSideSize = "CMSGroupAvatarMaxSideSize"; + public const string CMSGroupAvatarWidth = "CMSGroupAvatarWidth"; + public const string CMSGroupManagementPath = "CMSGroupManagementPath"; + public const string CMSGroupProfilePath = "CMSGroupProfilePath"; + public const string CMSGroupsSecurityAccessPath = "CMSGroupsSecurityAccessPath"; + public const string CMSGroupTemplatePath = "CMSGroupTemplatePath"; + public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; + public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; + public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; + public const string CMSHotfixVersion = "CMSHotfixVersion"; + public const string CMSImageWatermark = "CMSImageWatermark"; + public const string CMSImageWatermarkPosition = "CMSImageWatermarkPosition"; + public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; + public const string CMSIndentOutputHtml = "CMSIndentOutputHtml"; + public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; + public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; + public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; + public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; + public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; + public const string CMSInvitationAcceptationPath = "CMSInvitationAcceptationPath"; + public const string CMSInvitationValidity = "CMSInvitationValidity"; + public const string CMSKeepChangedDocumentAccesible = "CMSKeepChangedDocumentAccesible"; + public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; + public const string CMSLayoutMappingEnable = "CMSLayoutMappingEnable"; + public const string CMSLinkedInAccessToken = "CMSLinkedInAccessToken"; + public const string CMSLinkedInApiKey = "CMSLinkedInApiKey"; + public const string CMSLinkedInApplicationSecret = "CMSLinkedInApplicationSecret"; + public const string CMSLinkedInRoles = "CMSLinkedInRoles"; + public const string CMSLinkedInSignInPermissionScope = "CMSLinkedInSignInPermissionScope"; + public const string CMSLiveIDRequiredUserDataPage = "CMSLiveIDRequiredUserDataPage"; + public const string CMSLiveIDRoles = "CMSLiveIDRoles"; + public const string CMSLogAnalytics = "CMSLogAnalytics"; + public const string CMSLogCache = "CMSLogCache"; + public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; + public const string CMSLogFiles = "CMSLogFiles"; + public const string CMSLogHandlers = "CMSLogHandlers"; + public const string CMSLogMacros = "CMSLogMacros"; + public const string CMSLogMetadata = "CMSLogMetadata"; + public const string CMSLogOutput = "CMSLogOutput"; + public const string CMSLogPageNotFoundException = "CMSLogPageNotFoundException"; + public const string CMSLogRequests = "CMSLogRequests"; + public const string CMSLogSecurity = "CMSLogSecurity"; + public const string CMSLogSize = "CMSLogSize"; + public const string CMSLogSQLQueries = "CMSLogSQLQueries"; + public const string CMSLogToDatabase = "CMSLogToDatabase"; + public const string CMSLogToFileSystem = "CMSLogToFileSystem"; + public const string CMSLogToTrace = "CMSLogToTrace"; + public const string CMSLogViewState = "CMSLogViewState"; + public const string CMSLogWebFarm = "CMSLogWebFarm"; + public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; + public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; + public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; + public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; + public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; + public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; + public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; + public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; + public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; + public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; + public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; + public const string CMSMediaImageWatermark = "CMSMediaImageWatermark"; + public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; + public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; + public const string CMSMediaUsePermanentURLs = "CMSMediaUsePermanentURLs"; + public const string CMSMemberManagementPath = "CMSMemberManagementPath"; + public const string CMSMemberProfilePath = "CMSMemberProfilePath"; + public const string CMSMembershipReminder = "CMSMembershipReminder"; + public const string CMSMetaImageWatermark = "CMSMetaImageWatermark"; + public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; + public const string CMSMFEnabled = "CMSMFEnabled"; + public const string CMSMFRequired = "CMSMFRequired"; + public const string CMSMinWatermarkImageHeight = "CMSMinWatermarkImageHeight"; + public const string CMSMinWatermarkImageWidth = "CMSMinWatermarkImageWidth"; + public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; + public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; + public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; + public const string CMSMoveViewStateToEnd = "CMSMoveViewStateToEnd"; + public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; + public const string CMSMVTEnabled = "CMSMVTEnabled"; + public const string CMSMyAccountURL = "CMSMyAccountURL"; + public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; + public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; + public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; + public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; + public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; + public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; + public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; + public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; + public const string CMSOnSiteEditButton = "CMSOnSiteEditButton"; + public const string CMSOpenIDRoles = "CMSOpenIDRoles"; + public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; + public const string CMSOptInInterval = "CMSOptInInterval"; + public const string CMSOutputCacheItems = "CMSOutputCacheItems"; + public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; + public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; + public const string CMSPageNotFoundForNonPublished = "CMSPageNotFoundForNonPublished"; + public const string CMSPageNotFoundUrl = "CMSPageNotFoundUrl"; + public const string CMSPageTitleFormat = "CMSPageTitleFormat"; + public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; + public const string CMSPartialCacheItems = "CMSPartialCacheItems"; + public const string CMSPasswordExpiration = "CMSPasswordExpiration"; + public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; + public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; + public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; + public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; + public const string CMSPasswordFormat = "CMSPasswordFormat"; + public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; + public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; + public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; + public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; + public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; + public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; + public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; + public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; + public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; + public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; + public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; + public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; + public const string CMSPollsAllowGlobal = "CMSPollsAllowGlobal"; + public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; + public const string CMSPOP3Password = "CMSPOP3Password"; + public const string CMSPOP3ServerName = "CMSPOP3ServerName"; + public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; + public const string CMSPOP3UserName = "CMSPOP3UserName"; + public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; + public const string CMSPriceRounding = "CMSPriceRounding"; + public const string CMSProcessDomainPrefix = "CMSProcessDomainPrefix"; + public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; + public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; + public const string CMSRedirectAliasesToMainURL = "CMSRedirectAliasesToMainURL"; + public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; + public const string CMSRedirectInvalidCasePages = "CMSRedirectInvalidCasePages"; + public const string CMSRedirectToMainExtension = "CMSRedirectToMainExtension"; + public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; + public const string CMSRegistrationApprovalPath = "CMSRegistrationApprovalPath"; + public const string CMSRegistrationEmailConfirmation = "CMSRegistrationEmailConfirmation"; + public const string CMSRememberUniGridState = "CMSRememberUniGridState"; + public const string CMSRequiredLinkedInPage = "CMSRequiredLinkedInPage"; + public const string CMSRequiredOpenIDPage = "CMSRequiredOpenIDPage"; + public const string CMSReservedUserNames = "CMSReservedUserNames"; + public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; + public const string CMSResetPasswordURL = "CMSResetPasswordURL"; + public const string CMSResizeImagesToDevice = "CMSResizeImagesToDevice"; + public const string CMSResolveMacrosInCSS = "CMSResolveMacrosInCSS"; + public const string CMSResourceCompressionEnabled = "CMSResourceCompressionEnabled"; + public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; + public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; + public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; + public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; + public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; + public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; + public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; + public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; + public const string CMSRestoreObjects = "CMSRestoreObjects"; + public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; + public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; + public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; + public const string CMSRobotsPath = "CMSRobotsPath"; + public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; + public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; + public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; + public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; + public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; + public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; + public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; + public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; + public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; + public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; + public const string CMSSchedulerInterval = "CMSSchedulerInterval"; + public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; + public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; + public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; + public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; + public const string CMSScreenLockInterval = "CMSScreenLockInterval"; + public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; + public const string CMSScriptMinificationEnabled = "CMSScriptMinificationEnabled"; + public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; + public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; + public const string CMSSecuredAreasLogonPage = "CMSSecuredAreasLogonPage"; + public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; + public const string CMSSendBlogEmailsFrom = "CMSSendBlogEmailsFrom"; + public const string CMSSendBoardEmailsFrom = "CMSSendBoardEmailsFrom"; + public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; + public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; + public const string CMSSendForumEmailsFrom = "CMSSendForumEmailsFrom"; + public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; + public const string CMSSendPasswordResetConfirmation = "CMSSendPasswordResetConfirmation"; + public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; + public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; + public const string CMSServerTimeZone = "CMSServerTimeZone"; + public const string CMSServiceHealthMonitoringInterval = "CMSServiceHealthMonitoringInterval"; + public const string CMSSessionManagerSchedulerInterval = "CMSSessionManagerSchedulerInterval"; + public const string CMSSessionUseDBRepository = "CMSSessionUseDBRepository"; + public const string CMSSharePointCache = "CMSSharePointCache"; + public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; + public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; + public const string CMSShoppingCartURL = "CMSShoppingCartURL"; + public const string CMSSitemapPath = "CMSSitemapPath"; + public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; + public const string CMSSiteTimeZone = "CMSSiteTimeZone"; + public const string CMSSMTPServer = "CMSSMTPServer"; + public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; + public const string CMSSMTPServerTip = "CMSSMTPServerTip"; + public const string CMSSMTPServerUser = "CMSSMTPServerUser"; + public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; + public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; + public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; + public const string CMSStagingLogChanges = "CMSStagingLogChanges"; + public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; + public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; + public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; + public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; + public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; + public const string CMSStagingServicePassword = "CMSStagingServicePassword"; + public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; + public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; + public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; + public const string CMSStoreAddToShoppingCartConversionName = "CMSStoreAddToShoppingCartConversionName"; + public const string CMSStoreAddToShoppingCartConversionValue = "CMSStoreAddToShoppingCartConversionValue"; + public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; + public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; + public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; + public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; + public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; + public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; + public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; + public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; + public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; + public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; + public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; + public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; + public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; + public const string CMSStoreCSSStylesheetsInFS = "CMSStoreCSSStylesheetsInFS"; + public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; + public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; + public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; + public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; + public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; + public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; + public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; + public const string CMSStoreMassUnit = "CMSStoreMassUnit"; + public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; + public const string CMSStoreOrderConversionName = "CMSStoreOrderConversionName"; + public const string CMSStoreOrderConversionValue = "CMSStoreOrderConversionValue"; + public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; + public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; + public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; + public const string CMSStoreProductsTree = "CMSStoreProductsTree"; + public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; + public const string CMSStoreRegistrationConversionName = "CMSStoreRegistrationConversionName"; + public const string CMSStoreRegistrationConversionValue = "CMSStoreRegistrationConversionValue"; + public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; + public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; + public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; + public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; + public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; + public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; + public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; + public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; + public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; + public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; + public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; + public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; + public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; + public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; + public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; + public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; + public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; + public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; + public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; + public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; + public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; + public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; + public const string CMSStrandsAPIID = "CMSStrandsAPIID"; + public const string CMSStrandsAutomaticCatalogUploadEnabled = "CMSStrandsAutomaticCatalogUploadEnabled"; + public const string CMSStrandsAutomaticUploadFrequency = "CMSStrandsAutomaticUploadFrequency"; + public const string CMSStrandsCatalogFeedPassword = "CMSStrandsCatalogFeedPassword"; + public const string CMSStrandsCatalogFeedUsername = "CMSStrandsCatalogFeedUsername"; + public const string CMSStrandsCatalogTransformation = "CMSStrandsCatalogTransformation"; + public const string CMSStrandsCatalogWhereCondition = "CMSStrandsCatalogWhereCondition"; + public const string CMSStrandsDocumentTypes = "CMSStrandsDocumentTypes"; + public const string CMSStrandsPath = "CMSStrandsPath"; + public const string CMSStrandsValidationToken = "CMSStrandsValidationToken"; + public const string CMSStylesheetMinificationEnabled = "CMSStylesheetMinificationEnabled"; + public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; + public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; + public const string CMSTrackExitPages = "CMSTrackExitPages"; + public const string CMSTrackLandingPages = "CMSTrackLandingPages"; + public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; + public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; + public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; + public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; + public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; + public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; + public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; + public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; + public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; + public const string CMSTranslateWebpartProperties = "CMSTranslateWebpartProperties"; + public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; + public const string CMSTranslationsComPassword = "CMSTranslationsComPassword"; + public const string CMSTranslationsComProjectCode = "CMSTranslationsComProjectCode"; + public const string CMSTranslationsComURL = "CMSTranslationsComURL"; + public const string CMSTranslationsComUserName = "CMSTranslationsComUserName"; + public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; + public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; + public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; + public const string CMSUploadExtensions = "CMSUploadExtensions"; + public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; + public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; + public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; + public const string CMSUseDomainForCulture = "CMSUseDomainForCulture"; + public const string CMSUseEventLogListener = "CMSUseEventLogListener"; + public const string CMSUseExternalService = "CMSUseExternalService"; + public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; + public const string CMSUseLangPrefixForUrls = "CMSUseLangPrefixForUrls"; + public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; + public const string CMSUseNamePathForUrlPath = "CMSUseNamePathForUrlPath"; + public const string CMSUseNoFollowForUsersLinks = "CMSUseNoFollowForUsersLinks"; + public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; + public const string CMSUseParentGroupIDForNewDocuments = "CMSUseParentGroupIDForNewDocuments"; + public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; + public const string CMSUsePermanentRedirect = "CMSUsePermanentRedirect"; + public const string CMSUsePermanentURLs = "CMSUsePermanentURLs"; + public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; + public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; + public const string CMSUseSessionManagement = "CMSUseSessionManagement"; + public const string CMSUseSitePrefixForUserName = "CMSUseSitePrefixForUserName"; + public const string CMSUseSSL = "CMSUseSSL"; + public const string CMSUseSSLForAdministrationInterface = "CMSUseSSLForAdministrationInterface"; + public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; + public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; + public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; + public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; + public const string CMSWebAnalyticsUseJavascriptLogging = "CMSWebAnalyticsUseJavascriptLogging"; + public const string CMSWebDAVExtensions = "CMSWebDAVExtensions"; + public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; + public const string CMSWebFarmMode = "CMSWebFarmMode"; + public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; + public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; + public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; + public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; + public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; + public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; + public const string CMSWebFarmSynchronizeForumAttachments = "CMSWebFarmSynchronizeForumAttachments"; + public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; + public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; + public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; + public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; + public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; + public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; + public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; + public const string CMSWIFEnabled = "CMSWIFEnabled"; + public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; + public const string CMSWIFRealm = "CMSWIFRealm"; + public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; + public const string CMSWishlistURL = "CMSWishlistURL"; +} diff --git a/Migration.Toolkit.KX12/SettingsKeys.tt b/Migration.Toolkit.KX12/SettingsKeys.tt index 0254bd98..79807a48 100644 --- a/Migration.Toolkit.KX12/SettingsKeys.tt +++ b/Migration.Toolkit.KX12/SettingsKeys.tt @@ -1,6 +1,4 @@ <#@ template language="C#" #> -<#@ import namespace="System.Text" #> -<#@ import namespace="System.Collections.Generic" #> <#@ import namespace="System.Data.SqlClient" #> // ReSharper disable InconsistentNaming // ReSharper disable IdentifierTypo diff --git a/Migration.Toolkit.KX12/genModel.ps1 b/Migration.Toolkit.KX12/genModel.ps1 index db6d7b2b..518b3d97 100644 --- a/Migration.Toolkit.KX12/genModel.ps1 +++ b/Migration.Toolkit.KX12/genModel.ps1 @@ -6,9 +6,9 @@ $workDir = $MyInvocation.MyCommand.Path $workDir = [System.IO.Path]::GetDirectoryName($workDir) $contextPath = "$workDir\Context\KX12Context.cs" $contextText = [System.IO.File]::ReadAllText($contextPath) -$result = $contextText -replace '.*optionsBuilder.UseSqlServer.*',''; -$result = $result -replace '.*protected override void OnConfiguring.*',''; -$result = $result -replace '.*#warning To protect potentially sensitive information in your connection string, .*',''; +$result = $contextText -replace '.*optionsBuilder.UseSqlServer.*', ''; +$result = $result -replace '.*protected override void OnConfiguring.*', ''; +$result = $result -replace '.*#warning To protect potentially sensitive information in your connection string, .*', ''; [System.IO.File]::WriteAllText($contextPath, $result) # ./genModel.ps1 -connection Data Source=.;Initial Catalog=Kentico12_Boilerplate;Integrated Security=True;Persist Security Info=False;Connect Timeout=60;Encrypt=False;Current Language=English \ No newline at end of file diff --git a/Migration.Toolkit.KX13/Context/KX13Context.cs b/Migration.Toolkit.KX13/Context/KX13Context.cs index cc7ba22f..51e3f425 100644 --- a/Migration.Toolkit.KX13/Context/KX13Context.cs +++ b/Migration.Toolkit.KX13/Context/KX13Context.cs @@ -1,4096 +1,3943 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.KX13.Models; - -namespace Migration.Toolkit.KX13.Context; - -public partial class KX13Context : DbContext -{ - public KX13Context() - { - } - - public KX13Context(DbContextOptions options) - : base(options) - { - } - - public virtual DbSet AnalyticsCampaigns { get; set; } - - public virtual DbSet AnalyticsCampaignAssets { get; set; } - - public virtual DbSet AnalyticsCampaignAssetUrls { get; set; } - - public virtual DbSet AnalyticsCampaignConversions { get; set; } - - public virtual DbSet AnalyticsCampaignConversionHits { get; set; } - - public virtual DbSet AnalyticsCampaignObjectives { get; set; } - - public virtual DbSet AnalyticsDayHits { get; set; } - - public virtual DbSet AnalyticsExitPages { get; set; } - - public virtual DbSet AnalyticsHourHits { get; set; } - - public virtual DbSet AnalyticsMonthHits { get; set; } - - public virtual DbSet AnalyticsStatistics { get; set; } - - public virtual DbSet AnalyticsWeekHits { get; set; } - - public virtual DbSet AnalyticsYearHits { get; set; } - - public virtual DbSet CiFileMetadata { get; set; } - - public virtual DbSet CiMigrations { get; set; } - - public virtual DbSet CmsAcls { get; set; } - - public virtual DbSet CmsAclitems { get; set; } - - public virtual DbSet CmsAlternativeForms { get; set; } - - public virtual DbSet CmsAlternativeUrls { get; set; } - - public virtual DbSet CmsAttachments { get; set; } - - public virtual DbSet CmsAttachmentHistories { get; set; } - - public virtual DbSet CmsAutomationHistories { get; set; } - - public virtual DbSet CmsAutomationStates { get; set; } - - public virtual DbSet CmsAutomationTemplates { get; set; } - - public virtual DbSet CmsAvatars { get; set; } - - public virtual DbSet CmsCategories { get; set; } - - public virtual DbSet CmsClasses { get; set; } - - public virtual DbSet CmsConsents { get; set; } - - public virtual DbSet CmsConsentAgreements { get; set; } - - public virtual DbSet CmsConsentArchives { get; set; } - - public virtual DbSet CmsCountries { get; set; } - - public virtual DbSet CmsCultures { get; set; } - - public virtual DbSet CmsDocuments { get; set; } - - public virtual DbSet CmsDocumentTypeScopes { get; set; } - - public virtual DbSet CmsEmails { get; set; } - - public virtual DbSet CmsEmailAttachments { get; set; } - - public virtual DbSet CmsEmailTemplates { get; set; } - - public virtual DbSet CmsEmailUsers { get; set; } - - public virtual DbSet CmsEventLogs { get; set; } - - public virtual DbSet CmsExternalLogins { get; set; } - - public virtual DbSet CmsForms { get; set; } - - public virtual DbSet CmsFormUserControls { get; set; } - - public virtual DbSet CmsHelpTopics { get; set; } - - public virtual DbSet CmsLayouts { get; set; } - - public virtual DbSet CmsLicenseKeys { get; set; } - - public virtual DbSet CmsMacroIdentities { get; set; } - - public virtual DbSet CmsMacroRules { get; set; } - - public virtual DbSet CmsMemberships { get; set; } - - public virtual DbSet CmsMembershipUsers { get; set; } - - public virtual DbSet CmsMetaFiles { get; set; } - - public virtual DbSet CmsModuleLicenseKeys { get; set; } - - public virtual DbSet CmsModuleUsageCounters { get; set; } - - public virtual DbSet CmsObjectSettings { get; set; } - - public virtual DbSet CmsObjectVersionHistories { get; set; } - - public virtual DbSet CmsObjectWorkflowTriggers { get; set; } - - public virtual DbSet CmsPageFormerUrlPaths { get; set; } - - public virtual DbSet CmsPageTemplates { get; set; } - - public virtual DbSet CmsPageTemplateCategories { get; set; } - - public virtual DbSet CmsPageTemplateConfigurations { get; set; } - - public virtual DbSet CmsPageUrlPaths { get; set; } - - public virtual DbSet CmsPermissions { get; set; } - - public virtual DbSet CmsPersonalizations { get; set; } - - public virtual DbSet CmsQueries { get; set; } - - public virtual DbSet CmsRelationships { get; set; } - - public virtual DbSet CmsRelationshipNames { get; set; } - - public virtual DbSet CmsResources { get; set; } - - public virtual DbSet CmsResourceLibraries { get; set; } - - public virtual DbSet CmsResourceStrings { get; set; } - - public virtual DbSet CmsResourceTranslations { get; set; } - - public virtual DbSet CmsRoles { get; set; } - - public virtual DbSet CmsScheduledTasks { get; set; } - - public virtual DbSet CmsSearchEngines { get; set; } - - public virtual DbSet CmsSearchIndices { get; set; } - - public virtual DbSet CmsSearchTasks { get; set; } - - public virtual DbSet CmsSearchTaskAzures { get; set; } - - public virtual DbSet CmsSettingsCategories { get; set; } - - public virtual DbSet CmsSettingsKeys { get; set; } - - public virtual DbSet CmsSites { get; set; } - - public virtual DbSet CmsSiteDomainAliases { get; set; } - - public virtual DbSet CmsSmtpservers { get; set; } - - public virtual DbSet CmsStates { get; set; } - - public virtual DbSet CmsTags { get; set; } - - public virtual DbSet CmsTagGroups { get; set; } - - public virtual DbSet CmsTimeZones { get; set; } - - public virtual DbSet CmsTransformations { get; set; } - - public virtual DbSet CmsTranslationServices { get; set; } - - public virtual DbSet CmsTranslationSubmissions { get; set; } - - public virtual DbSet CmsTranslationSubmissionItems { get; set; } - - public virtual DbSet CmsTrees { get; set; } - - public virtual DbSet CmsUielements { get; set; } - - public virtual DbSet CmsUsers { get; set; } - - public virtual DbSet CmsUserCultures { get; set; } - - public virtual DbSet CmsUserMacroIdentities { get; set; } - - public virtual DbSet CmsUserRoles { get; set; } - - public virtual DbSet CmsUserSettings { get; set; } - - public virtual DbSet CmsUserSites { get; set; } - - public virtual DbSet CmsVersionHistories { get; set; } - - public virtual DbSet CmsWebFarmServers { get; set; } - - public virtual DbSet CmsWebFarmServerLogs { get; set; } - - public virtual DbSet CmsWebFarmServerMonitorings { get; set; } - - public virtual DbSet CmsWebFarmServerTasks { get; set; } - - public virtual DbSet CmsWebFarmTasks { get; set; } - - public virtual DbSet CmsWebParts { get; set; } - - public virtual DbSet CmsWebPartCategories { get; set; } - - public virtual DbSet CmsWebPartContainers { get; set; } - - public virtual DbSet CmsWebPartLayouts { get; set; } - - public virtual DbSet CmsWidgets { get; set; } - - public virtual DbSet CmsWidgetCategories { get; set; } - - public virtual DbSet CmsWidgetRoles { get; set; } - - public virtual DbSet CmsWorkflows { get; set; } - - public virtual DbSet CmsWorkflowActions { get; set; } - - public virtual DbSet CmsWorkflowHistories { get; set; } - - public virtual DbSet CmsWorkflowScopes { get; set; } - - public virtual DbSet CmsWorkflowSteps { get; set; } - - public virtual DbSet CmsWorkflowStepRoles { get; set; } - - public virtual DbSet CmsWorkflowStepUsers { get; set; } - - public virtual DbSet CmsWorkflowTransitions { get; set; } - - public virtual DbSet ComAddresses { get; set; } - - public virtual DbSet ComBrands { get; set; } - - public virtual DbSet ComCarriers { get; set; } - - public virtual DbSet ComCollections { get; set; } - - public virtual DbSet ComCouponCodes { get; set; } - - public virtual DbSet ComCurrencies { get; set; } - - public virtual DbSet ComCurrencyExchangeRates { get; set; } - - public virtual DbSet ComCustomers { get; set; } - - public virtual DbSet ComCustomerCreditHistories { get; set; } - - public virtual DbSet ComDepartments { get; set; } - - public virtual DbSet ComDiscounts { get; set; } - - public virtual DbSet ComExchangeTables { get; set; } - - public virtual DbSet ComGiftCards { get; set; } - - public virtual DbSet ComGiftCardCouponCodes { get; set; } - - public virtual DbSet ComInternalStatuses { get; set; } - - public virtual DbSet ComManufacturers { get; set; } - - public virtual DbSet ComMultiBuyCouponCodes { get; set; } - - public virtual DbSet ComMultiBuyDiscounts { get; set; } - - public virtual DbSet ComMultiBuyDiscountBrands { get; set; } - - public virtual DbSet ComMultiBuyDiscountCollections { get; set; } - - public virtual DbSet ComMultiBuyDiscountTrees { get; set; } - - public virtual DbSet ComOptionCategories { get; set; } - - public virtual DbSet ComOrders { get; set; } - - public virtual DbSet ComOrderAddresses { get; set; } - - public virtual DbSet ComOrderItems { get; set; } - - public virtual DbSet ComOrderItemSkufiles { get; set; } - - public virtual DbSet ComOrderStatuses { get; set; } - - public virtual DbSet ComOrderStatusUsers { get; set; } - - public virtual DbSet ComPaymentOptions { get; set; } - - public virtual DbSet ComPublicStatuses { get; set; } - - public virtual DbSet ComShippingCosts { get; set; } - - public virtual DbSet ComShippingOptions { get; set; } - - public virtual DbSet ComShoppingCarts { get; set; } - - public virtual DbSet ComShoppingCartCouponCodes { get; set; } - - public virtual DbSet ComShoppingCartSkus { get; set; } - - public virtual DbSet ComSkus { get; set; } - - public virtual DbSet ComSkufiles { get; set; } - - public virtual DbSet ComSkuoptionCategories { get; set; } - - public virtual DbSet ComSuppliers { get; set; } - - public virtual DbSet ComTaxClasses { get; set; } - - public virtual DbSet ComTaxClassCountries { get; set; } - - public virtual DbSet ComTaxClassStates { get; set; } - - public virtual DbSet ComVolumeDiscounts { get; set; } - - public virtual DbSet ComWishlists { get; set; } - - public virtual DbSet ExportHistories { get; set; } - - public virtual DbSet ExportTasks { get; set; } - - public virtual DbSet IntegrationConnectors { get; set; } - - public virtual DbSet IntegrationSyncLogs { get; set; } - - public virtual DbSet IntegrationSynchronizations { get; set; } - - public virtual DbSet IntegrationTasks { get; set; } - - public virtual DbSet MediaFiles { get; set; } - - public virtual DbSet MediaLibraries { get; set; } - - public virtual DbSet MediaLibraryRolePermissions { get; set; } - - public virtual DbSet NewsletterAbtests { get; set; } - - public virtual DbSet NewsletterClickedLinks { get; set; } - - public virtual DbSet NewsletterEmails { get; set; } - - public virtual DbSet NewsletterEmailTemplates { get; set; } - - public virtual DbSet NewsletterEmailWidgets { get; set; } - - public virtual DbSet NewsletterEmailWidgetTemplates { get; set; } - - public virtual DbSet NewsletterIssueContactGroups { get; set; } - - public virtual DbSet NewsletterLinks { get; set; } - - public virtual DbSet NewsletterNewsletters { get; set; } - - public virtual DbSet NewsletterNewsletterIssues { get; set; } - - public virtual DbSet NewsletterOpenedEmails { get; set; } - - public virtual DbSet NewsletterSubscribers { get; set; } - - public virtual DbSet NewsletterSubscriberNewsletters { get; set; } - - public virtual DbSet NewsletterUnsubscriptions { get; set; } - - public virtual DbSet OmAbtests { get; set; } - - public virtual DbSet OmAbvariantData { get; set; } - - public virtual DbSet OmAccounts { get; set; } - - public virtual DbSet OmAccountContacts { get; set; } - - public virtual DbSet OmAccountStatuses { get; set; } - - public virtual DbSet OmActivities { get; set; } - - public virtual DbSet OmActivityRecalculationQueues { get; set; } - - public virtual DbSet OmActivityTypes { get; set; } - - public virtual DbSet OmContacts { get; set; } - - public virtual DbSet OmContactChangeRecalculationQueues { get; set; } - - public virtual DbSet OmContactGroups { get; set; } - - public virtual DbSet OmContactGroupMembers { get; set; } - - public virtual DbSet OmContactRoles { get; set; } - - public virtual DbSet OmContactStatuses { get; set; } - - public virtual DbSet OmMemberships { get; set; } - - public virtual DbSet OmRules { get; set; } - - public virtual DbSet OmScores { get; set; } - - public virtual DbSet OmScoreContactRules { get; set; } - - public virtual DbSet OmVisitorToContacts { get; set; } - - public virtual DbSet PersonasPersonas { get; set; } - - public virtual DbSet PersonasPersonaContactHistories { get; set; } - - public virtual DbSet ReportingReports { get; set; } - - public virtual DbSet ReportingReportCategories { get; set; } - - public virtual DbSet ReportingReportGraphs { get; set; } - - public virtual DbSet ReportingReportSubscriptions { get; set; } - - public virtual DbSet ReportingReportTables { get; set; } - - public virtual DbSet ReportingReportValues { get; set; } - - public virtual DbSet ReportingSavedGraphs { get; set; } - - public virtual DbSet ReportingSavedReports { get; set; } - - public virtual DbSet SharePointSharePointConnections { get; set; } - - public virtual DbSet SharePointSharePointFiles { get; set; } - - public virtual DbSet SharePointSharePointLibraries { get; set; } - - public virtual DbSet SmFacebookAccounts { get; set; } - - public virtual DbSet SmFacebookApplications { get; set; } - - public virtual DbSet SmFacebookPosts { get; set; } - - public virtual DbSet SmInsights { get; set; } - - public virtual DbSet SmInsightHitDays { get; set; } - - public virtual DbSet SmInsightHitMonths { get; set; } - - public virtual DbSet SmInsightHitWeeks { get; set; } - - public virtual DbSet SmInsightHitYears { get; set; } - - public virtual DbSet SmLinkedInAccounts { get; set; } - - public virtual DbSet SmLinkedInApplications { get; set; } - - public virtual DbSet SmLinkedInPosts { get; set; } - - public virtual DbSet SmTwitterAccounts { get; set; } - - public virtual DbSet SmTwitterApplications { get; set; } - - public virtual DbSet SmTwitterPosts { get; set; } - - public virtual DbSet StagingServers { get; set; } - - public virtual DbSet StagingSynchronizations { get; set; } - - public virtual DbSet StagingTasks { get; set; } - - public virtual DbSet StagingTaskGroups { get; set; } - - public virtual DbSet StagingTaskGroupTasks { get; set; } - - public virtual DbSet StagingTaskGroupUsers { get; set; } - - public virtual DbSet StagingTaskUsers { get; set; } - - public virtual DbSet TempFiles { get; set; } - - public virtual DbSet TempPageBuilderWidgets { get; set; } - - public virtual DbSet ViewCmsAclitemItemsAndOperators { get; set; } - - public virtual DbSet ViewCmsObjectVersionHistoryUserJoineds { get; set; } - - public virtual DbSet ViewCmsPageTemplateCategoryPageTemplateJoineds { get; set; } - - public virtual DbSet ViewCmsRelationshipJoineds { get; set; } - - public virtual DbSet ViewCmsResourceStringJoineds { get; set; } - - public virtual DbSet ViewCmsResourceTranslatedJoineds { get; set; } - - public virtual DbSet ViewCmsRoleResourcePermissionJoineds { get; set; } - - public virtual DbSet ViewCmsSiteDocumentCounts { get; set; } - - public virtual DbSet ViewCmsSiteRoleResourceUielementJoineds { get; set; } - - public virtual DbSet ViewCmsTreeJoineds { get; set; } - - public virtual DbSet ViewCmsUsers { get; set; } - - public virtual DbSet ViewCmsUserDocuments { get; set; } - - public virtual DbSet ViewCmsUserRoleJoineds { get; set; } - - public virtual DbSet ViewCmsUserRoleMembershipRoles { get; set; } - - public virtual DbSet ViewCmsUserRoleMembershipRoleValidOnlyJoineds { get; set; } - - public virtual DbSet ViewCmsUserSettingsRoleJoineds { get; set; } - - public virtual DbSet ViewCmsWebPartCategoryWebpartJoineds { get; set; } - - public virtual DbSet ViewCmsWidgetCategoryWidgetJoineds { get; set; } - - public virtual DbSet ViewComSkuoptionCategoryOptionCategoryJoineds { get; set; } - - public virtual DbSet ViewIntegrationTaskJoineds { get; set; } - - public virtual DbSet ViewMembershipMembershipUserJoineds { get; set; } - - public virtual DbSet ViewNewsletterSubscriptionsJoineds { get; set; } - - public virtual DbSet ViewOmAccountContactAccountJoineds { get; set; } - - public virtual DbSet ViewOmAccountContactContactJoineds { get; set; } - - public virtual DbSet ViewOmAccountJoineds { get; set; } - - public virtual DbSet ViewOmContactGroupMemberAccountJoineds { get; set; } - - public virtual DbSet ViewReportingCategoryReportJoineds { get; set; } - - - - - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CampaignName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CampaignScheduledTask).WithMany(p => p.AnalyticsCampaigns).HasConstraintName("FK_Analytics_Campaign_CampaignScheduledTaskID_ScheduledTask"); - - entity.HasOne(d => d.CampaignSite).WithMany(p => p.AnalyticsCampaigns) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_Campaign_StatisticsSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignAssetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CampaignAssetType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignAssetCampaign).WithMany(p => p.AnalyticsCampaignAssets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignAsset_CampaignAssetCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignAssetUrlPageTitle).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignAssetUrlTarget).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignAssetUrlCampaignAsset).WithMany(p => p.AnalyticsCampaignAssetUrls) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID_Analytics_CampaignAsset"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignConversionActivityType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignConversionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CampaignConversionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CampaignConversionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignConversionCampaign).WithMany(p => p.AnalyticsCampaignConversions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignConversion_CampaignConversionCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignConversionHitsSourceName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CampaignConversionHitsConversion).WithMany(p => p.AnalyticsCampaignConversionHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID_Analytics_CampaignConversion"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CampaignObjectiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.CampaignObjectiveCampaignConversion).WithMany(p => p.AnalyticsCampaignObjectives) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID_Analytics_CampaignConversion"); - - entity.HasOne(d => d.CampaignObjectiveCampaign).WithOne(p => p.AnalyticsCampaignObjective) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignID_Analytics_Campaign"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_DayHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsDayHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_DayHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ExitPageUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ExitPageSite).WithMany(p => p.AnalyticsExitPages) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_ExitPages_ExitPageSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_HourHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsHourHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_HourHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_MonthHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsMonthHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_MonthHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StatisticsId).IsClustered(false); - - entity.HasIndex(e => e.StatisticsCode, "IX_Analytics_Statistics_StatisticsCode_StatisticsSiteID_StatisticsObjectID_StatisticsObjectCulture").IsClustered(); - - entity.Property(e => e.StatisticsCode).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.StatisticsSite).WithMany(p => p.AnalyticsStatistics).HasConstraintName("FK_Analytics_Statistics_StatisticsSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_WeekHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsWeekHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_WeekHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.HitsId).IsClustered(false); - - entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_YearHits_HitsStartTime_HitsEndTime") - .IsDescending() - .IsClustered(); - - entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsYearHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Analytics_YearHits_HitsStatisticsID_Analytics_Statistics"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FileLocation).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AclinheritedAcls).HasDefaultValueSql("('')"); - entity.Property(e => e.AcllastModified).HasDefaultValueSql("('10/30/2008 9:17:31 AM')"); - - entity.HasOne(d => d.Aclsite).WithMany(p => p.CmsAcls).HasConstraintName("FK_CMS_ACL_ACLSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Acl).WithMany(p => p.CmsAclitems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ACLItem_ACLID_CMS_ACL"); - - entity.HasOne(d => d.LastModifiedByUser).WithMany(p => p.CmsAclitemLastModifiedByUsers).HasConstraintName("FK_CMS_ACLItem_LastModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsAclitems).HasConstraintName("FK_CMS_ACLItem_RoleID_CMS_Role"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsAclitemUsers).HasConstraintName("FK_CMS_ACLItem_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormHideNewParentFields).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FormClass).WithMany(p => p.CmsAlternativeFormFormClasses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AlternativeForm_FormClassID_CMS_Class"); - - entity.HasOne(d => d.FormCoupledClass).WithMany(p => p.CmsAlternativeFormFormCoupledClasses).HasConstraintName("FK_CMS_AlternativeForm_FormCoupledClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AlternativeUrlLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.AlternativeUrlUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AlternativeUrlDocument).WithMany(p => p.CmsAlternativeUrls) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AlternativeUrl_CMS_Document"); - - entity.HasOne(d => d.AlternativeUrlSite).WithMany(p => p.CmsAlternativeUrls) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AlternativeUrl_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AttachmentId).IsClustered(false); - - entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName, e.AttachmentIsUnsorted, e.AttachmentOrder }, "IX_CMS_Attachment_AttachmentDocumentID_AttachmentIsUnsorted_AttachmentName_AttachmentOrder").IsClustered(); - - entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_Attachment_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") - .IsUnique() - .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); - - entity.HasOne(d => d.AttachmentDocument).WithMany(p => p.CmsAttachments).HasConstraintName("FK_CMS_Attachment_AttachmentDocumentID_CMS_Document"); - - entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Attachment_AttachmentSiteID_CMS_Site"); - - entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_Attachment_AttachmentVariantParentID_CMS_Attachment"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AttachmentHistoryId).IsClustered(false); - - entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName }, "IX_CMS_AttachmentHistory_AttachmentDocumentID_AttachmentName").IsClustered(); - - entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_AttachmentHistory_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") - .IsUnique() - .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); - - entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachmentHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentHistory_AttachmentSiteID_CMS_Site"); - - entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_AttachmentHistory_AttachmentVariantParentID_CMS_AttachmentHistory"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); - entity.Property(e => e.HistoryStepDisplayName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.HistoryApprovedByUser).WithMany(p => p.CmsAutomationHistories).HasConstraintName("FK_CMS_AutomationHistory_HistoryApprovedByUserID"); - - entity.HasOne(d => d.HistoryState).WithMany(p => p.CmsAutomationHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationHistory_HistoryStateID"); - - entity.HasOne(d => d.HistoryStep).WithMany(p => p.CmsAutomationHistoryHistorySteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryStepID"); - - entity.HasOne(d => d.HistoryTargetStep).WithMany(p => p.CmsAutomationHistoryHistoryTargetSteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryTargetStepID"); - - entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsAutomationHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationHistory_HistoryWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.StateSite).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateSiteID_CMS_Site"); - - entity.HasOne(d => d.StateStep).WithMany(p => p.CmsAutomationStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationState_StateStepID"); - - entity.HasOne(d => d.StateUser).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateUserID_CMS_User"); - - entity.HasOne(d => d.StateWorkflow).WithMany(p => p.CmsAutomationStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationState_StateWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TemplateLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AvatarId).IsClustered(false); - - entity.HasIndex(e => e.AvatarName, "IX_CMS_Avatar_AvatarName").IsClustered(); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_CMS_Category_CategoryDisplayName_CategoryEnabled").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.CategorySite).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategorySiteID_CMS_Site"); - - entity.HasOne(d => d.CategoryUser).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategoryUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ClassId).IsClustered(false); - - entity.HasIndex(e => new { e.ClassId, e.ClassName, e.ClassDisplayName }, "IX_CMS_Class_ClassID_ClassName_ClassDisplayName").IsClustered(); - - entity.HasOne(d => d.ClassResource).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassResourceID_CMS_Resource"); - - entity.HasMany(d => d.ChildClasses).WithMany(p => p.ParentClasses) - .UsingEntity>( - "CmsAllowedChildClass", - r => r.HasOne().WithMany() - .HasForeignKey("ChildClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ParentClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), - j => - { - j.HasKey("ParentClassId", "ChildClassId"); - j.ToTable("CMS_AllowedChildClasses"); - j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); - j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); - j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); - }); - - entity.HasMany(d => d.ParentClasses).WithMany(p => p.ChildClasses) - .UsingEntity>( - "CmsAllowedChildClass", - r => r.HasOne().WithMany() - .HasForeignKey("ParentClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ChildClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), - j => - { - j.HasKey("ParentClassId", "ChildClassId"); - j.ToTable("CMS_AllowedChildClasses"); - j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); - j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); - j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); - }); - - entity.HasMany(d => d.Sites).WithMany(p => p.Classes) - .UsingEntity>( - "CmsClassSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Class_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Class_ClassID_CMS_Class"), - j => - { - j.HasKey("ClassId", "SiteId"); - j.ToTable("CMS_ClassSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_ClassSite_SiteID"); - j.IndexerProperty("ClassId").HasColumnName("ClassID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ConsentName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentAgreementTime).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ConsentAgreementConsent).WithMany(p => p.CmsConsentAgreements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementConsentID_CMS_Consent"); - - entity.HasOne(d => d.ConsentAgreementContact).WithMany(p => p.CmsConsentAgreements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementContactID_OM_Contact"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentArchiveContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentArchiveHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentArchiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ConsentArchiveConsent).WithMany(p => p.CmsConsentArchives) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentArchive_ConsentArchiveConsentID_CMS_Consent"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CountryId).IsClustered(false); - - entity.HasIndex(e => e.CountryDisplayName, "IX_CMS_Country_CountryDisplayName").IsClustered(); - - entity.Property(e => e.CountryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CountryLastModified).HasDefaultValueSql("('11/14/2013 1:43:04 PM')"); - entity.Property(e => e.CountryName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CultureId).IsClustered(false); - - entity.HasIndex(e => e.CultureName, "IX_CMS_Culture_CultureName").IsClustered(); - - entity.Property(e => e.CultureIsUiculture).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DocumentCanBePublished).HasDefaultValueSql("((1))"); - entity.Property(e => e.DocumentCulture).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.DocumentCheckedOutByUser).WithMany(p => p.CmsDocumentDocumentCheckedOutByUsers).HasConstraintName("FK_CMS_Document_DocumentCheckedOutByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentCheckedOutVersionHistory).WithMany(p => p.CmsDocumentDocumentCheckedOutVersionHistories).HasConstraintName("FK_CMS_Document_DocumentCheckedOutVersionHistoryID_CMS_VersionHistory"); - - entity.HasOne(d => d.DocumentCreatedByUser).WithMany(p => p.CmsDocumentDocumentCreatedByUsers).HasConstraintName("FK_CMS_Document_DocumentCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentModifiedByUser).WithMany(p => p.CmsDocumentDocumentModifiedByUsers).HasConstraintName("FK_CMS_Document_DocumentModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.DocumentNode).WithMany(p => p.CmsDocuments) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Document_DocumentNodeID_CMS_Tree"); - - entity.HasOne(d => d.DocumentPublishedVersionHistory).WithMany(p => p.CmsDocumentDocumentPublishedVersionHistories).HasConstraintName("FK_CMS_Document_DocumentPublishedVersionHistoryID_CMS_VersionHistory"); - - entity.HasOne(d => d.DocumentTagGroup).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentTagGroupID_CMS_TagGroup"); - - entity.HasOne(d => d.DocumentWorkflowStep).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentWorkflowStepID_CMS_WorkflowStep"); - - entity.HasMany(d => d.Categories).WithMany(p => p.Documents) - .UsingEntity>( - "CmsDocumentCategory", - r => r.HasOne().WithMany() - .HasForeignKey("CategoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentCategory_CategoryID_CMS_Category"), - l => l.HasOne().WithMany() - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentCategory_DocumentID_CMS_Document"), - j => - { - j.HasKey("DocumentId", "CategoryId"); - j.ToTable("CMS_DocumentCategory"); - j.HasIndex(new[] { "CategoryId" }, "IX_CMS_DocumentCategory_CategoryID"); - j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); - j.IndexerProperty("CategoryId").HasColumnName("CategoryID"); - }); - - entity.HasMany(d => d.Tags).WithMany(p => p.Documents) - .UsingEntity>( - "CmsDocumentTag", - r => r.HasOne().WithMany() - .HasForeignKey("TagId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTag_TagID_CMS_Tag"), - l => l.HasOne().WithMany() - .HasForeignKey("DocumentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTag_DocumentID_CMS_Document"), - j => - { - j.HasKey("DocumentId", "TagId"); - j.ToTable("CMS_DocumentTag"); - j.HasIndex(new[] { "TagId" }, "IX_CMS_DocumentTag_TagID"); - j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); - j.IndexerProperty("TagId").HasColumnName("TagID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ScopeId).IsClustered(false); - - entity.HasIndex(e => e.ScopePath, "IX_CMS_DocumentTypeScope_ScopePath").IsClustered(); - - entity.Property(e => e.ScopeAllowAllTypes).HasDefaultValueSql("((0))"); - entity.Property(e => e.ScopeAllowLinks).HasDefaultValueSql("((0))"); - entity.Property(e => e.ScopeLastModified).HasDefaultValueSql("('4/30/2013 2:47:21 PM')"); - entity.Property(e => e.ScopePath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsDocumentTypeScopes).HasConstraintName("FK_CMS_DocumentTypeScope_ScopeSiteID_CMS_Site"); - - entity.HasMany(d => d.Classes).WithMany(p => p.Scopes) - .UsingEntity>( - "CmsDocumentTypeScopeClass", - r => r.HasOne().WithMany() - .HasForeignKey("ClassId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ClassID_CMS_Class"), - l => l.HasOne().WithMany() - .HasForeignKey("ScopeId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ScopeID_CMS_DocumentTypeScope"), - j => - { - j.HasKey("ScopeId", "ClassId"); - j.ToTable("CMS_DocumentTypeScopeClass"); - j.HasIndex(new[] { "ClassId" }, "IX_CMS_DocumentTypeScopeClass_ClassID"); - j.IndexerProperty("ScopeId").HasColumnName("ScopeID"); - j.IndexerProperty("ClassId").HasColumnName("ClassID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailFrom).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailIsMass).HasDefaultValueSql("((1))"); - entity.Property(e => e.EmailLastModified).HasDefaultValueSql("('6/17/2016 10:11:21 AM')"); - entity.Property(e => e.EmailSubject).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Attachments).WithMany(p => p.Emails) - .UsingEntity>( - "CmsAttachmentForEmail", - r => r.HasOne().WithMany() - .HasForeignKey("AttachmentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentForEmail_AttachmentID_CMS_EmailAttachment"), - l => l.HasOne().WithMany() - .HasForeignKey("EmailId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentForEmail_EmailID_CMS_Email"), - j => - { - j.HasKey("EmailId", "AttachmentId"); - j.ToTable("CMS_AttachmentForEmail"); - j.HasIndex(new[] { "AttachmentId" }, "IX_CMS_AttachmentForEmail_AttachmentID"); - j.IndexerProperty("EmailId").HasColumnName("EmailID"); - j.IndexerProperty("AttachmentId").HasColumnName("AttachmentID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.EmailTemplateId).IsClustered(false); - - entity.HasIndex(e => e.EmailTemplateDisplayName, "IX_CMS_EmailTemplate_EmailTemplateDisplayName").IsClustered(); - - entity.Property(e => e.EmailTemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.EmailTemplateName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailTemplateSite).WithMany(p => p.CmsEmailTemplates).HasConstraintName("FK_CMS_Email_EmailTemplateSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Email).WithMany(p => p.CmsEmailUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_EmailUser_EmailID_CMS_Email"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsEmailUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_EmailUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DocumentName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventMachineName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventTime).HasDefaultValueSql("('4/21/2015 8:21:43 AM')"); - entity.Property(e => e.EventType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventUrl).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventUrlReferrer).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Ipaddress).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Source).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.User).WithMany(p => p.CmsExternalLogins) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ExternalLogin_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.FormId).IsClustered(false); - - entity.HasIndex(e => e.FormDisplayName, "IX_CMS_Form_FormDisplayName").IsClustered(); - - entity.Property(e => e.FormConfirmationEmailSubject).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormEmailAttachUploadedDocs).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormLastModified).HasDefaultValueSql("('9/17/2012 1:37:08 PM')"); - entity.Property(e => e.FormLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.FormName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormSubmitButtonText).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.FormClass).WithMany(p => p.CmsForms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Form_FormClassID_CMS_Class"); - - entity.HasOne(d => d.FormSite).WithMany(p => p.CmsForms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Form_FormSiteID_CMS_Site"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Forms) - .UsingEntity>( - "CmsFormRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_FormRole_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("FormId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_FormRole_FormID_CMS_Form"), - j => - { - j.HasKey("FormId", "RoleId"); - j.ToTable("CMS_FormRole"); - j.HasIndex(new[] { "RoleId" }, "IX_CMS_FormRole_RoleID"); - j.IndexerProperty("FormId").HasColumnName("FormID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.UserControlId).IsClustered(false); - - entity.HasIndex(e => e.UserControlDisplayName, "IX_CMS_FormUserControl_UserControlDisplayName").IsClustered(); - - entity.Property(e => e.UserControlIsSystem).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserControlPriority).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserControlShowInCustomTables).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.UserControlParent).WithMany(p => p.InverseUserControlParent).HasConstraintName("FK_CMS_FormUserControl_UserControlParentID_CMS_FormUserControl"); - - entity.HasOne(d => d.UserControlResource).WithMany(p => p.CmsFormUserControls).HasConstraintName("FK_CMS_FormUserControl_UserControlResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HelpTopicLink).HasDefaultValueSql("(N'')"); - entity.Property(e => e.HelpTopicName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.HelpTopicUielement).WithMany(p => p.CmsHelpTopics) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_HelpTopic_HelpTopicUIElementID_CMS_UIElement"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LayoutCode).HasDefaultValueSql("('')"); - entity.Property(e => e.LayoutCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.LayoutDisplayName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.LicenseKeyId).IsClustered(false); - - entity.HasIndex(e => e.LicenseDomain, "IX_CMS_LicenseKey_LicenseDomain").IsClustered(); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.MacroIdentityName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.MacroIdentityEffectiveUser).WithMany(p => p.CmsMacroIdentities).HasConstraintName("FK_CMS_MacroIdentity_MacroIdentityEffectiveUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MacroRuleAvailability).HasDefaultValueSql("((0))"); - entity.Property(e => e.MacroRuleCondition).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MacroRuleDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.MacroRuleEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MacroRuleIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.MacroRuleLastModified).HasDefaultValueSql("('5/1/2012 8:46:33 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.MembershipSite).WithMany(p => p.CmsMemberships).HasConstraintName("FK_CMS_Membership_MembershipSiteID_CMS_Site"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Memberships) - .UsingEntity>( - "CmsMembershipRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipRole_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("MembershipId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipRole_MembershipID_CMS_Membership"), - j => - { - j.HasKey("MembershipId", "RoleId"); - j.ToTable("CMS_MembershipRole"); - j.HasIndex(new[] { "RoleId" }, "IX_CMS_MembershipRole_RoleID"); - j.IndexerProperty("MembershipId").HasColumnName("MembershipID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Membership).WithMany(p => p.CmsMembershipUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipUser_MembershipID_CMS_Membership"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsMembershipUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MembershipUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.MetaFileId).IsClustered(false); - - entity.HasIndex(e => new { e.MetaFileObjectType, e.MetaFileObjectId, e.MetaFileGroupName }, "IX_CMS_Metafile_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName").IsClustered(); - - entity.HasOne(d => d.MetaFileSite).WithMany(p => p.CmsMetaFiles).HasConstraintName("FK_CMS_MetaFile_MetaFileSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ModuleLicenseKeyLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ModuleLicenseKeyLicense).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ModuleLicenseKeyResource).WithMany(p => p.CmsModuleLicenseKeys) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ModuleUsageCounterName, "IX_CMS_ModuleUsageCounter_ModuleUsageCounterName") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.ModuleUsageCounterId).ValueGeneratedOnAdd(); - entity.Property(e => e.ModuleUsageCounterName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ObjectSettingsObjectType).HasDefaultValueSql("('')"); - entity.Property(e => e.ObjectWorkflowSendEmails).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ObjectCheckedOutByUser).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutByUserID_CMS_User"); - - entity.HasOne(d => d.ObjectCheckedOutVersionHistory).WithMany(p => p.CmsObjectSettingObjectCheckedOutVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID_CMS_ObjectVersionHistory"); - - entity.HasOne(d => d.ObjectPublishedVersionHistory).WithMany(p => p.CmsObjectSettingObjectPublishedVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectPublishedVersionHistoryID_CMS_ObjectVersionHistory"); - - entity.HasOne(d => d.ObjectWorkflowStep).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectWorkflowStepID_CMS_WorkflowStep"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.VersionId) - .HasName("PK_CMS_ObjectVersionHistory_VersionID") - .IsClustered(false); - - entity.HasIndex(e => new { e.VersionObjectType, e.VersionObjectId, e.VersionId }, "PK_CMS_ObjectVersionHistory") - .IsUnique() - .IsDescending(false, false, true) - .IsClustered(); - - entity.Property(e => e.VersionNumber).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionDeletedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionModifiedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionModifiedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionObjectSite).WithMany(p => p.CmsObjectVersionHistories).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionObjectSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TriggerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TriggerObjectType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TriggerWorkflow).WithMany(p => p.CmsObjectWorkflowTriggers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ObjectWorkflowTrigger_TriggerWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PageFormerUrlPathCulture).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PageFormerUrlPathLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.PageFormerUrlPathUrlPath).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PageFormerUrlPathUrlPathHash).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PageFormerUrlPathNode).WithMany(p => p.CmsPageFormerUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageFormerUrlPath_PageFormerUrlPathNodeID_CMS_Tree"); - - entity.HasOne(d => d.PageFormerUrlPathSite).WithMany(p => p.CmsPageFormerUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageFormerUrlPath_PageFormerUrlPathSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PageTemplateId).IsClustered(false); - - entity.HasIndex(e => e.PageTemplateCategoryId, "IX_CMS_PageTemplate_PageTemplateCategoryID").IsClustered(); - - entity.Property(e => e.PageTemplateCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.PageTemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.PageTemplateIconClass).HasDefaultValueSql("(N'icon-layout')"); - entity.Property(e => e.PageTemplateIsLayout).HasDefaultValueSql("((0))"); - entity.Property(e => e.PageTemplateType).HasDefaultValueSql("(N'portal')"); - - entity.HasOne(d => d.PageTemplateCategory).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateCategoryID_CMS_PageTemplateCategory"); - - entity.HasOne(d => d.PageTemplateLayoutNavigation).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateLayoutID_CMS_Layout"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_CMS_PageTemplateCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryChildCount).HasDefaultValueSql("((0))"); - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryTemplateChildCount).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_PageTemplateCategory_CategoryParentID_CMS_PageTemplateCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PageTemplateConfigurationLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.PageTemplateConfigurationName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PageTemplateConfigurationTemplate).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PageTemplateConfigurationSite).WithMany(p => p.CmsPageTemplateConfigurations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PageUrlPathCulture).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PageUrlPathLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.PageUrlPathUrlPath).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PageUrlPathUrlPathHash).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PageUrlPathNode).WithMany(p => p.CmsPageUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageUrlPath_PageUrlPathNodeID_CMS_Tree"); - - entity.HasOne(d => d.PageUrlPathSite).WithMany(p => p.CmsPageUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_PageUrlPath_PageUrlPathSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PermissionDisplayInMatrix).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.Class).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ClassID_CMS_Class"); - - entity.HasOne(d => d.Resource).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PersonalizationLastModified).HasDefaultValueSql("('9/2/2008 5:36:59 PM')"); - - entity.HasOne(d => d.PersonalizationSite).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationSiteID_CMS_Site"); - - entity.HasOne(d => d.PersonalizationUser).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.QueryIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.QueryName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.Class).WithMany(p => p.CmsQueries).HasConstraintName("FK_CMS_Query_ClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.LeftNode).WithMany(p => p.CmsRelationshipLeftNodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_LeftNodeID_CMS_Tree"); - - entity.HasOne(d => d.RelationshipName).WithMany(p => p.CmsRelationships) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_RelationshipNameID_CMS_RelationshipName"); - - entity.HasOne(d => d.RightNode).WithMany(p => p.CmsRelationshipRightNodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Relationship_RightNodeID_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.RelationshipDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.RelationshipName).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Sites).WithMany(p => p.RelationshipNames) - .UsingEntity>( - "CmsRelationshipNameSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RelationshipNameSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("RelationshipNameId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RelationshipNameSite_RelationshipNameID_CMS_RelationshipName"), - j => - { - j.HasKey("RelationshipNameId", "SiteId"); - j.ToTable("CMS_RelationshipNameSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_RelationshipNameSite_SiteID"); - j.IndexerProperty("RelationshipNameId").HasColumnName("RelationshipNameID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ResourceId).IsClustered(false); - - entity.HasIndex(e => e.ResourceDisplayName, "IX_CMS_Resource_ResourceDisplayName").IsClustered(); - - entity.Property(e => e.ResourceHasFiles).HasDefaultValueSql("((0))"); - entity.Property(e => e.ResourceInstallationState).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ResourceInstalledVersion).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ShowInDevelopment).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Resources) - .UsingEntity>( - "CmsResourceSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ResourceId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceSite_ResourceID_CMS_Resource"), - j => - { - j.HasKey("ResourceId", "SiteId"); - j.ToTable("CMS_ResourceSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_ResourceSite_SiteID"); - j.IndexerProperty("ResourceId").HasColumnName("ResourceID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ResourceLibraryPath).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ResourceLibraryResource).WithMany(p => p.CmsResourceLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceLibrary_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TranslationCulture).WithMany(p => p.CmsResourceTranslations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceTranslation_TranslationCultureID_CMS_Culture"); - - entity.HasOne(d => d.TranslationString).WithMany(p => p.CmsResourceTranslations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceTranslation_TranslationStringID_CMS_ResourceString"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.RoleId).IsClustered(false); - - entity.HasIndex(e => new { e.SiteId, e.RoleName, e.RoleDisplayName }, "IX_CMS_Role_SiteID_RoleName_RoleDisplayName") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_SiteID_CMS_SiteID"); - - entity.HasMany(d => d.Elements).WithMany(p => p.Roles) - .UsingEntity>( - "CmsRoleApplication", - r => r.HasOne().WithMany() - .HasForeignKey("ElementId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleApplication_CMS_UIElement"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleApplication_CMS_Role"), - j => - { - j.HasKey("RoleId", "ElementId"); - j.ToTable("CMS_RoleApplication"); - j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleApplication"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("ElementId").HasColumnName("ElementID"); - }); - - entity.HasMany(d => d.ElementsNavigation).WithMany(p => p.RolesNavigation) - .UsingEntity>( - "CmsRoleUielement", - r => r.HasOne().WithMany() - .HasForeignKey("ElementId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleUIElement_ElementID_CMS_UIElement"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RoleUIElement_RoleID_CMS_Role"), - j => - { - j.HasKey("RoleId", "ElementId"); - j.ToTable("CMS_RoleUIElement"); - j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleUIElement_ElementID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("ElementId").HasColumnName("ElementID"); - }); - - entity.HasMany(d => d.Permissions).WithMany(p => p.Roles) - .UsingEntity>( - "CmsRolePermission", - r => r.HasOne().WithMany() - .HasForeignKey("PermissionId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RolePermission_PermissionID_CMS_Permission"), - l => l.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_RolePermission_RoleID_CMS_Role"), - j => - { - j.HasKey("RoleId", "PermissionId"); - j.ToTable("CMS_RolePermission"); - j.HasIndex(new[] { "PermissionId" }, "IX_CMS_RolePermission_PermissionID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - j.IndexerProperty("PermissionId").HasColumnName("PermissionID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskAllowExternalService).HasDefaultValueSql("((0))"); - entity.Property(e => e.TaskExecutingServerName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.TaskResource).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskResourceID_CMS_Resource"); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskSiteID_CMS_Site"); - - entity.HasOne(d => d.TaskUser).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.IndexId).IsClustered(false); - - entity.HasIndex(e => e.IndexDisplayName, "IX_CMS_SearchIndex_IndexDisplayName").IsClustered(); - - entity.Property(e => e.IndexProvider).HasDefaultValueSql("(N'')"); - entity.Property(e => e.IndexType).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.IndexCultures).WithMany(p => p.Indices) - .UsingEntity>( - "CmsSearchIndexCulture", - r => r.HasOne().WithMany() - .HasForeignKey("IndexCultureId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexCulture_IndexCultureID_CMS_Culture"), - l => l.HasOne().WithMany() - .HasForeignKey("IndexId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexCulture_IndexID_CMS_SearchIndex"), - j => - { - j.HasKey("IndexId", "IndexCultureId"); - j.ToTable("CMS_SearchIndexCulture"); - j.HasIndex(new[] { "IndexCultureId" }, "IX_CMS_SearchIndexCulture_IndexCultureID"); - j.IndexerProperty("IndexId").HasColumnName("IndexID"); - j.IndexerProperty("IndexCultureId").HasColumnName("IndexCultureID"); - }); - - entity.HasMany(d => d.IndexSites).WithMany(p => p.Indices) - .UsingEntity>( - "CmsSearchIndexSite", - r => r.HasOne().WithMany() - .HasForeignKey("IndexSiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexSite_IndexSiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("IndexId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SearchIndexSite_IndexID_CMS_SearchIndex"), - j => - { - j.HasKey("IndexId", "IndexSiteId"); - j.ToTable("CMS_SearchIndexSite"); - j.HasIndex(new[] { "IndexSiteId" }, "IX_CMS_SearchIndexSite_IndexSiteID"); - j.IndexerProperty("IndexId").HasColumnName("IndexID"); - j.IndexerProperty("IndexSiteId").HasColumnName("IndexSiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SearchTaskId).IsClustered(false); - - entity.HasIndex(e => new { e.SearchTaskPriority, e.SearchTaskStatus, e.SearchTaskServerName }, "IX_CMS_SearchTask_SearchTaskPriority_SearchTaskStatus_SearchTaskServerName") - .IsDescending(true, false, false) - .IsClustered(); - - entity.Property(e => e.SearchTaskCreated).HasDefaultValueSql("('4/15/2009 11:23:52 AM')"); - entity.Property(e => e.SearchTaskStatus).HasDefaultValueSql("('')"); - entity.Property(e => e.SearchTaskType).HasDefaultValueSql("('')"); - entity.Property(e => e.SearchTaskValue).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SearchTaskAzureAdditionalData).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SearchTaskAzureCreated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.SearchTaskAzureType).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryOrder, "IX_CMS_SettingsCategory_CategoryOrder").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.CategoryIsGroup).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_SettingsCategory_CMS_SettingsCategory1"); - - entity.HasOne(d => d.CategoryResource).WithMany(p => p.CmsSettingsCategories).HasConstraintName("FK_CMS_SettingsCategory_CategoryResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.KeyDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.KeyExplanationText).HasDefaultValueSql("(N'')"); - entity.Property(e => e.KeyIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyIsGlobal).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyIsHidden).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyName).HasDefaultValueSql("('')"); - entity.Property(e => e.KeyType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.KeyCategory).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_KeyCategoryID_CMS_SettingsCategory"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SiteId).IsClustered(false); - - entity.HasIndex(e => e.SiteDisplayName, "IX_CMS_Site_SiteDisplayName").IsClustered(); - - entity.Property(e => e.SiteDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.SiteDomainName).HasDefaultValueSql("('')"); - entity.Property(e => e.SiteName).HasDefaultValueSql("('')"); - entity.Property(e => e.SitePresentationUrl).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SiteStatus).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Cultures).WithMany(p => p.Sites) - .UsingEntity>( - "CmsSiteCulture", - r => r.HasOne().WithMany() - .HasForeignKey("CultureId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteCulture_CultureID_CMS_Culture"), - l => l.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteCulture_SiteID_CMS_Site"), - j => - { - j.HasKey("SiteId", "CultureId"); - j.ToTable("CMS_SiteCulture"); - j.HasIndex(new[] { "CultureId" }, "IX_CMS_SiteCulture_CultureID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - j.IndexerProperty("CultureId").HasColumnName("CultureID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Site).WithMany(p => p.CmsSiteDomainAliases) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SiteDomainAlias_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ServerDeliveryMethod).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Servers) - .UsingEntity>( - "CmsSmtpserverSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SMTPServerSite_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ServerId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_SMTPServerSite_CMS_SMTPServer"), - j => - { - j.HasKey("ServerId", "SiteId"); - j.ToTable("CMS_SMTPServerSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_SMTPServerSite_SiteID"); - j.IndexerProperty("ServerId").HasColumnName("ServerID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StateId).IsClustered(false); - - entity.HasIndex(e => e.StateDisplayName, "IX_CMS_State_CountryID_StateDisplayName").IsClustered(); - - entity.Property(e => e.StateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.StateName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.Country).WithMany(p => p.CmsStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_State_CountryID_CMS_Country"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TagId).IsClustered(false); - - entity.HasIndex(e => e.TagName, "IX_CMS_Tag_TagName").IsClustered(); - - entity.HasOne(d => d.TagGroup).WithMany(p => p.CmsTags) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tag_TagGroupID_CMS_TagGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TagGroupId).IsClustered(false); - - entity.HasIndex(e => e.TagGroupDisplayName, "IX_CMS_TagGroup_TagGroupDisplayName").IsClustered(); - - entity.Property(e => e.TagGroupDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TagGroupName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TagGroupSite).WithMany(p => p.CmsTagGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TagGroup_TagGroupSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TimeZoneId).IsClustered(false); - - entity.HasIndex(e => e.TimeZoneDisplayName, "IX_CMS_TimeZone_TimeZoneDisplayName").IsClustered(); - - entity.Property(e => e.TimeZoneDaylight).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TransformationId).IsClustered(false); - - entity.HasIndex(e => new { e.TransformationClassId, e.TransformationName }, "IX_CMS_Transformation_TransformationClassID_TransformationName").IsClustered(); - - entity.Property(e => e.TransformationCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TransformationName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TransformationType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.TransformationClass).WithMany(p => p.CmsTransformations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Transformation_TransformationClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TranslationServiceSupportsCancel).HasDefaultValueSql("((0))"); - entity.Property(e => e.TranslationServiceSupportsStatusUpdate).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubmissionSourceCulture).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SubmissionTargetCulture).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SubmissionService).WithMany(p => p.CmsTranslationSubmissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TranslationSubmission_CMS_TranslationService"); - - entity.HasOne(d => d.SubmissionSubmittedByUser).WithMany(p => p.CmsTranslationSubmissions).HasConstraintName("FK_CMS_TranslationSubmission_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SubmissionItemSubmission).WithMany(p => p.CmsTranslationSubmissionItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_TranslationSubmissionItem_CMS_TranslationSubmission"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.NodeHasChildren).HasDefaultValueSql("((0))"); - entity.Property(e => e.NodeHasLinks).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.NodeAcl).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeACLID_CMS_ACL"); - - entity.HasOne(d => d.NodeClass).WithMany(p => p.CmsTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tree_NodeClassID_CMS_Class"); - - entity.HasOne(d => d.NodeLinkedNode).WithMany(p => p.InverseNodeLinkedNode).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeID_CMS_Tree"); - - entity.HasOne(d => d.NodeLinkedNodeSite).WithMany(p => p.CmsTreeNodeLinkedNodeSites).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeSiteID_CMS_Site"); - - entity.HasOne(d => d.NodeOriginalNode).WithMany(p => p.InverseNodeOriginalNode).HasConstraintName("FK_CMS_Tree_NodeOriginalNodeID_CMS_Tree"); - - entity.HasOne(d => d.NodeOwnerNavigation).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeOwner_CMS_User"); - - entity.HasOne(d => d.NodeParent).WithMany(p => p.InverseNodeParent).HasConstraintName("FK_CMS_Tree_NodeParentID_CMS_Tree"); - - entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsTreeNodeSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tree_NodeSiteID_CMS_Site"); - - entity.HasOne(d => d.NodeSku).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeSKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ElementId).IsClustered(false); - - entity.HasIndex(e => new { e.ElementResourceId, e.ElementLevel, e.ElementParentId, e.ElementOrder, e.ElementCaption }, "IX_CMS_UIElement_ElementResourceID_ElementLevel_ElementParentID_ElementOrder_ElementCaption").IsClustered(); - - entity.Property(e => e.ElementCheckModuleReadPermission).HasDefaultValueSql("((1))"); - entity.Property(e => e.ElementIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementIsGlobalApplication).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementIsMenu).HasDefaultValueSql("((0))"); - entity.Property(e => e.ElementName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ElementSize).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ElementPageTemplate).WithMany(p => p.CmsUielements).HasConstraintName("FK_CMS_UIElement_ElementPageTemplateID_CMS_PageTemplate"); - - entity.HasOne(d => d.ElementParent).WithMany(p => p.InverseElementParent).HasConstraintName("FK_CMS_UIElement_ElementParentID_CMS_UIElement"); - - entity.HasOne(d => d.ElementResource).WithMany(p => p.CmsUielements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UIElement_ElementResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserIsDomain).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserIsExternal).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserIsHidden).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserName).HasDefaultValueSql("('')"); - entity.Property(e => e.UserPassword).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Culture).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_CultureID_CMS_Culture"); - - entity.HasOne(d => d.Site).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_SiteID_CMS_Site"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserCultures) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserCulture_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserMacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.UserMacroIdentityMacroIdentity).WithMany(p => p.CmsUserMacroIdentities).HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID_CMS_MacroIdentity"); - - entity.HasOne(d => d.UserMacroIdentityUser).WithOne(p => p.CmsUserMacroIdentity) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Role).WithMany(p => p.CmsUserRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserRole_RoleID_CMS_Role"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserRole_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserAccountLockReason).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserInvalidLogOnAttempts).HasDefaultValueSql("((0))"); - entity.Property(e => e.UserWaitingForApproval).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.UserActivatedByUser).WithMany(p => p.CmsUserSettingUserActivatedByUsers).HasConstraintName("FK_CMS_UserSettings_UserActivatedByUserID_CMS_User"); - - entity.HasOne(d => d.UserAvatar).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserAvatarID_CMS_Avatar"); - - entity.HasOne(d => d.UserSettingsUser).WithMany(p => p.CmsUserSettingUserSettingsUsers) - .HasPrincipalKey(p => p.UserGuid) - .HasForeignKey(d => d.UserSettingsUserGuid) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserGUID_CMS_User"); - - entity.HasOne(d => d.UserSettingsUserNavigation).WithOne(p => p.CmsUserSettingUserSettingsUserNavigation) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserID_CMS_User"); - - entity.HasOne(d => d.UserTimeZone).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserTimeZoneID_CMS_TimeZone"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Site).WithMany(p => p.CmsUserSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSite_SiteID_CMS_Site"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserSites) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserSite_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.VersionHistoryId).IsClustered(false); - - entity.HasIndex(e => e.DocumentId, "IX_CMS_VersionHistory_DocumentID").IsClustered(); - - entity.HasOne(d => d.ModifiedByUser).WithMany(p => p.CmsVersionHistoryModifiedByUsers).HasConstraintName("FK_CMS_VersionHistory_ModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsVersionHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionHistory_NodeSiteID_CMS_Site"); - - entity.HasOne(d => d.VersionClass).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionClassID_CMS_Class"); - - entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_VersionHistory_DeletedByUserID_CMS_User"); - - entity.HasOne(d => d.VersionWorkflow).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowID_CMS_Workflow"); - - entity.HasOne(d => d.VersionWorkflowStep).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowStepID_CMS_WorkflowStep"); - - entity.HasMany(d => d.AttachmentHistories).WithMany(p => p.VersionHistories) - .UsingEntity>( - "CmsVersionAttachment", - r => r.HasOne().WithMany() - .HasForeignKey("AttachmentHistoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionAttachment_AttachmentHistoryID_CMS_AttachmentHistory"), - l => l.HasOne().WithMany() - .HasForeignKey("VersionHistoryId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_VersionAttachment_VersionHistoryID_CMS_VersionHistory"), - j => - { - j.HasKey("VersionHistoryId", "AttachmentHistoryId"); - j.ToTable("CMS_VersionAttachment"); - j.HasIndex(new[] { "AttachmentHistoryId" }, "IX_CMS_VersionAttachment_AttachmentHistoryID"); - j.IndexerProperty("VersionHistoryId").HasColumnName("VersionHistoryID"); - j.IndexerProperty("AttachmentHistoryId").HasColumnName("AttachmentHistoryID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ServerId).IsClustered(false); - - entity.HasIndex(e => e.ServerDisplayName, "IX_CMS_WebFarmServer_ServerDisplayName").IsClustered(); - - entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ServerLastModified).HasDefaultValueSql("('9/17/2013 12:18:06 PM')"); - entity.Property(e => e.ServerName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LogCode).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Server).WithMany(p => p.CmsWebFarmServerTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer"); - - entity.HasOne(d => d.Task).WithMany(p => p.CmsWebFarmServerTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebFarmServerTask_TaskID_CMS_WebFarmTask"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskGuid).HasDefaultValueSql("('00000000-0000-0000-0000-000000000000')"); - entity.Property(e => e.TaskIsMemory).HasDefaultValueSql("((0))"); - entity.Property(e => e.TaskType).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.WebPartDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartFileName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.WebPartName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartProperties).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPartSkipInsertProperties).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.WebPartCategory).WithMany(p => p.CmsWebParts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPart_WebPartCategoryID_CMS_WebPartCategory"); - - entity.HasOne(d => d.WebPartParent).WithMany(p => p.InverseWebPartParent).HasConstraintName("FK_CMS_WebPart_WebPartParentID_CMS_WebPart"); - - entity.HasOne(d => d.WebPartResource).WithMany(p => p.CmsWebParts).HasConstraintName("FK_CMS_WebPart_WebPartResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_CMS_WebPartCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_WebPartCategory_CategoryParentID_CMS_WebPartCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ContainerId).IsClustered(false); - - entity.HasIndex(e => e.ContainerDisplayName, "IX_CMS_WebPartContainer_ContainerDisplayName").IsClustered(); - - entity.Property(e => e.ContainerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContainerName).HasDefaultValueSql("('')"); - - entity.HasMany(d => d.Sites).WithMany(p => p.Containers) - .UsingEntity>( - "CmsWebPartContainerSite", - r => r.HasOne().WithMany() - .HasForeignKey("SiteId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartContainerSite_SiteID_CMS_Site"), - l => l.HasOne().WithMany() - .HasForeignKey("ContainerId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartContainerSite_ContainerID_CMS_WebPartContainer"), - j => - { - j.HasKey("ContainerId", "SiteId"); - j.ToTable("CMS_WebPartContainerSite"); - j.HasIndex(new[] { "SiteId" }, "IX_CMS_WebPartContainerSite_SiteID"); - j.IndexerProperty("ContainerId").HasColumnName("ContainerID"); - j.IndexerProperty("SiteId").HasColumnName("SiteID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WebPartLayoutId).IsClustered(false); - - entity.HasIndex(e => new { e.WebPartLayoutWebPartId, e.WebPartLayoutCodeName }, "IX_CMS_WebPartLayout_WebPartLayoutWebPartID_WebPartLayoutCodeName").IsClustered(); - - entity.Property(e => e.WebPartLayoutCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.WebPartLayoutDisplayName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.WebPartLayoutWebPart).WithMany(p => p.CmsWebPartLayouts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPartLayout_WebPartLayoutWebPartID_CMS_WebPart"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WidgetId).IsClustered(false); - - entity.HasIndex(e => new { e.WidgetCategoryId, e.WidgetDisplayName }, "IX_CMS_Widget_WidgetCategoryID_WidgetDisplayName").IsClustered(); - - entity.Property(e => e.WidgetSecurity).HasDefaultValueSql("((2))"); - - entity.HasOne(d => d.WidgetCategory).WithMany(p => p.CmsWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Widget_WidgetCategoryID_CMS_WidgetCategory"); - - entity.HasOne(d => d.WidgetLayout).WithMany(p => p.CmsWidgets).HasConstraintName("FK_CMS_Widget_WidgetLayoutID_CMS_WebPartLayout"); - - entity.HasOne(d => d.WidgetWebPart).WithMany(p => p.CmsWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Widget_WidgetWebPartID_CMS_WebPart"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WidgetCategoryId).IsClustered(false); - - entity.HasIndex(e => e.WidgetCategoryPath, "IX_CMS_WidgetCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.WidgetCategoryParent).WithMany(p => p.InverseWidgetCategoryParent).HasConstraintName("FK_CMS_WidgetCategory_WidgetCategoryParentID_CMS_WidgetCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Permission).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_RoleID_CMS_Role"); - - entity.HasOne(d => d.Widget).WithMany(p => p.CmsWidgetRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WidgetRole_WidgetID_CMS_Widget"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowId).IsClustered(false); - - entity.HasIndex(e => e.WorkflowDisplayName, "IX_CMS_Workflow_WorkflowDisplayName").IsClustered(); - - entity.Property(e => e.WorkflowAutoPublishChanges).HasDefaultValueSql("((0))"); - entity.Property(e => e.WorkflowDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.WorkflowEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowName).HasDefaultValueSql("('')"); - entity.Property(e => e.WorkflowSendApproveEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendArchiveEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendPublishEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendReadyForApprovalEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendRejectEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowUseCheckinCheckout).HasDefaultValueSql("((0))"); - - entity.HasMany(d => d.Users).WithMany(p => p.Workflows) - .UsingEntity>( - "CmsWorkflowUser", - r => r.HasOne().WithMany() - .HasForeignKey("UserId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowUser_UserID_CMS_User"), - l => l.HasOne().WithMany() - .HasForeignKey("WorkflowId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowUser_WorkflowID_CMS_Workflow"), - j => - { - j.HasKey("WorkflowId", "UserId").HasName("PK_CMS_WorkflowUser_1"); - j.ToTable("CMS_WorkflowUser"); - j.HasIndex(new[] { "UserId" }, "IX_CMS_WorkflowUser_UserID"); - j.IndexerProperty("WorkflowId").HasColumnName("WorkflowID"); - j.IndexerProperty("UserId").HasColumnName("UserID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ActionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ActionWorkflowType).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ActionResource).WithMany(p => p.CmsWorkflowActions).HasConstraintName("FK_CMS_WorkflowAction_ActionResourceID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ApprovedByUser).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_ApprovedByUserID_CMS_User"); - - entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_HistoryWorkflowID_CMS_Workflow"); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowHistorySteps).HasConstraintName("FK_CMS_WorkflowHistory_StepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TargetStep).WithMany(p => p.CmsWorkflowHistoryTargetSteps).HasConstraintName("FK_CMS_WorkflowHistory_TargetStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.VersionHistory).WithMany(p => p.CmsWorkflowHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowHistory_VersionHistoryID_CMS_VersionHistory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ScopeId).IsClustered(false); - - entity.HasIndex(e => e.ScopeStartingPath, "IX_CMS_WorkflowScope_ScopeStartingPath").IsClustered(); - - entity.HasOne(d => d.ScopeClass).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeClassID_CMS_Class"); - - entity.HasOne(d => d.ScopeCulture).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeCultureID_CMS_Culture"); - - entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsWorkflowScopes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowScope_ScopeSiteID_CMS_Site"); - - entity.HasOne(d => d.ScopeWorkflow).WithMany(p => p.CmsWorkflowScopes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowScope_ScopeWorkflowID_CMS_WorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.StepAllowPublish).HasDefaultValueSql("((0))"); - entity.Property(e => e.StepAllowReject).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.StepAction).WithMany(p => p.CmsWorkflowSteps).HasConstraintName("FK_CMS_WorkflowStep_StepActionID"); - - entity.HasOne(d => d.StepWorkflow).WithMany(p => p.CmsWorkflowSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStep_StepWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowStepRoleId).IsClustered(false); - - entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.RoleId }, "IX_CMS_WorkflowStepRoles_StepID_StepSourcePointGUID_RoleID") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsWorkflowStepRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepRoles_RoleID_CMS_Role"); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepRoles_StepID_CMS_WorkflowStep"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowStepUserId).IsClustered(false); - - entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.UserId }, "IX_CMS_WorkflowStepUser_StepID_StepSourcePointGUID_UserID") - .IsUnique() - .IsClustered(); - - entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepUser_StepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsWorkflowStepUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStepUser_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TransitionEndStep).WithMany(p => p.CmsWorkflowTransitionTransitionEndSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionEndStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TransitionStartStep).WithMany(p => p.CmsWorkflowTransitionTransitionStartSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionStartStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TransitionWorkflow).WithMany(p => p.CmsWorkflowTransitions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionWorkflowID_CMS_Workflow"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.AddressId).HasName("PK_COM_CustomerAdress"); - - entity.Property(e => e.AddressCity).HasDefaultValueSql("('')"); - entity.Property(e => e.AddressLastModified).HasDefaultValueSql("('10/18/2012 3:39:07 PM')"); - entity.Property(e => e.AddressLine1).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AddressName).HasDefaultValueSql("('')"); - entity.Property(e => e.AddressPersonalName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AddressZip).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Address_AddressCountryID_CMS_Country"); - - entity.HasOne(d => d.AddressCustomer).WithMany(p => p.ComAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Address_AddressCustomerID_COM_Customer"); - - entity.HasOne(d => d.AddressState).WithMany(p => p.ComAddresses).HasConstraintName("FK_COM_Address_AddressStateID_CMS_State"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BrandDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.BrandEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.BrandLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.BrandName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.BrandSite).WithMany(p => p.ComBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Brand_BrandSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CarrierAssemblyName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierClassName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CarrierLastModified).HasDefaultValueSql("('9/22/2014 3:00:14 PM')"); - entity.Property(e => e.CarrierName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CarrierSite).WithMany(p => p.ComCarriers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Carrier_CarrierSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CollectionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CollectionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.CollectionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.CollectionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CollectionSite).WithMany(p => p.ComCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Collection_CollectionSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CouponCodeCode).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CouponCodeDiscount).WithMany(p => p.ComCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CouponCode_CouponCodeDiscountID_COM_Discount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CurrencyCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyFormatString).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CurrencyName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CurrencySite).WithMany(p => p.ComCurrencies).HasConstraintName("FK_COM_Currency_CurrencySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ExchangeRateToCurrency).WithMany(p => p.ComCurrencyExchangeRates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID_COM_Currency"); - - entity.HasOne(d => d.ExchangeTable).WithMany(p => p.ComCurrencyExchangeRates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeTableID_COM_ExchangeTable"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.CustomerCompany, "IX_COM_Customer_CustomerCompany") - .HasFilter("([CustomerCompany] IS NOT NULL)") - .HasFillFactor(90); - - entity.HasOne(d => d.CustomerSite).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerSiteID_CMS_Site"); - - entity.HasOne(d => d.CustomerUser).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EventCreditLastModified).HasDefaultValueSql("('9/26/2012 12:21:38 PM')"); - entity.Property(e => e.EventDate).HasDefaultValueSql("('9/27/2012 2:48:56 PM')"); - entity.Property(e => e.EventName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.EventCustomer).WithMany(p => p.ComCustomerCreditHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_CustomerCreditHistory_EventCustomerID_COM_Customer"); - - entity.HasOne(d => d.EventSite).WithMany(p => p.ComCustomerCreditHistories).HasConstraintName("FK_COM_CustomerCreditHistory_EventSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DepartmentDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.DepartmentName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.DepartmentDefaultTaxClass).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentDefaultTaxClassID_COM_TaxClass"); - - entity.HasOne(d => d.DepartmentSite).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); - entity.Property(e => e.DiscountApplyTo).HasDefaultValueSql("('Order')"); - entity.Property(e => e.DiscountDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.DiscountEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.DiscountOrder).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.DiscountSite).WithMany(p => p.ComDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Discount_DiscountSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ExchangeTableId).IsClustered(false); - - entity.HasIndex(e => new { e.ExchangeTableValidFrom, e.ExchangeTableValidTo }, "IX_COM_ExchangeTable_ExchangeTableValidFrom_ExchangeTableValidTo") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.ExchangeTableDisplayName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ExchangeTableSite).WithMany(p => p.ComExchangeTables).HasConstraintName("FK_COM_ExchangeTable_ExchangeTableSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.GiftCardCustomerRestriction).HasDefaultValueSql("(N'enum1')"); - entity.Property(e => e.GiftCardDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GiftCardEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.GiftCardLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.GiftCardName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.GiftCardSite).WithMany(p => p.ComGiftCards) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_GiftCard_GiftCardSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.GiftCardCouponCodeCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.GiftCardCouponCodeLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.GiftCardCouponCodeGiftCard).WithMany(p => p.ComGiftCardCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_GiftCardCouponCode_GiftCardCouponCodeGiftCardID_COM_GiftCard"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.InternalStatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.InternalStatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.InternalStatusLastModified).HasDefaultValueSql("('9/20/2012 2:45:44 PM')"); - entity.Property(e => e.InternalStatusName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.InternalStatusSite).WithMany(p => p.ComInternalStatuses).HasConstraintName("FK_COM_InternalStatus_InternalStatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ManufacturerId).IsClustered(false); - - entity.HasIndex(e => new { e.ManufacturerDisplayName, e.ManufacturerEnabled }, "IX_COM_Manufacturer_ManufacturerDisplayName_ManufacturerEnabled").IsClustered(); - - entity.Property(e => e.ManufacturerDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ManufacturerEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ManufacturerLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ManufacturerSite).WithMany(p => p.ComManufacturers).HasConstraintName("FK_COM_Manufacturer_ManufacturerSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MultiBuyCouponCodeCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MultiBuyCouponCodeUseCount).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.MultiBuyCouponCodeMultiBuyDiscount).WithMany(p => p.ComMultiBuyCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MultiBuyDiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountAutoAddEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountCustomerRestriction).HasDefaultValueSql("(N'All')"); - entity.Property(e => e.MultiBuyDiscountEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountIsFlat).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountMinimumBuyCount).HasDefaultValueSql("((1))"); - entity.Property(e => e.MultiBuyDiscountUsesCoupons).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.MultiBuyDiscountApplyToSku).WithMany(p => p.ComMultiBuyDiscounts).HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID_COM_SKU"); - - entity.HasOne(d => d.MultiBuyDiscountSite).WithMany(p => p.ComMultiBuyDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountSiteID_CMS_Site"); - - entity.HasMany(d => d.Departments).WithMany(p => p.MultiBuyDiscounts) - .UsingEntity>( - "ComMultiBuyDiscountDepartment", - r => r.HasOne().WithMany() - .HasForeignKey("DepartmentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_DepartmentID_COM_Department"), - l => l.HasOne().WithMany() - .HasForeignKey("MultiBuyDiscountId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_MultiBuyDiscountID_COM_MultiBuyDiscount"), - j => - { - j.HasKey("MultiBuyDiscountId", "DepartmentId"); - j.ToTable("COM_MultiBuyDiscountDepartment"); - j.HasIndex(new[] { "DepartmentId" }, "IX_COM_MultiBuyDiscountDepartment_DepartmentID"); - j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); - j.IndexerProperty("DepartmentId").HasColumnName("DepartmentID"); - }); - - entity.HasMany(d => d.Skus).WithMany(p => p.MultiBuyDiscounts) - .UsingEntity>( - "ComMultiBuyDiscountSku", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountSKU_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("MultiBuyDiscountId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountSKU_MultiBuyDiscountID_COM_MultiBuyDiscount"), - j => - { - j.HasKey("MultiBuyDiscountId", "Skuid"); - j.ToTable("COM_MultiBuyDiscountSKU"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_MultiBuyDiscountSKU_SKUID"); - j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.BrandIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Brand).WithMany(p => p.ComMultiBuyDiscountBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountBrand_BrandID_COM_Brand"); - - entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountBrands) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountBrand_MultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CollectionIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Collection).WithMany(p => p.ComMultiBuyDiscountCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountCollection_CollectionID_COM_Collection"); - - entity.HasOne(d => d.MultibuyDiscount).WithMany(p => p.ComMultiBuyDiscountCollections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountCollection_MultiBuyDiscountID_COM_MultiBuyDiscount"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.NodeIncluded).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountTree_MultiBuyDiscountID_COM_MultiBuyDiscount"); - - entity.HasOne(d => d.Node).WithMany(p => p.ComMultiBuyDiscountTrees) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_MultiBuyDiscountTree_NodeID_CMS_Tree"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_COM_OptionCategory_CategoryDisplayName_CategoryEnabled").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CategoryDisplayPrice).HasDefaultValueSql("((1))"); - entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.CategoryName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.CategorySelectionType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.CategorySite).WithMany(p => p.ComOptionCategories).HasConstraintName("FK_COM_OptionCategory_CategorySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.OrderCreatedByUser).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.OrderCurrency).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCurrencyID_COM_Currency"); - - entity.HasOne(d => d.OrderCustomer).WithMany(p => p.ComOrders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Order_OrderCustomerID_COM_Customer"); - - entity.HasOne(d => d.OrderPaymentOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderPaymentOptionID_COM_PaymentOption"); - - entity.HasOne(d => d.OrderShippingOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderShippingOptionID_COM_ShippingOption"); - - entity.HasOne(d => d.OrderSite).WithMany(p => p.ComOrders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Order_OrderSiteID_CMS_Site"); - - entity.HasOne(d => d.OrderStatus).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderStatusID_COM_Status"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComOrderAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderAddress_AddressCountryID_CMS_Country"); - - entity.HasOne(d => d.AddressOrder).WithMany(p => p.ComOrderAddresses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderAddress_AddressOrderID_COM_Order"); - - entity.HasOne(d => d.AddressState).WithMany(p => p.ComOrderAddresses).HasConstraintName("FK_COM_OrderAddress_AddressStateID_CMS_State"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.OrderItemOrder).WithMany(p => p.ComOrderItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItem_OrderItemOrderID_COM_Order"); - - entity.HasOne(d => d.OrderItemSku).WithMany(p => p.ComOrderItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItem_OrderItemSKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.File).WithMany(p => p.ComOrderItemSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItemSKUFile_COM_SKUFile"); - - entity.HasOne(d => d.OrderItem).WithMany(p => p.ComOrderItemSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderItemSKUFile_COM_OrderItem"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.StatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.StatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.StatusName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.StatusSendNotification).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.StatusSite).WithMany(p => p.ComOrderStatuses).HasConstraintName("FK_COM_OrderStatus_StatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ChangedByUser).WithMany(p => p.ComOrderStatusUsers).HasConstraintName("FK_COM_OrderStatusUser_ChangedByUserID_CMS_User"); - - entity.HasOne(d => d.FromStatus).WithMany(p => p.ComOrderStatusUserFromStatuses).HasConstraintName("FK_COM_OrderStatusUser_FromStatusID_COM_Status"); - - entity.HasOne(d => d.Order).WithMany(p => p.ComOrderStatusUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderStatusUser_OrderID_COM_Order"); - - entity.HasOne(d => d.ToStatus).WithMany(p => p.ComOrderStatusUserToStatuses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_OrderStatusUser_ToStatusID_COM_Status"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PaymentOptionId).IsClustered(false); - - entity.HasIndex(e => new { e.PaymentOptionSiteId, e.PaymentOptionDisplayName, e.PaymentOptionEnabled }, "IX_COM_PaymentOption_PaymentOptionSiteID_PaymentOptionDisplayName_PaymentOptionEnabled").IsClustered(); - - entity.Property(e => e.PaymentOptionAllowIfNoShipping).HasDefaultValueSql("((0))"); - entity.Property(e => e.PaymentOptionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PaymentOptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PaymentOptionLastModified).HasDefaultValueSql("('9/27/2012 4:18:26 PM')"); - entity.Property(e => e.PaymentOptionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PaymentOptionAuthorizedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionAuthorizedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID_COM_OrderStatus"); - - entity.HasOne(d => d.PaymentOptionFailedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionFailedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionFailedOrderStatusID_COM_OrderStatus"); - - entity.HasOne(d => d.PaymentOptionSite).WithMany(p => p.ComPaymentOptions).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSiteID_CMS_Site"); - - entity.HasOne(d => d.PaymentOptionSucceededOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionSucceededOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSucceededOrderStatusID_COM_OrderStatus"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.PublicStatusId).IsClustered(false); - - entity.HasIndex(e => new { e.PublicStatusDisplayName, e.PublicStatusEnabled }, "IX_COM_PublicStatus_PublicStatusDisplayName_PublicStatusEnabled").IsClustered(); - - entity.Property(e => e.PublicStatusDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PublicStatusEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PublicStatusName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.PublicStatusSite).WithMany(p => p.ComPublicStatuses).HasConstraintName("FK_COM_PublicStatus_PublicStatusSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ShippingCostId).HasName("PK__COM_ShippingCost"); - - entity.HasOne(d => d.ShippingCostShippingOption).WithMany(p => p.ComShippingCosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShippingCost_ShippingCostShippingOptionID_COM_ShippingOption"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ShippingOptionId).IsClustered(false); - - entity.HasIndex(e => e.ShippingOptionDisplayName, "IX_COM_ShippingOptionDisplayName").IsClustered(); - - entity.Property(e => e.ShippingOptionDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ShippingOptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ShippingOptionLastModified).HasDefaultValueSql("('9/26/2012 12:44:18 PM')"); - entity.Property(e => e.ShippingOptionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ShippingOptionCarrier).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionCarrierID_COM_Carrier"); - - entity.HasOne(d => d.ShippingOptionSite).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionSiteID_CMS_Site"); - - entity.HasOne(d => d.ShippingOptionTaxClass).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionTaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ShoppingCartBillingAddress).WithMany(p => p.ComShoppingCartShoppingCartBillingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartBillingAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartCompanyAddress).WithMany(p => p.ComShoppingCartShoppingCartCompanyAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCompanyAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartCurrency).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCurrencyID_COM_Currency"); - - entity.HasOne(d => d.ShoppingCartCustomer).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCustomerID_COM_Customer"); - - entity.HasOne(d => d.ShoppingCartPaymentOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartPaymentOptionID_COM_PaymentOption"); - - entity.HasOne(d => d.ShoppingCartShippingAddress).WithMany(p => p.ComShoppingCartShoppingCartShippingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingAddressID_COM_Address"); - - entity.HasOne(d => d.ShoppingCartShippingOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingOptionID_COM_ShippingOption"); - - entity.HasOne(d => d.ShoppingCartSite).WithMany(p => p.ComShoppingCarts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCart_ShoppingCartSiteID_CMS_Site"); - - entity.HasOne(d => d.ShoppingCartUser).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CouponCode).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartCouponCodes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartCouponCode_ShoppingCartID_COM_ShoppingCart"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.CartItemAutoAddedUnits).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartSkus) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartSKU_ShoppingCartID_COM_ShoppingCart"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComShoppingCartSkus) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_ShoppingCartSKU_SKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.Skunumber, "IX_COM_SKU_SKUNumber") - .HasFilter("([SKUNumber] IS NOT NULL)") - .HasFillFactor(90); - - entity.Property(e => e.SkubundleInventoryType).HasDefaultValueSql("('REMOVEBUNDLE')"); - entity.Property(e => e.Skuenabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.Skuname).HasDefaultValueSql("('')"); - entity.Property(e => e.SkusellOnlyAvailable).HasDefaultValueSql("((0))"); - entity.Property(e => e.SkutrackInventory).HasDefaultValueSql("(N'ByProduct')"); - - entity.HasOne(d => d.Skubrand).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUBrandID_COM_Brand"); - - entity.HasOne(d => d.Skucollection).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUCollectionID_COM_Collection"); - - entity.HasOne(d => d.Skudepartment).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUDepartmentID_COM_Department"); - - entity.HasOne(d => d.SkuinternalStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUInternalStatusID_COM_InternalStatus"); - - entity.HasOne(d => d.Skumanufacturer).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUManufacturerID_COM_Manifacturer"); - - entity.HasOne(d => d.SkuoptionCategory).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUOptionCategoryID_COM_OptionCategory"); - - entity.HasOne(d => d.SkuparentSku).WithMany(p => p.InverseSkuparentSku).HasConstraintName("FK_COM_SKU_SKUParentSKUID_COM_SKU"); - - entity.HasOne(d => d.SkupublicStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUPublicStatusID_COM_PublicStatus"); - - entity.HasOne(d => d.Skusite).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSiteID_CMS_Site"); - - entity.HasOne(d => d.Skusupplier).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSupplierID_COM_Supplier"); - - entity.HasOne(d => d.SkutaxClass).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUTaxClass_COM_TaxClass"); - - entity.HasMany(d => d.Bundles).WithMany(p => p.Skus) - .UsingEntity>( - "ComBundle", - r => r.HasOne().WithMany() - .HasForeignKey("BundleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), - j => - { - j.HasKey("BundleId", "Skuid"); - j.ToTable("COM_Bundle"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); - j.IndexerProperty("BundleId").HasColumnName("BundleID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.OptionSkus).WithMany(p => p.SkusNavigation) - .UsingEntity>( - "ComSkuallowedOption", - r => r.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), - j => - { - j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); - j.ToTable("COM_SKUAllowedOption"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.OptionSkusNavigation).WithMany(p => p.VariantSkus) - .UsingEntity>( - "ComVariantOption", - r => r.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("VariantSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), - j => - { - j.HasKey("VariantSkuid", "OptionSkuid"); - j.ToTable("COM_VariantOption"); - j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); - j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - }); - - entity.HasMany(d => d.Skus).WithMany(p => p.Bundles) - .UsingEntity>( - "ComBundle", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("BundleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), - j => - { - j.HasKey("BundleId", "Skuid"); - j.ToTable("COM_Bundle"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); - j.IndexerProperty("BundleId").HasColumnName("BundleID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.SkusNavigation).WithMany(p => p.OptionSkus) - .UsingEntity>( - "ComSkuallowedOption", - r => r.HasOne().WithMany() - .HasForeignKey("Skuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), - j => - { - j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); - j.ToTable("COM_SKUAllowedOption"); - j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - j.IndexerProperty("Skuid").HasColumnName("SKUID"); - }); - - entity.HasMany(d => d.VariantSkus).WithMany(p => p.OptionSkusNavigation) - .UsingEntity>( - "ComVariantOption", - r => r.HasOne().WithMany() - .HasForeignKey("VariantSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), - l => l.HasOne().WithMany() - .HasForeignKey("OptionSkuid") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), - j => - { - j.HasKey("VariantSkuid", "OptionSkuid"); - j.ToTable("COM_VariantOption"); - j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); - j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); - j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.FileSku).WithMany(p => p.ComSkufiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUFile_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Category).WithMany(p => p.ComSkuoptionCategories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOptionCategory_CategoryID_COM_OptionCategory"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComSkuoptionCategories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_SKUOptionCategory_SKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SupplierId).IsClustered(false); - - entity.HasIndex(e => new { e.SupplierDisplayName, e.SupplierEnabled }, "IX_COM_Supplier_SupplierDisplayName_SupplierEnabled").IsClustered(); - - entity.Property(e => e.SupplierDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.SupplierEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.SupplierLastModified).HasDefaultValueSql("('9/21/2012 12:34:09 PM')"); - - entity.HasOne(d => d.SupplierSite).WithMany(p => p.ComSuppliers).HasConstraintName("FK_COM_Supplier_SupplierSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TaxClassId).IsClustered(false); - - entity.HasIndex(e => e.TaxClassDisplayName, "IX_COM_TaxClass_TaxClassDisplayName").IsClustered(); - - entity.Property(e => e.TaxClassDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TaxClassLastModified).HasDefaultValueSql("('9/20/2012 1:31:27 PM')"); - entity.Property(e => e.TaxClassName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TaxClassZeroIfIdsupplied).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.TaxClassSite).WithMany(p => p.ComTaxClasses).HasConstraintName("FK_COM_TaxClass_TaxClassSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Country).WithMany(p => p.ComTaxClassCountries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxCategoryCountry_CountryID_CMS_Country"); - - entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassCountries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxCategoryCountry_TaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.State).WithMany(p => p.ComTaxClassStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxClassState_StateID_CMS_State"); - - entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_TaxClassState_TaxClassID_COM_TaxClass"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.VolumeDiscountSku).WithMany(p => p.ComVolumeDiscounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_VolumeDiscount_VolumeDiscountSKUID_COM_SKU"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Site).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_SiteID_CMS_Site"); - - entity.HasOne(d => d.Sku).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_SKUID_COM_SKU"); - - entity.HasOne(d => d.User).WithMany(p => p.ComWishlists) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_COM_Wishlist_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ExportId).IsClustered(false); - - entity.HasIndex(e => e.ExportDateTime, "IX_Export_History_ExportDateTime") - .IsDescending() - .IsClustered(); - - entity.Property(e => e.ExportFileName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ExportSite).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportSiteID_CMS_Site"); - - entity.HasOne(d => d.ExportUser).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskSite).WithMany(p => p.ExportTasks).HasConstraintName("FK_Export_Task_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ConnectorId).IsClustered(false); - - entity.HasIndex(e => e.ConnectorDisplayName, "IX_Integration_Connector_ConnectorDisplayName").IsClustered(); - - entity.Property(e => e.ConnectorEnabled).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SyncLogSynchronization).WithMany(p => p.IntegrationSyncLogs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_SyncLog_SyncLogSynchronizationID_Integration_Synchronization"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SynchronizationConnector).WithMany(p => p.IntegrationSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_Synchronization_SynchronizationConnectorID_Integration_Connector"); - - entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.IntegrationSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Integration_Synchronization_SynchronizationTaskID_Integration_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TaskId).IsClustered(false); - - entity.HasIndex(e => e.TaskNodeAliasPath, "IX_Integration_Task_TaskNodeAliasPath").IsClustered(); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.IntegrationTasks).HasConstraintName("FK_IntegrationTask_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.FileId).IsClustered(false); - - entity.HasIndex(e => e.FilePath, "IX_Media_File_FilePath").IsClustered(); - - entity.Property(e => e.FileCreatedWhen).HasDefaultValueSql("('11/11/2008 4:10:00 PM')"); - entity.Property(e => e.FileModifiedWhen).HasDefaultValueSql("('11/11/2008 4:11:15 PM')"); - entity.Property(e => e.FileTitle).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FileCreatedByUser).WithMany(p => p.MediaFileFileCreatedByUsers).HasConstraintName("FK_Media_File_FileCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.FileLibrary).WithMany(p => p.MediaFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_File_FileLibraryID_Media_Library"); - - entity.HasOne(d => d.FileModifiedByUser).WithMany(p => p.MediaFileFileModifiedByUsers).HasConstraintName("FK_Media_File_FileModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.FileSite).WithMany(p => p.MediaFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_File_FileSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.LibraryId).IsClustered(false); - - entity.HasIndex(e => new { e.LibrarySiteId, e.LibraryDisplayName }, "IX_Media_Library_LibraryDisplayName").IsClustered(); - - entity.Property(e => e.LibraryName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.LibrarySite).WithMany(p => p.MediaLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_Library_LibrarySiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Library).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_LibraryID_Media_Library"); - - entity.HasOne(d => d.Permission).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_PermissionID_CMS_Permission"); - - entity.HasOne(d => d.Role).WithMany(p => p.MediaLibraryRolePermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_LibraryRolePermission_RoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TestLastModified).HasDefaultValueSql("('12/5/2011 4:56:38 PM')"); - - entity.HasOne(d => d.TestIssue).WithOne(p => p.NewsletterAbtestTestIssue) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_ABTest_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.TestWinnerIssue).WithMany(p => p.NewsletterAbtestTestWinnerIssues).HasConstraintName("FK_Newsletter_ABTest_TestWinnerIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.TestWinnerScheduledTask).WithMany(p => p.NewsletterAbtests).HasConstraintName("FK_Newsletter_ABTest_TestWinnerScheduledTaskID_CMS_ScheduledTask"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ClickedLinkEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ClickedLinkNewsletterLink).WithMany(p => p.NewsletterClickedLinks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_ClickedLink_Newsletter_Link"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.EmailNewsletterIssue).WithMany(p => p.NewsletterEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Emails_EmailNewsletterIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.EmailSite).WithMany(p => p.NewsletterEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Emails_EmailSiteID_CMS_Site"); - - entity.HasOne(d => d.EmailSubscriber).WithMany(p => p.NewsletterEmails).HasConstraintName("FK_Newsletter_Emails_EmailSubscriberID_Newsletter_Subscriber"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.TemplateId).IsClustered(false); - - entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateDisplayName").IsClustered(); - - entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TemplateIconClass).HasDefaultValueSql("(N'icon-accordion')"); - entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); - entity.Property(e => e.TemplateType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TemplateSite).WithMany(p => p.NewsletterEmailTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplate_TemplateSiteID_CMS_Site"); - - entity.HasMany(d => d.Newsletters).WithMany(p => p.Templates) - .UsingEntity>( - "NewsletterEmailTemplateNewsletter", - r => r.HasOne().WithMany() - .HasForeignKey("NewsletterId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_Newsletter"), - l => l.HasOne().WithMany() - .HasForeignKey("TemplateId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_EmailTemplate"), - j => - { - j.HasKey("TemplateId", "NewsletterId"); - j.ToTable("Newsletter_EmailTemplateNewsletter"); - j.HasIndex(new[] { "NewsletterId" }, "IX_Newsletter_EmailTemplateNewsletter_NewsletterID"); - j.IndexerProperty("TemplateId").HasColumnName("TemplateID"); - j.IndexerProperty("NewsletterId").HasColumnName("NewsletterID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailWidgetDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailWidgetIconCssClass).HasDefaultValueSql("(N'icon-cogwheel-square')"); - entity.Property(e => e.EmailWidgetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.EmailWidgetName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailWidgetSite).WithMany(p => p.NewsletterEmailWidgets) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidget_EmailWidgetSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.EmailWidget).WithMany(p => p.NewsletterEmailWidgetTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_EmailWidgetID_Newsletter_EmailWidget"); - - entity.HasOne(d => d.Template).WithMany(p => p.NewsletterEmailWidgetTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_TemplateID_Newsletter_EmailTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContactGroup).WithMany(p => p.NewsletterIssueContactGroups) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_IssueContactGroup_ContactGroupID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.LinkIssue).WithMany(p => p.NewsletterLinks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Link_Newsletter_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.NewsletterId).IsClustered(false); - - entity.HasIndex(e => new { e.NewsletterSiteId, e.NewsletterDisplayName }, "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterDisplayName").IsClustered(); - - entity.Property(e => e.NewsletterDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterEnableOptIn).HasDefaultValueSql("((0))"); - entity.Property(e => e.NewsletterLastModified).HasDefaultValueSql("('3/13/2015 2:53:28 PM')"); - entity.Property(e => e.NewsletterLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.NewsletterName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterSendOptInConfirmation).HasDefaultValueSql("((0))"); - entity.Property(e => e.NewsletterSenderEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.NewsletterSenderName).HasDefaultValueSql("('')"); - entity.Property(e => e.NewsletterSource).HasDefaultValueSql("(N'T')"); - entity.Property(e => e.NewsletterTrackClickedLinks).HasDefaultValueSql("((1))"); - entity.Property(e => e.NewsletterTrackOpenEmails).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.NewsletterDynamicScheduledTask).WithMany(p => p.NewsletterNewsletters).HasConstraintName("FK_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID_CMS_ScheduledTask"); - - entity.HasOne(d => d.NewsletterOptInTemplate).WithMany(p => p.NewsletterNewsletterNewsletterOptInTemplates).HasConstraintName("FK_Newsletter_Newsletter_NewsletterOptInTemplateID_EmailTemplate"); - - entity.HasOne(d => d.NewsletterSite).WithMany(p => p.NewsletterNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Newsletter_NewsletterSiteID_CMS_Site"); - - entity.HasOne(d => d.NewsletterUnsubscriptionTemplate).WithMany(p => p.NewsletterNewsletterNewsletterUnsubscriptionTemplates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID_Newsletter_EmailTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.IssueDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.IssueSubject).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.IssueNewsletter).WithMany(p => p.NewsletterNewsletterIssues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueNewsletterID_Newsletter_Newsletter"); - - entity.HasOne(d => d.IssueSite).WithMany(p => p.NewsletterNewsletterIssues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueSiteID_CMS_Site"); - - entity.HasOne(d => d.IssueTemplate).WithMany(p => p.NewsletterNewsletterIssues).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueTemplateID_Newsletter_EmailTemplate"); - - entity.HasOne(d => d.IssueVariantOfIssue).WithMany(p => p.InverseIssueVariantOfIssue).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueVariantOfIssue_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.OpenedEmailEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.OpenedEmailIssue).WithMany(p => p.NewsletterOpenedEmails) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_OpenedEmail_OpenedEmailIssueID_Newsletter_NewsletterIssue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SubscriberId).IsClustered(false); - - entity.HasIndex(e => new { e.SubscriberSiteId, e.SubscriberFullName }, "IX_Newsletter_Subscriber_SubscriberSiteID_SubscriberFullName").IsClustered(); - - entity.Property(e => e.SubscriberType).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SubscriberSite).WithMany(p => p.NewsletterSubscribers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_Subscriber_SubscriberSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SubscriptionApproved).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.Newsletter).WithMany(p => p.NewsletterSubscriberNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_SubscriberNewsletter_NewsletterID_Newsletter_Newsletter"); - - entity.HasOne(d => d.Subscriber).WithMany(p => p.NewsletterSubscriberNewsletters) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Newsletter_SubscriberNewsletter_SubscriberID_Newsletter_Subscriber"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UnsubscriptionEmail).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.UnsubscriptionFromIssue).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionFromIssueID_Newsletter_NewsletterIssue"); - - entity.HasOne(d => d.UnsubscriptionNewsletter).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionNewsletterID_Newsletter_Newsletter"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AbtestDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.AbtestIncludedTraffic).HasDefaultValueSql("((100))"); - entity.Property(e => e.AbtestName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.AbtestOriginalPage).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AbtestSite).WithMany(p => p.OmAbtests) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABTest_SiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.AbvariantDisplayName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.AbvariantTest).WithMany(p => p.OmAbvariantData) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ABVariantData_ABVariantTestID_OM_ABTest"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AccountCountry).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_Country"); - - entity.HasOne(d => d.AccountOwnerUser).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_User"); - - entity.HasOne(d => d.AccountPrimaryContact).WithMany(p => p.OmAccountAccountPrimaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_PrimaryContact"); - - entity.HasOne(d => d.AccountSecondaryContact).WithMany(p => p.OmAccountAccountSecondaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_SecondaryContact"); - - entity.HasOne(d => d.AccountState).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_State"); - - entity.HasOne(d => d.AccountStatus).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_OM_AccountStatus"); - - entity.HasOne(d => d.AccountSubsidiaryOf).WithMany(p => p.InverseAccountSubsidiaryOf).HasConstraintName("FK_OM_Account_OM_Account_SubsidiaryOf"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Account).WithMany(p => p.OmAccountContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_AccountContact_OM_Account"); - - entity.HasOne(d => d.Contact).WithMany(p => p.OmAccountContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_AccountContact_OM_Contact"); - - entity.HasOne(d => d.ContactRole).WithMany(p => p.OmAccountContacts).HasConstraintName("FK_OM_AccountContact_OM_ContactRole"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ActivityCampaign, "IX_OM_Activity_ActivityCampaign") - .HasFilter("([ActivityCampaign] IS NOT NULL)") - .HasFillFactor(90); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ActivityTypeEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ActivityTypeIsCustom).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactCreated).HasDefaultValueSql("('5/3/2011 10:51:13 AM')"); - entity.Property(e => e.ContactMonitored).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactSalesForceLeadReplicationDisabled).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactSalesForceLeadReplicationRequired).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ContactCountry).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_Country"); - - entity.HasOne(d => d.ContactOwnerUser).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_User"); - - entity.HasOne(d => d.ContactState).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_State"); - - entity.HasOne(d => d.ContactStatus).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_OM_ContactStatus"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ContactGroupId).HasName("PK_CMS_ContactGroup"); - - entity.Property(e => e.ContactGroupName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactGroupMemberFromCondition).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactGroupMemberFromManual).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ContactGroupMemberContactGroup).WithMany(p => p.OmContactGroupMembers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ContactGroupMembers_OM_ContactGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactRoleDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContactRoleName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactStatusDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContactStatusName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Contact).WithMany(p => p.OmMemberships) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_Membership_OM_Contact"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.RuleDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.RuleName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); - entity.Property(e => e.RuleType).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.RuleScore).WithMany(p => p.OmRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_Rule_OM_Score"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ScorePersonaId, "IX_OM_Score_ScorePersonaID") - .IsUnique() - .HasFilter("([ScorePersonaID] IS NOT NULL)"); - - entity.HasOne(d => d.ScorePersona).WithOne(p => p.OmScore).HasConstraintName("FK_OM_Score_Personas_Persona"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Contact).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Contact"); - - entity.HasOne(d => d.Rule).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Rule"); - - entity.HasOne(d => d.Score).WithMany(p => p.OmScoreContactRules) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ScoreContactRule_OM_Score"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.VisitorToContactContact).WithMany(p => p.OmVisitorToContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_VisitorToContact_OM_Contact_Cascade"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PersonaDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PersonaEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.PersonaName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); - entity.Property(e => e.PersonaPointsThreshold).HasDefaultValueSql("((100))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PersonaContactHistoryDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.PersonaContactHistoryPersona).WithMany(p => p.PersonasPersonaContactHistories).HasConstraintName("FK_Personas_PersonaContactHistory_Personas_Persona"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ReportId).IsClustered(false); - - entity.HasIndex(e => new { e.ReportDisplayName, e.ReportCategoryId }, "IX_Reporting_Report_ReportCategoryID_ReportDisplayName").IsClustered(); - - entity.Property(e => e.ReportAccess).HasDefaultValueSql("((1))"); - entity.Property(e => e.ReportDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportEnableSubscription).HasDefaultValueSql("((0))"); - entity.Property(e => e.ReportName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.ReportCategory).WithMany(p => p.ReportingReports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_Report_ReportCategoryID_Reporting_ReportCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryPath, "IX_Reporting_ReportCategory_CategoryPath") - .IsUnique() - .IsClustered(); - - entity.Property(e => e.CategoryCodeName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_Reporting_ReportCategory_CategoryID_Reporting_ReportCategory_ParentCategoryID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.GraphReport).WithMany(p => p.ReportingReportGraphs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportGraph_GraphReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ReportSubscriptionEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ReportSubscriptionInterval).HasDefaultValueSql("('')"); - entity.Property(e => e.ReportSubscriptionLastModified).HasDefaultValueSql("('3/9/2012 11:17:19 AM')"); - entity.Property(e => e.ReportSubscriptionOnlyNonEmpty).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ReportSubscriptionGraph).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionGraphID_Reporting_ReportGraph"); - - entity.HasOne(d => d.ReportSubscriptionReport).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionReportID_Reporting_Report"); - - entity.HasOne(d => d.ReportSubscriptionSite).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionSiteID_CMS_Site"); - - entity.HasOne(d => d.ReportSubscriptionTable).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionTableID_Reporting_ReportTable"); - - entity.HasOne(d => d.ReportSubscriptionUser).WithMany(p => p.ReportingReportSubscriptions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionUserID_CMS_User"); - - entity.HasOne(d => d.ReportSubscriptionValue).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionValueID_Reporting_ReportValue"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TableReport).WithMany(p => p.ReportingReportTables) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportTable_TableReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ValueReport).WithMany(p => p.ReportingReportValues) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_ReportValue_ValueReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SavedGraphSavedReport).WithMany(p => p.ReportingSavedGraphs) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_SavedGraph_SavedGraphSavedReportID_Reporting_SavedReport"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.SavedReportId).IsClustered(false); - - entity.HasIndex(e => new { e.SavedReportReportId, e.SavedReportDate }, "IX_Reporting_SavedReport_SavedReportReportID_SavedReportDate") - .IsDescending(false, true) - .IsClustered(); - - entity.HasOne(d => d.SavedReportCreatedByUser).WithMany(p => p.ReportingSavedReports).HasConstraintName("FK_Reporting_SavedReport_SavedReportCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.SavedReportReport).WithMany(p => p.ReportingSavedReports) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Reporting_SavedReport_SavedReportReportID_Reporting_Report"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SharePointConnectionSite).WithMany(p => p.SharePointSharePointConnections) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointConnection_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SharePointFileEtag).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileExtension).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileMimeType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointFileServerRelativeUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.SharePointFileSharePointLibrary).WithMany(p => p.SharePointSharePointFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointFile_SharePoint_SharePointLibrary"); - - entity.HasOne(d => d.SharePointFileSite).WithMany(p => p.SharePointSharePointFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointFile_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.SharePointLibraryDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibraryLastModified).HasDefaultValueSql("('10/3/2014 2:45:04 PM')"); - entity.Property(e => e.SharePointLibraryListTitle).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibraryName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.SharePointLibrarySharePointConnectionId).HasDefaultValueSql("((0))"); - entity.Property(e => e.SharePointLibrarySynchronizationPeriod).HasDefaultValueSql("((720))"); - - entity.HasOne(d => d.SharePointLibrarySharePointConnection).WithMany(p => p.SharePointSharePointLibraries).HasConstraintName("FK_SharePoint_SharePointLibrary_SharePoint_SharePointConnection"); - - entity.HasOne(d => d.SharePointLibrarySite).WithMany(p => p.SharePointSharePointLibraries) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SharePoint_SharePointLibrary_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookAccountPageAccessToken).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookAccountPageId).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FacebookAccountFacebookApplication).WithMany(p => p.SmFacebookAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookAccount_SM_FacebookApplication"); - - entity.HasOne(d => d.FacebookAccountSite).WithMany(p => p.SmFacebookAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookAccount_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookApplicationConsumerKey).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookApplicationConsumerSecret).HasDefaultValueSql("('')"); - entity.Property(e => e.FacebookApplicationLastModified).HasDefaultValueSql("('5/28/2013 1:02:36 PM')"); - - entity.HasOne(d => d.FacebookApplicationSite).WithMany(p => p.SmFacebookApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FacebookPostIsCreatedByUser).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.FacebookPostFacebookAccount).WithMany(p => p.SmFacebookPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookPost_SM_FacebookAccount"); - - entity.HasOne(d => d.FacebookPostSite).WithMany(p => p.SmFacebookPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_FacebookPost_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.InsightExternalId).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitDays).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitMonths).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitWeeks).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitYears).OnDelete(DeleteBehavior.ClientSetNull); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInAccountAccessToken).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInAccountProfileId).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInApplicationConsumerKey).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationConsumerSecret).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInApplicationName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.LinkedInApplicationSite).WithMany(p => p.SmLinkedInApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LinkedInPostComment).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LinkedInPostIsCreatedByUser).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.LinkedInPostLinkedInAccount).WithMany(p => p.SmLinkedInPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInPost_SM_LinkedInAccount"); - - entity.HasOne(d => d.LinkedInPostSite).WithMany(p => p.SmLinkedInPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_LinkedInPost_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterAccountAccessToken).HasDefaultValueSql("('')"); - entity.Property(e => e.TwitterAccountAccessTokenSecret).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterAccountSite).WithMany(p => p.SmTwitterAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterAccount_CMS_Site"); - - entity.HasOne(d => d.TwitterAccountTwitterApplication).WithMany(p => p.SmTwitterAccounts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterAccount_SM_TwitterApplication"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterApplicationConsumerKey).HasDefaultValueSql("('')"); - entity.Property(e => e.TwitterApplicationConsumerSecret).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterApplicationSite).WithMany(p => p.SmTwitterApplications) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterApplication_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TwitterPostIsCreatedByUser).HasDefaultValueSql("((1))"); - entity.Property(e => e.TwitterPostText).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TwitterPostSite).WithMany(p => p.SmTwitterPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterPost_CMS_Site"); - - entity.HasOne(d => d.TwitterPostTwitterAccount).WithMany(p => p.SmTwitterPosts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_SM_TwitterPost_SM_TwitterAccount"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ServerId).IsClustered(false); - - entity.HasIndex(e => new { e.ServerSiteId, e.ServerDisplayName }, "IX_Staging_Server_ServerSiteID_ServerDisplayName").IsClustered(); - - entity.Property(e => e.ServerAuthentication).HasDefaultValueSql("('USERNAME')"); - entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ServerEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ServerName).HasDefaultValueSql("('')"); - entity.Property(e => e.ServerUrl).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ServerSite).WithMany(p => p.StagingServers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Server_ServerSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SynchronizationServer).WithMany(p => p.StagingSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Synchronization_SynchronizationServerID_Staging_Server"); - - entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.StagingSynchronizations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_Synchronization_SynchronizationTaskID_Staging_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskServers).HasDefaultValueSql("('null')"); - - entity.HasOne(d => d.TaskSite).WithMany(p => p.StagingTasks).HasConstraintName("FK_Staging_Task_TaskSiteID_CMS_Site"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskGroupCodeName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupTask_Staging_TaskGroup"); - - entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskGroupTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupTask_Staging_Task"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupUser_Staging_TaskGroup"); - - entity.HasOne(d => d.User).WithOne(p => p.StagingTaskGroupUser) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskGroupUser_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskUser_StagingTask"); - - entity.HasOne(d => d.User).WithMany(p => p.StagingTaskUsers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Staging_TaskUser_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileDirectory).HasDefaultValueSql("('')"); - entity.Property(e => e.FileExtension).HasDefaultValueSql("('')"); - entity.Property(e => e.FileLastModified).HasDefaultValueSql("('6/29/2010 1:57:54 PM')"); - entity.Property(e => e.FileMimeType).HasDefaultValueSql("('')"); - entity.Property(e => e.FileName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PageBuilderWidgetsLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ACLItem_ItemsAndOperators"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ObjectVersionHistoryUser_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_PageTemplateCategoryPageTemplate_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Relationship_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ResourceString_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ResourceTranslated_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_RoleResourcePermission_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Site_DocumentCount"); - - entity.Property(e => e.SiteId).ValueGeneratedOnAdd(); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_SiteRoleResourceUIElement_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_Tree_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserDocuments"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRole_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRoleMembershipRole"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserRole_MembershipRole_ValidOnly_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_UserSettingsRole_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_WebPartCategoryWebpart_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_WidgetCategoryWidget_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_COM_SKUOptionCategory_OptionCategory_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Integration_Task_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Membership_MembershipUser_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Newsletter_Subscriptions_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_AccountContact_AccountJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_AccountContact_ContactJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_Account_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_ContactGroupMember_AccountJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_Reporting_CategoryReport_Joined"); - }); - - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; + +using Migration.Toolkit.KX13.Models; + +namespace Migration.Toolkit.KX13.Context; + +public partial class KX13Context : DbContext +{ + public KX13Context() + { + } + + public KX13Context(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet AnalyticsCampaigns { get; set; } + + public virtual DbSet AnalyticsCampaignAssets { get; set; } + + public virtual DbSet AnalyticsCampaignAssetUrls { get; set; } + + public virtual DbSet AnalyticsCampaignConversions { get; set; } + + public virtual DbSet AnalyticsCampaignConversionHits { get; set; } + + public virtual DbSet AnalyticsCampaignObjectives { get; set; } + + public virtual DbSet AnalyticsDayHits { get; set; } + + public virtual DbSet AnalyticsExitPages { get; set; } + + public virtual DbSet AnalyticsHourHits { get; set; } + + public virtual DbSet AnalyticsMonthHits { get; set; } + + public virtual DbSet AnalyticsStatistics { get; set; } + + public virtual DbSet AnalyticsWeekHits { get; set; } + + public virtual DbSet AnalyticsYearHits { get; set; } + + public virtual DbSet CiFileMetadata { get; set; } + + public virtual DbSet CiMigrations { get; set; } + + public virtual DbSet CmsAcls { get; set; } + + public virtual DbSet CmsAclitems { get; set; } + + public virtual DbSet CmsAlternativeForms { get; set; } + + public virtual DbSet CmsAlternativeUrls { get; set; } + + public virtual DbSet CmsAttachments { get; set; } + + public virtual DbSet CmsAttachmentHistories { get; set; } + + public virtual DbSet CmsAutomationHistories { get; set; } + + public virtual DbSet CmsAutomationStates { get; set; } + + public virtual DbSet CmsAutomationTemplates { get; set; } + + public virtual DbSet CmsAvatars { get; set; } + + public virtual DbSet CmsCategories { get; set; } + + public virtual DbSet CmsClasses { get; set; } + + public virtual DbSet CmsConsents { get; set; } + + public virtual DbSet CmsConsentAgreements { get; set; } + + public virtual DbSet CmsConsentArchives { get; set; } + + public virtual DbSet CmsCountries { get; set; } + + public virtual DbSet CmsCultures { get; set; } + + public virtual DbSet CmsDocuments { get; set; } + + public virtual DbSet CmsDocumentTypeScopes { get; set; } + + public virtual DbSet CmsEmails { get; set; } + + public virtual DbSet CmsEmailAttachments { get; set; } + + public virtual DbSet CmsEmailTemplates { get; set; } + + public virtual DbSet CmsEmailUsers { get; set; } + + public virtual DbSet CmsEventLogs { get; set; } + + public virtual DbSet CmsExternalLogins { get; set; } + + public virtual DbSet CmsForms { get; set; } + + public virtual DbSet CmsFormUserControls { get; set; } + + public virtual DbSet CmsHelpTopics { get; set; } + + public virtual DbSet CmsLayouts { get; set; } + + public virtual DbSet CmsLicenseKeys { get; set; } + + public virtual DbSet CmsMacroIdentities { get; set; } + + public virtual DbSet CmsMacroRules { get; set; } + + public virtual DbSet CmsMemberships { get; set; } + + public virtual DbSet CmsMembershipUsers { get; set; } + + public virtual DbSet CmsMetaFiles { get; set; } + + public virtual DbSet CmsModuleLicenseKeys { get; set; } + + public virtual DbSet CmsModuleUsageCounters { get; set; } + + public virtual DbSet CmsObjectSettings { get; set; } + + public virtual DbSet CmsObjectVersionHistories { get; set; } + + public virtual DbSet CmsObjectWorkflowTriggers { get; set; } + + public virtual DbSet CmsPageFormerUrlPaths { get; set; } + + public virtual DbSet CmsPageTemplates { get; set; } + + public virtual DbSet CmsPageTemplateCategories { get; set; } + + public virtual DbSet CmsPageTemplateConfigurations { get; set; } + + public virtual DbSet CmsPageUrlPaths { get; set; } + + public virtual DbSet CmsPermissions { get; set; } + + public virtual DbSet CmsPersonalizations { get; set; } + + public virtual DbSet CmsQueries { get; set; } + + public virtual DbSet CmsRelationships { get; set; } + + public virtual DbSet CmsRelationshipNames { get; set; } + + public virtual DbSet CmsResources { get; set; } + + public virtual DbSet CmsResourceLibraries { get; set; } + + public virtual DbSet CmsResourceStrings { get; set; } + + public virtual DbSet CmsResourceTranslations { get; set; } + + public virtual DbSet CmsRoles { get; set; } + + public virtual DbSet CmsScheduledTasks { get; set; } + + public virtual DbSet CmsSearchEngines { get; set; } + + public virtual DbSet CmsSearchIndices { get; set; } + + public virtual DbSet CmsSearchTasks { get; set; } + + public virtual DbSet CmsSearchTaskAzures { get; set; } + + public virtual DbSet CmsSettingsCategories { get; set; } + + public virtual DbSet CmsSettingsKeys { get; set; } + + public virtual DbSet CmsSites { get; set; } + + public virtual DbSet CmsSiteDomainAliases { get; set; } + + public virtual DbSet CmsSmtpservers { get; set; } + + public virtual DbSet CmsStates { get; set; } + + public virtual DbSet CmsTags { get; set; } + + public virtual DbSet CmsTagGroups { get; set; } + + public virtual DbSet CmsTimeZones { get; set; } + + public virtual DbSet CmsTransformations { get; set; } + + public virtual DbSet CmsTranslationServices { get; set; } + + public virtual DbSet CmsTranslationSubmissions { get; set; } + + public virtual DbSet CmsTranslationSubmissionItems { get; set; } + + public virtual DbSet CmsTrees { get; set; } + + public virtual DbSet CmsUielements { get; set; } + + public virtual DbSet CmsUsers { get; set; } + + public virtual DbSet CmsUserCultures { get; set; } + + public virtual DbSet CmsUserMacroIdentities { get; set; } + + public virtual DbSet CmsUserRoles { get; set; } + + public virtual DbSet CmsUserSettings { get; set; } + + public virtual DbSet CmsUserSites { get; set; } + + public virtual DbSet CmsVersionHistories { get; set; } + + public virtual DbSet CmsWebFarmServers { get; set; } + + public virtual DbSet CmsWebFarmServerLogs { get; set; } + + public virtual DbSet CmsWebFarmServerMonitorings { get; set; } + + public virtual DbSet CmsWebFarmServerTasks { get; set; } + + public virtual DbSet CmsWebFarmTasks { get; set; } + + public virtual DbSet CmsWebParts { get; set; } + + public virtual DbSet CmsWebPartCategories { get; set; } + + public virtual DbSet CmsWebPartContainers { get; set; } + + public virtual DbSet CmsWebPartLayouts { get; set; } + + public virtual DbSet CmsWidgets { get; set; } + + public virtual DbSet CmsWidgetCategories { get; set; } + + public virtual DbSet CmsWidgetRoles { get; set; } + + public virtual DbSet CmsWorkflows { get; set; } + + public virtual DbSet CmsWorkflowActions { get; set; } + + public virtual DbSet CmsWorkflowHistories { get; set; } + + public virtual DbSet CmsWorkflowScopes { get; set; } + + public virtual DbSet CmsWorkflowSteps { get; set; } + + public virtual DbSet CmsWorkflowStepRoles { get; set; } + + public virtual DbSet CmsWorkflowStepUsers { get; set; } + + public virtual DbSet CmsWorkflowTransitions { get; set; } + + public virtual DbSet ComAddresses { get; set; } + + public virtual DbSet ComBrands { get; set; } + + public virtual DbSet ComCarriers { get; set; } + + public virtual DbSet ComCollections { get; set; } + + public virtual DbSet ComCouponCodes { get; set; } + + public virtual DbSet ComCurrencies { get; set; } + + public virtual DbSet ComCurrencyExchangeRates { get; set; } + + public virtual DbSet ComCustomers { get; set; } + + public virtual DbSet ComCustomerCreditHistories { get; set; } + + public virtual DbSet ComDepartments { get; set; } + + public virtual DbSet ComDiscounts { get; set; } + + public virtual DbSet ComExchangeTables { get; set; } + + public virtual DbSet ComGiftCards { get; set; } + + public virtual DbSet ComGiftCardCouponCodes { get; set; } + + public virtual DbSet ComInternalStatuses { get; set; } + + public virtual DbSet ComManufacturers { get; set; } + + public virtual DbSet ComMultiBuyCouponCodes { get; set; } + + public virtual DbSet ComMultiBuyDiscounts { get; set; } + + public virtual DbSet ComMultiBuyDiscountBrands { get; set; } + + public virtual DbSet ComMultiBuyDiscountCollections { get; set; } + + public virtual DbSet ComMultiBuyDiscountTrees { get; set; } + + public virtual DbSet ComOptionCategories { get; set; } + + public virtual DbSet ComOrders { get; set; } + + public virtual DbSet ComOrderAddresses { get; set; } + + public virtual DbSet ComOrderItems { get; set; } + + public virtual DbSet ComOrderItemSkufiles { get; set; } + + public virtual DbSet ComOrderStatuses { get; set; } + + public virtual DbSet ComOrderStatusUsers { get; set; } + + public virtual DbSet ComPaymentOptions { get; set; } + + public virtual DbSet ComPublicStatuses { get; set; } + + public virtual DbSet ComShippingCosts { get; set; } + + public virtual DbSet ComShippingOptions { get; set; } + + public virtual DbSet ComShoppingCarts { get; set; } + + public virtual DbSet ComShoppingCartCouponCodes { get; set; } + + public virtual DbSet ComShoppingCartSkus { get; set; } + + public virtual DbSet ComSkus { get; set; } + + public virtual DbSet ComSkufiles { get; set; } + + public virtual DbSet ComSkuoptionCategories { get; set; } + + public virtual DbSet ComSuppliers { get; set; } + + public virtual DbSet ComTaxClasses { get; set; } + + public virtual DbSet ComTaxClassCountries { get; set; } + + public virtual DbSet ComTaxClassStates { get; set; } + + public virtual DbSet ComVolumeDiscounts { get; set; } + + public virtual DbSet ComWishlists { get; set; } + + public virtual DbSet ExportHistories { get; set; } + + public virtual DbSet ExportTasks { get; set; } + + public virtual DbSet IntegrationConnectors { get; set; } + + public virtual DbSet IntegrationSyncLogs { get; set; } + + public virtual DbSet IntegrationSynchronizations { get; set; } + + public virtual DbSet IntegrationTasks { get; set; } + + public virtual DbSet MediaFiles { get; set; } + + public virtual DbSet MediaLibraries { get; set; } + + public virtual DbSet MediaLibraryRolePermissions { get; set; } + + public virtual DbSet NewsletterAbtests { get; set; } + + public virtual DbSet NewsletterClickedLinks { get; set; } + + public virtual DbSet NewsletterEmails { get; set; } + + public virtual DbSet NewsletterEmailTemplates { get; set; } + + public virtual DbSet NewsletterEmailWidgets { get; set; } + + public virtual DbSet NewsletterEmailWidgetTemplates { get; set; } + + public virtual DbSet NewsletterIssueContactGroups { get; set; } + + public virtual DbSet NewsletterLinks { get; set; } + + public virtual DbSet NewsletterNewsletters { get; set; } + + public virtual DbSet NewsletterNewsletterIssues { get; set; } + + public virtual DbSet NewsletterOpenedEmails { get; set; } + + public virtual DbSet NewsletterSubscribers { get; set; } + + public virtual DbSet NewsletterSubscriberNewsletters { get; set; } + + public virtual DbSet NewsletterUnsubscriptions { get; set; } + + public virtual DbSet OmAbtests { get; set; } + + public virtual DbSet OmAbvariantData { get; set; } + + public virtual DbSet OmAccounts { get; set; } + + public virtual DbSet OmAccountContacts { get; set; } + + public virtual DbSet OmAccountStatuses { get; set; } + + public virtual DbSet OmActivities { get; set; } + + public virtual DbSet OmActivityRecalculationQueues { get; set; } + + public virtual DbSet OmActivityTypes { get; set; } + + public virtual DbSet OmContacts { get; set; } + + public virtual DbSet OmContactChangeRecalculationQueues { get; set; } + + public virtual DbSet OmContactGroups { get; set; } + + public virtual DbSet OmContactGroupMembers { get; set; } + + public virtual DbSet OmContactRoles { get; set; } + + public virtual DbSet OmContactStatuses { get; set; } + + public virtual DbSet OmMemberships { get; set; } + + public virtual DbSet OmRules { get; set; } + + public virtual DbSet OmScores { get; set; } + + public virtual DbSet OmScoreContactRules { get; set; } + + public virtual DbSet OmVisitorToContacts { get; set; } + + public virtual DbSet PersonasPersonas { get; set; } + + public virtual DbSet PersonasPersonaContactHistories { get; set; } + + public virtual DbSet ReportingReports { get; set; } + + public virtual DbSet ReportingReportCategories { get; set; } + + public virtual DbSet ReportingReportGraphs { get; set; } + + public virtual DbSet ReportingReportSubscriptions { get; set; } + + public virtual DbSet ReportingReportTables { get; set; } + + public virtual DbSet ReportingReportValues { get; set; } + + public virtual DbSet ReportingSavedGraphs { get; set; } + + public virtual DbSet ReportingSavedReports { get; set; } + + public virtual DbSet SharePointSharePointConnections { get; set; } + + public virtual DbSet SharePointSharePointFiles { get; set; } + + public virtual DbSet SharePointSharePointLibraries { get; set; } + + public virtual DbSet SmFacebookAccounts { get; set; } + + public virtual DbSet SmFacebookApplications { get; set; } + + public virtual DbSet SmFacebookPosts { get; set; } + + public virtual DbSet SmInsights { get; set; } + + public virtual DbSet SmInsightHitDays { get; set; } + + public virtual DbSet SmInsightHitMonths { get; set; } + + public virtual DbSet SmInsightHitWeeks { get; set; } + + public virtual DbSet SmInsightHitYears { get; set; } + + public virtual DbSet SmLinkedInAccounts { get; set; } + + public virtual DbSet SmLinkedInApplications { get; set; } + + public virtual DbSet SmLinkedInPosts { get; set; } + + public virtual DbSet SmTwitterAccounts { get; set; } + + public virtual DbSet SmTwitterApplications { get; set; } + + public virtual DbSet SmTwitterPosts { get; set; } + + public virtual DbSet StagingServers { get; set; } + + public virtual DbSet StagingSynchronizations { get; set; } + + public virtual DbSet StagingTasks { get; set; } + + public virtual DbSet StagingTaskGroups { get; set; } + + public virtual DbSet StagingTaskGroupTasks { get; set; } + + public virtual DbSet StagingTaskGroupUsers { get; set; } + + public virtual DbSet StagingTaskUsers { get; set; } + + public virtual DbSet TempFiles { get; set; } + + public virtual DbSet TempPageBuilderWidgets { get; set; } + + public virtual DbSet ViewCmsAclitemItemsAndOperators { get; set; } + + public virtual DbSet ViewCmsObjectVersionHistoryUserJoineds { get; set; } + + public virtual DbSet ViewCmsPageTemplateCategoryPageTemplateJoineds { get; set; } + + public virtual DbSet ViewCmsRelationshipJoineds { get; set; } + + public virtual DbSet ViewCmsResourceStringJoineds { get; set; } + + public virtual DbSet ViewCmsResourceTranslatedJoineds { get; set; } + + public virtual DbSet ViewCmsRoleResourcePermissionJoineds { get; set; } + + public virtual DbSet ViewCmsSiteDocumentCounts { get; set; } + + public virtual DbSet ViewCmsSiteRoleResourceUielementJoineds { get; set; } + + public virtual DbSet ViewCmsTreeJoineds { get; set; } + + public virtual DbSet ViewCmsUsers { get; set; } + + public virtual DbSet ViewCmsUserDocuments { get; set; } + + public virtual DbSet ViewCmsUserRoleJoineds { get; set; } + + public virtual DbSet ViewCmsUserRoleMembershipRoles { get; set; } + + public virtual DbSet ViewCmsUserRoleMembershipRoleValidOnlyJoineds { get; set; } + + public virtual DbSet ViewCmsUserSettingsRoleJoineds { get; set; } + + public virtual DbSet ViewCmsWebPartCategoryWebpartJoineds { get; set; } + + public virtual DbSet ViewCmsWidgetCategoryWidgetJoineds { get; set; } + + public virtual DbSet ViewComSkuoptionCategoryOptionCategoryJoineds { get; set; } + + public virtual DbSet ViewIntegrationTaskJoineds { get; set; } + + public virtual DbSet ViewMembershipMembershipUserJoineds { get; set; } + + public virtual DbSet ViewNewsletterSubscriptionsJoineds { get; set; } + + public virtual DbSet ViewOmAccountContactAccountJoineds { get; set; } + + public virtual DbSet ViewOmAccountContactContactJoineds { get; set; } + + public virtual DbSet ViewOmAccountJoineds { get; set; } + + public virtual DbSet ViewOmContactGroupMemberAccountJoineds { get; set; } + + public virtual DbSet ViewReportingCategoryReportJoineds { get; set; } + + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CampaignName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CampaignScheduledTask).WithMany(p => p.AnalyticsCampaigns).HasConstraintName("FK_Analytics_Campaign_CampaignScheduledTaskID_ScheduledTask"); + + entity.HasOne(d => d.CampaignSite).WithMany(p => p.AnalyticsCampaigns) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_Campaign_StatisticsSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignAssetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CampaignAssetType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignAssetCampaign).WithMany(p => p.AnalyticsCampaignAssets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignAsset_CampaignAssetCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignAssetUrlPageTitle).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignAssetUrlTarget).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignAssetUrlCampaignAsset).WithMany(p => p.AnalyticsCampaignAssetUrls) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID_Analytics_CampaignAsset"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignConversionActivityType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignConversionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CampaignConversionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CampaignConversionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignConversionCampaign).WithMany(p => p.AnalyticsCampaignConversions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignConversion_CampaignConversionCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignConversionHitsSourceName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CampaignConversionHitsConversion).WithMany(p => p.AnalyticsCampaignConversionHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID_Analytics_CampaignConversion"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CampaignObjectiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.CampaignObjectiveCampaignConversion).WithMany(p => p.AnalyticsCampaignObjectives) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID_Analytics_CampaignConversion"); + + entity.HasOne(d => d.CampaignObjectiveCampaign).WithOne(p => p.AnalyticsCampaignObjective) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_CampaignObjective_CampaignObjectiveCampaignID_Analytics_Campaign"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_DayHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsDayHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_DayHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ExitPageUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ExitPageSite).WithMany(p => p.AnalyticsExitPages) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_ExitPages_ExitPageSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_HourHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsHourHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_HourHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_MonthHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsMonthHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_MonthHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StatisticsId).IsClustered(false); + + entity.HasIndex(e => e.StatisticsCode, "IX_Analytics_Statistics_StatisticsCode_StatisticsSiteID_StatisticsObjectID_StatisticsObjectCulture").IsClustered(); + + entity.Property(e => e.StatisticsCode).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.StatisticsSite).WithMany(p => p.AnalyticsStatistics).HasConstraintName("FK_Analytics_Statistics_StatisticsSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_WeekHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsWeekHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_WeekHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.HitsId).IsClustered(false); + + entity.HasIndex(e => new { e.HitsStartTime, e.HitsEndTime }, "IX_Analytics_YearHits_HitsStartTime_HitsEndTime") + .IsDescending() + .IsClustered(); + + entity.HasOne(d => d.HitsStatistics).WithMany(p => p.AnalyticsYearHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Analytics_YearHits_HitsStatisticsID_Analytics_Statistics"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FileHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FileLocation).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AclinheritedAcls).HasDefaultValueSql("('')"); + entity.Property(e => e.AcllastModified).HasDefaultValueSql("('10/30/2008 9:17:31 AM')"); + + entity.HasOne(d => d.Aclsite).WithMany(p => p.CmsAcls).HasConstraintName("FK_CMS_ACL_ACLSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Acl).WithMany(p => p.CmsAclitems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ACLItem_ACLID_CMS_ACL"); + + entity.HasOne(d => d.LastModifiedByUser).WithMany(p => p.CmsAclitemLastModifiedByUsers).HasConstraintName("FK_CMS_ACLItem_LastModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsAclitems).HasConstraintName("FK_CMS_ACLItem_RoleID_CMS_Role"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsAclitemUsers).HasConstraintName("FK_CMS_ACLItem_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormHideNewParentFields).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FormClass).WithMany(p => p.CmsAlternativeFormFormClasses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AlternativeForm_FormClassID_CMS_Class"); + + entity.HasOne(d => d.FormCoupledClass).WithMany(p => p.CmsAlternativeFormFormCoupledClasses).HasConstraintName("FK_CMS_AlternativeForm_FormCoupledClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AlternativeUrlLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.AlternativeUrlUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AlternativeUrlDocument).WithMany(p => p.CmsAlternativeUrls) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AlternativeUrl_CMS_Document"); + + entity.HasOne(d => d.AlternativeUrlSite).WithMany(p => p.CmsAlternativeUrls) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AlternativeUrl_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AttachmentId).IsClustered(false); + + entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName, e.AttachmentIsUnsorted, e.AttachmentOrder }, "IX_CMS_Attachment_AttachmentDocumentID_AttachmentIsUnsorted_AttachmentName_AttachmentOrder").IsClustered(); + + entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_Attachment_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") + .IsUnique() + .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); + + entity.HasOne(d => d.AttachmentDocument).WithMany(p => p.CmsAttachments).HasConstraintName("FK_CMS_Attachment_AttachmentDocumentID_CMS_Document"); + + entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Attachment_AttachmentSiteID_CMS_Site"); + + entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_Attachment_AttachmentVariantParentID_CMS_Attachment"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AttachmentHistoryId).IsClustered(false); + + entity.HasIndex(e => new { e.AttachmentDocumentId, e.AttachmentName }, "IX_CMS_AttachmentHistory_AttachmentDocumentID_AttachmentName").IsClustered(); + + entity.HasIndex(e => new { e.AttachmentVariantDefinitionIdentifier, e.AttachmentVariantParentId }, "IX_CMS_AttachmentHistory_AttachmentVariantParentID_AttachmentVariantDefinitionIdentifier") + .IsUnique() + .HasFilter("([AttachmentVariantDefinitionIdentifier] IS NOT NULL AND [AttachmentVariantParentID] IS NOT NULL)"); + + entity.HasOne(d => d.AttachmentSite).WithMany(p => p.CmsAttachmentHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentHistory_AttachmentSiteID_CMS_Site"); + + entity.HasOne(d => d.AttachmentVariantParent).WithMany(p => p.InverseAttachmentVariantParent).HasConstraintName("FK_CMS_AttachmentHistory_AttachmentVariantParentID_CMS_AttachmentHistory"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); + entity.Property(e => e.HistoryStepDisplayName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.HistoryApprovedByUser).WithMany(p => p.CmsAutomationHistories).HasConstraintName("FK_CMS_AutomationHistory_HistoryApprovedByUserID"); + + entity.HasOne(d => d.HistoryState).WithMany(p => p.CmsAutomationHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationHistory_HistoryStateID"); + + entity.HasOne(d => d.HistoryStep).WithMany(p => p.CmsAutomationHistoryHistorySteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryStepID"); + + entity.HasOne(d => d.HistoryTargetStep).WithMany(p => p.CmsAutomationHistoryHistoryTargetSteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryTargetStepID"); + + entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsAutomationHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationHistory_HistoryWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.StateSite).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateSiteID_CMS_Site"); + + entity.HasOne(d => d.StateStep).WithMany(p => p.CmsAutomationStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationState_StateStepID"); + + entity.HasOne(d => d.StateUser).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateUserID_CMS_User"); + + entity.HasOne(d => d.StateWorkflow).WithMany(p => p.CmsAutomationStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationState_StateWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TemplateLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AvatarId).IsClustered(false); + + entity.HasIndex(e => e.AvatarName, "IX_CMS_Avatar_AvatarName").IsClustered(); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_CMS_Category_CategoryDisplayName_CategoryEnabled").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.CategorySite).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategorySiteID_CMS_Site"); + + entity.HasOne(d => d.CategoryUser).WithMany(p => p.CmsCategories).HasConstraintName("FK_CMS_Category_CategoryUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ClassId).IsClustered(false); + + entity.HasIndex(e => new { e.ClassId, e.ClassName, e.ClassDisplayName }, "IX_CMS_Class_ClassID_ClassName_ClassDisplayName").IsClustered(); + + entity.HasOne(d => d.ClassResource).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassResourceID_CMS_Resource"); + + entity.HasMany(d => d.ChildClasses).WithMany(p => p.ParentClasses) + .UsingEntity>( + "CmsAllowedChildClass", + r => r.HasOne().WithMany() + .HasForeignKey("ChildClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ParentClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), + j => + { + j.HasKey("ParentClassId", "ChildClassId"); + j.ToTable("CMS_AllowedChildClasses"); + j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); + j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); + j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); + }); + + entity.HasMany(d => d.ParentClasses).WithMany(p => p.ChildClasses) + .UsingEntity>( + "CmsAllowedChildClass", + r => r.HasOne().WithMany() + .HasForeignKey("ParentClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ParentClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ChildClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AllowedChildClasses_ChildClassID_CMS_Class"), + j => + { + j.HasKey("ParentClassId", "ChildClassId"); + j.ToTable("CMS_AllowedChildClasses"); + j.HasIndex(new[] { "ChildClassId" }, "IX_CMS_AllowedChildClasses_ChildClassID"); + j.IndexerProperty("ParentClassId").HasColumnName("ParentClassID"); + j.IndexerProperty("ChildClassId").HasColumnName("ChildClassID"); + }); + + entity.HasMany(d => d.Sites).WithMany(p => p.Classes) + .UsingEntity>( + "CmsClassSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Class_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Class_ClassID_CMS_Class"), + j => + { + j.HasKey("ClassId", "SiteId"); + j.ToTable("CMS_ClassSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_ClassSite_SiteID"); + j.IndexerProperty("ClassId").HasColumnName("ClassID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentContent).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.ConsentName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentAgreementTime).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ConsentAgreementConsent).WithMany(p => p.CmsConsentAgreements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementConsentID_CMS_Consent"); + + entity.HasOne(d => d.ConsentAgreementContact).WithMany(p => p.CmsConsentAgreements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementContactID_OM_Contact"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentArchiveContent).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentArchiveHash).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ConsentArchiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ConsentArchiveConsent).WithMany(p => p.CmsConsentArchives) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentArchive_ConsentArchiveConsentID_CMS_Consent"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CountryId).IsClustered(false); + + entity.HasIndex(e => e.CountryDisplayName, "IX_CMS_Country_CountryDisplayName").IsClustered(); + + entity.Property(e => e.CountryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CountryLastModified).HasDefaultValueSql("('11/14/2013 1:43:04 PM')"); + entity.Property(e => e.CountryName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CultureId).IsClustered(false); + + entity.HasIndex(e => e.CultureName, "IX_CMS_Culture_CultureName").IsClustered(); + + entity.Property(e => e.CultureIsUiculture).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DocumentCanBePublished).HasDefaultValueSql("((1))"); + entity.Property(e => e.DocumentCulture).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.DocumentCheckedOutByUser).WithMany(p => p.CmsDocumentDocumentCheckedOutByUsers).HasConstraintName("FK_CMS_Document_DocumentCheckedOutByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentCheckedOutVersionHistory).WithMany(p => p.CmsDocumentDocumentCheckedOutVersionHistories).HasConstraintName("FK_CMS_Document_DocumentCheckedOutVersionHistoryID_CMS_VersionHistory"); + + entity.HasOne(d => d.DocumentCreatedByUser).WithMany(p => p.CmsDocumentDocumentCreatedByUsers).HasConstraintName("FK_CMS_Document_DocumentCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentModifiedByUser).WithMany(p => p.CmsDocumentDocumentModifiedByUsers).HasConstraintName("FK_CMS_Document_DocumentModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.DocumentNode).WithMany(p => p.CmsDocuments) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Document_DocumentNodeID_CMS_Tree"); + + entity.HasOne(d => d.DocumentPublishedVersionHistory).WithMany(p => p.CmsDocumentDocumentPublishedVersionHistories).HasConstraintName("FK_CMS_Document_DocumentPublishedVersionHistoryID_CMS_VersionHistory"); + + entity.HasOne(d => d.DocumentTagGroup).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentTagGroupID_CMS_TagGroup"); + + entity.HasOne(d => d.DocumentWorkflowStep).WithMany(p => p.CmsDocuments).HasConstraintName("FK_CMS_Document_DocumentWorkflowStepID_CMS_WorkflowStep"); + + entity.HasMany(d => d.Categories).WithMany(p => p.Documents) + .UsingEntity>( + "CmsDocumentCategory", + r => r.HasOne().WithMany() + .HasForeignKey("CategoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentCategory_CategoryID_CMS_Category"), + l => l.HasOne().WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentCategory_DocumentID_CMS_Document"), + j => + { + j.HasKey("DocumentId", "CategoryId"); + j.ToTable("CMS_DocumentCategory"); + j.HasIndex(new[] { "CategoryId" }, "IX_CMS_DocumentCategory_CategoryID"); + j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); + j.IndexerProperty("CategoryId").HasColumnName("CategoryID"); + }); + + entity.HasMany(d => d.Tags).WithMany(p => p.Documents) + .UsingEntity>( + "CmsDocumentTag", + r => r.HasOne().WithMany() + .HasForeignKey("TagId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTag_TagID_CMS_Tag"), + l => l.HasOne().WithMany() + .HasForeignKey("DocumentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTag_DocumentID_CMS_Document"), + j => + { + j.HasKey("DocumentId", "TagId"); + j.ToTable("CMS_DocumentTag"); + j.HasIndex(new[] { "TagId" }, "IX_CMS_DocumentTag_TagID"); + j.IndexerProperty("DocumentId").HasColumnName("DocumentID"); + j.IndexerProperty("TagId").HasColumnName("TagID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ScopeId).IsClustered(false); + + entity.HasIndex(e => e.ScopePath, "IX_CMS_DocumentTypeScope_ScopePath").IsClustered(); + + entity.Property(e => e.ScopeAllowAllTypes).HasDefaultValueSql("((0))"); + entity.Property(e => e.ScopeAllowLinks).HasDefaultValueSql("((0))"); + entity.Property(e => e.ScopeLastModified).HasDefaultValueSql("('4/30/2013 2:47:21 PM')"); + entity.Property(e => e.ScopePath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsDocumentTypeScopes).HasConstraintName("FK_CMS_DocumentTypeScope_ScopeSiteID_CMS_Site"); + + entity.HasMany(d => d.Classes).WithMany(p => p.Scopes) + .UsingEntity>( + "CmsDocumentTypeScopeClass", + r => r.HasOne().WithMany() + .HasForeignKey("ClassId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ClassID_CMS_Class"), + l => l.HasOne().WithMany() + .HasForeignKey("ScopeId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_DocumentTypeScopeClass_ScopeID_CMS_DocumentTypeScope"), + j => + { + j.HasKey("ScopeId", "ClassId"); + j.ToTable("CMS_DocumentTypeScopeClass"); + j.HasIndex(new[] { "ClassId" }, "IX_CMS_DocumentTypeScopeClass_ClassID"); + j.IndexerProperty("ScopeId").HasColumnName("ScopeID"); + j.IndexerProperty("ClassId").HasColumnName("ClassID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailFrom).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EmailIsMass).HasDefaultValueSql("((1))"); + entity.Property(e => e.EmailLastModified).HasDefaultValueSql("('6/17/2016 10:11:21 AM')"); + entity.Property(e => e.EmailSubject).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Attachments).WithMany(p => p.Emails) + .UsingEntity>( + "CmsAttachmentForEmail", + r => r.HasOne().WithMany() + .HasForeignKey("AttachmentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentForEmail_AttachmentID_CMS_EmailAttachment"), + l => l.HasOne().WithMany() + .HasForeignKey("EmailId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentForEmail_EmailID_CMS_Email"), + j => + { + j.HasKey("EmailId", "AttachmentId"); + j.ToTable("CMS_AttachmentForEmail"); + j.HasIndex(new[] { "AttachmentId" }, "IX_CMS_AttachmentForEmail_AttachmentID"); + j.IndexerProperty("EmailId").HasColumnName("EmailID"); + j.IndexerProperty("AttachmentId").HasColumnName("AttachmentID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.EmailTemplateId).IsClustered(false); + + entity.HasIndex(e => e.EmailTemplateDisplayName, "IX_CMS_EmailTemplate_EmailTemplateDisplayName").IsClustered(); + + entity.Property(e => e.EmailTemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.EmailTemplateName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.EmailTemplateSite).WithMany(p => p.CmsEmailTemplates).HasConstraintName("FK_CMS_Email_EmailTemplateSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Email).WithMany(p => p.CmsEmailUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_EmailUser_EmailID_CMS_Email"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsEmailUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_EmailUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DocumentName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventMachineName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventTime).HasDefaultValueSql("('4/21/2015 8:21:43 AM')"); + entity.Property(e => e.EventType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventUrl).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EventUrlReferrer).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Ipaddress).HasDefaultValueSql("(N'')"); + entity.Property(e => e.Source).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.User).WithMany(p => p.CmsExternalLogins) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ExternalLogin_UserID_CMS_User")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FormId).IsClustered(false); + + entity.HasIndex(e => e.FormDisplayName, "IX_CMS_Form_FormDisplayName").IsClustered(); + + entity.Property(e => e.FormConfirmationEmailSubject).HasDefaultValueSql("(N'')"); + entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormEmailAttachUploadedDocs).HasDefaultValueSql("((0))"); + entity.Property(e => e.FormLastModified).HasDefaultValueSql("('9/17/2012 1:37:08 PM')"); + entity.Property(e => e.FormLogActivity).HasDefaultValueSql("((1))"); + entity.Property(e => e.FormName).HasDefaultValueSql("('')"); + entity.Property(e => e.FormSubmitButtonText).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.FormClass).WithMany(p => p.CmsForms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Form_FormClassID_CMS_Class"); + + entity.HasOne(d => d.FormSite).WithMany(p => p.CmsForms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Form_FormSiteID_CMS_Site"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Forms) + .UsingEntity>( + "CmsFormRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_FormRole_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("FormId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_FormRole_FormID_CMS_Form"), + j => + { + j.HasKey("FormId", "RoleId"); + j.ToTable("CMS_FormRole"); + j.HasIndex(new[] { "RoleId" }, "IX_CMS_FormRole_RoleID"); + j.IndexerProperty("FormId").HasColumnName("FormID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.UserControlId).IsClustered(false); + + entity.HasIndex(e => e.UserControlDisplayName, "IX_CMS_FormUserControl_UserControlDisplayName").IsClustered(); + + entity.Property(e => e.UserControlIsSystem).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserControlPriority).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserControlShowInCustomTables).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.UserControlParent).WithMany(p => p.InverseUserControlParent).HasConstraintName("FK_CMS_FormUserControl_UserControlParentID_CMS_FormUserControl"); + + entity.HasOne(d => d.UserControlResource).WithMany(p => p.CmsFormUserControls).HasConstraintName("FK_CMS_FormUserControl_UserControlResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HelpTopicLink).HasDefaultValueSql("(N'')"); + entity.Property(e => e.HelpTopicName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.HelpTopicUielement).WithMany(p => p.CmsHelpTopics) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_HelpTopic_HelpTopicUIElementID_CMS_UIElement"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LayoutCode).HasDefaultValueSql("('')"); + entity.Property(e => e.LayoutCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.LayoutDisplayName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LicenseKeyId).IsClustered(false); + + entity.HasIndex(e => e.LicenseDomain, "IX_CMS_LicenseKey_LicenseDomain").IsClustered(); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.MacroIdentityName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.MacroIdentityEffectiveUser).WithMany(p => p.CmsMacroIdentities).HasConstraintName("FK_CMS_MacroIdentity_MacroIdentityEffectiveUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MacroRuleAvailability).HasDefaultValueSql("((0))"); + entity.Property(e => e.MacroRuleCondition).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MacroRuleDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.MacroRuleEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MacroRuleIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.MacroRuleLastModified).HasDefaultValueSql("('5/1/2012 8:46:33 AM')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.MembershipSite).WithMany(p => p.CmsMemberships).HasConstraintName("FK_CMS_Membership_MembershipSiteID_CMS_Site"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Memberships) + .UsingEntity>( + "CmsMembershipRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipRole_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("MembershipId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipRole_MembershipID_CMS_Membership"), + j => + { + j.HasKey("MembershipId", "RoleId"); + j.ToTable("CMS_MembershipRole"); + j.HasIndex(new[] { "RoleId" }, "IX_CMS_MembershipRole_RoleID"); + j.IndexerProperty("MembershipId").HasColumnName("MembershipID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Membership).WithMany(p => p.CmsMembershipUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipUser_MembershipID_CMS_Membership"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsMembershipUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MembershipUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.MetaFileId).IsClustered(false); + + entity.HasIndex(e => new { e.MetaFileObjectType, e.MetaFileObjectId, e.MetaFileGroupName }, "IX_CMS_Metafile_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName").IsClustered(); + + entity.HasOne(d => d.MetaFileSite).WithMany(p => p.CmsMetaFiles).HasConstraintName("FK_CMS_MetaFile_MetaFileSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ModuleLicenseKeyLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.ModuleLicenseKeyLicense).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ModuleLicenseKeyResource).WithMany(p => p.CmsModuleLicenseKeys) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.ModuleUsageCounterName, "IX_CMS_ModuleUsageCounter_ModuleUsageCounterName") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.ModuleUsageCounterId).ValueGeneratedOnAdd(); + entity.Property(e => e.ModuleUsageCounterName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ObjectSettingsObjectType).HasDefaultValueSql("('')"); + entity.Property(e => e.ObjectWorkflowSendEmails).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.ObjectCheckedOutByUser).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutByUserID_CMS_User"); + + entity.HasOne(d => d.ObjectCheckedOutVersionHistory).WithMany(p => p.CmsObjectSettingObjectCheckedOutVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID_CMS_ObjectVersionHistory"); + + entity.HasOne(d => d.ObjectPublishedVersionHistory).WithMany(p => p.CmsObjectSettingObjectPublishedVersionHistories).HasConstraintName("FK_CMS_ObjectSettings_ObjectPublishedVersionHistoryID_CMS_ObjectVersionHistory"); + + entity.HasOne(d => d.ObjectWorkflowStep).WithMany(p => p.CmsObjectSettings).HasConstraintName("FK_CMS_ObjectSettings_ObjectWorkflowStepID_CMS_WorkflowStep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.VersionId) + .HasName("PK_CMS_ObjectVersionHistory_VersionID") + .IsClustered(false); + + entity.HasIndex(e => new { e.VersionObjectType, e.VersionObjectId, e.VersionId }, "PK_CMS_ObjectVersionHistory") + .IsUnique() + .IsDescending(false, false, true) + .IsClustered(); + + entity.Property(e => e.VersionNumber).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionDeletedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionModifiedByUser).WithMany(p => p.CmsObjectVersionHistoryVersionModifiedByUsers).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionObjectSite).WithMany(p => p.CmsObjectVersionHistories).HasConstraintName("FK_CMS_ObjectVersionHistory_VersionObjectSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TriggerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TriggerObjectType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TriggerWorkflow).WithMany(p => p.CmsObjectWorkflowTriggers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ObjectWorkflowTrigger_TriggerWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PageFormerUrlPathCulture).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PageFormerUrlPathLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.PageFormerUrlPathUrlPath).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PageFormerUrlPathUrlPathHash).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PageFormerUrlPathNode).WithMany(p => p.CmsPageFormerUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageFormerUrlPath_PageFormerUrlPathNodeID_CMS_Tree"); + + entity.HasOne(d => d.PageFormerUrlPathSite).WithMany(p => p.CmsPageFormerUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageFormerUrlPath_PageFormerUrlPathSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PageTemplateId).IsClustered(false); + + entity.HasIndex(e => e.PageTemplateCategoryId, "IX_CMS_PageTemplate_PageTemplateCategoryID").IsClustered(); + + entity.Property(e => e.PageTemplateCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.PageTemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.PageTemplateIconClass).HasDefaultValueSql("(N'icon-layout')"); + entity.Property(e => e.PageTemplateIsLayout).HasDefaultValueSql("((0))"); + entity.Property(e => e.PageTemplateType).HasDefaultValueSql("(N'portal')"); + + entity.HasOne(d => d.PageTemplateCategory).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateCategoryID_CMS_PageTemplateCategory"); + + entity.HasOne(d => d.PageTemplateLayoutNavigation).WithMany(p => p.CmsPageTemplates).HasConstraintName("FK_CMS_PageTemplate_PageTemplateLayoutID_CMS_Layout"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_CMS_PageTemplateCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryChildCount).HasDefaultValueSql("((0))"); + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryTemplateChildCount).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_PageTemplateCategory_CategoryParentID_CMS_PageTemplateCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PageTemplateConfigurationLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.PageTemplateConfigurationName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PageTemplateConfigurationTemplate).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PageTemplateConfigurationSite).WithMany(p => p.CmsPageTemplateConfigurations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PageUrlPathCulture).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PageUrlPathLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.PageUrlPathUrlPath).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PageUrlPathUrlPathHash).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PageUrlPathNode).WithMany(p => p.CmsPageUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageUrlPath_PageUrlPathNodeID_CMS_Tree"); + + entity.HasOne(d => d.PageUrlPathSite).WithMany(p => p.CmsPageUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_PageUrlPath_PageUrlPathSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PermissionDisplayInMatrix).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.Class).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ClassID_CMS_Class"); + + entity.HasOne(d => d.Resource).WithMany(p => p.CmsPermissions).HasConstraintName("FK_CMS_Permission_ResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PersonalizationLastModified).HasDefaultValueSql("('9/2/2008 5:36:59 PM')"); + + entity.HasOne(d => d.PersonalizationSite).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationSiteID_CMS_Site"); + + entity.HasOne(d => d.PersonalizationUser).WithMany(p => p.CmsPersonalizations).HasConstraintName("FK_CMS_Personalization_PersonalizationUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.QueryIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.QueryName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.Class).WithMany(p => p.CmsQueries).HasConstraintName("FK_CMS_Query_ClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.LeftNode).WithMany(p => p.CmsRelationshipLeftNodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_LeftNodeID_CMS_Tree"); + + entity.HasOne(d => d.RelationshipName).WithMany(p => p.CmsRelationships) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_RelationshipNameID_CMS_RelationshipName"); + + entity.HasOne(d => d.RightNode).WithMany(p => p.CmsRelationshipRightNodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Relationship_RightNodeID_CMS_Tree"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.RelationshipDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.RelationshipName).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Sites).WithMany(p => p.RelationshipNames) + .UsingEntity>( + "CmsRelationshipNameSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RelationshipNameSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("RelationshipNameId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RelationshipNameSite_RelationshipNameID_CMS_RelationshipName"), + j => + { + j.HasKey("RelationshipNameId", "SiteId"); + j.ToTable("CMS_RelationshipNameSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_RelationshipNameSite_SiteID"); + j.IndexerProperty("RelationshipNameId").HasColumnName("RelationshipNameID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ResourceId).IsClustered(false); + + entity.HasIndex(e => e.ResourceDisplayName, "IX_CMS_Resource_ResourceDisplayName").IsClustered(); + + entity.Property(e => e.ResourceHasFiles).HasDefaultValueSql("((0))"); + entity.Property(e => e.ResourceInstallationState).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ResourceInstalledVersion).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ShowInDevelopment).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Resources) + .UsingEntity>( + "CmsResourceSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ResourceId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceSite_ResourceID_CMS_Resource"), + j => + { + j.HasKey("ResourceId", "SiteId"); + j.ToTable("CMS_ResourceSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_ResourceSite_SiteID"); + j.IndexerProperty("ResourceId").HasColumnName("ResourceID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ResourceLibraryPath).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ResourceLibraryResource).WithMany(p => p.CmsResourceLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceLibrary_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TranslationCulture).WithMany(p => p.CmsResourceTranslations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceTranslation_TranslationCultureID_CMS_Culture"); + + entity.HasOne(d => d.TranslationString).WithMany(p => p.CmsResourceTranslations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceTranslation_TranslationStringID_CMS_ResourceString"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.RoleId).IsClustered(false); + + entity.HasIndex(e => new { e.SiteId, e.RoleName, e.RoleDisplayName }, "IX_CMS_Role_SiteID_RoleName_RoleDisplayName") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsRoles).HasConstraintName("FK_CMS_Role_SiteID_CMS_SiteID"); + + entity.HasMany(d => d.Elements).WithMany(p => p.Roles) + .UsingEntity>( + "CmsRoleApplication", + r => r.HasOne().WithMany() + .HasForeignKey("ElementId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleApplication_CMS_UIElement"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleApplication_CMS_Role"), + j => + { + j.HasKey("RoleId", "ElementId"); + j.ToTable("CMS_RoleApplication"); + j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleApplication"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("ElementId").HasColumnName("ElementID"); + }); + + entity.HasMany(d => d.ElementsNavigation).WithMany(p => p.RolesNavigation) + .UsingEntity>( + "CmsRoleUielement", + r => r.HasOne().WithMany() + .HasForeignKey("ElementId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleUIElement_ElementID_CMS_UIElement"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RoleUIElement_RoleID_CMS_Role"), + j => + { + j.HasKey("RoleId", "ElementId"); + j.ToTable("CMS_RoleUIElement"); + j.HasIndex(new[] { "ElementId" }, "IX_CMS_RoleUIElement_ElementID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("ElementId").HasColumnName("ElementID"); + }); + + entity.HasMany(d => d.Permissions).WithMany(p => p.Roles) + .UsingEntity>( + "CmsRolePermission", + r => r.HasOne().WithMany() + .HasForeignKey("PermissionId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RolePermission_PermissionID_CMS_Permission"), + l => l.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_RolePermission_RoleID_CMS_Role"), + j => + { + j.HasKey("RoleId", "PermissionId"); + j.ToTable("CMS_RolePermission"); + j.HasIndex(new[] { "PermissionId" }, "IX_CMS_RolePermission_PermissionID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + j.IndexerProperty("PermissionId").HasColumnName("PermissionID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskAllowExternalService).HasDefaultValueSql("((0))"); + entity.Property(e => e.TaskExecutingServerName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.TaskResource).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskResourceID_CMS_Resource"); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskSiteID_CMS_Site"); + + entity.HasOne(d => d.TaskUser).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.IndexId).IsClustered(false); + + entity.HasIndex(e => e.IndexDisplayName, "IX_CMS_SearchIndex_IndexDisplayName").IsClustered(); + + entity.Property(e => e.IndexProvider).HasDefaultValueSql("(N'')"); + entity.Property(e => e.IndexType).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.IndexCultures).WithMany(p => p.Indices) + .UsingEntity>( + "CmsSearchIndexCulture", + r => r.HasOne().WithMany() + .HasForeignKey("IndexCultureId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexCulture_IndexCultureID_CMS_Culture"), + l => l.HasOne().WithMany() + .HasForeignKey("IndexId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexCulture_IndexID_CMS_SearchIndex"), + j => + { + j.HasKey("IndexId", "IndexCultureId"); + j.ToTable("CMS_SearchIndexCulture"); + j.HasIndex(new[] { "IndexCultureId" }, "IX_CMS_SearchIndexCulture_IndexCultureID"); + j.IndexerProperty("IndexId").HasColumnName("IndexID"); + j.IndexerProperty("IndexCultureId").HasColumnName("IndexCultureID"); + }); + + entity.HasMany(d => d.IndexSites).WithMany(p => p.Indices) + .UsingEntity>( + "CmsSearchIndexSite", + r => r.HasOne().WithMany() + .HasForeignKey("IndexSiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexSite_IndexSiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("IndexId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SearchIndexSite_IndexID_CMS_SearchIndex"), + j => + { + j.HasKey("IndexId", "IndexSiteId"); + j.ToTable("CMS_SearchIndexSite"); + j.HasIndex(new[] { "IndexSiteId" }, "IX_CMS_SearchIndexSite_IndexSiteID"); + j.IndexerProperty("IndexId").HasColumnName("IndexID"); + j.IndexerProperty("IndexSiteId").HasColumnName("IndexSiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SearchTaskId).IsClustered(false); + + entity.HasIndex(e => new { e.SearchTaskPriority, e.SearchTaskStatus, e.SearchTaskServerName }, "IX_CMS_SearchTask_SearchTaskPriority_SearchTaskStatus_SearchTaskServerName") + .IsDescending(true, false, false) + .IsClustered(); + + entity.Property(e => e.SearchTaskCreated).HasDefaultValueSql("('4/15/2009 11:23:52 AM')"); + entity.Property(e => e.SearchTaskStatus).HasDefaultValueSql("('')"); + entity.Property(e => e.SearchTaskType).HasDefaultValueSql("('')"); + entity.Property(e => e.SearchTaskValue).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SearchTaskAzureAdditionalData).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SearchTaskAzureCreated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.SearchTaskAzureType).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryOrder, "IX_CMS_SettingsCategory_CategoryOrder").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.CategoryIsGroup).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_SettingsCategory_CMS_SettingsCategory1"); + + entity.HasOne(d => d.CategoryResource).WithMany(p => p.CmsSettingsCategories).HasConstraintName("FK_CMS_SettingsCategory_CategoryResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.KeyDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.KeyExplanationText).HasDefaultValueSql("(N'')"); + entity.Property(e => e.KeyIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyIsGlobal).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyIsHidden).HasDefaultValueSql("((0))"); + entity.Property(e => e.KeyName).HasDefaultValueSql("('')"); + entity.Property(e => e.KeyType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.KeyCategory).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_KeyCategoryID_CMS_SettingsCategory"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_SiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SiteId).IsClustered(false); + + entity.HasIndex(e => e.SiteDisplayName, "IX_CMS_Site_SiteDisplayName").IsClustered(); + + entity.Property(e => e.SiteDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.SiteDomainName).HasDefaultValueSql("('')"); + entity.Property(e => e.SiteName).HasDefaultValueSql("('')"); + entity.Property(e => e.SitePresentationUrl).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SiteStatus).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Cultures).WithMany(p => p.Sites) + .UsingEntity>( + "CmsSiteCulture", + r => r.HasOne().WithMany() + .HasForeignKey("CultureId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteCulture_CultureID_CMS_Culture"), + l => l.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteCulture_SiteID_CMS_Site"), + j => + { + j.HasKey("SiteId", "CultureId"); + j.ToTable("CMS_SiteCulture"); + j.HasIndex(new[] { "CultureId" }, "IX_CMS_SiteCulture_CultureID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + j.IndexerProperty("CultureId").HasColumnName("CultureID"); + }); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.Site).WithMany(p => p.CmsSiteDomainAliases) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SiteDomainAlias_SiteID_CMS_Site")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ServerDeliveryMethod).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Servers) + .UsingEntity>( + "CmsSmtpserverSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SMTPServerSite_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ServerId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_SMTPServerSite_CMS_SMTPServer"), + j => + { + j.HasKey("ServerId", "SiteId"); + j.ToTable("CMS_SMTPServerSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_SMTPServerSite_SiteID"); + j.IndexerProperty("ServerId").HasColumnName("ServerID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StateId).IsClustered(false); + + entity.HasIndex(e => e.StateDisplayName, "IX_CMS_State_CountryID_StateDisplayName").IsClustered(); + + entity.Property(e => e.StateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.StateName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.Country).WithMany(p => p.CmsStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_State_CountryID_CMS_Country"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TagId).IsClustered(false); + + entity.HasIndex(e => e.TagName, "IX_CMS_Tag_TagName").IsClustered(); + + entity.HasOne(d => d.TagGroup).WithMany(p => p.CmsTags) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tag_TagGroupID_CMS_TagGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TagGroupId).IsClustered(false); + + entity.HasIndex(e => e.TagGroupDisplayName, "IX_CMS_TagGroup_TagGroupDisplayName").IsClustered(); + + entity.Property(e => e.TagGroupDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TagGroupName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TagGroupSite).WithMany(p => p.CmsTagGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TagGroup_TagGroupSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TimeZoneId).IsClustered(false); + + entity.HasIndex(e => e.TimeZoneDisplayName, "IX_CMS_TimeZone_TimeZoneDisplayName").IsClustered(); + + entity.Property(e => e.TimeZoneDaylight).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TransformationId).IsClustered(false); + + entity.HasIndex(e => new { e.TransformationClassId, e.TransformationName }, "IX_CMS_Transformation_TransformationClassID_TransformationName").IsClustered(); + + entity.Property(e => e.TransformationCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TransformationName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TransformationType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.TransformationClass).WithMany(p => p.CmsTransformations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Transformation_TransformationClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TranslationServiceSupportsCancel).HasDefaultValueSql("((0))"); + entity.Property(e => e.TranslationServiceSupportsStatusUpdate).HasDefaultValueSql("((0))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubmissionSourceCulture).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SubmissionTargetCulture).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SubmissionService).WithMany(p => p.CmsTranslationSubmissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TranslationSubmission_CMS_TranslationService"); + + entity.HasOne(d => d.SubmissionSubmittedByUser).WithMany(p => p.CmsTranslationSubmissions).HasConstraintName("FK_CMS_TranslationSubmission_CMS_User"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SubmissionItemSubmission).WithMany(p => p.CmsTranslationSubmissionItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_TranslationSubmissionItem_CMS_TranslationSubmission")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.NodeHasChildren).HasDefaultValueSql("((0))"); + entity.Property(e => e.NodeHasLinks).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.NodeAcl).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeACLID_CMS_ACL"); + + entity.HasOne(d => d.NodeClass).WithMany(p => p.CmsTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tree_NodeClassID_CMS_Class"); + + entity.HasOne(d => d.NodeLinkedNode).WithMany(p => p.InverseNodeLinkedNode).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeID_CMS_Tree"); + + entity.HasOne(d => d.NodeLinkedNodeSite).WithMany(p => p.CmsTreeNodeLinkedNodeSites).HasConstraintName("FK_CMS_Tree_NodeLinkedNodeSiteID_CMS_Site"); + + entity.HasOne(d => d.NodeOriginalNode).WithMany(p => p.InverseNodeOriginalNode).HasConstraintName("FK_CMS_Tree_NodeOriginalNodeID_CMS_Tree"); + + entity.HasOne(d => d.NodeOwnerNavigation).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeOwner_CMS_User"); + + entity.HasOne(d => d.NodeParent).WithMany(p => p.InverseNodeParent).HasConstraintName("FK_CMS_Tree_NodeParentID_CMS_Tree"); + + entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsTreeNodeSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tree_NodeSiteID_CMS_Site"); + + entity.HasOne(d => d.NodeSku).WithMany(p => p.CmsTrees).HasConstraintName("FK_CMS_Tree_NodeSKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ElementId).IsClustered(false); + + entity.HasIndex(e => new + { + e.ElementResourceId, + e.ElementLevel, + e.ElementParentId, + e.ElementOrder, + e.ElementCaption + }, "IX_CMS_UIElement_ElementResourceID_ElementLevel_ElementParentID_ElementOrder_ElementCaption").IsClustered(); + + entity.Property(e => e.ElementCheckModuleReadPermission).HasDefaultValueSql("((1))"); + entity.Property(e => e.ElementIsCustom).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementIsGlobalApplication).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementIsMenu).HasDefaultValueSql("((0))"); + entity.Property(e => e.ElementName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ElementSize).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ElementPageTemplate).WithMany(p => p.CmsUielements).HasConstraintName("FK_CMS_UIElement_ElementPageTemplateID_CMS_PageTemplate"); + + entity.HasOne(d => d.ElementParent).WithMany(p => p.InverseElementParent).HasConstraintName("FK_CMS_UIElement_ElementParentID_CMS_UIElement"); + + entity.HasOne(d => d.ElementResource).WithMany(p => p.CmsUielements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UIElement_ElementResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserIsDomain).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserIsExternal).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserIsHidden).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserName).HasDefaultValueSql("('')"); + entity.Property(e => e.UserPassword).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Culture).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_CultureID_CMS_Culture"); + + entity.HasOne(d => d.Site).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_SiteID_CMS_Site"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserCultures) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserCulture_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserMacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.UserMacroIdentityMacroIdentity).WithMany(p => p.CmsUserMacroIdentities).HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID_CMS_MacroIdentity"); + + entity.HasOne(d => d.UserMacroIdentityUser).WithOne(p => p.CmsUserMacroIdentity) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Role).WithMany(p => p.CmsUserRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserRole_RoleID_CMS_Role"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserRole_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UserAccountLockReason).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserInvalidLogOnAttempts).HasDefaultValueSql("((0))"); + entity.Property(e => e.UserWaitingForApproval).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.UserActivatedByUser).WithMany(p => p.CmsUserSettingUserActivatedByUsers).HasConstraintName("FK_CMS_UserSettings_UserActivatedByUserID_CMS_User"); + + entity.HasOne(d => d.UserAvatar).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserAvatarID_CMS_Avatar"); + + entity.HasOne(d => d.UserSettingsUser).WithMany(p => p.CmsUserSettingUserSettingsUsers) + .HasPrincipalKey(p => p.UserGuid) + .HasForeignKey(d => d.UserSettingsUserGuid) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserGUID_CMS_User"); + + entity.HasOne(d => d.UserSettingsUserNavigation).WithOne(p => p.CmsUserSettingUserSettingsUserNavigation) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSettings_UserSettingsUserID_CMS_User"); + + entity.HasOne(d => d.UserTimeZone).WithMany(p => p.CmsUserSettings).HasConstraintName("FK_CMS_UserSettings_UserTimeZoneID_CMS_TimeZone"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Site).WithMany(p => p.CmsUserSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSite_SiteID_CMS_Site"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserSites) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserSite_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.VersionHistoryId).IsClustered(false); + + entity.HasIndex(e => e.DocumentId, "IX_CMS_VersionHistory_DocumentID").IsClustered(); + + entity.HasOne(d => d.ModifiedByUser).WithMany(p => p.CmsVersionHistoryModifiedByUsers).HasConstraintName("FK_CMS_VersionHistory_ModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.NodeSite).WithMany(p => p.CmsVersionHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionHistory_NodeSiteID_CMS_Site"); + + entity.HasOne(d => d.VersionClass).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionClassID_CMS_Class"); + + entity.HasOne(d => d.VersionDeletedByUser).WithMany(p => p.CmsVersionHistoryVersionDeletedByUsers).HasConstraintName("FK_CMS_VersionHistory_DeletedByUserID_CMS_User"); + + entity.HasOne(d => d.VersionWorkflow).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowID_CMS_Workflow"); + + entity.HasOne(d => d.VersionWorkflowStep).WithMany(p => p.CmsVersionHistories).HasConstraintName("FK_CMS_VersionHistory_VersionWorkflowStepID_CMS_WorkflowStep"); + + entity.HasMany(d => d.AttachmentHistories).WithMany(p => p.VersionHistories) + .UsingEntity>( + "CmsVersionAttachment", + r => r.HasOne().WithMany() + .HasForeignKey("AttachmentHistoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionAttachment_AttachmentHistoryID_CMS_AttachmentHistory"), + l => l.HasOne().WithMany() + .HasForeignKey("VersionHistoryId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_VersionAttachment_VersionHistoryID_CMS_VersionHistory"), + j => + { + j.HasKey("VersionHistoryId", "AttachmentHistoryId"); + j.ToTable("CMS_VersionAttachment"); + j.HasIndex(new[] { "AttachmentHistoryId" }, "IX_CMS_VersionAttachment_AttachmentHistoryID"); + j.IndexerProperty("VersionHistoryId").HasColumnName("VersionHistoryID"); + j.IndexerProperty("AttachmentHistoryId").HasColumnName("AttachmentHistoryID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ServerId).IsClustered(false); + + entity.HasIndex(e => e.ServerDisplayName, "IX_CMS_WebFarmServer_ServerDisplayName").IsClustered(); + + entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ServerLastModified).HasDefaultValueSql("('9/17/2013 12:18:06 PM')"); + entity.Property(e => e.ServerName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.LogCode).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Server).WithMany(p => p.CmsWebFarmServerTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer"); + + entity.HasOne(d => d.Task).WithMany(p => p.CmsWebFarmServerTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebFarmServerTask_TaskID_CMS_WebFarmTask"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskGuid).HasDefaultValueSql("('00000000-0000-0000-0000-000000000000')"); + entity.Property(e => e.TaskIsMemory).HasDefaultValueSql("((0))"); + entity.Property(e => e.TaskType).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.WebPartDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartFileName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.WebPartName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartProperties).HasDefaultValueSql("(N'')"); + entity.Property(e => e.WebPartSkipInsertProperties).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.WebPartCategory).WithMany(p => p.CmsWebParts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPart_WebPartCategoryID_CMS_WebPartCategory"); + + entity.HasOne(d => d.WebPartParent).WithMany(p => p.InverseWebPartParent).HasConstraintName("FK_CMS_WebPart_WebPartParentID_CMS_WebPart"); + + entity.HasOne(d => d.WebPartResource).WithMany(p => p.CmsWebParts).HasConstraintName("FK_CMS_WebPart_WebPartResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_CMS_WebPartCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_WebPartCategory_CategoryParentID_CMS_WebPartCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ContainerId).IsClustered(false); + + entity.HasIndex(e => e.ContainerDisplayName, "IX_CMS_WebPartContainer_ContainerDisplayName").IsClustered(); + + entity.Property(e => e.ContainerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContainerName).HasDefaultValueSql("('')"); + + entity.HasMany(d => d.Sites).WithMany(p => p.Containers) + .UsingEntity>( + "CmsWebPartContainerSite", + r => r.HasOne().WithMany() + .HasForeignKey("SiteId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartContainerSite_SiteID_CMS_Site"), + l => l.HasOne().WithMany() + .HasForeignKey("ContainerId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartContainerSite_ContainerID_CMS_WebPartContainer"), + j => + { + j.HasKey("ContainerId", "SiteId"); + j.ToTable("CMS_WebPartContainerSite"); + j.HasIndex(new[] { "SiteId" }, "IX_CMS_WebPartContainerSite_SiteID"); + j.IndexerProperty("ContainerId").HasColumnName("ContainerID"); + j.IndexerProperty("SiteId").HasColumnName("SiteID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WebPartLayoutId).IsClustered(false); + + entity.HasIndex(e => new { e.WebPartLayoutWebPartId, e.WebPartLayoutCodeName }, "IX_CMS_WebPartLayout_WebPartLayoutWebPartID_WebPartLayoutCodeName").IsClustered(); + + entity.Property(e => e.WebPartLayoutCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.WebPartLayoutDisplayName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.WebPartLayoutWebPart).WithMany(p => p.CmsWebPartLayouts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPartLayout_WebPartLayoutWebPartID_CMS_WebPart"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WidgetId).IsClustered(false); + + entity.HasIndex(e => new { e.WidgetCategoryId, e.WidgetDisplayName }, "IX_CMS_Widget_WidgetCategoryID_WidgetDisplayName").IsClustered(); + + entity.Property(e => e.WidgetSecurity).HasDefaultValueSql("((2))"); + + entity.HasOne(d => d.WidgetCategory).WithMany(p => p.CmsWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Widget_WidgetCategoryID_CMS_WidgetCategory"); + + entity.HasOne(d => d.WidgetLayout).WithMany(p => p.CmsWidgets).HasConstraintName("FK_CMS_Widget_WidgetLayoutID_CMS_WebPartLayout"); + + entity.HasOne(d => d.WidgetWebPart).WithMany(p => p.CmsWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Widget_WidgetWebPartID_CMS_WebPart"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WidgetCategoryId).IsClustered(false); + + entity.HasIndex(e => e.WidgetCategoryPath, "IX_CMS_WidgetCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.WidgetCategoryParent).WithMany(p => p.InverseWidgetCategoryParent).HasConstraintName("FK_CMS_WidgetCategory_WidgetCategoryParentID_CMS_WidgetCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Permission).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_RoleID_CMS_Role"); + + entity.HasOne(d => d.Widget).WithMany(p => p.CmsWidgetRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WidgetRole_WidgetID_CMS_Widget"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowId).IsClustered(false); + + entity.HasIndex(e => e.WorkflowDisplayName, "IX_CMS_Workflow_WorkflowDisplayName").IsClustered(); + + entity.Property(e => e.WorkflowAutoPublishChanges).HasDefaultValueSql("((0))"); + entity.Property(e => e.WorkflowDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.WorkflowEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowName).HasDefaultValueSql("('')"); + entity.Property(e => e.WorkflowSendApproveEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendArchiveEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendPublishEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendReadyForApprovalEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowSendRejectEmails).HasDefaultValueSql("((1))"); + entity.Property(e => e.WorkflowUseCheckinCheckout).HasDefaultValueSql("((0))"); + + entity.HasMany(d => d.Users).WithMany(p => p.Workflows) + .UsingEntity>( + "CmsWorkflowUser", + r => r.HasOne().WithMany() + .HasForeignKey("UserId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowUser_UserID_CMS_User"), + l => l.HasOne().WithMany() + .HasForeignKey("WorkflowId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowUser_WorkflowID_CMS_Workflow"), + j => + { + j.HasKey("WorkflowId", "UserId").HasName("PK_CMS_WorkflowUser_1"); + j.ToTable("CMS_WorkflowUser"); + j.HasIndex(new[] { "UserId" }, "IX_CMS_WorkflowUser_UserID"); + j.IndexerProperty("WorkflowId").HasColumnName("WorkflowID"); + j.IndexerProperty("UserId").HasColumnName("UserID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ActionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ActionWorkflowType).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ActionResource).WithMany(p => p.CmsWorkflowActions).HasConstraintName("FK_CMS_WorkflowAction_ActionResourceID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ApprovedByUser).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_ApprovedByUserID_CMS_User"); + + entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsWorkflowHistories).HasConstraintName("FK_CMS_WorkflowHistory_HistoryWorkflowID_CMS_Workflow"); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowHistorySteps).HasConstraintName("FK_CMS_WorkflowHistory_StepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TargetStep).WithMany(p => p.CmsWorkflowHistoryTargetSteps).HasConstraintName("FK_CMS_WorkflowHistory_TargetStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.VersionHistory).WithMany(p => p.CmsWorkflowHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowHistory_VersionHistoryID_CMS_VersionHistory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ScopeId).IsClustered(false); + + entity.HasIndex(e => e.ScopeStartingPath, "IX_CMS_WorkflowScope_ScopeStartingPath").IsClustered(); + + entity.HasOne(d => d.ScopeClass).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeClassID_CMS_Class"); + + entity.HasOne(d => d.ScopeCulture).WithMany(p => p.CmsWorkflowScopes).HasConstraintName("FK_CMS_WorkflowScope_ScopeCultureID_CMS_Culture"); + + entity.HasOne(d => d.ScopeSite).WithMany(p => p.CmsWorkflowScopes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowScope_ScopeSiteID_CMS_Site"); + + entity.HasOne(d => d.ScopeWorkflow).WithMany(p => p.CmsWorkflowScopes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowScope_ScopeWorkflowID_CMS_WorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.StepAllowPublish).HasDefaultValueSql("((0))"); + entity.Property(e => e.StepAllowReject).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.StepAction).WithMany(p => p.CmsWorkflowSteps).HasConstraintName("FK_CMS_WorkflowStep_StepActionID"); + + entity.HasOne(d => d.StepWorkflow).WithMany(p => p.CmsWorkflowSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStep_StepWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowStepRoleId).IsClustered(false); + + entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.RoleId }, "IX_CMS_WorkflowStepRoles_StepID_StepSourcePointGUID_RoleID") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsWorkflowStepRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepRoles_RoleID_CMS_Role"); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepRoles_StepID_CMS_WorkflowStep"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowStepUserId).IsClustered(false); + + entity.HasIndex(e => new { e.StepId, e.StepSourcePointGuid, e.UserId }, "IX_CMS_WorkflowStepUser_StepID_StepSourcePointGUID_UserID") + .IsUnique() + .IsClustered(); + + entity.HasOne(d => d.Step).WithMany(p => p.CmsWorkflowStepUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepUser_StepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsWorkflowStepUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStepUser_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TransitionEndStep).WithMany(p => p.CmsWorkflowTransitionTransitionEndSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionEndStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TransitionStartStep).WithMany(p => p.CmsWorkflowTransitionTransitionStartSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionStartStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TransitionWorkflow).WithMany(p => p.CmsWorkflowTransitions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionWorkflowID_CMS_Workflow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.AddressId).HasName("PK_COM_CustomerAdress"); + + entity.Property(e => e.AddressCity).HasDefaultValueSql("('')"); + entity.Property(e => e.AddressLastModified).HasDefaultValueSql("('10/18/2012 3:39:07 PM')"); + entity.Property(e => e.AddressLine1).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AddressName).HasDefaultValueSql("('')"); + entity.Property(e => e.AddressPersonalName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AddressZip).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Address_AddressCountryID_CMS_Country"); + + entity.HasOne(d => d.AddressCustomer).WithMany(p => p.ComAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Address_AddressCustomerID_COM_Customer"); + + entity.HasOne(d => d.AddressState).WithMany(p => p.ComAddresses).HasConstraintName("FK_COM_Address_AddressStateID_CMS_State"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BrandDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.BrandEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.BrandLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.BrandName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.BrandSite).WithMany(p => p.ComBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Brand_BrandSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CarrierAssemblyName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierClassName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CarrierLastModified).HasDefaultValueSql("('9/22/2014 3:00:14 PM')"); + entity.Property(e => e.CarrierName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CarrierSite).WithMany(p => p.ComCarriers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Carrier_CarrierSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CollectionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CollectionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.CollectionLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.CollectionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CollectionSite).WithMany(p => p.ComCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Collection_CollectionSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CouponCodeCode).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CouponCodeDiscount).WithMany(p => p.ComCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CouponCode_CouponCodeDiscountID_COM_Discount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CurrencyCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyFormatString).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CurrencyName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CurrencySite).WithMany(p => p.ComCurrencies).HasConstraintName("FK_COM_Currency_CurrencySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ExchangeRateToCurrency).WithMany(p => p.ComCurrencyExchangeRates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID_COM_Currency"); + + entity.HasOne(d => d.ExchangeTable).WithMany(p => p.ComCurrencyExchangeRates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CurrencyExchangeRate_ExchangeTableID_COM_ExchangeTable"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.CustomerCompany, "IX_COM_Customer_CustomerCompany") + .HasFilter("([CustomerCompany] IS NOT NULL)") + .HasFillFactor(90); + + entity.HasOne(d => d.CustomerSite).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerSiteID_CMS_Site"); + + entity.HasOne(d => d.CustomerUser).WithMany(p => p.ComCustomers).HasConstraintName("FK_COM_Customer_CustomerUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EventCreditLastModified).HasDefaultValueSql("('9/26/2012 12:21:38 PM')"); + entity.Property(e => e.EventDate).HasDefaultValueSql("('9/27/2012 2:48:56 PM')"); + entity.Property(e => e.EventName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.EventCustomer).WithMany(p => p.ComCustomerCreditHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_CustomerCreditHistory_EventCustomerID_COM_Customer"); + + entity.HasOne(d => d.EventSite).WithMany(p => p.ComCustomerCreditHistories).HasConstraintName("FK_COM_CustomerCreditHistory_EventSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DepartmentDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.DepartmentName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.DepartmentDefaultTaxClass).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentDefaultTaxClassID_COM_TaxClass"); + + entity.HasOne(d => d.DepartmentSite).WithMany(p => p.ComDepartments).HasConstraintName("FK_COM_Department_DepartmentSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); + entity.Property(e => e.DiscountApplyTo).HasDefaultValueSql("('Order')"); + entity.Property(e => e.DiscountDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.DiscountEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.DiscountOrder).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.DiscountSite).WithMany(p => p.ComDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Discount_DiscountSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ExchangeTableId).IsClustered(false); + + entity.HasIndex(e => new { e.ExchangeTableValidFrom, e.ExchangeTableValidTo }, "IX_COM_ExchangeTable_ExchangeTableValidFrom_ExchangeTableValidTo") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.ExchangeTableDisplayName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ExchangeTableSite).WithMany(p => p.ComExchangeTables).HasConstraintName("FK_COM_ExchangeTable_ExchangeTableSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.GiftCardCustomerRestriction).HasDefaultValueSql("(N'enum1')"); + entity.Property(e => e.GiftCardDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GiftCardEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.GiftCardLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.GiftCardName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.GiftCardSite).WithMany(p => p.ComGiftCards) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_GiftCard_GiftCardSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.GiftCardCouponCodeCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.GiftCardCouponCodeLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.GiftCardCouponCodeGiftCard).WithMany(p => p.ComGiftCardCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_GiftCardCouponCode_GiftCardCouponCodeGiftCardID_COM_GiftCard"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.InternalStatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.InternalStatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.InternalStatusLastModified).HasDefaultValueSql("('9/20/2012 2:45:44 PM')"); + entity.Property(e => e.InternalStatusName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.InternalStatusSite).WithMany(p => p.ComInternalStatuses).HasConstraintName("FK_COM_InternalStatus_InternalStatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ManufacturerId).IsClustered(false); + + entity.HasIndex(e => new { e.ManufacturerDisplayName, e.ManufacturerEnabled }, "IX_COM_Manufacturer_ManufacturerDisplayName_ManufacturerEnabled").IsClustered(); + + entity.Property(e => e.ManufacturerDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ManufacturerEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ManufacturerLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.ManufacturerSite).WithMany(p => p.ComManufacturers).HasConstraintName("FK_COM_Manufacturer_ManufacturerSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MultiBuyCouponCodeCode).HasDefaultValueSql("(N'')"); + entity.Property(e => e.MultiBuyCouponCodeUseCount).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.MultiBuyCouponCodeMultiBuyDiscount).WithMany(p => p.ComMultiBuyCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MultiBuyDiscountApplyFurtherDiscounts).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountAutoAddEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountCustomerRestriction).HasDefaultValueSql("(N'All')"); + entity.Property(e => e.MultiBuyDiscountEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountIsFlat).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountMinimumBuyCount).HasDefaultValueSql("((1))"); + entity.Property(e => e.MultiBuyDiscountUsesCoupons).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.MultiBuyDiscountApplyToSku).WithMany(p => p.ComMultiBuyDiscounts).HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID_COM_SKU"); + + entity.HasOne(d => d.MultiBuyDiscountSite).WithMany(p => p.ComMultiBuyDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscount_MultiBuyDiscountSiteID_CMS_Site"); + + entity.HasMany(d => d.Departments).WithMany(p => p.MultiBuyDiscounts) + .UsingEntity>( + "ComMultiBuyDiscountDepartment", + r => r.HasOne().WithMany() + .HasForeignKey("DepartmentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_DepartmentID_COM_Department"), + l => l.HasOne().WithMany() + .HasForeignKey("MultiBuyDiscountId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountDepartment_MultiBuyDiscountID_COM_MultiBuyDiscount"), + j => + { + j.HasKey("MultiBuyDiscountId", "DepartmentId"); + j.ToTable("COM_MultiBuyDiscountDepartment"); + j.HasIndex(new[] { "DepartmentId" }, "IX_COM_MultiBuyDiscountDepartment_DepartmentID"); + j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); + j.IndexerProperty("DepartmentId").HasColumnName("DepartmentID"); + }); + + entity.HasMany(d => d.Skus).WithMany(p => p.MultiBuyDiscounts) + .UsingEntity>( + "ComMultiBuyDiscountSku", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountSKU_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("MultiBuyDiscountId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountSKU_MultiBuyDiscountID_COM_MultiBuyDiscount"), + j => + { + j.HasKey("MultiBuyDiscountId", "Skuid"); + j.ToTable("COM_MultiBuyDiscountSKU"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_MultiBuyDiscountSKU_SKUID"); + j.IndexerProperty("MultiBuyDiscountId").HasColumnName("MultiBuyDiscountID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.BrandIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Brand).WithMany(p => p.ComMultiBuyDiscountBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountBrand_BrandID_COM_Brand"); + + entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountBrands) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountBrand_MultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CollectionIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Collection).WithMany(p => p.ComMultiBuyDiscountCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountCollection_CollectionID_COM_Collection"); + + entity.HasOne(d => d.MultibuyDiscount).WithMany(p => p.ComMultiBuyDiscountCollections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountCollection_MultiBuyDiscountID_COM_MultiBuyDiscount"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.NodeIncluded).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.MultiBuyDiscount).WithMany(p => p.ComMultiBuyDiscountTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountTree_MultiBuyDiscountID_COM_MultiBuyDiscount"); + + entity.HasOne(d => d.Node).WithMany(p => p.ComMultiBuyDiscountTrees) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_MultiBuyDiscountTree_NodeID_CMS_Tree"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => new { e.CategoryDisplayName, e.CategoryEnabled }, "IX_COM_OptionCategory_CategoryDisplayName_CategoryEnabled").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CategoryDisplayPrice).HasDefaultValueSql("((1))"); + entity.Property(e => e.CategoryEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.CategoryName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.CategorySelectionType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.CategorySite).WithMany(p => p.ComOptionCategories).HasConstraintName("FK_COM_OptionCategory_CategorySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.OrderCreatedByUser).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.OrderCurrency).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderCurrencyID_COM_Currency"); + + entity.HasOne(d => d.OrderCustomer).WithMany(p => p.ComOrders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Order_OrderCustomerID_COM_Customer"); + + entity.HasOne(d => d.OrderPaymentOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderPaymentOptionID_COM_PaymentOption"); + + entity.HasOne(d => d.OrderShippingOption).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderShippingOptionID_COM_ShippingOption"); + + entity.HasOne(d => d.OrderSite).WithMany(p => p.ComOrders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Order_OrderSiteID_CMS_Site"); + + entity.HasOne(d => d.OrderStatus).WithMany(p => p.ComOrders).HasConstraintName("FK_COM_Order_OrderStatusID_COM_Status"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AddressCountry).WithMany(p => p.ComOrderAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderAddress_AddressCountryID_CMS_Country"); + + entity.HasOne(d => d.AddressOrder).WithMany(p => p.ComOrderAddresses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderAddress_AddressOrderID_COM_Order"); + + entity.HasOne(d => d.AddressState).WithMany(p => p.ComOrderAddresses).HasConstraintName("FK_COM_OrderAddress_AddressStateID_CMS_State"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.OrderItemOrder).WithMany(p => p.ComOrderItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItem_OrderItemOrderID_COM_Order"); + + entity.HasOne(d => d.OrderItemSku).WithMany(p => p.ComOrderItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItem_OrderItemSKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.File).WithMany(p => p.ComOrderItemSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItemSKUFile_COM_SKUFile"); + + entity.HasOne(d => d.OrderItem).WithMany(p => p.ComOrderItemSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderItemSKUFile_COM_OrderItem"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.StatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.StatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.StatusName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.StatusSendNotification).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.StatusSite).WithMany(p => p.ComOrderStatuses).HasConstraintName("FK_COM_OrderStatus_StatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ChangedByUser).WithMany(p => p.ComOrderStatusUsers).HasConstraintName("FK_COM_OrderStatusUser_ChangedByUserID_CMS_User"); + + entity.HasOne(d => d.FromStatus).WithMany(p => p.ComOrderStatusUserFromStatuses).HasConstraintName("FK_COM_OrderStatusUser_FromStatusID_COM_Status"); + + entity.HasOne(d => d.Order).WithMany(p => p.ComOrderStatusUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderStatusUser_OrderID_COM_Order"); + + entity.HasOne(d => d.ToStatus).WithMany(p => p.ComOrderStatusUserToStatuses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_OrderStatusUser_ToStatusID_COM_Status"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PaymentOptionId).IsClustered(false); + + entity.HasIndex(e => new { e.PaymentOptionSiteId, e.PaymentOptionDisplayName, e.PaymentOptionEnabled }, "IX_COM_PaymentOption_PaymentOptionSiteID_PaymentOptionDisplayName_PaymentOptionEnabled").IsClustered(); + + entity.Property(e => e.PaymentOptionAllowIfNoShipping).HasDefaultValueSql("((0))"); + entity.Property(e => e.PaymentOptionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PaymentOptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PaymentOptionLastModified).HasDefaultValueSql("('9/27/2012 4:18:26 PM')"); + entity.Property(e => e.PaymentOptionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PaymentOptionAuthorizedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionAuthorizedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID_COM_OrderStatus"); + + entity.HasOne(d => d.PaymentOptionFailedOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionFailedOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionFailedOrderStatusID_COM_OrderStatus"); + + entity.HasOne(d => d.PaymentOptionSite).WithMany(p => p.ComPaymentOptions).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSiteID_CMS_Site"); + + entity.HasOne(d => d.PaymentOptionSucceededOrderStatus).WithMany(p => p.ComPaymentOptionPaymentOptionSucceededOrderStatuses).HasConstraintName("FK_COM_PaymentOption_PaymentOptionSucceededOrderStatusID_COM_OrderStatus"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.PublicStatusId).IsClustered(false); + + entity.HasIndex(e => new { e.PublicStatusDisplayName, e.PublicStatusEnabled }, "IX_COM_PublicStatus_PublicStatusDisplayName_PublicStatusEnabled").IsClustered(); + + entity.Property(e => e.PublicStatusDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PublicStatusEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PublicStatusName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.PublicStatusSite).WithMany(p => p.ComPublicStatuses).HasConstraintName("FK_COM_PublicStatus_PublicStatusSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ShippingCostId).HasName("PK__COM_ShippingCost"); + + entity.HasOne(d => d.ShippingCostShippingOption).WithMany(p => p.ComShippingCosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShippingCost_ShippingCostShippingOptionID_COM_ShippingOption"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ShippingOptionId).IsClustered(false); + + entity.HasIndex(e => e.ShippingOptionDisplayName, "IX_COM_ShippingOptionDisplayName").IsClustered(); + + entity.Property(e => e.ShippingOptionDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.ShippingOptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ShippingOptionLastModified).HasDefaultValueSql("('9/26/2012 12:44:18 PM')"); + entity.Property(e => e.ShippingOptionName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ShippingOptionCarrier).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionCarrierID_COM_Carrier"); + + entity.HasOne(d => d.ShippingOptionSite).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionSiteID_CMS_Site"); + + entity.HasOne(d => d.ShippingOptionTaxClass).WithMany(p => p.ComShippingOptions).HasConstraintName("FK_COM_ShippingOption_ShippingOptionTaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ShoppingCartBillingAddress).WithMany(p => p.ComShoppingCartShoppingCartBillingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartBillingAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartCompanyAddress).WithMany(p => p.ComShoppingCartShoppingCartCompanyAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCompanyAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartCurrency).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCurrencyID_COM_Currency"); + + entity.HasOne(d => d.ShoppingCartCustomer).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartCustomerID_COM_Customer"); + + entity.HasOne(d => d.ShoppingCartPaymentOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartPaymentOptionID_COM_PaymentOption"); + + entity.HasOne(d => d.ShoppingCartShippingAddress).WithMany(p => p.ComShoppingCartShoppingCartShippingAddresses).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingAddressID_COM_Address"); + + entity.HasOne(d => d.ShoppingCartShippingOption).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartShippingOptionID_COM_ShippingOption"); + + entity.HasOne(d => d.ShoppingCartSite).WithMany(p => p.ComShoppingCarts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCart_ShoppingCartSiteID_CMS_Site"); + + entity.HasOne(d => d.ShoppingCartUser).WithMany(p => p.ComShoppingCarts).HasConstraintName("FK_COM_ShoppingCart_ShoppingCartUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CouponCode).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartCouponCodes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartCouponCode_ShoppingCartID_COM_ShoppingCart"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.CartItemAutoAddedUnits).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ShoppingCart).WithMany(p => p.ComShoppingCartSkus) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartSKU_ShoppingCartID_COM_ShoppingCart"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComShoppingCartSkus) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_ShoppingCartSKU_SKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.Skunumber, "IX_COM_SKU_SKUNumber") + .HasFilter("([SKUNumber] IS NOT NULL)") + .HasFillFactor(90); + + entity.Property(e => e.SkubundleInventoryType).HasDefaultValueSql("('REMOVEBUNDLE')"); + entity.Property(e => e.Skuenabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.Skuname).HasDefaultValueSql("('')"); + entity.Property(e => e.SkusellOnlyAvailable).HasDefaultValueSql("((0))"); + entity.Property(e => e.SkutrackInventory).HasDefaultValueSql("(N'ByProduct')"); + + entity.HasOne(d => d.Skubrand).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUBrandID_COM_Brand"); + + entity.HasOne(d => d.Skucollection).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUCollectionID_COM_Collection"); + + entity.HasOne(d => d.Skudepartment).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUDepartmentID_COM_Department"); + + entity.HasOne(d => d.SkuinternalStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUInternalStatusID_COM_InternalStatus"); + + entity.HasOne(d => d.Skumanufacturer).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUManufacturerID_COM_Manifacturer"); + + entity.HasOne(d => d.SkuoptionCategory).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUOptionCategoryID_COM_OptionCategory"); + + entity.HasOne(d => d.SkuparentSku).WithMany(p => p.InverseSkuparentSku).HasConstraintName("FK_COM_SKU_SKUParentSKUID_COM_SKU"); + + entity.HasOne(d => d.SkupublicStatus).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUPublicStatusID_COM_PublicStatus"); + + entity.HasOne(d => d.Skusite).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSiteID_CMS_Site"); + + entity.HasOne(d => d.Skusupplier).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUSupplierID_COM_Supplier"); + + entity.HasOne(d => d.SkutaxClass).WithMany(p => p.ComSkus).HasConstraintName("FK_COM_SKU_SKUTaxClass_COM_TaxClass"); + + entity.HasMany(d => d.Bundles).WithMany(p => p.Skus) + .UsingEntity>( + "ComBundle", + r => r.HasOne().WithMany() + .HasForeignKey("BundleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), + j => + { + j.HasKey("BundleId", "Skuid"); + j.ToTable("COM_Bundle"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); + j.IndexerProperty("BundleId").HasColumnName("BundleID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.OptionSkus).WithMany(p => p.SkusNavigation) + .UsingEntity>( + "ComSkuallowedOption", + r => r.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), + j => + { + j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); + j.ToTable("COM_SKUAllowedOption"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.OptionSkusNavigation).WithMany(p => p.VariantSkus) + .UsingEntity>( + "ComVariantOption", + r => r.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("VariantSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), + j => + { + j.HasKey("VariantSkuid", "OptionSkuid"); + j.ToTable("COM_VariantOption"); + j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); + j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + }); + + entity.HasMany(d => d.Skus).WithMany(p => p.Bundles) + .UsingEntity>( + "ComBundle", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("BundleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Bundle_BundleID_COM_SKU"), + j => + { + j.HasKey("BundleId", "Skuid"); + j.ToTable("COM_Bundle"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_Bundle_SKUID"); + j.IndexerProperty("BundleId").HasColumnName("BundleID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.SkusNavigation).WithMany(p => p.OptionSkus) + .UsingEntity>( + "ComSkuallowedOption", + r => r.HasOne().WithMany() + .HasForeignKey("Skuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_SKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOption_OptionSKUID_COM_SKU"), + j => + { + j.HasKey("OptionSkuid", "Skuid").HasName("PK_COM_SKUOption"); + j.ToTable("COM_SKUAllowedOption"); + j.HasIndex(new[] { "Skuid" }, "IX_COM_SKUAllowedOption_SKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + j.IndexerProperty("Skuid").HasColumnName("SKUID"); + }); + + entity.HasMany(d => d.VariantSkus).WithMany(p => p.OptionSkusNavigation) + .UsingEntity>( + "ComVariantOption", + r => r.HasOne().WithMany() + .HasForeignKey("VariantSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_VariantSKUID_COM_SKU"), + l => l.HasOne().WithMany() + .HasForeignKey("OptionSkuid") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VariantOption_OptionSKUID_COM_SKU"), + j => + { + j.HasKey("VariantSkuid", "OptionSkuid"); + j.ToTable("COM_VariantOption"); + j.HasIndex(new[] { "OptionSkuid" }, "IX_COM_VariantOption_OptionSKUID"); + j.IndexerProperty("VariantSkuid").HasColumnName("VariantSKUID"); + j.IndexerProperty("OptionSkuid").HasColumnName("OptionSKUID"); + }); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.FileSku).WithMany(p => p.ComSkufiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUFile_COM_SKU")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Category).WithMany(p => p.ComSkuoptionCategories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOptionCategory_CategoryID_COM_OptionCategory"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComSkuoptionCategories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_SKUOptionCategory_SKUID_COM_SKU"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SupplierId).IsClustered(false); + + entity.HasIndex(e => new { e.SupplierDisplayName, e.SupplierEnabled }, "IX_COM_Supplier_SupplierDisplayName_SupplierEnabled").IsClustered(); + + entity.Property(e => e.SupplierDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.SupplierEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.SupplierLastModified).HasDefaultValueSql("('9/21/2012 12:34:09 PM')"); + + entity.HasOne(d => d.SupplierSite).WithMany(p => p.ComSuppliers).HasConstraintName("FK_COM_Supplier_SupplierSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TaxClassId).IsClustered(false); + + entity.HasIndex(e => e.TaxClassDisplayName, "IX_COM_TaxClass_TaxClassDisplayName").IsClustered(); + + entity.Property(e => e.TaxClassDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TaxClassLastModified).HasDefaultValueSql("('9/20/2012 1:31:27 PM')"); + entity.Property(e => e.TaxClassName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.TaxClassZeroIfIdsupplied).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.TaxClassSite).WithMany(p => p.ComTaxClasses).HasConstraintName("FK_COM_TaxClass_TaxClassSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Country).WithMany(p => p.ComTaxClassCountries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxCategoryCountry_CountryID_CMS_Country"); + + entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassCountries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxCategoryCountry_TaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.State).WithMany(p => p.ComTaxClassStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxClassState_StateID_CMS_State"); + + entity.HasOne(d => d.TaxClass).WithMany(p => p.ComTaxClassStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_TaxClassState_TaxClassID_COM_TaxClass"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.VolumeDiscountSku).WithMany(p => p.ComVolumeDiscounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_VolumeDiscount_VolumeDiscountSKUID_COM_SKU")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Site).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_SiteID_CMS_Site"); + + entity.HasOne(d => d.Sku).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_SKUID_COM_SKU"); + + entity.HasOne(d => d.User).WithMany(p => p.ComWishlists) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_COM_Wishlist_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ExportId).IsClustered(false); + + entity.HasIndex(e => e.ExportDateTime, "IX_Export_History_ExportDateTime") + .IsDescending() + .IsClustered(); + + entity.Property(e => e.ExportFileName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ExportSite).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportSiteID_CMS_Site"); + + entity.HasOne(d => d.ExportUser).WithMany(p => p.ExportHistories).HasConstraintName("FK_Export_History_ExportUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.TaskSite).WithMany(p => p.ExportTasks).HasConstraintName("FK_Export_Task_TaskSiteID_CMS_Site")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ConnectorId).IsClustered(false); + + entity.HasIndex(e => e.ConnectorDisplayName, "IX_Integration_Connector_ConnectorDisplayName").IsClustered(); + + entity.Property(e => e.ConnectorEnabled).HasDefaultValueSql("((1))"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SyncLogSynchronization).WithMany(p => p.IntegrationSyncLogs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_SyncLog_SyncLogSynchronizationID_Integration_Synchronization")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SynchronizationConnector).WithMany(p => p.IntegrationSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_Synchronization_SynchronizationConnectorID_Integration_Connector"); + + entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.IntegrationSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Integration_Synchronization_SynchronizationTaskID_Integration_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TaskId).IsClustered(false); + + entity.HasIndex(e => e.TaskNodeAliasPath, "IX_Integration_Task_TaskNodeAliasPath").IsClustered(); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.IntegrationTasks).HasConstraintName("FK_IntegrationTask_TaskSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FileId).IsClustered(false); + + entity.HasIndex(e => e.FilePath, "IX_Media_File_FilePath").IsClustered(); + + entity.Property(e => e.FileCreatedWhen).HasDefaultValueSql("('11/11/2008 4:10:00 PM')"); + entity.Property(e => e.FileModifiedWhen).HasDefaultValueSql("('11/11/2008 4:11:15 PM')"); + entity.Property(e => e.FileTitle).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FileCreatedByUser).WithMany(p => p.MediaFileFileCreatedByUsers).HasConstraintName("FK_Media_File_FileCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.FileLibrary).WithMany(p => p.MediaFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_File_FileLibraryID_Media_Library"); + + entity.HasOne(d => d.FileModifiedByUser).WithMany(p => p.MediaFileFileModifiedByUsers).HasConstraintName("FK_Media_File_FileModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.FileSite).WithMany(p => p.MediaFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_File_FileSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LibraryId).IsClustered(false); + + entity.HasIndex(e => new { e.LibrarySiteId, e.LibraryDisplayName }, "IX_Media_Library_LibraryDisplayName").IsClustered(); + + entity.Property(e => e.LibraryName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.LibrarySite).WithMany(p => p.MediaLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_Library_LibrarySiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Library).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_LibraryID_Media_Library"); + + entity.HasOne(d => d.Permission).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_PermissionID_CMS_Permission"); + + entity.HasOne(d => d.Role).WithMany(p => p.MediaLibraryRolePermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_LibraryRolePermission_RoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TestLastModified).HasDefaultValueSql("('12/5/2011 4:56:38 PM')"); + + entity.HasOne(d => d.TestIssue).WithOne(p => p.NewsletterAbtestTestIssue) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_ABTest_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.TestWinnerIssue).WithMany(p => p.NewsletterAbtestTestWinnerIssues).HasConstraintName("FK_Newsletter_ABTest_TestWinnerIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.TestWinnerScheduledTask).WithMany(p => p.NewsletterAbtests).HasConstraintName("FK_Newsletter_ABTest_TestWinnerScheduledTaskID_CMS_ScheduledTask"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ClickedLinkEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ClickedLinkNewsletterLink).WithMany(p => p.NewsletterClickedLinks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_ClickedLink_Newsletter_Link"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailNewsletterIssue).WithMany(p => p.NewsletterEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Emails_EmailNewsletterIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.EmailSite).WithMany(p => p.NewsletterEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Emails_EmailSiteID_CMS_Site"); + + entity.HasOne(d => d.EmailSubscriber).WithMany(p => p.NewsletterEmails).HasConstraintName("FK_Newsletter_Emails_EmailSubscriberID_Newsletter_Subscriber"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.TemplateId).IsClustered(false); + + entity.HasIndex(e => new { e.TemplateSiteId, e.TemplateDisplayName }, "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateDisplayName").IsClustered(); + + entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.TemplateIconClass).HasDefaultValueSql("(N'icon-accordion')"); + entity.Property(e => e.TemplateName).HasDefaultValueSql("('')"); + entity.Property(e => e.TemplateType).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TemplateSite).WithMany(p => p.NewsletterEmailTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplate_TemplateSiteID_CMS_Site"); + + entity.HasMany(d => d.Newsletters).WithMany(p => p.Templates) + .UsingEntity>( + "NewsletterEmailTemplateNewsletter", + r => r.HasOne().WithMany() + .HasForeignKey("NewsletterId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_Newsletter"), + l => l.HasOne().WithMany() + .HasForeignKey("TemplateId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailTemplateNewsletter_Newsletter_EmailTemplate"), + j => + { + j.HasKey("TemplateId", "NewsletterId"); + j.ToTable("Newsletter_EmailTemplateNewsletter"); + j.HasIndex(new[] { "NewsletterId" }, "IX_Newsletter_EmailTemplateNewsletter_NewsletterID"); + j.IndexerProperty("TemplateId").HasColumnName("TemplateID"); + j.IndexerProperty("NewsletterId").HasColumnName("NewsletterID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailWidgetDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.EmailWidgetIconCssClass).HasDefaultValueSql("(N'icon-cogwheel-square')"); + entity.Property(e => e.EmailWidgetLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + entity.Property(e => e.EmailWidgetName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.EmailWidgetSite).WithMany(p => p.NewsletterEmailWidgets) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidget_EmailWidgetSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailWidget).WithMany(p => p.NewsletterEmailWidgetTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_EmailWidgetID_Newsletter_EmailWidget"); + + entity.HasOne(d => d.Template).WithMany(p => p.NewsletterEmailWidgetTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_EmailWidgetTemplate_TemplateID_Newsletter_EmailTemplate"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.ContactGroup).WithMany(p => p.NewsletterIssueContactGroups) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_IssueContactGroup_ContactGroupID")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.LinkIssue).WithMany(p => p.NewsletterLinks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Link_Newsletter_NewsletterIssue")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.NewsletterId).IsClustered(false); + + entity.HasIndex(e => new { e.NewsletterSiteId, e.NewsletterDisplayName }, "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterDisplayName").IsClustered(); + + entity.Property(e => e.NewsletterDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterEnableOptIn).HasDefaultValueSql("((0))"); + entity.Property(e => e.NewsletterLastModified).HasDefaultValueSql("('3/13/2015 2:53:28 PM')"); + entity.Property(e => e.NewsletterLogActivity).HasDefaultValueSql("((1))"); + entity.Property(e => e.NewsletterName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterSendOptInConfirmation).HasDefaultValueSql("((0))"); + entity.Property(e => e.NewsletterSenderEmail).HasDefaultValueSql("(N'')"); + entity.Property(e => e.NewsletterSenderName).HasDefaultValueSql("('')"); + entity.Property(e => e.NewsletterSource).HasDefaultValueSql("(N'T')"); + entity.Property(e => e.NewsletterTrackClickedLinks).HasDefaultValueSql("((1))"); + entity.Property(e => e.NewsletterTrackOpenEmails).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.NewsletterDynamicScheduledTask).WithMany(p => p.NewsletterNewsletters).HasConstraintName("FK_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID_CMS_ScheduledTask"); + + entity.HasOne(d => d.NewsletterOptInTemplate).WithMany(p => p.NewsletterNewsletterNewsletterOptInTemplates).HasConstraintName("FK_Newsletter_Newsletter_NewsletterOptInTemplateID_EmailTemplate"); + + entity.HasOne(d => d.NewsletterSite).WithMany(p => p.NewsletterNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Newsletter_NewsletterSiteID_CMS_Site"); + + entity.HasOne(d => d.NewsletterUnsubscriptionTemplate).WithMany(p => p.NewsletterNewsletterNewsletterUnsubscriptionTemplates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID_Newsletter_EmailTemplate"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.IssueDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.IssueSubject).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.IssueNewsletter).WithMany(p => p.NewsletterNewsletterIssues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueNewsletterID_Newsletter_Newsletter"); + + entity.HasOne(d => d.IssueSite).WithMany(p => p.NewsletterNewsletterIssues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_NewsletterIssue_IssueSiteID_CMS_Site"); + + entity.HasOne(d => d.IssueTemplate).WithMany(p => p.NewsletterNewsletterIssues).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueTemplateID_Newsletter_EmailTemplate"); + + entity.HasOne(d => d.IssueVariantOfIssue).WithMany(p => p.InverseIssueVariantOfIssue).HasConstraintName("FK_Newsletter_NewsletterIssue_IssueVariantOfIssue_NewsletterIssue"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.OpenedEmailEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.OpenedEmailIssue).WithMany(p => p.NewsletterOpenedEmails) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_OpenedEmail_OpenedEmailIssueID_Newsletter_NewsletterIssue"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SubscriberId).IsClustered(false); + + entity.HasIndex(e => new { e.SubscriberSiteId, e.SubscriberFullName }, "IX_Newsletter_Subscriber_SubscriberSiteID_SubscriberFullName").IsClustered(); + + entity.Property(e => e.SubscriberType).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SubscriberSite).WithMany(p => p.NewsletterSubscribers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_Subscriber_SubscriberSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SubscriptionApproved).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.Newsletter).WithMany(p => p.NewsletterSubscriberNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_SubscriberNewsletter_NewsletterID_Newsletter_Newsletter"); + + entity.HasOne(d => d.Subscriber).WithMany(p => p.NewsletterSubscriberNewsletters) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Newsletter_SubscriberNewsletter_SubscriberID_Newsletter_Subscriber"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.UnsubscriptionEmail).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.UnsubscriptionFromIssue).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionFromIssueID_Newsletter_NewsletterIssue"); + + entity.HasOne(d => d.UnsubscriptionNewsletter).WithMany(p => p.NewsletterUnsubscriptions).HasConstraintName("FK_Newsletter_Unsubscription_UnsubscriptionNewsletterID_Newsletter_Newsletter"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AbtestDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.AbtestIncludedTraffic).HasDefaultValueSql("((100))"); + entity.Property(e => e.AbtestName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.AbtestOriginalPage).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AbtestSite).WithMany(p => p.OmAbtests) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABTest_SiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.AbvariantDisplayName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.AbvariantTest).WithMany(p => p.OmAbvariantData) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ABVariantData_ABVariantTestID_OM_ABTest"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AccountCountry).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_Country"); + + entity.HasOne(d => d.AccountOwnerUser).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_User"); + + entity.HasOne(d => d.AccountPrimaryContact).WithMany(p => p.OmAccountAccountPrimaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_PrimaryContact"); + + entity.HasOne(d => d.AccountSecondaryContact).WithMany(p => p.OmAccountAccountSecondaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_SecondaryContact"); + + entity.HasOne(d => d.AccountState).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_State"); + + entity.HasOne(d => d.AccountStatus).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_OM_AccountStatus"); + + entity.HasOne(d => d.AccountSubsidiaryOf).WithMany(p => p.InverseAccountSubsidiaryOf).HasConstraintName("FK_OM_Account_OM_Account_SubsidiaryOf"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Account).WithMany(p => p.OmAccountContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_AccountContact_OM_Account"); + + entity.HasOne(d => d.Contact).WithMany(p => p.OmAccountContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_AccountContact_OM_Contact"); + + entity.HasOne(d => d.ContactRole).WithMany(p => p.OmAccountContacts).HasConstraintName("FK_OM_AccountContact_OM_ContactRole"); + }); + + modelBuilder.Entity(entity => entity.HasIndex(e => e.ActivityCampaign, "IX_OM_Activity_ActivityCampaign") + .HasFilter("([ActivityCampaign] IS NOT NULL)") + .HasFillFactor(90)); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ActivityTypeEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ActivityTypeIsCustom).HasDefaultValueSql("((1))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactCreated).HasDefaultValueSql("('5/3/2011 10:51:13 AM')"); + entity.Property(e => e.ContactMonitored).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactSalesForceLeadReplicationDisabled).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactSalesForceLeadReplicationRequired).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ContactCountry).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_Country"); + + entity.HasOne(d => d.ContactOwnerUser).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_User"); + + entity.HasOne(d => d.ContactState).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_State"); + + entity.HasOne(d => d.ContactStatus).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_OM_ContactStatus"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ContactGroupId).HasName("PK_CMS_ContactGroup"); + + entity.Property(e => e.ContactGroupName).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactGroupMemberFromCondition).HasDefaultValueSql("((0))"); + entity.Property(e => e.ContactGroupMemberFromManual).HasDefaultValueSql("((0))"); + + entity.HasOne(d => d.ContactGroupMemberContactGroup).WithMany(p => p.OmContactGroupMembers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ContactGroupMembers_OM_ContactGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactRoleDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContactRoleName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactStatusDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ContactStatusName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.Contact).WithMany(p => p.OmMemberships) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_Membership_OM_Contact")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.RuleDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.RuleName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); + entity.Property(e => e.RuleType).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.RuleScore).WithMany(p => p.OmRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_Rule_OM_Score"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.ScorePersonaId, "IX_OM_Score_ScorePersonaID") + .IsUnique() + .HasFilter("([ScorePersonaID] IS NOT NULL)"); + + entity.HasOne(d => d.ScorePersona).WithOne(p => p.OmScore).HasConstraintName("FK_OM_Score_Personas_Persona"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Contact).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Contact"); + + entity.HasOne(d => d.Rule).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Rule"); + + entity.HasOne(d => d.Score).WithMany(p => p.OmScoreContactRules) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ScoreContactRule_OM_Score"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.VisitorToContactContact).WithMany(p => p.OmVisitorToContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_VisitorToContact_OM_Contact_Cascade")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PersonaDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.PersonaEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.PersonaName).HasDefaultValueSql("(N'[_][_]AUTO[_][_]')"); + entity.Property(e => e.PersonaPointsThreshold).HasDefaultValueSql("((100))"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PersonaContactHistoryDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); + + entity.HasOne(d => d.PersonaContactHistoryPersona).WithMany(p => p.PersonasPersonaContactHistories).HasConstraintName("FK_Personas_PersonaContactHistory_Personas_Persona"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ReportId).IsClustered(false); + + entity.HasIndex(e => new { e.ReportDisplayName, e.ReportCategoryId }, "IX_Reporting_Report_ReportCategoryID_ReportDisplayName").IsClustered(); + + entity.Property(e => e.ReportAccess).HasDefaultValueSql("((1))"); + entity.Property(e => e.ReportDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportEnableSubscription).HasDefaultValueSql("((0))"); + entity.Property(e => e.ReportName).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.ReportCategory).WithMany(p => p.ReportingReports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_Report_ReportCategoryID_Reporting_ReportCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryPath, "IX_Reporting_ReportCategory_CategoryPath") + .IsUnique() + .IsClustered(); + + entity.Property(e => e.CategoryCodeName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.CategoryPath).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_Reporting_ReportCategory_CategoryID_Reporting_ReportCategory_ParentCategoryID"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.GraphReport).WithMany(p => p.ReportingReportGraphs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportGraph_GraphReportID_Reporting_Report")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ReportSubscriptionEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ReportSubscriptionInterval).HasDefaultValueSql("('')"); + entity.Property(e => e.ReportSubscriptionLastModified).HasDefaultValueSql("('3/9/2012 11:17:19 AM')"); + entity.Property(e => e.ReportSubscriptionOnlyNonEmpty).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.ReportSubscriptionGraph).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionGraphID_Reporting_ReportGraph"); + + entity.HasOne(d => d.ReportSubscriptionReport).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionReportID_Reporting_Report"); + + entity.HasOne(d => d.ReportSubscriptionSite).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionSiteID_CMS_Site"); + + entity.HasOne(d => d.ReportSubscriptionTable).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionTableID_Reporting_ReportTable"); + + entity.HasOne(d => d.ReportSubscriptionUser).WithMany(p => p.ReportingReportSubscriptions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionUserID_CMS_User"); + + entity.HasOne(d => d.ReportSubscriptionValue).WithMany(p => p.ReportingReportSubscriptions).HasConstraintName("FK_Reporting_ReportSubscription_ReportSubscriptionValueID_Reporting_ReportValue"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.TableReport).WithMany(p => p.ReportingReportTables) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportTable_TableReportID_Reporting_Report")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.ValueReport).WithMany(p => p.ReportingReportValues) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_ReportValue_ValueReportID_Reporting_Report")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SavedGraphSavedReport).WithMany(p => p.ReportingSavedGraphs) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_SavedGraph_SavedGraphSavedReportID_Reporting_SavedReport")); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.SavedReportId).IsClustered(false); + + entity.HasIndex(e => new { e.SavedReportReportId, e.SavedReportDate }, "IX_Reporting_SavedReport_SavedReportReportID_SavedReportDate") + .IsDescending(false, true) + .IsClustered(); + + entity.HasOne(d => d.SavedReportCreatedByUser).WithMany(p => p.ReportingSavedReports).HasConstraintName("FK_Reporting_SavedReport_SavedReportCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.SavedReportReport).WithMany(p => p.ReportingSavedReports) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Reporting_SavedReport_SavedReportReportID_Reporting_Report"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.SharePointConnectionSite).WithMany(p => p.SharePointSharePointConnections) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointConnection_CMS_Site")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SharePointFileEtag).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileExtension).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileMimeType).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointFileServerRelativeUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.SharePointFileSharePointLibrary).WithMany(p => p.SharePointSharePointFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointFile_SharePoint_SharePointLibrary"); + + entity.HasOne(d => d.SharePointFileSite).WithMany(p => p.SharePointSharePointFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointFile_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SharePointLibraryDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibraryLastModified).HasDefaultValueSql("('10/3/2014 2:45:04 PM')"); + entity.Property(e => e.SharePointLibraryListTitle).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibraryName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.SharePointLibrarySharePointConnectionId).HasDefaultValueSql("((0))"); + entity.Property(e => e.SharePointLibrarySynchronizationPeriod).HasDefaultValueSql("((720))"); + + entity.HasOne(d => d.SharePointLibrarySharePointConnection).WithMany(p => p.SharePointSharePointLibraries).HasConstraintName("FK_SharePoint_SharePointLibrary_SharePoint_SharePointConnection"); + + entity.HasOne(d => d.SharePointLibrarySite).WithMany(p => p.SharePointSharePointLibraries) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SharePoint_SharePointLibrary_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookAccountPageAccessToken).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookAccountPageId).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.FacebookAccountFacebookApplication).WithMany(p => p.SmFacebookAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookAccount_SM_FacebookApplication"); + + entity.HasOne(d => d.FacebookAccountSite).WithMany(p => p.SmFacebookAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookAccount_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookApplicationConsumerKey).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookApplicationConsumerSecret).HasDefaultValueSql("('')"); + entity.Property(e => e.FacebookApplicationLastModified).HasDefaultValueSql("('5/28/2013 1:02:36 PM')"); + + entity.HasOne(d => d.FacebookApplicationSite).WithMany(p => p.SmFacebookApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FacebookPostIsCreatedByUser).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.FacebookPostFacebookAccount).WithMany(p => p.SmFacebookPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookPost_SM_FacebookAccount"); + + entity.HasOne(d => d.FacebookPostSite).WithMany(p => p.SmFacebookPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_FacebookPost_CMS_Site"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.InsightExternalId).HasDefaultValueSql("('')")); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitDays).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitMonths).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitWeeks).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => entity.HasOne(d => d.InsightHitInsight).WithMany(p => p.SmInsightHitYears).OnDelete(DeleteBehavior.ClientSetNull)); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInAccountAccessToken).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInAccountProfileId).HasDefaultValueSql("(N'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInApplicationConsumerKey).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationConsumerSecret).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationDisplayName).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInApplicationName).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.LinkedInApplicationSite).WithMany(p => p.SmLinkedInApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.LinkedInPostComment).HasDefaultValueSql("(N'')"); + entity.Property(e => e.LinkedInPostIsCreatedByUser).HasDefaultValueSql("((1))"); + + entity.HasOne(d => d.LinkedInPostLinkedInAccount).WithMany(p => p.SmLinkedInPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInPost_SM_LinkedInAccount"); + + entity.HasOne(d => d.LinkedInPostSite).WithMany(p => p.SmLinkedInPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_LinkedInPost_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterAccountAccessToken).HasDefaultValueSql("('')"); + entity.Property(e => e.TwitterAccountAccessTokenSecret).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterAccountSite).WithMany(p => p.SmTwitterAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterAccount_CMS_Site"); + + entity.HasOne(d => d.TwitterAccountTwitterApplication).WithMany(p => p.SmTwitterAccounts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterAccount_SM_TwitterApplication"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterApplicationConsumerKey).HasDefaultValueSql("('')"); + entity.Property(e => e.TwitterApplicationConsumerSecret).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterApplicationSite).WithMany(p => p.SmTwitterApplications) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterApplication_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TwitterPostIsCreatedByUser).HasDefaultValueSql("((1))"); + entity.Property(e => e.TwitterPostText).HasDefaultValueSql("('')"); + + entity.HasOne(d => d.TwitterPostSite).WithMany(p => p.SmTwitterPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterPost_CMS_Site"); + + entity.HasOne(d => d.TwitterPostTwitterAccount).WithMany(p => p.SmTwitterPosts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_SM_TwitterPost_SM_TwitterAccount"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ServerId).IsClustered(false); + + entity.HasIndex(e => new { e.ServerSiteId, e.ServerDisplayName }, "IX_Staging_Server_ServerSiteID_ServerDisplayName").IsClustered(); + + entity.Property(e => e.ServerAuthentication).HasDefaultValueSql("('USERNAME')"); + entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("('')"); + entity.Property(e => e.ServerEnabled).HasDefaultValueSql("((1))"); + entity.Property(e => e.ServerName).HasDefaultValueSql("('')"); + entity.Property(e => e.ServerUrl).HasDefaultValueSql("(N'')"); + + entity.HasOne(d => d.ServerSite).WithMany(p => p.StagingServers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Server_ServerSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SynchronizationServer).WithMany(p => p.StagingSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Synchronization_SynchronizationServerID_Staging_Server"); + + entity.HasOne(d => d.SynchronizationTask).WithMany(p => p.StagingSynchronizations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_Synchronization_SynchronizationTaskID_Staging_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskServers).HasDefaultValueSql("('null')"); + + entity.HasOne(d => d.TaskSite).WithMany(p => p.StagingTasks).HasConstraintName("FK_Staging_Task_TaskSiteID_CMS_Site"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.TaskGroupCodeName).HasDefaultValueSql("(N'')")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupTask_Staging_TaskGroup"); + + entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskGroupTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupTask_Staging_Task"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TaskGroup).WithMany(p => p.StagingTaskGroupUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupUser_Staging_TaskGroup"); + + entity.HasOne(d => d.User).WithOne(p => p.StagingTaskGroupUser) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskGroupUser_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Task).WithMany(p => p.StagingTaskUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskUser_StagingTask"); + + entity.HasOne(d => d.User).WithMany(p => p.StagingTaskUsers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Staging_TaskUser_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FileDirectory).HasDefaultValueSql("('')"); + entity.Property(e => e.FileExtension).HasDefaultValueSql("('')"); + entity.Property(e => e.FileLastModified).HasDefaultValueSql("('6/29/2010 1:57:54 PM')"); + entity.Property(e => e.FileMimeType).HasDefaultValueSql("('')"); + entity.Property(e => e.FileName).HasDefaultValueSql("('')"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.PageBuilderWidgetsLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ACLItem_ItemsAndOperators")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ObjectVersionHistoryUser_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_PageTemplateCategoryPageTemplate_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_Relationship_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ResourceString_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ResourceTranslated_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_RoleResourcePermission_Joined")); + + modelBuilder.Entity(entity => + { + entity.ToView("View_CMS_Site_DocumentCount"); + + entity.Property(e => e.SiteId).ValueGeneratedOnAdd(); + }); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_SiteRoleResourceUIElement_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_Tree_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_User")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserDocuments")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRole_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRoleMembershipRole")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserRole_MembershipRole_ValidOnly_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_UserSettingsRole_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_WebPartCategoryWebpart_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_WidgetCategoryWidget_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_COM_SKUOptionCategory_OptionCategory_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Integration_Task_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Membership_MembershipUser_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_Newsletter_Subscriptions_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_AccountContact_AccountJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_AccountContact_ContactJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_Account_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_ContactGroupMember_AccountJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_Reporting_CategoryReport_Joined")); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); +} diff --git a/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs b/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs index 489f6b33..fa4afefb 100644 --- a/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.KX13/DependencyInjectionExtensions.cs @@ -1,15 +1,16 @@ -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.KX13.Context; - -namespace Migration.Toolkit.KX13; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKx13DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) - { - services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); - return services; - } -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Toolkit.Common; +using Migration.Toolkit.KX13.Context; + +namespace Migration.Toolkit.KX13; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKx13DbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) + { + services.AddDbContextFactory(options => options.UseSqlServer(toolkitConfiguration.KxConnectionString)); + return services; + } +} diff --git a/Migration.Toolkit.KX13/KX13ContextCustomizations.cs b/Migration.Toolkit.KX13/KX13ContextCustomizations.cs index 1a3eca6b..ad2652f3 100644 --- a/Migration.Toolkit.KX13/KX13ContextCustomizations.cs +++ b/Migration.Toolkit.KX13/KX13ContextCustomizations.cs @@ -1,14 +1,14 @@ -namespace Migration.Toolkit.KX13.Context; - -using Microsoft.EntityFrameworkCore; - -public partial class KX13Context -{ - protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) - { - optionsBuilder - .EnableDetailedErrors() - .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); - base.OnConfiguring(optionsBuilder); - } -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Context; + +public partial class KX13Context +{ + protected override void OnConfiguring(DbContextOptionsBuilder optionsBuilder) + { + optionsBuilder + .EnableDetailedErrors() + .UseQueryTrackingBehavior(QueryTrackingBehavior.NoTracking); + base.OnConfiguring(optionsBuilder); + } +} diff --git a/Migration.Toolkit.KX13/Migration.Toolkit.KX13.csproj b/Migration.Toolkit.KX13/Migration.Toolkit.KX13.csproj index 129d74a5..e48c3cdc 100644 --- a/Migration.Toolkit.KX13/Migration.Toolkit.KX13.csproj +++ b/Migration.Toolkit.KX13/Migration.Toolkit.KX13.csproj @@ -1,38 +1,38 @@ - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + - + - - TextTemplatingFileGenerator - SettingsKeys.cs - + + TextTemplatingFileGenerator + SettingsKeys.cs + - - True - True - SettingsKeys.tt - + + True + True + SettingsKeys.tt + - + diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs index 37e3d56b..fb66e010 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaign.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_Campaign")] -[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] -[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] -public partial class AnalyticsCampaign -{ - [Key] - [Column("CampaignID")] - public int CampaignId { get; set; } - - [StringLength(200)] - public string CampaignName { get; set; } = null!; - - [StringLength(100)] - public string CampaignDisplayName { get; set; } = null!; - - public string? CampaignDescription { get; set; } - - [Column("CampaignSiteID")] - public int CampaignSiteId { get; set; } - - public DateTime? CampaignOpenFrom { get; set; } - - public DateTime? CampaignOpenTo { get; set; } - - [Column("CampaignGUID")] - public Guid CampaignGuid { get; set; } - - public DateTime CampaignLastModified { get; set; } - - [Column("CampaignUTMCode")] - [StringLength(200)] - public string? CampaignUtmcode { get; set; } - - public DateTime? CampaignCalculatedTo { get; set; } - - [Column("CampaignScheduledTaskID")] - public int? CampaignScheduledTaskId { get; set; } - - public int? CampaignVisitors { get; set; } - - [InverseProperty("CampaignAssetCampaign")] - public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); - - [InverseProperty("CampaignConversionCampaign")] - public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaign")] - public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } - - [ForeignKey("CampaignScheduledTaskId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } - - [ForeignKey("CampaignSiteId")] - [InverseProperty("AnalyticsCampaigns")] - public virtual CmsSite CampaignSite { get; set; } = null!; - - [InverseProperty("FacebookPostCampaign")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInPostCampaign")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterPostCampaign")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_Campaign")] +[Index("CampaignScheduledTaskId", Name = "IX_Analytics_Campaign_CampaignScheduledTaskID")] +[Index("CampaignSiteId", Name = "IX_Analytics_Campaign_CampaignSiteID")] +public class AnalyticsCampaign +{ + [Key] + [Column("CampaignID")] + public int CampaignId { get; set; } + + [StringLength(200)] + public string CampaignName { get; set; } = null!; + + [StringLength(100)] + public string CampaignDisplayName { get; set; } = null!; + + public string? CampaignDescription { get; set; } + + [Column("CampaignSiteID")] + public int CampaignSiteId { get; set; } + + public DateTime? CampaignOpenFrom { get; set; } + + public DateTime? CampaignOpenTo { get; set; } + + [Column("CampaignGUID")] + public Guid CampaignGuid { get; set; } + + public DateTime CampaignLastModified { get; set; } + + [Column("CampaignUTMCode")] + [StringLength(200)] + public string? CampaignUtmcode { get; set; } + + public DateTime? CampaignCalculatedTo { get; set; } + + [Column("CampaignScheduledTaskID")] + public int? CampaignScheduledTaskId { get; set; } + + public int? CampaignVisitors { get; set; } + + [InverseProperty("CampaignAssetCampaign")] + public virtual ICollection AnalyticsCampaignAssets { get; set; } = new List(); + + [InverseProperty("CampaignConversionCampaign")] + public virtual ICollection AnalyticsCampaignConversions { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaign")] + public virtual AnalyticsCampaignObjective? AnalyticsCampaignObjective { get; set; } + + [ForeignKey("CampaignScheduledTaskId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsScheduledTask? CampaignScheduledTask { get; set; } + + [ForeignKey("CampaignSiteId")] + [InverseProperty("AnalyticsCampaigns")] + public virtual CmsSite CampaignSite { get; set; } = null!; + + [InverseProperty("FacebookPostCampaign")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInPostCampaign")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterPostCampaign")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs index 897d5190..d7631156 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAsset.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignAsset")] -[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] -public partial class AnalyticsCampaignAsset -{ - [Key] - [Column("CampaignAssetID")] - public int CampaignAssetId { get; set; } - - public Guid CampaignAssetGuid { get; set; } - - public DateTime CampaignAssetLastModified { get; set; } - - public Guid CampaignAssetAssetGuid { get; set; } - - [Column("CampaignAssetCampaignID")] - public int CampaignAssetCampaignId { get; set; } - - [StringLength(200)] - public string CampaignAssetType { get; set; } = null!; - - [InverseProperty("CampaignAssetUrlCampaignAsset")] - public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); - - [ForeignKey("CampaignAssetCampaignId")] - [InverseProperty("AnalyticsCampaignAssets")] - public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_CampaignAsset")] +[Index("CampaignAssetCampaignId", Name = "IX_Analytics_CampaignAsset_CampaignAssetCampaignID")] +public class AnalyticsCampaignAsset +{ + [Key] + [Column("CampaignAssetID")] + public int CampaignAssetId { get; set; } + + public Guid CampaignAssetGuid { get; set; } + + public DateTime CampaignAssetLastModified { get; set; } + + public Guid CampaignAssetAssetGuid { get; set; } + + [Column("CampaignAssetCampaignID")] + public int CampaignAssetCampaignId { get; set; } + + [StringLength(200)] + public string CampaignAssetType { get; set; } = null!; + + [InverseProperty("CampaignAssetUrlCampaignAsset")] + public virtual ICollection AnalyticsCampaignAssetUrls { get; set; } = new List(); + + [ForeignKey("CampaignAssetCampaignId")] + [InverseProperty("AnalyticsCampaignAssets")] + public virtual AnalyticsCampaign CampaignAssetCampaign { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs index 057ccc08..c4a339fd 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignAssetUrl.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignAssetUrl")] -[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] -public partial class AnalyticsCampaignAssetUrl -{ - [Key] - [Column("CampaignAssetUrlID")] - public int CampaignAssetUrlId { get; set; } - - public Guid CampaignAssetUrlGuid { get; set; } - - public string CampaignAssetUrlTarget { get; set; } = null!; - - [StringLength(200)] - public string CampaignAssetUrlPageTitle { get; set; } = null!; - - [Column("CampaignAssetUrlCampaignAssetID")] - public int CampaignAssetUrlCampaignAssetId { get; set; } - - [ForeignKey("CampaignAssetUrlCampaignAssetId")] - [InverseProperty("AnalyticsCampaignAssetUrls")] - public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_CampaignAssetUrl")] +[Index("CampaignAssetUrlCampaignAssetId", Name = "IX_Analytics_CampaignAssetUrl_CampaignAssetUrlCampaignAssetID")] +public class AnalyticsCampaignAssetUrl +{ + [Key] + [Column("CampaignAssetUrlID")] + public int CampaignAssetUrlId { get; set; } + + public Guid CampaignAssetUrlGuid { get; set; } + + public string CampaignAssetUrlTarget { get; set; } = null!; + + [StringLength(200)] + public string CampaignAssetUrlPageTitle { get; set; } = null!; + + [Column("CampaignAssetUrlCampaignAssetID")] + public int CampaignAssetUrlCampaignAssetId { get; set; } + + [ForeignKey("CampaignAssetUrlCampaignAssetId")] + [InverseProperty("AnalyticsCampaignAssetUrls")] + public virtual AnalyticsCampaignAsset CampaignAssetUrlCampaignAsset { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs index 0142adc2..b7a97851 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversion.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignConversion")] -[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] -public partial class AnalyticsCampaignConversion -{ - [Key] - [Column("CampaignConversionID")] - public int CampaignConversionId { get; set; } - - public Guid CampaignConversionGuid { get; set; } - - public DateTime CampaignConversionLastModified { get; set; } - - [StringLength(100)] - public string CampaignConversionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string CampaignConversionName { get; set; } = null!; - - [Column("CampaignConversionCampaignID")] - public int CampaignConversionCampaignId { get; set; } - - public int CampaignConversionOrder { get; set; } - - [StringLength(250)] - public string CampaignConversionActivityType { get; set; } = null!; - - public int CampaignConversionHits { get; set; } - - [Column("CampaignConversionItemID")] - public int? CampaignConversionItemId { get; set; } - - public double CampaignConversionValue { get; set; } - - public bool CampaignConversionIsFunnelStep { get; set; } - - [Column("CampaignConversionURL")] - public string? CampaignConversionUrl { get; set; } - - [InverseProperty("CampaignConversionHitsConversion")] - public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); - - [InverseProperty("CampaignObjectiveCampaignConversion")] - public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); - - [ForeignKey("CampaignConversionCampaignId")] - [InverseProperty("AnalyticsCampaignConversions")] - public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_CampaignConversion")] +[Index("CampaignConversionCampaignId", Name = "IX_Analytics_CampaignConversion_CampaignConversionCampaignID")] +public class AnalyticsCampaignConversion +{ + [Key] + [Column("CampaignConversionID")] + public int CampaignConversionId { get; set; } + + public Guid CampaignConversionGuid { get; set; } + + public DateTime CampaignConversionLastModified { get; set; } + + [StringLength(100)] + public string CampaignConversionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string CampaignConversionName { get; set; } = null!; + + [Column("CampaignConversionCampaignID")] + public int CampaignConversionCampaignId { get; set; } + + public int CampaignConversionOrder { get; set; } + + [StringLength(250)] + public string CampaignConversionActivityType { get; set; } = null!; + + public int CampaignConversionHits { get; set; } + + [Column("CampaignConversionItemID")] + public int? CampaignConversionItemId { get; set; } + + public double CampaignConversionValue { get; set; } + + public bool CampaignConversionIsFunnelStep { get; set; } + + [Column("CampaignConversionURL")] + public string? CampaignConversionUrl { get; set; } + + [InverseProperty("CampaignConversionHitsConversion")] + public virtual ICollection AnalyticsCampaignConversionHits { get; set; } = new List(); + + [InverseProperty("CampaignObjectiveCampaignConversion")] + public virtual ICollection AnalyticsCampaignObjectives { get; set; } = new List(); + + [ForeignKey("CampaignConversionCampaignId")] + [InverseProperty("AnalyticsCampaignConversions")] + public virtual AnalyticsCampaign CampaignConversionCampaign { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs index 96b4df8a..f382813d 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignConversionHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignConversionHits")] -[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] -public partial class AnalyticsCampaignConversionHit -{ - [Key] - [Column("CampaignConversionHitsID")] - public int CampaignConversionHitsId { get; set; } - - [Column("CampaignConversionHitsConversionID")] - public int CampaignConversionHitsConversionId { get; set; } - - public int CampaignConversionHitsCount { get; set; } - - [StringLength(200)] - public string CampaignConversionHitsSourceName { get; set; } = null!; - - [StringLength(200)] - public string? CampaignConversionHitsContentName { get; set; } - - [ForeignKey("CampaignConversionHitsConversionId")] - [InverseProperty("AnalyticsCampaignConversionHits")] - public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_CampaignConversionHits")] +[Index("CampaignConversionHitsConversionId", Name = "IX_Analytics_CampaignConversionHits_CampaignConversionHitsConversionID")] +public class AnalyticsCampaignConversionHit +{ + [Key] + [Column("CampaignConversionHitsID")] + public int CampaignConversionHitsId { get; set; } + + [Column("CampaignConversionHitsConversionID")] + public int CampaignConversionHitsConversionId { get; set; } + + public int CampaignConversionHitsCount { get; set; } + + [StringLength(200)] + public string CampaignConversionHitsSourceName { get; set; } = null!; + + [StringLength(200)] + public string? CampaignConversionHitsContentName { get; set; } + + [ForeignKey("CampaignConversionHitsConversionId")] + [InverseProperty("AnalyticsCampaignConversionHits")] + public virtual AnalyticsCampaignConversion CampaignConversionHitsConversion { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs b/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs index 0943f173..70dd9951 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsCampaignObjective.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_CampaignObjective")] -[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] -[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] -public partial class AnalyticsCampaignObjective -{ - [Key] - [Column("CampaignObjectiveID")] - public int CampaignObjectiveId { get; set; } - - public Guid CampaignObjectiveGuid { get; set; } - - public DateTime CampaignObjectiveLastModified { get; set; } - - [Column("CampaignObjectiveCampaignID")] - public int CampaignObjectiveCampaignId { get; set; } - - public int? CampaignObjectiveValue { get; set; } - - [Column("CampaignObjectiveCampaignConversionID")] - public int CampaignObjectiveCampaignConversionId { get; set; } - - [ForeignKey("CampaignObjectiveCampaignId")] - [InverseProperty("AnalyticsCampaignObjective")] - public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; - - [ForeignKey("CampaignObjectiveCampaignConversionId")] - [InverseProperty("AnalyticsCampaignObjectives")] - public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_CampaignObjective")] +[Index("CampaignObjectiveCampaignId", Name = "CK_Analytics_CampaignObjective_CampaignObjectiveCampaignID", IsUnique = true)] +[Index("CampaignObjectiveCampaignConversionId", Name = "IX_Analytics_CampaignObjective_CampaignObjectiveCampaignConversionID")] +public class AnalyticsCampaignObjective +{ + [Key] + [Column("CampaignObjectiveID")] + public int CampaignObjectiveId { get; set; } + + public Guid CampaignObjectiveGuid { get; set; } + + public DateTime CampaignObjectiveLastModified { get; set; } + + [Column("CampaignObjectiveCampaignID")] + public int CampaignObjectiveCampaignId { get; set; } + + public int? CampaignObjectiveValue { get; set; } + + [Column("CampaignObjectiveCampaignConversionID")] + public int CampaignObjectiveCampaignConversionId { get; set; } + + [ForeignKey("CampaignObjectiveCampaignId")] + [InverseProperty("AnalyticsCampaignObjective")] + public virtual AnalyticsCampaign CampaignObjectiveCampaign { get; set; } = null!; + + [ForeignKey("CampaignObjectiveCampaignConversionId")] + [InverseProperty("AnalyticsCampaignObjectives")] + public virtual AnalyticsCampaignConversion CampaignObjectiveCampaignConversion { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs index 01d9e92d..90788703 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsDayHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_DayHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] -public partial class AnalyticsDayHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsDayHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_DayHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_DayHits_HitsStatisticsID")] +public class AnalyticsDayHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsDayHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs b/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs index 741eee17..cc850a22 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsExitPage.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_ExitPages")] -[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] -[Index("ExitPageSessionIdentifier", Name = "UQ_Analytics_ExitPages_ExitPageSessionIdentifier", IsUnique = true)] -public partial class AnalyticsExitPage -{ - public DateTime ExitPageLastModified { get; set; } - - [Column("ExitPageSiteID")] - public int ExitPageSiteId { get; set; } - - [StringLength(50)] - public string? ExitPageCulture { get; set; } - - [Key] - public int ExitPageId { get; set; } - - [StringLength(1000)] - public string ExitPageUrl { get; set; } = null!; - - public Guid ExitPageSessionIdentifier { get; set; } - - [ForeignKey("ExitPageSiteId")] - [InverseProperty("AnalyticsExitPages")] - public virtual CmsSite ExitPageSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_ExitPages")] +[Index("ExitPageLastModified", Name = "IX_Analytics_ExitPages_ExitPageLastModified")] +[Index("ExitPageSessionIdentifier", Name = "UQ_Analytics_ExitPages_ExitPageSessionIdentifier", IsUnique = true)] +public class AnalyticsExitPage +{ + public DateTime ExitPageLastModified { get; set; } + + [Column("ExitPageSiteID")] + public int ExitPageSiteId { get; set; } + + [StringLength(50)] + public string? ExitPageCulture { get; set; } + + [Key] + public int ExitPageId { get; set; } + + [StringLength(1000)] + public string ExitPageUrl { get; set; } = null!; + + public Guid ExitPageSessionIdentifier { get; set; } + + [ForeignKey("ExitPageSiteId")] + [InverseProperty("AnalyticsExitPages")] + public virtual CmsSite ExitPageSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs index 777d914e..21652c4c 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsHourHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_HourHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] -public partial class AnalyticsHourHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsHourHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_HourHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_HourHits_HitsStatisticsID")] +public class AnalyticsHourHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsHourHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs index d562bc79..2d4a1323 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsMonthHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_MonthHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] -public partial class AnalyticsMonthHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsMonthHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_MonthHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_MonthHits_HitsStatisticsID")] +public class AnalyticsMonthHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsMonthHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs b/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs index 0567d180..2eb6060d 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsStatistic.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_Statistics")] -[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] -public partial class AnalyticsStatistic -{ - [Key] - [Column("StatisticsID")] - public int StatisticsId { get; set; } - - [Column("StatisticsSiteID")] - public int? StatisticsSiteId { get; set; } - - [StringLength(400)] - public string StatisticsCode { get; set; } = null!; - - [StringLength(1000)] - public string? StatisticsObjectName { get; set; } - - [Column("StatisticsObjectID")] - public int? StatisticsObjectId { get; set; } - - [StringLength(50)] - public string? StatisticsObjectCulture { get; set; } - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsDayHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsHourHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); - - [InverseProperty("HitsStatistics")] - public virtual ICollection AnalyticsYearHits { get; set; } = new List(); - - [ForeignKey("StatisticsSiteId")] - [InverseProperty("AnalyticsStatistics")] - public virtual CmsSite? StatisticsSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_Statistics")] +[Index("StatisticsSiteId", Name = "IX_Analytics_Statistics_StatisticsSiteID")] +public class AnalyticsStatistic +{ + [Key] + [Column("StatisticsID")] + public int StatisticsId { get; set; } + + [Column("StatisticsSiteID")] + public int? StatisticsSiteId { get; set; } + + [StringLength(400)] + public string StatisticsCode { get; set; } = null!; + + [StringLength(1000)] + public string? StatisticsObjectName { get; set; } + + [Column("StatisticsObjectID")] + public int? StatisticsObjectId { get; set; } + + [StringLength(50)] + public string? StatisticsObjectCulture { get; set; } + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsDayHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsHourHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsMonthHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsWeekHits { get; set; } = new List(); + + [InverseProperty("HitsStatistics")] + public virtual ICollection AnalyticsYearHits { get; set; } = new List(); + + [ForeignKey("StatisticsSiteId")] + [InverseProperty("AnalyticsStatistics")] + public virtual CmsSite? StatisticsSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs index af7c3525..81dfa741 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsWeekHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_WeekHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] -public partial class AnalyticsWeekHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsWeekHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_WeekHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekHits_HitsStatisticsID")] +public class AnalyticsWeekHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsWeekHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs b/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs index 484eeb6e..16fca8eb 100644 --- a/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs +++ b/Migration.Toolkit.KX13/Models/AnalyticsYearHit.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Analytics_YearHits")] -[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] -public partial class AnalyticsYearHit -{ - [Key] - [Column("HitsID")] - public int HitsId { get; set; } - - [Column("HitsStatisticsID")] - public int HitsStatisticsId { get; set; } - - public DateTime HitsStartTime { get; set; } - - public DateTime HitsEndTime { get; set; } - - public int HitsCount { get; set; } - - public double? HitsValue { get; set; } - - [ForeignKey("HitsStatisticsId")] - [InverseProperty("AnalyticsYearHits")] - public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Analytics_YearHits")] +[Index("HitsStatisticsId", Name = "IX_Analytics_WeekYearHits_HitsStatisticsID")] +public class AnalyticsYearHit +{ + [Key] + [Column("HitsID")] + public int HitsId { get; set; } + + [Column("HitsStatisticsID")] + public int HitsStatisticsId { get; set; } + + public DateTime HitsStartTime { get; set; } + + public DateTime HitsEndTime { get; set; } + + public int HitsCount { get; set; } + + public double? HitsValue { get; set; } + + [ForeignKey("HitsStatisticsId")] + [InverseProperty("AnalyticsYearHits")] + public virtual AnalyticsStatistic HitsStatistics { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs b/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs index 69d3e0d8..e8abfa86 100644 --- a/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs +++ b/Migration.Toolkit.KX13/Models/CiFileMetadatum.cs @@ -1,22 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CI_FileMetadata")] -[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] -public partial class CiFileMetadatum -{ - [Key] - [Column("FileMetadataID")] - public int FileMetadataId { get; set; } - - [StringLength(260)] - public string FileLocation { get; set; } = null!; - - [StringLength(32)] - public string FileHash { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CI_FileMetadata")] +[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] +public class CiFileMetadatum +{ + [Key] + [Column("FileMetadataID")] + public int FileMetadataId { get; set; } + + [StringLength(260)] + public string FileLocation { get; set; } = null!; + + [StringLength(32)] + public string FileHash { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CiMigration.cs b/Migration.Toolkit.KX13/Models/CiMigration.cs index 9598053a..14eaaf79 100644 --- a/Migration.Toolkit.KX13/Models/CiMigration.cs +++ b/Migration.Toolkit.KX13/Models/CiMigration.cs @@ -1,24 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CI_Migration")] -[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] -public partial class CiMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CI_Migration")] +[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] +public class CiMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsAcl.cs b/Migration.Toolkit.KX13/Models/CmsAcl.cs index aae71c90..63206d32 100644 --- a/Migration.Toolkit.KX13/Models/CmsAcl.cs +++ b/Migration.Toolkit.KX13/Models/CmsAcl.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ACL")] -[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] -[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] -public partial class CmsAcl -{ - [Key] - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("ACLInheritedACLs")] - public string AclinheritedAcls { get; set; } = null!; - - [Column("ACLGUID")] - public Guid Aclguid { get; set; } - - [Column("ACLLastModified")] - public DateTime AcllastModified { get; set; } - - [Column("ACLSiteID")] - public int? AclsiteId { get; set; } - - [ForeignKey("AclsiteId")] - [InverseProperty("CmsAcls")] - public virtual CmsSite? Aclsite { get; set; } - - [InverseProperty("Acl")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("NodeAcl")] - public virtual ICollection CmsTrees { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ACL")] +[Index("AclinheritedAcls", Name = "IX_CMS_ACL_ACLInheritedACLs")] +[Index("AclsiteId", Name = "IX_CMS_ACL_ACLSiteID")] +public class CmsAcl +{ + [Key] + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("ACLInheritedACLs")] + public string AclinheritedAcls { get; set; } = null!; + + [Column("ACLGUID")] + public Guid Aclguid { get; set; } + + [Column("ACLLastModified")] + public DateTime AcllastModified { get; set; } + + [Column("ACLSiteID")] + public int? AclsiteId { get; set; } + + [ForeignKey("AclsiteId")] + [InverseProperty("CmsAcls")] + public virtual CmsSite? Aclsite { get; set; } + + [InverseProperty("Acl")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("NodeAcl")] + public virtual ICollection CmsTrees { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsAclitem.cs b/Migration.Toolkit.KX13/Models/CmsAclitem.cs index 984959ef..8144ecab 100644 --- a/Migration.Toolkit.KX13/Models/CmsAclitem.cs +++ b/Migration.Toolkit.KX13/Models/CmsAclitem.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ACLItem")] -[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] -[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] -[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] -[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] -public partial class CmsAclitem -{ - [Key] - [Column("ACLItemID")] - public int AclitemId { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - public DateTime LastModified { get; set; } - - [Column("LastModifiedByUserID")] - public int? LastModifiedByUserId { get; set; } - - [Column("ACLItemGUID")] - public Guid AclitemGuid { get; set; } - - [ForeignKey("Aclid")] - [InverseProperty("CmsAclitems")] - public virtual CmsAcl Acl { get; set; } = null!; - - [ForeignKey("LastModifiedByUserId")] - [InverseProperty("CmsAclitemLastModifiedByUsers")] - public virtual CmsUser? LastModifiedByUser { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsAclitems")] - public virtual CmsRole? Role { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsAclitemUsers")] - public virtual CmsUser? User { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ACLItem")] +[Index("Aclid", Name = "IX_CMS_ACLItem_ACLID")] +[Index("LastModifiedByUserId", Name = "IX_CMS_ACLItem_LastModifiedByUserID")] +[Index("RoleId", Name = "IX_CMS_ACLItem_RoleID")] +[Index("UserId", Name = "IX_CMS_ACLItem_UserID")] +public class CmsAclitem +{ + [Key] + [Column("ACLItemID")] + public int AclitemId { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + public DateTime LastModified { get; set; } + + [Column("LastModifiedByUserID")] + public int? LastModifiedByUserId { get; set; } + + [Column("ACLItemGUID")] + public Guid AclitemGuid { get; set; } + + [ForeignKey("Aclid")] + [InverseProperty("CmsAclitems")] + public virtual CmsAcl Acl { get; set; } = null!; + + [ForeignKey("LastModifiedByUserId")] + [InverseProperty("CmsAclitemLastModifiedByUsers")] + public virtual CmsUser? LastModifiedByUser { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsAclitems")] + public virtual CmsRole? Role { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsAclitemUsers")] + public virtual CmsUser? User { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs index 6efe2059..ed831120 100644 --- a/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs +++ b/Migration.Toolkit.KX13/Models/CmsAlternativeForm.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AlternativeForm")] -[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] -[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] -public partial class CmsAlternativeForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(50)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public string? FormDefinition { get; set; } - - public string? FormLayout { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Column("FormCoupledClassID")] - public int? FormCoupledClassId { get; set; } - - public bool? FormHideNewParentFields { get; set; } - - [StringLength(50)] - public string? FormLayoutType { get; set; } - - [Column("FormVersionGUID")] - [StringLength(50)] - public string? FormVersionGuid { get; set; } - - [StringLength(400)] - public string? FormCustomizedColumns { get; set; } - - public bool? FormIsCustom { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsAlternativeFormFormClasses")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormCoupledClassId")] - [InverseProperty("CmsAlternativeFormFormCoupledClasses")] - public virtual CmsClass? FormCoupledClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_AlternativeForm")] +[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] +[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] +public class CmsAlternativeForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(50)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public string? FormDefinition { get; set; } + + public string? FormLayout { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Column("FormCoupledClassID")] + public int? FormCoupledClassId { get; set; } + + public bool? FormHideNewParentFields { get; set; } + + [StringLength(50)] + public string? FormLayoutType { get; set; } + + [Column("FormVersionGUID")] + [StringLength(50)] + public string? FormVersionGuid { get; set; } + + [StringLength(400)] + public string? FormCustomizedColumns { get; set; } + + public bool? FormIsCustom { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsAlternativeFormFormClasses")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormCoupledClassId")] + [InverseProperty("CmsAlternativeFormFormCoupledClasses")] + public virtual CmsClass? FormCoupledClass { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs b/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs index 1dce6fb6..404dfa74 100644 --- a/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs +++ b/Migration.Toolkit.KX13/Models/CmsAlternativeUrl.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AlternativeUrl")] -[Index("AlternativeUrlDocumentId", Name = "IX_CMS_AlternativeUrl_AlternativeUrlDocumentID")] -[Index("AlternativeUrlSiteId", "AlternativeUrlUrl", Name = "IX_CMS_AlternativeUrl_AlternativeUrlSiteID_AlternativeUrlUrl", IsUnique = true)] -public partial class CmsAlternativeUrl -{ - [Key] - [Column("AlternativeUrlID")] - public int AlternativeUrlId { get; set; } - - [Column("AlternativeUrlGUID")] - public Guid AlternativeUrlGuid { get; set; } - - [Column("AlternativeUrlDocumentID")] - public int AlternativeUrlDocumentId { get; set; } - - [Column("AlternativeUrlSiteID")] - public int AlternativeUrlSiteId { get; set; } - - [StringLength(400)] - public string AlternativeUrlUrl { get; set; } = null!; - - public DateTime AlternativeUrlLastModified { get; set; } - - [ForeignKey("AlternativeUrlDocumentId")] - [InverseProperty("CmsAlternativeUrls")] - public virtual CmsDocument AlternativeUrlDocument { get; set; } = null!; - - [ForeignKey("AlternativeUrlSiteId")] - [InverseProperty("CmsAlternativeUrls")] - public virtual CmsSite AlternativeUrlSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_AlternativeUrl")] +[Index("AlternativeUrlDocumentId", Name = "IX_CMS_AlternativeUrl_AlternativeUrlDocumentID")] +[Index("AlternativeUrlSiteId", "AlternativeUrlUrl", Name = "IX_CMS_AlternativeUrl_AlternativeUrlSiteID_AlternativeUrlUrl", IsUnique = true)] +public class CmsAlternativeUrl +{ + [Key] + [Column("AlternativeUrlID")] + public int AlternativeUrlId { get; set; } + + [Column("AlternativeUrlGUID")] + public Guid AlternativeUrlGuid { get; set; } + + [Column("AlternativeUrlDocumentID")] + public int AlternativeUrlDocumentId { get; set; } + + [Column("AlternativeUrlSiteID")] + public int AlternativeUrlSiteId { get; set; } + + [StringLength(400)] + public string AlternativeUrlUrl { get; set; } = null!; + + public DateTime AlternativeUrlLastModified { get; set; } + + [ForeignKey("AlternativeUrlDocumentId")] + [InverseProperty("CmsAlternativeUrls")] + public virtual CmsDocument AlternativeUrlDocument { get; set; } = null!; + + [ForeignKey("AlternativeUrlSiteId")] + [InverseProperty("CmsAlternativeUrls")] + public virtual CmsSite AlternativeUrlSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsAttachment.cs b/Migration.Toolkit.KX13/Models/CmsAttachment.cs index 00b396c2..3e723479 100644 --- a/Migration.Toolkit.KX13/Models/CmsAttachment.cs +++ b/Migration.Toolkit.KX13/Models/CmsAttachment.cs @@ -1,91 +1,90 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Attachment")] -[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] -[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] -public partial class CmsAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int? AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [Column("AttachmentFormGUID")] - public Guid? AttachmentFormGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentDocumentId")] - [InverseProperty("CmsAttachments")] - public virtual CmsDocument? AttachmentDocument { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachments")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachment? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Attachment")] +[Index("AttachmentDocumentId", Name = "IX_CMS_Attachment_AttachmentDocumentID")] +[Index("AttachmentGuid", "AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentGUID_AttachmentSiteID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentFormGuid", "AttachmentOrder", Name = "IX_CMS_Attachment_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentFormGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_Attachment_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_Attachment_AttachmentVariantParentID")] +public class CmsAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int? AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [Column("AttachmentFormGUID")] + public Guid? AttachmentFormGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentDocumentId")] + [InverseProperty("CmsAttachments")] + public virtual CmsDocument? AttachmentDocument { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachments")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachment? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs b/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs index 0e930aca..b602ae76 100644 --- a/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsAttachmentHistory.cs @@ -1,90 +1,89 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AttachmentHistory")] -[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] -[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] -[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] -[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] -public partial class CmsAttachmentHistory -{ - [Key] - [Column("AttachmentHistoryID")] - public int AttachmentHistoryId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[]? AttachmentBinary { get; set; } - - public int? AttachmentImageWidth { get; set; } - - public int? AttachmentImageHeight { get; set; } - - [Column("AttachmentDocumentID")] - public int AttachmentDocumentId { get; set; } - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public bool? AttachmentIsUnsorted { get; set; } - - public int? AttachmentOrder { get; set; } - - [Column("AttachmentGroupGUID")] - public Guid? AttachmentGroupGuid { get; set; } - - [StringLength(32)] - public string? AttachmentHash { get; set; } - - [StringLength(250)] - public string? AttachmentTitle { get; set; } - - public string? AttachmentDescription { get; set; } - - public string? AttachmentCustomData { get; set; } - - public DateTime? AttachmentLastModified { get; set; } - - [Column("AttachmentHistoryGUID")] - public Guid AttachmentHistoryGuid { get; set; } - - [Column("AttachmentSiteID")] - public int AttachmentSiteId { get; set; } - - public string? AttachmentSearchContent { get; set; } - - [StringLength(50)] - public string? AttachmentVariantDefinitionIdentifier { get; set; } - - [Column("AttachmentVariantParentID")] - public int? AttachmentVariantParentId { get; set; } - - [ForeignKey("AttachmentSiteId")] - [InverseProperty("CmsAttachmentHistories")] - public virtual CmsSite AttachmentSite { get; set; } = null!; - - [ForeignKey("AttachmentVariantParentId")] - [InverseProperty("InverseAttachmentVariantParent")] - public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } - - [InverseProperty("AttachmentVariantParent")] - public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); - - [ForeignKey("AttachmentHistoryId")] - [InverseProperty("AttachmentHistories")] - public virtual ICollection VersionHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_AttachmentHistory")] +[Index("AttachmentGuid", Name = "IX_CMS_AttachmentHistory_AttachmentGUID")] +[Index("AttachmentIsUnsorted", "AttachmentGroupGuid", "AttachmentOrder", Name = "IX_CMS_AttachmentHistory_AttachmentIsUnsorted_AttachmentGroupGUID_AttachmentOrder")] +[Index("AttachmentSiteId", Name = "IX_CMS_AttachmentHistory_AttachmentSiteID")] +[Index("AttachmentVariantParentId", Name = "IX_CMS_AttachmentHistory_AttachmentVariantParentID")] +public class CmsAttachmentHistory +{ + [Key] + [Column("AttachmentHistoryID")] + public int AttachmentHistoryId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[]? AttachmentBinary { get; set; } + + public int? AttachmentImageWidth { get; set; } + + public int? AttachmentImageHeight { get; set; } + + [Column("AttachmentDocumentID")] + public int AttachmentDocumentId { get; set; } + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public bool? AttachmentIsUnsorted { get; set; } + + public int? AttachmentOrder { get; set; } + + [Column("AttachmentGroupGUID")] + public Guid? AttachmentGroupGuid { get; set; } + + [StringLength(32)] + public string? AttachmentHash { get; set; } + + [StringLength(250)] + public string? AttachmentTitle { get; set; } + + public string? AttachmentDescription { get; set; } + + public string? AttachmentCustomData { get; set; } + + public DateTime? AttachmentLastModified { get; set; } + + [Column("AttachmentHistoryGUID")] + public Guid AttachmentHistoryGuid { get; set; } + + [Column("AttachmentSiteID")] + public int AttachmentSiteId { get; set; } + + public string? AttachmentSearchContent { get; set; } + + [StringLength(50)] + public string? AttachmentVariantDefinitionIdentifier { get; set; } + + [Column("AttachmentVariantParentID")] + public int? AttachmentVariantParentId { get; set; } + + [ForeignKey("AttachmentSiteId")] + [InverseProperty("CmsAttachmentHistories")] + public virtual CmsSite AttachmentSite { get; set; } = null!; + + [ForeignKey("AttachmentVariantParentId")] + [InverseProperty("InverseAttachmentVariantParent")] + public virtual CmsAttachmentHistory? AttachmentVariantParent { get; set; } + + [InverseProperty("AttachmentVariantParent")] + public virtual ICollection InverseAttachmentVariantParent { get; set; } = new List(); + + [ForeignKey("AttachmentHistoryId")] + [InverseProperty("AttachmentHistories")] + public virtual ICollection VersionHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs index 6c743065..972ff973 100644 --- a/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsAutomationHistory.cs @@ -1,82 +1,81 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AutomationHistory")] -[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] -[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] -[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] -[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] -[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] -[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] -public partial class CmsAutomationHistory -{ - [Key] - [Column("HistoryID")] - public int HistoryId { get; set; } - - [Column("HistoryStepID")] - public int? HistoryStepId { get; set; } - - [StringLength(440)] - public string? HistoryStepName { get; set; } - - [StringLength(450)] - public string HistoryStepDisplayName { get; set; } = null!; - - public int? HistoryStepType { get; set; } - - [Column("HistoryTargetStepID")] - public int? HistoryTargetStepId { get; set; } - - [StringLength(440)] - public string? HistoryTargetStepName { get; set; } - - [StringLength(450)] - public string? HistoryTargetStepDisplayName { get; set; } - - public int? HistoryTargetStepType { get; set; } - - [Column("HistoryApprovedByUserID")] - public int? HistoryApprovedByUserId { get; set; } - - public DateTime? HistoryApprovedWhen { get; set; } - - public string? HistoryComment { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - public bool HistoryWasRejected { get; set; } - - [Column("HistoryStateID")] - public int HistoryStateId { get; set; } - - [ForeignKey("HistoryApprovedByUserId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsUser? HistoryApprovedByUser { get; set; } - - [ForeignKey("HistoryStateId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsAutomationState HistoryState { get; set; } = null!; - - [ForeignKey("HistoryStepId")] - [InverseProperty("CmsAutomationHistoryHistorySteps")] - public virtual CmsWorkflowStep? HistoryStep { get; set; } - - [ForeignKey("HistoryTargetStepId")] - [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] - public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_AutomationHistory")] +[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] +[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] +[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] +[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] +[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] +[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] +public class CmsAutomationHistory +{ + [Key] + [Column("HistoryID")] + public int HistoryId { get; set; } + + [Column("HistoryStepID")] + public int? HistoryStepId { get; set; } + + [StringLength(440)] + public string? HistoryStepName { get; set; } + + [StringLength(450)] + public string HistoryStepDisplayName { get; set; } = null!; + + public int? HistoryStepType { get; set; } + + [Column("HistoryTargetStepID")] + public int? HistoryTargetStepId { get; set; } + + [StringLength(440)] + public string? HistoryTargetStepName { get; set; } + + [StringLength(450)] + public string? HistoryTargetStepDisplayName { get; set; } + + public int? HistoryTargetStepType { get; set; } + + [Column("HistoryApprovedByUserID")] + public int? HistoryApprovedByUserId { get; set; } + + public DateTime? HistoryApprovedWhen { get; set; } + + public string? HistoryComment { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + public bool HistoryWasRejected { get; set; } + + [Column("HistoryStateID")] + public int HistoryStateId { get; set; } + + [ForeignKey("HistoryApprovedByUserId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsUser? HistoryApprovedByUser { get; set; } + + [ForeignKey("HistoryStateId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsAutomationState HistoryState { get; set; } = null!; + + [ForeignKey("HistoryStepId")] + [InverseProperty("CmsAutomationHistoryHistorySteps")] + public virtual CmsWorkflowStep? HistoryStep { get; set; } + + [ForeignKey("HistoryTargetStepId")] + [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] + public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationState.cs b/Migration.Toolkit.KX13/Models/CmsAutomationState.cs index c4ccce89..8e480c36 100644 --- a/Migration.Toolkit.KX13/Models/CmsAutomationState.cs +++ b/Migration.Toolkit.KX13/Models/CmsAutomationState.cs @@ -1,71 +1,70 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AutomationState")] -[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] -[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] -[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] -[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] -[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] -public partial class CmsAutomationState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [Column("StateStepID")] - public int StateStepId { get; set; } - - [Column("StateObjectID")] - public int StateObjectId { get; set; } - - [StringLength(100)] - public string StateObjectType { get; set; } = null!; - - [StringLength(450)] - public string? StateActionStatus { get; set; } - - public DateTime? StateCreated { get; set; } - - public DateTime? StateLastModified { get; set; } - - [Column("StateWorkflowID")] - public int StateWorkflowId { get; set; } - - public int? StateStatus { get; set; } - - [Column("StateSiteID")] - public int? StateSiteId { get; set; } - - [Column("StateUserID")] - public int? StateUserId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public string? StateCustomData { get; set; } - - [InverseProperty("HistoryState")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [ForeignKey("StateSiteId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsSite? StateSite { get; set; } - - [ForeignKey("StateStepId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflowStep StateStep { get; set; } = null!; - - [ForeignKey("StateUserId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsUser? StateUser { get; set; } - - [ForeignKey("StateWorkflowId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflow StateWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_AutomationState")] +[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] +[Index("StateSiteId", Name = "IX_CMS_AutomationState_StateSiteID")] +[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] +[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] +[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] +public class CmsAutomationState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [Column("StateStepID")] + public int StateStepId { get; set; } + + [Column("StateObjectID")] + public int StateObjectId { get; set; } + + [StringLength(100)] + public string StateObjectType { get; set; } = null!; + + [StringLength(450)] + public string? StateActionStatus { get; set; } + + public DateTime? StateCreated { get; set; } + + public DateTime? StateLastModified { get; set; } + + [Column("StateWorkflowID")] + public int StateWorkflowId { get; set; } + + public int? StateStatus { get; set; } + + [Column("StateSiteID")] + public int? StateSiteId { get; set; } + + [Column("StateUserID")] + public int? StateUserId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public string? StateCustomData { get; set; } + + [InverseProperty("HistoryState")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [ForeignKey("StateSiteId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsSite? StateSite { get; set; } + + [ForeignKey("StateStepId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflowStep StateStep { get; set; } = null!; + + [ForeignKey("StateUserId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsUser? StateUser { get; set; } + + [ForeignKey("StateWorkflowId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflow StateWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs b/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs index 43fc5e4e..2b3b406c 100644 --- a/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs +++ b/Migration.Toolkit.KX13/Models/CmsAutomationTemplate.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_AutomationTemplate")] -[Index("TemplateDisplayName", Name = "IX_CMS_AutomationTemplate_TemplateDisplayName")] -public partial class CmsAutomationTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateConfiguration { get; set; } - - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_AutomationTemplate")] +[Index("TemplateDisplayName", Name = "IX_CMS_AutomationTemplate_TemplateDisplayName")] +public class CmsAutomationTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateConfiguration { get; set; } + + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsAvatar.cs b/Migration.Toolkit.KX13/Models/CmsAvatar.cs index be2da84f..1b400271 100644 --- a/Migration.Toolkit.KX13/Models/CmsAvatar.cs +++ b/Migration.Toolkit.KX13/Models/CmsAvatar.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Avatar")] -[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] -public partial class CmsAvatar -{ - [Key] - [Column("AvatarID")] - public int AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarName { get; set; } - - [StringLength(200)] - public string AvatarFileName { get; set; } = null!; - - [StringLength(10)] - public string AvatarFileExtension { get; set; } = null!; - - public byte[]? AvatarBinary { get; set; } - - [Column("AvatarGUID")] - public Guid AvatarGuid { get; set; } - - public DateTime AvatarLastModified { get; set; } - - [StringLength(100)] - public string AvatarMimeType { get; set; } = null!; - - public int AvatarFileSize { get; set; } - - public int? AvatarImageHeight { get; set; } - - public int? AvatarImageWidth { get; set; } - - [InverseProperty("UserAvatar")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Avatar")] +[Index("AvatarGuid", Name = "IX_CMS_Avatar_AvatarGUID")] +public class CmsAvatar +{ + [Key] + [Column("AvatarID")] + public int AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarName { get; set; } + + [StringLength(200)] + public string AvatarFileName { get; set; } = null!; + + [StringLength(10)] + public string AvatarFileExtension { get; set; } = null!; + + public byte[]? AvatarBinary { get; set; } + + [Column("AvatarGUID")] + public Guid AvatarGuid { get; set; } + + public DateTime AvatarLastModified { get; set; } + + [StringLength(100)] + public string AvatarMimeType { get; set; } = null!; + + public int AvatarFileSize { get; set; } + + public int? AvatarImageHeight { get; set; } + + public int? AvatarImageWidth { get; set; } + + [InverseProperty("UserAvatar")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsCategory.cs b/Migration.Toolkit.KX13/Models/CmsCategory.cs index b85cec14..976603c2 100644 --- a/Migration.Toolkit.KX13/Models/CmsCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsCategory.cs @@ -1,67 +1,66 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Category")] -[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] -[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] -public partial class CmsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(250)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(250)] - public string? CategoryName { get; set; } - - public string? CategoryDescription { get; set; } - - public int? CategoryCount { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryUserID")] - public int? CategoryUserId { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - [StringLength(1500)] - public string? CategoryNamePath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryOrder { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("CmsCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [ForeignKey("CategoryUserId")] - [InverseProperty("CmsCategories")] - public virtual CmsUser? CategoryUser { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("Categories")] - public virtual ICollection Documents { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Category")] +[Index("CategorySiteId", Name = "IX_CMS_Category_CategorySiteID")] +[Index("CategoryUserId", Name = "IX_CMS_Category_CategoryUserID")] +public class CmsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(250)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(250)] + public string? CategoryName { get; set; } + + public string? CategoryDescription { get; set; } + + public int? CategoryCount { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryUserID")] + public int? CategoryUserId { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + [StringLength(1500)] + public string? CategoryNamePath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryOrder { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("CmsCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [ForeignKey("CategoryUserId")] + [InverseProperty("CmsCategories")] + public virtual CmsUser? CategoryUser { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("Categories")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsClass.cs b/Migration.Toolkit.KX13/Models/CmsClass.cs index 10e3be81..82c5ee8a 100644 --- a/Migration.Toolkit.KX13/Models/CmsClass.cs +++ b/Migration.Toolkit.KX13/Models/CmsClass.cs @@ -1,196 +1,195 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Class")] -[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] -[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] -[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] -[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] -public partial class CmsClass -{ - [Key] - [Column("ClassID")] - public int ClassId { get; set; } - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - public bool ClassUsesVersioning { get; set; } - - public bool ClassIsDocumentType { get; set; } - - public bool ClassIsCoupledClass { get; set; } - - public string ClassXmlSchema { get; set; } = null!; - - public string ClassFormDefinition { get; set; } = null!; - - [StringLength(100)] - public string ClassNodeNameSource { get; set; } = null!; - - [StringLength(100)] - public string? ClassTableName { get; set; } - - public string? ClassFormLayout { get; set; } - - public bool? ClassShowAsSystemTable { get; set; } - - public bool? ClassUsePublishFromTo { get; set; } - - public bool? ClassShowTemplateSelection { get; set; } - - [Column("ClassSKUMappings")] - public string? ClassSkumappings { get; set; } - - public bool? ClassIsMenuItemType { get; set; } - - [StringLength(100)] - public string? ClassNodeAliasSource { get; set; } - - public DateTime ClassLastModified { get; set; } - - [Column("ClassGUID")] - public Guid ClassGuid { get; set; } - - [Column("ClassCreateSKU")] - public bool? ClassCreateSku { get; set; } - - public bool? ClassIsProduct { get; set; } - - public bool ClassIsCustomTable { get; set; } - - [StringLength(1000)] - public string? ClassShowColumns { get; set; } - - [StringLength(200)] - public string? ClassSearchTitleColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchContentColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchImageColumn { get; set; } - - [StringLength(200)] - public string? ClassSearchCreationDateColumn { get; set; } - - public string? ClassSearchSettings { get; set; } - - [Column("ClassInheritsFromClassID")] - public int? ClassInheritsFromClassId { get; set; } - - public bool? ClassSearchEnabled { get; set; } - - [Column("ClassSKUDefaultDepartmentName")] - [StringLength(200)] - public string? ClassSkudefaultDepartmentName { get; set; } - - [Column("ClassSKUDefaultDepartmentID")] - public int? ClassSkudefaultDepartmentId { get; set; } - - public string? ClassContactMapping { get; set; } - - public bool? ClassContactOverwriteEnabled { get; set; } - - [Column("ClassSKUDefaultProductType")] - [StringLength(50)] - public string? ClassSkudefaultProductType { get; set; } - - [StringLength(100)] - public string? ClassConnectionString { get; set; } - - public bool? ClassIsProductSection { get; set; } - - [StringLength(50)] - public string? ClassFormLayoutType { get; set; } - - [Column("ClassVersionGUID")] - [StringLength(50)] - public string? ClassVersionGuid { get; set; } - - [StringLength(100)] - public string? ClassDefaultObjectType { get; set; } - - public bool? ClassIsForm { get; set; } - - [Column("ClassResourceID")] - public int? ClassResourceId { get; set; } - - [StringLength(400)] - public string? ClassCustomizedColumns { get; set; } - - public string? ClassCodeGenerationSettings { get; set; } - - [StringLength(200)] - public string? ClassIconClass { get; set; } - - [Column("ClassURLPattern")] - [StringLength(200)] - public string? ClassUrlpattern { get; set; } - - public bool ClassUsesPageBuilder { get; set; } - - public bool ClassIsNavigationItem { get; set; } - - [Column("ClassHasURL")] - public bool ClassHasUrl { get; set; } - - public bool ClassHasMetadata { get; set; } - - public int? ClassSearchIndexDataSource { get; set; } - - [ForeignKey("ClassResourceId")] - [InverseProperty("CmsClasses")] - public virtual CmsResource? ClassResource { get; set; } - - [InverseProperty("FormClass")] - public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); - - [InverseProperty("FormCoupledClass")] - public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); - - [InverseProperty("FormClass")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsQueries { get; set; } = new List(); - - [InverseProperty("TransformationClass")] - public virtual ICollection CmsTransformations { get; set; } = new List(); - - [InverseProperty("NodeClass")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("VersionClass")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeClass")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("ParentClassId")] - [InverseProperty("ParentClasses")] - public virtual ICollection ChildClasses { get; set; } = new List(); - - [ForeignKey("ChildClassId")] - [InverseProperty("ChildClasses")] - public virtual ICollection ParentClasses { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Scopes { get; set; } = new List(); - - [ForeignKey("ClassId")] - [InverseProperty("Classes")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Class")] +[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] +[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] +[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] +[Index("ClassShowAsSystemTable", "ClassIsCustomTable", "ClassIsCoupledClass", "ClassIsDocumentType", Name = "IX_CMS_Class_ClassShowAsSystemTable_ClassIsCustomTable_ClassIsCoupledClass_ClassIsDocumentType")] +public class CmsClass +{ + [Key] + [Column("ClassID")] + public int ClassId { get; set; } + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + public bool ClassUsesVersioning { get; set; } + + public bool ClassIsDocumentType { get; set; } + + public bool ClassIsCoupledClass { get; set; } + + public string ClassXmlSchema { get; set; } = null!; + + public string ClassFormDefinition { get; set; } = null!; + + [StringLength(100)] + public string ClassNodeNameSource { get; set; } = null!; + + [StringLength(100)] + public string? ClassTableName { get; set; } + + public string? ClassFormLayout { get; set; } + + public bool? ClassShowAsSystemTable { get; set; } + + public bool? ClassUsePublishFromTo { get; set; } + + public bool? ClassShowTemplateSelection { get; set; } + + [Column("ClassSKUMappings")] + public string? ClassSkumappings { get; set; } + + public bool? ClassIsMenuItemType { get; set; } + + [StringLength(100)] + public string? ClassNodeAliasSource { get; set; } + + public DateTime ClassLastModified { get; set; } + + [Column("ClassGUID")] + public Guid ClassGuid { get; set; } + + [Column("ClassCreateSKU")] + public bool? ClassCreateSku { get; set; } + + public bool? ClassIsProduct { get; set; } + + public bool ClassIsCustomTable { get; set; } + + [StringLength(1000)] + public string? ClassShowColumns { get; set; } + + [StringLength(200)] + public string? ClassSearchTitleColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchContentColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchImageColumn { get; set; } + + [StringLength(200)] + public string? ClassSearchCreationDateColumn { get; set; } + + public string? ClassSearchSettings { get; set; } + + [Column("ClassInheritsFromClassID")] + public int? ClassInheritsFromClassId { get; set; } + + public bool? ClassSearchEnabled { get; set; } + + [Column("ClassSKUDefaultDepartmentName")] + [StringLength(200)] + public string? ClassSkudefaultDepartmentName { get; set; } + + [Column("ClassSKUDefaultDepartmentID")] + public int? ClassSkudefaultDepartmentId { get; set; } + + public string? ClassContactMapping { get; set; } + + public bool? ClassContactOverwriteEnabled { get; set; } + + [Column("ClassSKUDefaultProductType")] + [StringLength(50)] + public string? ClassSkudefaultProductType { get; set; } + + [StringLength(100)] + public string? ClassConnectionString { get; set; } + + public bool? ClassIsProductSection { get; set; } + + [StringLength(50)] + public string? ClassFormLayoutType { get; set; } + + [Column("ClassVersionGUID")] + [StringLength(50)] + public string? ClassVersionGuid { get; set; } + + [StringLength(100)] + public string? ClassDefaultObjectType { get; set; } + + public bool? ClassIsForm { get; set; } + + [Column("ClassResourceID")] + public int? ClassResourceId { get; set; } + + [StringLength(400)] + public string? ClassCustomizedColumns { get; set; } + + public string? ClassCodeGenerationSettings { get; set; } + + [StringLength(200)] + public string? ClassIconClass { get; set; } + + [Column("ClassURLPattern")] + [StringLength(200)] + public string? ClassUrlpattern { get; set; } + + public bool ClassUsesPageBuilder { get; set; } + + public bool ClassIsNavigationItem { get; set; } + + [Column("ClassHasURL")] + public bool ClassHasUrl { get; set; } + + public bool ClassHasMetadata { get; set; } + + public int? ClassSearchIndexDataSource { get; set; } + + [ForeignKey("ClassResourceId")] + [InverseProperty("CmsClasses")] + public virtual CmsResource? ClassResource { get; set; } + + [InverseProperty("FormClass")] + public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); + + [InverseProperty("FormCoupledClass")] + public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); + + [InverseProperty("FormClass")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsQueries { get; set; } = new List(); + + [InverseProperty("TransformationClass")] + public virtual ICollection CmsTransformations { get; set; } = new List(); + + [InverseProperty("NodeClass")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("VersionClass")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeClass")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("ParentClassId")] + [InverseProperty("ParentClasses")] + public virtual ICollection ChildClasses { get; set; } = new List(); + + [ForeignKey("ChildClassId")] + [InverseProperty("ChildClasses")] + public virtual ICollection ParentClasses { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Scopes { get; set; } = new List(); + + [ForeignKey("ClassId")] + [InverseProperty("Classes")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsConsent.cs b/Migration.Toolkit.KX13/Models/CmsConsent.cs index fd93e053..aa737033 100644 --- a/Migration.Toolkit.KX13/Models/CmsConsent.cs +++ b/Migration.Toolkit.KX13/Models/CmsConsent.cs @@ -1,36 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Consent")] -public partial class CmsConsent -{ - [Key] - [Column("ConsentID")] - public int ConsentId { get; set; } - - [StringLength(200)] - public string ConsentDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ConsentName { get; set; } = null!; - - public string ConsentContent { get; set; } = null!; - - public Guid ConsentGuid { get; set; } - - public DateTime ConsentLastModified { get; set; } - - [StringLength(100)] - public string ConsentHash { get; set; } = null!; - - [InverseProperty("ConsentAgreementConsent")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [InverseProperty("ConsentArchiveConsent")] - public virtual ICollection CmsConsentArchives { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Consent")] +public class CmsConsent +{ + [Key] + [Column("ConsentID")] + public int ConsentId { get; set; } + + [StringLength(200)] + public string ConsentDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ConsentName { get; set; } = null!; + + public string ConsentContent { get; set; } = null!; + + public Guid ConsentGuid { get; set; } + + public DateTime ConsentLastModified { get; set; } + + [StringLength(100)] + public string ConsentHash { get; set; } = null!; + + [InverseProperty("ConsentAgreementConsent")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [InverseProperty("ConsentArchiveConsent")] + public virtual ICollection CmsConsentArchives { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs index 600a12ca..a5cc26df 100644 --- a/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs +++ b/Migration.Toolkit.KX13/Models/CmsConsentAgreement.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ConsentAgreement")] -[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] -public partial class CmsConsentAgreement -{ - [Key] - [Column("ConsentAgreementID")] - public int ConsentAgreementId { get; set; } - - public Guid ConsentAgreementGuid { get; set; } - - public bool ConsentAgreementRevoked { get; set; } - - [Column("ConsentAgreementContactID")] - public int ConsentAgreementContactId { get; set; } - - [Column("ConsentAgreementConsentID")] - public int ConsentAgreementConsentId { get; set; } - - [StringLength(100)] - public string? ConsentAgreementConsentHash { get; set; } - - public DateTime ConsentAgreementTime { get; set; } - - [ForeignKey("ConsentAgreementConsentId")] - [InverseProperty("CmsConsentAgreements")] - public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; - - [ForeignKey("ConsentAgreementContactId")] - [InverseProperty("CmsConsentAgreements")] - public virtual OmContact ConsentAgreementContact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ConsentAgreement")] +[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] +public class CmsConsentAgreement +{ + [Key] + [Column("ConsentAgreementID")] + public int ConsentAgreementId { get; set; } + + public Guid ConsentAgreementGuid { get; set; } + + public bool ConsentAgreementRevoked { get; set; } + + [Column("ConsentAgreementContactID")] + public int ConsentAgreementContactId { get; set; } + + [Column("ConsentAgreementConsentID")] + public int ConsentAgreementConsentId { get; set; } + + [StringLength(100)] + public string? ConsentAgreementConsentHash { get; set; } + + public DateTime ConsentAgreementTime { get; set; } + + [ForeignKey("ConsentAgreementConsentId")] + [InverseProperty("CmsConsentAgreements")] + public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; + + [ForeignKey("ConsentAgreementContactId")] + [InverseProperty("CmsConsentAgreements")] + public virtual OmContact ConsentAgreementContact { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs b/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs index 992ad780..2482109f 100644 --- a/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs +++ b/Migration.Toolkit.KX13/Models/CmsConsentArchive.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ConsentArchive")] -[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] -public partial class CmsConsentArchive -{ - [Key] - [Column("ConsentArchiveID")] - public int ConsentArchiveId { get; set; } - - public Guid ConsentArchiveGuid { get; set; } - - public DateTime ConsentArchiveLastModified { get; set; } - - [Column("ConsentArchiveConsentID")] - public int ConsentArchiveConsentId { get; set; } - - [StringLength(100)] - public string ConsentArchiveHash { get; set; } = null!; - - public string ConsentArchiveContent { get; set; } = null!; - - [ForeignKey("ConsentArchiveConsentId")] - [InverseProperty("CmsConsentArchives")] - public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ConsentArchive")] +[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] +public class CmsConsentArchive +{ + [Key] + [Column("ConsentArchiveID")] + public int ConsentArchiveId { get; set; } + + public Guid ConsentArchiveGuid { get; set; } + + public DateTime ConsentArchiveLastModified { get; set; } + + [Column("ConsentArchiveConsentID")] + public int ConsentArchiveConsentId { get; set; } + + [StringLength(100)] + public string ConsentArchiveHash { get; set; } = null!; + + public string ConsentArchiveContent { get; set; } = null!; + + [ForeignKey("ConsentArchiveConsentId")] + [InverseProperty("CmsConsentArchives")] + public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsCountry.cs b/Migration.Toolkit.KX13/Models/CmsCountry.cs index 83f7bcbb..6b8f4f09 100644 --- a/Migration.Toolkit.KX13/Models/CmsCountry.cs +++ b/Migration.Toolkit.KX13/Models/CmsCountry.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Country")] -public partial class CmsCountry -{ - [Key] - [Column("CountryID")] - public int CountryId { get; set; } - - [StringLength(200)] - public string CountryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CountryName { get; set; } = null!; - - [Column("CountryGUID")] - public Guid CountryGuid { get; set; } - - public DateTime CountryLastModified { get; set; } - - [StringLength(2)] - public string? CountryTwoLetterCode { get; set; } - - [StringLength(3)] - public string? CountryThreeLetterCode { get; set; } - - [InverseProperty("Country")] - public virtual ICollection CmsStates { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressCountry")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("Country")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("AccountCountry")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactCountry")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Country")] +public class CmsCountry +{ + [Key] + [Column("CountryID")] + public int CountryId { get; set; } + + [StringLength(200)] + public string CountryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CountryName { get; set; } = null!; + + [Column("CountryGUID")] + public Guid CountryGuid { get; set; } + + public DateTime CountryLastModified { get; set; } + + [StringLength(2)] + public string? CountryTwoLetterCode { get; set; } + + [StringLength(3)] + public string? CountryThreeLetterCode { get; set; } + + [InverseProperty("Country")] + public virtual ICollection CmsStates { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressCountry")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("Country")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("AccountCountry")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactCountry")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsCulture.cs b/Migration.Toolkit.KX13/Models/CmsCulture.cs index fc6dcf1d..9c89ab8b 100644 --- a/Migration.Toolkit.KX13/Models/CmsCulture.cs +++ b/Migration.Toolkit.KX13/Models/CmsCulture.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Culture")] -[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] -[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] -public partial class CmsCulture -{ - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; - - [StringLength(200)] - public string CultureShortName { get; set; } = null!; - - [Column("CultureGUID")] - public Guid CultureGuid { get; set; } - - public DateTime CultureLastModified { get; set; } - - [StringLength(100)] - public string? CultureAlias { get; set; } - - [Column("CultureIsUICulture")] - public bool? CultureIsUiculture { get; set; } - - [InverseProperty("TranslationCulture")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); - - [InverseProperty("Culture")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("ScopeCulture")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [ForeignKey("IndexCultureId")] - [InverseProperty("IndexCultures")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("CultureId")] - [InverseProperty("Cultures")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Culture")] +[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] +[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] +public class CmsCulture +{ + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; + + [StringLength(200)] + public string CultureShortName { get; set; } = null!; + + [Column("CultureGUID")] + public Guid CultureGuid { get; set; } + + public DateTime CultureLastModified { get; set; } + + [StringLength(100)] + public string? CultureAlias { get; set; } + + [Column("CultureIsUICulture")] + public bool? CultureIsUiculture { get; set; } + + [InverseProperty("TranslationCulture")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); + + [InverseProperty("Culture")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("ScopeCulture")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [ForeignKey("IndexCultureId")] + [InverseProperty("IndexCultures")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("CultureId")] + [InverseProperty("Cultures")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsDocument.cs b/Migration.Toolkit.KX13/Models/CmsDocument.cs index 28c78d4d..1f39f3b7 100644 --- a/Migration.Toolkit.KX13/Models/CmsDocument.cs +++ b/Migration.Toolkit.KX13/Models/CmsDocument.cs @@ -1,167 +1,166 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Document")] -[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] -[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] -[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] -[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] -[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] -[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] -[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] -[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] -[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] -[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] -public partial class CmsDocument -{ - [Key] - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - [StringLength(50)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public string? DocumentContent { get; set; } - - public string? DocumentCustomData { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - [Required] - public bool? DocumentCanBePublished { get; set; } - - public string? DocumentPageBuilderWidgets { get; set; } - - public string? DocumentPageTemplateConfiguration { get; set; } - - [Column("DocumentABTestConfiguration")] - public string? DocumentAbtestConfiguration { get; set; } - - public bool DocumentShowInMenu { get; set; } - - [InverseProperty("AlternativeUrlDocument")] - public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); - - [InverseProperty("AttachmentDocument")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [ForeignKey("DocumentCheckedOutByUserId")] - [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] - public virtual CmsUser? DocumentCheckedOutByUser { get; set; } - - [ForeignKey("DocumentCheckedOutVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] - public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } - - [ForeignKey("DocumentCreatedByUserId")] - [InverseProperty("CmsDocumentDocumentCreatedByUsers")] - public virtual CmsUser? DocumentCreatedByUser { get; set; } - - [ForeignKey("DocumentModifiedByUserId")] - [InverseProperty("CmsDocumentDocumentModifiedByUsers")] - public virtual CmsUser? DocumentModifiedByUser { get; set; } - - [ForeignKey("DocumentNodeId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTree DocumentNode { get; set; } = null!; - - [ForeignKey("DocumentPublishedVersionHistoryId")] - [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] - public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } - - [ForeignKey("DocumentTagGroupId")] - [InverseProperty("CmsDocuments")] - public virtual CmsTagGroup? DocumentTagGroup { get; set; } - - [ForeignKey("DocumentWorkflowStepId")] - [InverseProperty("CmsDocuments")] - public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Categories { get; set; } = new List(); - - [ForeignKey("DocumentId")] - [InverseProperty("Documents")] - public virtual ICollection Tags { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Document")] +[Index("DocumentCheckedOutByUserId", Name = "IX_CMS_Document_DocumentCheckedOutByUserID")] +[Index("DocumentCheckedOutVersionHistoryId", Name = "IX_CMS_Document_DocumentCheckedOutVersionHistoryID")] +[Index("DocumentCreatedByUserId", Name = "IX_CMS_Document_DocumentCreatedByUserID")] +[Index("DocumentCulture", Name = "IX_CMS_Document_DocumentCulture")] +[Index("DocumentForeignKeyValue", "DocumentId", "DocumentNodeId", Name = "IX_CMS_Document_DocumentForeignKeyValue_DocumentID_DocumentNodeID")] +[Index("DocumentModifiedByUserId", Name = "IX_CMS_Document_DocumentModifiedByUserID")] +[Index("DocumentNodeId", "DocumentId", "DocumentCulture", Name = "IX_CMS_Document_DocumentNodeID_DocumentID_DocumentCulture", IsUnique = true)] +[Index("DocumentPublishedVersionHistoryId", Name = "IX_CMS_Document_DocumentPublishedVersionHistoryID")] +[Index("DocumentTagGroupId", Name = "IX_CMS_Document_DocumentTagGroupID")] +[Index("DocumentWorkflowStepId", Name = "IX_CMS_Document_DocumentWorkflowStepID")] +public class CmsDocument +{ + [Key] + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + [StringLength(50)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public string? DocumentContent { get; set; } + + public string? DocumentCustomData { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + [Required] + public bool? DocumentCanBePublished { get; set; } + + public string? DocumentPageBuilderWidgets { get; set; } + + public string? DocumentPageTemplateConfiguration { get; set; } + + [Column("DocumentABTestConfiguration")] + public string? DocumentAbtestConfiguration { get; set; } + + public bool DocumentShowInMenu { get; set; } + + [InverseProperty("AlternativeUrlDocument")] + public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); + + [InverseProperty("AttachmentDocument")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [ForeignKey("DocumentCheckedOutByUserId")] + [InverseProperty("CmsDocumentDocumentCheckedOutByUsers")] + public virtual CmsUser? DocumentCheckedOutByUser { get; set; } + + [ForeignKey("DocumentCheckedOutVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentCheckedOutVersionHistories")] + public virtual CmsVersionHistory? DocumentCheckedOutVersionHistory { get; set; } + + [ForeignKey("DocumentCreatedByUserId")] + [InverseProperty("CmsDocumentDocumentCreatedByUsers")] + public virtual CmsUser? DocumentCreatedByUser { get; set; } + + [ForeignKey("DocumentModifiedByUserId")] + [InverseProperty("CmsDocumentDocumentModifiedByUsers")] + public virtual CmsUser? DocumentModifiedByUser { get; set; } + + [ForeignKey("DocumentNodeId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTree DocumentNode { get; set; } = null!; + + [ForeignKey("DocumentPublishedVersionHistoryId")] + [InverseProperty("CmsDocumentDocumentPublishedVersionHistories")] + public virtual CmsVersionHistory? DocumentPublishedVersionHistory { get; set; } + + [ForeignKey("DocumentTagGroupId")] + [InverseProperty("CmsDocuments")] + public virtual CmsTagGroup? DocumentTagGroup { get; set; } + + [ForeignKey("DocumentWorkflowStepId")] + [InverseProperty("CmsDocuments")] + public virtual CmsWorkflowStep? DocumentWorkflowStep { get; set; } + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Categories { get; set; } = new List(); + + [ForeignKey("DocumentId")] + [InverseProperty("Documents")] + public virtual ICollection Tags { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs b/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs index 58baa1b3..504cf013 100644 --- a/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs +++ b/Migration.Toolkit.KX13/Models/CmsDocumentTypeScope.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_DocumentTypeScope")] -[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] -public partial class CmsDocumentTypeScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopePath { get; set; } = null!; - - [Column("ScopeSiteID")] - public int? ScopeSiteId { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeGUID")] - public Guid? ScopeGuid { get; set; } - - public bool? ScopeIncludeChildren { get; set; } - - public bool? ScopeAllowAllTypes { get; set; } - - public bool? ScopeAllowLinks { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsDocumentTypeScopes")] - public virtual CmsSite? ScopeSite { get; set; } - - [ForeignKey("ScopeId")] - [InverseProperty("Scopes")] - public virtual ICollection Classes { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_DocumentTypeScope")] +[Index("ScopeSiteId", Name = "IX_CMS_DocumentTypeScope_ScopeSiteID")] +public class CmsDocumentTypeScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopePath { get; set; } = null!; + + [Column("ScopeSiteID")] + public int? ScopeSiteId { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeGUID")] + public Guid? ScopeGuid { get; set; } + + public bool? ScopeIncludeChildren { get; set; } + + public bool? ScopeAllowAllTypes { get; set; } + + public bool? ScopeAllowLinks { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsDocumentTypeScopes")] + public virtual CmsSite? ScopeSite { get; set; } + + [ForeignKey("ScopeId")] + [InverseProperty("Scopes")] + public virtual ICollection Classes { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsEmail.cs b/Migration.Toolkit.KX13/Models/CmsEmail.cs index e92da4d8..92315eb1 100644 --- a/Migration.Toolkit.KX13/Models/CmsEmail.cs +++ b/Migration.Toolkit.KX13/Models/CmsEmail.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Email")] -[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] -public partial class CmsEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [StringLength(254)] - public string EmailFrom { get; set; } = null!; - - [StringLength(998)] - public string? EmailTo { get; set; } - - [StringLength(998)] - public string? EmailCc { get; set; } - - [StringLength(998)] - public string? EmailBcc { get; set; } - - [StringLength(450)] - public string EmailSubject { get; set; } = null!; - - public string? EmailBody { get; set; } - - public string? EmailPlainTextBody { get; set; } - - public int EmailFormat { get; set; } - - public int EmailPriority { get; set; } - - [Column("EmailSiteID")] - public int? EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - public DateTime EmailLastModified { get; set; } - - public int? EmailStatus { get; set; } - - public bool? EmailIsMass { get; set; } - - [StringLength(254)] - public string? EmailReplyTo { get; set; } - - public string? EmailHeaders { get; set; } - - public DateTime? EmailCreated { get; set; } - - [InverseProperty("Email")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [ForeignKey("EmailId")] - [InverseProperty("Emails")] - public virtual ICollection Attachments { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Email")] +[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] +public class CmsEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [StringLength(254)] + public string EmailFrom { get; set; } = null!; + + [StringLength(998)] + public string? EmailTo { get; set; } + + [StringLength(998)] + public string? EmailCc { get; set; } + + [StringLength(998)] + public string? EmailBcc { get; set; } + + [StringLength(450)] + public string EmailSubject { get; set; } = null!; + + public string? EmailBody { get; set; } + + public string? EmailPlainTextBody { get; set; } + + public int EmailFormat { get; set; } + + public int EmailPriority { get; set; } + + [Column("EmailSiteID")] + public int? EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + public DateTime EmailLastModified { get; set; } + + public int? EmailStatus { get; set; } + + public bool? EmailIsMass { get; set; } + + [StringLength(254)] + public string? EmailReplyTo { get; set; } + + public string? EmailHeaders { get; set; } + + public DateTime? EmailCreated { get; set; } + + [InverseProperty("Email")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [ForeignKey("EmailId")] + [InverseProperty("Emails")] + public virtual ICollection Attachments { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs index 1fc14af8..ca006388 100644 --- a/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs +++ b/Migration.Toolkit.KX13/Models/CmsEmailAttachment.cs @@ -1,44 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_EmailAttachment")] -public partial class CmsEmailAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[] AttachmentBinary { get; set; } = null!; - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [Column("AttachmentContentID")] - [StringLength(255)] - public string? AttachmentContentId { get; set; } - - [Column("AttachmentSiteID")] - public int? AttachmentSiteId { get; set; } - - [ForeignKey("AttachmentId")] - [InverseProperty("Attachments")] - public virtual ICollection Emails { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_EmailAttachment")] +public class CmsEmailAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[] AttachmentBinary { get; set; } = null!; + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [Column("AttachmentContentID")] + [StringLength(255)] + public string? AttachmentContentId { get; set; } + + [Column("AttachmentSiteID")] + public int? AttachmentSiteId { get; set; } + + [ForeignKey("AttachmentId")] + [InverseProperty("Attachments")] + public virtual ICollection Emails { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs b/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs index bfdf56ed..329a7dec 100644 --- a/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs +++ b/Migration.Toolkit.KX13/Models/CmsEmailTemplate.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_EmailTemplate")] -[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] -[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] -public partial class CmsEmailTemplate -{ - [Key] - [Column("EmailTemplateID")] - public int EmailTemplateId { get; set; } - - [StringLength(200)] - public string EmailTemplateName { get; set; } = null!; - - [StringLength(200)] - public string EmailTemplateDisplayName { get; set; } = null!; - - public string? EmailTemplateText { get; set; } - - [Column("EmailTemplateSiteID")] - public int? EmailTemplateSiteId { get; set; } - - [Column("EmailTemplateGUID")] - public Guid EmailTemplateGuid { get; set; } - - public DateTime EmailTemplateLastModified { get; set; } - - public string? EmailTemplatePlainText { get; set; } - - [StringLength(250)] - public string? EmailTemplateSubject { get; set; } - - [StringLength(254)] - public string? EmailTemplateFrom { get; set; } - - [StringLength(998)] - public string? EmailTemplateCc { get; set; } - - [StringLength(998)] - public string? EmailTemplateBcc { get; set; } - - [StringLength(100)] - public string? EmailTemplateType { get; set; } - - public string? EmailTemplateDescription { get; set; } - - [StringLength(254)] - public string? EmailTemplateReplyTo { get; set; } - - [ForeignKey("EmailTemplateSiteId")] - [InverseProperty("CmsEmailTemplates")] - public virtual CmsSite? EmailTemplateSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_EmailTemplate")] +[Index("EmailTemplateName", "EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateName_EmailTemplateSiteID")] +[Index("EmailTemplateSiteId", Name = "IX_CMS_EmailTemplate_EmailTemplateSiteID")] +public class CmsEmailTemplate +{ + [Key] + [Column("EmailTemplateID")] + public int EmailTemplateId { get; set; } + + [StringLength(200)] + public string EmailTemplateName { get; set; } = null!; + + [StringLength(200)] + public string EmailTemplateDisplayName { get; set; } = null!; + + public string? EmailTemplateText { get; set; } + + [Column("EmailTemplateSiteID")] + public int? EmailTemplateSiteId { get; set; } + + [Column("EmailTemplateGUID")] + public Guid EmailTemplateGuid { get; set; } + + public DateTime EmailTemplateLastModified { get; set; } + + public string? EmailTemplatePlainText { get; set; } + + [StringLength(250)] + public string? EmailTemplateSubject { get; set; } + + [StringLength(254)] + public string? EmailTemplateFrom { get; set; } + + [StringLength(998)] + public string? EmailTemplateCc { get; set; } + + [StringLength(998)] + public string? EmailTemplateBcc { get; set; } + + [StringLength(100)] + public string? EmailTemplateType { get; set; } + + public string? EmailTemplateDescription { get; set; } + + [StringLength(254)] + public string? EmailTemplateReplyTo { get; set; } + + [ForeignKey("EmailTemplateSiteId")] + [InverseProperty("CmsEmailTemplates")] + public virtual CmsSite? EmailTemplateSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsEmailUser.cs b/Migration.Toolkit.KX13/Models/CmsEmailUser.cs index 6c09f303..f116ce1e 100644 --- a/Migration.Toolkit.KX13/Models/CmsEmailUser.cs +++ b/Migration.Toolkit.KX13/Models/CmsEmailUser.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("EmailId", "UserId")] -[Table("CMS_EmailUser")] -[Index("Status", Name = "IX_CMS_EmailUser_Status")] -[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] -public partial class CmsEmailUser -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Key] - [Column("UserID")] - public int UserId { get; set; } - - public string? LastSendResult { get; set; } - - public DateTime? LastSendAttempt { get; set; } - - public int? Status { get; set; } - - [ForeignKey("EmailId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsEmail Email { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsEmailUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("EmailId", "UserId")] +[Table("CMS_EmailUser")] +[Index("Status", Name = "IX_CMS_EmailUser_Status")] +[Index("UserId", Name = "IX_CMS_EmailUser_UserID")] +public class CmsEmailUser +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Key] + [Column("UserID")] + public int UserId { get; set; } + + public string? LastSendResult { get; set; } + + public DateTime? LastSendAttempt { get; set; } + + public int? Status { get; set; } + + [ForeignKey("EmailId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsEmail Email { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsEmailUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsEventLog.cs b/Migration.Toolkit.KX13/Models/CmsEventLog.cs index 6f5a4094..7aa81ace 100644 --- a/Migration.Toolkit.KX13/Models/CmsEventLog.cs +++ b/Migration.Toolkit.KX13/Models/CmsEventLog.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_EventLog")] -[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] -public partial class CmsEventLog -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(5)] - public string EventType { get; set; } = null!; - - public DateTime EventTime { get; set; } - - [StringLength(100)] - public string Source { get; set; } = null!; - - [StringLength(100)] - public string EventCode { get; set; } = null!; - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(250)] - public string? UserName { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string? Ipaddress { get; set; } - - [Column("NodeID")] - public int? NodeId { get; set; } - - [StringLength(100)] - public string? DocumentName { get; set; } - - public string? EventDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - public string? EventUrl { get; set; } - - [StringLength(100)] - public string? EventMachineName { get; set; } - - public string? EventUserAgent { get; set; } - - public string? EventUrlReferrer { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_EventLog")] +[Index("SiteId", Name = "IX_CMS_EventLog_SiteID")] +public class CmsEventLog +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(5)] + public string EventType { get; set; } = null!; + + public DateTime EventTime { get; set; } + + [StringLength(100)] + public string Source { get; set; } = null!; + + [StringLength(100)] + public string EventCode { get; set; } = null!; + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(250)] + public string? UserName { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string? Ipaddress { get; set; } + + [Column("NodeID")] + public int? NodeId { get; set; } + + [StringLength(100)] + public string? DocumentName { get; set; } + + public string? EventDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + public string? EventUrl { get; set; } + + [StringLength(100)] + public string? EventMachineName { get; set; } + + public string? EventUserAgent { get; set; } + + public string? EventUrlReferrer { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs b/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs index c4a61e1f..3c562d6a 100644 --- a/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs +++ b/Migration.Toolkit.KX13/Models/CmsExternalLogin.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ExternalLogin")] -[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] -public partial class CmsExternalLogin -{ - [Key] - [Column("ExternalLoginID")] - public int ExternalLoginId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(200)] - public string? LoginProvider { get; set; } - - [StringLength(200)] - public string? IdentityKey { get; set; } - - [ForeignKey("UserId")] - [InverseProperty("CmsExternalLogins")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ExternalLogin")] +[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] +public class CmsExternalLogin +{ + [Key] + [Column("ExternalLoginID")] + public int ExternalLoginId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(200)] + public string? LoginProvider { get; set; } + + [StringLength(200)] + public string? IdentityKey { get; set; } + + [ForeignKey("UserId")] + [InverseProperty("CmsExternalLogins")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsForm.cs b/Migration.Toolkit.KX13/Models/CmsForm.cs index 49dd2941..364a9ff5 100644 --- a/Migration.Toolkit.KX13/Models/CmsForm.cs +++ b/Migration.Toolkit.KX13/Models/CmsForm.cs @@ -1,94 +1,93 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Form")] -[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] -[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] -public partial class CmsForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(100)] - public string FormName { get; set; } = null!; - - [StringLength(998)] - public string? FormSendToEmail { get; set; } - - [StringLength(254)] - public string? FormSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormEmailSubject { get; set; } - - public string? FormEmailTemplate { get; set; } - - public bool? FormEmailAttachUploadedDocs { get; set; } - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public int FormItems { get; set; } - - public string? FormReportFields { get; set; } - - [StringLength(400)] - public string? FormRedirectToUrl { get; set; } - - public string? FormDisplayText { get; set; } - - public bool FormClearAfterSave { get; set; } - - [StringLength(400)] - public string? FormSubmitButtonText { get; set; } - - [Column("FormSiteID")] - public int FormSiteId { get; set; } - - [StringLength(254)] - public string? FormConfirmationEmailField { get; set; } - - public string? FormConfirmationTemplate { get; set; } - - [StringLength(254)] - public string? FormConfirmationSendFromEmail { get; set; } - - [StringLength(250)] - public string? FormConfirmationEmailSubject { get; set; } - - public int? FormAccess { get; set; } - - [StringLength(255)] - public string? FormSubmitButtonImage { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Required] - public bool? FormLogActivity { get; set; } - - public string? FormBuilderLayout { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsForms")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormSiteId")] - [InverseProperty("CmsForms")] - public virtual CmsSite FormSite { get; set; } = null!; - - [ForeignKey("FormId")] - [InverseProperty("Forms")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Form")] +[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] +[Index("FormSiteId", Name = "IX_CMS_Form_FormSiteID")] +public class CmsForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(100)] + public string FormName { get; set; } = null!; + + [StringLength(998)] + public string? FormSendToEmail { get; set; } + + [StringLength(254)] + public string? FormSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormEmailSubject { get; set; } + + public string? FormEmailTemplate { get; set; } + + public bool? FormEmailAttachUploadedDocs { get; set; } + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public int FormItems { get; set; } + + public string? FormReportFields { get; set; } + + [StringLength(400)] + public string? FormRedirectToUrl { get; set; } + + public string? FormDisplayText { get; set; } + + public bool FormClearAfterSave { get; set; } + + [StringLength(400)] + public string? FormSubmitButtonText { get; set; } + + [Column("FormSiteID")] + public int FormSiteId { get; set; } + + [StringLength(254)] + public string? FormConfirmationEmailField { get; set; } + + public string? FormConfirmationTemplate { get; set; } + + [StringLength(254)] + public string? FormConfirmationSendFromEmail { get; set; } + + [StringLength(250)] + public string? FormConfirmationEmailSubject { get; set; } + + public int? FormAccess { get; set; } + + [StringLength(255)] + public string? FormSubmitButtonImage { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Required] + public bool? FormLogActivity { get; set; } + + public string? FormBuilderLayout { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsForms")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormSiteId")] + [InverseProperty("CmsForms")] + public virtual CmsSite FormSite { get; set; } = null!; + + [ForeignKey("FormId")] + [InverseProperty("Forms")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs b/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs index 25ec5cfd..2080ad41 100644 --- a/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs +++ b/Migration.Toolkit.KX13/Models/CmsFormUserControl.cs @@ -1,95 +1,94 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_FormUserControl")] -[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] -[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] -[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] -public partial class CmsFormUserControl -{ - [Key] - [Column("UserControlID")] - public int UserControlId { get; set; } - - [StringLength(200)] - public string UserControlDisplayName { get; set; } = null!; - - [StringLength(200)] - public string UserControlCodeName { get; set; } = null!; - - [StringLength(400)] - public string UserControlFileName { get; set; } = null!; - - public bool UserControlForText { get; set; } - - public bool UserControlForLongText { get; set; } - - public bool UserControlForInteger { get; set; } - - public bool UserControlForDecimal { get; set; } - - public bool UserControlForDateTime { get; set; } - - public bool UserControlForBoolean { get; set; } - - public bool UserControlForFile { get; set; } - - public bool? UserControlShowInDocumentTypes { get; set; } - - public bool? UserControlShowInSystemTables { get; set; } - - public bool? UserControlShowInWebParts { get; set; } - - public bool? UserControlShowInReports { get; set; } - - [Column("UserControlGUID")] - public Guid UserControlGuid { get; set; } - - public DateTime UserControlLastModified { get; set; } - - public bool UserControlForGuid { get; set; } - - public bool? UserControlShowInCustomTables { get; set; } - - public string? UserControlParameters { get; set; } - - public bool UserControlForDocAttachments { get; set; } - - [Column("UserControlResourceID")] - public int? UserControlResourceId { get; set; } - - [Column("UserControlParentID")] - public int? UserControlParentId { get; set; } - - public string? UserControlDescription { get; set; } - - public int? UserControlPriority { get; set; } - - public bool? UserControlIsSystem { get; set; } - - public bool UserControlForBinary { get; set; } - - public bool UserControlForDocRelationships { get; set; } - - [StringLength(200)] - public string? UserControlAssemblyName { get; set; } - - [StringLength(200)] - public string? UserControlClassName { get; set; } - - [InverseProperty("UserControlParent")] - public virtual ICollection InverseUserControlParent { get; set; } = new List(); - - [ForeignKey("UserControlParentId")] - [InverseProperty("InverseUserControlParent")] - public virtual CmsFormUserControl? UserControlParent { get; set; } - - [ForeignKey("UserControlResourceId")] - [InverseProperty("CmsFormUserControls")] - public virtual CmsResource? UserControlResource { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_FormUserControl")] +[Index("UserControlCodeName", Name = "IX_CMS_FormUserControl_UserControlCodeName", IsUnique = true)] +[Index("UserControlParentId", Name = "IX_CMS_FormUserControl_UserControlParentID")] +[Index("UserControlResourceId", Name = "IX_CMS_FormUserControl_UserControlResourceID")] +public class CmsFormUserControl +{ + [Key] + [Column("UserControlID")] + public int UserControlId { get; set; } + + [StringLength(200)] + public string UserControlDisplayName { get; set; } = null!; + + [StringLength(200)] + public string UserControlCodeName { get; set; } = null!; + + [StringLength(400)] + public string UserControlFileName { get; set; } = null!; + + public bool UserControlForText { get; set; } + + public bool UserControlForLongText { get; set; } + + public bool UserControlForInteger { get; set; } + + public bool UserControlForDecimal { get; set; } + + public bool UserControlForDateTime { get; set; } + + public bool UserControlForBoolean { get; set; } + + public bool UserControlForFile { get; set; } + + public bool? UserControlShowInDocumentTypes { get; set; } + + public bool? UserControlShowInSystemTables { get; set; } + + public bool? UserControlShowInWebParts { get; set; } + + public bool? UserControlShowInReports { get; set; } + + [Column("UserControlGUID")] + public Guid UserControlGuid { get; set; } + + public DateTime UserControlLastModified { get; set; } + + public bool UserControlForGuid { get; set; } + + public bool? UserControlShowInCustomTables { get; set; } + + public string? UserControlParameters { get; set; } + + public bool UserControlForDocAttachments { get; set; } + + [Column("UserControlResourceID")] + public int? UserControlResourceId { get; set; } + + [Column("UserControlParentID")] + public int? UserControlParentId { get; set; } + + public string? UserControlDescription { get; set; } + + public int? UserControlPriority { get; set; } + + public bool? UserControlIsSystem { get; set; } + + public bool UserControlForBinary { get; set; } + + public bool UserControlForDocRelationships { get; set; } + + [StringLength(200)] + public string? UserControlAssemblyName { get; set; } + + [StringLength(200)] + public string? UserControlClassName { get; set; } + + [InverseProperty("UserControlParent")] + public virtual ICollection InverseUserControlParent { get; set; } = new List(); + + [ForeignKey("UserControlParentId")] + [InverseProperty("InverseUserControlParent")] + public virtual CmsFormUserControl? UserControlParent { get; set; } + + [ForeignKey("UserControlResourceId")] + [InverseProperty("CmsFormUserControls")] + public virtual CmsResource? UserControlResource { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs b/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs index fded87e0..b99ba3c2 100644 --- a/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs +++ b/Migration.Toolkit.KX13/Models/CmsHelpTopic.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_HelpTopic")] -[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] -public partial class CmsHelpTopic -{ - [Key] - [Column("HelpTopicID")] - public int HelpTopicId { get; set; } - - [Column("HelpTopicUIElementID")] - public int HelpTopicUielementId { get; set; } - - [StringLength(200)] - public string HelpTopicName { get; set; } = null!; - - [StringLength(1023)] - public string HelpTopicLink { get; set; } = null!; - - public DateTime HelpTopicLastModified { get; set; } - - [Column("HelpTopicGUID")] - public Guid HelpTopicGuid { get; set; } - - public int? HelpTopicOrder { get; set; } - - public string? HelpTopicVisibilityCondition { get; set; } - - [ForeignKey("HelpTopicUielementId")] - [InverseProperty("CmsHelpTopics")] - public virtual CmsUielement HelpTopicUielement { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_HelpTopic")] +[Index("HelpTopicUielementId", Name = "IX_CMS_HelpTopic_HelpTopicUIElementID")] +public class CmsHelpTopic +{ + [Key] + [Column("HelpTopicID")] + public int HelpTopicId { get; set; } + + [Column("HelpTopicUIElementID")] + public int HelpTopicUielementId { get; set; } + + [StringLength(200)] + public string HelpTopicName { get; set; } = null!; + + [StringLength(1023)] + public string HelpTopicLink { get; set; } = null!; + + public DateTime HelpTopicLastModified { get; set; } + + [Column("HelpTopicGUID")] + public Guid HelpTopicGuid { get; set; } + + public int? HelpTopicOrder { get; set; } + + public string? HelpTopicVisibilityCondition { get; set; } + + [ForeignKey("HelpTopicUielementId")] + [InverseProperty("CmsHelpTopics")] + public virtual CmsUielement HelpTopicUielement { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsLayout.cs b/Migration.Toolkit.KX13/Models/CmsLayout.cs index 6b1aa3bb..6eb54d0a 100644 --- a/Migration.Toolkit.KX13/Models/CmsLayout.cs +++ b/Migration.Toolkit.KX13/Models/CmsLayout.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Layout")] -[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] -public partial class CmsLayout -{ - [Key] - [Column("LayoutID")] - public int LayoutId { get; set; } - - [StringLength(100)] - public string LayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string LayoutDisplayName { get; set; } = null!; - - public string? LayoutDescription { get; set; } - - public string LayoutCode { get; set; } = null!; - - [Column("LayoutVersionGUID")] - [StringLength(50)] - public string? LayoutVersionGuid { get; set; } - - [Column("LayoutGUID")] - public Guid LayoutGuid { get; set; } - - public DateTime LayoutLastModified { get; set; } - - [StringLength(50)] - public string? LayoutType { get; set; } - - [Column("LayoutCSS")] - public string? LayoutCss { get; set; } - - [InverseProperty("PageTemplateLayoutNavigation")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Layout")] +[Index("LayoutDisplayName", Name = "IX_CMS_Layout_LayoutDisplayName")] +public class CmsLayout +{ + [Key] + [Column("LayoutID")] + public int LayoutId { get; set; } + + [StringLength(100)] + public string LayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string LayoutDisplayName { get; set; } = null!; + + public string? LayoutDescription { get; set; } + + public string LayoutCode { get; set; } = null!; + + [Column("LayoutVersionGUID")] + [StringLength(50)] + public string? LayoutVersionGuid { get; set; } + + [Column("LayoutGUID")] + public Guid LayoutGuid { get; set; } + + public DateTime LayoutLastModified { get; set; } + + [StringLength(50)] + public string? LayoutType { get; set; } + + [Column("LayoutCSS")] + public string? LayoutCss { get; set; } + + [InverseProperty("PageTemplateLayoutNavigation")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs b/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs index 8cc7b1fa..522fb68f 100644 --- a/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs +++ b/Migration.Toolkit.KX13/Models/CmsLicenseKey.cs @@ -1,28 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_LicenseKey")] -public partial class CmsLicenseKey -{ - [Key] - [Column("LicenseKeyID")] - public int LicenseKeyId { get; set; } - - [StringLength(255)] - public string? LicenseDomain { get; set; } - - public string? LicenseKey { get; set; } - - [StringLength(200)] - public string? LicenseEdition { get; set; } - - [StringLength(200)] - public string? LicenseExpiration { get; set; } - - public int? LicenseServers { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_LicenseKey")] +public class CmsLicenseKey +{ + [Key] + [Column("LicenseKeyID")] + public int LicenseKeyId { get; set; } + + [StringLength(255)] + public string? LicenseDomain { get; set; } + + public string? LicenseKey { get; set; } + + [StringLength(200)] + public string? LicenseEdition { get; set; } + + [StringLength(200)] + public string? LicenseExpiration { get; set; } + + public int? LicenseServers { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs index 0c3ba484..c9ab83ec 100644 --- a/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs +++ b/Migration.Toolkit.KX13/Models/CmsMacroIdentity.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_MacroIdentity")] -[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] -public partial class CmsMacroIdentity -{ - [Key] - [Column("MacroIdentityID")] - public int MacroIdentityId { get; set; } - - public Guid MacroIdentityGuid { get; set; } - - public DateTime MacroIdentityLastModified { get; set; } - - [StringLength(200)] - public string MacroIdentityName { get; set; } = null!; - - [Column("MacroIdentityEffectiveUserID")] - public int? MacroIdentityEffectiveUserId { get; set; } - - [InverseProperty("UserMacroIdentityMacroIdentity")] - public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); - - [ForeignKey("MacroIdentityEffectiveUserId")] - [InverseProperty("CmsMacroIdentities")] - public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_MacroIdentity")] +[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] +public class CmsMacroIdentity +{ + [Key] + [Column("MacroIdentityID")] + public int MacroIdentityId { get; set; } + + public Guid MacroIdentityGuid { get; set; } + + public DateTime MacroIdentityLastModified { get; set; } + + [StringLength(200)] + public string MacroIdentityName { get; set; } = null!; + + [Column("MacroIdentityEffectiveUserID")] + public int? MacroIdentityEffectiveUserId { get; set; } + + [InverseProperty("UserMacroIdentityMacroIdentity")] + public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); + + [ForeignKey("MacroIdentityEffectiveUserId")] + [InverseProperty("CmsMacroIdentities")] + public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsMacroRule.cs b/Migration.Toolkit.KX13/Models/CmsMacroRule.cs index 24e9d79e..487129df 100644 --- a/Migration.Toolkit.KX13/Models/CmsMacroRule.cs +++ b/Migration.Toolkit.KX13/Models/CmsMacroRule.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_MacroRule")] -public partial class CmsMacroRule -{ - [Key] - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [StringLength(200)] - public string MacroRuleName { get; set; } = null!; - - [StringLength(1000)] - public string MacroRuleText { get; set; } = null!; - - public string? MacroRuleParameters { get; set; } - - [StringLength(100)] - public string? MacroRuleResourceName { get; set; } - - public DateTime MacroRuleLastModified { get; set; } - - [Column("MacroRuleGUID")] - public Guid MacroRuleGuid { get; set; } - - public string MacroRuleCondition { get; set; } = null!; - - [StringLength(500)] - public string MacroRuleDisplayName { get; set; } = null!; - - public bool? MacroRuleIsCustom { get; set; } - - public bool MacroRuleRequiresContext { get; set; } - - [StringLength(450)] - public string? MacroRuleDescription { get; set; } - - [StringLength(2500)] - public string? MacroRuleRequiredData { get; set; } - - public bool? MacroRuleEnabled { get; set; } - - public int? MacroRuleAvailability { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_MacroRule")] +public class CmsMacroRule +{ + [Key] + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [StringLength(200)] + public string MacroRuleName { get; set; } = null!; + + [StringLength(1000)] + public string MacroRuleText { get; set; } = null!; + + public string? MacroRuleParameters { get; set; } + + [StringLength(100)] + public string? MacroRuleResourceName { get; set; } + + public DateTime MacroRuleLastModified { get; set; } + + [Column("MacroRuleGUID")] + public Guid MacroRuleGuid { get; set; } + + public string MacroRuleCondition { get; set; } = null!; + + [StringLength(500)] + public string MacroRuleDisplayName { get; set; } = null!; + + public bool? MacroRuleIsCustom { get; set; } + + public bool MacroRuleRequiresContext { get; set; } + + [StringLength(450)] + public string? MacroRuleDescription { get; set; } + + [StringLength(2500)] + public string? MacroRuleRequiredData { get; set; } + + public bool? MacroRuleEnabled { get; set; } + + public int? MacroRuleAvailability { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsMembership.cs b/Migration.Toolkit.KX13/Models/CmsMembership.cs index feb7f8d2..3bf124b1 100644 --- a/Migration.Toolkit.KX13/Models/CmsMembership.cs +++ b/Migration.Toolkit.KX13/Models/CmsMembership.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Membership")] -[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] -public partial class CmsMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [StringLength(200)] - public string MembershipName { get; set; } = null!; - - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - public string? MembershipDescription { get; set; } - - public DateTime MembershipLastModified { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } - - [InverseProperty("Membership")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [ForeignKey("MembershipSiteId")] - [InverseProperty("CmsMemberships")] - public virtual CmsSite? MembershipSite { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("Memberships")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Membership")] +[Index("MembershipSiteId", Name = "IX_CMS_Membership_MembershipSiteID")] +public class CmsMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [StringLength(200)] + public string MembershipName { get; set; } = null!; + + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + public string? MembershipDescription { get; set; } + + public DateTime MembershipLastModified { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } + + [InverseProperty("Membership")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [ForeignKey("MembershipSiteId")] + [InverseProperty("CmsMemberships")] + public virtual CmsSite? MembershipSite { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("Memberships")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs b/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs index e2036e83..e80dcbf3 100644 --- a/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs +++ b/Migration.Toolkit.KX13/Models/CmsMembershipUser.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_MembershipUser")] -[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] -[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] -public partial class CmsMembershipUser -{ - [Key] - [Column("MembershipUserID")] - public int MembershipUserId { get; set; } - - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } - - public bool? SendNotification { get; set; } - - [ForeignKey("MembershipId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsMembership Membership { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsMembershipUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_MembershipUser")] +[Index("MembershipId", "UserId", Name = "IX_CMS_MembershipUser_MembershipID_UserID", IsUnique = true)] +[Index("UserId", Name = "IX_CMS_MembershipUser_UserID")] +public class CmsMembershipUser +{ + [Key] + [Column("MembershipUserID")] + public int MembershipUserId { get; set; } + + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } + + public bool? SendNotification { get; set; } + + [ForeignKey("MembershipId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsMembership Membership { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsMembershipUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsMetaFile.cs b/Migration.Toolkit.KX13/Models/CmsMetaFile.cs index ee04a742..e6df9f68 100644 --- a/Migration.Toolkit.KX13/Models/CmsMetaFile.cs +++ b/Migration.Toolkit.KX13/Models/CmsMetaFile.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_MetaFile")] -[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] -[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] -public partial class CmsMetaFile -{ - [Key] - [Column("MetaFileID")] - public int MetaFileId { get; set; } - - [Column("MetaFileObjectID")] - public int MetaFileObjectId { get; set; } - - [StringLength(100)] - public string MetaFileObjectType { get; set; } = null!; - - [StringLength(100)] - public string? MetaFileGroupName { get; set; } - - [StringLength(250)] - public string MetaFileName { get; set; } = null!; - - [StringLength(50)] - public string MetaFileExtension { get; set; } = null!; - - public int MetaFileSize { get; set; } - - [StringLength(100)] - public string MetaFileMimeType { get; set; } = null!; - - public byte[]? MetaFileBinary { get; set; } - - public int? MetaFileImageWidth { get; set; } - - public int? MetaFileImageHeight { get; set; } - - [Column("MetaFileGUID")] - public Guid MetaFileGuid { get; set; } - - public DateTime MetaFileLastModified { get; set; } - - [Column("MetaFileSiteID")] - public int? MetaFileSiteId { get; set; } - - [StringLength(250)] - public string? MetaFileTitle { get; set; } - - public string? MetaFileDescription { get; set; } - - public string? MetaFileCustomData { get; set; } - - [ForeignKey("MetaFileSiteId")] - [InverseProperty("CmsMetaFiles")] - public virtual CmsSite? MetaFileSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_MetaFile")] +[Index("MetaFileGuid", "MetaFileSiteId", "MetaFileObjectType", "MetaFileObjectId", "MetaFileGroupName", Name = "IX_CMS_MetaFile_MetaFileGUID_MetaFileSiteID_MetaFileObjectType_MetaFileObjectID_MetaFileGroupName")] +[Index("MetaFileSiteId", Name = "IX_CMS_MetaFile_MetaFileSiteID")] +public class CmsMetaFile +{ + [Key] + [Column("MetaFileID")] + public int MetaFileId { get; set; } + + [Column("MetaFileObjectID")] + public int MetaFileObjectId { get; set; } + + [StringLength(100)] + public string MetaFileObjectType { get; set; } = null!; + + [StringLength(100)] + public string? MetaFileGroupName { get; set; } + + [StringLength(250)] + public string MetaFileName { get; set; } = null!; + + [StringLength(50)] + public string MetaFileExtension { get; set; } = null!; + + public int MetaFileSize { get; set; } + + [StringLength(100)] + public string MetaFileMimeType { get; set; } = null!; + + public byte[]? MetaFileBinary { get; set; } + + public int? MetaFileImageWidth { get; set; } + + public int? MetaFileImageHeight { get; set; } + + [Column("MetaFileGUID")] + public Guid MetaFileGuid { get; set; } + + public DateTime MetaFileLastModified { get; set; } + + [Column("MetaFileSiteID")] + public int? MetaFileSiteId { get; set; } + + [StringLength(250)] + public string? MetaFileTitle { get; set; } + + public string? MetaFileDescription { get; set; } + + public string? MetaFileCustomData { get; set; } + + [ForeignKey("MetaFileSiteId")] + [InverseProperty("CmsMetaFiles")] + public virtual CmsSite? MetaFileSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs b/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs index 90d229d8..416f81d6 100644 --- a/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs +++ b/Migration.Toolkit.KX13/Models/CmsModuleLicenseKey.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ModuleLicenseKey")] -[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] -public partial class CmsModuleLicenseKey -{ - [Key] - [Column("ModuleLicenseKeyID")] - public int ModuleLicenseKeyId { get; set; } - - public Guid ModuleLicenseKeyGuid { get; set; } - - public DateTime ModuleLicenseKeyLastModified { get; set; } - - public string ModuleLicenseKeyLicense { get; set; } = null!; - - [Column("ModuleLicenseKeyResourceID")] - public int ModuleLicenseKeyResourceId { get; set; } - - [ForeignKey("ModuleLicenseKeyResourceId")] - [InverseProperty("CmsModuleLicenseKeys")] - public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ModuleLicenseKey")] +[Index("ModuleLicenseKeyResourceId", Name = "IX_CMS_ModuleLicenseKey_ModuleLicenseKeyResourceID")] +public class CmsModuleLicenseKey +{ + [Key] + [Column("ModuleLicenseKeyID")] + public int ModuleLicenseKeyId { get; set; } + + public Guid ModuleLicenseKeyGuid { get; set; } + + public DateTime ModuleLicenseKeyLastModified { get; set; } + + public string ModuleLicenseKeyLicense { get; set; } = null!; + + [Column("ModuleLicenseKeyResourceID")] + public int ModuleLicenseKeyResourceId { get; set; } + + [ForeignKey("ModuleLicenseKeyResourceId")] + [InverseProperty("CmsModuleLicenseKeys")] + public virtual CmsResource ModuleLicenseKeyResource { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs b/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs index 2393d763..185eebc1 100644 --- a/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs +++ b/Migration.Toolkit.KX13/Models/CmsModuleUsageCounter.cs @@ -1,20 +1,19 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -[Table("CMS_ModuleUsageCounter")] -public partial class CmsModuleUsageCounter -{ - [Column("ModuleUsageCounterID")] - public int ModuleUsageCounterId { get; set; } - - [StringLength(200)] - public string ModuleUsageCounterName { get; set; } = null!; - - public long ModuleUsageCounterValue { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +[Table("CMS_ModuleUsageCounter")] +public class CmsModuleUsageCounter +{ + [Column("ModuleUsageCounterID")] + public int ModuleUsageCounterId { get; set; } + + [StringLength(200)] + public string ModuleUsageCounterName { get; set; } = null!; + + public long ModuleUsageCounterValue { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs b/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs index 55f1b37c..91aade8f 100644 --- a/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs +++ b/Migration.Toolkit.KX13/Models/CmsObjectSetting.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ObjectSettings")] -[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] -[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] -[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] -[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] -[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] -public partial class CmsObjectSetting -{ - [Key] - [Column("ObjectSettingsID")] - public int ObjectSettingsId { get; set; } - - public string? ObjectTags { get; set; } - - [Column("ObjectCheckedOutByUserID")] - public int? ObjectCheckedOutByUserId { get; set; } - - public DateTime? ObjectCheckedOutWhen { get; set; } - - [Column("ObjectCheckedOutVersionHistoryID")] - public int? ObjectCheckedOutVersionHistoryId { get; set; } - - [Column("ObjectWorkflowStepID")] - public int? ObjectWorkflowStepId { get; set; } - - [Column("ObjectPublishedVersionHistoryID")] - public int? ObjectPublishedVersionHistoryId { get; set; } - - [Column("ObjectSettingsObjectID")] - public int ObjectSettingsObjectId { get; set; } - - [StringLength(100)] - public string ObjectSettingsObjectType { get; set; } = null!; - - public string? ObjectComments { get; set; } - - public bool? ObjectWorkflowSendEmails { get; set; } - - [ForeignKey("ObjectCheckedOutByUserId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsUser? ObjectCheckedOutByUser { get; set; } - - [ForeignKey("ObjectCheckedOutVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } - - [ForeignKey("ObjectPublishedVersionHistoryId")] - [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] - public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } - - [ForeignKey("ObjectWorkflowStepId")] - [InverseProperty("CmsObjectSettings")] - public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ObjectSettings")] +[Index("ObjectCheckedOutByUserId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutByUserID")] +[Index("ObjectCheckedOutVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectCheckedOutVersionHistoryID")] +[Index("ObjectPublishedVersionHistoryId", Name = "IX_CMS_ObjectSettings_ObjectPublishedVersionHistoryID")] +[Index("ObjectSettingsObjectId", "ObjectSettingsObjectType", Name = "IX_CMS_ObjectSettings_ObjectSettingsObjectType_ObjectSettingsObjectID", IsUnique = true)] +[Index("ObjectWorkflowStepId", Name = "IX_CMS_ObjectSettings_ObjectWorkflowStepID")] +public class CmsObjectSetting +{ + [Key] + [Column("ObjectSettingsID")] + public int ObjectSettingsId { get; set; } + + public string? ObjectTags { get; set; } + + [Column("ObjectCheckedOutByUserID")] + public int? ObjectCheckedOutByUserId { get; set; } + + public DateTime? ObjectCheckedOutWhen { get; set; } + + [Column("ObjectCheckedOutVersionHistoryID")] + public int? ObjectCheckedOutVersionHistoryId { get; set; } + + [Column("ObjectWorkflowStepID")] + public int? ObjectWorkflowStepId { get; set; } + + [Column("ObjectPublishedVersionHistoryID")] + public int? ObjectPublishedVersionHistoryId { get; set; } + + [Column("ObjectSettingsObjectID")] + public int ObjectSettingsObjectId { get; set; } + + [StringLength(100)] + public string ObjectSettingsObjectType { get; set; } = null!; + + public string? ObjectComments { get; set; } + + public bool? ObjectWorkflowSendEmails { get; set; } + + [ForeignKey("ObjectCheckedOutByUserId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsUser? ObjectCheckedOutByUser { get; set; } + + [ForeignKey("ObjectCheckedOutVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectCheckedOutVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectCheckedOutVersionHistory { get; set; } + + [ForeignKey("ObjectPublishedVersionHistoryId")] + [InverseProperty("CmsObjectSettingObjectPublishedVersionHistories")] + public virtual CmsObjectVersionHistory? ObjectPublishedVersionHistory { get; set; } + + [ForeignKey("ObjectWorkflowStepId")] + [InverseProperty("CmsObjectSettings")] + public virtual CmsWorkflowStep? ObjectWorkflowStep { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs b/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs index e2f8f899..628ebf96 100644 --- a/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsObjectVersionHistory.cs @@ -1,73 +1,72 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ObjectVersionHistory")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] -[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] -public partial class CmsObjectVersionHistory -{ - [Key] - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [InverseProperty("ObjectCheckedOutVersionHistory")] - public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("ObjectPublishedVersionHistory")] - public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionModifiedByUserId")] - [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] - public virtual CmsUser? VersionModifiedByUser { get; set; } - - [ForeignKey("VersionObjectSiteId")] - [InverseProperty("CmsObjectVersionHistories")] - public virtual CmsSite? VersionObjectSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ObjectVersionHistory")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionModifiedByUserId", Name = "IX_CMS_ObjectVersionHistory_VersionModifiedByUserID")] +[Index("VersionObjectSiteId", "VersionDeletedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectSiteID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionObjectType", "VersionObjectId", "VersionModifiedWhen", Name = "IX_CMS_ObjectVersionHistory_VersionObjectType_VersionObjectID_VersionModifiedWhen", IsDescending = new[] { false, false, true })] +public class CmsObjectVersionHistory +{ + [Key] + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [InverseProperty("ObjectCheckedOutVersionHistory")] + public virtual ICollection CmsObjectSettingObjectCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("ObjectPublishedVersionHistory")] + public virtual ICollection CmsObjectSettingObjectPublishedVersionHistories { get; set; } = new List(); + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionModifiedByUserId")] + [InverseProperty("CmsObjectVersionHistoryVersionModifiedByUsers")] + public virtual CmsUser? VersionModifiedByUser { get; set; } + + [ForeignKey("VersionObjectSiteId")] + [InverseProperty("CmsObjectVersionHistories")] + public virtual CmsSite? VersionObjectSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs index 2f8d707d..4f5b5daa 100644 --- a/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs +++ b/Migration.Toolkit.KX13/Models/CmsObjectWorkflowTrigger.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ObjectWorkflowTrigger")] -[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] -public partial class CmsObjectWorkflowTrigger -{ - [Key] - [Column("TriggerID")] - public int TriggerId { get; set; } - - [Column("TriggerGUID")] - public Guid TriggerGuid { get; set; } - - public DateTime TriggerLastModified { get; set; } - - public int TriggerType { get; set; } - - public string? TriggerMacroCondition { get; set; } - - [Column("TriggerWorkflowID")] - public int TriggerWorkflowId { get; set; } - - [StringLength(450)] - public string TriggerDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TriggerObjectType { get; set; } = null!; - - public string? TriggerParameters { get; set; } - - [StringLength(100)] - public string? TriggerTargetObjectType { get; set; } - - [Column("TriggerTargetObjectID")] - public int? TriggerTargetObjectId { get; set; } - - [ForeignKey("TriggerWorkflowId")] - [InverseProperty("CmsObjectWorkflowTriggers")] - public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ObjectWorkflowTrigger")] +[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] +public class CmsObjectWorkflowTrigger +{ + [Key] + [Column("TriggerID")] + public int TriggerId { get; set; } + + [Column("TriggerGUID")] + public Guid TriggerGuid { get; set; } + + public DateTime TriggerLastModified { get; set; } + + public int TriggerType { get; set; } + + public string? TriggerMacroCondition { get; set; } + + [Column("TriggerWorkflowID")] + public int TriggerWorkflowId { get; set; } + + [StringLength(450)] + public string TriggerDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TriggerObjectType { get; set; } = null!; + + public string? TriggerParameters { get; set; } + + [StringLength(100)] + public string? TriggerTargetObjectType { get; set; } + + [Column("TriggerTargetObjectID")] + public int? TriggerTargetObjectId { get; set; } + + [ForeignKey("TriggerWorkflowId")] + [InverseProperty("CmsObjectWorkflowTriggers")] + public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs b/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs index efe01526..8cf4fba7 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageFormerUrlPath.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageFormerUrlPath")] -[Index("PageFormerUrlPathNodeId", Name = "IX_CMS_PageFormerUrlPath_PageFormerUrlPathNodeID")] -[Index("PageFormerUrlPathSiteId", Name = "IX_CMS_PageFormerUrlPath_PageFormerUrlPathSiteID")] -[Index("PageFormerUrlPathUrlPathHash", "PageFormerUrlPathCulture", "PageFormerUrlPathSiteId", Name = "IX_CMS_PageFormerUrlPath_UrlPathHash_Culture_SiteID", IsUnique = true)] -public partial class CmsPageFormerUrlPath -{ - [Key] - [Column("PageFormerUrlPathID")] - public int PageFormerUrlPathId { get; set; } - - [StringLength(2000)] - public string PageFormerUrlPathUrlPath { get; set; } = null!; - - [StringLength(64)] - public string PageFormerUrlPathUrlPathHash { get; set; } = null!; - - [StringLength(50)] - public string PageFormerUrlPathCulture { get; set; } = null!; - - [Column("PageFormerUrlPathNodeID")] - public int PageFormerUrlPathNodeId { get; set; } - - [Column("PageFormerUrlPathSiteID")] - public int PageFormerUrlPathSiteId { get; set; } - - public DateTime PageFormerUrlPathLastModified { get; set; } - - [ForeignKey("PageFormerUrlPathNodeId")] - [InverseProperty("CmsPageFormerUrlPaths")] - public virtual CmsTree PageFormerUrlPathNode { get; set; } = null!; - - [ForeignKey("PageFormerUrlPathSiteId")] - [InverseProperty("CmsPageFormerUrlPaths")] - public virtual CmsSite PageFormerUrlPathSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_PageFormerUrlPath")] +[Index("PageFormerUrlPathNodeId", Name = "IX_CMS_PageFormerUrlPath_PageFormerUrlPathNodeID")] +[Index("PageFormerUrlPathSiteId", Name = "IX_CMS_PageFormerUrlPath_PageFormerUrlPathSiteID")] +[Index("PageFormerUrlPathUrlPathHash", "PageFormerUrlPathCulture", "PageFormerUrlPathSiteId", Name = "IX_CMS_PageFormerUrlPath_UrlPathHash_Culture_SiteID", IsUnique = true)] +public class CmsPageFormerUrlPath +{ + [Key] + [Column("PageFormerUrlPathID")] + public int PageFormerUrlPathId { get; set; } + + [StringLength(2000)] + public string PageFormerUrlPathUrlPath { get; set; } = null!; + + [StringLength(64)] + public string PageFormerUrlPathUrlPathHash { get; set; } = null!; + + [StringLength(50)] + public string PageFormerUrlPathCulture { get; set; } = null!; + + [Column("PageFormerUrlPathNodeID")] + public int PageFormerUrlPathNodeId { get; set; } + + [Column("PageFormerUrlPathSiteID")] + public int PageFormerUrlPathSiteId { get; set; } + + public DateTime PageFormerUrlPathLastModified { get; set; } + + [ForeignKey("PageFormerUrlPathNodeId")] + [InverseProperty("CmsPageFormerUrlPaths")] + public virtual CmsTree PageFormerUrlPathNode { get; set; } = null!; + + [ForeignKey("PageFormerUrlPathSiteId")] + [InverseProperty("CmsPageFormerUrlPaths")] + public virtual CmsSite PageFormerUrlPathSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs index 7e45290a..252dee39 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageTemplate.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageTemplate")] -[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] -[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] -public partial class CmsPageTemplate -{ - [Key] - [Column("PageTemplateID")] - public int PageTemplateId { get; set; } - - [StringLength(200)] - public string PageTemplateDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PageTemplateCodeName { get; set; } = null!; - - public string? PageTemplateDescription { get; set; } - - [Column("PageTemplateCategoryID")] - public int? PageTemplateCategoryId { get; set; } - - [Column("PageTemplateLayoutID")] - public int? PageTemplateLayoutId { get; set; } - - public string? PageTemplateWebParts { get; set; } - - public string? PageTemplateLayout { get; set; } - - [Column("PageTemplateVersionGUID")] - [StringLength(200)] - public string? PageTemplateVersionGuid { get; set; } - - [Column("PageTemplateGUID")] - public Guid PageTemplateGuid { get; set; } - - public DateTime PageTemplateLastModified { get; set; } - - [StringLength(10)] - public string PageTemplateType { get; set; } = null!; - - [StringLength(50)] - public string? PageTemplateLayoutType { get; set; } - - [Column("PageTemplateCSS")] - public string? PageTemplateCss { get; set; } - - [Column("PageTemplateThumbnailGUID")] - public Guid? PageTemplateThumbnailGuid { get; set; } - - public string? PageTemplateProperties { get; set; } - - public bool? PageTemplateIsLayout { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } - - [InverseProperty("ElementPageTemplate")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [ForeignKey("PageTemplateCategoryId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } - - [ForeignKey("PageTemplateLayoutId")] - [InverseProperty("CmsPageTemplates")] - public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_PageTemplate")] +[Index("PageTemplateCodeName", "PageTemplateDisplayName", Name = "IX_CMS_PageTemplate_PageTemplateCodeName_PageTemplateDisplayName")] +[Index("PageTemplateLayoutId", Name = "IX_CMS_PageTemplate_PageTemplateLayoutID")] +public class CmsPageTemplate +{ + [Key] + [Column("PageTemplateID")] + public int PageTemplateId { get; set; } + + [StringLength(200)] + public string PageTemplateDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PageTemplateCodeName { get; set; } = null!; + + public string? PageTemplateDescription { get; set; } + + [Column("PageTemplateCategoryID")] + public int? PageTemplateCategoryId { get; set; } + + [Column("PageTemplateLayoutID")] + public int? PageTemplateLayoutId { get; set; } + + public string? PageTemplateWebParts { get; set; } + + public string? PageTemplateLayout { get; set; } + + [Column("PageTemplateVersionGUID")] + [StringLength(200)] + public string? PageTemplateVersionGuid { get; set; } + + [Column("PageTemplateGUID")] + public Guid PageTemplateGuid { get; set; } + + public DateTime PageTemplateLastModified { get; set; } + + [StringLength(10)] + public string PageTemplateType { get; set; } = null!; + + [StringLength(50)] + public string? PageTemplateLayoutType { get; set; } + + [Column("PageTemplateCSS")] + public string? PageTemplateCss { get; set; } + + [Column("PageTemplateThumbnailGUID")] + public Guid? PageTemplateThumbnailGuid { get; set; } + + public string? PageTemplateProperties { get; set; } + + public bool? PageTemplateIsLayout { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } + + [InverseProperty("ElementPageTemplate")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [ForeignKey("PageTemplateCategoryId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsPageTemplateCategory? PageTemplateCategory { get; set; } + + [ForeignKey("PageTemplateLayoutId")] + [InverseProperty("CmsPageTemplates")] + public virtual CmsLayout? PageTemplateLayoutNavigation { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs index 68efe31d..e1e5fc01 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageTemplateCategory.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageTemplateCategory")] -[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] -[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] -public partial class CmsPageTemplateCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(200)] - public string? CategoryName { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public string? CategoryPath { get; set; } - - public int? CategoryLevel { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsPageTemplateCategory? CategoryParent { get; set; } - - [InverseProperty("PageTemplateCategory")] - public virtual ICollection CmsPageTemplates { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_PageTemplateCategory")] +[Index("CategoryLevel", Name = "IX_CMS_PageTemplateCategory_CategoryLevel")] +[Index("CategoryParentId", Name = "IX_CMS_PageTemplateCategory_CategoryParentID")] +public class CmsPageTemplateCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(200)] + public string? CategoryName { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public string? CategoryPath { get; set; } + + public int? CategoryLevel { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsPageTemplateCategory? CategoryParent { get; set; } + + [InverseProperty("PageTemplateCategory")] + public virtual ICollection CmsPageTemplates { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs index 26bdf5dc..52c39233 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageTemplateConfiguration.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageTemplateConfiguration")] -[Index("PageTemplateConfigurationSiteId", Name = "IX_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID")] -public partial class CmsPageTemplateConfiguration -{ - [Key] - [Column("PageTemplateConfigurationID")] - public int PageTemplateConfigurationId { get; set; } - - [Column("PageTemplateConfigurationGUID")] - public Guid PageTemplateConfigurationGuid { get; set; } - - [Column("PageTemplateConfigurationSiteID")] - public int PageTemplateConfigurationSiteId { get; set; } - - public DateTime PageTemplateConfigurationLastModified { get; set; } - - [StringLength(200)] - public string PageTemplateConfigurationName { get; set; } = null!; - - public string? PageTemplateConfigurationDescription { get; set; } - - [Column("PageTemplateConfigurationThumbnailGUID")] - public Guid? PageTemplateConfigurationThumbnailGuid { get; set; } - - public string PageTemplateConfigurationTemplate { get; set; } = null!; - - public string? PageTemplateConfigurationWidgets { get; set; } - - [ForeignKey("PageTemplateConfigurationSiteId")] - [InverseProperty("CmsPageTemplateConfigurations")] - public virtual CmsSite PageTemplateConfigurationSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_PageTemplateConfiguration")] +[Index("PageTemplateConfigurationSiteId", Name = "IX_CMS_PageTemplateConfiguration_PageTemplateConfigurationSiteID")] +public class CmsPageTemplateConfiguration +{ + [Key] + [Column("PageTemplateConfigurationID")] + public int PageTemplateConfigurationId { get; set; } + + [Column("PageTemplateConfigurationGUID")] + public Guid PageTemplateConfigurationGuid { get; set; } + + [Column("PageTemplateConfigurationSiteID")] + public int PageTemplateConfigurationSiteId { get; set; } + + public DateTime PageTemplateConfigurationLastModified { get; set; } + + [StringLength(200)] + public string PageTemplateConfigurationName { get; set; } = null!; + + public string? PageTemplateConfigurationDescription { get; set; } + + [Column("PageTemplateConfigurationThumbnailGUID")] + public Guid? PageTemplateConfigurationThumbnailGuid { get; set; } + + public string PageTemplateConfigurationTemplate { get; set; } = null!; + + public string? PageTemplateConfigurationWidgets { get; set; } + + [ForeignKey("PageTemplateConfigurationSiteId")] + [InverseProperty("CmsPageTemplateConfigurations")] + public virtual CmsSite PageTemplateConfigurationSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs b/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs index 2d3d8b33..21331870 100644 --- a/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs +++ b/Migration.Toolkit.KX13/Models/CmsPageUrlPath.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_PageUrlPath")] -[Index("PageUrlPathNodeId", Name = "IX_CMS_PageUrlPath_PageUrlPathNodeID")] -[Index("PageUrlPathSiteId", Name = "IX_CMS_PageUrlPath_PageUrlPathSiteID")] -[Index("PageUrlPathUrlPathHash", "PageUrlPathCulture", "PageUrlPathSiteId", Name = "IX_CMS_PageUrlPath_PageUrlPathUrlPathHash_PageUrlPathCulture_PageUrlPathSiteID", IsUnique = true)] -public partial class CmsPageUrlPath -{ - [Key] - [Column("PageUrlPathID")] - public int PageUrlPathId { get; set; } - - [Column("PageUrlPathGUID")] - public Guid PageUrlPathGuid { get; set; } - - [StringLength(50)] - public string PageUrlPathCulture { get; set; } = null!; - - [Column("PageUrlPathNodeID")] - public int PageUrlPathNodeId { get; set; } - - [StringLength(2000)] - public string PageUrlPathUrlPath { get; set; } = null!; - - [StringLength(64)] - public string PageUrlPathUrlPathHash { get; set; } = null!; - - [Column("PageUrlPathSiteID")] - public int PageUrlPathSiteId { get; set; } - - public DateTime PageUrlPathLastModified { get; set; } - - [ForeignKey("PageUrlPathNodeId")] - [InverseProperty("CmsPageUrlPaths")] - public virtual CmsTree PageUrlPathNode { get; set; } = null!; - - [ForeignKey("PageUrlPathSiteId")] - [InverseProperty("CmsPageUrlPaths")] - public virtual CmsSite PageUrlPathSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_PageUrlPath")] +[Index("PageUrlPathNodeId", Name = "IX_CMS_PageUrlPath_PageUrlPathNodeID")] +[Index("PageUrlPathSiteId", Name = "IX_CMS_PageUrlPath_PageUrlPathSiteID")] +[Index("PageUrlPathUrlPathHash", "PageUrlPathCulture", "PageUrlPathSiteId", Name = "IX_CMS_PageUrlPath_PageUrlPathUrlPathHash_PageUrlPathCulture_PageUrlPathSiteID", IsUnique = true)] +public class CmsPageUrlPath +{ + [Key] + [Column("PageUrlPathID")] + public int PageUrlPathId { get; set; } + + [Column("PageUrlPathGUID")] + public Guid PageUrlPathGuid { get; set; } + + [StringLength(50)] + public string PageUrlPathCulture { get; set; } = null!; + + [Column("PageUrlPathNodeID")] + public int PageUrlPathNodeId { get; set; } + + [StringLength(2000)] + public string PageUrlPathUrlPath { get; set; } = null!; + + [StringLength(64)] + public string PageUrlPathUrlPathHash { get; set; } = null!; + + [Column("PageUrlPathSiteID")] + public int PageUrlPathSiteId { get; set; } + + public DateTime PageUrlPathLastModified { get; set; } + + [ForeignKey("PageUrlPathNodeId")] + [InverseProperty("CmsPageUrlPaths")] + public virtual CmsTree PageUrlPathNode { get; set; } = null!; + + [ForeignKey("PageUrlPathSiteId")] + [InverseProperty("CmsPageUrlPaths")] + public virtual CmsSite PageUrlPathSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsPermission.cs b/Migration.Toolkit.KX13/Models/CmsPermission.cs index adfc1575..4b0bffde 100644 --- a/Migration.Toolkit.KX13/Models/CmsPermission.cs +++ b/Migration.Toolkit.KX13/Models/CmsPermission.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Permission")] -[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] -[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] -public partial class CmsPermission -{ - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [StringLength(100)] - public string PermissionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("ClassID")] - public int? ClassId { get; set; } - - [Column("ResourceID")] - public int? ResourceId { get; set; } - - [Column("PermissionGUID")] - public Guid PermissionGuid { get; set; } - - public DateTime PermissionLastModified { get; set; } - - public string? PermissionDescription { get; set; } - - public bool? PermissionDisplayInMatrix { get; set; } - - public int? PermissionOrder { get; set; } - - public bool? PermissionEditableByGlobalAdmin { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsPermissions")] - public virtual CmsClass? Class { get; set; } - - [InverseProperty("Permission")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Permission")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("CmsPermissions")] - public virtual CmsResource? Resource { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("Permissions")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Permission")] +[Index("ClassId", "PermissionName", Name = "IX_CMS_Permission_ClassID_PermissionName")] +[Index("ResourceId", "PermissionName", Name = "IX_CMS_Permission_ResourceID_PermissionName")] +public class CmsPermission +{ + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [StringLength(100)] + public string PermissionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("ClassID")] + public int? ClassId { get; set; } + + [Column("ResourceID")] + public int? ResourceId { get; set; } + + [Column("PermissionGUID")] + public Guid PermissionGuid { get; set; } + + public DateTime PermissionLastModified { get; set; } + + public string? PermissionDescription { get; set; } + + public bool? PermissionDisplayInMatrix { get; set; } + + public int? PermissionOrder { get; set; } + + public bool? PermissionEditableByGlobalAdmin { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsPermissions")] + public virtual CmsClass? Class { get; set; } + + [InverseProperty("Permission")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Permission")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("CmsPermissions")] + public virtual CmsResource? Resource { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("Permissions")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsPersonalization.cs b/Migration.Toolkit.KX13/Models/CmsPersonalization.cs index 893e9f64..7950b1ae 100644 --- a/Migration.Toolkit.KX13/Models/CmsPersonalization.cs +++ b/Migration.Toolkit.KX13/Models/CmsPersonalization.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Personalization")] -[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] -[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] -public partial class CmsPersonalization -{ - [Key] - [Column("PersonalizationID")] - public int PersonalizationId { get; set; } - - [Column("PersonalizationGUID")] - public Guid PersonalizationGuid { get; set; } - - public DateTime PersonalizationLastModified { get; set; } - - [Column("PersonalizationUserID")] - public int? PersonalizationUserId { get; set; } - - public string? PersonalizationWebParts { get; set; } - - [StringLength(200)] - public string? PersonalizationDashboardName { get; set; } - - [Column("PersonalizationSiteID")] - public int? PersonalizationSiteId { get; set; } - - [ForeignKey("PersonalizationSiteId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsSite? PersonalizationSite { get; set; } - - [ForeignKey("PersonalizationUserId")] - [InverseProperty("CmsPersonalizations")] - public virtual CmsUser? PersonalizationUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Personalization")] +[Index("PersonalizationSiteId", Name = "IX_CMS_Personalization_PersonalizationSiteID_SiteID")] +[Index("PersonalizationUserId", Name = "IX_CMS_Personalization_PersonalizationUserID")] +public class CmsPersonalization +{ + [Key] + [Column("PersonalizationID")] + public int PersonalizationId { get; set; } + + [Column("PersonalizationGUID")] + public Guid PersonalizationGuid { get; set; } + + public DateTime PersonalizationLastModified { get; set; } + + [Column("PersonalizationUserID")] + public int? PersonalizationUserId { get; set; } + + public string? PersonalizationWebParts { get; set; } + + [StringLength(200)] + public string? PersonalizationDashboardName { get; set; } + + [Column("PersonalizationSiteID")] + public int? PersonalizationSiteId { get; set; } + + [ForeignKey("PersonalizationSiteId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsSite? PersonalizationSite { get; set; } + + [ForeignKey("PersonalizationUserId")] + [InverseProperty("CmsPersonalizations")] + public virtual CmsUser? PersonalizationUser { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsQuery.cs b/Migration.Toolkit.KX13/Models/CmsQuery.cs index 05e0ad71..deafbba8 100644 --- a/Migration.Toolkit.KX13/Models/CmsQuery.cs +++ b/Migration.Toolkit.KX13/Models/CmsQuery.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Query")] -[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] -public partial class CmsQuery -{ - [Key] - [Column("QueryID")] - public int QueryId { get; set; } - - [StringLength(100)] - public string QueryName { get; set; } = null!; - - [Column("QueryTypeID")] - public int QueryTypeId { get; set; } - - public string QueryText { get; set; } = null!; - - public bool QueryRequiresTransaction { get; set; } - - [Column("ClassID")] - public int? ClassId { get; set; } - - public bool QueryIsLocked { get; set; } - - public DateTime QueryLastModified { get; set; } - - [Column("QueryGUID")] - public Guid QueryGuid { get; set; } - - public bool? QueryIsCustom { get; set; } - - [StringLength(100)] - public string? QueryConnectionString { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsQueries")] - public virtual CmsClass? Class { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Query")] +[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] +public class CmsQuery +{ + [Key] + [Column("QueryID")] + public int QueryId { get; set; } + + [StringLength(100)] + public string QueryName { get; set; } = null!; + + [Column("QueryTypeID")] + public int QueryTypeId { get; set; } + + public string QueryText { get; set; } = null!; + + public bool QueryRequiresTransaction { get; set; } + + [Column("ClassID")] + public int? ClassId { get; set; } + + public bool QueryIsLocked { get; set; } + + public DateTime QueryLastModified { get; set; } + + [Column("QueryGUID")] + public Guid QueryGuid { get; set; } + + public bool? QueryIsCustom { get; set; } + + [StringLength(100)] + public string? QueryConnectionString { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsQueries")] + public virtual CmsClass? Class { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsRelationship.cs b/Migration.Toolkit.KX13/Models/CmsRelationship.cs index 4ca4649d..1931440c 100644 --- a/Migration.Toolkit.KX13/Models/CmsRelationship.cs +++ b/Migration.Toolkit.KX13/Models/CmsRelationship.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Relationship")] -[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] -[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] -[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] -public partial class CmsRelationship -{ - [Key] - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - public string? RelationshipCustomData { get; set; } - - public int? RelationshipOrder { get; set; } - - public bool? RelationshipIsAdHoc { get; set; } - - [ForeignKey("LeftNodeId")] - [InverseProperty("CmsRelationshipLeftNodes")] - public virtual CmsTree LeftNode { get; set; } = null!; - - [ForeignKey("RelationshipNameId")] - [InverseProperty("CmsRelationships")] - public virtual CmsRelationshipName RelationshipName { get; set; } = null!; - - [ForeignKey("RightNodeId")] - [InverseProperty("CmsRelationshipRightNodes")] - public virtual CmsTree RightNode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Relationship")] +[Index("LeftNodeId", Name = "IX_CMS_Relationship_LeftNodeID")] +[Index("RelationshipNameId", Name = "IX_CMS_Relationship_RelationshipNameID")] +[Index("RightNodeId", Name = "IX_CMS_Relationship_RightNodeID")] +public class CmsRelationship +{ + [Key] + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + public string? RelationshipCustomData { get; set; } + + public int? RelationshipOrder { get; set; } + + public bool? RelationshipIsAdHoc { get; set; } + + [ForeignKey("LeftNodeId")] + [InverseProperty("CmsRelationshipLeftNodes")] + public virtual CmsTree LeftNode { get; set; } = null!; + + [ForeignKey("RelationshipNameId")] + [InverseProperty("CmsRelationships")] + public virtual CmsRelationshipName RelationshipName { get; set; } = null!; + + [ForeignKey("RightNodeId")] + [InverseProperty("CmsRelationshipRightNodes")] + public virtual CmsTree RightNode { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs b/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs index 131bfe34..f63cf485 100644 --- a/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs +++ b/Migration.Toolkit.KX13/Models/CmsRelationshipName.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_RelationshipName")] -[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] -[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] -public partial class CmsRelationshipName -{ - [Key] - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - public string? RelationshipAllowedObjects { get; set; } - - [Column("RelationshipGUID")] - public Guid RelationshipGuid { get; set; } - - public DateTime RelationshipLastModified { get; set; } - - public bool? RelationshipNameIsAdHoc { get; set; } - - [InverseProperty("RelationshipName")] - public virtual ICollection CmsRelationships { get; set; } = new List(); - - [ForeignKey("RelationshipNameId")] - [InverseProperty("RelationshipNames")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_RelationshipName")] +[Index("RelationshipAllowedObjects", Name = "IX_CMS_RelationshipName_RelationshipAllowedObjects")] +[Index("RelationshipName", "RelationshipDisplayName", Name = "IX_CMS_RelationshipName_RelationshipName_RelationshipDisplayName")] +public class CmsRelationshipName +{ + [Key] + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + public string? RelationshipAllowedObjects { get; set; } + + [Column("RelationshipGUID")] + public Guid RelationshipGuid { get; set; } + + public DateTime RelationshipLastModified { get; set; } + + public bool? RelationshipNameIsAdHoc { get; set; } + + [InverseProperty("RelationshipName")] + public virtual ICollection CmsRelationships { get; set; } = new List(); + + [ForeignKey("RelationshipNameId")] + [InverseProperty("RelationshipNames")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsResource.cs b/Migration.Toolkit.KX13/Models/CmsResource.cs index 25b42c57..692847db 100644 --- a/Migration.Toolkit.KX13/Models/CmsResource.cs +++ b/Migration.Toolkit.KX13/Models/CmsResource.cs @@ -1,85 +1,84 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Resource")] -[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] -public partial class CmsResource -{ - [Key] - [Column("ResourceID")] - public int ResourceId { get; set; } - - [StringLength(100)] - public string ResourceDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - public string? ResourceDescription { get; set; } - - public bool? ShowInDevelopment { get; set; } - - [Column("ResourceURL")] - [StringLength(1000)] - public string? ResourceUrl { get; set; } - - [Column("ResourceGUID")] - public Guid ResourceGuid { get; set; } - - public DateTime ResourceLastModified { get; set; } - - public bool? ResourceIsInDevelopment { get; set; } - - public bool? ResourceHasFiles { get; set; } - - [StringLength(200)] - public string? ResourceVersion { get; set; } - - [StringLength(200)] - public string? ResourceAuthor { get; set; } - - [StringLength(50)] - public string? ResourceInstallationState { get; set; } - - [StringLength(50)] - public string? ResourceInstalledVersion { get; set; } - - [InverseProperty("ClassResource")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("UserControlResource")] - public virtual ICollection CmsFormUserControls { get; set; } = new List(); - - [InverseProperty("ModuleLicenseKeyResource")] - public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); - - [InverseProperty("Resource")] - public virtual ICollection CmsPermissions { get; set; } = new List(); - - [InverseProperty("ResourceLibraryResource")] - public virtual ICollection CmsResourceLibraries { get; set; } = new List(); - - [InverseProperty("TaskResource")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("CategoryResource")] - public virtual ICollection CmsSettingsCategories { get; set; } = new List(); - - [InverseProperty("ElementResource")] - public virtual ICollection CmsUielements { get; set; } = new List(); - - [InverseProperty("WebPartResource")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("ActionResource")] - public virtual ICollection CmsWorkflowActions { get; set; } = new List(); - - [ForeignKey("ResourceId")] - [InverseProperty("Resources")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Resource")] +[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] +public class CmsResource +{ + [Key] + [Column("ResourceID")] + public int ResourceId { get; set; } + + [StringLength(100)] + public string ResourceDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + public string? ResourceDescription { get; set; } + + public bool? ShowInDevelopment { get; set; } + + [Column("ResourceURL")] + [StringLength(1000)] + public string? ResourceUrl { get; set; } + + [Column("ResourceGUID")] + public Guid ResourceGuid { get; set; } + + public DateTime ResourceLastModified { get; set; } + + public bool? ResourceIsInDevelopment { get; set; } + + public bool? ResourceHasFiles { get; set; } + + [StringLength(200)] + public string? ResourceVersion { get; set; } + + [StringLength(200)] + public string? ResourceAuthor { get; set; } + + [StringLength(50)] + public string? ResourceInstallationState { get; set; } + + [StringLength(50)] + public string? ResourceInstalledVersion { get; set; } + + [InverseProperty("ClassResource")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("UserControlResource")] + public virtual ICollection CmsFormUserControls { get; set; } = new List(); + + [InverseProperty("ModuleLicenseKeyResource")] + public virtual ICollection CmsModuleLicenseKeys { get; set; } = new List(); + + [InverseProperty("Resource")] + public virtual ICollection CmsPermissions { get; set; } = new List(); + + [InverseProperty("ResourceLibraryResource")] + public virtual ICollection CmsResourceLibraries { get; set; } = new List(); + + [InverseProperty("TaskResource")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("CategoryResource")] + public virtual ICollection CmsSettingsCategories { get; set; } = new List(); + + [InverseProperty("ElementResource")] + public virtual ICollection CmsUielements { get; set; } = new List(); + + [InverseProperty("WebPartResource")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("ActionResource")] + public virtual ICollection CmsWorkflowActions { get; set; } = new List(); + + [ForeignKey("ResourceId")] + [InverseProperty("Resources")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs b/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs index 85fb87cb..84ceb3b2 100644 --- a/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs +++ b/Migration.Toolkit.KX13/Models/CmsResourceLibrary.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ResourceLibrary")] -[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] -public partial class CmsResourceLibrary -{ - [Key] - [Column("ResourceLibraryID")] - public int ResourceLibraryId { get; set; } - - [Column("ResourceLibraryResourceID")] - public int ResourceLibraryResourceId { get; set; } - - [StringLength(200)] - public string ResourceLibraryPath { get; set; } = null!; - - [ForeignKey("ResourceLibraryResourceId")] - [InverseProperty("CmsResourceLibraries")] - public virtual CmsResource ResourceLibraryResource { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ResourceLibrary")] +[Index("ResourceLibraryResourceId", Name = "IX_CMS_ResourceLibrary")] +public class CmsResourceLibrary +{ + [Key] + [Column("ResourceLibraryID")] + public int ResourceLibraryId { get; set; } + + [Column("ResourceLibraryResourceID")] + public int ResourceLibraryResourceId { get; set; } + + [StringLength(200)] + public string ResourceLibraryPath { get; set; } = null!; + + [ForeignKey("ResourceLibraryResourceId")] + [InverseProperty("CmsResourceLibraries")] + public virtual CmsResource ResourceLibraryResource { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsResourceString.cs b/Migration.Toolkit.KX13/Models/CmsResourceString.cs index 2cb81d21..761d3b81 100644 --- a/Migration.Toolkit.KX13/Models/CmsResourceString.cs +++ b/Migration.Toolkit.KX13/Models/CmsResourceString.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ResourceString")] -[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] -public partial class CmsResourceString -{ - [Key] - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("StringGUID")] - public Guid StringGuid { get; set; } - - [InverseProperty("TranslationString")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ResourceString")] +[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] +public class CmsResourceString +{ + [Key] + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("StringGUID")] + public Guid StringGuid { get; set; } + + [InverseProperty("TranslationString")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs index cc65c9fa..ceaa3cfc 100644 --- a/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs +++ b/Migration.Toolkit.KX13/Models/CmsResourceTranslation.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ResourceTranslation")] -[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] -[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] -public partial class CmsResourceTranslation -{ - [Key] - [Column("TranslationID")] - public int TranslationId { get; set; } - - [Column("TranslationStringID")] - public int TranslationStringId { get; set; } - - public string? TranslationText { get; set; } - - [Column("TranslationCultureID")] - public int TranslationCultureId { get; set; } - - [ForeignKey("TranslationCultureId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsCulture TranslationCulture { get; set; } = null!; - - [ForeignKey("TranslationStringId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsResourceString TranslationString { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ResourceTranslation")] +[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] +[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] +public class CmsResourceTranslation +{ + [Key] + [Column("TranslationID")] + public int TranslationId { get; set; } + + [Column("TranslationStringID")] + public int TranslationStringId { get; set; } + + public string? TranslationText { get; set; } + + [Column("TranslationCultureID")] + public int TranslationCultureId { get; set; } + + [ForeignKey("TranslationCultureId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsCulture TranslationCulture { get; set; } = null!; + + [ForeignKey("TranslationStringId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsResourceString TranslationString { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsRole.cs b/Migration.Toolkit.KX13/Models/CmsRole.cs index 0d5c5d62..6bb47832 100644 --- a/Migration.Toolkit.KX13/Models/CmsRole.cs +++ b/Migration.Toolkit.KX13/Models/CmsRole.cs @@ -1,73 +1,72 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Role")] -[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] -public partial class CmsRole -{ - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - public DateTime RoleLastModified { get; set; } - - public bool? RoleIsDomain { get; set; } - - [InverseProperty("Role")] - public virtual ICollection CmsAclitems { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("CmsRoles")] - public virtual CmsSite? Site { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Elements { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("RolesNavigation")] - public virtual ICollection ElementsNavigation { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Forms { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Memberships { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Permissions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Role")] +[Index("SiteId", "RoleId", Name = "IX_CMS_Role_SiteID_RoleID")] +public class CmsRole +{ + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + public DateTime RoleLastModified { get; set; } + + public bool? RoleIsDomain { get; set; } + + [InverseProperty("Role")] + public virtual ICollection CmsAclitems { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("CmsRoles")] + public virtual CmsSite? Site { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Elements { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("RolesNavigation")] + public virtual ICollection ElementsNavigation { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Forms { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Memberships { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Permissions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs b/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs index f37f4bb4..266457bd 100644 --- a/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs +++ b/Migration.Toolkit.KX13/Models/CmsScheduledTask.cs @@ -1,114 +1,113 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_ScheduledTask")] -[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] -[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] -[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] -[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] -public partial class CmsScheduledTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(200)] - public string TaskName { get; set; } = null!; - - [StringLength(200)] - public string TaskDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TaskAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string? TaskClass { get; set; } - - [StringLength(1000)] - public string TaskInterval { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime? TaskLastRunTime { get; set; } - - public DateTime? TaskNextRunTime { get; set; } - - public string? TaskLastResult { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - public bool? TaskDeleteAfterLastRun { get; set; } - - [StringLength(100)] - public string? TaskServerName { get; set; } - - [Column("TaskGUID")] - public Guid TaskGuid { get; set; } - - public DateTime TaskLastModified { get; set; } - - public int? TaskExecutions { get; set; } - - [Column("TaskResourceID")] - public int? TaskResourceId { get; set; } - - public bool? TaskRunInSeparateThread { get; set; } - - public bool? TaskUseExternalService { get; set; } - - public bool? TaskAllowExternalService { get; set; } - - public DateTime? TaskLastExecutionReset { get; set; } - - [StringLength(400)] - public string? TaskCondition { get; set; } - - public bool? TaskRunIndividually { get; set; } - - [Column("TaskUserID")] - public int? TaskUserId { get; set; } - - public int? TaskType { get; set; } - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [StringLength(200)] - public string? TaskExecutingServerName { get; set; } - - public bool TaskEnabled { get; set; } - - public bool TaskIsRunning { get; set; } - - public int TaskAvailability { get; set; } - - [InverseProperty("CampaignScheduledTask")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("TestWinnerScheduledTask")] - public virtual ICollection NewsletterAbtests { get; set; } = new List(); - - [InverseProperty("NewsletterDynamicScheduledTask")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [ForeignKey("TaskResourceId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsResource? TaskResource { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsSite? TaskSite { get; set; } - - [ForeignKey("TaskUserId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsUser? TaskUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_ScheduledTask")] +[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] +[Index("TaskResourceId", Name = "IX_CMS_ScheduledTask_TaskResourceID")] +[Index("TaskSiteId", "TaskDisplayName", Name = "IX_CMS_ScheduledTask_TaskSiteID_TaskDisplayName")] +[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] +public class CmsScheduledTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(200)] + public string TaskName { get; set; } = null!; + + [StringLength(200)] + public string TaskDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TaskAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string? TaskClass { get; set; } + + [StringLength(1000)] + public string TaskInterval { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime? TaskLastRunTime { get; set; } + + public DateTime? TaskNextRunTime { get; set; } + + public string? TaskLastResult { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + public bool? TaskDeleteAfterLastRun { get; set; } + + [StringLength(100)] + public string? TaskServerName { get; set; } + + [Column("TaskGUID")] + public Guid TaskGuid { get; set; } + + public DateTime TaskLastModified { get; set; } + + public int? TaskExecutions { get; set; } + + [Column("TaskResourceID")] + public int? TaskResourceId { get; set; } + + public bool? TaskRunInSeparateThread { get; set; } + + public bool? TaskUseExternalService { get; set; } + + public bool? TaskAllowExternalService { get; set; } + + public DateTime? TaskLastExecutionReset { get; set; } + + [StringLength(400)] + public string? TaskCondition { get; set; } + + public bool? TaskRunIndividually { get; set; } + + [Column("TaskUserID")] + public int? TaskUserId { get; set; } + + public int? TaskType { get; set; } + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [StringLength(200)] + public string? TaskExecutingServerName { get; set; } + + public bool TaskEnabled { get; set; } + + public bool TaskIsRunning { get; set; } + + public int TaskAvailability { get; set; } + + [InverseProperty("CampaignScheduledTask")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("TestWinnerScheduledTask")] + public virtual ICollection NewsletterAbtests { get; set; } = new List(); + + [InverseProperty("NewsletterDynamicScheduledTask")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [ForeignKey("TaskResourceId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsResource? TaskResource { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsSite? TaskSite { get; set; } + + [ForeignKey("TaskUserId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsUser? TaskUser { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs b/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs index 4440f0d6..40f37e19 100644 --- a/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs +++ b/Migration.Toolkit.KX13/Models/CmsSearchEngine.cs @@ -1,35 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SearchEngine")] -public partial class CmsSearchEngine -{ - [Key] - [Column("SearchEngineID")] - public int SearchEngineId { get; set; } - - [StringLength(200)] - public string SearchEngineDisplayName { get; set; } = null!; - - [StringLength(200)] - public string SearchEngineName { get; set; } = null!; - - [StringLength(450)] - public string SearchEngineDomainRule { get; set; } = null!; - - [StringLength(200)] - public string? SearchEngineKeywordParameter { get; set; } - - [Column("SearchEngineGUID")] - public Guid SearchEngineGuid { get; set; } - - public DateTime SearchEngineLastModified { get; set; } - - [StringLength(200)] - public string? SearchEngineCrawler { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_SearchEngine")] +public class CmsSearchEngine +{ + [Key] + [Column("SearchEngineID")] + public int SearchEngineId { get; set; } + + [StringLength(200)] + public string SearchEngineDisplayName { get; set; } = null!; + + [StringLength(200)] + public string SearchEngineName { get; set; } = null!; + + [StringLength(450)] + public string SearchEngineDomainRule { get; set; } = null!; + + [StringLength(200)] + public string? SearchEngineKeywordParameter { get; set; } + + [Column("SearchEngineGUID")] + public Guid SearchEngineGuid { get; set; } + + public DateTime SearchEngineLastModified { get; set; } + + [StringLength(200)] + public string? SearchEngineCrawler { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs b/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs index aa16d5fc..1845b4c1 100644 --- a/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs +++ b/Migration.Toolkit.KX13/Models/CmsSearchIndex.cs @@ -1,77 +1,74 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SearchIndex")] -public partial class CmsSearchIndex -{ - [Key] - [Column("IndexID")] - public int IndexId { get; set; } - - [StringLength(200)] - public string IndexName { get; set; } = null!; - - [StringLength(200)] - public string IndexDisplayName { get; set; } = null!; - - [StringLength(200)] - public string? IndexAnalyzerType { get; set; } - - public string? IndexSettings { get; set; } - - [Column("IndexGUID")] - public Guid IndexGuid { get; set; } - - public DateTime IndexLastModified { get; set; } - - public DateTime? IndexLastRebuildTime { get; set; } - - [StringLength(200)] - public string IndexType { get; set; } = null!; - - [StringLength(200)] - public string? IndexStopWordsFile { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerAssemblyName { get; set; } - - [StringLength(200)] - public string? IndexCustomAnalyzerClassName { get; set; } - - public int? IndexBatchSize { get; set; } - - [StringLength(10)] - public string? IndexStatus { get; set; } - - public DateTime? IndexLastUpdate { get; set; } - - public bool? IndexIsOutdated { get; set; } - - [StringLength(200)] - public string IndexProvider { get; set; } = null!; - - [StringLength(200)] - public string? IndexSearchServiceName { get; set; } - - [StringLength(200)] - public string? IndexAdminKey { get; set; } - - [StringLength(200)] - public string? IndexQueryKey { get; set; } - - [StringLength(200)] - public string? IndexCrawlerUser { get; set; } - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexCultures { get; set; } = new List(); - - [ForeignKey("IndexId")] - [InverseProperty("Indices")] - public virtual ICollection IndexSites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_SearchIndex")] +public class CmsSearchIndex +{ + [Key] + [Column("IndexID")] + public int IndexId { get; set; } + + [StringLength(200)] + public string IndexName { get; set; } = null!; + + [StringLength(200)] + public string IndexDisplayName { get; set; } = null!; + + [StringLength(200)] + public string? IndexAnalyzerType { get; set; } + + public string? IndexSettings { get; set; } + + [Column("IndexGUID")] + public Guid IndexGuid { get; set; } + + public DateTime IndexLastModified { get; set; } + + public DateTime? IndexLastRebuildTime { get; set; } + + [StringLength(200)] + public string IndexType { get; set; } = null!; + + [StringLength(200)] + public string? IndexStopWordsFile { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerAssemblyName { get; set; } + + [StringLength(200)] + public string? IndexCustomAnalyzerClassName { get; set; } + + public int? IndexBatchSize { get; set; } + + [StringLength(10)] + public string? IndexStatus { get; set; } + + public DateTime? IndexLastUpdate { get; set; } + + public bool? IndexIsOutdated { get; set; } + + [StringLength(200)] + public string IndexProvider { get; set; } = null!; + + [StringLength(200)] + public string? IndexSearchServiceName { get; set; } + + [StringLength(200)] + public string? IndexAdminKey { get; set; } + + [StringLength(200)] + public string? IndexQueryKey { get; set; } + + [StringLength(200)] + public string? IndexCrawlerUser { get; set; } + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexCultures { get; set; } = new List(); + + [ForeignKey("IndexId")] + [InverseProperty("Indices")] + public virtual ICollection IndexSites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsSearchTask.cs b/Migration.Toolkit.KX13/Models/CmsSearchTask.cs index 4a6f821b..2ebccb40 100644 --- a/Migration.Toolkit.KX13/Models/CmsSearchTask.cs +++ b/Migration.Toolkit.KX13/Models/CmsSearchTask.cs @@ -1,45 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SearchTask")] -public partial class CmsSearchTask -{ - [Key] - [Column("SearchTaskID")] - public int SearchTaskId { get; set; } - - [StringLength(100)] - public string SearchTaskType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskField { get; set; } - - [StringLength(600)] - public string SearchTaskValue { get; set; } = null!; - - [StringLength(200)] - public string? SearchTaskServerName { get; set; } - - [StringLength(100)] - public string SearchTaskStatus { get; set; } = null!; - - public int SearchTaskPriority { get; set; } - - public DateTime SearchTaskCreated { get; set; } - - public string? SearchTaskErrorMessage { get; set; } - - [Column("SearchTaskRelatedObjectID")] - public int? SearchTaskRelatedObjectId { get; set; } - - [StringLength(100)] - public string? SearchTaskIndexerName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_SearchTask")] +public class CmsSearchTask +{ + [Key] + [Column("SearchTaskID")] + public int SearchTaskId { get; set; } + + [StringLength(100)] + public string SearchTaskType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskField { get; set; } + + [StringLength(600)] + public string SearchTaskValue { get; set; } = null!; + + [StringLength(200)] + public string? SearchTaskServerName { get; set; } + + [StringLength(100)] + public string SearchTaskStatus { get; set; } = null!; + + public int SearchTaskPriority { get; set; } + + public DateTime SearchTaskCreated { get; set; } + + public string? SearchTaskErrorMessage { get; set; } + + [Column("SearchTaskRelatedObjectID")] + public int? SearchTaskRelatedObjectId { get; set; } + + [StringLength(100)] + public string? SearchTaskIndexerName { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs b/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs index 1ce6fa61..25281979 100644 --- a/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs +++ b/Migration.Toolkit.KX13/Models/CmsSearchTaskAzure.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SearchTaskAzure")] -[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] -public partial class CmsSearchTaskAzure -{ - [Key] - [Column("SearchTaskAzureID")] - public int SearchTaskAzureId { get; set; } - - [StringLength(100)] - public string SearchTaskAzureType { get; set; } = null!; - - [StringLength(100)] - public string? SearchTaskAzureObjectType { get; set; } - - [StringLength(200)] - public string? SearchTaskAzureMetadata { get; set; } - - [StringLength(600)] - public string SearchTaskAzureAdditionalData { get; set; } = null!; - - [Column("SearchTaskAzureInitiatorObjectID")] - public int? SearchTaskAzureInitiatorObjectId { get; set; } - - public int SearchTaskAzurePriority { get; set; } - - public string? SearchTaskAzureErrorMessage { get; set; } - - public DateTime SearchTaskAzureCreated { get; set; } - - [StringLength(100)] - public string? SearchTaskAzureIndexerName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_SearchTaskAzure")] +[Index("SearchTaskAzurePriority", Name = "IX_CMS_SearchTaskAzure_SearchTaskAzurePriority", AllDescending = true)] +public class CmsSearchTaskAzure +{ + [Key] + [Column("SearchTaskAzureID")] + public int SearchTaskAzureId { get; set; } + + [StringLength(100)] + public string SearchTaskAzureType { get; set; } = null!; + + [StringLength(100)] + public string? SearchTaskAzureObjectType { get; set; } + + [StringLength(200)] + public string? SearchTaskAzureMetadata { get; set; } + + [StringLength(600)] + public string SearchTaskAzureAdditionalData { get; set; } = null!; + + [Column("SearchTaskAzureInitiatorObjectID")] + public int? SearchTaskAzureInitiatorObjectId { get; set; } + + public int SearchTaskAzurePriority { get; set; } + + public string? SearchTaskAzureErrorMessage { get; set; } + + public DateTime SearchTaskAzureCreated { get; set; } + + [StringLength(100)] + public string? SearchTaskAzureIndexerName { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs index 83986bea..dfc27e04 100644 --- a/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsSettingsCategory.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SettingsCategory")] -[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] -[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] -public partial class CmsSettingsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - public int? CategoryOrder { get; set; } - - [StringLength(100)] - public string? CategoryName { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - [StringLength(200)] - public string? CategoryIconPath { get; set; } - - public bool? CategoryIsGroup { get; set; } - - public bool? CategoryIsCustom { get; set; } - - [Column("CategoryResourceID")] - public int? CategoryResourceId { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsSettingsCategory? CategoryParent { get; set; } - - [ForeignKey("CategoryResourceId")] - [InverseProperty("CmsSettingsCategories")] - public virtual CmsResource? CategoryResource { get; set; } - - [InverseProperty("KeyCategory")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_SettingsCategory")] +[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] +[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] +public class CmsSettingsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + public int? CategoryOrder { get; set; } + + [StringLength(100)] + public string? CategoryName { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + [StringLength(200)] + public string? CategoryIconPath { get; set; } + + public bool? CategoryIsGroup { get; set; } + + public bool? CategoryIsCustom { get; set; } + + [Column("CategoryResourceID")] + public int? CategoryResourceId { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsSettingsCategory? CategoryParent { get; set; } + + [ForeignKey("CategoryResourceId")] + [InverseProperty("CmsSettingsCategories")] + public virtual CmsResource? CategoryResource { get; set; } + + [InverseProperty("KeyCategory")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs b/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs index 8e72f866..faea7229 100644 --- a/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs +++ b/Migration.Toolkit.KX13/Models/CmsSettingsKey.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SettingsKey")] -[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] -[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] -public partial class CmsSettingsKey -{ - [Key] - [Column("KeyID")] - public int KeyId { get; set; } - - [StringLength(100)] - public string KeyName { get; set; } = null!; - - [StringLength(200)] - public string KeyDisplayName { get; set; } = null!; - - public string? KeyDescription { get; set; } - - public string? KeyValue { get; set; } - - [StringLength(50)] - public string KeyType { get; set; } = null!; - - [Column("KeyCategoryID")] - public int? KeyCategoryId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("KeyGUID")] - public Guid KeyGuid { get; set; } - - public DateTime KeyLastModified { get; set; } - - public int? KeyOrder { get; set; } - - public string? KeyDefaultValue { get; set; } - - [StringLength(255)] - public string? KeyValidation { get; set; } - - [StringLength(200)] - public string? KeyEditingControlPath { get; set; } - - public bool? KeyIsGlobal { get; set; } - - public bool? KeyIsCustom { get; set; } - - public bool? KeyIsHidden { get; set; } - - public string? KeyFormControlSettings { get; set; } - - public string? KeyExplanationText { get; set; } - - [ForeignKey("KeyCategoryId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSettingsCategory? KeyCategory { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSite? Site { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_SettingsKey")] +[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] +[Index("SiteId", "KeyName", Name = "IX_CMS_SettingsKey_SiteID_KeyName")] +public class CmsSettingsKey +{ + [Key] + [Column("KeyID")] + public int KeyId { get; set; } + + [StringLength(100)] + public string KeyName { get; set; } = null!; + + [StringLength(200)] + public string KeyDisplayName { get; set; } = null!; + + public string? KeyDescription { get; set; } + + public string? KeyValue { get; set; } + + [StringLength(50)] + public string KeyType { get; set; } = null!; + + [Column("KeyCategoryID")] + public int? KeyCategoryId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("KeyGUID")] + public Guid KeyGuid { get; set; } + + public DateTime KeyLastModified { get; set; } + + public int? KeyOrder { get; set; } + + public string? KeyDefaultValue { get; set; } + + [StringLength(255)] + public string? KeyValidation { get; set; } + + [StringLength(200)] + public string? KeyEditingControlPath { get; set; } + + public bool? KeyIsGlobal { get; set; } + + public bool? KeyIsCustom { get; set; } + + public bool? KeyIsHidden { get; set; } + + public string? KeyFormControlSettings { get; set; } + + public string? KeyExplanationText { get; set; } + + [ForeignKey("KeyCategoryId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSettingsCategory? KeyCategory { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSite? Site { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsSite.cs b/Migration.Toolkit.KX13/Models/CmsSite.cs index 89de8e40..f04cc503 100644 --- a/Migration.Toolkit.KX13/Models/CmsSite.cs +++ b/Migration.Toolkit.KX13/Models/CmsSite.cs @@ -1,311 +1,310 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Site")] -[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] -[Index("SiteName", Name = "IX_CMS_Site_SiteName")] -public partial class CmsSite -{ - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - [Column("SitePresentationURL")] - [StringLength(400)] - public string SitePresentationUrl { get; set; } = null!; - - [InverseProperty("CampaignSite")] - public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); - - [InverseProperty("ExitPageSite")] - public virtual ICollection AnalyticsExitPages { get; set; } = new List(); - - [InverseProperty("StatisticsSite")] - public virtual ICollection AnalyticsStatistics { get; set; } = new List(); - - [InverseProperty("Aclsite")] - public virtual ICollection CmsAcls { get; set; } = new List(); - - [InverseProperty("AlternativeUrlSite")] - public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); - - [InverseProperty("AttachmentSite")] - public virtual ICollection CmsAttachments { get; set; } = new List(); - - [InverseProperty("StateSite")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); - - [InverseProperty("EmailTemplateSite")] - public virtual ICollection CmsEmailTemplates { get; set; } = new List(); - - [InverseProperty("FormSite")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("MembershipSite")] - public virtual ICollection CmsMemberships { get; set; } = new List(); - - [InverseProperty("MetaFileSite")] - public virtual ICollection CmsMetaFiles { get; set; } = new List(); - - [InverseProperty("VersionObjectSite")] - public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); - - [InverseProperty("PageFormerUrlPathSite")] - public virtual ICollection CmsPageFormerUrlPaths { get; set; } = new List(); - - [InverseProperty("PageTemplateConfigurationSite")] - public virtual ICollection CmsPageTemplateConfigurations { get; set; } = new List(); - - [InverseProperty("PageUrlPathSite")] - public virtual ICollection CmsPageUrlPaths { get; set; } = new List(); - - [InverseProperty("PersonalizationSite")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsRoles { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); - - [InverseProperty("TagGroupSite")] - public virtual ICollection CmsTagGroups { get; set; } = new List(); - - [InverseProperty("NodeLinkedNodeSite")] - public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("NodeSite")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("ScopeSite")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("BrandSite")] - public virtual ICollection ComBrands { get; set; } = new List(); - - [InverseProperty("CarrierSite")] - public virtual ICollection ComCarriers { get; set; } = new List(); - - [InverseProperty("CollectionSite")] - public virtual ICollection ComCollections { get; set; } = new List(); - - [InverseProperty("CurrencySite")] - public virtual ICollection ComCurrencies { get; set; } = new List(); - - [InverseProperty("EventSite")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("CustomerSite")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("DepartmentSite")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("DiscountSite")] - public virtual ICollection ComDiscounts { get; set; } = new List(); - - [InverseProperty("ExchangeTableSite")] - public virtual ICollection ComExchangeTables { get; set; } = new List(); - - [InverseProperty("GiftCardSite")] - public virtual ICollection ComGiftCards { get; set; } = new List(); - - [InverseProperty("InternalStatusSite")] - public virtual ICollection ComInternalStatuses { get; set; } = new List(); - - [InverseProperty("ManufacturerSite")] - public virtual ICollection ComManufacturers { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountSite")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("CategorySite")] - public virtual ICollection ComOptionCategories { get; set; } = new List(); - - [InverseProperty("StatusSite")] - public virtual ICollection ComOrderStatuses { get; set; } = new List(); - - [InverseProperty("OrderSite")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionSite")] - public virtual ICollection ComPaymentOptions { get; set; } = new List(); - - [InverseProperty("PublicStatusSite")] - public virtual ICollection ComPublicStatuses { get; set; } = new List(); - - [InverseProperty("ShippingOptionSite")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("ShoppingCartSite")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("Skusite")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("SupplierSite")] - public virtual ICollection ComSuppliers { get; set; } = new List(); - - [InverseProperty("TaxClassSite")] - public virtual ICollection ComTaxClasses { get; set; } = new List(); - - [InverseProperty("Site")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("ExportSite")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection ExportTasks { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection IntegrationTasks { get; set; } = new List(); - - [InverseProperty("FileSite")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("LibrarySite")] - public virtual ICollection MediaLibraries { get; set; } = new List(); - - [InverseProperty("TemplateSite")] - public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); - - [InverseProperty("EmailWidgetSite")] - public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); - - [InverseProperty("EmailSite")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("IssueSite")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterSite")] - public virtual ICollection NewsletterNewsletters { get; set; } = new List(); - - [InverseProperty("SubscriberSite")] - public virtual ICollection NewsletterSubscribers { get; set; } = new List(); - - [InverseProperty("AbtestSite")] - public virtual ICollection OmAbtests { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionSite")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SharePointConnectionSite")] - public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); - - [InverseProperty("SharePointFileSite")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); - - [InverseProperty("SharePointLibrarySite")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); - - [InverseProperty("FacebookAccountSite")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); - - [InverseProperty("FacebookApplicationSite")] - public virtual ICollection SmFacebookApplications { get; set; } = new List(); - - [InverseProperty("FacebookPostSite")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); - - [InverseProperty("LinkedInApplicationSite")] - public virtual ICollection SmLinkedInApplications { get; set; } = new List(); - - [InverseProperty("LinkedInPostSite")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); - - [InverseProperty("TwitterAccountSite")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [InverseProperty("TwitterApplicationSite")] - public virtual ICollection SmTwitterApplications { get; set; } = new List(); - - [InverseProperty("TwitterPostSite")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [InverseProperty("ServerSite")] - public virtual ICollection StagingServers { get; set; } = new List(); - - [InverseProperty("TaskSite")] - public virtual ICollection StagingTasks { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Classes { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Containers { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Cultures { get; set; } = new List(); - - [ForeignKey("IndexSiteId")] - [InverseProperty("IndexSites")] - public virtual ICollection Indices { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection RelationshipNames { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Resources { get; set; } = new List(); - - [ForeignKey("SiteId")] - [InverseProperty("Sites")] - public virtual ICollection Servers { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Site")] +[Index("SiteDomainName", "SiteStatus", Name = "IX_CMS_Site_SiteDomainName_SiteStatus")] +[Index("SiteName", Name = "IX_CMS_Site_SiteName")] +public class CmsSite +{ + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + [Column("SitePresentationURL")] + [StringLength(400)] + public string SitePresentationUrl { get; set; } = null!; + + [InverseProperty("CampaignSite")] + public virtual ICollection AnalyticsCampaigns { get; set; } = new List(); + + [InverseProperty("ExitPageSite")] + public virtual ICollection AnalyticsExitPages { get; set; } = new List(); + + [InverseProperty("StatisticsSite")] + public virtual ICollection AnalyticsStatistics { get; set; } = new List(); + + [InverseProperty("Aclsite")] + public virtual ICollection CmsAcls { get; set; } = new List(); + + [InverseProperty("AlternativeUrlSite")] + public virtual ICollection CmsAlternativeUrls { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachmentHistories { get; set; } = new List(); + + [InverseProperty("AttachmentSite")] + public virtual ICollection CmsAttachments { get; set; } = new List(); + + [InverseProperty("StateSite")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsDocumentTypeScopes { get; set; } = new List(); + + [InverseProperty("EmailTemplateSite")] + public virtual ICollection CmsEmailTemplates { get; set; } = new List(); + + [InverseProperty("FormSite")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("MembershipSite")] + public virtual ICollection CmsMemberships { get; set; } = new List(); + + [InverseProperty("MetaFileSite")] + public virtual ICollection CmsMetaFiles { get; set; } = new List(); + + [InverseProperty("VersionObjectSite")] + public virtual ICollection CmsObjectVersionHistories { get; set; } = new List(); + + [InverseProperty("PageFormerUrlPathSite")] + public virtual ICollection CmsPageFormerUrlPaths { get; set; } = new List(); + + [InverseProperty("PageTemplateConfigurationSite")] + public virtual ICollection CmsPageTemplateConfigurations { get; set; } = new List(); + + [InverseProperty("PageUrlPathSite")] + public virtual ICollection CmsPageUrlPaths { get; set; } = new List(); + + [InverseProperty("PersonalizationSite")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsRoles { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsSiteDomainAliases { get; set; } = new List(); + + [InverseProperty("TagGroupSite")] + public virtual ICollection CmsTagGroups { get; set; } = new List(); + + [InverseProperty("NodeLinkedNodeSite")] + public virtual ICollection CmsTreeNodeLinkedNodeSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsTreeNodeSites { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("NodeSite")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("ScopeSite")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("BrandSite")] + public virtual ICollection ComBrands { get; set; } = new List(); + + [InverseProperty("CarrierSite")] + public virtual ICollection ComCarriers { get; set; } = new List(); + + [InverseProperty("CollectionSite")] + public virtual ICollection ComCollections { get; set; } = new List(); + + [InverseProperty("CurrencySite")] + public virtual ICollection ComCurrencies { get; set; } = new List(); + + [InverseProperty("EventSite")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("CustomerSite")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("DepartmentSite")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("DiscountSite")] + public virtual ICollection ComDiscounts { get; set; } = new List(); + + [InverseProperty("ExchangeTableSite")] + public virtual ICollection ComExchangeTables { get; set; } = new List(); + + [InverseProperty("GiftCardSite")] + public virtual ICollection ComGiftCards { get; set; } = new List(); + + [InverseProperty("InternalStatusSite")] + public virtual ICollection ComInternalStatuses { get; set; } = new List(); + + [InverseProperty("ManufacturerSite")] + public virtual ICollection ComManufacturers { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountSite")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("CategorySite")] + public virtual ICollection ComOptionCategories { get; set; } = new List(); + + [InverseProperty("StatusSite")] + public virtual ICollection ComOrderStatuses { get; set; } = new List(); + + [InverseProperty("OrderSite")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionSite")] + public virtual ICollection ComPaymentOptions { get; set; } = new List(); + + [InverseProperty("PublicStatusSite")] + public virtual ICollection ComPublicStatuses { get; set; } = new List(); + + [InverseProperty("ShippingOptionSite")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("ShoppingCartSite")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("Skusite")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("SupplierSite")] + public virtual ICollection ComSuppliers { get; set; } = new List(); + + [InverseProperty("TaxClassSite")] + public virtual ICollection ComTaxClasses { get; set; } = new List(); + + [InverseProperty("Site")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("ExportSite")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection ExportTasks { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection IntegrationTasks { get; set; } = new List(); + + [InverseProperty("FileSite")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("LibrarySite")] + public virtual ICollection MediaLibraries { get; set; } = new List(); + + [InverseProperty("TemplateSite")] + public virtual ICollection NewsletterEmailTemplates { get; set; } = new List(); + + [InverseProperty("EmailWidgetSite")] + public virtual ICollection NewsletterEmailWidgets { get; set; } = new List(); + + [InverseProperty("EmailSite")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("IssueSite")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterSite")] + public virtual ICollection NewsletterNewsletters { get; set; } = new List(); + + [InverseProperty("SubscriberSite")] + public virtual ICollection NewsletterSubscribers { get; set; } = new List(); + + [InverseProperty("AbtestSite")] + public virtual ICollection OmAbtests { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionSite")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SharePointConnectionSite")] + public virtual ICollection SharePointSharePointConnections { get; set; } = new List(); + + [InverseProperty("SharePointFileSite")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); + + [InverseProperty("SharePointLibrarySite")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); + + [InverseProperty("FacebookAccountSite")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); + + [InverseProperty("FacebookApplicationSite")] + public virtual ICollection SmFacebookApplications { get; set; } = new List(); + + [InverseProperty("FacebookPostSite")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); + + [InverseProperty("LinkedInApplicationSite")] + public virtual ICollection SmLinkedInApplications { get; set; } = new List(); + + [InverseProperty("LinkedInPostSite")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); + + [InverseProperty("TwitterAccountSite")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [InverseProperty("TwitterApplicationSite")] + public virtual ICollection SmTwitterApplications { get; set; } = new List(); + + [InverseProperty("TwitterPostSite")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [InverseProperty("ServerSite")] + public virtual ICollection StagingServers { get; set; } = new List(); + + [InverseProperty("TaskSite")] + public virtual ICollection StagingTasks { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Classes { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Containers { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Cultures { get; set; } = new List(); + + [ForeignKey("IndexSiteId")] + [InverseProperty("IndexSites")] + public virtual ICollection Indices { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection RelationshipNames { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Resources { get; set; } = new List(); + + [ForeignKey("SiteId")] + [InverseProperty("Sites")] + public virtual ICollection Servers { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs b/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs index 1719c229..cb2c3057 100644 --- a/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs +++ b/Migration.Toolkit.KX13/Models/CmsSiteDomainAlias.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SiteDomainAlias")] -[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] -[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] -public partial class CmsSiteDomainAlias -{ - [Key] - [Column("SiteDomainAliasID")] - public int SiteDomainAliasId { get; set; } - - [StringLength(400)] - public string? SiteDomainAliasName { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteDomainGUID")] - public Guid? SiteDomainGuid { get; set; } - - public DateTime SiteDomainLastModified { get; set; } - - [StringLength(400)] - public string? SiteDomainPresentationUrl { get; set; } - - public int SiteDomainAliasType { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsSiteDomainAliases")] - public virtual CmsSite Site { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_SiteDomainAlias")] +[Index("SiteDomainAliasName", Name = "IX_CMS_SiteDomainAlias_SiteDomainAliasName")] +[Index("SiteId", Name = "IX_CMS_SiteDomainAlias_SiteID")] +public class CmsSiteDomainAlias +{ + [Key] + [Column("SiteDomainAliasID")] + public int SiteDomainAliasId { get; set; } + + [StringLength(400)] + public string? SiteDomainAliasName { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteDomainGUID")] + public Guid? SiteDomainGuid { get; set; } + + public DateTime SiteDomainLastModified { get; set; } + + [StringLength(400)] + public string? SiteDomainPresentationUrl { get; set; } + + public int SiteDomainAliasType { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsSiteDomainAliases")] + public virtual CmsSite Site { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs b/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs index 372fe6cd..54dca9a6 100644 --- a/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs +++ b/Migration.Toolkit.KX13/Models/CmsSmtpserver.cs @@ -1,47 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_SMTPServer")] -public partial class CmsSmtpserver -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(200)] - public string ServerName { get; set; } = null!; - - [StringLength(50)] - public string? ServerUserName { get; set; } - - [StringLength(200)] - public string? ServerPassword { get; set; } - - [Column("ServerUseSSL")] - public bool ServerUseSsl { get; set; } - - public bool ServerEnabled { get; set; } - - public bool ServerIsGlobal { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public int? ServerPriority { get; set; } - - public int? ServerDeliveryMethod { get; set; } - - [StringLength(450)] - public string? ServerPickupDirectory { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("Servers")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_SMTPServer")] +public class CmsSmtpserver +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(200)] + public string ServerName { get; set; } = null!; + + [StringLength(50)] + public string? ServerUserName { get; set; } + + [StringLength(200)] + public string? ServerPassword { get; set; } + + [Column("ServerUseSSL")] + public bool ServerUseSsl { get; set; } + + public bool ServerEnabled { get; set; } + + public bool ServerIsGlobal { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public int? ServerPriority { get; set; } + + public int? ServerDeliveryMethod { get; set; } + + [StringLength(450)] + public string? ServerPickupDirectory { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("Servers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsState.cs b/Migration.Toolkit.KX13/Models/CmsState.cs index 97540d4c..1cd891a2 100644 --- a/Migration.Toolkit.KX13/Models/CmsState.cs +++ b/Migration.Toolkit.KX13/Models/CmsState.cs @@ -1,53 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_State")] -[Index("CountryId", Name = "IX_CMS_State_CountryID")] -[Index("StateCode", Name = "IX_CMS_State_StateCode")] -public partial class CmsState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [StringLength(200)] - public string StateDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StateName { get; set; } = null!; - - [StringLength(100)] - public string? StateCode { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public DateTime StateLastModified { get; set; } - - [InverseProperty("AddressState")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("AddressState")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("State")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("CountryId")] - [InverseProperty("CmsStates")] - public virtual CmsCountry Country { get; set; } = null!; - - [InverseProperty("AccountState")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactState")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_State")] +[Index("CountryId", Name = "IX_CMS_State_CountryID")] +[Index("StateCode", Name = "IX_CMS_State_StateCode")] +public class CmsState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [StringLength(200)] + public string StateDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StateName { get; set; } = null!; + + [StringLength(100)] + public string? StateCode { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public DateTime StateLastModified { get; set; } + + [InverseProperty("AddressState")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("AddressState")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("State")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("CountryId")] + [InverseProperty("CmsStates")] + public virtual CmsCountry Country { get; set; } = null!; + + [InverseProperty("AccountState")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactState")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsTag.cs b/Migration.Toolkit.KX13/Models/CmsTag.cs index df626de1..e2737d6a 100644 --- a/Migration.Toolkit.KX13/Models/CmsTag.cs +++ b/Migration.Toolkit.KX13/Models/CmsTag.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Tag")] -[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] -public partial class CmsTag -{ - [Key] - [Column("TagID")] - public int TagId { get; set; } - - [StringLength(250)] - public string TagName { get; set; } = null!; - - public int TagCount { get; set; } - - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [Column("TagGUID")] - public Guid TagGuid { get; set; } - - [ForeignKey("TagGroupId")] - [InverseProperty("CmsTags")] - public virtual CmsTagGroup TagGroup { get; set; } = null!; - - [ForeignKey("TagId")] - [InverseProperty("Tags")] - public virtual ICollection Documents { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Tag")] +[Index("TagGroupId", Name = "IX_CMS_Tag_TagGroupID")] +public class CmsTag +{ + [Key] + [Column("TagID")] + public int TagId { get; set; } + + [StringLength(250)] + public string TagName { get; set; } = null!; + + public int TagCount { get; set; } + + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [Column("TagGUID")] + public Guid TagGuid { get; set; } + + [ForeignKey("TagGroupId")] + [InverseProperty("CmsTags")] + public virtual CmsTagGroup TagGroup { get; set; } = null!; + + [ForeignKey("TagId")] + [InverseProperty("Tags")] + public virtual ICollection Documents { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsTagGroup.cs b/Migration.Toolkit.KX13/Models/CmsTagGroup.cs index 3df7be83..efe1458b 100644 --- a/Migration.Toolkit.KX13/Models/CmsTagGroup.cs +++ b/Migration.Toolkit.KX13/Models/CmsTagGroup.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TagGroup")] -[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] -public partial class CmsTagGroup -{ - [Key] - [Column("TagGroupID")] - public int TagGroupId { get; set; } - - [StringLength(250)] - public string TagGroupDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TagGroupName { get; set; } = null!; - - public string? TagGroupDescription { get; set; } - - [Column("TagGroupSiteID")] - public int TagGroupSiteId { get; set; } - - public bool TagGroupIsAdHoc { get; set; } - - public DateTime TagGroupLastModified { get; set; } - - [Column("TagGroupGUID")] - public Guid TagGroupGuid { get; set; } - - [InverseProperty("DocumentTagGroup")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("TagGroup")] - public virtual ICollection CmsTags { get; set; } = new List(); - - [ForeignKey("TagGroupSiteId")] - [InverseProperty("CmsTagGroups")] - public virtual CmsSite TagGroupSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_TagGroup")] +[Index("TagGroupSiteId", Name = "IX_CMS_TagGroup_TagGroupSiteID")] +public class CmsTagGroup +{ + [Key] + [Column("TagGroupID")] + public int TagGroupId { get; set; } + + [StringLength(250)] + public string TagGroupDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TagGroupName { get; set; } = null!; + + public string? TagGroupDescription { get; set; } + + [Column("TagGroupSiteID")] + public int TagGroupSiteId { get; set; } + + public bool TagGroupIsAdHoc { get; set; } + + public DateTime TagGroupLastModified { get; set; } + + [Column("TagGroupGUID")] + public Guid TagGroupGuid { get; set; } + + [InverseProperty("DocumentTagGroup")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("TagGroup")] + public virtual ICollection CmsTags { get; set; } = new List(); + + [ForeignKey("TagGroupSiteId")] + [InverseProperty("CmsTagGroups")] + public virtual CmsSite TagGroupSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsTimeZone.cs b/Migration.Toolkit.KX13/Models/CmsTimeZone.cs index 7ad6fd70..3c48c350 100644 --- a/Migration.Toolkit.KX13/Models/CmsTimeZone.cs +++ b/Migration.Toolkit.KX13/Models/CmsTimeZone.cs @@ -1,44 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TimeZone")] -public partial class CmsTimeZone -{ - [Key] - [Column("TimeZoneID")] - public int TimeZoneId { get; set; } - - [StringLength(200)] - public string TimeZoneName { get; set; } = null!; - - [StringLength(200)] - public string TimeZoneDisplayName { get; set; } = null!; - - [Column("TimeZoneGMT")] - public double TimeZoneGmt { get; set; } - - public bool? TimeZoneDaylight { get; set; } - - public DateTime TimeZoneRuleStartIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleStartRule { get; set; } = null!; - - public DateTime TimeZoneRuleEndIn { get; set; } - - [StringLength(200)] - public string TimeZoneRuleEndRule { get; set; } = null!; - - [Column("TimeZoneGUID")] - public Guid TimeZoneGuid { get; set; } - - public DateTime TimeZoneLastModified { get; set; } - - [InverseProperty("UserTimeZone")] - public virtual ICollection CmsUserSettings { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_TimeZone")] +public class CmsTimeZone +{ + [Key] + [Column("TimeZoneID")] + public int TimeZoneId { get; set; } + + [StringLength(200)] + public string TimeZoneName { get; set; } = null!; + + [StringLength(200)] + public string TimeZoneDisplayName { get; set; } = null!; + + [Column("TimeZoneGMT")] + public double TimeZoneGmt { get; set; } + + public bool? TimeZoneDaylight { get; set; } + + public DateTime TimeZoneRuleStartIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleStartRule { get; set; } = null!; + + public DateTime TimeZoneRuleEndIn { get; set; } + + [StringLength(200)] + public string TimeZoneRuleEndRule { get; set; } = null!; + + [Column("TimeZoneGUID")] + public Guid TimeZoneGuid { get; set; } + + public DateTime TimeZoneLastModified { get; set; } + + [InverseProperty("UserTimeZone")] + public virtual ICollection CmsUserSettings { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsTransformation.cs b/Migration.Toolkit.KX13/Models/CmsTransformation.cs index 08e1b23a..4412abe7 100644 --- a/Migration.Toolkit.KX13/Models/CmsTransformation.cs +++ b/Migration.Toolkit.KX13/Models/CmsTransformation.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Transformation")] -[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] -public partial class CmsTransformation -{ - [Key] - [Column("TransformationID")] - public int TransformationId { get; set; } - - [StringLength(100)] - public string TransformationName { get; set; } = null!; - - public string TransformationCode { get; set; } = null!; - - [StringLength(50)] - public string TransformationType { get; set; } = null!; - - [Column("TransformationClassID")] - public int TransformationClassId { get; set; } - - [Column("TransformationVersionGUID")] - [StringLength(50)] - public string? TransformationVersionGuid { get; set; } - - [Column("TransformationGUID")] - public Guid TransformationGuid { get; set; } - - public DateTime TransformationLastModified { get; set; } - - [ForeignKey("TransformationClassId")] - [InverseProperty("CmsTransformations")] - public virtual CmsClass TransformationClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Transformation")] +[Index("TransformationClassId", Name = "IX_CMS_Transformation_TransformationClassID")] +public class CmsTransformation +{ + [Key] + [Column("TransformationID")] + public int TransformationId { get; set; } + + [StringLength(100)] + public string TransformationName { get; set; } = null!; + + public string TransformationCode { get; set; } = null!; + + [StringLength(50)] + public string TransformationType { get; set; } = null!; + + [Column("TransformationClassID")] + public int TransformationClassId { get; set; } + + [Column("TransformationVersionGUID")] + [StringLength(50)] + public string? TransformationVersionGuid { get; set; } + + [Column("TransformationGUID")] + public Guid TransformationGuid { get; set; } + + public DateTime TransformationLastModified { get; set; } + + [ForeignKey("TransformationClassId")] + [InverseProperty("CmsTransformations")] + public virtual CmsClass TransformationClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationService.cs b/Migration.Toolkit.KX13/Models/CmsTranslationService.cs index feb8d81e..d668a1e0 100644 --- a/Migration.Toolkit.KX13/Models/CmsTranslationService.cs +++ b/Migration.Toolkit.KX13/Models/CmsTranslationService.cs @@ -1,52 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TranslationService")] -public partial class CmsTranslationService -{ - [Key] - [Column("TranslationServiceID")] - public int TranslationServiceId { get; set; } - - [StringLength(200)] - public string TranslationServiceAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceClassName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceName { get; set; } = null!; - - [StringLength(200)] - public string TranslationServiceDisplayName { get; set; } = null!; - - public bool TranslationServiceIsMachine { get; set; } - - public DateTime TranslationServiceLastModified { get; set; } - - [Column("TranslationServiceGUID")] - public Guid TranslationServiceGuid { get; set; } - - public bool TranslationServiceEnabled { get; set; } - - public bool? TranslationServiceSupportsInstructions { get; set; } - - public bool? TranslationServiceSupportsPriority { get; set; } - - public bool? TranslationServiceSupportsDeadline { get; set; } - - [StringLength(1000)] - public string? TranslationServiceParameter { get; set; } - - public bool? TranslationServiceSupportsStatusUpdate { get; set; } - - public bool? TranslationServiceSupportsCancel { get; set; } - - [InverseProperty("SubmissionService")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_TranslationService")] +public class CmsTranslationService +{ + [Key] + [Column("TranslationServiceID")] + public int TranslationServiceId { get; set; } + + [StringLength(200)] + public string TranslationServiceAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceClassName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceName { get; set; } = null!; + + [StringLength(200)] + public string TranslationServiceDisplayName { get; set; } = null!; + + public bool TranslationServiceIsMachine { get; set; } + + public DateTime TranslationServiceLastModified { get; set; } + + [Column("TranslationServiceGUID")] + public Guid TranslationServiceGuid { get; set; } + + public bool TranslationServiceEnabled { get; set; } + + public bool? TranslationServiceSupportsInstructions { get; set; } + + public bool? TranslationServiceSupportsPriority { get; set; } + + public bool? TranslationServiceSupportsDeadline { get; set; } + + [StringLength(1000)] + public string? TranslationServiceParameter { get; set; } + + public bool? TranslationServiceSupportsStatusUpdate { get; set; } + + public bool? TranslationServiceSupportsCancel { get; set; } + + [InverseProperty("SubmissionService")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs b/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs index 3d951b0b..bed35bd7 100644 --- a/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs +++ b/Migration.Toolkit.KX13/Models/CmsTranslationSubmission.cs @@ -1,76 +1,75 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TranslationSubmission")] -[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] -[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] -public partial class CmsTranslationSubmission -{ - [Key] - [Column("SubmissionID")] - public int SubmissionId { get; set; } - - [StringLength(200)] - public string SubmissionName { get; set; } = null!; - - [StringLength(200)] - public string? SubmissionTicket { get; set; } - - public int SubmissionStatus { get; set; } - - [Column("SubmissionServiceID")] - public int SubmissionServiceId { get; set; } - - [StringLength(50)] - public string SubmissionSourceCulture { get; set; } = null!; - - public string SubmissionTargetCulture { get; set; } = null!; - - public int SubmissionPriority { get; set; } - - public DateTime? SubmissionDeadline { get; set; } - - [StringLength(500)] - public string? SubmissionInstructions { get; set; } - - public DateTime SubmissionLastModified { get; set; } - - [Column("SubmissionGUID")] - public Guid SubmissionGuid { get; set; } - - [Column("SubmissionSiteID")] - public int? SubmissionSiteId { get; set; } - - public double? SubmissionPrice { get; set; } - - public string? SubmissionStatusMessage { get; set; } - - public bool? SubmissionTranslateAttachments { get; set; } - - public int SubmissionItemCount { get; set; } - - public DateTime SubmissionDate { get; set; } - - public int? SubmissionWordCount { get; set; } - - public int? SubmissionCharCount { get; set; } - - [Column("SubmissionSubmittedByUserID")] - public int? SubmissionSubmittedByUserId { get; set; } - - [InverseProperty("SubmissionItemSubmission")] - public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); - - [ForeignKey("SubmissionServiceId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsTranslationService SubmissionService { get; set; } = null!; - - [ForeignKey("SubmissionSubmittedByUserId")] - [InverseProperty("CmsTranslationSubmissions")] - public virtual CmsUser? SubmissionSubmittedByUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_TranslationSubmission")] +[Index("SubmissionServiceId", Name = "IX_CMS_TranslationSubmission_SubmissionServiceID")] +[Index("SubmissionSubmittedByUserId", Name = "IX_CMS_TranslationSubmission_SubmissionSubmittedByUserID")] +public class CmsTranslationSubmission +{ + [Key] + [Column("SubmissionID")] + public int SubmissionId { get; set; } + + [StringLength(200)] + public string SubmissionName { get; set; } = null!; + + [StringLength(200)] + public string? SubmissionTicket { get; set; } + + public int SubmissionStatus { get; set; } + + [Column("SubmissionServiceID")] + public int SubmissionServiceId { get; set; } + + [StringLength(50)] + public string SubmissionSourceCulture { get; set; } = null!; + + public string SubmissionTargetCulture { get; set; } = null!; + + public int SubmissionPriority { get; set; } + + public DateTime? SubmissionDeadline { get; set; } + + [StringLength(500)] + public string? SubmissionInstructions { get; set; } + + public DateTime SubmissionLastModified { get; set; } + + [Column("SubmissionGUID")] + public Guid SubmissionGuid { get; set; } + + [Column("SubmissionSiteID")] + public int? SubmissionSiteId { get; set; } + + public double? SubmissionPrice { get; set; } + + public string? SubmissionStatusMessage { get; set; } + + public bool? SubmissionTranslateAttachments { get; set; } + + public int SubmissionItemCount { get; set; } + + public DateTime SubmissionDate { get; set; } + + public int? SubmissionWordCount { get; set; } + + public int? SubmissionCharCount { get; set; } + + [Column("SubmissionSubmittedByUserID")] + public int? SubmissionSubmittedByUserId { get; set; } + + [InverseProperty("SubmissionItemSubmission")] + public virtual ICollection CmsTranslationSubmissionItems { get; set; } = new List(); + + [ForeignKey("SubmissionServiceId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsTranslationService SubmissionService { get; set; } = null!; + + [ForeignKey("SubmissionSubmittedByUserId")] + [InverseProperty("CmsTranslationSubmissions")] + public virtual CmsUser? SubmissionSubmittedByUser { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs b/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs index 95f18ef0..724e3082 100644 --- a/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs +++ b/Migration.Toolkit.KX13/Models/CmsTranslationSubmissionItem.cs @@ -1,58 +1,57 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_TranslationSubmissionItem")] -[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] -public partial class CmsTranslationSubmissionItem -{ - [Key] - [Column("SubmissionItemID")] - public int SubmissionItemId { get; set; } - - [Column("SubmissionItemSubmissionID")] - public int SubmissionItemSubmissionId { get; set; } - - [Column("SubmissionItemSourceXLIFF")] - public string? SubmissionItemSourceXliff { get; set; } - - [Column("SubmissionItemTargetXLIFF")] - public string? SubmissionItemTargetXliff { get; set; } - - [StringLength(100)] - public string SubmissionItemObjectType { get; set; } = null!; - - [Column("SubmissionItemObjectID")] - public int SubmissionItemObjectId { get; set; } - - [Column("SubmissionItemGUID")] - public Guid SubmissionItemGuid { get; set; } - - public DateTime SubmissionItemLastModified { get; set; } - - [StringLength(200)] - public string SubmissionItemName { get; set; } = null!; - - public int? SubmissionItemWordCount { get; set; } - - public int? SubmissionItemCharCount { get; set; } - - public string? SubmissionItemCustomData { get; set; } - - [Column("SubmissionItemTargetObjectID")] - public int SubmissionItemTargetObjectId { get; set; } - - [StringLength(50)] - public string? SubmissionItemType { get; set; } - - [StringLength(50)] - public string? SubmissionItemTargetCulture { get; set; } - - [ForeignKey("SubmissionItemSubmissionId")] - [InverseProperty("CmsTranslationSubmissionItems")] - public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_TranslationSubmissionItem")] +[Index("SubmissionItemSubmissionId", Name = "IX_CMS_TranslationSubmissionItem_SubmissionItemSubmissionID")] +public class CmsTranslationSubmissionItem +{ + [Key] + [Column("SubmissionItemID")] + public int SubmissionItemId { get; set; } + + [Column("SubmissionItemSubmissionID")] + public int SubmissionItemSubmissionId { get; set; } + + [Column("SubmissionItemSourceXLIFF")] + public string? SubmissionItemSourceXliff { get; set; } + + [Column("SubmissionItemTargetXLIFF")] + public string? SubmissionItemTargetXliff { get; set; } + + [StringLength(100)] + public string SubmissionItemObjectType { get; set; } = null!; + + [Column("SubmissionItemObjectID")] + public int SubmissionItemObjectId { get; set; } + + [Column("SubmissionItemGUID")] + public Guid SubmissionItemGuid { get; set; } + + public DateTime SubmissionItemLastModified { get; set; } + + [StringLength(200)] + public string SubmissionItemName { get; set; } = null!; + + public int? SubmissionItemWordCount { get; set; } + + public int? SubmissionItemCharCount { get; set; } + + public string? SubmissionItemCustomData { get; set; } + + [Column("SubmissionItemTargetObjectID")] + public int SubmissionItemTargetObjectId { get; set; } + + [StringLength(50)] + public string? SubmissionItemType { get; set; } + + [StringLength(50)] + public string? SubmissionItemTargetCulture { get; set; } + + [ForeignKey("SubmissionItemSubmissionId")] + [InverseProperty("CmsTranslationSubmissionItems")] + public virtual CmsTranslationSubmission SubmissionItemSubmission { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsTree.cs b/Migration.Toolkit.KX13/Models/CmsTree.cs index 836a8a16..224cba69 100644 --- a/Migration.Toolkit.KX13/Models/CmsTree.cs +++ b/Migration.Toolkit.KX13/Models/CmsTree.cs @@ -1,141 +1,140 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Tree")] -[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] -[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] -[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] -[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] -[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] -[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] -[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] -[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] -[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] -[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] -[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] -public partial class CmsTree -{ - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - [InverseProperty("DocumentNode")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("PageFormerUrlPathNode")] - public virtual ICollection CmsPageFormerUrlPaths { get; set; } = new List(); - - [InverseProperty("PageUrlPathNode")] - public virtual ICollection CmsPageUrlPaths { get; set; } = new List(); - - [InverseProperty("LeftNode")] - public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); - - [InverseProperty("RightNode")] - public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); - - [InverseProperty("Node")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [InverseProperty("NodeLinkedNode")] - public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); - - [InverseProperty("NodeOriginalNode")] - public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); - - [InverseProperty("NodeParent")] - public virtual ICollection InverseNodeParent { get; set; } = new List(); - - [ForeignKey("NodeAclid")] - [InverseProperty("CmsTrees")] - public virtual CmsAcl? NodeAcl { get; set; } - - [ForeignKey("NodeClassId")] - [InverseProperty("CmsTrees")] - public virtual CmsClass NodeClass { get; set; } = null!; - - [ForeignKey("NodeLinkedNodeId")] - [InverseProperty("InverseNodeLinkedNode")] - public virtual CmsTree? NodeLinkedNode { get; set; } - - [ForeignKey("NodeLinkedNodeSiteId")] - [InverseProperty("CmsTreeNodeLinkedNodeSites")] - public virtual CmsSite? NodeLinkedNodeSite { get; set; } - - [ForeignKey("NodeOriginalNodeId")] - [InverseProperty("InverseNodeOriginalNode")] - public virtual CmsTree? NodeOriginalNode { get; set; } - - [ForeignKey("NodeOwner")] - [InverseProperty("CmsTrees")] - public virtual CmsUser? NodeOwnerNavigation { get; set; } - - [ForeignKey("NodeParentId")] - [InverseProperty("InverseNodeParent")] - public virtual CmsTree? NodeParent { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsTreeNodeSites")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("NodeSkuid")] - [InverseProperty("CmsTrees")] - public virtual ComSku? NodeSku { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Tree")] +[Index("NodeAclid", Name = "IX_CMS_Tree_NodeACLID")] +[Index("NodeAliasPath", Name = "IX_CMS_Tree_NodeAliasPath")] +[Index("NodeClassId", Name = "IX_CMS_Tree_NodeClassID")] +[Index("NodeLevel", Name = "IX_CMS_Tree_NodeLevel")] +[Index("NodeLinkedNodeId", Name = "IX_CMS_Tree_NodeLinkedNodeID")] +[Index("NodeLinkedNodeSiteId", Name = "IX_CMS_Tree_NodeLinkedNodeSiteID")] +[Index("NodeOriginalNodeId", Name = "IX_CMS_Tree_NodeOriginalNodeID")] +[Index("NodeOwner", Name = "IX_CMS_Tree_NodeOwner")] +[Index("NodeParentId", "NodeAlias", "NodeName", Name = "IX_CMS_Tree_NodeParentID_NodeAlias_NodeName")] +[Index("NodeSkuid", Name = "IX_CMS_Tree_NodeSKUID")] +[Index("NodeSiteId", "NodeGuid", Name = "IX_CMS_Tree_NodeSiteID_NodeGUID", IsUnique = true)] +public class CmsTree +{ + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + [InverseProperty("DocumentNode")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("PageFormerUrlPathNode")] + public virtual ICollection CmsPageFormerUrlPaths { get; set; } = new List(); + + [InverseProperty("PageUrlPathNode")] + public virtual ICollection CmsPageUrlPaths { get; set; } = new List(); + + [InverseProperty("LeftNode")] + public virtual ICollection CmsRelationshipLeftNodes { get; set; } = new List(); + + [InverseProperty("RightNode")] + public virtual ICollection CmsRelationshipRightNodes { get; set; } = new List(); + + [InverseProperty("Node")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [InverseProperty("NodeLinkedNode")] + public virtual ICollection InverseNodeLinkedNode { get; set; } = new List(); + + [InverseProperty("NodeOriginalNode")] + public virtual ICollection InverseNodeOriginalNode { get; set; } = new List(); + + [InverseProperty("NodeParent")] + public virtual ICollection InverseNodeParent { get; set; } = new List(); + + [ForeignKey("NodeAclid")] + [InverseProperty("CmsTrees")] + public virtual CmsAcl? NodeAcl { get; set; } + + [ForeignKey("NodeClassId")] + [InverseProperty("CmsTrees")] + public virtual CmsClass NodeClass { get; set; } = null!; + + [ForeignKey("NodeLinkedNodeId")] + [InverseProperty("InverseNodeLinkedNode")] + public virtual CmsTree? NodeLinkedNode { get; set; } + + [ForeignKey("NodeLinkedNodeSiteId")] + [InverseProperty("CmsTreeNodeLinkedNodeSites")] + public virtual CmsSite? NodeLinkedNodeSite { get; set; } + + [ForeignKey("NodeOriginalNodeId")] + [InverseProperty("InverseNodeOriginalNode")] + public virtual CmsTree? NodeOriginalNode { get; set; } + + [ForeignKey("NodeOwner")] + [InverseProperty("CmsTrees")] + public virtual CmsUser? NodeOwnerNavigation { get; set; } + + [ForeignKey("NodeParentId")] + [InverseProperty("InverseNodeParent")] + public virtual CmsTree? NodeParent { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsTreeNodeSites")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("NodeSkuid")] + [InverseProperty("CmsTrees")] + public virtual ComSku? NodeSku { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsUielement.cs b/Migration.Toolkit.KX13/Models/CmsUielement.cs index ecfec680..427a63a2 100644 --- a/Migration.Toolkit.KX13/Models/CmsUielement.cs +++ b/Migration.Toolkit.KX13/Models/CmsUielement.cs @@ -1,116 +1,115 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UIElement")] -[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] -[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] -[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] -public partial class CmsUielement -{ - [Key] - [Column("ElementID")] - public int ElementId { get; set; } - - [StringLength(200)] - public string ElementDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(200)] - public string? ElementCaption { get; set; } - - [Column("ElementTargetURL")] - [StringLength(650)] - public string? ElementTargetUrl { get; set; } - - [Column("ElementResourceID")] - public int ElementResourceId { get; set; } - - [Column("ElementParentID")] - public int? ElementParentId { get; set; } - - public int ElementChildCount { get; set; } - - public int? ElementOrder { get; set; } - - public int ElementLevel { get; set; } - - [Column("ElementIDPath")] - [StringLength(450)] - public string ElementIdpath { get; set; } = null!; - - [StringLength(200)] - public string? ElementIconPath { get; set; } - - public bool? ElementIsCustom { get; set; } - - public DateTime ElementLastModified { get; set; } - - [Column("ElementGUID")] - public Guid ElementGuid { get; set; } - - public int? ElementSize { get; set; } - - public string? ElementDescription { get; set; } - - [StringLength(20)] - public string? ElementFromVersion { get; set; } - - [Column("ElementPageTemplateID")] - public int? ElementPageTemplateId { get; set; } - - [StringLength(50)] - public string? ElementType { get; set; } - - public string? ElementProperties { get; set; } - - public bool? ElementIsMenu { get; set; } - - [StringLength(200)] - public string? ElementFeature { get; set; } - - [StringLength(100)] - public string? ElementIconClass { get; set; } - - public bool? ElementIsGlobalApplication { get; set; } - - public bool? ElementCheckModuleReadPermission { get; set; } - - public string? ElementAccessCondition { get; set; } - - public string? ElementVisibilityCondition { get; set; } - - public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } - - [InverseProperty("HelpTopicUielement")] - public virtual ICollection CmsHelpTopics { get; set; } = new List(); - - [ForeignKey("ElementPageTemplateId")] - [InverseProperty("CmsUielements")] - public virtual CmsPageTemplate? ElementPageTemplate { get; set; } - - [ForeignKey("ElementParentId")] - [InverseProperty("InverseElementParent")] - public virtual CmsUielement? ElementParent { get; set; } - - [ForeignKey("ElementResourceId")] - [InverseProperty("CmsUielements")] - public virtual CmsResource ElementResource { get; set; } = null!; - - [InverseProperty("ElementParent")] - public virtual ICollection InverseElementParent { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("Elements")] - public virtual ICollection Roles { get; set; } = new List(); - - [ForeignKey("ElementId")] - [InverseProperty("ElementsNavigation")] - public virtual ICollection RolesNavigation { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_UIElement")] +[Index("ElementGuid", Name = "IX_CMS_UIElement_ElementGUID", IsUnique = true)] +[Index("ElementPageTemplateId", Name = "IX_CMS_UIElement_ElementPageTemplateID")] +[Index("ElementParentId", Name = "IX_CMS_UIElement_ElementParentID")] +public class CmsUielement +{ + [Key] + [Column("ElementID")] + public int ElementId { get; set; } + + [StringLength(200)] + public string ElementDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(200)] + public string? ElementCaption { get; set; } + + [Column("ElementTargetURL")] + [StringLength(650)] + public string? ElementTargetUrl { get; set; } + + [Column("ElementResourceID")] + public int ElementResourceId { get; set; } + + [Column("ElementParentID")] + public int? ElementParentId { get; set; } + + public int ElementChildCount { get; set; } + + public int? ElementOrder { get; set; } + + public int ElementLevel { get; set; } + + [Column("ElementIDPath")] + [StringLength(450)] + public string ElementIdpath { get; set; } = null!; + + [StringLength(200)] + public string? ElementIconPath { get; set; } + + public bool? ElementIsCustom { get; set; } + + public DateTime ElementLastModified { get; set; } + + [Column("ElementGUID")] + public Guid ElementGuid { get; set; } + + public int? ElementSize { get; set; } + + public string? ElementDescription { get; set; } + + [StringLength(20)] + public string? ElementFromVersion { get; set; } + + [Column("ElementPageTemplateID")] + public int? ElementPageTemplateId { get; set; } + + [StringLength(50)] + public string? ElementType { get; set; } + + public string? ElementProperties { get; set; } + + public bool? ElementIsMenu { get; set; } + + [StringLength(200)] + public string? ElementFeature { get; set; } + + [StringLength(100)] + public string? ElementIconClass { get; set; } + + public bool? ElementIsGlobalApplication { get; set; } + + public bool? ElementCheckModuleReadPermission { get; set; } + + public string? ElementAccessCondition { get; set; } + + public string? ElementVisibilityCondition { get; set; } + + public bool ElementRequiresGlobalAdminPriviligeLevel { get; set; } + + [InverseProperty("HelpTopicUielement")] + public virtual ICollection CmsHelpTopics { get; set; } = new List(); + + [ForeignKey("ElementPageTemplateId")] + [InverseProperty("CmsUielements")] + public virtual CmsPageTemplate? ElementPageTemplate { get; set; } + + [ForeignKey("ElementParentId")] + [InverseProperty("InverseElementParent")] + public virtual CmsUielement? ElementParent { get; set; } + + [ForeignKey("ElementResourceId")] + [InverseProperty("CmsUielements")] + public virtual CmsResource ElementResource { get; set; } = null!; + + [InverseProperty("ElementParent")] + public virtual ICollection InverseElementParent { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("Elements")] + public virtual ICollection Roles { get; set; } = new List(); + + [ForeignKey("ElementId")] + [InverseProperty("ElementsNavigation")] + public virtual ICollection RolesNavigation { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsUser.cs b/Migration.Toolkit.KX13/Models/CmsUser.cs index 4e52ab9b..82167098 100644 --- a/Migration.Toolkit.KX13/Models/CmsUser.cs +++ b/Migration.Toolkit.KX13/Models/CmsUser.cs @@ -1,224 +1,223 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_User")] -[Index("Email", Name = "IX_CMS_User_Email")] -[Index("FullName", Name = "IX_CMS_User_FullName")] -[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] -[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] -[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] -[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] -public partial class CmsUser -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(50)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(50)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [InverseProperty("LastModifiedByUser")] - public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsAclitemUsers { get; set; } = new List(); - - [InverseProperty("HistoryApprovedByUser")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateUser")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("CategoryUser")] - public virtual ICollection CmsCategories { get; set; } = new List(); - - [InverseProperty("DocumentCheckedOutByUser")] - public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); - - [InverseProperty("DocumentCreatedByUser")] - public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); - - [InverseProperty("DocumentModifiedByUser")] - public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsEmailUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsExternalLogins { get; set; } = new List(); - - [InverseProperty("MacroIdentityEffectiveUser")] - public virtual ICollection CmsMacroIdentities { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsMembershipUsers { get; set; } = new List(); - - [InverseProperty("ObjectCheckedOutByUser")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("VersionModifiedByUser")] - public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); - - [InverseProperty("PersonalizationUser")] - public virtual ICollection CmsPersonalizations { get; set; } = new List(); - - [InverseProperty("TaskUser")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("SubmissionSubmittedByUser")] - public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); - - [InverseProperty("NodeOwnerNavigation")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserCultures { get; set; } = new List(); - - [InverseProperty("UserMacroIdentityUser")] - public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } - - [InverseProperty("User")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("UserActivatedByUser")] - public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); - - [InverseProperty("UserSettingsUserNavigation")] - public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } - - public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsUserSites { get; set; } = new List(); - - [InverseProperty("ModifiedByUser")] - public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); - - [InverseProperty("VersionDeletedByUser")] - public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); - - [InverseProperty("ApprovedByUser")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("CustomerUser")] - public virtual ICollection ComCustomers { get; set; } = new List(); - - [InverseProperty("ChangedByUser")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [InverseProperty("OrderCreatedByUser")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartUser")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("ExportUser")] - public virtual ICollection ExportHistories { get; set; } = new List(); - - [InverseProperty("FileCreatedByUser")] - public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); - - [InverseProperty("FileModifiedByUser")] - public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); - - [InverseProperty("AccountOwnerUser")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactOwnerUser")] - public virtual ICollection OmContacts { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionUser")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("SavedReportCreatedByUser")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); - - [InverseProperty("User")] - public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } - - [InverseProperty("User")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("UserId")] - [InverseProperty("Users")] - public virtual ICollection Workflows { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_User")] +[Index("Email", Name = "IX_CMS_User_Email")] +[Index("FullName", Name = "IX_CMS_User_FullName")] +[Index("UserEnabled", "UserIsHidden", Name = "IX_CMS_User_UserEnabled_UserIsHidden")] +[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] +[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] +[Index("UserPrivilegeLevel", Name = "IX_CMS_User_UserPrivilegeLevel")] +public class CmsUser +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(50)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(50)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [InverseProperty("LastModifiedByUser")] + public virtual ICollection CmsAclitemLastModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsAclitemUsers { get; set; } = new List(); + + [InverseProperty("HistoryApprovedByUser")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateUser")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("CategoryUser")] + public virtual ICollection CmsCategories { get; set; } = new List(); + + [InverseProperty("DocumentCheckedOutByUser")] + public virtual ICollection CmsDocumentDocumentCheckedOutByUsers { get; set; } = new List(); + + [InverseProperty("DocumentCreatedByUser")] + public virtual ICollection CmsDocumentDocumentCreatedByUsers { get; set; } = new List(); + + [InverseProperty("DocumentModifiedByUser")] + public virtual ICollection CmsDocumentDocumentModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsEmailUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsExternalLogins { get; set; } = new List(); + + [InverseProperty("MacroIdentityEffectiveUser")] + public virtual ICollection CmsMacroIdentities { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsMembershipUsers { get; set; } = new List(); + + [InverseProperty("ObjectCheckedOutByUser")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("VersionModifiedByUser")] + public virtual ICollection CmsObjectVersionHistoryVersionModifiedByUsers { get; set; } = new List(); + + [InverseProperty("PersonalizationUser")] + public virtual ICollection CmsPersonalizations { get; set; } = new List(); + + [InverseProperty("TaskUser")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SubmissionSubmittedByUser")] + public virtual ICollection CmsTranslationSubmissions { get; set; } = new List(); + + [InverseProperty("NodeOwnerNavigation")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserCultures { get; set; } = new List(); + + [InverseProperty("UserMacroIdentityUser")] + public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } + + [InverseProperty("User")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("UserActivatedByUser")] + public virtual ICollection CmsUserSettingUserActivatedByUsers { get; set; } = new List(); + + [InverseProperty("UserSettingsUserNavigation")] + public virtual CmsUserSetting? CmsUserSettingUserSettingsUserNavigation { get; set; } + + public virtual ICollection CmsUserSettingUserSettingsUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsUserSites { get; set; } = new List(); + + [InverseProperty("ModifiedByUser")] + public virtual ICollection CmsVersionHistoryModifiedByUsers { get; set; } = new List(); + + [InverseProperty("VersionDeletedByUser")] + public virtual ICollection CmsVersionHistoryVersionDeletedByUsers { get; set; } = new List(); + + [InverseProperty("ApprovedByUser")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("CustomerUser")] + public virtual ICollection ComCustomers { get; set; } = new List(); + + [InverseProperty("ChangedByUser")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [InverseProperty("OrderCreatedByUser")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartUser")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("ExportUser")] + public virtual ICollection ExportHistories { get; set; } = new List(); + + [InverseProperty("FileCreatedByUser")] + public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); + + [InverseProperty("FileModifiedByUser")] + public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); + + [InverseProperty("AccountOwnerUser")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactOwnerUser")] + public virtual ICollection OmContacts { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionUser")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("SavedReportCreatedByUser")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); + + [InverseProperty("User")] + public virtual StagingTaskGroupUser? StagingTaskGroupUser { get; set; } + + [InverseProperty("User")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("UserId")] + [InverseProperty("Users")] + public virtual ICollection Workflows { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsUserCulture.cs b/Migration.Toolkit.KX13/Models/CmsUserCulture.cs index ce19d591..0a356757 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserCulture.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserCulture.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("UserId", "CultureId", "SiteId")] -[Table("CMS_UserCulture")] -[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] -[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] -public partial class CmsUserCulture -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("CultureId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsCulture Culture { get; set; } = null!; - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserCultures")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("UserId", "CultureId", "SiteId")] +[Table("CMS_UserCulture")] +[Index("CultureId", Name = "IX_CMS_UserCulture_CultureID")] +[Index("SiteId", Name = "IX_CMS_UserCulture_SiteID")] +public class CmsUserCulture +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("CultureId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsCulture Culture { get; set; } = null!; + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserCultures")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs index a5536776..cf105e4d 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserMacroIdentity.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UserMacroIdentity")] -[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] -[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] -public partial class CmsUserMacroIdentity -{ - [Key] - [Column("UserMacroIdentityID")] - public int UserMacroIdentityId { get; set; } - - public DateTime UserMacroIdentityLastModified { get; set; } - - [Column("UserMacroIdentityUserID")] - public int UserMacroIdentityUserId { get; set; } - - [Column("UserMacroIdentityMacroIdentityID")] - public int? UserMacroIdentityMacroIdentityId { get; set; } - - public Guid UserMacroIdentityUserGuid { get; set; } - - [ForeignKey("UserMacroIdentityMacroIdentityId")] - [InverseProperty("CmsUserMacroIdentities")] - public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } - - [ForeignKey("UserMacroIdentityUserId")] - [InverseProperty("CmsUserMacroIdentity")] - public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_UserMacroIdentity")] +[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] +[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] +public class CmsUserMacroIdentity +{ + [Key] + [Column("UserMacroIdentityID")] + public int UserMacroIdentityId { get; set; } + + public DateTime UserMacroIdentityLastModified { get; set; } + + [Column("UserMacroIdentityUserID")] + public int UserMacroIdentityUserId { get; set; } + + [Column("UserMacroIdentityMacroIdentityID")] + public int? UserMacroIdentityMacroIdentityId { get; set; } + + public Guid UserMacroIdentityUserGuid { get; set; } + + [ForeignKey("UserMacroIdentityMacroIdentityId")] + [InverseProperty("CmsUserMacroIdentities")] + public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } + + [ForeignKey("UserMacroIdentityUserId")] + [InverseProperty("CmsUserMacroIdentity")] + public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsUserRole.cs b/Migration.Toolkit.KX13/Models/CmsUserRole.cs index c1e3b211..8fb7235b 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserRole.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserRole.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UserRole")] -[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] -[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] -[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] -public partial class CmsUserRole -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Key] - [Column("UserRoleID")] - public int UserRoleId { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_UserRole")] +[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] +[Index("RoleId", "ValidTo", "UserId", Name = "IX_CMS_UserRole_UserID")] +[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] +public class CmsUserRole +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Key] + [Column("UserRoleID")] + public int UserRoleId { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsUserSetting.cs b/Migration.Toolkit.KX13/Models/CmsUserSetting.cs index bd01b94c..973a2419 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserSetting.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserSetting.cs @@ -1,122 +1,121 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UserSettings")] -[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] -[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] -[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] -[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] -[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] -[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] -[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] -[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] -[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] -[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] -public partial class CmsUserSetting -{ - [Key] - [Column("UserSettingsID")] - public int UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int UserSettingsUserId { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [ForeignKey("UserActivatedByUserId")] - [InverseProperty("CmsUserSettingUserActivatedByUsers")] - public virtual CmsUser? UserActivatedByUser { get; set; } - - [ForeignKey("UserAvatarId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsAvatar? UserAvatar { get; set; } - - public virtual CmsUser UserSettingsUser { get; set; } = null!; - - [ForeignKey("UserSettingsUserId")] - [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] - public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; - - [ForeignKey("UserTimeZoneId")] - [InverseProperty("CmsUserSettings")] - public virtual CmsTimeZone? UserTimeZone { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_UserSettings")] +[Index("UserActivatedByUserId", Name = "IX_CMS_UserSettings_UserActivatedByUserID")] +[Index("UserAuthenticationGuid", Name = "IX_CMS_UserSettings_UserAuthenticationGUID")] +[Index("UserAvatarId", Name = "IX_CMS_UserSettings_UserAvatarID")] +[Index("UserGender", Name = "IX_CMS_UserSettings_UserGender")] +[Index("UserNickName", Name = "IX_CMS_UserSettings_UserNickName")] +[Index("UserPasswordRequestHash", Name = "IX_CMS_UserSettings_UserPasswordRequestHash")] +[Index("UserSettingsUserGuid", Name = "IX_CMS_UserSettings_UserSettingsUserGUID")] +[Index("UserSettingsUserId", Name = "IX_CMS_UserSettings_UserSettingsUserID", IsUnique = true)] +[Index("UserTimeZoneId", Name = "IX_CMS_UserSettings_UserTimeZoneID")] +[Index("UserWaitingForApproval", Name = "IX_CMS_UserSettings_UserWaitingForApproval")] +public class CmsUserSetting +{ + [Key] + [Column("UserSettingsID")] + public int UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int UserSettingsUserId { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [ForeignKey("UserActivatedByUserId")] + [InverseProperty("CmsUserSettingUserActivatedByUsers")] + public virtual CmsUser? UserActivatedByUser { get; set; } + + [ForeignKey("UserAvatarId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsAvatar? UserAvatar { get; set; } + + public virtual CmsUser UserSettingsUser { get; set; } = null!; + + [ForeignKey("UserSettingsUserId")] + [InverseProperty("CmsUserSettingUserSettingsUserNavigation")] + public virtual CmsUser UserSettingsUserNavigation { get; set; } = null!; + + [ForeignKey("UserTimeZoneId")] + [InverseProperty("CmsUserSettings")] + public virtual CmsTimeZone? UserTimeZone { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsUserSite.cs b/Migration.Toolkit.KX13/Models/CmsUserSite.cs index e484a060..e67d1e77 100644 --- a/Migration.Toolkit.KX13/Models/CmsUserSite.cs +++ b/Migration.Toolkit.KX13/Models/CmsUserSite.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_UserSite")] -[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] -[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] -public partial class CmsUserSite -{ - [Key] - [Column("UserSiteID")] - public int UserSiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("CmsUserSites")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserSites")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_UserSite")] +[Index("SiteId", Name = "IX_CMS_UserSite_SiteID")] +[Index("UserId", "SiteId", Name = "IX_CMS_UserSite_UserID_SiteID", IsUnique = true)] +public class CmsUserSite +{ + [Key] + [Column("UserSiteID")] + public int UserSiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("CmsUserSites")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserSites")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs b/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs index 8734d2aa..c54d5f57 100644 --- a/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsVersionHistory.cs @@ -1,108 +1,107 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_VersionHistory")] -[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] -[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] -[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] -[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] -[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] -[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] -[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] -public partial class CmsVersionHistory -{ - [Key] - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("DocumentID")] - public int? DocumentId { get; set; } - - [Column("NodeXML")] - public string NodeXml { get; set; } = null!; - - [Column("ModifiedByUserID")] - public int? ModifiedByUserId { get; set; } - - public DateTime ModifiedWhen { get; set; } - - [StringLength(50)] - public string? VersionNumber { get; set; } - - public string? VersionComment { get; set; } - - public bool ToBePublished { get; set; } - - public DateTime? PublishFrom { get; set; } - - public DateTime? PublishTo { get; set; } - - public DateTime? WasPublishedFrom { get; set; } - - public DateTime? WasPublishedTo { get; set; } - - [StringLength(100)] - public string? VersionDocumentName { get; set; } - - [Column("VersionClassID")] - public int? VersionClassId { get; set; } - - [Column("VersionWorkflowID")] - public int? VersionWorkflowId { get; set; } - - [Column("VersionWorkflowStepID")] - public int? VersionWorkflowStepId { get; set; } - - [StringLength(450)] - public string? VersionNodeAliasPath { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [InverseProperty("DocumentCheckedOutVersionHistory")] - public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); - - [InverseProperty("DocumentPublishedVersionHistory")] - public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); - - [InverseProperty("VersionHistory")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [ForeignKey("ModifiedByUserId")] - [InverseProperty("CmsVersionHistoryModifiedByUsers")] - public virtual CmsUser? ModifiedByUser { get; set; } - - [ForeignKey("NodeSiteId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsSite NodeSite { get; set; } = null!; - - [ForeignKey("VersionClassId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsClass? VersionClass { get; set; } - - [ForeignKey("VersionDeletedByUserId")] - [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] - public virtual CmsUser? VersionDeletedByUser { get; set; } - - [ForeignKey("VersionWorkflowId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflow? VersionWorkflow { get; set; } - - [ForeignKey("VersionWorkflowStepId")] - [InverseProperty("CmsVersionHistories")] - public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("VersionHistories")] - public virtual ICollection AttachmentHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_VersionHistory")] +[Index("ModifiedByUserId", Name = "IX_CMS_VersionHistory_ModifiedByUserID")] +[Index("NodeSiteId", Name = "IX_CMS_VersionHistory_NodeSiteID")] +[Index("ToBePublished", "PublishFrom", "PublishTo", Name = "IX_CMS_VersionHistory_ToBePublished_PublishFrom_PublishTo")] +[Index("VersionClassId", Name = "IX_CMS_VersionHistory_VersionClassID")] +[Index("VersionDeletedByUserId", "VersionDeletedWhen", Name = "IX_CMS_VersionHistory_VersionDeletedByUserID_VersionDeletedWhen", IsDescending = new[] { false, true })] +[Index("VersionWorkflowId", Name = "IX_CMS_VersionHistory_VersionWorkflowID")] +[Index("VersionWorkflowStepId", Name = "IX_CMS_VersionHistory_VersionWorkflowStepID")] +public class CmsVersionHistory +{ + [Key] + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("DocumentID")] + public int? DocumentId { get; set; } + + [Column("NodeXML")] + public string NodeXml { get; set; } = null!; + + [Column("ModifiedByUserID")] + public int? ModifiedByUserId { get; set; } + + public DateTime ModifiedWhen { get; set; } + + [StringLength(50)] + public string? VersionNumber { get; set; } + + public string? VersionComment { get; set; } + + public bool ToBePublished { get; set; } + + public DateTime? PublishFrom { get; set; } + + public DateTime? PublishTo { get; set; } + + public DateTime? WasPublishedFrom { get; set; } + + public DateTime? WasPublishedTo { get; set; } + + [StringLength(100)] + public string? VersionDocumentName { get; set; } + + [Column("VersionClassID")] + public int? VersionClassId { get; set; } + + [Column("VersionWorkflowID")] + public int? VersionWorkflowId { get; set; } + + [Column("VersionWorkflowStepID")] + public int? VersionWorkflowStepId { get; set; } + + [StringLength(450)] + public string? VersionNodeAliasPath { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [InverseProperty("DocumentCheckedOutVersionHistory")] + public virtual ICollection CmsDocumentDocumentCheckedOutVersionHistories { get; set; } = new List(); + + [InverseProperty("DocumentPublishedVersionHistory")] + public virtual ICollection CmsDocumentDocumentPublishedVersionHistories { get; set; } = new List(); + + [InverseProperty("VersionHistory")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [ForeignKey("ModifiedByUserId")] + [InverseProperty("CmsVersionHistoryModifiedByUsers")] + public virtual CmsUser? ModifiedByUser { get; set; } + + [ForeignKey("NodeSiteId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsSite NodeSite { get; set; } = null!; + + [ForeignKey("VersionClassId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsClass? VersionClass { get; set; } + + [ForeignKey("VersionDeletedByUserId")] + [InverseProperty("CmsVersionHistoryVersionDeletedByUsers")] + public virtual CmsUser? VersionDeletedByUser { get; set; } + + [ForeignKey("VersionWorkflowId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflow? VersionWorkflow { get; set; } + + [ForeignKey("VersionWorkflowStepId")] + [InverseProperty("CmsVersionHistories")] + public virtual CmsWorkflowStep? VersionWorkflowStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("VersionHistories")] + public virtual ICollection AttachmentHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs index a84c99ae..4499b2e9 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmServer.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebFarmServer")] -[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] -public partial class CmsWebFarmServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(300)] - public string ServerDisplayName { get; set; } = null!; - - [StringLength(300)] - public string ServerName { get; set; } = null!; - - [Column("ServerGUID")] - public Guid? ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public bool ServerEnabled { get; set; } - - public bool IsExternalWebAppServer { get; set; } - - [InverseProperty("Server")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WebFarmServer")] +[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] +public class CmsWebFarmServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(300)] + public string ServerDisplayName { get; set; } = null!; + + [StringLength(300)] + public string ServerName { get; set; } = null!; + + [Column("ServerGUID")] + public Guid? ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public bool ServerEnabled { get; set; } + + public bool IsExternalWebAppServer { get; set; } + + [InverseProperty("Server")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs index 86cf647d..9e19ed80 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmServerLog.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebFarmServerLog")] -public partial class CmsWebFarmServerLog -{ - [Key] - [Column("WebFarmServerLogID")] - public int WebFarmServerLogId { get; set; } - - public DateTime LogTime { get; set; } - - [StringLength(200)] - public string LogCode { get; set; } = null!; - - [Column("ServerID")] - public int ServerId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WebFarmServerLog")] +public class CmsWebFarmServerLog +{ + [Key] + [Column("WebFarmServerLogID")] + public int WebFarmServerLogId { get; set; } + + public DateTime LogTime { get; set; } + + [StringLength(200)] + public string LogCode { get; set; } = null!; + + [Column("ServerID")] + public int ServerId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs index 48bbb08f..0fbc8931 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmServerMonitoring.cs @@ -1,20 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebFarmServerMonitoring")] -public partial class CmsWebFarmServerMonitoring -{ - [Key] - [Column("WebFarmServerMonitoringID")] - public int WebFarmServerMonitoringId { get; set; } - - [Column("ServerID")] - public int ServerId { get; set; } - - public DateTime? ServerPing { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WebFarmServerMonitoring")] +public class CmsWebFarmServerMonitoring +{ + [Key] + [Column("WebFarmServerMonitoringID")] + public int WebFarmServerMonitoringId { get; set; } + + [Column("ServerID")] + public int ServerId { get; set; } + + public DateTime? ServerPing { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs index 5c4b6fc9..6de89769 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmServerTask.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("ServerId", "TaskId")] -[Table("CMS_WebFarmServerTask")] -[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] -public partial class CmsWebFarmServerTask -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - public string? ErrorMessage { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmServer Server { get; set; } = null!; - - [ForeignKey("TaskId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmTask Task { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("ServerId", "TaskId")] +[Table("CMS_WebFarmServerTask")] +[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] +public class CmsWebFarmServerTask +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + public string? ErrorMessage { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmServer Server { get; set; } = null!; + + [ForeignKey("TaskId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmTask Task { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs index 3c38cb80..8e51ea89 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebFarmTask.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebFarmTask")] -[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] -public partial class CmsWebFarmTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(100)] - public string TaskType { get; set; } = null!; - - public string? TaskTextData { get; set; } - - public byte[]? TaskBinaryData { get; set; } - - public DateTime? TaskCreated { get; set; } - - public string? TaskTarget { get; set; } - - [StringLength(450)] - public string? TaskMachineName { get; set; } - - [Column("TaskGUID")] - public Guid? TaskGuid { get; set; } - - public bool? TaskIsAnonymous { get; set; } - - public string? TaskErrorMessage { get; set; } - - public bool? TaskIsMemory { get; set; } - - [InverseProperty("Task")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WebFarmTask")] +[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] +public class CmsWebFarmTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(100)] + public string TaskType { get; set; } = null!; + + public string? TaskTextData { get; set; } + + public byte[]? TaskBinaryData { get; set; } + + public DateTime? TaskCreated { get; set; } + + public string? TaskTarget { get; set; } + + [StringLength(450)] + public string? TaskMachineName { get; set; } + + [Column("TaskGUID")] + public Guid? TaskGuid { get; set; } + + public bool? TaskIsAnonymous { get; set; } + + public string? TaskErrorMessage { get; set; } + + public bool? TaskIsMemory { get; set; } + + [InverseProperty("Task")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebPart.cs b/Migration.Toolkit.KX13/Models/CmsWebPart.cs index 1f693c2f..575d4c50 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebPart.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebPart.cs @@ -1,84 +1,83 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebPart")] -[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] -[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] -[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] -[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] -public partial class CmsWebPart -{ - [Key] - [Column("WebPartID")] - public int WebPartId { get; set; } - - [StringLength(100)] - public string WebPartName { get; set; } = null!; - - [StringLength(100)] - public string WebPartDisplayName { get; set; } = null!; - - public string? WebPartDescription { get; set; } - - [StringLength(100)] - public string WebPartFileName { get; set; } = null!; - - public string WebPartProperties { get; set; } = null!; - - [Column("WebPartCategoryID")] - public int WebPartCategoryId { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - public string? WebPartDocumentation { get; set; } - - [Column("WebPartGUID")] - public Guid WebPartGuid { get; set; } - - public DateTime WebPartLastModified { get; set; } - - public int? WebPartType { get; set; } - - public string? WebPartDefaultValues { get; set; } - - [Column("WebPartResourceID")] - public int? WebPartResourceId { get; set; } - - [Column("WebPartCSS")] - public string? WebPartCss { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } - - [Column("WebPartThumbnailGUID")] - public Guid? WebPartThumbnailGuid { get; set; } - - [StringLength(200)] - public string? WebPartIconClass { get; set; } - - [InverseProperty("WebPartLayoutWebPart")] - public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); - - [InverseProperty("WidgetWebPart")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WebPartParent")] - public virtual ICollection InverseWebPartParent { get; set; } = new List(); - - [ForeignKey("WebPartCategoryId")] - [InverseProperty("CmsWebParts")] - public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; - - [ForeignKey("WebPartParentId")] - [InverseProperty("InverseWebPartParent")] - public virtual CmsWebPart? WebPartParent { get; set; } - - [ForeignKey("WebPartResourceId")] - [InverseProperty("CmsWebParts")] - public virtual CmsResource? WebPartResource { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WebPart")] +[Index("WebPartCategoryId", Name = "IX_CMS_WebPart_WebPartCategoryID")] +[Index("WebPartName", Name = "IX_CMS_WebPart_WebPartName")] +[Index("WebPartParentId", Name = "IX_CMS_WebPart_WebPartParentID")] +[Index("WebPartResourceId", Name = "IX_CMS_WebPart_WebPartResourceID")] +public class CmsWebPart +{ + [Key] + [Column("WebPartID")] + public int WebPartId { get; set; } + + [StringLength(100)] + public string WebPartName { get; set; } = null!; + + [StringLength(100)] + public string WebPartDisplayName { get; set; } = null!; + + public string? WebPartDescription { get; set; } + + [StringLength(100)] + public string WebPartFileName { get; set; } = null!; + + public string WebPartProperties { get; set; } = null!; + + [Column("WebPartCategoryID")] + public int WebPartCategoryId { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + public string? WebPartDocumentation { get; set; } + + [Column("WebPartGUID")] + public Guid WebPartGuid { get; set; } + + public DateTime WebPartLastModified { get; set; } + + public int? WebPartType { get; set; } + + public string? WebPartDefaultValues { get; set; } + + [Column("WebPartResourceID")] + public int? WebPartResourceId { get; set; } + + [Column("WebPartCSS")] + public string? WebPartCss { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } + + [Column("WebPartThumbnailGUID")] + public Guid? WebPartThumbnailGuid { get; set; } + + [StringLength(200)] + public string? WebPartIconClass { get; set; } + + [InverseProperty("WebPartLayoutWebPart")] + public virtual ICollection CmsWebPartLayouts { get; set; } = new List(); + + [InverseProperty("WidgetWebPart")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WebPartParent")] + public virtual ICollection InverseWebPartParent { get; set; } = new List(); + + [ForeignKey("WebPartCategoryId")] + [InverseProperty("CmsWebParts")] + public virtual CmsWebPartCategory WebPartCategory { get; set; } = null!; + + [ForeignKey("WebPartParentId")] + [InverseProperty("InverseWebPartParent")] + public virtual CmsWebPart? WebPartParent { get; set; } + + [ForeignKey("WebPartResourceId")] + [InverseProperty("CmsWebParts")] + public virtual CmsResource? WebPartResource { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs b/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs index b0a7f7a7..72568cef 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebPartCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebPartCategory")] -[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] -public partial class CmsWebPartCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(100)] - public string CategoryDisplayName { get; set; } = null!; - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(100)] - public string CategoryName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsWebPartCategory? CategoryParent { get; set; } - - [InverseProperty("WebPartCategory")] - public virtual ICollection CmsWebParts { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WebPartCategory")] +[Index("CategoryParentId", Name = "IX_CMS_WebPartCategory_CategoryParentID")] +public class CmsWebPartCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(100)] + public string CategoryDisplayName { get; set; } = null!; + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(100)] + public string CategoryName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsWebPartCategory? CategoryParent { get; set; } + + [InverseProperty("WebPartCategory")] + public virtual ICollection CmsWebParts { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs b/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs index 48f93e1c..53644484 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebPartContainer.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebPartContainer")] -[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] -public partial class CmsWebPartContainer -{ - [Key] - [Column("ContainerID")] - public int ContainerId { get; set; } - - [StringLength(200)] - public string ContainerDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContainerName { get; set; } = null!; - - public string? ContainerTextBefore { get; set; } - - public string? ContainerTextAfter { get; set; } - - [Column("ContainerGUID")] - public Guid ContainerGuid { get; set; } - - public DateTime ContainerLastModified { get; set; } - - [Column("ContainerCSS")] - public string? ContainerCss { get; set; } - - [ForeignKey("ContainerId")] - [InverseProperty("Containers")] - public virtual ICollection Sites { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WebPartContainer")] +[Index("ContainerName", Name = "IX_CMS_WebPartContainer_ContainerName")] +public class CmsWebPartContainer +{ + [Key] + [Column("ContainerID")] + public int ContainerId { get; set; } + + [StringLength(200)] + public string ContainerDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContainerName { get; set; } = null!; + + public string? ContainerTextBefore { get; set; } + + public string? ContainerTextAfter { get; set; } + + [Column("ContainerGUID")] + public Guid ContainerGuid { get; set; } + + public DateTime ContainerLastModified { get; set; } + + [Column("ContainerCSS")] + public string? ContainerCss { get; set; } + + [ForeignKey("ContainerId")] + [InverseProperty("Containers")] + public virtual ICollection Sites { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs b/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs index 0546ec48..99a2da6d 100644 --- a/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs +++ b/Migration.Toolkit.KX13/Models/CmsWebPartLayout.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WebPartLayout")] -[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] -public partial class CmsWebPartLayout -{ - [Key] - [Column("WebPartLayoutID")] - public int WebPartLayoutId { get; set; } - - [StringLength(200)] - public string WebPartLayoutCodeName { get; set; } = null!; - - [StringLength(200)] - public string WebPartLayoutDisplayName { get; set; } = null!; - - public string? WebPartLayoutDescription { get; set; } - - public string? WebPartLayoutCode { get; set; } - - [Column("WebPartLayoutVersionGUID")] - [StringLength(100)] - public string? WebPartLayoutVersionGuid { get; set; } - - [Column("WebPartLayoutWebPartID")] - public int WebPartLayoutWebPartId { get; set; } - - [Column("WebPartLayoutGUID")] - public Guid WebPartLayoutGuid { get; set; } - - public DateTime WebPartLayoutLastModified { get; set; } - - [Column("WebPartLayoutCSS")] - public string? WebPartLayoutCss { get; set; } - - public bool? WebPartLayoutIsDefault { get; set; } - - [InverseProperty("WidgetLayout")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [ForeignKey("WebPartLayoutWebPartId")] - [InverseProperty("CmsWebPartLayouts")] - public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WebPartLayout")] +[Index("WebPartLayoutWebPartId", Name = "IX_CMS_WebPartLayout_WebPartLayoutWebPartID")] +public class CmsWebPartLayout +{ + [Key] + [Column("WebPartLayoutID")] + public int WebPartLayoutId { get; set; } + + [StringLength(200)] + public string WebPartLayoutCodeName { get; set; } = null!; + + [StringLength(200)] + public string WebPartLayoutDisplayName { get; set; } = null!; + + public string? WebPartLayoutDescription { get; set; } + + public string? WebPartLayoutCode { get; set; } + + [Column("WebPartLayoutVersionGUID")] + [StringLength(100)] + public string? WebPartLayoutVersionGuid { get; set; } + + [Column("WebPartLayoutWebPartID")] + public int WebPartLayoutWebPartId { get; set; } + + [Column("WebPartLayoutGUID")] + public Guid WebPartLayoutGuid { get; set; } + + public DateTime WebPartLayoutLastModified { get; set; } + + [Column("WebPartLayoutCSS")] + public string? WebPartLayoutCss { get; set; } + + public bool? WebPartLayoutIsDefault { get; set; } + + [InverseProperty("WidgetLayout")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [ForeignKey("WebPartLayoutWebPartId")] + [InverseProperty("CmsWebPartLayouts")] + public virtual CmsWebPart WebPartLayoutWebPart { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWidget.cs b/Migration.Toolkit.KX13/Models/CmsWidget.cs index 5ee0586f..361f386e 100644 --- a/Migration.Toolkit.KX13/Models/CmsWidget.cs +++ b/Migration.Toolkit.KX13/Models/CmsWidget.cs @@ -1,73 +1,72 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Widget")] -[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] -[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] -[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] -public partial class CmsWidget -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Column("WidgetWebPartID")] - public int WidgetWebPartId { get; set; } - - [StringLength(100)] - public string WidgetDisplayName { get; set; } = null!; - - [StringLength(100)] - public string WidgetName { get; set; } = null!; - - public string? WidgetDescription { get; set; } - - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - public string? WidgetProperties { get; set; } - - public int WidgetSecurity { get; set; } - - [Column("WidgetGUID")] - public Guid WidgetGuid { get; set; } - - public DateTime WidgetLastModified { get; set; } - - public bool WidgetIsEnabled { get; set; } - - public string? WidgetDocumentation { get; set; } - - public string? WidgetDefaultValues { get; set; } - - [Column("WidgetLayoutID")] - public int? WidgetLayoutId { get; set; } - - public bool? WidgetSkipInsertProperties { get; set; } - - [Column("WidgetThumbnailGUID")] - public Guid? WidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? WidgetIconClass { get; set; } - - [InverseProperty("Widget")] - public virtual ICollection CmsWidgetRoles { get; set; } = new List(); - - [ForeignKey("WidgetCategoryId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; - - [ForeignKey("WidgetLayoutId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPartLayout? WidgetLayout { get; set; } - - [ForeignKey("WidgetWebPartId")] - [InverseProperty("CmsWidgets")] - public virtual CmsWebPart WidgetWebPart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Widget")] +[Index("WidgetCategoryId", Name = "IX_CMS_Widget_WidgetCategoryID")] +[Index("WidgetLayoutId", Name = "IX_CMS_Widget_WidgetLayoutID")] +[Index("WidgetWebPartId", Name = "IX_CMS_Widget_WidgetWebPartID")] +public class CmsWidget +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Column("WidgetWebPartID")] + public int WidgetWebPartId { get; set; } + + [StringLength(100)] + public string WidgetDisplayName { get; set; } = null!; + + [StringLength(100)] + public string WidgetName { get; set; } = null!; + + public string? WidgetDescription { get; set; } + + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + public string? WidgetProperties { get; set; } + + public int WidgetSecurity { get; set; } + + [Column("WidgetGUID")] + public Guid WidgetGuid { get; set; } + + public DateTime WidgetLastModified { get; set; } + + public bool WidgetIsEnabled { get; set; } + + public string? WidgetDocumentation { get; set; } + + public string? WidgetDefaultValues { get; set; } + + [Column("WidgetLayoutID")] + public int? WidgetLayoutId { get; set; } + + public bool? WidgetSkipInsertProperties { get; set; } + + [Column("WidgetThumbnailGUID")] + public Guid? WidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? WidgetIconClass { get; set; } + + [InverseProperty("Widget")] + public virtual ICollection CmsWidgetRoles { get; set; } = new List(); + + [ForeignKey("WidgetCategoryId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWidgetCategory WidgetCategory { get; set; } = null!; + + [ForeignKey("WidgetLayoutId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPartLayout? WidgetLayout { get; set; } + + [ForeignKey("WidgetWebPartId")] + [InverseProperty("CmsWidgets")] + public virtual CmsWebPart WidgetWebPart { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs b/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs index 9e1242a1..3bb04dd8 100644 --- a/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs +++ b/Migration.Toolkit.KX13/Models/CmsWidgetCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WidgetCategory")] -[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] -public partial class CmsWidgetCategory -{ - [Key] - [Column("WidgetCategoryID")] - public int WidgetCategoryId { get; set; } - - [StringLength(100)] - public string WidgetCategoryName { get; set; } = null!; - - [StringLength(100)] - public string WidgetCategoryDisplayName { get; set; } = null!; - - [Column("WidgetCategoryParentID")] - public int? WidgetCategoryParentId { get; set; } - - public string WidgetCategoryPath { get; set; } = null!; - - public int WidgetCategoryLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [Column("WidgetCategoryGUID")] - public Guid WidgetCategoryGuid { get; set; } - - public DateTime WidgetCategoryLastModified { get; set; } - - [InverseProperty("WidgetCategory")] - public virtual ICollection CmsWidgets { get; set; } = new List(); - - [InverseProperty("WidgetCategoryParent")] - public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); - - [ForeignKey("WidgetCategoryParentId")] - [InverseProperty("InverseWidgetCategoryParent")] - public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WidgetCategory")] +[Index("WidgetCategoryParentId", Name = "IX_CMS_WidgetCategory_WidgetCategoryParentID")] +public class CmsWidgetCategory +{ + [Key] + [Column("WidgetCategoryID")] + public int WidgetCategoryId { get; set; } + + [StringLength(100)] + public string WidgetCategoryName { get; set; } = null!; + + [StringLength(100)] + public string WidgetCategoryDisplayName { get; set; } = null!; + + [Column("WidgetCategoryParentID")] + public int? WidgetCategoryParentId { get; set; } + + public string WidgetCategoryPath { get; set; } = null!; + + public int WidgetCategoryLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [Column("WidgetCategoryGUID")] + public Guid WidgetCategoryGuid { get; set; } + + public DateTime WidgetCategoryLastModified { get; set; } + + [InverseProperty("WidgetCategory")] + public virtual ICollection CmsWidgets { get; set; } = new List(); + + [InverseProperty("WidgetCategoryParent")] + public virtual ICollection InverseWidgetCategoryParent { get; set; } = new List(); + + [ForeignKey("WidgetCategoryParentId")] + [InverseProperty("InverseWidgetCategoryParent")] + public virtual CmsWidgetCategory? WidgetCategoryParent { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs b/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs index 04376356..aa4252b7 100644 --- a/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs +++ b/Migration.Toolkit.KX13/Models/CmsWidgetRole.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("WidgetId", "RoleId", "PermissionId")] -[Table("CMS_WidgetRole")] -[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] -[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] -public partial class CmsWidgetRole -{ - [Key] - [Column("WidgetID")] - public int WidgetId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("PermissionId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("WidgetId")] - [InverseProperty("CmsWidgetRoles")] - public virtual CmsWidget Widget { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("WidgetId", "RoleId", "PermissionId")] +[Table("CMS_WidgetRole")] +[Index("PermissionId", Name = "IX_CMS_WidgetRole_PermissionID")] +[Index("RoleId", Name = "IX_CMS_WidgetRole_RoleID")] +public class CmsWidgetRole +{ + [Key] + [Column("WidgetID")] + public int WidgetId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("PermissionId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("WidgetId")] + [InverseProperty("CmsWidgetRoles")] + public virtual CmsWidget Widget { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflow.cs b/Migration.Toolkit.KX13/Models/CmsWorkflow.cs index 79dd2302..8ca44e6b 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflow.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflow.cs @@ -1,96 +1,93 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_Workflow")] -public partial class CmsWorkflow -{ - [Key] - [Column("WorkflowID")] - public int WorkflowId { get; set; } - - public string WorkflowDisplayName { get; set; } = null!; - - [StringLength(450)] - public string WorkflowName { get; set; } = null!; - - [Column("WorkflowGUID")] - public Guid WorkflowGuid { get; set; } - - public DateTime WorkflowLastModified { get; set; } - - public bool? WorkflowAutoPublishChanges { get; set; } - - public bool? WorkflowUseCheckinCheckout { get; set; } - - public int? WorkflowType { get; set; } - - public bool? WorkflowSendEmails { get; set; } - - public bool? WorkflowSendApproveEmails { get; set; } - - public bool? WorkflowSendRejectEmails { get; set; } - - public bool? WorkflowSendPublishEmails { get; set; } - - public bool? WorkflowSendArchiveEmails { get; set; } - - [StringLength(200)] - public string? WorkflowApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowPublishedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowArchivedTemplateName { get; set; } - - public bool? WorkflowSendReadyForApprovalEmails { get; set; } - - [StringLength(200)] - public string? WorkflowReadyForApprovalTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowNotificationTemplateName { get; set; } - - public string? WorkflowAllowedObjects { get; set; } - - public int? WorkflowRecurrenceType { get; set; } - - [Required] - public bool? WorkflowEnabled { get; set; } - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateWorkflow")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TriggerWorkflow")] - public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); - - [InverseProperty("VersionWorkflow")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); - - [InverseProperty("ScopeWorkflow")] - public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); - - [InverseProperty("StepWorkflow")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); - - [InverseProperty("TransitionWorkflow")] - public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); - - [ForeignKey("WorkflowId")] - [InverseProperty("Workflows")] - public virtual ICollection Users { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_Workflow")] +public class CmsWorkflow +{ + [Key] + [Column("WorkflowID")] + public int WorkflowId { get; set; } + + public string WorkflowDisplayName { get; set; } = null!; + + [StringLength(450)] + public string WorkflowName { get; set; } = null!; + + [Column("WorkflowGUID")] + public Guid WorkflowGuid { get; set; } + + public DateTime WorkflowLastModified { get; set; } + + public bool? WorkflowAutoPublishChanges { get; set; } + + public bool? WorkflowUseCheckinCheckout { get; set; } + + public int? WorkflowType { get; set; } + + public bool? WorkflowSendEmails { get; set; } + + public bool? WorkflowSendApproveEmails { get; set; } + + public bool? WorkflowSendRejectEmails { get; set; } + + public bool? WorkflowSendPublishEmails { get; set; } + + public bool? WorkflowSendArchiveEmails { get; set; } + + [StringLength(200)] + public string? WorkflowApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowPublishedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowArchivedTemplateName { get; set; } + + public bool? WorkflowSendReadyForApprovalEmails { get; set; } + + [StringLength(200)] + public string? WorkflowReadyForApprovalTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowNotificationTemplateName { get; set; } + + public string? WorkflowAllowedObjects { get; set; } + + public int? WorkflowRecurrenceType { get; set; } + + [Required] + public bool? WorkflowEnabled { get; set; } + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateWorkflow")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TriggerWorkflow")] + public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); + + [InverseProperty("VersionWorkflow")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsWorkflowHistories { get; set; } = new List(); + + [InverseProperty("ScopeWorkflow")] + public virtual ICollection CmsWorkflowScopes { get; set; } = new List(); + + [InverseProperty("StepWorkflow")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); + + [InverseProperty("TransitionWorkflow")] + public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); + + [ForeignKey("WorkflowId")] + [InverseProperty("Workflows")] + public virtual ICollection Users { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs index b446bdaf..38ef5704 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowAction.cs @@ -1,72 +1,71 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowAction")] -[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] -public partial class CmsWorkflowAction -{ - [Key] - [Column("ActionID")] - public int ActionId { get; set; } - - [StringLength(200)] - public string ActionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ActionName { get; set; } = null!; - - public string? ActionParameters { get; set; } - - public string? ActionDescription { get; set; } - - [StringLength(200)] - public string ActionAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string ActionClass { get; set; } = null!; - - [Column("ActionResourceID")] - public int? ActionResourceId { get; set; } - - [Column("ActionThumbnailGUID")] - public Guid? ActionThumbnailGuid { get; set; } - - [Column("ActionGUID")] - public Guid ActionGuid { get; set; } - - public DateTime ActionLastModified { get; set; } - - [Required] - public bool? ActionEnabled { get; set; } - - public string? ActionAllowedObjects { get; set; } - - [Column("ActionIconGUID")] - public Guid? ActionIconGuid { get; set; } - - public int? ActionWorkflowType { get; set; } - - [StringLength(200)] - public string? ActionIconClass { get; set; } - - [StringLength(200)] - public string? ActionThumbnailClass { get; set; } - - [StringLength(200)] - public string? ActionDataProviderClass { get; set; } - - [StringLength(200)] - public string? ActionDataProviderAssemblyName { get; set; } - - [ForeignKey("ActionResourceId")] - [InverseProperty("CmsWorkflowActions")] - public virtual CmsResource? ActionResource { get; set; } - - [InverseProperty("StepAction")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WorkflowAction")] +[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] +public class CmsWorkflowAction +{ + [Key] + [Column("ActionID")] + public int ActionId { get; set; } + + [StringLength(200)] + public string ActionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ActionName { get; set; } = null!; + + public string? ActionParameters { get; set; } + + public string? ActionDescription { get; set; } + + [StringLength(200)] + public string ActionAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string ActionClass { get; set; } = null!; + + [Column("ActionResourceID")] + public int? ActionResourceId { get; set; } + + [Column("ActionThumbnailGUID")] + public Guid? ActionThumbnailGuid { get; set; } + + [Column("ActionGUID")] + public Guid ActionGuid { get; set; } + + public DateTime ActionLastModified { get; set; } + + [Required] + public bool? ActionEnabled { get; set; } + + public string? ActionAllowedObjects { get; set; } + + [Column("ActionIconGUID")] + public Guid? ActionIconGuid { get; set; } + + public int? ActionWorkflowType { get; set; } + + [StringLength(200)] + public string? ActionIconClass { get; set; } + + [StringLength(200)] + public string? ActionThumbnailClass { get; set; } + + [StringLength(200)] + public string? ActionDataProviderClass { get; set; } + + [StringLength(200)] + public string? ActionDataProviderAssemblyName { get; set; } + + [ForeignKey("ActionResourceId")] + [InverseProperty("CmsWorkflowActions")] + public virtual CmsResource? ActionResource { get; set; } + + [InverseProperty("StepAction")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs index 6bf07e15..823a8962 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowHistory.cs @@ -1,88 +1,87 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowHistory")] -[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] -[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] -[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] -[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] -[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] -[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] -public partial class CmsWorkflowHistory -{ - [Key] - [Column("WorkflowHistoryID")] - public int WorkflowHistoryId { get; set; } - - [Column("VersionHistoryID")] - public int VersionHistoryId { get; set; } - - [Column("StepID")] - public int? StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [Column("ApprovedByUserID")] - public int? ApprovedByUserId { get; set; } - - public DateTime? ApprovedWhen { get; set; } - - public string? Comment { get; set; } - - public bool WasRejected { get; set; } - - [StringLength(440)] - public string? StepName { get; set; } - - [Column("TargetStepID")] - public int? TargetStepId { get; set; } - - [StringLength(440)] - public string? TargetStepName { get; set; } - - [StringLength(450)] - public string? TargetStepDisplayName { get; set; } - - public int? StepType { get; set; } - - public int? TargetStepType { get; set; } - - [StringLength(100)] - public string? HistoryObjectType { get; set; } - - [Column("HistoryObjectID")] - public int? HistoryObjectId { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int? HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - [ForeignKey("ApprovedByUserId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsUser? ApprovedByUser { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsWorkflow? HistoryWorkflow { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowHistorySteps")] - public virtual CmsWorkflowStep? Step { get; set; } - - [ForeignKey("TargetStepId")] - [InverseProperty("CmsWorkflowHistoryTargetSteps")] - public virtual CmsWorkflowStep? TargetStep { get; set; } - - [ForeignKey("VersionHistoryId")] - [InverseProperty("CmsWorkflowHistories")] - public virtual CmsVersionHistory VersionHistory { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WorkflowHistory")] +[Index("ApprovedByUserId", Name = "IX_CMS_WorkflowHistory_ApprovedByUserID")] +[Index("ApprovedWhen", Name = "IX_CMS_WorkflowHistory_ApprovedWhen")] +[Index("HistoryWorkflowId", Name = "IX_CMS_WorkflowHistory_HistoryWorkflowID")] +[Index("StepId", Name = "IX_CMS_WorkflowHistory_StepID")] +[Index("TargetStepId", Name = "IX_CMS_WorkflowHistory_TargetStepID")] +[Index("VersionHistoryId", Name = "IX_CMS_WorkflowHistory_VersionHistoryID")] +public class CmsWorkflowHistory +{ + [Key] + [Column("WorkflowHistoryID")] + public int WorkflowHistoryId { get; set; } + + [Column("VersionHistoryID")] + public int VersionHistoryId { get; set; } + + [Column("StepID")] + public int? StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [Column("ApprovedByUserID")] + public int? ApprovedByUserId { get; set; } + + public DateTime? ApprovedWhen { get; set; } + + public string? Comment { get; set; } + + public bool WasRejected { get; set; } + + [StringLength(440)] + public string? StepName { get; set; } + + [Column("TargetStepID")] + public int? TargetStepId { get; set; } + + [StringLength(440)] + public string? TargetStepName { get; set; } + + [StringLength(450)] + public string? TargetStepDisplayName { get; set; } + + public int? StepType { get; set; } + + public int? TargetStepType { get; set; } + + [StringLength(100)] + public string? HistoryObjectType { get; set; } + + [Column("HistoryObjectID")] + public int? HistoryObjectId { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int? HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + [ForeignKey("ApprovedByUserId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsUser? ApprovedByUser { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsWorkflow? HistoryWorkflow { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowHistorySteps")] + public virtual CmsWorkflowStep? Step { get; set; } + + [ForeignKey("TargetStepId")] + [InverseProperty("CmsWorkflowHistoryTargetSteps")] + public virtual CmsWorkflowStep? TargetStep { get; set; } + + [ForeignKey("VersionHistoryId")] + [InverseProperty("CmsWorkflowHistories")] + public virtual CmsVersionHistory VersionHistory { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs index b0f4df62..79559a9d 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowScope.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowScope")] -[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] -[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] -[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] -[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] -public partial class CmsWorkflowScope -{ - [Key] - [Column("ScopeID")] - public int ScopeId { get; set; } - - public string ScopeStartingPath { get; set; } = null!; - - [Column("ScopeWorkflowID")] - public int ScopeWorkflowId { get; set; } - - [Column("ScopeClassID")] - public int? ScopeClassId { get; set; } - - [Column("ScopeSiteID")] - public int ScopeSiteId { get; set; } - - [Column("ScopeGUID")] - public Guid ScopeGuid { get; set; } - - public DateTime ScopeLastModified { get; set; } - - [Column("ScopeCultureID")] - public int? ScopeCultureId { get; set; } - - public bool? ScopeExcludeChildren { get; set; } - - public bool ScopeExcluded { get; set; } - - public string? ScopeMacroCondition { get; set; } - - [ForeignKey("ScopeClassId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsClass? ScopeClass { get; set; } - - [ForeignKey("ScopeCultureId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsCulture? ScopeCulture { get; set; } - - [ForeignKey("ScopeSiteId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsSite ScopeSite { get; set; } = null!; - - [ForeignKey("ScopeWorkflowId")] - [InverseProperty("CmsWorkflowScopes")] - public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WorkflowScope")] +[Index("ScopeClassId", Name = "IX_CMS_WorkflowScope_ScopeClassID")] +[Index("ScopeCultureId", Name = "IX_CMS_WorkflowScope_ScopeCultureID")] +[Index("ScopeSiteId", Name = "IX_CMS_WorkflowScope_ScopeSiteID")] +[Index("ScopeWorkflowId", Name = "IX_CMS_WorkflowScope_ScopeWorkflowID")] +public class CmsWorkflowScope +{ + [Key] + [Column("ScopeID")] + public int ScopeId { get; set; } + + public string ScopeStartingPath { get; set; } = null!; + + [Column("ScopeWorkflowID")] + public int ScopeWorkflowId { get; set; } + + [Column("ScopeClassID")] + public int? ScopeClassId { get; set; } + + [Column("ScopeSiteID")] + public int ScopeSiteId { get; set; } + + [Column("ScopeGUID")] + public Guid ScopeGuid { get; set; } + + public DateTime ScopeLastModified { get; set; } + + [Column("ScopeCultureID")] + public int? ScopeCultureId { get; set; } + + public bool? ScopeExcludeChildren { get; set; } + + public bool ScopeExcluded { get; set; } + + public string? ScopeMacroCondition { get; set; } + + [ForeignKey("ScopeClassId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsClass? ScopeClass { get; set; } + + [ForeignKey("ScopeCultureId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsCulture? ScopeCulture { get; set; } + + [ForeignKey("ScopeSiteId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsSite ScopeSite { get; set; } = null!; + + [ForeignKey("ScopeWorkflowId")] + [InverseProperty("CmsWorkflowScopes")] + public virtual CmsWorkflow ScopeWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs index 40f821c7..971aebe3 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowStep.cs @@ -1,115 +1,114 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowStep")] -[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] -[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] -[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] -[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] -public partial class CmsWorkflowStep -{ - [Key] - [Column("StepID")] - public int StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [StringLength(440)] - public string? StepName { get; set; } - - public int? StepOrder { get; set; } - - [Column("StepWorkflowID")] - public int StepWorkflowId { get; set; } - - [Column("StepGUID")] - public Guid StepGuid { get; set; } - - public DateTime StepLastModified { get; set; } - - public int? StepType { get; set; } - - public bool? StepAllowReject { get; set; } - - public string? StepDefinition { get; set; } - - public int? StepRolesSecurity { get; set; } - - public int? StepUsersSecurity { get; set; } - - [StringLength(200)] - public string? StepApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? StepRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? StepReadyforApprovalTemplateName { get; set; } - - public bool? StepSendApproveEmails { get; set; } - - public bool? StepSendRejectEmails { get; set; } - - public bool? StepSendReadyForApprovalEmails { get; set; } - - public bool? StepSendEmails { get; set; } - - public bool? StepAllowPublish { get; set; } - - [Column("StepActionID")] - public int? StepActionId { get; set; } - - public string? StepActionParameters { get; set; } - - public int? StepWorkflowType { get; set; } - - [InverseProperty("HistoryStep")] - public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); - - [InverseProperty("HistoryTargetStep")] - public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("StateStep")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("DocumentWorkflowStep")] - public virtual ICollection CmsDocuments { get; set; } = new List(); - - [InverseProperty("ObjectWorkflowStep")] - public virtual ICollection CmsObjectSettings { get; set; } = new List(); - - [InverseProperty("VersionWorkflowStep")] - public virtual ICollection CmsVersionHistories { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); - - [InverseProperty("TargetStep")] - public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Step")] - public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); - - [InverseProperty("TransitionEndStep")] - public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); - - [InverseProperty("TransitionStartStep")] - public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); - - [ForeignKey("StepActionId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflowAction? StepAction { get; set; } - - [ForeignKey("StepWorkflowId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflow StepWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WorkflowStep")] +[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] +[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] +[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] +[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] +public class CmsWorkflowStep +{ + [Key] + [Column("StepID")] + public int StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [StringLength(440)] + public string? StepName { get; set; } + + public int? StepOrder { get; set; } + + [Column("StepWorkflowID")] + public int StepWorkflowId { get; set; } + + [Column("StepGUID")] + public Guid StepGuid { get; set; } + + public DateTime StepLastModified { get; set; } + + public int? StepType { get; set; } + + public bool? StepAllowReject { get; set; } + + public string? StepDefinition { get; set; } + + public int? StepRolesSecurity { get; set; } + + public int? StepUsersSecurity { get; set; } + + [StringLength(200)] + public string? StepApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? StepRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? StepReadyforApprovalTemplateName { get; set; } + + public bool? StepSendApproveEmails { get; set; } + + public bool? StepSendRejectEmails { get; set; } + + public bool? StepSendReadyForApprovalEmails { get; set; } + + public bool? StepSendEmails { get; set; } + + public bool? StepAllowPublish { get; set; } + + [Column("StepActionID")] + public int? StepActionId { get; set; } + + public string? StepActionParameters { get; set; } + + public int? StepWorkflowType { get; set; } + + [InverseProperty("HistoryStep")] + public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); + + [InverseProperty("HistoryTargetStep")] + public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("StateStep")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("DocumentWorkflowStep")] + public virtual ICollection CmsDocuments { get; set; } = new List(); + + [InverseProperty("ObjectWorkflowStep")] + public virtual ICollection CmsObjectSettings { get; set; } = new List(); + + [InverseProperty("VersionWorkflowStep")] + public virtual ICollection CmsVersionHistories { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowHistorySteps { get; set; } = new List(); + + [InverseProperty("TargetStep")] + public virtual ICollection CmsWorkflowHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Step")] + public virtual ICollection CmsWorkflowStepUsers { get; set; } = new List(); + + [InverseProperty("TransitionEndStep")] + public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); + + [InverseProperty("TransitionStartStep")] + public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); + + [ForeignKey("StepActionId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflowAction? StepAction { get; set; } + + [ForeignKey("StepWorkflowId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflow StepWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs index 9ffd24b8..3aa228fc 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowStepRole.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowStepRoles")] -[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] -public partial class CmsWorkflowStepRole -{ - [Key] - [Column("WorkflowStepRoleID")] - public int WorkflowStepRoleId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepRoles")] - public virtual CmsWorkflowStep Step { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WorkflowStepRoles")] +[Index("RoleId", Name = "IX_CMS_WorkflowStepRoles_RoleID")] +public class CmsWorkflowStepRole +{ + [Key] + [Column("WorkflowStepRoleID")] + public int WorkflowStepRoleId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepRoles")] + public virtual CmsWorkflowStep Step { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs index 70c00647..910ecc9c 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowStepUser.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowStepUser")] -[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] -public partial class CmsWorkflowStepUser -{ - [Key] - [Column("WorkflowStepUserID")] - public int WorkflowStepUserId { get; set; } - - [Column("StepID")] - public int StepId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [Column("StepSourcePointGUID")] - public Guid? StepSourcePointGuid { get; set; } - - [ForeignKey("StepId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsWorkflowStep Step { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsWorkflowStepUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WorkflowStepUser")] +[Index("UserId", Name = "IX_CMS_WorkflowStepUser_UserID")] +public class CmsWorkflowStepUser +{ + [Key] + [Column("WorkflowStepUserID")] + public int WorkflowStepUserId { get; set; } + + [Column("StepID")] + public int StepId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [Column("StepSourcePointGUID")] + public Guid? StepSourcePointGuid { get; set; } + + [ForeignKey("StepId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsWorkflowStep Step { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsWorkflowStepUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs index 2ea43d07..047ee75a 100644 --- a/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs +++ b/Migration.Toolkit.KX13/Models/CmsWorkflowTransition.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("CMS_WorkflowTransition")] -[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] -[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] -[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] -public partial class CmsWorkflowTransition -{ - [Key] - [Column("TransitionID")] - public int TransitionId { get; set; } - - [Column("TransitionStartStepID")] - public int TransitionStartStepId { get; set; } - - [Column("TransitionEndStepID")] - public int TransitionEndStepId { get; set; } - - public int TransitionType { get; set; } - - public DateTime TransitionLastModified { get; set; } - - [Column("TransitionSourcePointGUID")] - public Guid? TransitionSourcePointGuid { get; set; } - - [Column("TransitionWorkflowID")] - public int TransitionWorkflowId { get; set; } - - [ForeignKey("TransitionEndStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] - public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; - - [ForeignKey("TransitionStartStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] - public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; - - [ForeignKey("TransitionWorkflowId")] - [InverseProperty("CmsWorkflowTransitions")] - public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("CMS_WorkflowTransition")] +[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] +[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] +[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] +public class CmsWorkflowTransition +{ + [Key] + [Column("TransitionID")] + public int TransitionId { get; set; } + + [Column("TransitionStartStepID")] + public int TransitionStartStepId { get; set; } + + [Column("TransitionEndStepID")] + public int TransitionEndStepId { get; set; } + + public int TransitionType { get; set; } + + public DateTime TransitionLastModified { get; set; } + + [Column("TransitionSourcePointGUID")] + public Guid? TransitionSourcePointGuid { get; set; } + + [Column("TransitionWorkflowID")] + public int TransitionWorkflowId { get; set; } + + [ForeignKey("TransitionEndStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] + public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; + + [ForeignKey("TransitionStartStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] + public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; + + [ForeignKey("TransitionWorkflowId")] + [InverseProperty("CmsWorkflowTransitions")] + public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComAddress.cs b/Migration.Toolkit.KX13/Models/ComAddress.cs index 8d34bb05..c5f7ca25 100644 --- a/Migration.Toolkit.KX13/Models/ComAddress.cs +++ b/Migration.Toolkit.KX13/Models/ComAddress.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Address")] -[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] -[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] -[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] -public partial class ComAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(200)] - public string AddressName { get; set; } = null!; - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCustomerID")] - public int AddressCustomerId { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressCustomerId")] - [InverseProperty("ComAddresses")] - public virtual ComCustomer AddressCustomer { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComAddresses")] - public virtual CmsState? AddressState { get; set; } - - [InverseProperty("ShoppingCartBillingAddress")] - public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartCompanyAddress")] - public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingAddress")] - public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Address")] +[Index("AddressCountryId", Name = "IX_COM_Address_AddressCountryID")] +[Index("AddressCustomerId", Name = "IX_COM_Address_AddressCustomerID")] +[Index("AddressStateId", Name = "IX_COM_Address_AddressStateID")] +public class ComAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(200)] + public string AddressName { get; set; } = null!; + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCustomerID")] + public int AddressCustomerId { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressCustomerId")] + [InverseProperty("ComAddresses")] + public virtual ComCustomer AddressCustomer { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComAddresses")] + public virtual CmsState? AddressState { get; set; } + + [InverseProperty("ShoppingCartBillingAddress")] + public virtual ICollection ComShoppingCartShoppingCartBillingAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartCompanyAddress")] + public virtual ICollection ComShoppingCartShoppingCartCompanyAddresses { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingAddress")] + public virtual ICollection ComShoppingCartShoppingCartShippingAddresses { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ComBrand.cs b/Migration.Toolkit.KX13/Models/ComBrand.cs index ad8c26f9..be00c224 100644 --- a/Migration.Toolkit.KX13/Models/ComBrand.cs +++ b/Migration.Toolkit.KX13/Models/ComBrand.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Brand")] -[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] -[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] -public partial class ComBrand -{ - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [StringLength(200)] - public string BrandDisplayName { get; set; } = null!; - - [StringLength(200)] - public string BrandName { get; set; } = null!; - - public string? BrandDescription { get; set; } - - [StringLength(400)] - public string? BrandHomepage { get; set; } - - [Column("BrandThumbnailGUID")] - public Guid? BrandThumbnailGuid { get; set; } - - [Column("BrandSiteID")] - public int BrandSiteId { get; set; } - - [Required] - public bool? BrandEnabled { get; set; } - - public Guid BrandGuid { get; set; } - - public DateTime BrandLastModified { get; set; } - - [ForeignKey("BrandSiteId")] - [InverseProperty("ComBrands")] - public virtual CmsSite BrandSite { get; set; } = null!; - - [InverseProperty("Brand")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("Skubrand")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Brand")] +[Index("BrandDisplayName", Name = "IX_COM_Brand_BrandDisplayName")] +[Index("BrandSiteId", "BrandEnabled", Name = "IX_COM_Brand_BrandSiteID_BrandEnabled")] +public class ComBrand +{ + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [StringLength(200)] + public string BrandDisplayName { get; set; } = null!; + + [StringLength(200)] + public string BrandName { get; set; } = null!; + + public string? BrandDescription { get; set; } + + [StringLength(400)] + public string? BrandHomepage { get; set; } + + [Column("BrandThumbnailGUID")] + public Guid? BrandThumbnailGuid { get; set; } + + [Column("BrandSiteID")] + public int BrandSiteId { get; set; } + + [Required] + public bool? BrandEnabled { get; set; } + + public Guid BrandGuid { get; set; } + + public DateTime BrandLastModified { get; set; } + + [ForeignKey("BrandSiteId")] + [InverseProperty("ComBrands")] + public virtual CmsSite BrandSite { get; set; } = null!; + + [InverseProperty("Brand")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("Skubrand")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ComCarrier.cs b/Migration.Toolkit.KX13/Models/ComCarrier.cs index 8b600e9f..3db33acf 100644 --- a/Migration.Toolkit.KX13/Models/ComCarrier.cs +++ b/Migration.Toolkit.KX13/Models/ComCarrier.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Carrier")] -[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] -public partial class ComCarrier -{ - [Key] - [Column("CarrierID")] - public int CarrierId { get; set; } - - [StringLength(200)] - public string CarrierDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CarrierName { get; set; } = null!; - - [Column("CarrierSiteID")] - public int CarrierSiteId { get; set; } - - [Column("CarrierGUID")] - public Guid CarrierGuid { get; set; } - - [StringLength(200)] - public string CarrierAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string CarrierClassName { get; set; } = null!; - - public DateTime CarrierLastModified { get; set; } - - [ForeignKey("CarrierSiteId")] - [InverseProperty("ComCarriers")] - public virtual CmsSite CarrierSite { get; set; } = null!; - - [InverseProperty("ShippingOptionCarrier")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Carrier")] +[Index("CarrierSiteId", Name = "IX_COM_Carrier_CarrierSiteID")] +public class ComCarrier +{ + [Key] + [Column("CarrierID")] + public int CarrierId { get; set; } + + [StringLength(200)] + public string CarrierDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CarrierName { get; set; } = null!; + + [Column("CarrierSiteID")] + public int CarrierSiteId { get; set; } + + [Column("CarrierGUID")] + public Guid CarrierGuid { get; set; } + + [StringLength(200)] + public string CarrierAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string CarrierClassName { get; set; } = null!; + + public DateTime CarrierLastModified { get; set; } + + [ForeignKey("CarrierSiteId")] + [InverseProperty("ComCarriers")] + public virtual CmsSite CarrierSite { get; set; } = null!; + + [InverseProperty("ShippingOptionCarrier")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ComCollection.cs b/Migration.Toolkit.KX13/Models/ComCollection.cs index 901ba62c..e9d3bcc6 100644 --- a/Migration.Toolkit.KX13/Models/ComCollection.cs +++ b/Migration.Toolkit.KX13/Models/ComCollection.cs @@ -1,45 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Collection")] -[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] -[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] -public partial class ComCollection -{ - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [StringLength(200)] - public string CollectionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CollectionName { get; set; } = null!; - - public string? CollectionDescription { get; set; } - - [Column("CollectionSiteID")] - public int CollectionSiteId { get; set; } - - [Required] - public bool? CollectionEnabled { get; set; } - - public Guid CollectionGuid { get; set; } - - public DateTime CollectionLastModified { get; set; } - - [ForeignKey("CollectionSiteId")] - [InverseProperty("ComCollections")] - public virtual CmsSite CollectionSite { get; set; } = null!; - - [InverseProperty("Collection")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("Skucollection")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Collection")] +[Index("CollectionDisplayName", Name = "IX_COM_Collection_CollectionDisplayName")] +[Index("CollectionSiteId", "CollectionEnabled", Name = "IX_COM_Collection_CollectionSiteID_CollectionEnabled")] +public class ComCollection +{ + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [StringLength(200)] + public string CollectionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CollectionName { get; set; } = null!; + + public string? CollectionDescription { get; set; } + + [Column("CollectionSiteID")] + public int CollectionSiteId { get; set; } + + [Required] + public bool? CollectionEnabled { get; set; } + + public Guid CollectionGuid { get; set; } + + public DateTime CollectionLastModified { get; set; } + + [ForeignKey("CollectionSiteId")] + [InverseProperty("ComCollections")] + public virtual CmsSite CollectionSite { get; set; } = null!; + + [InverseProperty("Collection")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("Skucollection")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ComCouponCode.cs b/Migration.Toolkit.KX13/Models/ComCouponCode.cs index ff134612..84eafe87 100644 --- a/Migration.Toolkit.KX13/Models/ComCouponCode.cs +++ b/Migration.Toolkit.KX13/Models/ComCouponCode.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_CouponCode")] -[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] -public partial class ComCouponCode -{ - [Key] - [Column("CouponCodeID")] - public int CouponCodeId { get; set; } - - [StringLength(200)] - public string CouponCodeCode { get; set; } = null!; - - public int? CouponCodeUseCount { get; set; } - - public int? CouponCodeUseLimit { get; set; } - - [Column("CouponCodeDiscountID")] - public int CouponCodeDiscountId { get; set; } - - public DateTime CouponCodeLastModified { get; set; } - - [Column("CouponCodeGUID")] - public Guid CouponCodeGuid { get; set; } - - [ForeignKey("CouponCodeDiscountId")] - [InverseProperty("ComCouponCodes")] - public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_CouponCode")] +[Index("CouponCodeDiscountId", Name = "IX_COM_CouponCode_CouponCodeDiscountID")] +public class ComCouponCode +{ + [Key] + [Column("CouponCodeID")] + public int CouponCodeId { get; set; } + + [StringLength(200)] + public string CouponCodeCode { get; set; } = null!; + + public int? CouponCodeUseCount { get; set; } + + public int? CouponCodeUseLimit { get; set; } + + [Column("CouponCodeDiscountID")] + public int CouponCodeDiscountId { get; set; } + + public DateTime CouponCodeLastModified { get; set; } + + [Column("CouponCodeGUID")] + public Guid CouponCodeGuid { get; set; } + + [ForeignKey("CouponCodeDiscountId")] + [InverseProperty("ComCouponCodes")] + public virtual ComDiscount CouponCodeDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComCurrency.cs b/Migration.Toolkit.KX13/Models/ComCurrency.cs index 2387affa..9f2dde9f 100644 --- a/Migration.Toolkit.KX13/Models/ComCurrency.cs +++ b/Migration.Toolkit.KX13/Models/ComCurrency.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Currency")] -[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] -[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] -public partial class ComCurrency -{ - [Key] - [Column("CurrencyID")] - public int CurrencyId { get; set; } - - [StringLength(200)] - public string CurrencyName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CurrencyCode { get; set; } = null!; - - public int? CurrencyRoundTo { get; set; } - - public bool CurrencyEnabled { get; set; } - - [StringLength(200)] - public string CurrencyFormatString { get; set; } = null!; - - public bool CurrencyIsMain { get; set; } - - [Column("CurrencyGUID")] - public Guid? CurrencyGuid { get; set; } - - public DateTime CurrencyLastModified { get; set; } - - [Column("CurrencySiteID")] - public int? CurrencySiteId { get; set; } - - [InverseProperty("ExchangeRateToCurrency")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [InverseProperty("OrderCurrency")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCurrency")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CurrencySiteId")] - [InverseProperty("ComCurrencies")] - public virtual CmsSite? CurrencySite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Currency")] +[Index("CurrencyDisplayName", Name = "IX_COM_Currency_CurrencyDisplayName")] +[Index("CurrencySiteId", Name = "IX_COM_Currency_CurrencySiteID")] +public class ComCurrency +{ + [Key] + [Column("CurrencyID")] + public int CurrencyId { get; set; } + + [StringLength(200)] + public string CurrencyName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CurrencyCode { get; set; } = null!; + + public int? CurrencyRoundTo { get; set; } + + public bool CurrencyEnabled { get; set; } + + [StringLength(200)] + public string CurrencyFormatString { get; set; } = null!; + + public bool CurrencyIsMain { get; set; } + + [Column("CurrencyGUID")] + public Guid? CurrencyGuid { get; set; } + + public DateTime CurrencyLastModified { get; set; } + + [Column("CurrencySiteID")] + public int? CurrencySiteId { get; set; } + + [InverseProperty("ExchangeRateToCurrency")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [InverseProperty("OrderCurrency")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCurrency")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CurrencySiteId")] + [InverseProperty("ComCurrencies")] + public virtual CmsSite? CurrencySite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs b/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs index e4dd9fd4..c876abed 100644 --- a/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs +++ b/Migration.Toolkit.KX13/Models/ComCurrencyExchangeRate.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_CurrencyExchangeRate")] -[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] -[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] -public partial class ComCurrencyExchangeRate -{ - [Key] - [Column("ExchagneRateID")] - public int ExchagneRateId { get; set; } - - [Column("ExchangeRateToCurrencyID")] - public int ExchangeRateToCurrencyId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ExchangeRateValue { get; set; } - - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [Column("ExchangeRateGUID")] - public Guid ExchangeRateGuid { get; set; } - - public DateTime ExchangeRateLastModified { get; set; } - - [ForeignKey("ExchangeRateToCurrencyId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; - - [ForeignKey("ExchangeTableId")] - [InverseProperty("ComCurrencyExchangeRates")] - public virtual ComExchangeTable ExchangeTable { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_CurrencyExchangeRate")] +[Index("ExchangeRateToCurrencyId", Name = "IX_COM_CurrencyExchangeRate_ExchangeRateToCurrencyID")] +[Index("ExchangeTableId", Name = "IX_COM_CurrencyExchangeRate_ExchangeTableID")] +public class ComCurrencyExchangeRate +{ + [Key] + [Column("ExchagneRateID")] + public int ExchagneRateId { get; set; } + + [Column("ExchangeRateToCurrencyID")] + public int ExchangeRateToCurrencyId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ExchangeRateValue { get; set; } + + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [Column("ExchangeRateGUID")] + public Guid ExchangeRateGuid { get; set; } + + public DateTime ExchangeRateLastModified { get; set; } + + [ForeignKey("ExchangeRateToCurrencyId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComCurrency ExchangeRateToCurrency { get; set; } = null!; + + [ForeignKey("ExchangeTableId")] + [InverseProperty("ComCurrencyExchangeRates")] + public virtual ComExchangeTable ExchangeTable { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComCustomer.cs b/Migration.Toolkit.KX13/Models/ComCustomer.cs index c7150afb..290fef21 100644 --- a/Migration.Toolkit.KX13/Models/ComCustomer.cs +++ b/Migration.Toolkit.KX13/Models/ComCustomer.cs @@ -1,79 +1,78 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Customer")] -[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] -[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] -[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] -[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] -[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] -public partial class ComCustomer -{ - [Key] - [Column("CustomerID")] - public int CustomerId { get; set; } - - [StringLength(200)] - public string CustomerFirstName { get; set; } = null!; - - [StringLength(200)] - public string CustomerLastName { get; set; } = null!; - - [StringLength(254)] - public string? CustomerEmail { get; set; } - - [StringLength(26)] - public string? CustomerPhone { get; set; } - - [StringLength(50)] - public string? CustomerFax { get; set; } - - [StringLength(200)] - public string? CustomerCompany { get; set; } - - [Column("CustomerUserID")] - public int? CustomerUserId { get; set; } - - [Column("CustomerGUID")] - public Guid CustomerGuid { get; set; } - - [Column("CustomerTaxRegistrationID")] - [StringLength(50)] - public string? CustomerTaxRegistrationId { get; set; } - - [Column("CustomerOrganizationID")] - [StringLength(50)] - public string? CustomerOrganizationId { get; set; } - - public DateTime CustomerLastModified { get; set; } - - [Column("CustomerSiteID")] - public int? CustomerSiteId { get; set; } - - public DateTime? CustomerCreated { get; set; } - - [InverseProperty("AddressCustomer")] - public virtual ICollection ComAddresses { get; set; } = new List(); - - [InverseProperty("EventCustomer")] - public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); - - [InverseProperty("OrderCustomer")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartCustomer")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("CustomerSiteId")] - [InverseProperty("ComCustomers")] - public virtual CmsSite? CustomerSite { get; set; } - - [ForeignKey("CustomerUserId")] - [InverseProperty("ComCustomers")] - public virtual CmsUser? CustomerUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Customer")] +[Index("CustomerEmail", Name = "IX_COM_Customer_CustomerEmail")] +[Index("CustomerFirstName", Name = "IX_COM_Customer_CustomerFirstName")] +[Index("CustomerLastName", Name = "IX_COM_Customer_CustomerLastName")] +[Index("CustomerSiteId", Name = "IX_COM_Customer_CustomerSiteID")] +[Index("CustomerUserId", Name = "IX_COM_Customer_CustomerUserID")] +public class ComCustomer +{ + [Key] + [Column("CustomerID")] + public int CustomerId { get; set; } + + [StringLength(200)] + public string CustomerFirstName { get; set; } = null!; + + [StringLength(200)] + public string CustomerLastName { get; set; } = null!; + + [StringLength(254)] + public string? CustomerEmail { get; set; } + + [StringLength(26)] + public string? CustomerPhone { get; set; } + + [StringLength(50)] + public string? CustomerFax { get; set; } + + [StringLength(200)] + public string? CustomerCompany { get; set; } + + [Column("CustomerUserID")] + public int? CustomerUserId { get; set; } + + [Column("CustomerGUID")] + public Guid CustomerGuid { get; set; } + + [Column("CustomerTaxRegistrationID")] + [StringLength(50)] + public string? CustomerTaxRegistrationId { get; set; } + + [Column("CustomerOrganizationID")] + [StringLength(50)] + public string? CustomerOrganizationId { get; set; } + + public DateTime CustomerLastModified { get; set; } + + [Column("CustomerSiteID")] + public int? CustomerSiteId { get; set; } + + public DateTime? CustomerCreated { get; set; } + + [InverseProperty("AddressCustomer")] + public virtual ICollection ComAddresses { get; set; } = new List(); + + [InverseProperty("EventCustomer")] + public virtual ICollection ComCustomerCreditHistories { get; set; } = new List(); + + [InverseProperty("OrderCustomer")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartCustomer")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("CustomerSiteId")] + [InverseProperty("ComCustomers")] + public virtual CmsSite? CustomerSite { get; set; } + + [ForeignKey("CustomerUserId")] + [InverseProperty("ComCustomers")] + public virtual CmsUser? CustomerUser { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs b/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs index b04b4526..d32cbf50 100644 --- a/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs +++ b/Migration.Toolkit.KX13/Models/ComCustomerCreditHistory.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_CustomerCreditHistory")] -[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] -[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] -public partial class ComCustomerCreditHistory -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(200)] - public string EventName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal EventCreditChange { get; set; } - - public DateTime EventDate { get; set; } - - public string? EventDescription { get; set; } - - [Column("EventCustomerID")] - public int EventCustomerId { get; set; } - - [Column("EventCreditGUID")] - public Guid? EventCreditGuid { get; set; } - - public DateTime EventCreditLastModified { get; set; } - - [Column("EventSiteID")] - public int? EventSiteId { get; set; } - - [ForeignKey("EventCustomerId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual ComCustomer EventCustomer { get; set; } = null!; - - [ForeignKey("EventSiteId")] - [InverseProperty("ComCustomerCreditHistories")] - public virtual CmsSite? EventSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_CustomerCreditHistory")] +[Index("EventCustomerId", "EventDate", Name = "IX_COM_CustomerCreditHistory_EventCustomerID_EventDate", IsDescending = new[] { false, true })] +[Index("EventSiteId", Name = "IX_COM_CustomerCreditHistory_EventSiteID")] +public class ComCustomerCreditHistory +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(200)] + public string EventName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal EventCreditChange { get; set; } + + public DateTime EventDate { get; set; } + + public string? EventDescription { get; set; } + + [Column("EventCustomerID")] + public int EventCustomerId { get; set; } + + [Column("EventCreditGUID")] + public Guid? EventCreditGuid { get; set; } + + public DateTime EventCreditLastModified { get; set; } + + [Column("EventSiteID")] + public int? EventSiteId { get; set; } + + [ForeignKey("EventCustomerId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual ComCustomer EventCustomer { get; set; } = null!; + + [ForeignKey("EventSiteId")] + [InverseProperty("ComCustomerCreditHistories")] + public virtual CmsSite? EventSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComDepartment.cs b/Migration.Toolkit.KX13/Models/ComDepartment.cs index 61f61b4b..71f629a0 100644 --- a/Migration.Toolkit.KX13/Models/ComDepartment.cs +++ b/Migration.Toolkit.KX13/Models/ComDepartment.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Department")] -[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] -[Index("DepartmentDisplayName", Name = "IX_COM_Department_DepartmentDisplayName")] -[Index("DepartmentName", "DepartmentSiteId", Name = "IX_COM_Department_DepartmentName_DepartmentSiteID", IsUnique = true)] -[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] -public partial class ComDepartment -{ - [Key] - [Column("DepartmentID")] - public int DepartmentId { get; set; } - - [StringLength(200)] - public string DepartmentName { get; set; } = null!; - - [StringLength(200)] - public string DepartmentDisplayName { get; set; } = null!; - - [Column("DepartmentDefaultTaxClassID")] - public int? DepartmentDefaultTaxClassId { get; set; } - - [Column("DepartmentGUID")] - public Guid DepartmentGuid { get; set; } - - public DateTime DepartmentLastModified { get; set; } - - [Column("DepartmentSiteID")] - public int? DepartmentSiteId { get; set; } - - [InverseProperty("Skudepartment")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("DepartmentDefaultTaxClassId")] - [InverseProperty("ComDepartments")] - public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } - - [ForeignKey("DepartmentSiteId")] - [InverseProperty("ComDepartments")] - public virtual CmsSite? DepartmentSite { get; set; } - - [ForeignKey("DepartmentId")] - [InverseProperty("Departments")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Department")] +[Index("DepartmentDefaultTaxClassId", Name = "IX_COM_Department_DepartmentDefaultTaxClassID")] +[Index("DepartmentDisplayName", Name = "IX_COM_Department_DepartmentDisplayName")] +[Index("DepartmentName", "DepartmentSiteId", Name = "IX_COM_Department_DepartmentName_DepartmentSiteID", IsUnique = true)] +[Index("DepartmentSiteId", Name = "IX_COM_Department_DepartmentSiteID")] +public class ComDepartment +{ + [Key] + [Column("DepartmentID")] + public int DepartmentId { get; set; } + + [StringLength(200)] + public string DepartmentName { get; set; } = null!; + + [StringLength(200)] + public string DepartmentDisplayName { get; set; } = null!; + + [Column("DepartmentDefaultTaxClassID")] + public int? DepartmentDefaultTaxClassId { get; set; } + + [Column("DepartmentGUID")] + public Guid DepartmentGuid { get; set; } + + public DateTime DepartmentLastModified { get; set; } + + [Column("DepartmentSiteID")] + public int? DepartmentSiteId { get; set; } + + [InverseProperty("Skudepartment")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("DepartmentDefaultTaxClassId")] + [InverseProperty("ComDepartments")] + public virtual ComTaxClass? DepartmentDefaultTaxClass { get; set; } + + [ForeignKey("DepartmentSiteId")] + [InverseProperty("ComDepartments")] + public virtual CmsSite? DepartmentSite { get; set; } + + [ForeignKey("DepartmentId")] + [InverseProperty("Departments")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ComDiscount.cs b/Migration.Toolkit.KX13/Models/ComDiscount.cs index ee38626d..517a5a43 100644 --- a/Migration.Toolkit.KX13/Models/ComDiscount.cs +++ b/Migration.Toolkit.KX13/Models/ComDiscount.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Discount")] -[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] -public partial class ComDiscount -{ - [Key] - [Column("DiscountID")] - public int DiscountId { get; set; } - - [StringLength(200)] - public string DiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string DiscountName { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal DiscountValue { get; set; } - - [Required] - public bool? DiscountEnabled { get; set; } - - [Column("DiscountGUID")] - public Guid DiscountGuid { get; set; } - - public DateTime DiscountLastModified { get; set; } - - [Column("DiscountSiteID")] - public int DiscountSiteId { get; set; } - - public string? DiscountDescription { get; set; } - - public DateTime? DiscountValidFrom { get; set; } - - public DateTime? DiscountValidTo { get; set; } - - public double DiscountOrder { get; set; } - - public string? DiscountProductCondition { get; set; } - - [StringLength(400)] - public string? DiscountRoles { get; set; } - - [StringLength(200)] - public string? DiscountCustomerRestriction { get; set; } - - public bool DiscountIsFlat { get; set; } - - public string? DiscountCartCondition { get; set; } - - [StringLength(100)] - public string DiscountApplyTo { get; set; } = null!; - - [Required] - public bool? DiscountApplyFurtherDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? DiscountOrderAmount { get; set; } - - public bool DiscountUsesCoupons { get; set; } - - [InverseProperty("CouponCodeDiscount")] - public virtual ICollection ComCouponCodes { get; set; } = new List(); - - [ForeignKey("DiscountSiteId")] - [InverseProperty("ComDiscounts")] - public virtual CmsSite DiscountSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Discount")] +[Index("DiscountSiteId", Name = "IX_COM_Discount_DiscountSiteID")] +public class ComDiscount +{ + [Key] + [Column("DiscountID")] + public int DiscountId { get; set; } + + [StringLength(200)] + public string DiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string DiscountName { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal DiscountValue { get; set; } + + [Required] + public bool? DiscountEnabled { get; set; } + + [Column("DiscountGUID")] + public Guid DiscountGuid { get; set; } + + public DateTime DiscountLastModified { get; set; } + + [Column("DiscountSiteID")] + public int DiscountSiteId { get; set; } + + public string? DiscountDescription { get; set; } + + public DateTime? DiscountValidFrom { get; set; } + + public DateTime? DiscountValidTo { get; set; } + + public double DiscountOrder { get; set; } + + public string? DiscountProductCondition { get; set; } + + [StringLength(400)] + public string? DiscountRoles { get; set; } + + [StringLength(200)] + public string? DiscountCustomerRestriction { get; set; } + + public bool DiscountIsFlat { get; set; } + + public string? DiscountCartCondition { get; set; } + + [StringLength(100)] + public string DiscountApplyTo { get; set; } = null!; + + [Required] + public bool? DiscountApplyFurtherDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? DiscountOrderAmount { get; set; } + + public bool DiscountUsesCoupons { get; set; } + + [InverseProperty("CouponCodeDiscount")] + public virtual ICollection ComCouponCodes { get; set; } = new List(); + + [ForeignKey("DiscountSiteId")] + [InverseProperty("ComDiscounts")] + public virtual CmsSite DiscountSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComExchangeTable.cs b/Migration.Toolkit.KX13/Models/ComExchangeTable.cs index 5c3505d4..5e0f314b 100644 --- a/Migration.Toolkit.KX13/Models/ComExchangeTable.cs +++ b/Migration.Toolkit.KX13/Models/ComExchangeTable.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ExchangeTable")] -[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] -public partial class ComExchangeTable -{ - [Key] - [Column("ExchangeTableID")] - public int ExchangeTableId { get; set; } - - [StringLength(200)] - public string ExchangeTableDisplayName { get; set; } = null!; - - public DateTime? ExchangeTableValidFrom { get; set; } - - public DateTime? ExchangeTableValidTo { get; set; } - - [Column("ExchangeTableGUID")] - public Guid ExchangeTableGuid { get; set; } - - public DateTime ExchangeTableLastModified { get; set; } - - [Column("ExchangeTableSiteID")] - public int? ExchangeTableSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } - - [InverseProperty("ExchangeTable")] - public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); - - [ForeignKey("ExchangeTableSiteId")] - [InverseProperty("ComExchangeTables")] - public virtual CmsSite? ExchangeTableSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_ExchangeTable")] +[Index("ExchangeTableSiteId", Name = "IX_COM_ExchangeTable_ExchangeTableSiteID")] +public class ComExchangeTable +{ + [Key] + [Column("ExchangeTableID")] + public int ExchangeTableId { get; set; } + + [StringLength(200)] + public string ExchangeTableDisplayName { get; set; } = null!; + + public DateTime? ExchangeTableValidFrom { get; set; } + + public DateTime? ExchangeTableValidTo { get; set; } + + [Column("ExchangeTableGUID")] + public Guid ExchangeTableGuid { get; set; } + + public DateTime ExchangeTableLastModified { get; set; } + + [Column("ExchangeTableSiteID")] + public int? ExchangeTableSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? ExchangeTableRateFromGlobalCurrency { get; set; } + + [InverseProperty("ExchangeTable")] + public virtual ICollection ComCurrencyExchangeRates { get; set; } = new List(); + + [ForeignKey("ExchangeTableSiteId")] + [InverseProperty("ComExchangeTables")] + public virtual CmsSite? ExchangeTableSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComGiftCard.cs b/Migration.Toolkit.KX13/Models/ComGiftCard.cs index 813f2355..efb4a40e 100644 --- a/Migration.Toolkit.KX13/Models/ComGiftCard.cs +++ b/Migration.Toolkit.KX13/Models/ComGiftCard.cs @@ -1,59 +1,58 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_GiftCard")] -[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] -public partial class ComGiftCard -{ - [Key] - [Column("GiftCardID")] - public int GiftCardId { get; set; } - - public Guid GiftCardGuid { get; set; } - - [StringLength(200)] - public string GiftCardDisplayName { get; set; } = null!; - - [StringLength(200)] - public string GiftCardName { get; set; } = null!; - - public string? GiftCardDescription { get; set; } - - [Required] - public bool? GiftCardEnabled { get; set; } - - public DateTime GiftCardLastModified { get; set; } - - [Column("GiftCardSiteID")] - public int GiftCardSiteId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardValue { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? GiftCardMinimumOrderPrice { get; set; } - - public string? GiftCardCartCondition { get; set; } - - public DateTime? GiftCardValidFrom { get; set; } - - public DateTime? GiftCardValidTo { get; set; } - - [StringLength(200)] - public string? GiftCardCustomerRestriction { get; set; } - - [StringLength(400)] - public string? GiftCardRoles { get; set; } - - [InverseProperty("GiftCardCouponCodeGiftCard")] - public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); - - [ForeignKey("GiftCardSiteId")] - [InverseProperty("ComGiftCards")] - public virtual CmsSite GiftCardSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_GiftCard")] +[Index("GiftCardSiteId", Name = "IX_COM_GiftCard_GiftCardSiteID")] +public class ComGiftCard +{ + [Key] + [Column("GiftCardID")] + public int GiftCardId { get; set; } + + public Guid GiftCardGuid { get; set; } + + [StringLength(200)] + public string GiftCardDisplayName { get; set; } = null!; + + [StringLength(200)] + public string GiftCardName { get; set; } = null!; + + public string? GiftCardDescription { get; set; } + + [Required] + public bool? GiftCardEnabled { get; set; } + + public DateTime GiftCardLastModified { get; set; } + + [Column("GiftCardSiteID")] + public int GiftCardSiteId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardValue { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? GiftCardMinimumOrderPrice { get; set; } + + public string? GiftCardCartCondition { get; set; } + + public DateTime? GiftCardValidFrom { get; set; } + + public DateTime? GiftCardValidTo { get; set; } + + [StringLength(200)] + public string? GiftCardCustomerRestriction { get; set; } + + [StringLength(400)] + public string? GiftCardRoles { get; set; } + + [InverseProperty("GiftCardCouponCodeGiftCard")] + public virtual ICollection ComGiftCardCouponCodes { get; set; } = new List(); + + [ForeignKey("GiftCardSiteId")] + [InverseProperty("ComGiftCards")] + public virtual CmsSite GiftCardSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs b/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs index 072f6c6e..40663c1f 100644 --- a/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs +++ b/Migration.Toolkit.KX13/Models/ComGiftCardCouponCode.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_GiftCardCouponCode")] -[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] -public partial class ComGiftCardCouponCode -{ - [Key] - [Column("GiftCardCouponCodeID")] - public int GiftCardCouponCodeId { get; set; } - - [StringLength(200)] - public string GiftCardCouponCodeCode { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal GiftCardCouponCodeRemainingValue { get; set; } - - [Column("GiftCardCouponCodeGiftCardID")] - public int GiftCardCouponCodeGiftCardId { get; set; } - - public Guid GiftCardCouponCodeGuid { get; set; } - - public DateTime GiftCardCouponCodeLastModified { get; set; } - - [ForeignKey("GiftCardCouponCodeGiftCardId")] - [InverseProperty("ComGiftCardCouponCodes")] - public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_GiftCardCouponCode")] +[Index("GiftCardCouponCodeGiftCardId", Name = "IX_COM_GiftCardCouponCodeGiftCardID")] +public class ComGiftCardCouponCode +{ + [Key] + [Column("GiftCardCouponCodeID")] + public int GiftCardCouponCodeId { get; set; } + + [StringLength(200)] + public string GiftCardCouponCodeCode { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal GiftCardCouponCodeRemainingValue { get; set; } + + [Column("GiftCardCouponCodeGiftCardID")] + public int GiftCardCouponCodeGiftCardId { get; set; } + + public Guid GiftCardCouponCodeGuid { get; set; } + + public DateTime GiftCardCouponCodeLastModified { get; set; } + + [ForeignKey("GiftCardCouponCodeGiftCardId")] + [InverseProperty("ComGiftCardCouponCodes")] + public virtual ComGiftCard GiftCardCouponCodeGiftCard { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComInternalStatus.cs b/Migration.Toolkit.KX13/Models/ComInternalStatus.cs index 39e0da07..9f567fc5 100644 --- a/Migration.Toolkit.KX13/Models/ComInternalStatus.cs +++ b/Migration.Toolkit.KX13/Models/ComInternalStatus.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_InternalStatus")] -[Index("InternalStatusSiteId", "InternalStatusDisplayName", "InternalStatusEnabled", Name = "IX_COM_InternalStatus_InternalStatusSiteID_InternalStatusDisplayName_InternalStatusEnabled")] -public partial class ComInternalStatus -{ - [Key] - [Column("InternalStatusID")] - public int InternalStatusId { get; set; } - - [StringLength(200)] - public string InternalStatusName { get; set; } = null!; - - [StringLength(200)] - public string InternalStatusDisplayName { get; set; } = null!; - - [Required] - public bool? InternalStatusEnabled { get; set; } - - [Column("InternalStatusGUID")] - public Guid InternalStatusGuid { get; set; } - - public DateTime InternalStatusLastModified { get; set; } - - [Column("InternalStatusSiteID")] - public int? InternalStatusSiteId { get; set; } - - [InverseProperty("SkuinternalStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("InternalStatusSiteId")] - [InverseProperty("ComInternalStatuses")] - public virtual CmsSite? InternalStatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_InternalStatus")] +[Index("InternalStatusSiteId", "InternalStatusDisplayName", "InternalStatusEnabled", Name = "IX_COM_InternalStatus_InternalStatusSiteID_InternalStatusDisplayName_InternalStatusEnabled")] +public class ComInternalStatus +{ + [Key] + [Column("InternalStatusID")] + public int InternalStatusId { get; set; } + + [StringLength(200)] + public string InternalStatusName { get; set; } = null!; + + [StringLength(200)] + public string InternalStatusDisplayName { get; set; } = null!; + + [Required] + public bool? InternalStatusEnabled { get; set; } + + [Column("InternalStatusGUID")] + public Guid InternalStatusGuid { get; set; } + + public DateTime InternalStatusLastModified { get; set; } + + [Column("InternalStatusSiteID")] + public int? InternalStatusSiteId { get; set; } + + [InverseProperty("SkuinternalStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("InternalStatusSiteId")] + [InverseProperty("ComInternalStatuses")] + public virtual CmsSite? InternalStatusSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComManufacturer.cs b/Migration.Toolkit.KX13/Models/ComManufacturer.cs index f818c137..543016c2 100644 --- a/Migration.Toolkit.KX13/Models/ComManufacturer.cs +++ b/Migration.Toolkit.KX13/Models/ComManufacturer.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Manufacturer")] -[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] -public partial class ComManufacturer -{ - [Key] - [Column("ManufacturerID")] - public int ManufacturerId { get; set; } - - [StringLength(200)] - public string ManufacturerDisplayName { get; set; } = null!; - - [StringLength(400)] - public string? ManufactureHomepage { get; set; } - - [Required] - public bool? ManufacturerEnabled { get; set; } - - [Column("ManufacturerGUID")] - public Guid ManufacturerGuid { get; set; } - - public DateTime ManufacturerLastModified { get; set; } - - [Column("ManufacturerSiteID")] - public int? ManufacturerSiteId { get; set; } - - [Column("ManufacturerThumbnailGUID")] - public Guid? ManufacturerThumbnailGuid { get; set; } - - public string? ManufacturerDescription { get; set; } - - [StringLength(200)] - public string? ManufacturerName { get; set; } - - [InverseProperty("Skumanufacturer")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("ManufacturerSiteId")] - [InverseProperty("ComManufacturers")] - public virtual CmsSite? ManufacturerSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Manufacturer")] +[Index("ManufacturerSiteId", Name = "IX_COM_Manufacturer_ManufacturerSiteID")] +public class ComManufacturer +{ + [Key] + [Column("ManufacturerID")] + public int ManufacturerId { get; set; } + + [StringLength(200)] + public string ManufacturerDisplayName { get; set; } = null!; + + [StringLength(400)] + public string? ManufactureHomepage { get; set; } + + [Required] + public bool? ManufacturerEnabled { get; set; } + + [Column("ManufacturerGUID")] + public Guid ManufacturerGuid { get; set; } + + public DateTime ManufacturerLastModified { get; set; } + + [Column("ManufacturerSiteID")] + public int? ManufacturerSiteId { get; set; } + + [Column("ManufacturerThumbnailGUID")] + public Guid? ManufacturerThumbnailGuid { get; set; } + + public string? ManufacturerDescription { get; set; } + + [StringLength(200)] + public string? ManufacturerName { get; set; } + + [InverseProperty("Skumanufacturer")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("ManufacturerSiteId")] + [InverseProperty("ComManufacturers")] + public virtual CmsSite? ManufacturerSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs index ceddbce9..31d5af00 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyCouponCode.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_MultiBuyCouponCode")] -[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] -public partial class ComMultiBuyCouponCode -{ - [Key] - [Column("MultiBuyCouponCodeID")] - public int MultiBuyCouponCodeId { get; set; } - - [StringLength(200)] - public string MultiBuyCouponCodeCode { get; set; } = null!; - - public int? MultiBuyCouponCodeUseLimit { get; set; } - - public int? MultiBuyCouponCodeUseCount { get; set; } - - [Column("MultiBuyCouponCodeMultiBuyDiscountID")] - public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } - - public DateTime MultiBuyCouponCodeLastModified { get; set; } - - [Column("MultiBuyCouponCodeGUID")] - public Guid MultiBuyCouponCodeGuid { get; set; } - - [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] - [InverseProperty("ComMultiBuyCouponCodes")] - public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_MultiBuyCouponCode")] +[Index("MultiBuyCouponCodeMultiBuyDiscountId", Name = "IX_COM_MultiBuyCouponCode_MultiBuyCouponCodeMultiBuyDiscountID")] +public class ComMultiBuyCouponCode +{ + [Key] + [Column("MultiBuyCouponCodeID")] + public int MultiBuyCouponCodeId { get; set; } + + [StringLength(200)] + public string MultiBuyCouponCodeCode { get; set; } = null!; + + public int? MultiBuyCouponCodeUseLimit { get; set; } + + public int? MultiBuyCouponCodeUseCount { get; set; } + + [Column("MultiBuyCouponCodeMultiBuyDiscountID")] + public int MultiBuyCouponCodeMultiBuyDiscountId { get; set; } + + public DateTime MultiBuyCouponCodeLastModified { get; set; } + + [Column("MultiBuyCouponCodeGUID")] + public Guid MultiBuyCouponCodeGuid { get; set; } + + [ForeignKey("MultiBuyCouponCodeMultiBuyDiscountId")] + [InverseProperty("ComMultiBuyCouponCodes")] + public virtual ComMultiBuyDiscount MultiBuyCouponCodeMultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs index 70ac439a..93570e44 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscount.cs @@ -1,98 +1,97 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_MultiBuyDiscount")] -[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] -[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] -public partial class ComMultiBuyDiscount -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string MultiBuyDiscountName { get; set; } = null!; - - public string? MultiBuyDiscountDescription { get; set; } - - [Required] - public bool? MultiBuyDiscountEnabled { get; set; } - - [Column("MultiBuyDiscountGUID")] - public Guid MultiBuyDiscountGuid { get; set; } - - public DateTime MultiBuyDiscountLastModified { get; set; } - - [Column("MultiBuyDiscountSiteID")] - public int MultiBuyDiscountSiteId { get; set; } - - [Required] - public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } - - public int MultiBuyDiscountMinimumBuyCount { get; set; } - - public DateTime? MultiBuyDiscountValidFrom { get; set; } - - public DateTime? MultiBuyDiscountValidTo { get; set; } - - [StringLength(200)] - public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; - - [StringLength(400)] - public string? MultiBuyDiscountRoles { get; set; } - - [Column("MultiBuyDiscountApplyToSKUID")] - public int? MultiBuyDiscountApplyToSkuid { get; set; } - - public int? MultiBuyDiscountLimitPerOrder { get; set; } - - public bool? MultiBuyDiscountUsesCoupons { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? MultiBuyDiscountValue { get; set; } - - public bool? MultiBuyDiscountIsFlat { get; set; } - - [Required] - public bool? MultiBuyDiscountAutoAddEnabled { get; set; } - - public int? MultiBuyDiscountPriority { get; set; } - - public bool MultiBuyDiscountIsProductCoupon { get; set; } - - [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] - public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); - - [InverseProperty("MultibuyDiscount")] - public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscount")] - public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountApplyToSkuid")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } - - [ForeignKey("MultiBuyDiscountSiteId")] - [InverseProperty("ComMultiBuyDiscounts")] - public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Departments { get; set; } = new List(); - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("MultiBuyDiscounts")] - public virtual ICollection Skus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_MultiBuyDiscount")] +[Index("MultiBuyDiscountApplyToSkuid", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountApplyToSKUID")] +[Index("MultiBuyDiscountSiteId", Name = "IX_COM_MultiBuyDiscount_MultiBuyDiscountSiteID")] +public class ComMultiBuyDiscount +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string MultiBuyDiscountName { get; set; } = null!; + + public string? MultiBuyDiscountDescription { get; set; } + + [Required] + public bool? MultiBuyDiscountEnabled { get; set; } + + [Column("MultiBuyDiscountGUID")] + public Guid MultiBuyDiscountGuid { get; set; } + + public DateTime MultiBuyDiscountLastModified { get; set; } + + [Column("MultiBuyDiscountSiteID")] + public int MultiBuyDiscountSiteId { get; set; } + + [Required] + public bool? MultiBuyDiscountApplyFurtherDiscounts { get; set; } + + public int MultiBuyDiscountMinimumBuyCount { get; set; } + + public DateTime? MultiBuyDiscountValidFrom { get; set; } + + public DateTime? MultiBuyDiscountValidTo { get; set; } + + [StringLength(200)] + public string MultiBuyDiscountCustomerRestriction { get; set; } = null!; + + [StringLength(400)] + public string? MultiBuyDiscountRoles { get; set; } + + [Column("MultiBuyDiscountApplyToSKUID")] + public int? MultiBuyDiscountApplyToSkuid { get; set; } + + public int? MultiBuyDiscountLimitPerOrder { get; set; } + + public bool? MultiBuyDiscountUsesCoupons { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? MultiBuyDiscountValue { get; set; } + + public bool? MultiBuyDiscountIsFlat { get; set; } + + [Required] + public bool? MultiBuyDiscountAutoAddEnabled { get; set; } + + public int? MultiBuyDiscountPriority { get; set; } + + public bool MultiBuyDiscountIsProductCoupon { get; set; } + + [InverseProperty("MultiBuyCouponCodeMultiBuyDiscount")] + public virtual ICollection ComMultiBuyCouponCodes { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountBrands { get; set; } = new List(); + + [InverseProperty("MultibuyDiscount")] + public virtual ICollection ComMultiBuyDiscountCollections { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscount")] + public virtual ICollection ComMultiBuyDiscountTrees { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountApplyToSkuid")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual ComSku? MultiBuyDiscountApplyToSku { get; set; } + + [ForeignKey("MultiBuyDiscountSiteId")] + [InverseProperty("ComMultiBuyDiscounts")] + public virtual CmsSite MultiBuyDiscountSite { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Departments { get; set; } = new List(); + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("MultiBuyDiscounts")] + public virtual ICollection Skus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs index 0eadc2f0..2914ac66 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountBrand.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("MultiBuyDiscountId", "BrandId")] -[Table("COM_MultiBuyDiscountBrand")] -[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] -public partial class ComMultiBuyDiscountBrand -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("BrandID")] - public int BrandId { get; set; } - - [Required] - public bool? BrandIncluded { get; set; } - - [ForeignKey("BrandId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComBrand Brand { get; set; } = null!; - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountBrands")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("MultiBuyDiscountId", "BrandId")] +[Table("COM_MultiBuyDiscountBrand")] +[Index("BrandId", Name = "IX_COM_MultiBuyDiscountBrand_BrandID")] +public class ComMultiBuyDiscountBrand +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("BrandID")] + public int BrandId { get; set; } + + [Required] + public bool? BrandIncluded { get; set; } + + [ForeignKey("BrandId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComBrand Brand { get; set; } = null!; + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountBrands")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs index bdb7897a..0519743c 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountCollection.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("MultibuyDiscountId", "CollectionId")] -[Table("COM_MultiBuyDiscountCollection")] -[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] -public partial class ComMultiBuyDiscountCollection -{ - [Key] - [Column("MultibuyDiscountID")] - public int MultibuyDiscountId { get; set; } - - [Key] - [Column("CollectionID")] - public int CollectionId { get; set; } - - [Required] - public bool? CollectionIncluded { get; set; } - - [ForeignKey("CollectionId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComCollection Collection { get; set; } = null!; - - [ForeignKey("MultibuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountCollections")] - public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("MultibuyDiscountId", "CollectionId")] +[Table("COM_MultiBuyDiscountCollection")] +[Index("CollectionId", Name = "IX_COM_MultiBuyDiscountCollection_CollectionID")] +public class ComMultiBuyDiscountCollection +{ + [Key] + [Column("MultibuyDiscountID")] + public int MultibuyDiscountId { get; set; } + + [Key] + [Column("CollectionID")] + public int CollectionId { get; set; } + + [Required] + public bool? CollectionIncluded { get; set; } + + [ForeignKey("CollectionId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComCollection Collection { get; set; } = null!; + + [ForeignKey("MultibuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountCollections")] + public virtual ComMultiBuyDiscount MultibuyDiscount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs index a5dd8998..e4a5af62 100644 --- a/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs +++ b/Migration.Toolkit.KX13/Models/ComMultiBuyDiscountTree.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("MultiBuyDiscountId", "NodeId")] -[Table("COM_MultiBuyDiscountTree")] -[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] -public partial class ComMultiBuyDiscountTree -{ - [Key] - [Column("MultiBuyDiscountID")] - public int MultiBuyDiscountId { get; set; } - - [Key] - [Column("NodeID")] - public int NodeId { get; set; } - - [Required] - public bool? NodeIncluded { get; set; } - - [ForeignKey("MultiBuyDiscountId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; - - [ForeignKey("NodeId")] - [InverseProperty("ComMultiBuyDiscountTrees")] - public virtual CmsTree Node { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("MultiBuyDiscountId", "NodeId")] +[Table("COM_MultiBuyDiscountTree")] +[Index("NodeId", Name = "IX_COM_MultiBuyDiscountTree_NodeID")] +public class ComMultiBuyDiscountTree +{ + [Key] + [Column("MultiBuyDiscountID")] + public int MultiBuyDiscountId { get; set; } + + [Key] + [Column("NodeID")] + public int NodeId { get; set; } + + [Required] + public bool? NodeIncluded { get; set; } + + [ForeignKey("MultiBuyDiscountId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual ComMultiBuyDiscount MultiBuyDiscount { get; set; } = null!; + + [ForeignKey("NodeId")] + [InverseProperty("ComMultiBuyDiscountTrees")] + public virtual CmsTree Node { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComOptionCategory.cs b/Migration.Toolkit.KX13/Models/ComOptionCategory.cs index 94d4d15c..fd3f3e94 100644 --- a/Migration.Toolkit.KX13/Models/ComOptionCategory.cs +++ b/Migration.Toolkit.KX13/Models/ComOptionCategory.cs @@ -1,66 +1,65 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OptionCategory")] -[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] -public partial class ComOptionCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - [Required] - public bool? CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } - - [ForeignKey("CategorySiteId")] - [InverseProperty("ComOptionCategories")] - public virtual CmsSite? CategorySite { get; set; } - - [InverseProperty("Category")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("SkuoptionCategory")] - public virtual ICollection ComSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_OptionCategory")] +[Index("CategorySiteId", Name = "IX_COM_OptionCategory_CategorySiteID")] +public class ComOptionCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + [Required] + public bool? CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } + + [ForeignKey("CategorySiteId")] + [InverseProperty("ComOptionCategories")] + public virtual CmsSite? CategorySite { get; set; } + + [InverseProperty("Category")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("SkuoptionCategory")] + public virtual ICollection ComSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ComOrder.cs b/Migration.Toolkit.KX13/Models/ComOrder.cs index 1e5e0d80..0a8a4f88 100644 --- a/Migration.Toolkit.KX13/Models/ComOrder.cs +++ b/Migration.Toolkit.KX13/Models/ComOrder.cs @@ -1,132 +1,131 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Order")] -[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] -[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] -[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] -[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] -[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] -[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] -[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] -public partial class ComOrder -{ - [Key] - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("OrderShippingOptionID")] - public int? OrderShippingOptionId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalShipping { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalPrice { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderTotalTax { get; set; } - - public DateTime OrderDate { get; set; } - - [Column("OrderStatusID")] - public int? OrderStatusId { get; set; } - - [Column("OrderCurrencyID")] - public int? OrderCurrencyId { get; set; } - - [Column("OrderCustomerID")] - public int OrderCustomerId { get; set; } - - [Column("OrderCreatedByUserID")] - public int? OrderCreatedByUserId { get; set; } - - public string? OrderNote { get; set; } - - [Column("OrderSiteID")] - public int OrderSiteId { get; set; } - - [Column("OrderPaymentOptionID")] - public int? OrderPaymentOptionId { get; set; } - - public string? OrderInvoice { get; set; } - - [StringLength(200)] - public string? OrderInvoiceNumber { get; set; } - - [StringLength(100)] - public string? OrderTrackingNumber { get; set; } - - public string? OrderCustomData { get; set; } - - public string? OrderPaymentResult { get; set; } - - [Column("OrderGUID")] - public Guid OrderGuid { get; set; } - - public DateTime OrderLastModified { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderTotalPriceInMainCurrency { get; set; } - - public bool? OrderIsPaid { get; set; } - - [StringLength(50)] - public string? OrderCulture { get; set; } - - public string? OrderDiscounts { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderGrandTotal { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderGrandTotalInMainCurrency { get; set; } - - public string? OrderOtherPayments { get; set; } - - public string? OrderTaxSummary { get; set; } - - public string? OrderCouponCodes { get; set; } - - [InverseProperty("AddressOrder")] - public virtual ICollection ComOrderAddresses { get; set; } = new List(); - - [InverseProperty("OrderItemOrder")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Order")] - public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); - - [ForeignKey("OrderCreatedByUserId")] - [InverseProperty("ComOrders")] - public virtual CmsUser? OrderCreatedByUser { get; set; } - - [ForeignKey("OrderCurrencyId")] - [InverseProperty("ComOrders")] - public virtual ComCurrency? OrderCurrency { get; set; } - - [ForeignKey("OrderCustomerId")] - [InverseProperty("ComOrders")] - public virtual ComCustomer OrderCustomer { get; set; } = null!; - - [ForeignKey("OrderPaymentOptionId")] - [InverseProperty("ComOrders")] - public virtual ComPaymentOption? OrderPaymentOption { get; set; } - - [ForeignKey("OrderShippingOptionId")] - [InverseProperty("ComOrders")] - public virtual ComShippingOption? OrderShippingOption { get; set; } - - [ForeignKey("OrderSiteId")] - [InverseProperty("ComOrders")] - public virtual CmsSite OrderSite { get; set; } = null!; - - [ForeignKey("OrderStatusId")] - [InverseProperty("ComOrders")] - public virtual ComOrderStatus? OrderStatus { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Order")] +[Index("OrderCreatedByUserId", Name = "IX_COM_Order_OrderCreatedByUserID")] +[Index("OrderCurrencyId", Name = "IX_COM_Order_OrderCurrencyID")] +[Index("OrderCustomerId", Name = "IX_COM_Order_OrderCustomerID")] +[Index("OrderPaymentOptionId", Name = "IX_COM_Order_OrderPaymentOptionID")] +[Index("OrderShippingOptionId", Name = "IX_COM_Order_OrderShippingOptionID")] +[Index("OrderSiteId", "OrderDate", Name = "IX_COM_Order_OrderSiteID_OrderDate", IsDescending = new[] { false, true })] +[Index("OrderStatusId", Name = "IX_COM_Order_OrderStatusID")] +public class ComOrder +{ + [Key] + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("OrderShippingOptionID")] + public int? OrderShippingOptionId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalShipping { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalPrice { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderTotalTax { get; set; } + + public DateTime OrderDate { get; set; } + + [Column("OrderStatusID")] + public int? OrderStatusId { get; set; } + + [Column("OrderCurrencyID")] + public int? OrderCurrencyId { get; set; } + + [Column("OrderCustomerID")] + public int OrderCustomerId { get; set; } + + [Column("OrderCreatedByUserID")] + public int? OrderCreatedByUserId { get; set; } + + public string? OrderNote { get; set; } + + [Column("OrderSiteID")] + public int OrderSiteId { get; set; } + + [Column("OrderPaymentOptionID")] + public int? OrderPaymentOptionId { get; set; } + + public string? OrderInvoice { get; set; } + + [StringLength(200)] + public string? OrderInvoiceNumber { get; set; } + + [StringLength(100)] + public string? OrderTrackingNumber { get; set; } + + public string? OrderCustomData { get; set; } + + public string? OrderPaymentResult { get; set; } + + [Column("OrderGUID")] + public Guid OrderGuid { get; set; } + + public DateTime OrderLastModified { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderTotalPriceInMainCurrency { get; set; } + + public bool? OrderIsPaid { get; set; } + + [StringLength(50)] + public string? OrderCulture { get; set; } + + public string? OrderDiscounts { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderGrandTotal { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderGrandTotalInMainCurrency { get; set; } + + public string? OrderOtherPayments { get; set; } + + public string? OrderTaxSummary { get; set; } + + public string? OrderCouponCodes { get; set; } + + [InverseProperty("AddressOrder")] + public virtual ICollection ComOrderAddresses { get; set; } = new List(); + + [InverseProperty("OrderItemOrder")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Order")] + public virtual ICollection ComOrderStatusUsers { get; set; } = new List(); + + [ForeignKey("OrderCreatedByUserId")] + [InverseProperty("ComOrders")] + public virtual CmsUser? OrderCreatedByUser { get; set; } + + [ForeignKey("OrderCurrencyId")] + [InverseProperty("ComOrders")] + public virtual ComCurrency? OrderCurrency { get; set; } + + [ForeignKey("OrderCustomerId")] + [InverseProperty("ComOrders")] + public virtual ComCustomer OrderCustomer { get; set; } = null!; + + [ForeignKey("OrderPaymentOptionId")] + [InverseProperty("ComOrders")] + public virtual ComPaymentOption? OrderPaymentOption { get; set; } + + [ForeignKey("OrderShippingOptionId")] + [InverseProperty("ComOrders")] + public virtual ComShippingOption? OrderShippingOption { get; set; } + + [ForeignKey("OrderSiteId")] + [InverseProperty("ComOrders")] + public virtual CmsSite OrderSite { get; set; } = null!; + + [ForeignKey("OrderStatusId")] + [InverseProperty("ComOrders")] + public virtual ComOrderStatus? OrderStatus { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComOrderAddress.cs b/Migration.Toolkit.KX13/Models/ComOrderAddress.cs index db20c946..3de60688 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderAddress.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderAddress.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderAddress")] -[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] -[Index("AddressOrderId", "AddressType", Name = "IX_COM_OrderAddress_AddressOrderID_AddressType", IsUnique = true)] -[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] -public partial class ComOrderAddress -{ - [Key] - [Column("AddressID")] - public int AddressId { get; set; } - - [StringLength(100)] - public string AddressLine1 { get; set; } = null!; - - [StringLength(100)] - public string? AddressLine2 { get; set; } - - [StringLength(100)] - public string AddressCity { get; set; } = null!; - - [StringLength(20)] - public string AddressZip { get; set; } = null!; - - [StringLength(26)] - public string? AddressPhone { get; set; } - - [Column("AddressCountryID")] - public int AddressCountryId { get; set; } - - [Column("AddressStateID")] - public int? AddressStateId { get; set; } - - [StringLength(200)] - public string AddressPersonalName { get; set; } = null!; - - [Column("AddressGUID")] - public Guid? AddressGuid { get; set; } - - public DateTime AddressLastModified { get; set; } - - [Column("AddressOrderID")] - public int AddressOrderId { get; set; } - - public int AddressType { get; set; } - - [ForeignKey("AddressCountryId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsCountry AddressCountry { get; set; } = null!; - - [ForeignKey("AddressOrderId")] - [InverseProperty("ComOrderAddresses")] - public virtual ComOrder AddressOrder { get; set; } = null!; - - [ForeignKey("AddressStateId")] - [InverseProperty("ComOrderAddresses")] - public virtual CmsState? AddressState { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_OrderAddress")] +[Index("AddressCountryId", Name = "IX_COM_OrderAddress_AddressCountryID")] +[Index("AddressOrderId", "AddressType", Name = "IX_COM_OrderAddress_AddressOrderID_AddressType", IsUnique = true)] +[Index("AddressStateId", Name = "IX_COM_OrderAddress_AddressStateID")] +public class ComOrderAddress +{ + [Key] + [Column("AddressID")] + public int AddressId { get; set; } + + [StringLength(100)] + public string AddressLine1 { get; set; } = null!; + + [StringLength(100)] + public string? AddressLine2 { get; set; } + + [StringLength(100)] + public string AddressCity { get; set; } = null!; + + [StringLength(20)] + public string AddressZip { get; set; } = null!; + + [StringLength(26)] + public string? AddressPhone { get; set; } + + [Column("AddressCountryID")] + public int AddressCountryId { get; set; } + + [Column("AddressStateID")] + public int? AddressStateId { get; set; } + + [StringLength(200)] + public string AddressPersonalName { get; set; } = null!; + + [Column("AddressGUID")] + public Guid? AddressGuid { get; set; } + + public DateTime AddressLastModified { get; set; } + + [Column("AddressOrderID")] + public int AddressOrderId { get; set; } + + public int AddressType { get; set; } + + [ForeignKey("AddressCountryId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsCountry AddressCountry { get; set; } = null!; + + [ForeignKey("AddressOrderId")] + [InverseProperty("ComOrderAddresses")] + public virtual ComOrder AddressOrder { get; set; } = null!; + + [ForeignKey("AddressStateId")] + [InverseProperty("ComOrderAddresses")] + public virtual CmsState? AddressState { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComOrderItem.cs b/Migration.Toolkit.KX13/Models/ComOrderItem.cs index 23e02794..c9be49bc 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderItem.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderItem.cs @@ -1,70 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderItem")] -[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] -[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] -public partial class ComOrderItem -{ - [Key] - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("OrderItemOrderID")] - public int OrderItemOrderId { get; set; } - - [Column("OrderItemSKUID")] - public int OrderItemSkuid { get; set; } - - [Column("OrderItemSKUName")] - [StringLength(450)] - public string OrderItemSkuname { get; set; } = null!; - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemUnitPrice { get; set; } - - public int OrderItemUnitCount { get; set; } - - public string? OrderItemCustomData { get; set; } - - public Guid OrderItemGuid { get; set; } - - public Guid? OrderItemParentGuid { get; set; } - - public DateTime OrderItemLastModified { get; set; } - - public DateTime? OrderItemValidTo { get; set; } - - [Column("OrderItemBundleGUID")] - public Guid? OrderItemBundleGuid { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal? OrderItemTotalPriceInMainCurrency { get; set; } - - public bool? OrderItemSendNotification { get; set; } - - public string? OrderItemText { get; set; } - - public string? OrderItemProductDiscounts { get; set; } - - public string? OrderItemDiscountSummary { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal OrderItemTotalPrice { get; set; } - - [InverseProperty("OrderItem")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("OrderItemOrderId")] - [InverseProperty("ComOrderItems")] - public virtual ComOrder OrderItemOrder { get; set; } = null!; - - [ForeignKey("OrderItemSkuid")] - [InverseProperty("ComOrderItems")] - public virtual ComSku OrderItemSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_OrderItem")] +[Index("OrderItemOrderId", Name = "IX_COM_OrderItem_OrderItemOrderID")] +[Index("OrderItemSkuid", Name = "IX_COM_OrderItem_OrderItemSKUID")] +public class ComOrderItem +{ + [Key] + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("OrderItemOrderID")] + public int OrderItemOrderId { get; set; } + + [Column("OrderItemSKUID")] + public int OrderItemSkuid { get; set; } + + [Column("OrderItemSKUName")] + [StringLength(450)] + public string OrderItemSkuname { get; set; } = null!; + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemUnitPrice { get; set; } + + public int OrderItemUnitCount { get; set; } + + public string? OrderItemCustomData { get; set; } + + public Guid OrderItemGuid { get; set; } + + public Guid? OrderItemParentGuid { get; set; } + + public DateTime OrderItemLastModified { get; set; } + + public DateTime? OrderItemValidTo { get; set; } + + [Column("OrderItemBundleGUID")] + public Guid? OrderItemBundleGuid { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal? OrderItemTotalPriceInMainCurrency { get; set; } + + public bool? OrderItemSendNotification { get; set; } + + public string? OrderItemText { get; set; } + + public string? OrderItemProductDiscounts { get; set; } + + public string? OrderItemDiscountSummary { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal OrderItemTotalPrice { get; set; } + + [InverseProperty("OrderItem")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("OrderItemOrderId")] + [InverseProperty("ComOrderItems")] + public virtual ComOrder OrderItemOrder { get; set; } = null!; + + [ForeignKey("OrderItemSkuid")] + [InverseProperty("ComOrderItems")] + public virtual ComSku OrderItemSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs b/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs index e724c1fa..0dfec3eb 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderItemSkufile.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderItemSKUFile")] -[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] -[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] -public partial class ComOrderItemSkufile -{ - [Key] - [Column("OrderItemSKUFileID")] - public int OrderItemSkufileId { get; set; } - - public Guid Token { get; set; } - - [Column("OrderItemID")] - public int OrderItemId { get; set; } - - [Column("FileID")] - public int FileId { get; set; } - - [ForeignKey("FileId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComSkufile File { get; set; } = null!; - - [ForeignKey("OrderItemId")] - [InverseProperty("ComOrderItemSkufiles")] - public virtual ComOrderItem OrderItem { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_OrderItemSKUFile")] +[Index("FileId", Name = "IX_COM_OrderItemSKUFile_FileID")] +[Index("OrderItemId", Name = "IX_COM_OrderItemSKUFile_OrderItemID")] +public class ComOrderItemSkufile +{ + [Key] + [Column("OrderItemSKUFileID")] + public int OrderItemSkufileId { get; set; } + + public Guid Token { get; set; } + + [Column("OrderItemID")] + public int OrderItemId { get; set; } + + [Column("FileID")] + public int FileId { get; set; } + + [ForeignKey("FileId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComSkufile File { get; set; } = null!; + + [ForeignKey("OrderItemId")] + [InverseProperty("ComOrderItemSkufiles")] + public virtual ComOrderItem OrderItem { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComOrderStatus.cs b/Migration.Toolkit.KX13/Models/ComOrderStatus.cs index b93a2c77..a23e3412 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderStatus.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderStatus.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderStatus")] -[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] -public partial class ComOrderStatus -{ - [Key] - [Column("StatusID")] - public int StatusId { get; set; } - - [StringLength(200)] - public string StatusName { get; set; } = null!; - - [StringLength(200)] - public string StatusDisplayName { get; set; } = null!; - - public int? StatusOrder { get; set; } - - [Required] - public bool? StatusEnabled { get; set; } - - [StringLength(7)] - public string? StatusColor { get; set; } - - [Column("StatusGUID")] - public Guid StatusGuid { get; set; } - - public DateTime StatusLastModified { get; set; } - - public bool? StatusSendNotification { get; set; } - - [Column("StatusSiteID")] - public int? StatusSiteId { get; set; } - - public bool? StatusOrderIsPaid { get; set; } - - [InverseProperty("FromStatus")] - public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); - - [InverseProperty("ToStatus")] - public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); - - [InverseProperty("OrderStatus")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("PaymentOptionAuthorizedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionFailedOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); - - [InverseProperty("PaymentOptionSucceededOrderStatus")] - public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); - - [ForeignKey("StatusSiteId")] - [InverseProperty("ComOrderStatuses")] - public virtual CmsSite? StatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_OrderStatus")] +[Index("StatusSiteId", "StatusOrder", Name = "IX_COM_OrderStatus_StatusSiteID_StatusOrder")] +public class ComOrderStatus +{ + [Key] + [Column("StatusID")] + public int StatusId { get; set; } + + [StringLength(200)] + public string StatusName { get; set; } = null!; + + [StringLength(200)] + public string StatusDisplayName { get; set; } = null!; + + public int? StatusOrder { get; set; } + + [Required] + public bool? StatusEnabled { get; set; } + + [StringLength(7)] + public string? StatusColor { get; set; } + + [Column("StatusGUID")] + public Guid StatusGuid { get; set; } + + public DateTime StatusLastModified { get; set; } + + public bool? StatusSendNotification { get; set; } + + [Column("StatusSiteID")] + public int? StatusSiteId { get; set; } + + public bool? StatusOrderIsPaid { get; set; } + + [InverseProperty("FromStatus")] + public virtual ICollection ComOrderStatusUserFromStatuses { get; set; } = new List(); + + [InverseProperty("ToStatus")] + public virtual ICollection ComOrderStatusUserToStatuses { get; set; } = new List(); + + [InverseProperty("OrderStatus")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("PaymentOptionAuthorizedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionAuthorizedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionFailedOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionFailedOrderStatuses { get; set; } = new List(); + + [InverseProperty("PaymentOptionSucceededOrderStatus")] + public virtual ICollection ComPaymentOptionPaymentOptionSucceededOrderStatuses { get; set; } = new List(); + + [ForeignKey("StatusSiteId")] + [InverseProperty("ComOrderStatuses")] + public virtual CmsSite? StatusSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs b/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs index 2cab8bd8..64749710 100644 --- a/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs +++ b/Migration.Toolkit.KX13/Models/ComOrderStatusUser.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_OrderStatusUser")] -[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] -[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] -[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] -[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] -public partial class ComOrderStatusUser -{ - [Key] - [Column("OrderStatusUserID")] - public int OrderStatusUserId { get; set; } - - [Column("OrderID")] - public int OrderId { get; set; } - - [Column("FromStatusID")] - public int? FromStatusId { get; set; } - - [Column("ToStatusID")] - public int ToStatusId { get; set; } - - [Column("ChangedByUserID")] - public int? ChangedByUserId { get; set; } - - public DateTime Date { get; set; } - - public string? Note { get; set; } - - [ForeignKey("ChangedByUserId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual CmsUser? ChangedByUser { get; set; } - - [ForeignKey("FromStatusId")] - [InverseProperty("ComOrderStatusUserFromStatuses")] - public virtual ComOrderStatus? FromStatus { get; set; } - - [ForeignKey("OrderId")] - [InverseProperty("ComOrderStatusUsers")] - public virtual ComOrder Order { get; set; } = null!; - - [ForeignKey("ToStatusId")] - [InverseProperty("ComOrderStatusUserToStatuses")] - public virtual ComOrderStatus ToStatus { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_OrderStatusUser")] +[Index("ChangedByUserId", Name = "IX_COM_OrderStatusUser_ChangedByUserID")] +[Index("FromStatusId", Name = "IX_COM_OrderStatusUser_FromStatusID")] +[Index("OrderId", "Date", Name = "IX_COM_OrderStatusUser_OrderID_Date")] +[Index("ToStatusId", Name = "IX_COM_OrderStatusUser_ToStatusID")] +public class ComOrderStatusUser +{ + [Key] + [Column("OrderStatusUserID")] + public int OrderStatusUserId { get; set; } + + [Column("OrderID")] + public int OrderId { get; set; } + + [Column("FromStatusID")] + public int? FromStatusId { get; set; } + + [Column("ToStatusID")] + public int ToStatusId { get; set; } + + [Column("ChangedByUserID")] + public int? ChangedByUserId { get; set; } + + public DateTime Date { get; set; } + + public string? Note { get; set; } + + [ForeignKey("ChangedByUserId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual CmsUser? ChangedByUser { get; set; } + + [ForeignKey("FromStatusId")] + [InverseProperty("ComOrderStatusUserFromStatuses")] + public virtual ComOrderStatus? FromStatus { get; set; } + + [ForeignKey("OrderId")] + [InverseProperty("ComOrderStatusUsers")] + public virtual ComOrder Order { get; set; } = null!; + + [ForeignKey("ToStatusId")] + [InverseProperty("ComOrderStatusUserToStatuses")] + public virtual ComOrderStatus ToStatus { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComPaymentOption.cs b/Migration.Toolkit.KX13/Models/ComPaymentOption.cs index 3dd35229..4c2d03e6 100644 --- a/Migration.Toolkit.KX13/Models/ComPaymentOption.cs +++ b/Migration.Toolkit.KX13/Models/ComPaymentOption.cs @@ -1,83 +1,82 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_PaymentOption")] -[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] -[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] -[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] -[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] -public partial class ComPaymentOption -{ - [Key] - [Column("PaymentOptionID")] - public int PaymentOptionId { get; set; } - - [StringLength(200)] - public string PaymentOptionName { get; set; } = null!; - - [StringLength(200)] - public string PaymentOptionDisplayName { get; set; } = null!; - - [Required] - public bool? PaymentOptionEnabled { get; set; } - - [Column("PaymentOptionSiteID")] - public int? PaymentOptionSiteId { get; set; } - - [StringLength(500)] - public string? PaymentOptionPaymentGateUrl { get; set; } - - [StringLength(200)] - public string? PaymentOptionAssemblyName { get; set; } - - [StringLength(200)] - public string? PaymentOptionClassName { get; set; } - - [Column("PaymentOptionSucceededOrderStatusID")] - public int? PaymentOptionSucceededOrderStatusId { get; set; } - - [Column("PaymentOptionFailedOrderStatusID")] - public int? PaymentOptionFailedOrderStatusId { get; set; } - - [Column("PaymentOptionGUID")] - public Guid PaymentOptionGuid { get; set; } - - public DateTime PaymentOptionLastModified { get; set; } - - public bool? PaymentOptionAllowIfNoShipping { get; set; } - - [Column("PaymentOptionThumbnailGUID")] - public Guid? PaymentOptionThumbnailGuid { get; set; } - - public string? PaymentOptionDescription { get; set; } - - [Column("PaymentOptionAuthorizedOrderStatusID")] - public int? PaymentOptionAuthorizedOrderStatusId { get; set; } - - [InverseProperty("OrderPaymentOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShoppingCartPaymentOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionFailedOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } - - [ForeignKey("PaymentOptionSiteId")] - [InverseProperty("ComPaymentOptions")] - public virtual CmsSite? PaymentOptionSite { get; set; } - - [ForeignKey("PaymentOptionSucceededOrderStatusId")] - [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] - public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_PaymentOption")] +[Index("PaymentOptionAuthorizedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionAuthorizedOrderStatusID")] +[Index("PaymentOptionFailedOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionFailedOrderStatusID")] +[Index("PaymentOptionSiteId", Name = "IX_COM_PaymentOption_PaymentOptionSiteID")] +[Index("PaymentOptionSucceededOrderStatusId", Name = "IX_COM_PaymentOption_PaymentOptionSucceededOrderStatusID")] +public class ComPaymentOption +{ + [Key] + [Column("PaymentOptionID")] + public int PaymentOptionId { get; set; } + + [StringLength(200)] + public string PaymentOptionName { get; set; } = null!; + + [StringLength(200)] + public string PaymentOptionDisplayName { get; set; } = null!; + + [Required] + public bool? PaymentOptionEnabled { get; set; } + + [Column("PaymentOptionSiteID")] + public int? PaymentOptionSiteId { get; set; } + + [StringLength(500)] + public string? PaymentOptionPaymentGateUrl { get; set; } + + [StringLength(200)] + public string? PaymentOptionAssemblyName { get; set; } + + [StringLength(200)] + public string? PaymentOptionClassName { get; set; } + + [Column("PaymentOptionSucceededOrderStatusID")] + public int? PaymentOptionSucceededOrderStatusId { get; set; } + + [Column("PaymentOptionFailedOrderStatusID")] + public int? PaymentOptionFailedOrderStatusId { get; set; } + + [Column("PaymentOptionGUID")] + public Guid PaymentOptionGuid { get; set; } + + public DateTime PaymentOptionLastModified { get; set; } + + public bool? PaymentOptionAllowIfNoShipping { get; set; } + + [Column("PaymentOptionThumbnailGUID")] + public Guid? PaymentOptionThumbnailGuid { get; set; } + + public string? PaymentOptionDescription { get; set; } + + [Column("PaymentOptionAuthorizedOrderStatusID")] + public int? PaymentOptionAuthorizedOrderStatusId { get; set; } + + [InverseProperty("OrderPaymentOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShoppingCartPaymentOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("PaymentOptionAuthorizedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionAuthorizedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionAuthorizedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionFailedOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionFailedOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionFailedOrderStatus { get; set; } + + [ForeignKey("PaymentOptionSiteId")] + [InverseProperty("ComPaymentOptions")] + public virtual CmsSite? PaymentOptionSite { get; set; } + + [ForeignKey("PaymentOptionSucceededOrderStatusId")] + [InverseProperty("ComPaymentOptionPaymentOptionSucceededOrderStatuses")] + public virtual ComOrderStatus? PaymentOptionSucceededOrderStatus { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComPublicStatus.cs b/Migration.Toolkit.KX13/Models/ComPublicStatus.cs index b319c134..699cb5e6 100644 --- a/Migration.Toolkit.KX13/Models/ComPublicStatus.cs +++ b/Migration.Toolkit.KX13/Models/ComPublicStatus.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_PublicStatus")] -[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] -public partial class ComPublicStatus -{ - [Key] - [Column("PublicStatusID")] - public int PublicStatusId { get; set; } - - [StringLength(200)] - public string PublicStatusName { get; set; } = null!; - - [StringLength(200)] - public string PublicStatusDisplayName { get; set; } = null!; - - [Required] - public bool? PublicStatusEnabled { get; set; } - - [Column("PublicStatusGUID")] - public Guid? PublicStatusGuid { get; set; } - - public DateTime PublicStatusLastModified { get; set; } - - [Column("PublicStatusSiteID")] - public int? PublicStatusSiteId { get; set; } - - [InverseProperty("SkupublicStatus")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("PublicStatusSiteId")] - [InverseProperty("ComPublicStatuses")] - public virtual CmsSite? PublicStatusSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_PublicStatus")] +[Index("PublicStatusSiteId", Name = "IX_COM_PublicStatus_PublicStatusSiteID")] +public class ComPublicStatus +{ + [Key] + [Column("PublicStatusID")] + public int PublicStatusId { get; set; } + + [StringLength(200)] + public string PublicStatusName { get; set; } = null!; + + [StringLength(200)] + public string PublicStatusDisplayName { get; set; } = null!; + + [Required] + public bool? PublicStatusEnabled { get; set; } + + [Column("PublicStatusGUID")] + public Guid? PublicStatusGuid { get; set; } + + public DateTime PublicStatusLastModified { get; set; } + + [Column("PublicStatusSiteID")] + public int? PublicStatusSiteId { get; set; } + + [InverseProperty("SkupublicStatus")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("PublicStatusSiteId")] + [InverseProperty("ComPublicStatuses")] + public virtual CmsSite? PublicStatusSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComShippingCost.cs b/Migration.Toolkit.KX13/Models/ComShippingCost.cs index 6a595dd4..e29a7a47 100644 --- a/Migration.Toolkit.KX13/Models/ComShippingCost.cs +++ b/Migration.Toolkit.KX13/Models/ComShippingCost.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShippingCost")] -[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] -public partial class ComShippingCost -{ - [Key] - [Column("ShippingCostID")] - public int ShippingCostId { get; set; } - - [Column("ShippingCostShippingOptionID")] - public int ShippingCostShippingOptionId { get; set; } - - public double ShippingCostMinWeight { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal ShippingCostValue { get; set; } - - [Column("ShippingCostGUID")] - public Guid ShippingCostGuid { get; set; } - - public DateTime ShippingCostLastModified { get; set; } - - [ForeignKey("ShippingCostShippingOptionId")] - [InverseProperty("ComShippingCosts")] - public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_ShippingCost")] +[Index("ShippingCostShippingOptionId", Name = "IX_COM_ShippingCost_ShippingCostShippingOptionID")] +public class ComShippingCost +{ + [Key] + [Column("ShippingCostID")] + public int ShippingCostId { get; set; } + + [Column("ShippingCostShippingOptionID")] + public int ShippingCostShippingOptionId { get; set; } + + public double ShippingCostMinWeight { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal ShippingCostValue { get; set; } + + [Column("ShippingCostGUID")] + public Guid ShippingCostGuid { get; set; } + + public DateTime ShippingCostLastModified { get; set; } + + [ForeignKey("ShippingCostShippingOptionId")] + [InverseProperty("ComShippingCosts")] + public virtual ComShippingOption ShippingCostShippingOption { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComShippingOption.cs b/Migration.Toolkit.KX13/Models/ComShippingOption.cs index 2b79e210..c3e02ba0 100644 --- a/Migration.Toolkit.KX13/Models/ComShippingOption.cs +++ b/Migration.Toolkit.KX13/Models/ComShippingOption.cs @@ -1,70 +1,69 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShippingOption")] -[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] -[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] -[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] -public partial class ComShippingOption -{ - [Key] - [Column("ShippingOptionID")] - public int ShippingOptionId { get; set; } - - [StringLength(200)] - public string ShippingOptionName { get; set; } = null!; - - [StringLength(200)] - public string ShippingOptionDisplayName { get; set; } = null!; - - [Required] - public bool? ShippingOptionEnabled { get; set; } - - [Column("ShippingOptionSiteID")] - public int? ShippingOptionSiteId { get; set; } - - [Column("ShippingOptionGUID")] - public Guid ShippingOptionGuid { get; set; } - - public DateTime ShippingOptionLastModified { get; set; } - - [Column("ShippingOptionThumbnailGUID")] - public Guid? ShippingOptionThumbnailGuid { get; set; } - - public string? ShippingOptionDescription { get; set; } - - [Column("ShippingOptionCarrierID")] - public int? ShippingOptionCarrierId { get; set; } - - [StringLength(200)] - public string? ShippingOptionCarrierServiceName { get; set; } - - [Column("ShippingOptionTaxClassID")] - public int? ShippingOptionTaxClassId { get; set; } - - [InverseProperty("OrderShippingOption")] - public virtual ICollection ComOrders { get; set; } = new List(); - - [InverseProperty("ShippingCostShippingOption")] - public virtual ICollection ComShippingCosts { get; set; } = new List(); - - [InverseProperty("ShoppingCartShippingOption")] - public virtual ICollection ComShoppingCarts { get; set; } = new List(); - - [ForeignKey("ShippingOptionCarrierId")] - [InverseProperty("ComShippingOptions")] - public virtual ComCarrier? ShippingOptionCarrier { get; set; } - - [ForeignKey("ShippingOptionSiteId")] - [InverseProperty("ComShippingOptions")] - public virtual CmsSite? ShippingOptionSite { get; set; } - - [ForeignKey("ShippingOptionTaxClassId")] - [InverseProperty("ComShippingOptions")] - public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_ShippingOption")] +[Index("ShippingOptionCarrierId", Name = "IX_COM_ShippingOption_ShippingOptionCarrierID")] +[Index("ShippingOptionSiteId", Name = "IX_COM_ShippingOption_ShippingOptionSiteID_ShippingOptionDisplayName_ShippingOptionEnabled")] +[Index("ShippingOptionTaxClassId", Name = "IX_COM_ShippingOption_ShippingOptionTaxClassID")] +public class ComShippingOption +{ + [Key] + [Column("ShippingOptionID")] + public int ShippingOptionId { get; set; } + + [StringLength(200)] + public string ShippingOptionName { get; set; } = null!; + + [StringLength(200)] + public string ShippingOptionDisplayName { get; set; } = null!; + + [Required] + public bool? ShippingOptionEnabled { get; set; } + + [Column("ShippingOptionSiteID")] + public int? ShippingOptionSiteId { get; set; } + + [Column("ShippingOptionGUID")] + public Guid ShippingOptionGuid { get; set; } + + public DateTime ShippingOptionLastModified { get; set; } + + [Column("ShippingOptionThumbnailGUID")] + public Guid? ShippingOptionThumbnailGuid { get; set; } + + public string? ShippingOptionDescription { get; set; } + + [Column("ShippingOptionCarrierID")] + public int? ShippingOptionCarrierId { get; set; } + + [StringLength(200)] + public string? ShippingOptionCarrierServiceName { get; set; } + + [Column("ShippingOptionTaxClassID")] + public int? ShippingOptionTaxClassId { get; set; } + + [InverseProperty("OrderShippingOption")] + public virtual ICollection ComOrders { get; set; } = new List(); + + [InverseProperty("ShippingCostShippingOption")] + public virtual ICollection ComShippingCosts { get; set; } = new List(); + + [InverseProperty("ShoppingCartShippingOption")] + public virtual ICollection ComShoppingCarts { get; set; } = new List(); + + [ForeignKey("ShippingOptionCarrierId")] + [InverseProperty("ComShippingOptions")] + public virtual ComCarrier? ShippingOptionCarrier { get; set; } + + [ForeignKey("ShippingOptionSiteId")] + [InverseProperty("ComShippingOptions")] + public virtual CmsSite? ShippingOptionSite { get; set; } + + [ForeignKey("ShippingOptionTaxClassId")] + [InverseProperty("ComShippingOptions")] + public virtual ComTaxClass? ShippingOptionTaxClass { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCart.cs b/Migration.Toolkit.KX13/Models/ComShoppingCart.cs index 4563a1bf..3b4b6761 100644 --- a/Migration.Toolkit.KX13/Models/ComShoppingCart.cs +++ b/Migration.Toolkit.KX13/Models/ComShoppingCart.cs @@ -1,107 +1,106 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShoppingCart")] -[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] -[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] -[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] -[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] -[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] -[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] -[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] -[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] -[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] -[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] -[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] -public partial class ComShoppingCart -{ - [Key] - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("ShoppingCartGUID")] - public Guid ShoppingCartGuid { get; set; } - - [Column("ShoppingCartUserID")] - public int? ShoppingCartUserId { get; set; } - - [Column("ShoppingCartSiteID")] - public int ShoppingCartSiteId { get; set; } - - public DateTime ShoppingCartLastUpdate { get; set; } - - [Column("ShoppingCartCurrencyID")] - public int? ShoppingCartCurrencyId { get; set; } - - [Column("ShoppingCartPaymentOptionID")] - public int? ShoppingCartPaymentOptionId { get; set; } - - [Column("ShoppingCartShippingOptionID")] - public int? ShoppingCartShippingOptionId { get; set; } - - [Column("ShoppingCartBillingAddressID")] - public int? ShoppingCartBillingAddressId { get; set; } - - [Column("ShoppingCartShippingAddressID")] - public int? ShoppingCartShippingAddressId { get; set; } - - [Column("ShoppingCartCustomerID")] - public int? ShoppingCartCustomerId { get; set; } - - public string? ShoppingCartNote { get; set; } - - [Column("ShoppingCartCompanyAddressID")] - public int? ShoppingCartCompanyAddressId { get; set; } - - public string? ShoppingCartCustomData { get; set; } - - [Column("ShoppingCartContactID")] - public int? ShoppingCartContactId { get; set; } - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); - - [InverseProperty("ShoppingCart")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [ForeignKey("ShoppingCartBillingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] - public virtual ComAddress? ShoppingCartBillingAddress { get; set; } - - [ForeignKey("ShoppingCartCompanyAddressId")] - [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] - public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } - - [ForeignKey("ShoppingCartCurrencyId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCurrency? ShoppingCartCurrency { get; set; } - - [ForeignKey("ShoppingCartCustomerId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComCustomer? ShoppingCartCustomer { get; set; } - - [ForeignKey("ShoppingCartPaymentOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } - - [ForeignKey("ShoppingCartShippingAddressId")] - [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] - public virtual ComAddress? ShoppingCartShippingAddress { get; set; } - - [ForeignKey("ShoppingCartShippingOptionId")] - [InverseProperty("ComShoppingCarts")] - public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } - - [ForeignKey("ShoppingCartSiteId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsSite ShoppingCartSite { get; set; } = null!; - - [ForeignKey("ShoppingCartUserId")] - [InverseProperty("ComShoppingCarts")] - public virtual CmsUser? ShoppingCartUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_ShoppingCart")] +[Index("ShoppingCartBillingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartBillingAddressID")] +[Index("ShoppingCartCompanyAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartCompanyAddressID")] +[Index("ShoppingCartCurrencyId", Name = "IX_COM_ShoppingCart_ShoppingCartCurrencyID")] +[Index("ShoppingCartCustomerId", Name = "IX_COM_ShoppingCart_ShoppingCartCustomerID")] +[Index("ShoppingCartLastUpdate", Name = "IX_COM_ShoppingCart_ShoppingCartLastUpdate")] +[Index("ShoppingCartPaymentOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartPaymentOptionID")] +[Index("ShoppingCartShippingAddressId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingAddressID")] +[Index("ShoppingCartShippingOptionId", Name = "IX_COM_ShoppingCart_ShoppingCartShippingOptionID")] +[Index("ShoppingCartSiteId", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID")] +[Index("ShoppingCartGuid", Name = "IX_COM_ShoppingCart_ShoppingCartSiteID_ShoppingCartGUID")] +[Index("ShoppingCartUserId", Name = "IX_COM_ShoppingCart_ShoppingCartUserID")] +public class ComShoppingCart +{ + [Key] + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("ShoppingCartGUID")] + public Guid ShoppingCartGuid { get; set; } + + [Column("ShoppingCartUserID")] + public int? ShoppingCartUserId { get; set; } + + [Column("ShoppingCartSiteID")] + public int ShoppingCartSiteId { get; set; } + + public DateTime ShoppingCartLastUpdate { get; set; } + + [Column("ShoppingCartCurrencyID")] + public int? ShoppingCartCurrencyId { get; set; } + + [Column("ShoppingCartPaymentOptionID")] + public int? ShoppingCartPaymentOptionId { get; set; } + + [Column("ShoppingCartShippingOptionID")] + public int? ShoppingCartShippingOptionId { get; set; } + + [Column("ShoppingCartBillingAddressID")] + public int? ShoppingCartBillingAddressId { get; set; } + + [Column("ShoppingCartShippingAddressID")] + public int? ShoppingCartShippingAddressId { get; set; } + + [Column("ShoppingCartCustomerID")] + public int? ShoppingCartCustomerId { get; set; } + + public string? ShoppingCartNote { get; set; } + + [Column("ShoppingCartCompanyAddressID")] + public int? ShoppingCartCompanyAddressId { get; set; } + + public string? ShoppingCartCustomData { get; set; } + + [Column("ShoppingCartContactID")] + public int? ShoppingCartContactId { get; set; } + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartCouponCodes { get; set; } = new List(); + + [InverseProperty("ShoppingCart")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [ForeignKey("ShoppingCartBillingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartBillingAddresses")] + public virtual ComAddress? ShoppingCartBillingAddress { get; set; } + + [ForeignKey("ShoppingCartCompanyAddressId")] + [InverseProperty("ComShoppingCartShoppingCartCompanyAddresses")] + public virtual ComAddress? ShoppingCartCompanyAddress { get; set; } + + [ForeignKey("ShoppingCartCurrencyId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCurrency? ShoppingCartCurrency { get; set; } + + [ForeignKey("ShoppingCartCustomerId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComCustomer? ShoppingCartCustomer { get; set; } + + [ForeignKey("ShoppingCartPaymentOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComPaymentOption? ShoppingCartPaymentOption { get; set; } + + [ForeignKey("ShoppingCartShippingAddressId")] + [InverseProperty("ComShoppingCartShoppingCartShippingAddresses")] + public virtual ComAddress? ShoppingCartShippingAddress { get; set; } + + [ForeignKey("ShoppingCartShippingOptionId")] + [InverseProperty("ComShoppingCarts")] + public virtual ComShippingOption? ShoppingCartShippingOption { get; set; } + + [ForeignKey("ShoppingCartSiteId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsSite ShoppingCartSite { get; set; } = null!; + + [ForeignKey("ShoppingCartUserId")] + [InverseProperty("ComShoppingCarts")] + public virtual CmsUser? ShoppingCartUser { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs b/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs index 76174dc0..d856c7a3 100644 --- a/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs +++ b/Migration.Toolkit.KX13/Models/ComShoppingCartCouponCode.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShoppingCartCouponCode")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] -public partial class ComShoppingCartCouponCode -{ - [Key] - [Column("ShoppingCartCouponCodeID")] - public int ShoppingCartCouponCodeId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [StringLength(200)] - public string CouponCode { get; set; } = null!; - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartCouponCodes")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_ShoppingCartCouponCode")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartCouponCode_ShoppingCartID")] +public class ComShoppingCartCouponCode +{ + [Key] + [Column("ShoppingCartCouponCodeID")] + public int ShoppingCartCouponCodeId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [StringLength(200)] + public string CouponCode { get; set; } = null!; + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartCouponCodes")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs b/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs index d19c696e..a97e43b8 100644 --- a/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs +++ b/Migration.Toolkit.KX13/Models/ComShoppingCartSku.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_ShoppingCartSKU")] -[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] -[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] -public partial class ComShoppingCartSku -{ - [Key] - [Column("CartItemID")] - public int CartItemId { get; set; } - - [Column("ShoppingCartID")] - public int ShoppingCartId { get; set; } - - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUUnits")] - public int Skuunits { get; set; } - - public string? CartItemCustomData { get; set; } - - public Guid? CartItemGuid { get; set; } - - public Guid? CartItemParentGuid { get; set; } - - public DateTime? CartItemValidTo { get; set; } - - [Column("CartItemBundleGUID")] - public Guid? CartItemBundleGuid { get; set; } - - public string? CartItemText { get; set; } - - public int? CartItemAutoAddedUnits { get; set; } - - [ForeignKey("ShoppingCartId")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComShoppingCart ShoppingCart { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComShoppingCartSkus")] - public virtual ComSku Sku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_ShoppingCartSKU")] +[Index("Skuid", Name = "IX_COM_ShoppingCartSKU_SKUID")] +[Index("ShoppingCartId", Name = "IX_COM_ShoppingCartSKU_ShoppingCartID")] +public class ComShoppingCartSku +{ + [Key] + [Column("CartItemID")] + public int CartItemId { get; set; } + + [Column("ShoppingCartID")] + public int ShoppingCartId { get; set; } + + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUUnits")] + public int Skuunits { get; set; } + + public string? CartItemCustomData { get; set; } + + public Guid? CartItemGuid { get; set; } + + public Guid? CartItemParentGuid { get; set; } + + public DateTime? CartItemValidTo { get; set; } + + [Column("CartItemBundleGUID")] + public Guid? CartItemBundleGuid { get; set; } + + public string? CartItemText { get; set; } + + public int? CartItemAutoAddedUnits { get; set; } + + [ForeignKey("ShoppingCartId")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComShoppingCart ShoppingCart { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComShoppingCartSkus")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComSku.cs b/Migration.Toolkit.KX13/Models/ComSku.cs index d6eca97b..b573e5c9 100644 --- a/Migration.Toolkit.KX13/Models/ComSku.cs +++ b/Migration.Toolkit.KX13/Models/ComSku.cs @@ -1,270 +1,269 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_SKU")] -[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] -[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] -[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] -[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] -[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] -[Index("Skuname", Name = "IX_COM_SKU_SKUName")] -[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] -[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] -[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] -[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] -[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] -[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] -[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] -public partial class ComSku -{ - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("SKUNumber")] - [StringLength(200)] - public string? Skunumber { get; set; } - - [Column("SKUName")] - [StringLength(440)] - public string Skuname { get; set; } = null!; - - [Column("SKUDescription")] - public string? Skudescription { get; set; } - - [Column("SKUPrice", TypeName = "decimal(18, 9)")] - public decimal Skuprice { get; set; } - - [Required] - [Column("SKUEnabled")] - public bool? Skuenabled { get; set; } - - [Column("SKUDepartmentID")] - public int? SkudepartmentId { get; set; } - - [Column("SKUManufacturerID")] - public int? SkumanufacturerId { get; set; } - - [Column("SKUInternalStatusID")] - public int? SkuinternalStatusId { get; set; } - - [Column("SKUPublicStatusID")] - public int? SkupublicStatusId { get; set; } - - [Column("SKUSupplierID")] - public int? SkusupplierId { get; set; } - - [Column("SKUAvailableInDays")] - public int? SkuavailableInDays { get; set; } - - [Column("SKUGUID")] - public Guid Skuguid { get; set; } - - [Column("SKUImagePath")] - [StringLength(450)] - public string? SkuimagePath { get; set; } - - [Column("SKUWeight")] - public double? Skuweight { get; set; } - - [Column("SKUWidth")] - public double? Skuwidth { get; set; } - - [Column("SKUDepth")] - public double? Skudepth { get; set; } - - [Column("SKUHeight")] - public double? Skuheight { get; set; } - - [Column("SKUAvailableItems")] - public int? SkuavailableItems { get; set; } - - [Column("SKUSellOnlyAvailable")] - public bool? SkusellOnlyAvailable { get; set; } - - [Column("SKUCustomData")] - public string? SkucustomData { get; set; } - - [Column("SKUOptionCategoryID")] - public int? SkuoptionCategoryId { get; set; } - - [Column("SKUOrder")] - public int? Skuorder { get; set; } - - [Column("SKULastModified")] - public DateTime SkulastModified { get; set; } - - [Column("SKUCreated")] - public DateTime? Skucreated { get; set; } - - [Column("SKUSiteID")] - public int? SkusiteId { get; set; } - - [Column("SKUNeedsShipping")] - public bool? SkuneedsShipping { get; set; } - - [Column("SKUValidUntil")] - public DateTime? SkuvalidUntil { get; set; } - - [Column("SKUProductType")] - [StringLength(50)] - public string? SkuproductType { get; set; } - - [Column("SKUMaxItemsInOrder")] - public int? SkumaxItemsInOrder { get; set; } - - [Column("SKUValidity")] - [StringLength(50)] - public string? Skuvalidity { get; set; } - - [Column("SKUValidFor")] - public int? SkuvalidFor { get; set; } - - [Column("SKUMembershipGUID")] - public Guid? SkumembershipGuid { get; set; } - - [Column("SKUBundleInventoryType")] - [StringLength(50)] - public string? SkubundleInventoryType { get; set; } - - [Column("SKUMinItemsInOrder")] - public int? SkuminItemsInOrder { get; set; } - - [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] - public decimal? SkuretailPrice { get; set; } - - [Column("SKUParentSKUID")] - public int? SkuparentSkuid { get; set; } - - [Column("SKUShortDescription")] - public string? SkushortDescription { get; set; } - - [Column("SKUEproductFilesCount")] - public int? SkueproductFilesCount { get; set; } - - [Column("SKUBundleItemsCount")] - public int? SkubundleItemsCount { get; set; } - - [Column("SKUInStoreFrom")] - public DateTime? SkuinStoreFrom { get; set; } - - [Column("SKUReorderAt")] - public int? SkureorderAt { get; set; } - - [Column("SKUTrackInventory")] - [StringLength(50)] - public string? SkutrackInventory { get; set; } - - [Column("SKUTaxClassID")] - public int? SkutaxClassId { get; set; } - - [Column("SKUBrandID")] - public int? SkubrandId { get; set; } - - [Column("SKUCollectionID")] - public int? SkucollectionId { get; set; } - - [InverseProperty("NodeSku")] - public virtual ICollection CmsTrees { get; set; } = new List(); - - [InverseProperty("MultiBuyDiscountApplyToSku")] - public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); - - [InverseProperty("OrderItemSku")] - public virtual ICollection ComOrderItems { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); - - [InverseProperty("FileSku")] - public virtual ICollection ComSkufiles { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); - - [InverseProperty("VolumeDiscountSku")] - public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); - - [InverseProperty("Sku")] - public virtual ICollection ComWishlists { get; set; } = new List(); - - [InverseProperty("SkuparentSku")] - public virtual ICollection InverseSkuparentSku { get; set; } = new List(); - - [ForeignKey("SkubrandId")] - [InverseProperty("ComSkus")] - public virtual ComBrand? Skubrand { get; set; } - - [ForeignKey("SkucollectionId")] - [InverseProperty("ComSkus")] - public virtual ComCollection? Skucollection { get; set; } - - [ForeignKey("SkudepartmentId")] - [InverseProperty("ComSkus")] - public virtual ComDepartment? Skudepartment { get; set; } - - [ForeignKey("SkuinternalStatusId")] - [InverseProperty("ComSkus")] - public virtual ComInternalStatus? SkuinternalStatus { get; set; } - - [ForeignKey("SkumanufacturerId")] - [InverseProperty("ComSkus")] - public virtual ComManufacturer? Skumanufacturer { get; set; } - - [ForeignKey("SkuoptionCategoryId")] - [InverseProperty("ComSkus")] - public virtual ComOptionCategory? SkuoptionCategory { get; set; } - - [ForeignKey("SkuparentSkuid")] - [InverseProperty("InverseSkuparentSku")] - public virtual ComSku? SkuparentSku { get; set; } - - [ForeignKey("SkupublicStatusId")] - [InverseProperty("ComSkus")] - public virtual ComPublicStatus? SkupublicStatus { get; set; } - - [ForeignKey("SkusiteId")] - [InverseProperty("ComSkus")] - public virtual CmsSite? Skusite { get; set; } - - [ForeignKey("SkusupplierId")] - [InverseProperty("ComSkus")] - public virtual ComSupplier? Skusupplier { get; set; } - - [ForeignKey("SkutaxClassId")] - [InverseProperty("ComSkus")] - public virtual ComTaxClass? SkutaxClass { get; set; } - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection Bundles { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("Skus")] - public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); - - [ForeignKey("Skuid")] - [InverseProperty("SkusNavigation")] - public virtual ICollection OptionSkus { get; set; } = new List(); - - [ForeignKey("VariantSkuid")] - [InverseProperty("VariantSkus")] - public virtual ICollection OptionSkusNavigation { get; set; } = new List(); - - [ForeignKey("BundleId")] - [InverseProperty("Bundles")] - public virtual ICollection Skus { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkus")] - public virtual ICollection SkusNavigation { get; set; } = new List(); - - [ForeignKey("OptionSkuid")] - [InverseProperty("OptionSkusNavigation")] - public virtual ICollection VariantSkus { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_SKU")] +[Index("SkubrandId", Name = "IX_COM_SKU_SKUBrandID")] +[Index("SkucollectionId", Name = "IX_COM_SKU_SKUCollectionID")] +[Index("SkudepartmentId", Name = "IX_COM_SKU_SKUDepartmentID")] +[Index("SkuinternalStatusId", Name = "IX_COM_SKU_SKUInternalStatusID")] +[Index("SkumanufacturerId", Name = "IX_COM_SKU_SKUManufacturerID")] +[Index("Skuname", Name = "IX_COM_SKU_SKUName")] +[Index("SkuoptionCategoryId", Name = "IX_COM_SKU_SKUOptionCategoryID")] +[Index("SkuparentSkuid", Name = "IX_COM_SKU_SKUParentSKUID")] +[Index("Skuprice", Name = "IX_COM_SKU_SKUPrice")] +[Index("SkupublicStatusId", Name = "IX_COM_SKU_SKUPublicStatusID")] +[Index("SkusiteId", Name = "IX_COM_SKU_SKUSiteID")] +[Index("SkusupplierId", Name = "IX_COM_SKU_SKUSupplierID")] +[Index("SkutaxClassId", Name = "IX_COM_SKU_SKUTaxClassID")] +public class ComSku +{ + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("SKUNumber")] + [StringLength(200)] + public string? Skunumber { get; set; } + + [Column("SKUName")] + [StringLength(440)] + public string Skuname { get; set; } = null!; + + [Column("SKUDescription")] + public string? Skudescription { get; set; } + + [Column("SKUPrice", TypeName = "decimal(18, 9)")] + public decimal Skuprice { get; set; } + + [Required] + [Column("SKUEnabled")] + public bool? Skuenabled { get; set; } + + [Column("SKUDepartmentID")] + public int? SkudepartmentId { get; set; } + + [Column("SKUManufacturerID")] + public int? SkumanufacturerId { get; set; } + + [Column("SKUInternalStatusID")] + public int? SkuinternalStatusId { get; set; } + + [Column("SKUPublicStatusID")] + public int? SkupublicStatusId { get; set; } + + [Column("SKUSupplierID")] + public int? SkusupplierId { get; set; } + + [Column("SKUAvailableInDays")] + public int? SkuavailableInDays { get; set; } + + [Column("SKUGUID")] + public Guid Skuguid { get; set; } + + [Column("SKUImagePath")] + [StringLength(450)] + public string? SkuimagePath { get; set; } + + [Column("SKUWeight")] + public double? Skuweight { get; set; } + + [Column("SKUWidth")] + public double? Skuwidth { get; set; } + + [Column("SKUDepth")] + public double? Skudepth { get; set; } + + [Column("SKUHeight")] + public double? Skuheight { get; set; } + + [Column("SKUAvailableItems")] + public int? SkuavailableItems { get; set; } + + [Column("SKUSellOnlyAvailable")] + public bool? SkusellOnlyAvailable { get; set; } + + [Column("SKUCustomData")] + public string? SkucustomData { get; set; } + + [Column("SKUOptionCategoryID")] + public int? SkuoptionCategoryId { get; set; } + + [Column("SKUOrder")] + public int? Skuorder { get; set; } + + [Column("SKULastModified")] + public DateTime SkulastModified { get; set; } + + [Column("SKUCreated")] + public DateTime? Skucreated { get; set; } + + [Column("SKUSiteID")] + public int? SkusiteId { get; set; } + + [Column("SKUNeedsShipping")] + public bool? SkuneedsShipping { get; set; } + + [Column("SKUValidUntil")] + public DateTime? SkuvalidUntil { get; set; } + + [Column("SKUProductType")] + [StringLength(50)] + public string? SkuproductType { get; set; } + + [Column("SKUMaxItemsInOrder")] + public int? SkumaxItemsInOrder { get; set; } + + [Column("SKUValidity")] + [StringLength(50)] + public string? Skuvalidity { get; set; } + + [Column("SKUValidFor")] + public int? SkuvalidFor { get; set; } + + [Column("SKUMembershipGUID")] + public Guid? SkumembershipGuid { get; set; } + + [Column("SKUBundleInventoryType")] + [StringLength(50)] + public string? SkubundleInventoryType { get; set; } + + [Column("SKUMinItemsInOrder")] + public int? SkuminItemsInOrder { get; set; } + + [Column("SKURetailPrice", TypeName = "decimal(18, 9)")] + public decimal? SkuretailPrice { get; set; } + + [Column("SKUParentSKUID")] + public int? SkuparentSkuid { get; set; } + + [Column("SKUShortDescription")] + public string? SkushortDescription { get; set; } + + [Column("SKUEproductFilesCount")] + public int? SkueproductFilesCount { get; set; } + + [Column("SKUBundleItemsCount")] + public int? SkubundleItemsCount { get; set; } + + [Column("SKUInStoreFrom")] + public DateTime? SkuinStoreFrom { get; set; } + + [Column("SKUReorderAt")] + public int? SkureorderAt { get; set; } + + [Column("SKUTrackInventory")] + [StringLength(50)] + public string? SkutrackInventory { get; set; } + + [Column("SKUTaxClassID")] + public int? SkutaxClassId { get; set; } + + [Column("SKUBrandID")] + public int? SkubrandId { get; set; } + + [Column("SKUCollectionID")] + public int? SkucollectionId { get; set; } + + [InverseProperty("NodeSku")] + public virtual ICollection CmsTrees { get; set; } = new List(); + + [InverseProperty("MultiBuyDiscountApplyToSku")] + public virtual ICollection ComMultiBuyDiscounts { get; set; } = new List(); + + [InverseProperty("OrderItemSku")] + public virtual ICollection ComOrderItems { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComShoppingCartSkus { get; set; } = new List(); + + [InverseProperty("FileSku")] + public virtual ICollection ComSkufiles { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComSkuoptionCategories { get; set; } = new List(); + + [InverseProperty("VolumeDiscountSku")] + public virtual ICollection ComVolumeDiscounts { get; set; } = new List(); + + [InverseProperty("Sku")] + public virtual ICollection ComWishlists { get; set; } = new List(); + + [InverseProperty("SkuparentSku")] + public virtual ICollection InverseSkuparentSku { get; set; } = new List(); + + [ForeignKey("SkubrandId")] + [InverseProperty("ComSkus")] + public virtual ComBrand? Skubrand { get; set; } + + [ForeignKey("SkucollectionId")] + [InverseProperty("ComSkus")] + public virtual ComCollection? Skucollection { get; set; } + + [ForeignKey("SkudepartmentId")] + [InverseProperty("ComSkus")] + public virtual ComDepartment? Skudepartment { get; set; } + + [ForeignKey("SkuinternalStatusId")] + [InverseProperty("ComSkus")] + public virtual ComInternalStatus? SkuinternalStatus { get; set; } + + [ForeignKey("SkumanufacturerId")] + [InverseProperty("ComSkus")] + public virtual ComManufacturer? Skumanufacturer { get; set; } + + [ForeignKey("SkuoptionCategoryId")] + [InverseProperty("ComSkus")] + public virtual ComOptionCategory? SkuoptionCategory { get; set; } + + [ForeignKey("SkuparentSkuid")] + [InverseProperty("InverseSkuparentSku")] + public virtual ComSku? SkuparentSku { get; set; } + + [ForeignKey("SkupublicStatusId")] + [InverseProperty("ComSkus")] + public virtual ComPublicStatus? SkupublicStatus { get; set; } + + [ForeignKey("SkusiteId")] + [InverseProperty("ComSkus")] + public virtual CmsSite? Skusite { get; set; } + + [ForeignKey("SkusupplierId")] + [InverseProperty("ComSkus")] + public virtual ComSupplier? Skusupplier { get; set; } + + [ForeignKey("SkutaxClassId")] + [InverseProperty("ComSkus")] + public virtual ComTaxClass? SkutaxClass { get; set; } + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection Bundles { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("Skus")] + public virtual ICollection MultiBuyDiscounts { get; set; } = new List(); + + [ForeignKey("Skuid")] + [InverseProperty("SkusNavigation")] + public virtual ICollection OptionSkus { get; set; } = new List(); + + [ForeignKey("VariantSkuid")] + [InverseProperty("VariantSkus")] + public virtual ICollection OptionSkusNavigation { get; set; } = new List(); + + [ForeignKey("BundleId")] + [InverseProperty("Bundles")] + public virtual ICollection Skus { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkus")] + public virtual ICollection SkusNavigation { get; set; } = new List(); + + [ForeignKey("OptionSkuid")] + [InverseProperty("OptionSkusNavigation")] + public virtual ICollection VariantSkus { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ComSkufile.cs b/Migration.Toolkit.KX13/Models/ComSkufile.cs index 6f3fb4c8..21e2e885 100644 --- a/Migration.Toolkit.KX13/Models/ComSkufile.cs +++ b/Migration.Toolkit.KX13/Models/ComSkufile.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_SKUFile")] -[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] -public partial class ComSkufile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileSKUID")] - public int FileSkuid { get; set; } - - [StringLength(450)] - public string FilePath { get; set; } = null!; - - [StringLength(50)] - public string FileType { get; set; } = null!; - - public DateTime FileLastModified { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [Column("FileMetaFileGUID")] - public Guid? FileMetaFileGuid { get; set; } - - [InverseProperty("File")] - public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); - - [ForeignKey("FileSkuid")] - [InverseProperty("ComSkufiles")] - public virtual ComSku FileSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_SKUFile")] +[Index("FileSkuid", Name = "IX_COM_SKUFile_FileSKUID")] +public class ComSkufile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileSKUID")] + public int FileSkuid { get; set; } + + [StringLength(450)] + public string FilePath { get; set; } = null!; + + [StringLength(50)] + public string FileType { get; set; } = null!; + + public DateTime FileLastModified { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [Column("FileMetaFileGUID")] + public Guid? FileMetaFileGuid { get; set; } + + [InverseProperty("File")] + public virtual ICollection ComOrderItemSkufiles { get; set; } = new List(); + + [ForeignKey("FileSkuid")] + [InverseProperty("ComSkufiles")] + public virtual ComSku FileSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs b/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs index 8d012197..4f7b56dc 100644 --- a/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs +++ b/Migration.Toolkit.KX13/Models/ComSkuoptionCategory.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_SKUOptionCategory")] -[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] -[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] -public partial class ComSkuoptionCategory -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Key] - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [ForeignKey("CategoryId")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComOptionCategory Category { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComSkuoptionCategories")] - public virtual ComSku Sku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_SKUOptionCategory")] +[Index("CategoryId", Name = "IX_COM_SKUOptionCategory_CategoryID")] +[Index("Skuid", Name = "IX_COM_SKUOptionCategory_SKUID")] +public class ComSkuoptionCategory +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Key] + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [ForeignKey("CategoryId")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComOptionCategory Category { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComSkuoptionCategories")] + public virtual ComSku Sku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComSupplier.cs b/Migration.Toolkit.KX13/Models/ComSupplier.cs index de11274c..474c27eb 100644 --- a/Migration.Toolkit.KX13/Models/ComSupplier.cs +++ b/Migration.Toolkit.KX13/Models/ComSupplier.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_Supplier")] -[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] -public partial class ComSupplier -{ - [Key] - [Column("SupplierID")] - public int SupplierId { get; set; } - - [StringLength(200)] - public string SupplierDisplayName { get; set; } = null!; - - [StringLength(50)] - public string? SupplierPhone { get; set; } - - [StringLength(254)] - public string? SupplierEmail { get; set; } - - [StringLength(50)] - public string? SupplierFax { get; set; } - - [Required] - public bool? SupplierEnabled { get; set; } - - [Column("SupplierGUID")] - public Guid SupplierGuid { get; set; } - - public DateTime SupplierLastModified { get; set; } - - [Column("SupplierSiteID")] - public int? SupplierSiteId { get; set; } - - [StringLength(200)] - public string? SupplierName { get; set; } - - [InverseProperty("Skusupplier")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [ForeignKey("SupplierSiteId")] - [InverseProperty("ComSuppliers")] - public virtual CmsSite? SupplierSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_Supplier")] +[Index("SupplierSiteId", Name = "IX_COM_Supplier_SupplierSiteID")] +public class ComSupplier +{ + [Key] + [Column("SupplierID")] + public int SupplierId { get; set; } + + [StringLength(200)] + public string SupplierDisplayName { get; set; } = null!; + + [StringLength(50)] + public string? SupplierPhone { get; set; } + + [StringLength(254)] + public string? SupplierEmail { get; set; } + + [StringLength(50)] + public string? SupplierFax { get; set; } + + [Required] + public bool? SupplierEnabled { get; set; } + + [Column("SupplierGUID")] + public Guid SupplierGuid { get; set; } + + public DateTime SupplierLastModified { get; set; } + + [Column("SupplierSiteID")] + public int? SupplierSiteId { get; set; } + + [StringLength(200)] + public string? SupplierName { get; set; } + + [InverseProperty("Skusupplier")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [ForeignKey("SupplierSiteId")] + [InverseProperty("ComSuppliers")] + public virtual CmsSite? SupplierSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComTaxClass.cs b/Migration.Toolkit.KX13/Models/ComTaxClass.cs index b4d022ba..bec4989c 100644 --- a/Migration.Toolkit.KX13/Models/ComTaxClass.cs +++ b/Migration.Toolkit.KX13/Models/ComTaxClass.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_TaxClass")] -[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] -public partial class ComTaxClass -{ - [Key] - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [StringLength(200)] - public string TaxClassName { get; set; } = null!; - - [StringLength(200)] - public string TaxClassDisplayName { get; set; } = null!; - - [Column("TaxClassZeroIfIDSupplied")] - public bool? TaxClassZeroIfIdsupplied { get; set; } - - [Column("TaxClassGUID")] - public Guid TaxClassGuid { get; set; } - - public DateTime TaxClassLastModified { get; set; } - - [Column("TaxClassSiteID")] - public int? TaxClassSiteId { get; set; } - - [InverseProperty("DepartmentDefaultTaxClass")] - public virtual ICollection ComDepartments { get; set; } = new List(); - - [InverseProperty("ShippingOptionTaxClass")] - public virtual ICollection ComShippingOptions { get; set; } = new List(); - - [InverseProperty("SkutaxClass")] - public virtual ICollection ComSkus { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassCountries { get; set; } = new List(); - - [InverseProperty("TaxClass")] - public virtual ICollection ComTaxClassStates { get; set; } = new List(); - - [ForeignKey("TaxClassSiteId")] - [InverseProperty("ComTaxClasses")] - public virtual CmsSite? TaxClassSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_TaxClass")] +[Index("TaxClassSiteId", Name = "IX_COM_TaxClass_TaxClassSiteID")] +public class ComTaxClass +{ + [Key] + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [StringLength(200)] + public string TaxClassName { get; set; } = null!; + + [StringLength(200)] + public string TaxClassDisplayName { get; set; } = null!; + + [Column("TaxClassZeroIfIDSupplied")] + public bool? TaxClassZeroIfIdsupplied { get; set; } + + [Column("TaxClassGUID")] + public Guid TaxClassGuid { get; set; } + + public DateTime TaxClassLastModified { get; set; } + + [Column("TaxClassSiteID")] + public int? TaxClassSiteId { get; set; } + + [InverseProperty("DepartmentDefaultTaxClass")] + public virtual ICollection ComDepartments { get; set; } = new List(); + + [InverseProperty("ShippingOptionTaxClass")] + public virtual ICollection ComShippingOptions { get; set; } = new List(); + + [InverseProperty("SkutaxClass")] + public virtual ICollection ComSkus { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassCountries { get; set; } = new List(); + + [InverseProperty("TaxClass")] + public virtual ICollection ComTaxClassStates { get; set; } = new List(); + + [ForeignKey("TaxClassSiteId")] + [InverseProperty("ComTaxClasses")] + public virtual CmsSite? TaxClassSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs b/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs index 7929fe16..f73bf6af 100644 --- a/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs +++ b/Migration.Toolkit.KX13/Models/ComTaxClassCountry.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_TaxClassCountry")] -[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] -[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] -public partial class ComTaxClassCountry -{ - [Key] - [Column("TaxClassCountryID")] - public int TaxClassCountryId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("CountryId")] - [InverseProperty("ComTaxClassCountries")] - public virtual CmsCountry Country { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassCountries")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_TaxClassCountry")] +[Index("CountryId", Name = "IX_COM_TaxClassCountry_CountryID")] +[Index("TaxClassId", "CountryId", Name = "IX_COM_TaxClassCountry_TaxClassID_CountryID", IsUnique = true)] +public class ComTaxClassCountry +{ + [Key] + [Column("TaxClassCountryID")] + public int TaxClassCountryId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("CountryId")] + [InverseProperty("ComTaxClassCountries")] + public virtual CmsCountry Country { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassCountries")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComTaxClassState.cs b/Migration.Toolkit.KX13/Models/ComTaxClassState.cs index 09d1d139..3d442359 100644 --- a/Migration.Toolkit.KX13/Models/ComTaxClassState.cs +++ b/Migration.Toolkit.KX13/Models/ComTaxClassState.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_TaxClassState")] -[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] -[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] -public partial class ComTaxClassState -{ - [Key] - [Column("TaxClassStateID")] - public int TaxClassStateId { get; set; } - - [Column("TaxClassID")] - public int TaxClassId { get; set; } - - [Column("StateID")] - public int StateId { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal TaxValue { get; set; } - - [ForeignKey("StateId")] - [InverseProperty("ComTaxClassStates")] - public virtual CmsState State { get; set; } = null!; - - [ForeignKey("TaxClassId")] - [InverseProperty("ComTaxClassStates")] - public virtual ComTaxClass TaxClass { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_TaxClassState")] +[Index("StateId", Name = "IX_COM_TaxClassState_StateID")] +[Index("TaxClassId", "StateId", Name = "IX_COM_TaxClassState_TaxClassID_StateID", IsUnique = true)] +public class ComTaxClassState +{ + [Key] + [Column("TaxClassStateID")] + public int TaxClassStateId { get; set; } + + [Column("TaxClassID")] + public int TaxClassId { get; set; } + + [Column("StateID")] + public int StateId { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal TaxValue { get; set; } + + [ForeignKey("StateId")] + [InverseProperty("ComTaxClassStates")] + public virtual CmsState State { get; set; } = null!; + + [ForeignKey("TaxClassId")] + [InverseProperty("ComTaxClassStates")] + public virtual ComTaxClass TaxClass { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs b/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs index 7c9e5429..e4146abd 100644 --- a/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs +++ b/Migration.Toolkit.KX13/Models/ComVolumeDiscount.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("COM_VolumeDiscount")] -[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] -public partial class ComVolumeDiscount -{ - [Key] - [Column("VolumeDiscountID")] - public int VolumeDiscountId { get; set; } - - [Column("VolumeDiscountSKUID")] - public int VolumeDiscountSkuid { get; set; } - - public int VolumeDiscountMinCount { get; set; } - - [Column(TypeName = "decimal(18, 9)")] - public decimal VolumeDiscountValue { get; set; } - - public bool VolumeDiscountIsFlatValue { get; set; } - - [Column("VolumeDiscountGUID")] - public Guid VolumeDiscountGuid { get; set; } - - public DateTime VolumeDiscountLastModified { get; set; } - - [ForeignKey("VolumeDiscountSkuid")] - [InverseProperty("ComVolumeDiscounts")] - public virtual ComSku VolumeDiscountSku { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("COM_VolumeDiscount")] +[Index("VolumeDiscountSkuid", Name = "IX_COM_VolumeDiscount_VolumeDiscountSKUID")] +public class ComVolumeDiscount +{ + [Key] + [Column("VolumeDiscountID")] + public int VolumeDiscountId { get; set; } + + [Column("VolumeDiscountSKUID")] + public int VolumeDiscountSkuid { get; set; } + + public int VolumeDiscountMinCount { get; set; } + + [Column(TypeName = "decimal(18, 9)")] + public decimal VolumeDiscountValue { get; set; } + + public bool VolumeDiscountIsFlatValue { get; set; } + + [Column("VolumeDiscountGUID")] + public Guid VolumeDiscountGuid { get; set; } + + public DateTime VolumeDiscountLastModified { get; set; } + + [ForeignKey("VolumeDiscountSkuid")] + [InverseProperty("ComVolumeDiscounts")] + public virtual ComSku VolumeDiscountSku { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ComWishlist.cs b/Migration.Toolkit.KX13/Models/ComWishlist.cs index df0ab62e..5b0f92d2 100644 --- a/Migration.Toolkit.KX13/Models/ComWishlist.cs +++ b/Migration.Toolkit.KX13/Models/ComWishlist.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("UserId", "Skuid", "SiteId")] -[Table("COM_Wishlist")] -[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] -[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] -public partial class ComWishlist -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [Key] - [Column("SKUID")] - public int Skuid { get; set; } - - [Key] - [Column("SiteID")] - public int SiteId { get; set; } - - [ForeignKey("SiteId")] - [InverseProperty("ComWishlists")] - public virtual CmsSite Site { get; set; } = null!; - - [ForeignKey("Skuid")] - [InverseProperty("ComWishlists")] - public virtual ComSku Sku { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("ComWishlists")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("UserId", "Skuid", "SiteId")] +[Table("COM_Wishlist")] +[Index("Skuid", Name = "IX_COM_Wishlist_SKUID")] +[Index("SiteId", "UserId", Name = "IX_COM_Wishlist_SiteID_UserID")] +public class ComWishlist +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [Key] + [Column("SKUID")] + public int Skuid { get; set; } + + [Key] + [Column("SiteID")] + public int SiteId { get; set; } + + [ForeignKey("SiteId")] + [InverseProperty("ComWishlists")] + public virtual CmsSite Site { get; set; } = null!; + + [ForeignKey("Skuid")] + [InverseProperty("ComWishlists")] + public virtual ComSku Sku { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("ComWishlists")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ExportHistory.cs b/Migration.Toolkit.KX13/Models/ExportHistory.cs index 45277bf5..00dac957 100644 --- a/Migration.Toolkit.KX13/Models/ExportHistory.cs +++ b/Migration.Toolkit.KX13/Models/ExportHistory.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Export_History")] -[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] -[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] -public partial class ExportHistory -{ - [Key] - [Column("ExportID")] - public int ExportId { get; set; } - - public DateTime ExportDateTime { get; set; } - - [StringLength(450)] - public string ExportFileName { get; set; } = null!; - - [Column("ExportSiteID")] - public int? ExportSiteId { get; set; } - - [Column("ExportUserID")] - public int? ExportUserId { get; set; } - - public string? ExportSettings { get; set; } - - [ForeignKey("ExportSiteId")] - [InverseProperty("ExportHistories")] - public virtual CmsSite? ExportSite { get; set; } - - [ForeignKey("ExportUserId")] - [InverseProperty("ExportHistories")] - public virtual CmsUser? ExportUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Export_History")] +[Index("ExportSiteId", Name = "IX_Export_History_ExportSiteID")] +[Index("ExportUserId", Name = "IX_Export_History_ExportUserID")] +public class ExportHistory +{ + [Key] + [Column("ExportID")] + public int ExportId { get; set; } + + public DateTime ExportDateTime { get; set; } + + [StringLength(450)] + public string ExportFileName { get; set; } = null!; + + [Column("ExportSiteID")] + public int? ExportSiteId { get; set; } + + [Column("ExportUserID")] + public int? ExportUserId { get; set; } + + public string? ExportSettings { get; set; } + + [ForeignKey("ExportSiteId")] + [InverseProperty("ExportHistories")] + public virtual CmsSite? ExportSite { get; set; } + + [ForeignKey("ExportUserId")] + [InverseProperty("ExportHistories")] + public virtual CmsUser? ExportUser { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ExportTask.cs b/Migration.Toolkit.KX13/Models/ExportTask.cs index b3591f21..85cf0580 100644 --- a/Migration.Toolkit.KX13/Models/ExportTask.cs +++ b/Migration.Toolkit.KX13/Models/ExportTask.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Export_Task")] -[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] -public partial class ExportTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [ForeignKey("TaskSiteId")] - [InverseProperty("ExportTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Export_Task")] +[Index("TaskSiteId", "TaskObjectType", Name = "IX_Export_Task_TaskSiteID_TaskObjectType")] +public class ExportTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [ForeignKey("TaskSiteId")] + [InverseProperty("ExportTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/IntegrationConnector.cs b/Migration.Toolkit.KX13/Models/IntegrationConnector.cs index 8243b87b..f11e3ee5 100644 --- a/Migration.Toolkit.KX13/Models/IntegrationConnector.cs +++ b/Migration.Toolkit.KX13/Models/IntegrationConnector.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Integration_Connector")] -[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] -public partial class IntegrationConnector -{ - [Key] - [Column("ConnectorID")] - public int ConnectorId { get; set; } - - [StringLength(100)] - public string ConnectorName { get; set; } = null!; - - [StringLength(440)] - public string ConnectorDisplayName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorAssemblyName { get; set; } = null!; - - [StringLength(400)] - public string ConnectorClassName { get; set; } = null!; - - [Required] - public bool? ConnectorEnabled { get; set; } - - public DateTime ConnectorLastModified { get; set; } - - [InverseProperty("SynchronizationConnector")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Integration_Connector")] +[Index("ConnectorEnabled", Name = "IX_Integration_Connector_ConnectorEnabled")] +public class IntegrationConnector +{ + [Key] + [Column("ConnectorID")] + public int ConnectorId { get; set; } + + [StringLength(100)] + public string ConnectorName { get; set; } = null!; + + [StringLength(440)] + public string ConnectorDisplayName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorAssemblyName { get; set; } = null!; + + [StringLength(400)] + public string ConnectorClassName { get; set; } = null!; + + [Required] + public bool? ConnectorEnabled { get; set; } + + public DateTime ConnectorLastModified { get; set; } + + [InverseProperty("SynchronizationConnector")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs b/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs index d84f9f7c..ccbd0df8 100644 --- a/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs +++ b/Migration.Toolkit.KX13/Models/IntegrationSyncLog.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Integration_SyncLog")] -[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] -public partial class IntegrationSyncLog -{ - [Key] - [Column("SyncLogID")] - public int SyncLogId { get; set; } - - [Column("SyncLogSynchronizationID")] - public int SyncLogSynchronizationId { get; set; } - - public DateTime SyncLogTime { get; set; } - - public string? SyncLogErrorMessage { get; set; } - - [ForeignKey("SyncLogSynchronizationId")] - [InverseProperty("IntegrationSyncLogs")] - public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Integration_SyncLog")] +[Index("SyncLogSynchronizationId", Name = "IX_Integration_SyncLog_SyncLogTaskID")] +public class IntegrationSyncLog +{ + [Key] + [Column("SyncLogID")] + public int SyncLogId { get; set; } + + [Column("SyncLogSynchronizationID")] + public int SyncLogSynchronizationId { get; set; } + + public DateTime SyncLogTime { get; set; } + + public string? SyncLogErrorMessage { get; set; } + + [ForeignKey("SyncLogSynchronizationId")] + [InverseProperty("IntegrationSyncLogs")] + public virtual IntegrationSynchronization SyncLogSynchronization { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs b/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs index fa5c0255..88251326 100644 --- a/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs +++ b/Migration.Toolkit.KX13/Models/IntegrationSynchronization.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Integration_Synchronization")] -[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] -[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] -public partial class IntegrationSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int SynchronizationConnectorId { get; set; } - - public DateTime SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [InverseProperty("SyncLogSynchronization")] - public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); - - [ForeignKey("SynchronizationConnectorId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("IntegrationSynchronizations")] - public virtual IntegrationTask SynchronizationTask { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Integration_Synchronization")] +[Index("SynchronizationConnectorId", Name = "IX_Integration_Synchronization_SynchronizationConnectorID")] +[Index("SynchronizationTaskId", Name = "IX_Integration_Synchronization_SynchronizationTaskID")] +public class IntegrationSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int SynchronizationConnectorId { get; set; } + + public DateTime SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [InverseProperty("SyncLogSynchronization")] + public virtual ICollection IntegrationSyncLogs { get; set; } = new List(); + + [ForeignKey("SynchronizationConnectorId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationConnector SynchronizationConnector { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("IntegrationSynchronizations")] + public virtual IntegrationTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/IntegrationTask.cs b/Migration.Toolkit.KX13/Models/IntegrationTask.cs index a4768494..e84853ec 100644 --- a/Migration.Toolkit.KX13/Models/IntegrationTask.cs +++ b/Migration.Toolkit.KX13/Models/IntegrationTask.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Integration_Task")] -[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] -[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Integration_Task_TaskType")] -public partial class IntegrationTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("IntegrationTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Integration_Task")] +[Index("TaskIsInbound", Name = "IX_Integration_Task_TaskIsInbound")] +[Index("TaskSiteId", Name = "IX_Integration_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Integration_Task_TaskType")] +public class IntegrationTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection IntegrationSynchronizations { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("IntegrationTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/MediaFile.cs b/Migration.Toolkit.KX13/Models/MediaFile.cs index 122c5138..fc931df3 100644 --- a/Migration.Toolkit.KX13/Models/MediaFile.cs +++ b/Migration.Toolkit.KX13/Models/MediaFile.cs @@ -1,78 +1,77 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Media_File")] -[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] -[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] -[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] -[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] -public partial class MediaFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string FileTitle { get; set; } = null!; - - public string FileDescription { get; set; } = null!; - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public string FilePath { get; set; } = null!; - - public long FileSize { get; set; } - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileLibraryID")] - public int FileLibraryId { get; set; } - - [Column("FileSiteID")] - public int FileSiteId { get; set; } - - [Column("FileCreatedByUserID")] - public int? FileCreatedByUserId { get; set; } - - public DateTime FileCreatedWhen { get; set; } - - [Column("FileModifiedByUserID")] - public int? FileModifiedByUserId { get; set; } - - public DateTime FileModifiedWhen { get; set; } - - public string? FileCustomData { get; set; } - - [ForeignKey("FileCreatedByUserId")] - [InverseProperty("MediaFileFileCreatedByUsers")] - public virtual CmsUser? FileCreatedByUser { get; set; } - - [ForeignKey("FileLibraryId")] - [InverseProperty("MediaFiles")] - public virtual MediaLibrary FileLibrary { get; set; } = null!; - - [ForeignKey("FileModifiedByUserId")] - [InverseProperty("MediaFileFileModifiedByUsers")] - public virtual CmsUser? FileModifiedByUser { get; set; } - - [ForeignKey("FileSiteId")] - [InverseProperty("MediaFiles")] - public virtual CmsSite FileSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Media_File")] +[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] +[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] +[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] +[Index("FileSiteId", "FileGuid", Name = "IX_Media_File_FileSiteID_FileGUID")] +public class MediaFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string FileTitle { get; set; } = null!; + + public string FileDescription { get; set; } = null!; + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public string FilePath { get; set; } = null!; + + public long FileSize { get; set; } + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileLibraryID")] + public int FileLibraryId { get; set; } + + [Column("FileSiteID")] + public int FileSiteId { get; set; } + + [Column("FileCreatedByUserID")] + public int? FileCreatedByUserId { get; set; } + + public DateTime FileCreatedWhen { get; set; } + + [Column("FileModifiedByUserID")] + public int? FileModifiedByUserId { get; set; } + + public DateTime FileModifiedWhen { get; set; } + + public string? FileCustomData { get; set; } + + [ForeignKey("FileCreatedByUserId")] + [InverseProperty("MediaFileFileCreatedByUsers")] + public virtual CmsUser? FileCreatedByUser { get; set; } + + [ForeignKey("FileLibraryId")] + [InverseProperty("MediaFiles")] + public virtual MediaLibrary FileLibrary { get; set; } = null!; + + [ForeignKey("FileModifiedByUserId")] + [InverseProperty("MediaFileFileModifiedByUsers")] + public virtual CmsUser? FileModifiedByUser { get; set; } + + [ForeignKey("FileSiteId")] + [InverseProperty("MediaFiles")] + public virtual CmsSite FileSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/MediaLibrary.cs b/Migration.Toolkit.KX13/Models/MediaLibrary.cs index 26386775..dccb5df1 100644 --- a/Migration.Toolkit.KX13/Models/MediaLibrary.cs +++ b/Migration.Toolkit.KX13/Models/MediaLibrary.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Media_Library")] -[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] -public partial class MediaLibrary -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [StringLength(250)] - public string LibraryName { get; set; } = null!; - - [StringLength(250)] - public string LibraryDisplayName { get; set; } = null!; - - public string? LibraryDescription { get; set; } - - [StringLength(250)] - public string LibraryFolder { get; set; } = null!; - - public int? LibraryAccess { get; set; } - - [Column("LibrarySiteID")] - public int LibrarySiteId { get; set; } - - [Column("LibraryGUID")] - public Guid? LibraryGuid { get; set; } - - public DateTime? LibraryLastModified { get; set; } - - [StringLength(450)] - public string? LibraryTeaserPath { get; set; } - - [Column("LibraryTeaserGUID")] - public Guid? LibraryTeaserGuid { get; set; } - - public bool? LibraryUseDirectPathForContent { get; set; } - - [ForeignKey("LibrarySiteId")] - [InverseProperty("MediaLibraries")] - public virtual CmsSite LibrarySite { get; set; } = null!; - - [InverseProperty("FileLibrary")] - public virtual ICollection MediaFiles { get; set; } = new List(); - - [InverseProperty("Library")] - public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Media_Library")] +[Index("LibrarySiteId", "LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] +public class MediaLibrary +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [StringLength(250)] + public string LibraryName { get; set; } = null!; + + [StringLength(250)] + public string LibraryDisplayName { get; set; } = null!; + + public string? LibraryDescription { get; set; } + + [StringLength(250)] + public string LibraryFolder { get; set; } = null!; + + public int? LibraryAccess { get; set; } + + [Column("LibrarySiteID")] + public int LibrarySiteId { get; set; } + + [Column("LibraryGUID")] + public Guid? LibraryGuid { get; set; } + + public DateTime? LibraryLastModified { get; set; } + + [StringLength(450)] + public string? LibraryTeaserPath { get; set; } + + [Column("LibraryTeaserGUID")] + public Guid? LibraryTeaserGuid { get; set; } + + public bool? LibraryUseDirectPathForContent { get; set; } + + [ForeignKey("LibrarySiteId")] + [InverseProperty("MediaLibraries")] + public virtual CmsSite LibrarySite { get; set; } = null!; + + [InverseProperty("FileLibrary")] + public virtual ICollection MediaFiles { get; set; } = new List(); + + [InverseProperty("Library")] + public virtual ICollection MediaLibraryRolePermissions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs b/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs index d2967895..3c0b3408 100644 --- a/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs +++ b/Migration.Toolkit.KX13/Models/MediaLibraryRolePermission.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[PrimaryKey("LibraryId", "RoleId", "PermissionId")] -[Table("Media_LibraryRolePermission")] -[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] -[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] -public partial class MediaLibraryRolePermission -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("PermissionID")] - public int PermissionId { get; set; } - - [ForeignKey("LibraryId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual MediaLibrary Library { get; set; } = null!; - - [ForeignKey("PermissionId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsPermission Permission { get; set; } = null!; - - [ForeignKey("RoleId")] - [InverseProperty("MediaLibraryRolePermissions")] - public virtual CmsRole Role { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[PrimaryKey("LibraryId", "RoleId", "PermissionId")] +[Table("Media_LibraryRolePermission")] +[Index("PermissionId", Name = "IX_Media_LibraryRolePermission_PermissionID")] +[Index("RoleId", Name = "IX_Media_LibraryRolePermission_RoleID")] +public class MediaLibraryRolePermission +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("PermissionID")] + public int PermissionId { get; set; } + + [ForeignKey("LibraryId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual MediaLibrary Library { get; set; } = null!; + + [ForeignKey("PermissionId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsPermission Permission { get; set; } = null!; + + [ForeignKey("RoleId")] + [InverseProperty("MediaLibraryRolePermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs b/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs index 441ca374..320d1644 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterAbtest.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_ABTest")] -[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] -[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] -[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] -public partial class NewsletterAbtest -{ - [Key] - [Column("TestID")] - public int TestId { get; set; } - - [Column("TestIssueID")] - public int TestIssueId { get; set; } - - public int TestWinnerOption { get; set; } - - public int? TestSelectWinnerAfter { get; set; } - - [Column("TestWinnerIssueID")] - public int? TestWinnerIssueId { get; set; } - - public DateTime? TestWinnerSelected { get; set; } - - public DateTime TestLastModified { get; set; } - - [Column("TestGUID")] - public Guid TestGuid { get; set; } - - [Column("TestWinnerScheduledTaskID")] - public int? TestWinnerScheduledTaskId { get; set; } - - public int TestSizePercentage { get; set; } - - public int? TestNumberPerVariantEmails { get; set; } - - [ForeignKey("TestIssueId")] - [InverseProperty("NewsletterAbtestTestIssue")] - public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; - - [ForeignKey("TestWinnerIssueId")] - [InverseProperty("NewsletterAbtestTestWinnerIssues")] - public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } - - [ForeignKey("TestWinnerScheduledTaskId")] - [InverseProperty("NewsletterAbtests")] - public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_ABTest")] +[Index("TestIssueId", Name = "IX_Newsletter_ABTest_TestIssueID", IsUnique = true)] +[Index("TestWinnerIssueId", Name = "IX_Newsletter_ABTest_TestWinnerIssueID")] +[Index("TestWinnerScheduledTaskId", Name = "IX_Newsletter_ABTest_TestWinnerScheduledTaskID")] +public class NewsletterAbtest +{ + [Key] + [Column("TestID")] + public int TestId { get; set; } + + [Column("TestIssueID")] + public int TestIssueId { get; set; } + + public int TestWinnerOption { get; set; } + + public int? TestSelectWinnerAfter { get; set; } + + [Column("TestWinnerIssueID")] + public int? TestWinnerIssueId { get; set; } + + public DateTime? TestWinnerSelected { get; set; } + + public DateTime TestLastModified { get; set; } + + [Column("TestGUID")] + public Guid TestGuid { get; set; } + + [Column("TestWinnerScheduledTaskID")] + public int? TestWinnerScheduledTaskId { get; set; } + + public int TestSizePercentage { get; set; } + + public int? TestNumberPerVariantEmails { get; set; } + + [ForeignKey("TestIssueId")] + [InverseProperty("NewsletterAbtestTestIssue")] + public virtual NewsletterNewsletterIssue TestIssue { get; set; } = null!; + + [ForeignKey("TestWinnerIssueId")] + [InverseProperty("NewsletterAbtestTestWinnerIssues")] + public virtual NewsletterNewsletterIssue? TestWinnerIssue { get; set; } + + [ForeignKey("TestWinnerScheduledTaskId")] + [InverseProperty("NewsletterAbtests")] + public virtual CmsScheduledTask? TestWinnerScheduledTask { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs b/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs index 843e850b..638cc13f 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterClickedLink.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_ClickedLink")] -[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] -public partial class NewsletterClickedLink -{ - [Key] - [Column("ClickedLinkID")] - public int ClickedLinkId { get; set; } - - public Guid ClickedLinkGuid { get; set; } - - [StringLength(254)] - public string ClickedLinkEmail { get; set; } = null!; - - [Column("ClickedLinkNewsletterLinkID")] - public int ClickedLinkNewsletterLinkId { get; set; } - - public DateTime? ClickedLinkTime { get; set; } - - [ForeignKey("ClickedLinkNewsletterLinkId")] - [InverseProperty("NewsletterClickedLinks")] - public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_ClickedLink")] +[Index("ClickedLinkNewsletterLinkId", Name = "IX_Newsletter_ClickedLink_ClickedLinkNewsletterLinkID")] +public class NewsletterClickedLink +{ + [Key] + [Column("ClickedLinkID")] + public int ClickedLinkId { get; set; } + + public Guid ClickedLinkGuid { get; set; } + + [StringLength(254)] + public string ClickedLinkEmail { get; set; } = null!; + + [Column("ClickedLinkNewsletterLinkID")] + public int ClickedLinkNewsletterLinkId { get; set; } + + public DateTime? ClickedLinkTime { get; set; } + + [ForeignKey("ClickedLinkNewsletterLinkId")] + [InverseProperty("NewsletterClickedLinks")] + public virtual NewsletterLink ClickedLinkNewsletterLink { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmail.cs b/Migration.Toolkit.KX13/Models/NewsletterEmail.cs index a021e07f..4dbc1100 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterEmail.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterEmail.cs @@ -1,56 +1,55 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Emails")] -[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] -[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] -[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] -[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] -[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] -public partial class NewsletterEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [Column("EmailNewsletterIssueID")] - public int EmailNewsletterIssueId { get; set; } - - [Column("EmailSubscriberID")] - public int? EmailSubscriberId { get; set; } - - [Column("EmailSiteID")] - public int EmailSiteId { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - public bool? EmailSending { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - [Column("EmailContactID")] - public int? EmailContactId { get; set; } - - [StringLength(254)] - public string? EmailAddress { get; set; } - - [ForeignKey("EmailNewsletterIssueId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; - - [ForeignKey("EmailSiteId")] - [InverseProperty("NewsletterEmails")] - public virtual CmsSite EmailSite { get; set; } = null!; - - [ForeignKey("EmailSubscriberId")] - [InverseProperty("NewsletterEmails")] - public virtual NewsletterSubscriber? EmailSubscriber { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_Emails")] +[Index("EmailGuid", Name = "IX_Newsletter_Emails_EmailGUID", IsUnique = true)] +[Index("EmailNewsletterIssueId", Name = "IX_Newsletter_Emails_EmailNewsletterIssueID")] +[Index("EmailSending", Name = "IX_Newsletter_Emails_EmailSending")] +[Index("EmailSiteId", Name = "IX_Newsletter_Emails_EmailSiteID")] +[Index("EmailSubscriberId", Name = "IX_Newsletter_Emails_EmailSubscriberID")] +public class NewsletterEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [Column("EmailNewsletterIssueID")] + public int EmailNewsletterIssueId { get; set; } + + [Column("EmailSubscriberID")] + public int? EmailSubscriberId { get; set; } + + [Column("EmailSiteID")] + public int EmailSiteId { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + public bool? EmailSending { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + [Column("EmailContactID")] + public int? EmailContactId { get; set; } + + [StringLength(254)] + public string? EmailAddress { get; set; } + + [ForeignKey("EmailNewsletterIssueId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterNewsletterIssue EmailNewsletterIssue { get; set; } = null!; + + [ForeignKey("EmailSiteId")] + [InverseProperty("NewsletterEmails")] + public virtual CmsSite EmailSite { get; set; } = null!; + + [ForeignKey("EmailSubscriberId")] + [InverseProperty("NewsletterEmails")] + public virtual NewsletterSubscriber? EmailSubscriber { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs index 3ec9898f..221ccc0c 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterEmailTemplate.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_EmailTemplate")] -[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] -public partial class NewsletterEmailTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - [StringLength(250)] - public string TemplateName { get; set; } = null!; - - [Column("TemplateSiteID")] - public int TemplateSiteId { get; set; } - - [StringLength(50)] - public string TemplateType { get; set; } = null!; - - [Column("TemplateGUID")] - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } - - [StringLength(450)] - public string? TemplateSubject { get; set; } - - [Column("TemplateThumbnailGUID")] - public Guid? TemplateThumbnailGuid { get; set; } - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateCode { get; set; } - - [Column("TemplateInlineCSS")] - public bool TemplateInlineCss { get; set; } - - [InverseProperty("Template")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); - - [InverseProperty("IssueTemplate")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [InverseProperty("NewsletterOptInTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); - - [InverseProperty("NewsletterUnsubscriptionTemplate")] - public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); - - [ForeignKey("TemplateSiteId")] - [InverseProperty("NewsletterEmailTemplates")] - public virtual CmsSite TemplateSite { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("Templates")] - public virtual ICollection Newsletters { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_EmailTemplate")] +[Index("TemplateSiteId", "TemplateName", Name = "IX_Newsletter_EmailTemplate_TemplateSiteID_TemplateName", IsUnique = true)] +public class NewsletterEmailTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + [StringLength(250)] + public string TemplateName { get; set; } = null!; + + [Column("TemplateSiteID")] + public int TemplateSiteId { get; set; } + + [StringLength(50)] + public string TemplateType { get; set; } = null!; + + [Column("TemplateGUID")] + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } + + [StringLength(450)] + public string? TemplateSubject { get; set; } + + [Column("TemplateThumbnailGUID")] + public Guid? TemplateThumbnailGuid { get; set; } + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateCode { get; set; } + + [Column("TemplateInlineCSS")] + public bool TemplateInlineCss { get; set; } + + [InverseProperty("Template")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); + + [InverseProperty("IssueTemplate")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [InverseProperty("NewsletterOptInTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterOptInTemplates { get; set; } = new List(); + + [InverseProperty("NewsletterUnsubscriptionTemplate")] + public virtual ICollection NewsletterNewsletterNewsletterUnsubscriptionTemplates { get; set; } = new List(); + + [ForeignKey("TemplateSiteId")] + [InverseProperty("NewsletterEmailTemplates")] + public virtual CmsSite TemplateSite { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("Templates")] + public virtual ICollection Newsletters { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs index f44ddf43..42213b05 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterEmailWidget.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_EmailWidget")] -[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] -public partial class NewsletterEmailWidget -{ - [Key] - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - public Guid EmailWidgetGuid { get; set; } - - public DateTime EmailWidgetLastModified { get; set; } - - [StringLength(250)] - public string EmailWidgetDisplayName { get; set; } = null!; - - [StringLength(250)] - public string EmailWidgetName { get; set; } = null!; - - public string? EmailWidgetDescription { get; set; } - - public string? EmailWidgetCode { get; set; } - - [Column("EmailWidgetSiteID")] - public int EmailWidgetSiteId { get; set; } - - [Column("EmailWidgetThumbnailGUID")] - public Guid? EmailWidgetThumbnailGuid { get; set; } - - [StringLength(200)] - public string? EmailWidgetIconCssClass { get; set; } - - public string? EmailWidgetProperties { get; set; } - - [ForeignKey("EmailWidgetSiteId")] - [InverseProperty("NewsletterEmailWidgets")] - public virtual CmsSite EmailWidgetSite { get; set; } = null!; - - [InverseProperty("EmailWidget")] - public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_EmailWidget")] +[Index("EmailWidgetSiteId", Name = "IX_Newsletter_EmailWidget_EmailWidgetSiteID")] +public class NewsletterEmailWidget +{ + [Key] + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + public Guid EmailWidgetGuid { get; set; } + + public DateTime EmailWidgetLastModified { get; set; } + + [StringLength(250)] + public string EmailWidgetDisplayName { get; set; } = null!; + + [StringLength(250)] + public string EmailWidgetName { get; set; } = null!; + + public string? EmailWidgetDescription { get; set; } + + public string? EmailWidgetCode { get; set; } + + [Column("EmailWidgetSiteID")] + public int EmailWidgetSiteId { get; set; } + + [Column("EmailWidgetThumbnailGUID")] + public Guid? EmailWidgetThumbnailGuid { get; set; } + + [StringLength(200)] + public string? EmailWidgetIconCssClass { get; set; } + + public string? EmailWidgetProperties { get; set; } + + [ForeignKey("EmailWidgetSiteId")] + [InverseProperty("NewsletterEmailWidgets")] + public virtual CmsSite EmailWidgetSite { get; set; } = null!; + + [InverseProperty("EmailWidget")] + public virtual ICollection NewsletterEmailWidgetTemplates { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs b/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs index 77a9ae14..05f97bd6 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterEmailWidgetTemplate.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_EmailWidgetTemplate")] -[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] -[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] -public partial class NewsletterEmailWidgetTemplate -{ - [Key] - [Column("EmailWidgetTemplateID")] - public int EmailWidgetTemplateId { get; set; } - - [Column("EmailWidgetID")] - public int EmailWidgetId { get; set; } - - [Column("TemplateID")] - public int TemplateId { get; set; } - - [ForeignKey("EmailWidgetId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; - - [ForeignKey("TemplateId")] - [InverseProperty("NewsletterEmailWidgetTemplates")] - public virtual NewsletterEmailTemplate Template { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_EmailWidgetTemplate")] +[Index("EmailWidgetId", Name = "IX_Newsletter_EmailWidgetTemplate_EmailWidgetID")] +[Index("TemplateId", Name = "IX_Newsletter_EmailWidgetTemplate_TemplateID")] +public class NewsletterEmailWidgetTemplate +{ + [Key] + [Column("EmailWidgetTemplateID")] + public int EmailWidgetTemplateId { get; set; } + + [Column("EmailWidgetID")] + public int EmailWidgetId { get; set; } + + [Column("TemplateID")] + public int TemplateId { get; set; } + + [ForeignKey("EmailWidgetId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailWidget EmailWidget { get; set; } = null!; + + [ForeignKey("TemplateId")] + [InverseProperty("NewsletterEmailWidgetTemplates")] + public virtual NewsletterEmailTemplate Template { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs b/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs index 05564615..4c9fe19b 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterIssueContactGroup.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_IssueContactGroup")] -[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] -public partial class NewsletterIssueContactGroup -{ - [Key] - [Column("IssueContactGroupID")] - public int IssueContactGroupId { get; set; } - - [Column("IssueID")] - public int IssueId { get; set; } - - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [ForeignKey("ContactGroupId")] - [InverseProperty("NewsletterIssueContactGroups")] - public virtual OmContactGroup ContactGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_IssueContactGroup")] +[Index("ContactGroupId", Name = "IX_Newsletter_IssueContactGroup_ContactGroupID")] +public class NewsletterIssueContactGroup +{ + [Key] + [Column("IssueContactGroupID")] + public int IssueContactGroupId { get; set; } + + [Column("IssueID")] + public int IssueId { get; set; } + + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [ForeignKey("ContactGroupId")] + [InverseProperty("NewsletterIssueContactGroups")] + public virtual OmContactGroup ContactGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterLink.cs b/Migration.Toolkit.KX13/Models/NewsletterLink.cs index 8478afa5..f70d9e39 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterLink.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterLink.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Link")] -[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] -public partial class NewsletterLink -{ - [Key] - [Column("LinkID")] - public int LinkId { get; set; } - - [Column("LinkIssueID")] - public int LinkIssueId { get; set; } - - public string LinkTarget { get; set; } = null!; - - [StringLength(450)] - public string LinkDescription { get; set; } = null!; - - [Column("LinkGUID")] - public Guid LinkGuid { get; set; } - - [ForeignKey("LinkIssueId")] - [InverseProperty("NewsletterLinks")] - public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; - - [InverseProperty("ClickedLinkNewsletterLink")] - public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_Link")] +[Index("LinkIssueId", Name = "IX_Newsletter_Link_LinkIssueID")] +public class NewsletterLink +{ + [Key] + [Column("LinkID")] + public int LinkId { get; set; } + + [Column("LinkIssueID")] + public int LinkIssueId { get; set; } + + public string LinkTarget { get; set; } = null!; + + [StringLength(450)] + public string LinkDescription { get; set; } = null!; + + [Column("LinkGUID")] + public Guid LinkGuid { get; set; } + + [ForeignKey("LinkIssueId")] + [InverseProperty("NewsletterLinks")] + public virtual NewsletterNewsletterIssue LinkIssue { get; set; } = null!; + + [InverseProperty("ClickedLinkNewsletterLink")] + public virtual ICollection NewsletterClickedLinks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs b/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs index 8ce94ee3..a341d59a 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterNewsletter.cs @@ -1,116 +1,115 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Newsletter")] -[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] -[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] -[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] -[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] -[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] -public partial class NewsletterNewsletter -{ - [Key] - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [StringLength(250)] - public string NewsletterName { get; set; } = null!; - - [Column("NewsletterSubscriptionTemplateID")] - public int? NewsletterSubscriptionTemplateId { get; set; } - - [Column("NewsletterUnsubscriptionTemplateID")] - public int NewsletterUnsubscriptionTemplateId { get; set; } - - [StringLength(200)] - public string NewsletterSenderName { get; set; } = null!; - - [StringLength(254)] - public string NewsletterSenderEmail { get; set; } = null!; - - [StringLength(100)] - public string? NewsletterDynamicSubject { get; set; } - - [Column("NewsletterDynamicURL")] - [StringLength(500)] - public string? NewsletterDynamicUrl { get; set; } - - [Column("NewsletterDynamicScheduledTaskID")] - public int? NewsletterDynamicScheduledTaskId { get; set; } - - [Column("NewsletterSiteID")] - public int NewsletterSiteId { get; set; } - - [Column("NewsletterGUID")] - public Guid NewsletterGuid { get; set; } - - [StringLength(1000)] - public string? NewsletterUnsubscribeUrl { get; set; } - - [StringLength(500)] - public string? NewsletterBaseUrl { get; set; } - - public DateTime NewsletterLastModified { get; set; } - - public bool? NewsletterEnableOptIn { get; set; } - - [Column("NewsletterOptInTemplateID")] - public int? NewsletterOptInTemplateId { get; set; } - - public bool? NewsletterSendOptInConfirmation { get; set; } - - [Column("NewsletterOptInApprovalURL")] - [StringLength(450)] - public string? NewsletterOptInApprovalUrl { get; set; } - - public bool? NewsletterTrackOpenEmails { get; set; } - - public bool? NewsletterTrackClickedLinks { get; set; } - - [StringLength(998)] - public string? NewsletterDraftEmails { get; set; } - - public bool? NewsletterLogActivity { get; set; } - - [StringLength(5)] - public string NewsletterSource { get; set; } = null!; - - public int NewsletterType { get; set; } - - [ForeignKey("NewsletterDynamicScheduledTaskId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } - - [InverseProperty("IssueNewsletter")] - public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); - - [ForeignKey("NewsletterOptInTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] - public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } - - [ForeignKey("NewsletterSiteId")] - [InverseProperty("NewsletterNewsletters")] - public virtual CmsSite NewsletterSite { get; set; } = null!; - - [InverseProperty("Newsletter")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("NewsletterUnsubscriptionTemplateId")] - [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] - public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; - - [InverseProperty("UnsubscriptionNewsletter")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); - - [ForeignKey("NewsletterId")] - [InverseProperty("Newsletters")] - public virtual ICollection Templates { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_Newsletter")] +[Index("NewsletterDynamicScheduledTaskId", Name = "IX_Newsletter_Newsletter_NewsletterDynamicScheduledTaskID")] +[Index("NewsletterOptInTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterOptInTemplateID")] +[Index("NewsletterSiteId", "NewsletterName", Name = "IX_Newsletter_Newsletter_NewsletterSiteID_NewsletterName", IsUnique = true)] +[Index("NewsletterSubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterSubscriptionTemplateID")] +[Index("NewsletterUnsubscriptionTemplateId", Name = "IX_Newsletter_Newsletter_NewsletterUnsubscriptionTemplateID")] +public class NewsletterNewsletter +{ + [Key] + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [StringLength(250)] + public string NewsletterName { get; set; } = null!; + + [Column("NewsletterSubscriptionTemplateID")] + public int? NewsletterSubscriptionTemplateId { get; set; } + + [Column("NewsletterUnsubscriptionTemplateID")] + public int NewsletterUnsubscriptionTemplateId { get; set; } + + [StringLength(200)] + public string NewsletterSenderName { get; set; } = null!; + + [StringLength(254)] + public string NewsletterSenderEmail { get; set; } = null!; + + [StringLength(100)] + public string? NewsletterDynamicSubject { get; set; } + + [Column("NewsletterDynamicURL")] + [StringLength(500)] + public string? NewsletterDynamicUrl { get; set; } + + [Column("NewsletterDynamicScheduledTaskID")] + public int? NewsletterDynamicScheduledTaskId { get; set; } + + [Column("NewsletterSiteID")] + public int NewsletterSiteId { get; set; } + + [Column("NewsletterGUID")] + public Guid NewsletterGuid { get; set; } + + [StringLength(1000)] + public string? NewsletterUnsubscribeUrl { get; set; } + + [StringLength(500)] + public string? NewsletterBaseUrl { get; set; } + + public DateTime NewsletterLastModified { get; set; } + + public bool? NewsletterEnableOptIn { get; set; } + + [Column("NewsletterOptInTemplateID")] + public int? NewsletterOptInTemplateId { get; set; } + + public bool? NewsletterSendOptInConfirmation { get; set; } + + [Column("NewsletterOptInApprovalURL")] + [StringLength(450)] + public string? NewsletterOptInApprovalUrl { get; set; } + + public bool? NewsletterTrackOpenEmails { get; set; } + + public bool? NewsletterTrackClickedLinks { get; set; } + + [StringLength(998)] + public string? NewsletterDraftEmails { get; set; } + + public bool? NewsletterLogActivity { get; set; } + + [StringLength(5)] + public string NewsletterSource { get; set; } = null!; + + public int NewsletterType { get; set; } + + [ForeignKey("NewsletterDynamicScheduledTaskId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsScheduledTask? NewsletterDynamicScheduledTask { get; set; } + + [InverseProperty("IssueNewsletter")] + public virtual ICollection NewsletterNewsletterIssues { get; set; } = new List(); + + [ForeignKey("NewsletterOptInTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterOptInTemplates")] + public virtual NewsletterEmailTemplate? NewsletterOptInTemplate { get; set; } + + [ForeignKey("NewsletterSiteId")] + [InverseProperty("NewsletterNewsletters")] + public virtual CmsSite NewsletterSite { get; set; } = null!; + + [InverseProperty("Newsletter")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("NewsletterUnsubscriptionTemplateId")] + [InverseProperty("NewsletterNewsletterNewsletterUnsubscriptionTemplates")] + public virtual NewsletterEmailTemplate NewsletterUnsubscriptionTemplate { get; set; } = null!; + + [InverseProperty("UnsubscriptionNewsletter")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); + + [ForeignKey("NewsletterId")] + [InverseProperty("Newsletters")] + public virtual ICollection Templates { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs b/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs index 05fd5872..4de3934c 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterNewsletterIssue.cs @@ -1,128 +1,127 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_NewsletterIssue")] -[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] -[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] -[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] -[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] -[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] -public partial class NewsletterNewsletterIssue -{ - [Key] - [Column("IssueID")] - public int IssueId { get; set; } - - [StringLength(450)] - public string IssueSubject { get; set; } = null!; - - public string IssueText { get; set; } = null!; - - public int IssueUnsubscribed { get; set; } - - [Column("IssueNewsletterID")] - public int IssueNewsletterId { get; set; } - - [Column("IssueTemplateID")] - public int? IssueTemplateId { get; set; } - - public int IssueSentEmails { get; set; } - - public DateTime? IssueMailoutTime { get; set; } - - [Column("IssueGUID")] - public Guid IssueGuid { get; set; } - - public DateTime IssueLastModified { get; set; } - - [Column("IssueSiteID")] - public int IssueSiteId { get; set; } - - public int? IssueOpenedEmails { get; set; } - - public int? IssueBounces { get; set; } - - public int? IssueStatus { get; set; } - - [Column("IssueIsABTest")] - public bool? IssueIsAbtest { get; set; } - - [Column("IssueVariantOfIssueID")] - public int? IssueVariantOfIssueId { get; set; } - - [StringLength(200)] - public string? IssueVariantName { get; set; } - - [StringLength(200)] - public string? IssueSenderName { get; set; } - - [StringLength(254)] - public string? IssueSenderEmail { get; set; } - - [Column("IssueScheduledTaskID")] - public int? IssueScheduledTaskId { get; set; } - - [Column("IssueUTMSource")] - [StringLength(200)] - public string? IssueUtmsource { get; set; } - - [Column("IssueUseUTM")] - public bool IssueUseUtm { get; set; } - - [Column("IssueUTMCampaign")] - [StringLength(200)] - public string? IssueUtmcampaign { get; set; } - - [StringLength(200)] - public string IssueDisplayName { get; set; } = null!; - - public string? IssueWidgets { get; set; } - - public string? IssuePreheader { get; set; } - - public string? IssuePlainText { get; set; } - - public bool IssueForAutomation { get; set; } - - [InverseProperty("IssueVariantOfIssue")] - public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); - - [ForeignKey("IssueNewsletterId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; - - [ForeignKey("IssueSiteId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual CmsSite IssueSite { get; set; } = null!; - - [ForeignKey("IssueTemplateId")] - [InverseProperty("NewsletterNewsletterIssues")] - public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } - - [ForeignKey("IssueVariantOfIssueId")] - [InverseProperty("InverseIssueVariantOfIssue")] - public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } - - [InverseProperty("TestIssue")] - public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } - - [InverseProperty("TestWinnerIssue")] - public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); - - [InverseProperty("EmailNewsletterIssue")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("LinkIssue")] - public virtual ICollection NewsletterLinks { get; set; } = new List(); - - [InverseProperty("OpenedEmailIssue")] - public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); - - [InverseProperty("UnsubscriptionFromIssue")] - public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_NewsletterIssue")] +[Index("IssueNewsletterId", Name = "IX_Newsletter_NewsletterIssue_IssueNewsletterID")] +[Index("IssueScheduledTaskId", Name = "IX_Newsletter_NewsletterIssue_IssueScheduledTaskID")] +[Index("IssueSiteId", Name = "IX_Newsletter_NewsletterIssue_IssueSiteID")] +[Index("IssueTemplateId", Name = "IX_Newsletter_NewsletterIssue_IssueTemplateID")] +[Index("IssueVariantOfIssueId", Name = "IX_Newsletter_NewsletterIssue_IssueVariantOfIssueID")] +public class NewsletterNewsletterIssue +{ + [Key] + [Column("IssueID")] + public int IssueId { get; set; } + + [StringLength(450)] + public string IssueSubject { get; set; } = null!; + + public string IssueText { get; set; } = null!; + + public int IssueUnsubscribed { get; set; } + + [Column("IssueNewsletterID")] + public int IssueNewsletterId { get; set; } + + [Column("IssueTemplateID")] + public int? IssueTemplateId { get; set; } + + public int IssueSentEmails { get; set; } + + public DateTime? IssueMailoutTime { get; set; } + + [Column("IssueGUID")] + public Guid IssueGuid { get; set; } + + public DateTime IssueLastModified { get; set; } + + [Column("IssueSiteID")] + public int IssueSiteId { get; set; } + + public int? IssueOpenedEmails { get; set; } + + public int? IssueBounces { get; set; } + + public int? IssueStatus { get; set; } + + [Column("IssueIsABTest")] + public bool? IssueIsAbtest { get; set; } + + [Column("IssueVariantOfIssueID")] + public int? IssueVariantOfIssueId { get; set; } + + [StringLength(200)] + public string? IssueVariantName { get; set; } + + [StringLength(200)] + public string? IssueSenderName { get; set; } + + [StringLength(254)] + public string? IssueSenderEmail { get; set; } + + [Column("IssueScheduledTaskID")] + public int? IssueScheduledTaskId { get; set; } + + [Column("IssueUTMSource")] + [StringLength(200)] + public string? IssueUtmsource { get; set; } + + [Column("IssueUseUTM")] + public bool IssueUseUtm { get; set; } + + [Column("IssueUTMCampaign")] + [StringLength(200)] + public string? IssueUtmcampaign { get; set; } + + [StringLength(200)] + public string IssueDisplayName { get; set; } = null!; + + public string? IssueWidgets { get; set; } + + public string? IssuePreheader { get; set; } + + public string? IssuePlainText { get; set; } + + public bool IssueForAutomation { get; set; } + + [InverseProperty("IssueVariantOfIssue")] + public virtual ICollection InverseIssueVariantOfIssue { get; set; } = new List(); + + [ForeignKey("IssueNewsletterId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterNewsletter IssueNewsletter { get; set; } = null!; + + [ForeignKey("IssueSiteId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual CmsSite IssueSite { get; set; } = null!; + + [ForeignKey("IssueTemplateId")] + [InverseProperty("NewsletterNewsletterIssues")] + public virtual NewsletterEmailTemplate? IssueTemplate { get; set; } + + [ForeignKey("IssueVariantOfIssueId")] + [InverseProperty("InverseIssueVariantOfIssue")] + public virtual NewsletterNewsletterIssue? IssueVariantOfIssue { get; set; } + + [InverseProperty("TestIssue")] + public virtual NewsletterAbtest? NewsletterAbtestTestIssue { get; set; } + + [InverseProperty("TestWinnerIssue")] + public virtual ICollection NewsletterAbtestTestWinnerIssues { get; set; } = new List(); + + [InverseProperty("EmailNewsletterIssue")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("LinkIssue")] + public virtual ICollection NewsletterLinks { get; set; } = new List(); + + [InverseProperty("OpenedEmailIssue")] + public virtual ICollection NewsletterOpenedEmails { get; set; } = new List(); + + [InverseProperty("UnsubscriptionFromIssue")] + public virtual ICollection NewsletterUnsubscriptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs b/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs index 295c30be..f451d949 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterOpenedEmail.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_OpenedEmail")] -[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] -public partial class NewsletterOpenedEmail -{ - [Key] - [Column("OpenedEmailID")] - public int OpenedEmailId { get; set; } - - [StringLength(254)] - public string OpenedEmailEmail { get; set; } = null!; - - public Guid OpenedEmailGuid { get; set; } - - public DateTime? OpenedEmailTime { get; set; } - - [Column("OpenedEmailIssueID")] - public int OpenedEmailIssueId { get; set; } - - [ForeignKey("OpenedEmailIssueId")] - [InverseProperty("NewsletterOpenedEmails")] - public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_OpenedEmail")] +[Index("OpenedEmailIssueId", Name = "IX_Newsletter_OpenedEmail_OpenedEmailIssueID")] +public class NewsletterOpenedEmail +{ + [Key] + [Column("OpenedEmailID")] + public int OpenedEmailId { get; set; } + + [StringLength(254)] + public string OpenedEmailEmail { get; set; } = null!; + + public Guid OpenedEmailGuid { get; set; } + + public DateTime? OpenedEmailTime { get; set; } + + [Column("OpenedEmailIssueID")] + public int OpenedEmailIssueId { get; set; } + + [ForeignKey("OpenedEmailIssueId")] + [InverseProperty("NewsletterOpenedEmails")] + public virtual NewsletterNewsletterIssue OpenedEmailIssue { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs b/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs index 6ac7ad27..5084ef2b 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterSubscriber.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Subscriber")] -[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] -[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] -public partial class NewsletterSubscriber -{ - [Key] - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - [StringLength(200)] - public string? SubscriberFirstName { get; set; } - - [StringLength(200)] - public string? SubscriberLastName { get; set; } - - [Column("SubscriberSiteID")] - public int SubscriberSiteId { get; set; } - - [Column("SubscriberGUID")] - public Guid SubscriberGuid { get; set; } - - public string? SubscriberCustomData { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - public DateTime SubscriberLastModified { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - public int? SubscriberBounces { get; set; } - - [InverseProperty("EmailSubscriber")] - public virtual ICollection NewsletterEmails { get; set; } = new List(); - - [InverseProperty("Subscriber")] - public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); - - [ForeignKey("SubscriberSiteId")] - [InverseProperty("NewsletterSubscribers")] - public virtual CmsSite SubscriberSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_Subscriber")] +[Index("SubscriberEmail", Name = "IX_Newsletter_Subscriber_SubscriberEmail")] +[Index("SubscriberType", "SubscriberRelatedId", Name = "IX_Newsletter_Subscriber_SubscriberType_SubscriberRelatedID")] +public class NewsletterSubscriber +{ + [Key] + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + [StringLength(200)] + public string? SubscriberFirstName { get; set; } + + [StringLength(200)] + public string? SubscriberLastName { get; set; } + + [Column("SubscriberSiteID")] + public int SubscriberSiteId { get; set; } + + [Column("SubscriberGUID")] + public Guid SubscriberGuid { get; set; } + + public string? SubscriberCustomData { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + public DateTime SubscriberLastModified { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + public int? SubscriberBounces { get; set; } + + [InverseProperty("EmailSubscriber")] + public virtual ICollection NewsletterEmails { get; set; } = new List(); + + [InverseProperty("Subscriber")] + public virtual ICollection NewsletterSubscriberNewsletters { get; set; } = new List(); + + [ForeignKey("SubscriberSiteId")] + [InverseProperty("NewsletterSubscribers")] + public virtual CmsSite SubscriberSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs b/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs index e0d4a830..7bf93904 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterSubscriberNewsletter.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_SubscriberNewsletter")] -[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] -[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] -public partial class NewsletterSubscriberNewsletter -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - public DateTime SubscribedWhen { get; set; } - - public bool? SubscriptionApproved { get; set; } - - public DateTime? SubscriptionApprovedWhen { get; set; } - - [StringLength(100)] - public string? SubscriptionApprovalHash { get; set; } - - [Key] - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } - - [ForeignKey("NewsletterId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterNewsletter Newsletter { get; set; } = null!; - - [ForeignKey("SubscriberId")] - [InverseProperty("NewsletterSubscriberNewsletters")] - public virtual NewsletterSubscriber Subscriber { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_SubscriberNewsletter")] +[Index("NewsletterId", "SubscriptionApproved", Name = "IX_Newsletter_SubscriberNewsletter_NewsletterID_SubscriptionApproved")] +[Index("SubscriberId", "NewsletterId", Name = "UQ_Newsletter_SubscriberNewsletter", IsUnique = true)] +public class NewsletterSubscriberNewsletter +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + public DateTime SubscribedWhen { get; set; } + + public bool? SubscriptionApproved { get; set; } + + public DateTime? SubscriptionApprovedWhen { get; set; } + + [StringLength(100)] + public string? SubscriptionApprovalHash { get; set; } + + [Key] + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } + + [ForeignKey("NewsletterId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterNewsletter Newsletter { get; set; } = null!; + + [ForeignKey("SubscriberId")] + [InverseProperty("NewsletterSubscriberNewsletters")] + public virtual NewsletterSubscriber Subscriber { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs b/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs index 0df0e616..6ae293e0 100644 --- a/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs +++ b/Migration.Toolkit.KX13/Models/NewsletterUnsubscription.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Newsletter_Unsubscription")] -[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] -[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] -[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] -public partial class NewsletterUnsubscription -{ - [Key] - [Column("UnsubscriptionID")] - public int UnsubscriptionId { get; set; } - - [StringLength(254)] - public string UnsubscriptionEmail { get; set; } = null!; - - public DateTime UnsubscriptionCreated { get; set; } - - [Column("UnsubscriptionNewsletterID")] - public int? UnsubscriptionNewsletterId { get; set; } - - [Column("UnsubscriptionFromIssueID")] - public int? UnsubscriptionFromIssueId { get; set; } - - [Column("UnsubscriptionGUID")] - public Guid UnsubscriptionGuid { get; set; } - - [ForeignKey("UnsubscriptionFromIssueId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } - - [ForeignKey("UnsubscriptionNewsletterId")] - [InverseProperty("NewsletterUnsubscriptions")] - public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Newsletter_Unsubscription")] +[Index("UnsubscriptionEmail", "UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_Email_NewsletterID")] +[Index("UnsubscriptionNewsletterId", Name = "IX_Newsletter_Unsubscription_NewsletterID")] +[Index("UnsubscriptionFromIssueId", Name = "IX_Newsletter_Unsubscription_UnsubscriptionFromIssueID")] +public class NewsletterUnsubscription +{ + [Key] + [Column("UnsubscriptionID")] + public int UnsubscriptionId { get; set; } + + [StringLength(254)] + public string UnsubscriptionEmail { get; set; } = null!; + + public DateTime UnsubscriptionCreated { get; set; } + + [Column("UnsubscriptionNewsletterID")] + public int? UnsubscriptionNewsletterId { get; set; } + + [Column("UnsubscriptionFromIssueID")] + public int? UnsubscriptionFromIssueId { get; set; } + + [Column("UnsubscriptionGUID")] + public Guid UnsubscriptionGuid { get; set; } + + [ForeignKey("UnsubscriptionFromIssueId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletterIssue? UnsubscriptionFromIssue { get; set; } + + [ForeignKey("UnsubscriptionNewsletterId")] + [InverseProperty("NewsletterUnsubscriptions")] + public virtual NewsletterNewsletter? UnsubscriptionNewsletter { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/OmAbtest.cs b/Migration.Toolkit.KX13/Models/OmAbtest.cs index 1d9c342e..ca40d2e7 100644 --- a/Migration.Toolkit.KX13/Models/OmAbtest.cs +++ b/Migration.Toolkit.KX13/Models/OmAbtest.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ABTest")] -[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] -public partial class OmAbtest -{ - [Key] - [Column("ABTestID")] - public int AbtestId { get; set; } - - [Column("ABTestName")] - [StringLength(50)] - public string AbtestName { get; set; } = null!; - - [Column("ABTestDescription")] - public string? AbtestDescription { get; set; } - - [Column("ABTestCulture")] - [StringLength(50)] - public string? AbtestCulture { get; set; } - - [Column("ABTestOriginalPage")] - [StringLength(450)] - public string AbtestOriginalPage { get; set; } = null!; - - [Column("ABTestOpenFrom")] - public DateTime? AbtestOpenFrom { get; set; } - - [Column("ABTestOpenTo")] - public DateTime? AbtestOpenTo { get; set; } - - [Column("ABTestSiteID")] - public int AbtestSiteId { get; set; } - - [Column("ABTestGUID")] - public Guid AbtestGuid { get; set; } - - [Column("ABTestLastModified")] - public DateTime AbtestLastModified { get; set; } - - [Column("ABTestDisplayName")] - [StringLength(100)] - public string AbtestDisplayName { get; set; } = null!; - - [Column("ABTestIncludedTraffic")] - public int AbtestIncludedTraffic { get; set; } - - [Column("ABTestVisitorTargeting")] - public string? AbtestVisitorTargeting { get; set; } - - [Column("ABTestConversions")] - public string? AbtestConversions { get; set; } - - [Column("ABTestWinnerGUID")] - public Guid? AbtestWinnerGuid { get; set; } - - [ForeignKey("AbtestSiteId")] - [InverseProperty("OmAbtests")] - public virtual CmsSite AbtestSite { get; set; } = null!; - - [InverseProperty("AbvariantTest")] - public virtual ICollection OmAbvariantData { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ABTest")] +[Index("AbtestSiteId", Name = "IX_OM_ABTest_SiteID")] +public class OmAbtest +{ + [Key] + [Column("ABTestID")] + public int AbtestId { get; set; } + + [Column("ABTestName")] + [StringLength(50)] + public string AbtestName { get; set; } = null!; + + [Column("ABTestDescription")] + public string? AbtestDescription { get; set; } + + [Column("ABTestCulture")] + [StringLength(50)] + public string? AbtestCulture { get; set; } + + [Column("ABTestOriginalPage")] + [StringLength(450)] + public string AbtestOriginalPage { get; set; } = null!; + + [Column("ABTestOpenFrom")] + public DateTime? AbtestOpenFrom { get; set; } + + [Column("ABTestOpenTo")] + public DateTime? AbtestOpenTo { get; set; } + + [Column("ABTestSiteID")] + public int AbtestSiteId { get; set; } + + [Column("ABTestGUID")] + public Guid AbtestGuid { get; set; } + + [Column("ABTestLastModified")] + public DateTime AbtestLastModified { get; set; } + + [Column("ABTestDisplayName")] + [StringLength(100)] + public string AbtestDisplayName { get; set; } = null!; + + [Column("ABTestIncludedTraffic")] + public int AbtestIncludedTraffic { get; set; } + + [Column("ABTestVisitorTargeting")] + public string? AbtestVisitorTargeting { get; set; } + + [Column("ABTestConversions")] + public string? AbtestConversions { get; set; } + + [Column("ABTestWinnerGUID")] + public Guid? AbtestWinnerGuid { get; set; } + + [ForeignKey("AbtestSiteId")] + [InverseProperty("OmAbtests")] + public virtual CmsSite AbtestSite { get; set; } = null!; + + [InverseProperty("AbvariantTest")] + public virtual ICollection OmAbvariantData { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs b/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs index a2050260..3987b1ba 100644 --- a/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs +++ b/Migration.Toolkit.KX13/Models/OmAbvariantDatum.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ABVariantData")] -[Index("AbvariantTestId", "AbvariantGuid", Name = "IX_OM_ABVariantData_ABVariantTestID_ABVariantGUID")] -public partial class OmAbvariantDatum -{ - [Key] - [Column("ABVariantID")] - public int AbvariantId { get; set; } - - [Column("ABVariantDisplayName")] - [StringLength(100)] - public string AbvariantDisplayName { get; set; } = null!; - - [Column("ABVariantGUID")] - public Guid AbvariantGuid { get; set; } - - [Column("ABVariantTestID")] - public int AbvariantTestId { get; set; } - - [Column("ABVariantIsOriginal")] - public bool AbvariantIsOriginal { get; set; } - - [ForeignKey("AbvariantTestId")] - [InverseProperty("OmAbvariantData")] - public virtual OmAbtest AbvariantTest { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ABVariantData")] +[Index("AbvariantTestId", "AbvariantGuid", Name = "IX_OM_ABVariantData_ABVariantTestID_ABVariantGUID")] +public class OmAbvariantDatum +{ + [Key] + [Column("ABVariantID")] + public int AbvariantId { get; set; } + + [Column("ABVariantDisplayName")] + [StringLength(100)] + public string AbvariantDisplayName { get; set; } = null!; + + [Column("ABVariantGUID")] + public Guid AbvariantGuid { get; set; } + + [Column("ABVariantTestID")] + public int AbvariantTestId { get; set; } + + [Column("ABVariantIsOriginal")] + public bool AbvariantIsOriginal { get; set; } + + [ForeignKey("AbvariantTestId")] + [InverseProperty("OmAbvariantData")] + public virtual OmAbtest AbvariantTest { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/OmAccount.cs b/Migration.Toolkit.KX13/Models/OmAccount.cs index b213c250..9fa3d49a 100644 --- a/Migration.Toolkit.KX13/Models/OmAccount.cs +++ b/Migration.Toolkit.KX13/Models/OmAccount.cs @@ -1,114 +1,113 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Account")] -[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] -[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] -[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] -[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] -[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] -[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] -[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] -public partial class OmAccount -{ - [Key] - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [ForeignKey("AccountCountryId")] - [InverseProperty("OmAccounts")] - public virtual CmsCountry? AccountCountry { get; set; } - - [ForeignKey("AccountOwnerUserId")] - [InverseProperty("OmAccounts")] - public virtual CmsUser? AccountOwnerUser { get; set; } - - [ForeignKey("AccountPrimaryContactId")] - [InverseProperty("OmAccountAccountPrimaryContacts")] - public virtual OmContact? AccountPrimaryContact { get; set; } - - [ForeignKey("AccountSecondaryContactId")] - [InverseProperty("OmAccountAccountSecondaryContacts")] - public virtual OmContact? AccountSecondaryContact { get; set; } - - [ForeignKey("AccountStateId")] - [InverseProperty("OmAccounts")] - public virtual CmsState? AccountState { get; set; } - - [ForeignKey("AccountStatusId")] - [InverseProperty("OmAccounts")] - public virtual OmAccountStatus? AccountStatus { get; set; } - - [ForeignKey("AccountSubsidiaryOfId")] - [InverseProperty("InverseAccountSubsidiaryOf")] - public virtual OmAccount? AccountSubsidiaryOf { get; set; } - - [InverseProperty("AccountSubsidiaryOf")] - public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); - - [InverseProperty("Account")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_Account")] +[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] +[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] +[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] +[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] +[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] +[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] +[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] +public class OmAccount +{ + [Key] + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [ForeignKey("AccountCountryId")] + [InverseProperty("OmAccounts")] + public virtual CmsCountry? AccountCountry { get; set; } + + [ForeignKey("AccountOwnerUserId")] + [InverseProperty("OmAccounts")] + public virtual CmsUser? AccountOwnerUser { get; set; } + + [ForeignKey("AccountPrimaryContactId")] + [InverseProperty("OmAccountAccountPrimaryContacts")] + public virtual OmContact? AccountPrimaryContact { get; set; } + + [ForeignKey("AccountSecondaryContactId")] + [InverseProperty("OmAccountAccountSecondaryContacts")] + public virtual OmContact? AccountSecondaryContact { get; set; } + + [ForeignKey("AccountStateId")] + [InverseProperty("OmAccounts")] + public virtual CmsState? AccountState { get; set; } + + [ForeignKey("AccountStatusId")] + [InverseProperty("OmAccounts")] + public virtual OmAccountStatus? AccountStatus { get; set; } + + [ForeignKey("AccountSubsidiaryOfId")] + [InverseProperty("InverseAccountSubsidiaryOf")] + public virtual OmAccount? AccountSubsidiaryOf { get; set; } + + [InverseProperty("AccountSubsidiaryOf")] + public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); + + [InverseProperty("Account")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/OmAccountContact.cs b/Migration.Toolkit.KX13/Models/OmAccountContact.cs index 1a858306..de62cc81 100644 --- a/Migration.Toolkit.KX13/Models/OmAccountContact.cs +++ b/Migration.Toolkit.KX13/Models/OmAccountContact.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_AccountContact")] -[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] -[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] -[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] -public partial class OmAccountContact -{ - [Key] - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("AccountId")] - [InverseProperty("OmAccountContacts")] - public virtual OmAccount Account { get; set; } = null!; - - [ForeignKey("ContactId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("ContactRoleId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContactRole? ContactRole { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_AccountContact")] +[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] +[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] +[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] +public class OmAccountContact +{ + [Key] + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("AccountId")] + [InverseProperty("OmAccountContacts")] + public virtual OmAccount Account { get; set; } = null!; + + [ForeignKey("ContactId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("ContactRoleId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContactRole? ContactRole { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/OmAccountStatus.cs b/Migration.Toolkit.KX13/Models/OmAccountStatus.cs index b1995d94..b4d27360 100644 --- a/Migration.Toolkit.KX13/Models/OmAccountStatus.cs +++ b/Migration.Toolkit.KX13/Models/OmAccountStatus.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_AccountStatus")] -public partial class OmAccountStatus -{ - [Key] - [Column("AccountStatusID")] - public int AccountStatusId { get; set; } - - [StringLength(200)] - public string AccountStatusName { get; set; } = null!; - - [StringLength(200)] - public string AccountStatusDisplayName { get; set; } = null!; - - public string? AccountStatusDescription { get; set; } - - [InverseProperty("AccountStatus")] - public virtual ICollection OmAccounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_AccountStatus")] +public class OmAccountStatus +{ + [Key] + [Column("AccountStatusID")] + public int AccountStatusId { get; set; } + + [StringLength(200)] + public string AccountStatusName { get; set; } = null!; + + [StringLength(200)] + public string AccountStatusDisplayName { get; set; } = null!; + + public string? AccountStatusDescription { get; set; } + + [InverseProperty("AccountStatus")] + public virtual ICollection OmAccounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/OmActivity.cs b/Migration.Toolkit.KX13/Models/OmActivity.cs index 7aca43ed..b7d2fcd9 100644 --- a/Migration.Toolkit.KX13/Models/OmActivity.cs +++ b/Migration.Toolkit.KX13/Models/OmActivity.cs @@ -1,75 +1,74 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Activity")] -[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] -[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] -[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] -[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] -[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] -public partial class OmActivity -{ - [Key] - [Column("ActivityID")] - public int ActivityId { get; set; } - - [Column("ActivityContactID")] - public int ActivityContactId { get; set; } - - public DateTime? ActivityCreated { get; set; } - - [StringLength(250)] - public string ActivityType { get; set; } = null!; - - [Column("ActivityItemID")] - public int? ActivityItemId { get; set; } - - [Column("ActivityItemDetailID")] - public int? ActivityItemDetailId { get; set; } - - [StringLength(250)] - public string? ActivityValue { get; set; } - - [Column("ActivityURL")] - public string? ActivityUrl { get; set; } - - [StringLength(250)] - public string? ActivityTitle { get; set; } - - [Column("ActivitySiteID")] - public int ActivitySiteId { get; set; } - - public string? ActivityComment { get; set; } - - [StringLength(200)] - public string? ActivityCampaign { get; set; } - - [Column("ActivityURLReferrer")] - public string? ActivityUrlreferrer { get; set; } - - [StringLength(50)] - public string? ActivityCulture { get; set; } - - [Column("ActivityNodeID")] - public int? ActivityNodeId { get; set; } - - [Column("ActivityUTMSource")] - [StringLength(200)] - public string? ActivityUtmsource { get; set; } - - [Column("ActivityABVariantName")] - [StringLength(200)] - public string? ActivityAbvariantName { get; set; } - - [Column("ActivityURLHash")] - public long ActivityUrlhash { get; set; } - - [Column("ActivityUTMContent")] - [StringLength(200)] - public string? ActivityUtmcontent { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_Activity")] +[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] +[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] +[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] +[Index("ActivitySiteId", Name = "IX_OM_Activity_ActivitySiteID")] +[Index("ActivityType", "ActivityItemId", "ActivityNodeId", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityNodeID_ActivityUTMSource_ActivityUTMContent_ActivityCampaign")] +public class OmActivity +{ + [Key] + [Column("ActivityID")] + public int ActivityId { get; set; } + + [Column("ActivityContactID")] + public int ActivityContactId { get; set; } + + public DateTime? ActivityCreated { get; set; } + + [StringLength(250)] + public string ActivityType { get; set; } = null!; + + [Column("ActivityItemID")] + public int? ActivityItemId { get; set; } + + [Column("ActivityItemDetailID")] + public int? ActivityItemDetailId { get; set; } + + [StringLength(250)] + public string? ActivityValue { get; set; } + + [Column("ActivityURL")] + public string? ActivityUrl { get; set; } + + [StringLength(250)] + public string? ActivityTitle { get; set; } + + [Column("ActivitySiteID")] + public int ActivitySiteId { get; set; } + + public string? ActivityComment { get; set; } + + [StringLength(200)] + public string? ActivityCampaign { get; set; } + + [Column("ActivityURLReferrer")] + public string? ActivityUrlreferrer { get; set; } + + [StringLength(50)] + public string? ActivityCulture { get; set; } + + [Column("ActivityNodeID")] + public int? ActivityNodeId { get; set; } + + [Column("ActivityUTMSource")] + [StringLength(200)] + public string? ActivityUtmsource { get; set; } + + [Column("ActivityABVariantName")] + [StringLength(200)] + public string? ActivityAbvariantName { get; set; } + + [Column("ActivityURLHash")] + public long ActivityUrlhash { get; set; } + + [Column("ActivityUTMContent")] + [StringLength(200)] + public string? ActivityUtmcontent { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs index ce6b15b7..7902e50f 100644 --- a/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs +++ b/Migration.Toolkit.KX13/Models/OmActivityRecalculationQueue.cs @@ -1,18 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ActivityRecalculationQueue")] -public partial class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ActivityRecalculationQueue")] +public class OmActivityRecalculationQueue +{ + [Key] + [Column("ActivityRecalculationQueueID")] + public int ActivityRecalculationQueueId { get; set; } + + [Column("ActivityRecalculationQueueActivityID")] + public int ActivityRecalculationQueueActivityId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/OmActivityType.cs b/Migration.Toolkit.KX13/Models/OmActivityType.cs index 759716fb..8ee0cb68 100644 --- a/Migration.Toolkit.KX13/Models/OmActivityType.cs +++ b/Migration.Toolkit.KX13/Models/OmActivityType.cs @@ -1,44 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ActivityType")] -public partial class OmActivityType -{ - [Key] - [Column("ActivityTypeID")] - public int ActivityTypeId { get; set; } - - [StringLength(250)] - public string ActivityTypeDisplayName { get; set; } = null!; - - [StringLength(250)] - public string ActivityTypeName { get; set; } = null!; - - public bool? ActivityTypeEnabled { get; set; } - - public bool? ActivityTypeIsCustom { get; set; } - - public string? ActivityTypeDescription { get; set; } - - public bool? ActivityTypeManualCreationAllowed { get; set; } - - [StringLength(200)] - public string? ActivityTypeMainFormControl { get; set; } - - [StringLength(200)] - public string? ActivityTypeDetailFormControl { get; set; } - - [StringLength(7)] - public string? ActivityTypeColor { get; set; } - - [StringLength(200)] - public string? ActivityTypeItemObjectType { get; set; } - - [StringLength(200)] - public string? ActivityTypeItemDetailObjectType { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ActivityType")] +public class OmActivityType +{ + [Key] + [Column("ActivityTypeID")] + public int ActivityTypeId { get; set; } + + [StringLength(250)] + public string ActivityTypeDisplayName { get; set; } = null!; + + [StringLength(250)] + public string ActivityTypeName { get; set; } = null!; + + public bool? ActivityTypeEnabled { get; set; } + + public bool? ActivityTypeIsCustom { get; set; } + + public string? ActivityTypeDescription { get; set; } + + public bool? ActivityTypeManualCreationAllowed { get; set; } + + [StringLength(200)] + public string? ActivityTypeMainFormControl { get; set; } + + [StringLength(200)] + public string? ActivityTypeDetailFormControl { get; set; } + + [StringLength(7)] + public string? ActivityTypeColor { get; set; } + + [StringLength(200)] + public string? ActivityTypeItemObjectType { get; set; } + + [StringLength(200)] + public string? ActivityTypeItemDetailObjectType { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/OmContact.cs b/Migration.Toolkit.KX13/Models/OmContact.cs index 8b8c79a9..c6a4c413 100644 --- a/Migration.Toolkit.KX13/Models/OmContact.cs +++ b/Migration.Toolkit.KX13/Models/OmContact.cs @@ -1,141 +1,140 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Contact")] -[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] -[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] -[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] -[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] -[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] -[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] -[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] -[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] -public partial class OmContact -{ - [Key] - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactSalesForceLeadID")] - [StringLength(18)] - public string? ContactSalesForceLeadId { get; set; } - - public bool? ContactSalesForceLeadReplicationDisabled { get; set; } - - public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } - - public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } - - public bool? ContactSalesForceLeadReplicationRequired { get; set; } - - [Column("ContactPersonaID")] - public int? ContactPersonaId { get; set; } - - [InverseProperty("ConsentAgreementContact")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [ForeignKey("ContactCountryId")] - [InverseProperty("OmContacts")] - public virtual CmsCountry? ContactCountry { get; set; } - - [ForeignKey("ContactOwnerUserId")] - [InverseProperty("OmContacts")] - public virtual CmsUser? ContactOwnerUser { get; set; } - - [ForeignKey("ContactStateId")] - [InverseProperty("OmContacts")] - public virtual CmsState? ContactState { get; set; } - - [ForeignKey("ContactStatusId")] - [InverseProperty("OmContacts")] - public virtual OmContactStatus? ContactStatus { get; set; } - - [InverseProperty("AccountPrimaryContact")] - public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); - - [InverseProperty("AccountSecondaryContact")] - public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmMemberships { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [InverseProperty("VisitorToContactContact")] - public virtual ICollection OmVisitorToContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_Contact")] +[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] +[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] +[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] +[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] +[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] +[Index("ContactPersonaId", "ContactLastName", Name = "IX_OM_Contact_ContactPersonaID_ContactLastName")] +[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] +[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] +public class OmContact +{ + [Key] + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactSalesForceLeadID")] + [StringLength(18)] + public string? ContactSalesForceLeadId { get; set; } + + public bool? ContactSalesForceLeadReplicationDisabled { get; set; } + + public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } + + public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } + + public bool? ContactSalesForceLeadReplicationRequired { get; set; } + + [Column("ContactPersonaID")] + public int? ContactPersonaId { get; set; } + + [InverseProperty("ConsentAgreementContact")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [ForeignKey("ContactCountryId")] + [InverseProperty("OmContacts")] + public virtual CmsCountry? ContactCountry { get; set; } + + [ForeignKey("ContactOwnerUserId")] + [InverseProperty("OmContacts")] + public virtual CmsUser? ContactOwnerUser { get; set; } + + [ForeignKey("ContactStateId")] + [InverseProperty("OmContacts")] + public virtual CmsState? ContactState { get; set; } + + [ForeignKey("ContactStatusId")] + [InverseProperty("OmContacts")] + public virtual OmContactStatus? ContactStatus { get; set; } + + [InverseProperty("AccountPrimaryContact")] + public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); + + [InverseProperty("AccountSecondaryContact")] + public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmMemberships { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [InverseProperty("VisitorToContactContact")] + public virtual ICollection OmVisitorToContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs index 7bfd6863..f3777af9 100644 --- a/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs +++ b/Migration.Toolkit.KX13/Models/OmContactChangeRecalculationQueue.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactChangeRecalculationQueue")] -public partial class OmContactChangeRecalculationQueue -{ - [Key] - [Column("ContactChangeRecalculationQueueID")] - public int ContactChangeRecalculationQueueId { get; set; } - - [Column("ContactChangeRecalculationQueueContactID")] - public int ContactChangeRecalculationQueueContactId { get; set; } - - public string? ContactChangeRecalculationQueueChangedColumns { get; set; } - - public bool ContactChangeRecalculationQueueContactIsNew { get; set; } - - public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ContactChangeRecalculationQueue")] +public class OmContactChangeRecalculationQueue +{ + [Key] + [Column("ContactChangeRecalculationQueueID")] + public int ContactChangeRecalculationQueueId { get; set; } + + [Column("ContactChangeRecalculationQueueContactID")] + public int ContactChangeRecalculationQueueContactId { get; set; } + + public string? ContactChangeRecalculationQueueChangedColumns { get; set; } + + public bool ContactChangeRecalculationQueueContactIsNew { get; set; } + + public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/OmContactGroup.cs b/Migration.Toolkit.KX13/Models/OmContactGroup.cs index f1585bd6..fd12786b 100644 --- a/Migration.Toolkit.KX13/Models/OmContactGroup.cs +++ b/Migration.Toolkit.KX13/Models/OmContactGroup.cs @@ -1,40 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactGroup")] -public partial class OmContactGroup -{ - [Key] - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - public string? ContactGroupDescription { get; set; } - - public string? ContactGroupDynamicCondition { get; set; } - - public bool? ContactGroupEnabled { get; set; } - - public DateTime? ContactGroupLastModified { get; set; } - - [Column("ContactGroupGUID")] - public Guid? ContactGroupGuid { get; set; } - - public int? ContactGroupStatus { get; set; } - - [InverseProperty("ContactGroup")] - public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); - - [InverseProperty("ContactGroupMemberContactGroup")] - public virtual ICollection OmContactGroupMembers { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ContactGroup")] +public class OmContactGroup +{ + [Key] + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + public string? ContactGroupDescription { get; set; } + + public string? ContactGroupDynamicCondition { get; set; } + + public bool? ContactGroupEnabled { get; set; } + + public DateTime? ContactGroupLastModified { get; set; } + + [Column("ContactGroupGUID")] + public Guid? ContactGroupGuid { get; set; } + + public int? ContactGroupStatus { get; set; } + + [InverseProperty("ContactGroup")] + public virtual ICollection NewsletterIssueContactGroups { get; set; } = new List(); + + [InverseProperty("ContactGroupMemberContactGroup")] + public virtual ICollection OmContactGroupMembers { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs b/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs index 0a2b2598..90ac7e30 100644 --- a/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs +++ b/Migration.Toolkit.KX13/Models/OmContactGroupMember.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactGroupMember")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] -[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] -public partial class OmContactGroupMember -{ - [Key] - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public int ContactGroupMemberType { get; set; } - - [Column("ContactGroupMemberRelatedID")] - public int ContactGroupMemberRelatedId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [ForeignKey("ContactGroupMemberContactGroupId")] - [InverseProperty("OmContactGroupMembers")] - public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ContactGroupMember")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] +[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] +public class OmContactGroupMember +{ + [Key] + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public int ContactGroupMemberType { get; set; } + + [Column("ContactGroupMemberRelatedID")] + public int ContactGroupMemberRelatedId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [ForeignKey("ContactGroupMemberContactGroupId")] + [InverseProperty("OmContactGroupMembers")] + public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/OmContactRole.cs b/Migration.Toolkit.KX13/Models/OmContactRole.cs index 34952ac2..9394c1c8 100644 --- a/Migration.Toolkit.KX13/Models/OmContactRole.cs +++ b/Migration.Toolkit.KX13/Models/OmContactRole.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactRole")] -public partial class OmContactRole -{ - [Key] - [Column("ContactRoleID")] - public int ContactRoleId { get; set; } - - [StringLength(200)] - public string ContactRoleName { get; set; } = null!; - - [StringLength(200)] - public string ContactRoleDisplayName { get; set; } = null!; - - public string? ContactRoleDescription { get; set; } - - [InverseProperty("ContactRole")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ContactRole")] +public class OmContactRole +{ + [Key] + [Column("ContactRoleID")] + public int ContactRoleId { get; set; } + + [StringLength(200)] + public string ContactRoleName { get; set; } = null!; + + [StringLength(200)] + public string ContactRoleDisplayName { get; set; } = null!; + + public string? ContactRoleDescription { get; set; } + + [InverseProperty("ContactRole")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/OmContactStatus.cs b/Migration.Toolkit.KX13/Models/OmContactStatus.cs index f686cbfd..78608376 100644 --- a/Migration.Toolkit.KX13/Models/OmContactStatus.cs +++ b/Migration.Toolkit.KX13/Models/OmContactStatus.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ContactStatus")] -public partial class OmContactStatus -{ - [Key] - [Column("ContactStatusID")] - public int ContactStatusId { get; set; } - - [StringLength(200)] - public string ContactStatusName { get; set; } = null!; - - [StringLength(200)] - public string ContactStatusDisplayName { get; set; } = null!; - - public string? ContactStatusDescription { get; set; } - - [InverseProperty("ContactStatus")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ContactStatus")] +public class OmContactStatus +{ + [Key] + [Column("ContactStatusID")] + public int ContactStatusId { get; set; } + + [StringLength(200)] + public string ContactStatusName { get; set; } = null!; + + [StringLength(200)] + public string ContactStatusDisplayName { get; set; } = null!; + + public string? ContactStatusDescription { get; set; } + + [InverseProperty("ContactStatus")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/OmMembership.cs b/Migration.Toolkit.KX13/Models/OmMembership.cs index eabb61eb..a18914cc 100644 --- a/Migration.Toolkit.KX13/Models/OmMembership.cs +++ b/Migration.Toolkit.KX13/Models/OmMembership.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Membership")] -[Index("ContactId", Name = "IX_OM_Membership_ContactID")] -[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] -public partial class OmMembership -{ - [Key] - [Column("MembershipID")] - public int MembershipId { get; set; } - - [Column("RelatedID")] - public int RelatedId { get; set; } - - public int MemberType { get; set; } - - [Column("MembershipGUID")] - public Guid MembershipGuid { get; set; } - - public DateTime MembershipCreated { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmMemberships")] - public virtual OmContact Contact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_Membership")] +[Index("ContactId", Name = "IX_OM_Membership_ContactID")] +[Index("RelatedId", Name = "IX_OM_Membership_RelatedID")] +public class OmMembership +{ + [Key] + [Column("MembershipID")] + public int MembershipId { get; set; } + + [Column("RelatedID")] + public int RelatedId { get; set; } + + public int MemberType { get; set; } + + [Column("MembershipGUID")] + public Guid MembershipGuid { get; set; } + + public DateTime MembershipCreated { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmMemberships")] + public virtual OmContact Contact { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/OmRule.cs b/Migration.Toolkit.KX13/Models/OmRule.cs index 3062ec58..6b134706 100644 --- a/Migration.Toolkit.KX13/Models/OmRule.cs +++ b/Migration.Toolkit.KX13/Models/OmRule.cs @@ -1,71 +1,70 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Rule")] -[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] -public partial class OmRule -{ - [Key] - [Column("RuleID")] - public int RuleId { get; set; } - - [Column("RuleScoreID")] - public int RuleScoreId { get; set; } - - [StringLength(200)] - public string RuleDisplayName { get; set; } = null!; - - [StringLength(200)] - public string RuleName { get; set; } = null!; - - public int RuleValue { get; set; } - - public bool? RuleIsRecurring { get; set; } - - public int? RuleMaxPoints { get; set; } - - public DateTime? RuleValidUntil { get; set; } - - [StringLength(50)] - public string? RuleValidity { get; set; } - - public int? RuleValidFor { get; set; } - - public int RuleType { get; set; } - - [StringLength(250)] - public string? RuleParameter { get; set; } - - public string RuleCondition { get; set; } = null!; - - public DateTime RuleLastModified { get; set; } - - [Column("RuleGUID")] - public Guid RuleGuid { get; set; } - - public bool RuleBelongsToPersona { get; set; } - - [Column("RuleActivityItemID")] - public int? RuleActivityItemId { get; set; } - - [StringLength(200)] - public string? RuleActivityItemObjectType { get; set; } - - [Column("RuleActivityItemDetailID")] - public int? RuleActivityItemDetailId { get; set; } - - [StringLength(200)] - public string? RuleActivityItemDetailObjectType { get; set; } - - [InverseProperty("Rule")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [ForeignKey("RuleScoreId")] - [InverseProperty("OmRules")] - public virtual OmScore RuleScore { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_Rule")] +[Index("RuleScoreId", Name = "IX_OM_Rule_RuleScoreID")] +public class OmRule +{ + [Key] + [Column("RuleID")] + public int RuleId { get; set; } + + [Column("RuleScoreID")] + public int RuleScoreId { get; set; } + + [StringLength(200)] + public string RuleDisplayName { get; set; } = null!; + + [StringLength(200)] + public string RuleName { get; set; } = null!; + + public int RuleValue { get; set; } + + public bool? RuleIsRecurring { get; set; } + + public int? RuleMaxPoints { get; set; } + + public DateTime? RuleValidUntil { get; set; } + + [StringLength(50)] + public string? RuleValidity { get; set; } + + public int? RuleValidFor { get; set; } + + public int RuleType { get; set; } + + [StringLength(250)] + public string? RuleParameter { get; set; } + + public string RuleCondition { get; set; } = null!; + + public DateTime RuleLastModified { get; set; } + + [Column("RuleGUID")] + public Guid RuleGuid { get; set; } + + public bool RuleBelongsToPersona { get; set; } + + [Column("RuleActivityItemID")] + public int? RuleActivityItemId { get; set; } + + [StringLength(200)] + public string? RuleActivityItemObjectType { get; set; } + + [Column("RuleActivityItemDetailID")] + public int? RuleActivityItemDetailId { get; set; } + + [StringLength(200)] + public string? RuleActivityItemDetailObjectType { get; set; } + + [InverseProperty("Rule")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [ForeignKey("RuleScoreId")] + [InverseProperty("OmRules")] + public virtual OmScore RuleScore { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/OmScore.cs b/Migration.Toolkit.KX13/Models/OmScore.cs index 9dc04e76..89cf0cef 100644 --- a/Migration.Toolkit.KX13/Models/OmScore.cs +++ b/Migration.Toolkit.KX13/Models/OmScore.cs @@ -1,53 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_Score")] -public partial class OmScore -{ - [Key] - [Column("ScoreID")] - public int ScoreId { get; set; } - - [StringLength(200)] - public string ScoreName { get; set; } = null!; - - [StringLength(200)] - public string ScoreDisplayName { get; set; } = null!; - - public string? ScoreDescription { get; set; } - - public bool ScoreEnabled { get; set; } - - public int? ScoreEmailAtScore { get; set; } - - [StringLength(998)] - public string? ScoreNotificationEmail { get; set; } - - public DateTime ScoreLastModified { get; set; } - - [Column("ScoreGUID")] - public Guid ScoreGuid { get; set; } - - public int? ScoreStatus { get; set; } - - [Column("ScoreScheduledTaskID")] - public int? ScoreScheduledTaskId { get; set; } - - [Column("ScorePersonaID")] - public int? ScorePersonaId { get; set; } - - [InverseProperty("RuleScore")] - public virtual ICollection OmRules { get; set; } = new List(); - - [InverseProperty("Score")] - public virtual ICollection OmScoreContactRules { get; set; } = new List(); - - [ForeignKey("ScorePersonaId")] - [InverseProperty("OmScore")] - public virtual PersonasPersona? ScorePersona { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_Score")] +public class OmScore +{ + [Key] + [Column("ScoreID")] + public int ScoreId { get; set; } + + [StringLength(200)] + public string ScoreName { get; set; } = null!; + + [StringLength(200)] + public string ScoreDisplayName { get; set; } = null!; + + public string? ScoreDescription { get; set; } + + public bool ScoreEnabled { get; set; } + + public int? ScoreEmailAtScore { get; set; } + + [StringLength(998)] + public string? ScoreNotificationEmail { get; set; } + + public DateTime ScoreLastModified { get; set; } + + [Column("ScoreGUID")] + public Guid ScoreGuid { get; set; } + + public int? ScoreStatus { get; set; } + + [Column("ScoreScheduledTaskID")] + public int? ScoreScheduledTaskId { get; set; } + + [Column("ScorePersonaID")] + public int? ScorePersonaId { get; set; } + + [InverseProperty("RuleScore")] + public virtual ICollection OmRules { get; set; } = new List(); + + [InverseProperty("Score")] + public virtual ICollection OmScoreContactRules { get; set; } = new List(); + + [ForeignKey("ScorePersonaId")] + [InverseProperty("OmScore")] + public virtual PersonasPersona? ScorePersona { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs b/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs index 1a71dbd7..0ec22655 100644 --- a/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs +++ b/Migration.Toolkit.KX13/Models/OmScoreContactRule.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_ScoreContactRule")] -[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] -[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] -[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] -[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] -public partial class OmScoreContactRule -{ - [Column("ScoreID")] - public int ScoreId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("RuleID")] - public int RuleId { get; set; } - - public int Value { get; set; } - - public DateTime? Expiration { get; set; } - - [Key] - [Column("ScoreContactRuleID")] - public int ScoreContactRuleId { get; set; } - - [ForeignKey("ContactId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("RuleId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmRule Rule { get; set; } = null!; - - [ForeignKey("ScoreId")] - [InverseProperty("OmScoreContactRules")] - public virtual OmScore Score { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_ScoreContactRule")] +[Index("ContactId", Name = "IX_OM_ScoreContactRule_ContactID")] +[Index("RuleId", Name = "IX_OM_ScoreContactRule_RuleID")] +[Index("ScoreId", Name = "IX_OM_ScoreContactRule_ScoreID_ContactID_Value_Expiration")] +[Index("ScoreId", "ContactId", "RuleId", Name = "UQ_OM_ScoreContactRule", IsUnique = true)] +public class OmScoreContactRule +{ + [Column("ScoreID")] + public int ScoreId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("RuleID")] + public int RuleId { get; set; } + + public int Value { get; set; } + + public DateTime? Expiration { get; set; } + + [Key] + [Column("ScoreContactRuleID")] + public int ScoreContactRuleId { get; set; } + + [ForeignKey("ContactId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("RuleId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmRule Rule { get; set; } = null!; + + [ForeignKey("ScoreId")] + [InverseProperty("OmScoreContactRules")] + public virtual OmScore Score { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs b/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs index 0826fe46..70ae870c 100644 --- a/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs +++ b/Migration.Toolkit.KX13/Models/OmVisitorToContact.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("OM_VisitorToContact")] -[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] -[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] -public partial class OmVisitorToContact -{ - [Key] - [Column("VisitorToContactID")] - public int VisitorToContactId { get; set; } - - [Column("VisitorToContactVisitorGUID")] - public Guid VisitorToContactVisitorGuid { get; set; } - - [Column("VisitorToContactContactID")] - public int VisitorToContactContactId { get; set; } - - [ForeignKey("VisitorToContactContactId")] - [InverseProperty("OmVisitorToContacts")] - public virtual OmContact VisitorToContactContact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("OM_VisitorToContact")] +[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] +[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] +public class OmVisitorToContact +{ + [Key] + [Column("VisitorToContactID")] + public int VisitorToContactId { get; set; } + + [Column("VisitorToContactVisitorGUID")] + public Guid VisitorToContactVisitorGuid { get; set; } + + [Column("VisitorToContactContactID")] + public int VisitorToContactContactId { get; set; } + + [ForeignKey("VisitorToContactContactId")] + [InverseProperty("OmVisitorToContacts")] + public virtual OmContact VisitorToContactContact { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/PersonasPersona.cs b/Migration.Toolkit.KX13/Models/PersonasPersona.cs index 9d878214..60b5319a 100644 --- a/Migration.Toolkit.KX13/Models/PersonasPersona.cs +++ b/Migration.Toolkit.KX13/Models/PersonasPersona.cs @@ -1,40 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Personas_Persona")] -public partial class PersonasPersona -{ - [Key] - [Column("PersonaID")] - public int PersonaId { get; set; } - - [StringLength(200)] - public string PersonaDisplayName { get; set; } = null!; - - [StringLength(200)] - public string PersonaName { get; set; } = null!; - - public string? PersonaDescription { get; set; } - - [Required] - public bool? PersonaEnabled { get; set; } - - [Column("PersonaGUID")] - public Guid PersonaGuid { get; set; } - - [Column("PersonaPictureMetafileGUID")] - public Guid? PersonaPictureMetafileGuid { get; set; } - - public int PersonaPointsThreshold { get; set; } - - [InverseProperty("ScorePersona")] - public virtual OmScore? OmScore { get; set; } - - [InverseProperty("PersonaContactHistoryPersona")] - public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Personas_Persona")] +public class PersonasPersona +{ + [Key] + [Column("PersonaID")] + public int PersonaId { get; set; } + + [StringLength(200)] + public string PersonaDisplayName { get; set; } = null!; + + [StringLength(200)] + public string PersonaName { get; set; } = null!; + + public string? PersonaDescription { get; set; } + + [Required] + public bool? PersonaEnabled { get; set; } + + [Column("PersonaGUID")] + public Guid PersonaGuid { get; set; } + + [Column("PersonaPictureMetafileGUID")] + public Guid? PersonaPictureMetafileGuid { get; set; } + + public int PersonaPointsThreshold { get; set; } + + [InverseProperty("ScorePersona")] + public virtual OmScore? OmScore { get; set; } + + [InverseProperty("PersonaContactHistoryPersona")] + public virtual ICollection PersonasPersonaContactHistories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs b/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs index 3526e785..bac1db08 100644 --- a/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs +++ b/Migration.Toolkit.KX13/Models/PersonasPersonaContactHistory.cs @@ -1,28 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Personas_PersonaContactHistory")] -[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] -public partial class PersonasPersonaContactHistory -{ - [Key] - [Column("PersonaContactHistoryID")] - public int PersonaContactHistoryId { get; set; } - - [Column("PersonaContactHistoryPersonaID")] - public int? PersonaContactHistoryPersonaId { get; set; } - - [Column(TypeName = "date")] - public DateTime PersonaContactHistoryDate { get; set; } - - public int PersonaContactHistoryContacts { get; set; } - - [ForeignKey("PersonaContactHistoryPersonaId")] - [InverseProperty("PersonasPersonaContactHistories")] - public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Personas_PersonaContactHistory")] +[Index("PersonaContactHistoryPersonaId", Name = "IX_Personas_PersonaContactHistoryPersonaID")] +public class PersonasPersonaContactHistory +{ + [Key] + [Column("PersonaContactHistoryID")] + public int PersonaContactHistoryId { get; set; } + + [Column("PersonaContactHistoryPersonaID")] + public int? PersonaContactHistoryPersonaId { get; set; } + + [Column(TypeName = "date")] + public DateTime PersonaContactHistoryDate { get; set; } + + public int PersonaContactHistoryContacts { get; set; } + + [ForeignKey("PersonaContactHistoryPersonaId")] + [InverseProperty("PersonasPersonaContactHistories")] + public virtual PersonasPersona? PersonaContactHistoryPersona { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ReportingReport.cs b/Migration.Toolkit.KX13/Models/ReportingReport.cs index 43c0e67d..90f06d5a 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReport.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReport.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_Report")] -[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] -[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] -[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] -public partial class ReportingReport -{ - [Key] - [Column("ReportID")] - public int ReportId { get; set; } - - [StringLength(200)] - public string ReportName { get; set; } = null!; - - [StringLength(440)] - public string ReportDisplayName { get; set; } = null!; - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - [Column("ReportCategoryID")] - public int ReportCategoryId { get; set; } - - public int ReportAccess { get; set; } - - [Column("ReportGUID")] - public Guid ReportGuid { get; set; } - - public DateTime ReportLastModified { get; set; } - - public bool? ReportEnableSubscription { get; set; } - - [StringLength(100)] - public string? ReportConnectionString { get; set; } - - [ForeignKey("ReportCategoryId")] - [InverseProperty("ReportingReports")] - public virtual ReportingReportCategory ReportCategory { get; set; } = null!; - - [InverseProperty("GraphReport")] - public virtual ICollection ReportingReportGraphs { get; set; } = new List(); - - [InverseProperty("ReportSubscriptionReport")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [InverseProperty("TableReport")] - public virtual ICollection ReportingReportTables { get; set; } = new List(); - - [InverseProperty("ValueReport")] - public virtual ICollection ReportingReportValues { get; set; } = new List(); - - [InverseProperty("SavedReportReport")] - public virtual ICollection ReportingSavedReports { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Reporting_Report")] +[Index("ReportCategoryId", Name = "IX_Reporting_Report_ReportCategoryID")] +[Index("ReportGuid", "ReportName", Name = "IX_Reporting_Report_ReportGUID_ReportName")] +[Index("ReportName", Name = "IX_Reporting_Report_ReportName", IsUnique = true)] +public class ReportingReport +{ + [Key] + [Column("ReportID")] + public int ReportId { get; set; } + + [StringLength(200)] + public string ReportName { get; set; } = null!; + + [StringLength(440)] + public string ReportDisplayName { get; set; } = null!; + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + [Column("ReportCategoryID")] + public int ReportCategoryId { get; set; } + + public int ReportAccess { get; set; } + + [Column("ReportGUID")] + public Guid ReportGuid { get; set; } + + public DateTime ReportLastModified { get; set; } + + public bool? ReportEnableSubscription { get; set; } + + [StringLength(100)] + public string? ReportConnectionString { get; set; } + + [ForeignKey("ReportCategoryId")] + [InverseProperty("ReportingReports")] + public virtual ReportingReportCategory ReportCategory { get; set; } = null!; + + [InverseProperty("GraphReport")] + public virtual ICollection ReportingReportGraphs { get; set; } = new List(); + + [InverseProperty("ReportSubscriptionReport")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [InverseProperty("TableReport")] + public virtual ICollection ReportingReportTables { get; set; } = new List(); + + [InverseProperty("ValueReport")] + public virtual ICollection ReportingReportValues { get; set; } = new List(); + + [InverseProperty("SavedReportReport")] + public virtual ICollection ReportingSavedReports { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs b/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs index 9f9a64f8..0b3e1d2c 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportCategory.cs @@ -1,51 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportCategory")] -[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] -public partial class ReportingReportCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryCodeName { get; set; } = null!; - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - public string CategoryPath { get; set; } = null!; - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual ReportingReportCategory? CategoryParent { get; set; } - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); - - [InverseProperty("ReportCategory")] - public virtual ICollection ReportingReports { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Reporting_ReportCategory")] +[Index("CategoryParentId", Name = "IX_Reporting_ReportCategory_CategoryParentID")] +public class ReportingReportCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryCodeName { get; set; } = null!; + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + public string CategoryPath { get; set; } = null!; + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual ReportingReportCategory? CategoryParent { get; set; } + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); + + [InverseProperty("ReportCategory")] + public virtual ICollection ReportingReports { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs b/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs index 78200727..a3a75c8e 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportGraph.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportGraph")] -[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] -[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] -public partial class ReportingReportGraph -{ - [Key] - [Column("GraphID")] - public int GraphId { get; set; } - - [StringLength(100)] - public string GraphName { get; set; } = null!; - - [StringLength(450)] - public string GraphDisplayName { get; set; } = null!; - - public string GraphQuery { get; set; } = null!; - - public bool GraphQueryIsStoredProcedure { get; set; } - - [StringLength(50)] - public string GraphType { get; set; } = null!; - - [Column("GraphReportID")] - public int GraphReportId { get; set; } - - [StringLength(200)] - public string? GraphTitle { get; set; } - - [Column("GraphXAxisTitle")] - [StringLength(200)] - public string? GraphXaxisTitle { get; set; } - - [Column("GraphYAxisTitle")] - [StringLength(200)] - public string? GraphYaxisTitle { get; set; } - - public int? GraphWidth { get; set; } - - public int? GraphHeight { get; set; } - - public int? GraphLegendPosition { get; set; } - - public string? GraphSettings { get; set; } - - [Column("GraphGUID")] - public Guid GraphGuid { get; set; } - - public DateTime GraphLastModified { get; set; } - - public bool? GraphIsHtml { get; set; } - - [StringLength(100)] - public string? GraphConnectionString { get; set; } - - [ForeignKey("GraphReportId")] - [InverseProperty("ReportingReportGraphs")] - public virtual ReportingReport GraphReport { get; set; } = null!; - - [InverseProperty("ReportSubscriptionGraph")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Reporting_ReportGraph")] +[Index("GraphGuid", Name = "IX_Reporting_ReportGraph_GraphGUID", IsUnique = true)] +[Index("GraphReportId", "GraphName", Name = "IX_Reporting_ReportGraph_GraphReportID_GraphName", IsUnique = true)] +public class ReportingReportGraph +{ + [Key] + [Column("GraphID")] + public int GraphId { get; set; } + + [StringLength(100)] + public string GraphName { get; set; } = null!; + + [StringLength(450)] + public string GraphDisplayName { get; set; } = null!; + + public string GraphQuery { get; set; } = null!; + + public bool GraphQueryIsStoredProcedure { get; set; } + + [StringLength(50)] + public string GraphType { get; set; } = null!; + + [Column("GraphReportID")] + public int GraphReportId { get; set; } + + [StringLength(200)] + public string? GraphTitle { get; set; } + + [Column("GraphXAxisTitle")] + [StringLength(200)] + public string? GraphXaxisTitle { get; set; } + + [Column("GraphYAxisTitle")] + [StringLength(200)] + public string? GraphYaxisTitle { get; set; } + + public int? GraphWidth { get; set; } + + public int? GraphHeight { get; set; } + + public int? GraphLegendPosition { get; set; } + + public string? GraphSettings { get; set; } + + [Column("GraphGUID")] + public Guid GraphGuid { get; set; } + + public DateTime GraphLastModified { get; set; } + + public bool? GraphIsHtml { get; set; } + + [StringLength(100)] + public string? GraphConnectionString { get; set; } + + [ForeignKey("GraphReportId")] + [InverseProperty("ReportingReportGraphs")] + public virtual ReportingReport GraphReport { get; set; } = null!; + + [InverseProperty("ReportSubscriptionGraph")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs b/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs index 992a5158..81a686c6 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportSubscription.cs @@ -1,93 +1,92 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportSubscription")] -[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] -[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] -[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] -[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] -[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] -[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] -public partial class ReportingReportSubscription -{ - [Key] - [Column("ReportSubscriptionID")] - public int ReportSubscriptionId { get; set; } - - [Column("ReportSubscriptionReportID")] - public int ReportSubscriptionReportId { get; set; } - - [StringLength(1000)] - public string ReportSubscriptionInterval { get; set; } = null!; - - public string? ReportSubscriptionCondition { get; set; } - - [Required] - public bool? ReportSubscriptionEnabled { get; set; } - - public string? ReportSubscriptionParameters { get; set; } - - [Column("ReportSubscriptionGUID")] - public Guid ReportSubscriptionGuid { get; set; } - - public DateTime ReportSubscriptionLastModified { get; set; } - - [StringLength(200)] - public string? ReportSubscriptionSubject { get; set; } - - [Column("ReportSubscriptionGraphID")] - public int? ReportSubscriptionGraphId { get; set; } - - [Column("ReportSubscriptionTableID")] - public int? ReportSubscriptionTableId { get; set; } - - [Column("ReportSubscriptionValueID")] - public int? ReportSubscriptionValueId { get; set; } - - [Column("ReportSubscriptionUserID")] - public int ReportSubscriptionUserId { get; set; } - - [StringLength(400)] - public string ReportSubscriptionEmail { get; set; } = null!; - - [Required] - public bool? ReportSubscriptionOnlyNonEmpty { get; set; } - - public DateTime? ReportSubscriptionLastPostDate { get; set; } - - public DateTime? ReportSubscriptionNextPostDate { get; set; } - - [Column("ReportSubscriptionSiteID")] - public int ReportSubscriptionSiteId { get; set; } - - public string? ReportSubscriptionSettings { get; set; } - - [ForeignKey("ReportSubscriptionGraphId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } - - [ForeignKey("ReportSubscriptionReportId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; - - [ForeignKey("ReportSubscriptionSiteId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; - - [ForeignKey("ReportSubscriptionTableId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } - - [ForeignKey("ReportSubscriptionUserId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; - - [ForeignKey("ReportSubscriptionValueId")] - [InverseProperty("ReportingReportSubscriptions")] - public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Reporting_ReportSubscription")] +[Index("ReportSubscriptionGraphId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionGraphID")] +[Index("ReportSubscriptionReportId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionReportID")] +[Index("ReportSubscriptionSiteId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionSiteID")] +[Index("ReportSubscriptionTableId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionTableID")] +[Index("ReportSubscriptionUserId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionUserID")] +[Index("ReportSubscriptionValueId", Name = "IX_Reporting_ReportSubscription_ReportSubscriptionValueID")] +public class ReportingReportSubscription +{ + [Key] + [Column("ReportSubscriptionID")] + public int ReportSubscriptionId { get; set; } + + [Column("ReportSubscriptionReportID")] + public int ReportSubscriptionReportId { get; set; } + + [StringLength(1000)] + public string ReportSubscriptionInterval { get; set; } = null!; + + public string? ReportSubscriptionCondition { get; set; } + + [Required] + public bool? ReportSubscriptionEnabled { get; set; } + + public string? ReportSubscriptionParameters { get; set; } + + [Column("ReportSubscriptionGUID")] + public Guid ReportSubscriptionGuid { get; set; } + + public DateTime ReportSubscriptionLastModified { get; set; } + + [StringLength(200)] + public string? ReportSubscriptionSubject { get; set; } + + [Column("ReportSubscriptionGraphID")] + public int? ReportSubscriptionGraphId { get; set; } + + [Column("ReportSubscriptionTableID")] + public int? ReportSubscriptionTableId { get; set; } + + [Column("ReportSubscriptionValueID")] + public int? ReportSubscriptionValueId { get; set; } + + [Column("ReportSubscriptionUserID")] + public int ReportSubscriptionUserId { get; set; } + + [StringLength(400)] + public string ReportSubscriptionEmail { get; set; } = null!; + + [Required] + public bool? ReportSubscriptionOnlyNonEmpty { get; set; } + + public DateTime? ReportSubscriptionLastPostDate { get; set; } + + public DateTime? ReportSubscriptionNextPostDate { get; set; } + + [Column("ReportSubscriptionSiteID")] + public int ReportSubscriptionSiteId { get; set; } + + public string? ReportSubscriptionSettings { get; set; } + + [ForeignKey("ReportSubscriptionGraphId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportGraph? ReportSubscriptionGraph { get; set; } + + [ForeignKey("ReportSubscriptionReportId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReport ReportSubscriptionReport { get; set; } = null!; + + [ForeignKey("ReportSubscriptionSiteId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsSite ReportSubscriptionSite { get; set; } = null!; + + [ForeignKey("ReportSubscriptionTableId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportTable? ReportSubscriptionTable { get; set; } + + [ForeignKey("ReportSubscriptionUserId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual CmsUser ReportSubscriptionUser { get; set; } = null!; + + [ForeignKey("ReportSubscriptionValueId")] + [InverseProperty("ReportingReportSubscriptions")] + public virtual ReportingReportValue? ReportSubscriptionValue { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportTable.cs b/Migration.Toolkit.KX13/Models/ReportingReportTable.cs index 083b45aa..9697f2ee 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportTable.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportTable.cs @@ -1,47 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportTable")] -[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] -[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] -public partial class ReportingReportTable -{ - [Key] - [Column("TableID")] - public int TableId { get; set; } - - [StringLength(100)] - public string TableName { get; set; } = null!; - - [StringLength(450)] - public string TableDisplayName { get; set; } = null!; - - public string TableQuery { get; set; } = null!; - - public bool TableQueryIsStoredProcedure { get; set; } - - [Column("TableReportID")] - public int TableReportId { get; set; } - - public string? TableSettings { get; set; } - - [Column("TableGUID")] - public Guid TableGuid { get; set; } - - public DateTime TableLastModified { get; set; } - - [StringLength(100)] - public string? TableConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionTable")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("TableReportId")] - [InverseProperty("ReportingReportTables")] - public virtual ReportingReport TableReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Reporting_ReportTable")] +[Index("TableReportId", Name = "IX_Reporting_ReportTable_TableReportID")] +[Index("TableName", "TableReportId", Name = "IX_Reporting_ReportTable_TableReportID_TableName", IsUnique = true)] +public class ReportingReportTable +{ + [Key] + [Column("TableID")] + public int TableId { get; set; } + + [StringLength(100)] + public string TableName { get; set; } = null!; + + [StringLength(450)] + public string TableDisplayName { get; set; } = null!; + + public string TableQuery { get; set; } = null!; + + public bool TableQueryIsStoredProcedure { get; set; } + + [Column("TableReportID")] + public int TableReportId { get; set; } + + public string? TableSettings { get; set; } + + [Column("TableGUID")] + public Guid TableGuid { get; set; } + + public DateTime TableLastModified { get; set; } + + [StringLength(100)] + public string? TableConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionTable")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("TableReportId")] + [InverseProperty("ReportingReportTables")] + public virtual ReportingReport TableReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ReportingReportValue.cs b/Migration.Toolkit.KX13/Models/ReportingReportValue.cs index 387fdc9d..be55812b 100644 --- a/Migration.Toolkit.KX13/Models/ReportingReportValue.cs +++ b/Migration.Toolkit.KX13/Models/ReportingReportValue.cs @@ -1,50 +1,49 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_ReportValue")] -[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] -[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] -public partial class ReportingReportValue -{ - [Key] - [Column("ValueID")] - public int ValueId { get; set; } - - [StringLength(100)] - public string ValueName { get; set; } = null!; - - [StringLength(450)] - public string ValueDisplayName { get; set; } = null!; - - public string ValueQuery { get; set; } = null!; - - public bool ValueQueryIsStoredProcedure { get; set; } - - [StringLength(200)] - public string? ValueFormatString { get; set; } - - [Column("ValueReportID")] - public int ValueReportId { get; set; } - - [Column("ValueGUID")] - public Guid ValueGuid { get; set; } - - public DateTime ValueLastModified { get; set; } - - public string? ValueSettings { get; set; } - - [StringLength(100)] - public string? ValueConnectionString { get; set; } - - [InverseProperty("ReportSubscriptionValue")] - public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); - - [ForeignKey("ValueReportId")] - [InverseProperty("ReportingReportValues")] - public virtual ReportingReport ValueReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Reporting_ReportValue")] +[Index("ValueName", "ValueReportId", Name = "IX_Reporting_ReportValue_ValueName_ValueReportID")] +[Index("ValueReportId", Name = "IX_Reporting_ReportValue_ValueReportID")] +public class ReportingReportValue +{ + [Key] + [Column("ValueID")] + public int ValueId { get; set; } + + [StringLength(100)] + public string ValueName { get; set; } = null!; + + [StringLength(450)] + public string ValueDisplayName { get; set; } = null!; + + public string ValueQuery { get; set; } = null!; + + public bool ValueQueryIsStoredProcedure { get; set; } + + [StringLength(200)] + public string? ValueFormatString { get; set; } + + [Column("ValueReportID")] + public int ValueReportId { get; set; } + + [Column("ValueGUID")] + public Guid ValueGuid { get; set; } + + public DateTime ValueLastModified { get; set; } + + public string? ValueSettings { get; set; } + + [StringLength(100)] + public string? ValueConnectionString { get; set; } + + [InverseProperty("ReportSubscriptionValue")] + public virtual ICollection ReportingReportSubscriptions { get; set; } = new List(); + + [ForeignKey("ValueReportId")] + [InverseProperty("ReportingReportValues")] + public virtual ReportingReport ValueReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs b/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs index 2573d5a2..da97cbeb 100644 --- a/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs +++ b/Migration.Toolkit.KX13/Models/ReportingSavedGraph.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_SavedGraph")] -[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] -[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] -public partial class ReportingSavedGraph -{ - [Key] - [Column("SavedGraphID")] - public int SavedGraphId { get; set; } - - [Column("SavedGraphSavedReportID")] - public int SavedGraphSavedReportId { get; set; } - - [Column("SavedGraphGUID")] - public Guid SavedGraphGuid { get; set; } - - public byte[] SavedGraphBinary { get; set; } = null!; - - [StringLength(100)] - public string SavedGraphMimeType { get; set; } = null!; - - public DateTime SavedGraphLastModified { get; set; } - - [ForeignKey("SavedGraphSavedReportId")] - [InverseProperty("ReportingSavedGraphs")] - public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Reporting_SavedGraph")] +[Index("SavedGraphGuid", Name = "IX_Reporting_SavedGraph_SavedGraphGUID")] +[Index("SavedGraphSavedReportId", Name = "IX_Reporting_SavedGraph_SavedGraphSavedReportID")] +public class ReportingSavedGraph +{ + [Key] + [Column("SavedGraphID")] + public int SavedGraphId { get; set; } + + [Column("SavedGraphSavedReportID")] + public int SavedGraphSavedReportId { get; set; } + + [Column("SavedGraphGUID")] + public Guid SavedGraphGuid { get; set; } + + public byte[] SavedGraphBinary { get; set; } = null!; + + [StringLength(100)] + public string SavedGraphMimeType { get; set; } = null!; + + public DateTime SavedGraphLastModified { get; set; } + + [ForeignKey("SavedGraphSavedReportId")] + [InverseProperty("ReportingSavedGraphs")] + public virtual ReportingSavedReport SavedGraphSavedReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs b/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs index f97fbc8f..d65c06e5 100644 --- a/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs +++ b/Migration.Toolkit.KX13/Models/ReportingSavedReport.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Reporting_SavedReport")] -[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] -public partial class ReportingSavedReport -{ - [Key] - [Column("SavedReportID")] - public int SavedReportId { get; set; } - - [Column("SavedReportReportID")] - public int SavedReportReportId { get; set; } - - [Column("SavedReportGUID")] - public Guid SavedReportGuid { get; set; } - - [StringLength(200)] - public string? SavedReportTitle { get; set; } - - public DateTime SavedReportDate { get; set; } - - [Column("SavedReportHTML")] - public string SavedReportHtml { get; set; } = null!; - - public string SavedReportParameters { get; set; } = null!; - - [Column("SavedReportCreatedByUserID")] - public int? SavedReportCreatedByUserId { get; set; } - - public DateTime SavedReportLastModified { get; set; } - - [InverseProperty("SavedGraphSavedReport")] - public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); - - [ForeignKey("SavedReportCreatedByUserId")] - [InverseProperty("ReportingSavedReports")] - public virtual CmsUser? SavedReportCreatedByUser { get; set; } - - [ForeignKey("SavedReportReportId")] - [InverseProperty("ReportingSavedReports")] - public virtual ReportingReport SavedReportReport { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Reporting_SavedReport")] +[Index("SavedReportCreatedByUserId", Name = "IX_Reporting_SavedReport_SavedReportCreatedByUserID")] +public class ReportingSavedReport +{ + [Key] + [Column("SavedReportID")] + public int SavedReportId { get; set; } + + [Column("SavedReportReportID")] + public int SavedReportReportId { get; set; } + + [Column("SavedReportGUID")] + public Guid SavedReportGuid { get; set; } + + [StringLength(200)] + public string? SavedReportTitle { get; set; } + + public DateTime SavedReportDate { get; set; } + + [Column("SavedReportHTML")] + public string SavedReportHtml { get; set; } = null!; + + public string SavedReportParameters { get; set; } = null!; + + [Column("SavedReportCreatedByUserID")] + public int? SavedReportCreatedByUserId { get; set; } + + public DateTime SavedReportLastModified { get; set; } + + [InverseProperty("SavedGraphSavedReport")] + public virtual ICollection ReportingSavedGraphs { get; set; } = new List(); + + [ForeignKey("SavedReportCreatedByUserId")] + [InverseProperty("ReportingSavedReports")] + public virtual CmsUser? SavedReportCreatedByUser { get; set; } + + [ForeignKey("SavedReportReportId")] + [InverseProperty("ReportingSavedReports")] + public virtual ReportingReport SavedReportReport { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs index 82e54f81..dee17a43 100644 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs +++ b/Migration.Toolkit.KX13/Models/SharePointSharePointConnection.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SharePoint_SharePointConnection")] -[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] -public partial class SharePointSharePointConnection -{ - [Key] - [Column("SharePointConnectionID")] - public int SharePointConnectionId { get; set; } - - [Column("SharePointConnectionGUID")] - public Guid SharePointConnectionGuid { get; set; } - - [Column("SharePointConnectionSiteID")] - public int SharePointConnectionSiteId { get; set; } - - [StringLength(512)] - public string SharePointConnectionSiteUrl { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionDisplayName { get; set; } = null!; - - [StringLength(100)] - public string SharePointConnectionName { get; set; } = null!; - - [StringLength(100)] - public string? SharePointConnectionUserName { get; set; } - - [StringLength(100)] - public string? SharePointConnectionPassword { get; set; } - - public DateTime SharePointConnectionLastModified { get; set; } - - [ForeignKey("SharePointConnectionSiteId")] - [InverseProperty("SharePointSharePointConnections")] - public virtual CmsSite SharePointConnectionSite { get; set; } = null!; - - [InverseProperty("SharePointLibrarySharePointConnection")] - public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SharePoint_SharePointConnection")] +[Index("SharePointConnectionSiteId", Name = "IX_SharePoint_SharePointConnection_SharePointConnectionSiteID")] +public class SharePointSharePointConnection +{ + [Key] + [Column("SharePointConnectionID")] + public int SharePointConnectionId { get; set; } + + [Column("SharePointConnectionGUID")] + public Guid SharePointConnectionGuid { get; set; } + + [Column("SharePointConnectionSiteID")] + public int SharePointConnectionSiteId { get; set; } + + [StringLength(512)] + public string SharePointConnectionSiteUrl { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionDisplayName { get; set; } = null!; + + [StringLength(100)] + public string SharePointConnectionName { get; set; } = null!; + + [StringLength(100)] + public string? SharePointConnectionUserName { get; set; } + + [StringLength(100)] + public string? SharePointConnectionPassword { get; set; } + + public DateTime SharePointConnectionLastModified { get; set; } + + [ForeignKey("SharePointConnectionSiteId")] + [InverseProperty("SharePointSharePointConnections")] + public virtual CmsSite SharePointConnectionSite { get; set; } = null!; + + [InverseProperty("SharePointLibrarySharePointConnection")] + public virtual ICollection SharePointSharePointLibraries { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs index 3b160e0a..7aaf52da 100644 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs +++ b/Migration.Toolkit.KX13/Models/SharePointSharePointFile.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SharePoint_SharePointFile")] -[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] -[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] -public partial class SharePointSharePointFile -{ - [Key] - [Column("SharePointFileID")] - public int SharePointFileId { get; set; } - - [Column("SharePointFileGUID")] - public Guid SharePointFileGuid { get; set; } - - [Column("SharePointFileSiteID")] - public int SharePointFileSiteId { get; set; } - - [StringLength(150)] - public string SharePointFileName { get; set; } = null!; - - [StringLength(150)] - public string? SharePointFileExtension { get; set; } - - [StringLength(255)] - public string? SharePointFileMimeType { get; set; } - - [Column("SharePointFileETag")] - [StringLength(255)] - public string? SharePointFileEtag { get; set; } - - public long SharePointFileSize { get; set; } - - public DateTime SharePointFileServerLastModified { get; set; } - - [Column("SharePointFileServerRelativeURL")] - [StringLength(300)] - public string SharePointFileServerRelativeUrl { get; set; } = null!; - - [Column("SharePointFileSharePointLibraryID")] - public int SharePointFileSharePointLibraryId { get; set; } - - public byte[]? SharePointFileBinary { get; set; } - - [ForeignKey("SharePointFileSharePointLibraryId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; - - [ForeignKey("SharePointFileSiteId")] - [InverseProperty("SharePointSharePointFiles")] - public virtual CmsSite SharePointFileSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SharePoint_SharePointFile")] +[Index("SharePointFileSiteId", Name = "IX_SharePoint_SharePointFile_SharePointFileSiteID")] +[Index("SharePointFileSharePointLibraryId", "SharePointFileServerRelativeUrl", Name = "UQ_SharePoint_SharePointFile_LibraryID_ServerRelativeURL", IsUnique = true)] +public class SharePointSharePointFile +{ + [Key] + [Column("SharePointFileID")] + public int SharePointFileId { get; set; } + + [Column("SharePointFileGUID")] + public Guid SharePointFileGuid { get; set; } + + [Column("SharePointFileSiteID")] + public int SharePointFileSiteId { get; set; } + + [StringLength(150)] + public string SharePointFileName { get; set; } = null!; + + [StringLength(150)] + public string? SharePointFileExtension { get; set; } + + [StringLength(255)] + public string? SharePointFileMimeType { get; set; } + + [Column("SharePointFileETag")] + [StringLength(255)] + public string? SharePointFileEtag { get; set; } + + public long SharePointFileSize { get; set; } + + public DateTime SharePointFileServerLastModified { get; set; } + + [Column("SharePointFileServerRelativeURL")] + [StringLength(300)] + public string SharePointFileServerRelativeUrl { get; set; } = null!; + + [Column("SharePointFileSharePointLibraryID")] + public int SharePointFileSharePointLibraryId { get; set; } + + public byte[]? SharePointFileBinary { get; set; } + + [ForeignKey("SharePointFileSharePointLibraryId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual SharePointSharePointLibrary SharePointFileSharePointLibrary { get; set; } = null!; + + [ForeignKey("SharePointFileSiteId")] + [InverseProperty("SharePointSharePointFiles")] + public virtual CmsSite SharePointFileSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs b/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs index 7f2a9b42..3aa94dfa 100644 --- a/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs +++ b/Migration.Toolkit.KX13/Models/SharePointSharePointLibrary.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SharePoint_SharePointLibrary")] -[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] -[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] -public partial class SharePointSharePointLibrary -{ - [Key] - [Column("SharePointLibraryID")] - public int SharePointLibraryId { get; set; } - - [StringLength(100)] - public string SharePointLibraryName { get; set; } = null!; - - [Column("SharePointLibrarySharePointConnectionID")] - public int? SharePointLibrarySharePointConnectionId { get; set; } - - [StringLength(100)] - public string SharePointLibraryListTitle { get; set; } = null!; - - public int SharePointLibrarySynchronizationPeriod { get; set; } - - [Column("SharePointLibraryGUID")] - public Guid SharePointLibraryGuid { get; set; } - - [Column("SharePointLibrarySiteID")] - public int SharePointLibrarySiteId { get; set; } - - [StringLength(100)] - public string SharePointLibraryDisplayName { get; set; } = null!; - - public DateTime SharePointLibraryLastModified { get; set; } - - public int SharePointLibraryListType { get; set; } - - [ForeignKey("SharePointLibrarySharePointConnectionId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } - - [ForeignKey("SharePointLibrarySiteId")] - [InverseProperty("SharePointSharePointLibraries")] - public virtual CmsSite SharePointLibrarySite { get; set; } = null!; - - [InverseProperty("SharePointFileSharePointLibrary")] - public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SharePoint_SharePointLibrary")] +[Index("SharePointLibrarySharePointConnectionId", Name = "IX_SharePoint_SharePointLibrary_SharePointLibrarySharepointConnectionID")] +[Index("SharePointLibrarySiteId", Name = "IX_SharePoint_SharePointLibrary_SharePointlibrarySiteID")] +public class SharePointSharePointLibrary +{ + [Key] + [Column("SharePointLibraryID")] + public int SharePointLibraryId { get; set; } + + [StringLength(100)] + public string SharePointLibraryName { get; set; } = null!; + + [Column("SharePointLibrarySharePointConnectionID")] + public int? SharePointLibrarySharePointConnectionId { get; set; } + + [StringLength(100)] + public string SharePointLibraryListTitle { get; set; } = null!; + + public int SharePointLibrarySynchronizationPeriod { get; set; } + + [Column("SharePointLibraryGUID")] + public Guid SharePointLibraryGuid { get; set; } + + [Column("SharePointLibrarySiteID")] + public int SharePointLibrarySiteId { get; set; } + + [StringLength(100)] + public string SharePointLibraryDisplayName { get; set; } = null!; + + public DateTime SharePointLibraryLastModified { get; set; } + + public int SharePointLibraryListType { get; set; } + + [ForeignKey("SharePointLibrarySharePointConnectionId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual SharePointSharePointConnection? SharePointLibrarySharePointConnection { get; set; } + + [ForeignKey("SharePointLibrarySiteId")] + [InverseProperty("SharePointSharePointLibraries")] + public virtual CmsSite SharePointLibrarySite { get; set; } = null!; + + [InverseProperty("SharePointFileSharePointLibrary")] + public virtual ICollection SharePointSharePointFiles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs b/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs index d3faffd6..3f2f6f20 100644 --- a/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs +++ b/Migration.Toolkit.KX13/Models/SmFacebookAccount.cs @@ -1,55 +1,54 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_FacebookAccount")] -[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] -[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] -public partial class SmFacebookAccount -{ - [Key] - [Column("FacebookAccountID")] - public int FacebookAccountId { get; set; } - - [Column("FacebookAccountGUID")] - public Guid FacebookAccountGuid { get; set; } - - public DateTime FacebookAccountLastModified { get; set; } - - [Column("FacebookAccountSiteID")] - public int FacebookAccountSiteId { get; set; } - - [StringLength(200)] - public string FacebookAccountName { get; set; } = null!; - - [StringLength(200)] - public string FacebookAccountDisplayName { get; set; } = null!; - - [Column("FacebookAccountPageID")] - [StringLength(500)] - public string FacebookAccountPageId { get; set; } = null!; - - public string FacebookAccountPageAccessToken { get; set; } = null!; - - [Column("FacebookAccountFacebookApplicationID")] - public int FacebookAccountFacebookApplicationId { get; set; } - - public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } - - public bool? FacebookAccountIsDefault { get; set; } - - [ForeignKey("FacebookAccountFacebookApplicationId")] - [InverseProperty("SmFacebookAccounts")] - public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; - - [ForeignKey("FacebookAccountSiteId")] - [InverseProperty("SmFacebookAccounts")] - public virtual CmsSite FacebookAccountSite { get; set; } = null!; - - [InverseProperty("FacebookPostFacebookAccount")] - public virtual ICollection SmFacebookPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_FacebookAccount")] +[Index("FacebookAccountFacebookApplicationId", Name = "IX_SM_FacebookAccount_FacebookAccountFacebookApplicationID")] +[Index("FacebookAccountSiteId", Name = "IX_SM_FacebookAccount_FacebookAccountSiteID")] +public class SmFacebookAccount +{ + [Key] + [Column("FacebookAccountID")] + public int FacebookAccountId { get; set; } + + [Column("FacebookAccountGUID")] + public Guid FacebookAccountGuid { get; set; } + + public DateTime FacebookAccountLastModified { get; set; } + + [Column("FacebookAccountSiteID")] + public int FacebookAccountSiteId { get; set; } + + [StringLength(200)] + public string FacebookAccountName { get; set; } = null!; + + [StringLength(200)] + public string FacebookAccountDisplayName { get; set; } = null!; + + [Column("FacebookAccountPageID")] + [StringLength(500)] + public string FacebookAccountPageId { get; set; } = null!; + + public string FacebookAccountPageAccessToken { get; set; } = null!; + + [Column("FacebookAccountFacebookApplicationID")] + public int FacebookAccountFacebookApplicationId { get; set; } + + public DateTime? FacebookAccountPageAccessTokenExpiration { get; set; } + + public bool? FacebookAccountIsDefault { get; set; } + + [ForeignKey("FacebookAccountFacebookApplicationId")] + [InverseProperty("SmFacebookAccounts")] + public virtual SmFacebookApplication FacebookAccountFacebookApplication { get; set; } = null!; + + [ForeignKey("FacebookAccountSiteId")] + [InverseProperty("SmFacebookAccounts")] + public virtual CmsSite FacebookAccountSite { get; set; } = null!; + + [InverseProperty("FacebookPostFacebookAccount")] + public virtual ICollection SmFacebookPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs b/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs index b2465a85..35511549 100644 --- a/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs +++ b/Migration.Toolkit.KX13/Models/SmFacebookApplication.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_FacebookApplication")] -[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] -public partial class SmFacebookApplication -{ - [Key] - [Column("FacebookApplicationID")] - public int FacebookApplicationId { get; set; } - - [StringLength(500)] - public string FacebookApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string FacebookApplicationConsumerSecret { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationName { get; set; } = null!; - - [StringLength(200)] - public string FacebookApplicationDisplayName { get; set; } = null!; - - [Column("FacebookApplicationGUID")] - public Guid FacebookApplicationGuid { get; set; } - - public DateTime FacebookApplicationLastModified { get; set; } - - [Column("FacebookApplicationSiteID")] - public int FacebookApplicationSiteId { get; set; } - - [ForeignKey("FacebookApplicationSiteId")] - [InverseProperty("SmFacebookApplications")] - public virtual CmsSite FacebookApplicationSite { get; set; } = null!; - - [InverseProperty("FacebookAccountFacebookApplication")] - public virtual ICollection SmFacebookAccounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_FacebookApplication")] +[Index("FacebookApplicationSiteId", Name = "IX_SM_FacebookApplication_FacebookApplicationSiteID")] +public class SmFacebookApplication +{ + [Key] + [Column("FacebookApplicationID")] + public int FacebookApplicationId { get; set; } + + [StringLength(500)] + public string FacebookApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string FacebookApplicationConsumerSecret { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationName { get; set; } = null!; + + [StringLength(200)] + public string FacebookApplicationDisplayName { get; set; } = null!; + + [Column("FacebookApplicationGUID")] + public Guid FacebookApplicationGuid { get; set; } + + public DateTime FacebookApplicationLastModified { get; set; } + + [Column("FacebookApplicationSiteID")] + public int FacebookApplicationSiteId { get; set; } + + [ForeignKey("FacebookApplicationSiteId")] + [InverseProperty("SmFacebookApplications")] + public virtual CmsSite FacebookApplicationSite { get; set; } = null!; + + [InverseProperty("FacebookAccountFacebookApplication")] + public virtual ICollection SmFacebookAccounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/SmFacebookPost.cs b/Migration.Toolkit.KX13/Models/SmFacebookPost.cs index 92f22b7d..69c3dac7 100644 --- a/Migration.Toolkit.KX13/Models/SmFacebookPost.cs +++ b/Migration.Toolkit.KX13/Models/SmFacebookPost.cs @@ -1,89 +1,88 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_FacebookPost")] -[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] -[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] -[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] -public partial class SmFacebookPost -{ - [Key] - [Column("FacebookPostID")] - public int FacebookPostId { get; set; } - - [Column("FacebookPostGUID")] - public Guid FacebookPostGuid { get; set; } - - public DateTime FacebookPostLastModified { get; set; } - - [Column("FacebookPostSiteID")] - public int FacebookPostSiteId { get; set; } - - [Column("FacebookPostFacebookAccountID")] - public int FacebookPostFacebookAccountId { get; set; } - - public string FacebookPostText { get; set; } = null!; - - [Column("FacebookPostURLShortenerType")] - public int? FacebookPostUrlshortenerType { get; set; } - - public int? FacebookPostErrorCode { get; set; } - - public int? FacebookPostErrorSubcode { get; set; } - - [Column("FacebookPostExternalID")] - public string? FacebookPostExternalId { get; set; } - - public DateTime? FacebookPostPublishedDateTime { get; set; } - - public DateTime? FacebookPostScheduledPublishDateTime { get; set; } - - [Column("FacebookPostCampaignID")] - public int? FacebookPostCampaignId { get; set; } - - public bool? FacebookPostPostAfterDocumentPublish { get; set; } - - public int? FacebookPostInsightPeopleReached { get; set; } - - public int? FacebookPostInsightLikesFromPage { get; set; } - - public int? FacebookPostInsightCommentsFromPage { get; set; } - - public int? FacebookPostInsightSharesFromPage { get; set; } - - public int? FacebookPostInsightLikesTotal { get; set; } - - public int? FacebookPostInsightCommentsTotal { get; set; } - - public int? FacebookPostInsightNegativeHidePost { get; set; } - - public int? FacebookPostInsightNegativeHideAllPosts { get; set; } - - public int? FacebookPostInsightNegativeReportSpam { get; set; } - - public int? FacebookPostInsightNegativeUnlikePage { get; set; } - - public DateTime? FacebookPostInsightsLastUpdated { get; set; } - - [Column("FacebookPostDocumentGUID")] - public Guid? FacebookPostDocumentGuid { get; set; } - - public bool? FacebookPostIsCreatedByUser { get; set; } - - [ForeignKey("FacebookPostCampaignId")] - [InverseProperty("SmFacebookPosts")] - public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } - - [ForeignKey("FacebookPostFacebookAccountId")] - [InverseProperty("SmFacebookPosts")] - public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; - - [ForeignKey("FacebookPostSiteId")] - [InverseProperty("SmFacebookPosts")] - public virtual CmsSite FacebookPostSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_FacebookPost")] +[Index("FacebookPostCampaignId", Name = "IX_SM_FacebookPost_FacebookPostCampaignID")] +[Index("FacebookPostFacebookAccountId", Name = "IX_SM_FacebookPost_FacebookPostFacebookAccountID")] +[Index("FacebookPostSiteId", Name = "IX_SM_FacebookPost_FacebookPostSiteID")] +public class SmFacebookPost +{ + [Key] + [Column("FacebookPostID")] + public int FacebookPostId { get; set; } + + [Column("FacebookPostGUID")] + public Guid FacebookPostGuid { get; set; } + + public DateTime FacebookPostLastModified { get; set; } + + [Column("FacebookPostSiteID")] + public int FacebookPostSiteId { get; set; } + + [Column("FacebookPostFacebookAccountID")] + public int FacebookPostFacebookAccountId { get; set; } + + public string FacebookPostText { get; set; } = null!; + + [Column("FacebookPostURLShortenerType")] + public int? FacebookPostUrlshortenerType { get; set; } + + public int? FacebookPostErrorCode { get; set; } + + public int? FacebookPostErrorSubcode { get; set; } + + [Column("FacebookPostExternalID")] + public string? FacebookPostExternalId { get; set; } + + public DateTime? FacebookPostPublishedDateTime { get; set; } + + public DateTime? FacebookPostScheduledPublishDateTime { get; set; } + + [Column("FacebookPostCampaignID")] + public int? FacebookPostCampaignId { get; set; } + + public bool? FacebookPostPostAfterDocumentPublish { get; set; } + + public int? FacebookPostInsightPeopleReached { get; set; } + + public int? FacebookPostInsightLikesFromPage { get; set; } + + public int? FacebookPostInsightCommentsFromPage { get; set; } + + public int? FacebookPostInsightSharesFromPage { get; set; } + + public int? FacebookPostInsightLikesTotal { get; set; } + + public int? FacebookPostInsightCommentsTotal { get; set; } + + public int? FacebookPostInsightNegativeHidePost { get; set; } + + public int? FacebookPostInsightNegativeHideAllPosts { get; set; } + + public int? FacebookPostInsightNegativeReportSpam { get; set; } + + public int? FacebookPostInsightNegativeUnlikePage { get; set; } + + public DateTime? FacebookPostInsightsLastUpdated { get; set; } + + [Column("FacebookPostDocumentGUID")] + public Guid? FacebookPostDocumentGuid { get; set; } + + public bool? FacebookPostIsCreatedByUser { get; set; } + + [ForeignKey("FacebookPostCampaignId")] + [InverseProperty("SmFacebookPosts")] + public virtual AnalyticsCampaign? FacebookPostCampaign { get; set; } + + [ForeignKey("FacebookPostFacebookAccountId")] + [InverseProperty("SmFacebookPosts")] + public virtual SmFacebookAccount FacebookPostFacebookAccount { get; set; } = null!; + + [ForeignKey("FacebookPostSiteId")] + [InverseProperty("SmFacebookPosts")] + public virtual CmsSite FacebookPostSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmInsight.cs b/Migration.Toolkit.KX13/Models/SmInsight.cs index 0a53e679..71868dba 100644 --- a/Migration.Toolkit.KX13/Models/SmInsight.cs +++ b/Migration.Toolkit.KX13/Models/SmInsight.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_Insight")] -[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] -public partial class SmInsight -{ - [Key] - [Column("InsightID")] - public int InsightId { get; set; } - - [StringLength(200)] - public string InsightCodeName { get; set; } = null!; - - [Column("InsightExternalID")] - public string InsightExternalId { get; set; } = null!; - - [StringLength(20)] - public string InsightPeriodType { get; set; } = null!; - - public string? InsightValueName { get; set; } - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitDays { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitMonths { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); - - [InverseProperty("InsightHitInsight")] - public virtual ICollection SmInsightHitYears { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_Insight")] +[Index("InsightCodeName", "InsightPeriodType", Name = "IX_SM_Insight_InsightCodeName_InsightPeriodType")] +public class SmInsight +{ + [Key] + [Column("InsightID")] + public int InsightId { get; set; } + + [StringLength(200)] + public string InsightCodeName { get; set; } = null!; + + [Column("InsightExternalID")] + public string InsightExternalId { get; set; } = null!; + + [StringLength(20)] + public string InsightPeriodType { get; set; } = null!; + + public string? InsightValueName { get; set; } + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitDays { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitMonths { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitWeeks { get; set; } = new List(); + + [InverseProperty("InsightHitInsight")] + public virtual ICollection SmInsightHitYears { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs b/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs index f52eb1c6..a28f2ba8 100644 --- a/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs +++ b/Migration.Toolkit.KX13/Models/SmInsightHitDay.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_InsightHit_Day")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitDay -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitDays")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_InsightHit_Day")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Day_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitDay +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitDays")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs b/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs index 9245eb05..6237d884 100644 --- a/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs +++ b/Migration.Toolkit.KX13/Models/SmInsightHitMonth.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_InsightHit_Month")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitMonth -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitMonths")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_InsightHit_Month")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Month_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitMonth +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitMonths")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs b/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs index 511a9b45..f06ebd62 100644 --- a/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs +++ b/Migration.Toolkit.KX13/Models/SmInsightHitWeek.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_InsightHit_Week")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitWeek -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitWeeks")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_InsightHit_Week")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Week_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitWeek +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitWeeks")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs b/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs index f60e757f..02539f39 100644 --- a/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs +++ b/Migration.Toolkit.KX13/Models/SmInsightHitYear.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_InsightHit_Year")] -[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] -public partial class SmInsightHitYear -{ - [Key] - [Column("InsightHitID")] - public int InsightHitId { get; set; } - - public DateTime InsightHitPeriodFrom { get; set; } - - public DateTime InsightHitPeriodTo { get; set; } - - public long InsightHitValue { get; set; } - - [Column("InsightHitInsightID")] - public int InsightHitInsightId { get; set; } - - [ForeignKey("InsightHitInsightId")] - [InverseProperty("SmInsightHitYears")] - public virtual SmInsight InsightHitInsight { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_InsightHit_Year")] +[Index("InsightHitInsightId", "InsightHitPeriodFrom", "InsightHitPeriodTo", Name = "UQ_SM_InsightHit_Year_InsightHitInsightID_InsightHitPeriodFrom_InsightHitPeriodTo", IsUnique = true)] +public class SmInsightHitYear +{ + [Key] + [Column("InsightHitID")] + public int InsightHitId { get; set; } + + public DateTime InsightHitPeriodFrom { get; set; } + + public DateTime InsightHitPeriodTo { get; set; } + + public long InsightHitValue { get; set; } + + [Column("InsightHitInsightID")] + public int InsightHitInsightId { get; set; } + + [ForeignKey("InsightHitInsightId")] + [InverseProperty("SmInsightHitYears")] + public virtual SmInsight InsightHitInsight { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs b/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs index 82ec9965..2c9c7b36 100644 --- a/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs +++ b/Migration.Toolkit.KX13/Models/SmLinkedInAccount.cs @@ -1,49 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_LinkedInAccount")] -public partial class SmLinkedInAccount -{ - [Key] - [Column("LinkedInAccountID")] - public int LinkedInAccountId { get; set; } - - [StringLength(200)] - public string LinkedInAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInAccountName { get; set; } = null!; - - public bool? LinkedInAccountIsDefault { get; set; } - - [StringLength(500)] - public string LinkedInAccountAccessToken { get; set; } = null!; - - public DateTime LinkedInAccountLastModified { get; set; } - - [Column("LinkedInAccountGUID")] - public Guid LinkedInAccountGuid { get; set; } - - [Column("LinkedInAccountSiteID")] - public int LinkedInAccountSiteId { get; set; } - - [Column("LinkedInAccountProfileID")] - [StringLength(50)] - public string LinkedInAccountProfileId { get; set; } = null!; - - [Column("LinkedInAccountLinkedInApplicationID")] - public int LinkedInAccountLinkedInApplicationId { get; set; } - - [StringLength(200)] - public string? LinkedInAccountProfileName { get; set; } - - public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } - - [InverseProperty("LinkedInPostLinkedInAccount")] - public virtual ICollection SmLinkedInPosts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_LinkedInAccount")] +public class SmLinkedInAccount +{ + [Key] + [Column("LinkedInAccountID")] + public int LinkedInAccountId { get; set; } + + [StringLength(200)] + public string LinkedInAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInAccountName { get; set; } = null!; + + public bool? LinkedInAccountIsDefault { get; set; } + + [StringLength(500)] + public string LinkedInAccountAccessToken { get; set; } = null!; + + public DateTime LinkedInAccountLastModified { get; set; } + + [Column("LinkedInAccountGUID")] + public Guid LinkedInAccountGuid { get; set; } + + [Column("LinkedInAccountSiteID")] + public int LinkedInAccountSiteId { get; set; } + + [Column("LinkedInAccountProfileID")] + [StringLength(50)] + public string LinkedInAccountProfileId { get; set; } = null!; + + [Column("LinkedInAccountLinkedInApplicationID")] + public int LinkedInAccountLinkedInApplicationId { get; set; } + + [StringLength(200)] + public string? LinkedInAccountProfileName { get; set; } + + public DateTime? LinkedInAccountAccessTokenExpiration { get; set; } + + [InverseProperty("LinkedInPostLinkedInAccount")] + public virtual ICollection SmLinkedInPosts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs b/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs index 1bb160c1..3783c570 100644 --- a/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs +++ b/Migration.Toolkit.KX13/Models/SmLinkedInApplication.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_LinkedInApplication")] -[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] -public partial class SmLinkedInApplication -{ - [Key] - [Column("LinkedInApplicationID")] - public int LinkedInApplicationId { get; set; } - - [StringLength(200)] - public string LinkedInApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string LinkedInApplicationName { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerSecret { get; set; } = null!; - - [StringLength(500)] - public string LinkedInApplicationConsumerKey { get; set; } = null!; - - public DateTime LinkedInApplicationLastModified { get; set; } - - [Column("LinkedInApplicationGUID")] - public Guid LinkedInApplicationGuid { get; set; } - - [Column("LinkedInApplicationSiteID")] - public int LinkedInApplicationSiteId { get; set; } - - [ForeignKey("LinkedInApplicationSiteId")] - [InverseProperty("SmLinkedInApplications")] - public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_LinkedInApplication")] +[Index("LinkedInApplicationSiteId", Name = "IX_SM_LinkedInApplication_LinkedInApplicationSiteID")] +public class SmLinkedInApplication +{ + [Key] + [Column("LinkedInApplicationID")] + public int LinkedInApplicationId { get; set; } + + [StringLength(200)] + public string LinkedInApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string LinkedInApplicationName { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerSecret { get; set; } = null!; + + [StringLength(500)] + public string LinkedInApplicationConsumerKey { get; set; } = null!; + + public DateTime LinkedInApplicationLastModified { get; set; } + + [Column("LinkedInApplicationGUID")] + public Guid LinkedInApplicationGuid { get; set; } + + [Column("LinkedInApplicationSiteID")] + public int LinkedInApplicationSiteId { get; set; } + + [ForeignKey("LinkedInApplicationSiteId")] + [InverseProperty("SmLinkedInApplications")] + public virtual CmsSite LinkedInApplicationSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs b/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs index c0cec1e7..80644944 100644 --- a/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs +++ b/Migration.Toolkit.KX13/Models/SmLinkedInPost.cs @@ -1,85 +1,84 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_LinkedInPost")] -[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] -[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] -[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] -public partial class SmLinkedInPost -{ - [Key] - [Column("LinkedInPostID")] - public int LinkedInPostId { get; set; } - - [Column("LinkedInPostLinkedInAccountID")] - public int LinkedInPostLinkedInAccountId { get; set; } - - [StringLength(700)] - public string LinkedInPostComment { get; set; } = null!; - - [Column("LinkedInPostSiteID")] - public int LinkedInPostSiteId { get; set; } - - [Column("LinkedInPostGUID")] - public Guid LinkedInPostGuid { get; set; } - - public DateTime? LinkedInPostLastModified { get; set; } - - [StringLength(200)] - public string? LinkedInPostUpdateKey { get; set; } - - [Column("LinkedInPostURLShortenerType")] - public int? LinkedInPostUrlshortenerType { get; set; } - - public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } - - [Column("LinkedInPostCampaignID")] - public int? LinkedInPostCampaignId { get; set; } - - public DateTime? LinkedInPostPublishedDateTime { get; set; } - - [Column("LinkedInPostHTTPStatusCode")] - public int? LinkedInPostHttpstatusCode { get; set; } - - public int? LinkedInPostErrorCode { get; set; } - - public string? LinkedInPostErrorMessage { get; set; } - - [Column("LinkedInPostDocumentGUID")] - public Guid? LinkedInPostDocumentGuid { get; set; } - - public bool? LinkedInPostIsCreatedByUser { get; set; } - - public bool? LinkedInPostPostAfterDocumentPublish { get; set; } - - public DateTime? LinkedInPostInsightsLastUpdated { get; set; } - - public int? LinkedInPostCommentCount { get; set; } - - public int? LinkedInPostImpressionCount { get; set; } - - public int? LinkedInPostLikeCount { get; set; } - - public int? LinkedInPostShareCount { get; set; } - - public int? LinkedInPostClickCount { get; set; } - - public double? LinkedInPostEngagement { get; set; } - - [ForeignKey("LinkedInPostCampaignId")] - [InverseProperty("SmLinkedInPosts")] - public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } - - [ForeignKey("LinkedInPostLinkedInAccountId")] - [InverseProperty("SmLinkedInPosts")] - public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; - - [ForeignKey("LinkedInPostSiteId")] - [InverseProperty("SmLinkedInPosts")] - public virtual CmsSite LinkedInPostSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_LinkedInPost")] +[Index("LinkedInPostCampaignId", Name = "IX_SM_LinkedInPost_LinkedInPostCampaignID")] +[Index("LinkedInPostLinkedInAccountId", Name = "IX_SM_LinkedInPost_LinkedInPostLinkedInAccountID")] +[Index("LinkedInPostSiteId", Name = "IX_SM_LinkedInPost_LinkedInPostSiteID")] +public class SmLinkedInPost +{ + [Key] + [Column("LinkedInPostID")] + public int LinkedInPostId { get; set; } + + [Column("LinkedInPostLinkedInAccountID")] + public int LinkedInPostLinkedInAccountId { get; set; } + + [StringLength(700)] + public string LinkedInPostComment { get; set; } = null!; + + [Column("LinkedInPostSiteID")] + public int LinkedInPostSiteId { get; set; } + + [Column("LinkedInPostGUID")] + public Guid LinkedInPostGuid { get; set; } + + public DateTime? LinkedInPostLastModified { get; set; } + + [StringLength(200)] + public string? LinkedInPostUpdateKey { get; set; } + + [Column("LinkedInPostURLShortenerType")] + public int? LinkedInPostUrlshortenerType { get; set; } + + public DateTime? LinkedInPostScheduledPublishDateTime { get; set; } + + [Column("LinkedInPostCampaignID")] + public int? LinkedInPostCampaignId { get; set; } + + public DateTime? LinkedInPostPublishedDateTime { get; set; } + + [Column("LinkedInPostHTTPStatusCode")] + public int? LinkedInPostHttpstatusCode { get; set; } + + public int? LinkedInPostErrorCode { get; set; } + + public string? LinkedInPostErrorMessage { get; set; } + + [Column("LinkedInPostDocumentGUID")] + public Guid? LinkedInPostDocumentGuid { get; set; } + + public bool? LinkedInPostIsCreatedByUser { get; set; } + + public bool? LinkedInPostPostAfterDocumentPublish { get; set; } + + public DateTime? LinkedInPostInsightsLastUpdated { get; set; } + + public int? LinkedInPostCommentCount { get; set; } + + public int? LinkedInPostImpressionCount { get; set; } + + public int? LinkedInPostLikeCount { get; set; } + + public int? LinkedInPostShareCount { get; set; } + + public int? LinkedInPostClickCount { get; set; } + + public double? LinkedInPostEngagement { get; set; } + + [ForeignKey("LinkedInPostCampaignId")] + [InverseProperty("SmLinkedInPosts")] + public virtual AnalyticsCampaign? LinkedInPostCampaign { get; set; } + + [ForeignKey("LinkedInPostLinkedInAccountId")] + [InverseProperty("SmLinkedInPosts")] + public virtual SmLinkedInAccount LinkedInPostLinkedInAccount { get; set; } = null!; + + [ForeignKey("LinkedInPostSiteId")] + [InverseProperty("SmLinkedInPosts")] + public virtual CmsSite LinkedInPostSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs b/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs index 4cb1a5f6..2e920ef8 100644 --- a/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs +++ b/Migration.Toolkit.KX13/Models/SmTwitterAccount.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_TwitterAccount")] -[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] -[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] -public partial class SmTwitterAccount -{ - [Key] - [Column("TwitterAccountID")] - public int TwitterAccountId { get; set; } - - [StringLength(200)] - public string TwitterAccountDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterAccountName { get; set; } = null!; - - public DateTime TwitterAccountLastModified { get; set; } - - [Column("TwitterAccountGUID")] - public Guid TwitterAccountGuid { get; set; } - - [Column("TwitterAccountSiteID")] - public int TwitterAccountSiteId { get; set; } - - [StringLength(500)] - public string TwitterAccountAccessToken { get; set; } = null!; - - [StringLength(500)] - public string TwitterAccountAccessTokenSecret { get; set; } = null!; - - [Column("TwitterAccountTwitterApplicationID")] - public int TwitterAccountTwitterApplicationId { get; set; } - - public int? TwitterAccountFollowers { get; set; } - - public int? TwitterAccountMentions { get; set; } - - [StringLength(40)] - public string? TwitterAccountMentionsRange { get; set; } - - [Column("TwitterAccountUserID")] - [StringLength(20)] - public string? TwitterAccountUserId { get; set; } - - public bool? TwitterAccountIsDefault { get; set; } - - [InverseProperty("TwitterPostTwitterAccount")] - public virtual ICollection SmTwitterPosts { get; set; } = new List(); - - [ForeignKey("TwitterAccountSiteId")] - [InverseProperty("SmTwitterAccounts")] - public virtual CmsSite TwitterAccountSite { get; set; } = null!; - - [ForeignKey("TwitterAccountTwitterApplicationId")] - [InverseProperty("SmTwitterAccounts")] - public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_TwitterAccount")] +[Index("TwitterAccountSiteId", Name = "IX_SM_TwitterAccount_TwitterAccountSiteID")] +[Index("TwitterAccountTwitterApplicationId", Name = "IX_SM_TwitterAccount_TwitterAccountTwitterApplicationID")] +public class SmTwitterAccount +{ + [Key] + [Column("TwitterAccountID")] + public int TwitterAccountId { get; set; } + + [StringLength(200)] + public string TwitterAccountDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterAccountName { get; set; } = null!; + + public DateTime TwitterAccountLastModified { get; set; } + + [Column("TwitterAccountGUID")] + public Guid TwitterAccountGuid { get; set; } + + [Column("TwitterAccountSiteID")] + public int TwitterAccountSiteId { get; set; } + + [StringLength(500)] + public string TwitterAccountAccessToken { get; set; } = null!; + + [StringLength(500)] + public string TwitterAccountAccessTokenSecret { get; set; } = null!; + + [Column("TwitterAccountTwitterApplicationID")] + public int TwitterAccountTwitterApplicationId { get; set; } + + public int? TwitterAccountFollowers { get; set; } + + public int? TwitterAccountMentions { get; set; } + + [StringLength(40)] + public string? TwitterAccountMentionsRange { get; set; } + + [Column("TwitterAccountUserID")] + [StringLength(20)] + public string? TwitterAccountUserId { get; set; } + + public bool? TwitterAccountIsDefault { get; set; } + + [InverseProperty("TwitterPostTwitterAccount")] + public virtual ICollection SmTwitterPosts { get; set; } = new List(); + + [ForeignKey("TwitterAccountSiteId")] + [InverseProperty("SmTwitterAccounts")] + public virtual CmsSite TwitterAccountSite { get; set; } = null!; + + [ForeignKey("TwitterAccountTwitterApplicationId")] + [InverseProperty("SmTwitterAccounts")] + public virtual SmTwitterApplication TwitterAccountTwitterApplication { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs b/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs index 4c7e1bd5..6d451e34 100644 --- a/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs +++ b/Migration.Toolkit.KX13/Models/SmTwitterApplication.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_TwitterApplication")] -[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] -public partial class SmTwitterApplication -{ - [Key] - [Column("TwitterApplicationID")] - public int TwitterApplicationId { get; set; } - - [StringLength(200)] - public string TwitterApplicationDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TwitterApplicationName { get; set; } = null!; - - public DateTime TwitterApplicationLastModified { get; set; } - - [Column("TwitterApplicationGUID")] - public Guid TwitterApplicationGuid { get; set; } - - [Column("TwitterApplicationSiteID")] - public int TwitterApplicationSiteId { get; set; } - - [StringLength(500)] - public string TwitterApplicationConsumerKey { get; set; } = null!; - - [StringLength(500)] - public string TwitterApplicationConsumerSecret { get; set; } = null!; - - [InverseProperty("TwitterAccountTwitterApplication")] - public virtual ICollection SmTwitterAccounts { get; set; } = new List(); - - [ForeignKey("TwitterApplicationSiteId")] - [InverseProperty("SmTwitterApplications")] - public virtual CmsSite TwitterApplicationSite { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_TwitterApplication")] +[Index("TwitterApplicationSiteId", Name = "IX_SM_TwitterApplication_TwitterApplicationSiteID")] +public class SmTwitterApplication +{ + [Key] + [Column("TwitterApplicationID")] + public int TwitterApplicationId { get; set; } + + [StringLength(200)] + public string TwitterApplicationDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TwitterApplicationName { get; set; } = null!; + + public DateTime TwitterApplicationLastModified { get; set; } + + [Column("TwitterApplicationGUID")] + public Guid TwitterApplicationGuid { get; set; } + + [Column("TwitterApplicationSiteID")] + public int TwitterApplicationSiteId { get; set; } + + [StringLength(500)] + public string TwitterApplicationConsumerKey { get; set; } = null!; + + [StringLength(500)] + public string TwitterApplicationConsumerSecret { get; set; } = null!; + + [InverseProperty("TwitterAccountTwitterApplication")] + public virtual ICollection SmTwitterAccounts { get; set; } = new List(); + + [ForeignKey("TwitterApplicationSiteId")] + [InverseProperty("SmTwitterApplications")] + public virtual CmsSite TwitterApplicationSite { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/SmTwitterPost.cs b/Migration.Toolkit.KX13/Models/SmTwitterPost.cs index 0b24ad50..ccf0838e 100644 --- a/Migration.Toolkit.KX13/Models/SmTwitterPost.cs +++ b/Migration.Toolkit.KX13/Models/SmTwitterPost.cs @@ -1,71 +1,70 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("SM_TwitterPost")] -[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] -[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] -[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] -public partial class SmTwitterPost -{ - [Key] - [Column("TwitterPostID")] - public int TwitterPostId { get; set; } - - [Column("TwitterPostGUID")] - public Guid TwitterPostGuid { get; set; } - - public DateTime TwitterPostLastModified { get; set; } - - [Column("TwitterPostSiteID")] - public int TwitterPostSiteId { get; set; } - - [Column("TwitterPostTwitterAccountID")] - public int TwitterPostTwitterAccountId { get; set; } - - public string TwitterPostText { get; set; } = null!; - - [Column("TwitterPostURLShortenerType")] - public int? TwitterPostUrlshortenerType { get; set; } - - [Column("TwitterPostExternalID")] - public string? TwitterPostExternalId { get; set; } - - public int? TwitterPostErrorCode { get; set; } - - public DateTime? TwitterPostPublishedDateTime { get; set; } - - public DateTime? TwitterPostScheduledPublishDateTime { get; set; } - - [Column("TwitterPostCampaignID")] - public int? TwitterPostCampaignId { get; set; } - - public int? TwitterPostFavorites { get; set; } - - public int? TwitterPostRetweets { get; set; } - - public bool? TwitterPostPostAfterDocumentPublish { get; set; } - - public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } - - [Column("TwitterPostDocumentGUID")] - public Guid? TwitterPostDocumentGuid { get; set; } - - public bool? TwitterPostIsCreatedByUser { get; set; } - - [ForeignKey("TwitterPostCampaignId")] - [InverseProperty("SmTwitterPosts")] - public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } - - [ForeignKey("TwitterPostSiteId")] - [InverseProperty("SmTwitterPosts")] - public virtual CmsSite TwitterPostSite { get; set; } = null!; - - [ForeignKey("TwitterPostTwitterAccountId")] - [InverseProperty("SmTwitterPosts")] - public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("SM_TwitterPost")] +[Index("TwitterPostCampaignId", Name = "IX_SM_TwitterPost_TwitterPostCampaignID")] +[Index("TwitterPostSiteId", Name = "IX_SM_TwitterPost_TwitterPostSiteID")] +[Index("TwitterPostTwitterAccountId", Name = "IX_SM_TwitterPost_TwitterPostTwitterAccountID")] +public class SmTwitterPost +{ + [Key] + [Column("TwitterPostID")] + public int TwitterPostId { get; set; } + + [Column("TwitterPostGUID")] + public Guid TwitterPostGuid { get; set; } + + public DateTime TwitterPostLastModified { get; set; } + + [Column("TwitterPostSiteID")] + public int TwitterPostSiteId { get; set; } + + [Column("TwitterPostTwitterAccountID")] + public int TwitterPostTwitterAccountId { get; set; } + + public string TwitterPostText { get; set; } = null!; + + [Column("TwitterPostURLShortenerType")] + public int? TwitterPostUrlshortenerType { get; set; } + + [Column("TwitterPostExternalID")] + public string? TwitterPostExternalId { get; set; } + + public int? TwitterPostErrorCode { get; set; } + + public DateTime? TwitterPostPublishedDateTime { get; set; } + + public DateTime? TwitterPostScheduledPublishDateTime { get; set; } + + [Column("TwitterPostCampaignID")] + public int? TwitterPostCampaignId { get; set; } + + public int? TwitterPostFavorites { get; set; } + + public int? TwitterPostRetweets { get; set; } + + public bool? TwitterPostPostAfterDocumentPublish { get; set; } + + public DateTime? TwitterPostInsightsUpdateDateTime { get; set; } + + [Column("TwitterPostDocumentGUID")] + public Guid? TwitterPostDocumentGuid { get; set; } + + public bool? TwitterPostIsCreatedByUser { get; set; } + + [ForeignKey("TwitterPostCampaignId")] + [InverseProperty("SmTwitterPosts")] + public virtual AnalyticsCampaign? TwitterPostCampaign { get; set; } + + [ForeignKey("TwitterPostSiteId")] + [InverseProperty("SmTwitterPosts")] + public virtual CmsSite TwitterPostSite { get; set; } = null!; + + [ForeignKey("TwitterPostTwitterAccountId")] + [InverseProperty("SmTwitterPosts")] + public virtual SmTwitterAccount TwitterPostTwitterAccount { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/StagingServer.cs b/Migration.Toolkit.KX13/Models/StagingServer.cs index a6a8fc28..018b5bcb 100644 --- a/Migration.Toolkit.KX13/Models/StagingServer.cs +++ b/Migration.Toolkit.KX13/Models/StagingServer.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Staging_Server")] -[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] -[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] -public partial class StagingServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(100)] - public string ServerName { get; set; } = null!; - - [StringLength(440)] - public string ServerDisplayName { get; set; } = null!; - - [Column("ServerSiteID")] - public int ServerSiteId { get; set; } - - [Column("ServerURL")] - [StringLength(450)] - public string ServerUrl { get; set; } = null!; - - [Required] - public bool? ServerEnabled { get; set; } - - [StringLength(20)] - public string ServerAuthentication { get; set; } = null!; - - [StringLength(100)] - public string? ServerUsername { get; set; } - - [StringLength(100)] - public string? ServerPassword { get; set; } - - [Column("ServerX509ClientKeyID")] - [StringLength(200)] - public string? ServerX509clientKeyId { get; set; } - - [Column("ServerX509ServerKeyID")] - [StringLength(200)] - public string? ServerX509serverKeyId { get; set; } - - [Column("ServerGUID")] - public Guid ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - [ForeignKey("ServerSiteId")] - [InverseProperty("StagingServers")] - public virtual CmsSite ServerSite { get; set; } = null!; - - [InverseProperty("SynchronizationServer")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Staging_Server")] +[Index("ServerEnabled", Name = "IX_Staging_Server_ServerEnabled")] +[Index("ServerSiteId", Name = "IX_Staging_Server_ServerSiteID")] +public class StagingServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(100)] + public string ServerName { get; set; } = null!; + + [StringLength(440)] + public string ServerDisplayName { get; set; } = null!; + + [Column("ServerSiteID")] + public int ServerSiteId { get; set; } + + [Column("ServerURL")] + [StringLength(450)] + public string ServerUrl { get; set; } = null!; + + [Required] + public bool? ServerEnabled { get; set; } + + [StringLength(20)] + public string ServerAuthentication { get; set; } = null!; + + [StringLength(100)] + public string? ServerUsername { get; set; } + + [StringLength(100)] + public string? ServerPassword { get; set; } + + [Column("ServerX509ClientKeyID")] + [StringLength(200)] + public string? ServerX509clientKeyId { get; set; } + + [Column("ServerX509ServerKeyID")] + [StringLength(200)] + public string? ServerX509serverKeyId { get; set; } + + [Column("ServerGUID")] + public Guid ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + [ForeignKey("ServerSiteId")] + [InverseProperty("StagingServers")] + public virtual CmsSite ServerSite { get; set; } = null!; + + [InverseProperty("SynchronizationServer")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/StagingSynchronization.cs b/Migration.Toolkit.KX13/Models/StagingSynchronization.cs index 2fe344e9..d9f8ded1 100644 --- a/Migration.Toolkit.KX13/Models/StagingSynchronization.cs +++ b/Migration.Toolkit.KX13/Models/StagingSynchronization.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Staging_Synchronization")] -[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] -[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] -public partial class StagingSynchronization -{ - [Key] - [Column("SynchronizationID")] - public int SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int SynchronizationTaskId { get; set; } - - [Column("SynchronizationServerID")] - public int SynchronizationServerId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - [ForeignKey("SynchronizationServerId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingServer SynchronizationServer { get; set; } = null!; - - [ForeignKey("SynchronizationTaskId")] - [InverseProperty("StagingSynchronizations")] - public virtual StagingTask SynchronizationTask { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Staging_Synchronization")] +[Index("SynchronizationServerId", Name = "IX_Staging_Synchronization_SynchronizationServerID")] +[Index("SynchronizationTaskId", Name = "IX_Staging_Synchronization_SynchronizationTaskID")] +public class StagingSynchronization +{ + [Key] + [Column("SynchronizationID")] + public int SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int SynchronizationTaskId { get; set; } + + [Column("SynchronizationServerID")] + public int SynchronizationServerId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + [ForeignKey("SynchronizationServerId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingServer SynchronizationServer { get; set; } = null!; + + [ForeignKey("SynchronizationTaskId")] + [InverseProperty("StagingSynchronizations")] + public virtual StagingTask SynchronizationTask { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/StagingTask.cs b/Migration.Toolkit.KX13/Models/StagingTask.cs index 838b2128..1d291cd1 100644 --- a/Migration.Toolkit.KX13/Models/StagingTask.cs +++ b/Migration.Toolkit.KX13/Models/StagingTask.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Staging_Task")] -[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] -[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] -[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] -[Index("TaskType", Name = "IX_Staging_Task_TaskType")] -public partial class StagingTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool? TaskRunning { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - public string? TaskServers { get; set; } - - [InverseProperty("SynchronizationTask")] - public virtual ICollection StagingSynchronizations { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("Task")] - public virtual ICollection StagingTaskUsers { get; set; } = new List(); - - [ForeignKey("TaskSiteId")] - [InverseProperty("StagingTasks")] - public virtual CmsSite? TaskSite { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Staging_Task")] +[Index("TaskDocumentId", "TaskNodeId", "TaskRunning", Name = "IX_Staging_Task_TaskDocumentID_TaskNodeID_TaskRunning")] +[Index("TaskObjectType", "TaskObjectId", "TaskRunning", Name = "IX_Staging_Task_TaskObjectType_TaskObjectID_TaskRunning")] +[Index("TaskSiteId", Name = "IX_Staging_Task_TaskSiteID")] +[Index("TaskType", Name = "IX_Staging_Task_TaskType")] +public class StagingTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool? TaskRunning { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + public string? TaskServers { get; set; } + + [InverseProperty("SynchronizationTask")] + public virtual ICollection StagingSynchronizations { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("Task")] + public virtual ICollection StagingTaskUsers { get; set; } = new List(); + + [ForeignKey("TaskSiteId")] + [InverseProperty("StagingTasks")] + public virtual CmsSite? TaskSite { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs index 045b77b8..182c2598 100644 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs +++ b/Migration.Toolkit.KX13/Models/StagingTaskGroup.cs @@ -1,28 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("staging_TaskGroup")] -public partial class StagingTaskGroup -{ - [Key] - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [StringLength(50)] - public string TaskGroupCodeName { get; set; } = null!; - - public Guid TaskGroupGuid { get; set; } - - public string? TaskGroupDescription { get; set; } - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); - - [InverseProperty("TaskGroup")] - public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("staging_TaskGroup")] +public class StagingTaskGroup +{ + [Key] + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [StringLength(50)] + public string TaskGroupCodeName { get; set; } = null!; + + public Guid TaskGroupGuid { get; set; } + + public string? TaskGroupDescription { get; set; } + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupTasks { get; set; } = new List(); + + [InverseProperty("TaskGroup")] + public virtual ICollection StagingTaskGroupUsers { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs index 502b5585..3c37eb80 100644 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs +++ b/Migration.Toolkit.KX13/Models/StagingTaskGroupTask.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("staging_TaskGroupTask")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] -[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] -public partial class StagingTaskGroupTask -{ - [Key] - [Column("TaskGroupTaskID")] - public int TaskGroupTaskId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupTasks")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("staging_TaskGroupTask")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupTask_TaskGroupID")] +[Index("TaskId", Name = "IX_Staging_TaskGroupTask_TaskID")] +public class StagingTaskGroupTask +{ + [Key] + [Column("TaskGroupTaskID")] + public int TaskGroupTaskId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupTasks")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs b/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs index d388fc1e..40c9024c 100644 --- a/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs +++ b/Migration.Toolkit.KX13/Models/StagingTaskGroupUser.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("staging_TaskGroupUser")] -[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] -[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] -public partial class StagingTaskGroupUser -{ - [Key] - [Column("TaskGroupUserID")] - public int TaskGroupUserId { get; set; } - - [Column("TaskGroupID")] - public int TaskGroupId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskGroupId")] - [InverseProperty("StagingTaskGroupUsers")] - public virtual StagingTaskGroup TaskGroup { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskGroupUser")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("staging_TaskGroupUser")] +[Index("TaskGroupId", Name = "IX_Staging_TaskGroupUser_TaskGroup_ID")] +[Index("UserId", Name = "IX_Staging_TaskGroupUser_UserID", IsUnique = true)] +public class StagingTaskGroupUser +{ + [Key] + [Column("TaskGroupUserID")] + public int TaskGroupUserId { get; set; } + + [Column("TaskGroupID")] + public int TaskGroupId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskGroupId")] + [InverseProperty("StagingTaskGroupUsers")] + public virtual StagingTaskGroup TaskGroup { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskGroupUser")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/StagingTaskUser.cs b/Migration.Toolkit.KX13/Models/StagingTaskUser.cs index 0a72b280..358f10f7 100644 --- a/Migration.Toolkit.KX13/Models/StagingTaskUser.cs +++ b/Migration.Toolkit.KX13/Models/StagingTaskUser.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Staging_TaskUser")] -[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] -[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] -public partial class StagingTaskUser -{ - [Key] - [Column("TaskUserID")] - public int TaskUserId { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [ForeignKey("TaskId")] - [InverseProperty("StagingTaskUsers")] - public virtual StagingTask Task { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("StagingTaskUsers")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Staging_TaskUser")] +[Index("TaskId", Name = "IX_Staging_TaskUser_TaskID")] +[Index("UserId", Name = "IX_Staging_TaskUser_UserID")] +public class StagingTaskUser +{ + [Key] + [Column("TaskUserID")] + public int TaskUserId { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [ForeignKey("TaskId")] + [InverseProperty("StagingTaskUsers")] + public virtual StagingTask Task { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("StagingTaskUsers")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/TempFile.cs b/Migration.Toolkit.KX13/Models/TempFile.cs index 841a895f..ff2d5722 100644 --- a/Migration.Toolkit.KX13/Models/TempFile.cs +++ b/Migration.Toolkit.KX13/Models/TempFile.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Temp_File")] -public partial class TempFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileParentGUID")] - public Guid FileParentGuid { get; set; } - - public int FileNumber { get; set; } - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - public long FileSize { get; set; } - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - public byte[]? FileBinary { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - public DateTime FileLastModified { get; set; } - - [StringLength(200)] - public string FileDirectory { get; set; } = null!; - - [StringLength(200)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string? FileTitle { get; set; } - - public string? FileDescription { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Temp_File")] +public class TempFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileParentGUID")] + public Guid FileParentGuid { get; set; } + + public int FileNumber { get; set; } + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + public long FileSize { get; set; } + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + public byte[]? FileBinary { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + public DateTime FileLastModified { get; set; } + + [StringLength(200)] + public string FileDirectory { get; set; } = null!; + + [StringLength(200)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string? FileTitle { get; set; } + + public string? FileDescription { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs index 93dd8e7c..0894e4f9 100644 --- a/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs +++ b/Migration.Toolkit.KX13/Models/TempPageBuilderWidget.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Table("Temp_PageBuilderWidgets")] -public partial class TempPageBuilderWidget -{ - [Key] - [Column("PageBuilderWidgetsID")] - public int PageBuilderWidgetsId { get; set; } - - public string? PageBuilderWidgetsConfiguration { get; set; } - - public Guid PageBuilderWidgetsGuid { get; set; } - - public DateTime PageBuilderWidgetsLastModified { get; set; } - - public string? PageBuilderTemplateConfiguration { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KX13.Models; + +[Table("Temp_PageBuilderWidgets")] +public class TempPageBuilderWidget +{ + [Key] + [Column("PageBuilderWidgetsID")] + public int PageBuilderWidgetsId { get; set; } + + public string? PageBuilderWidgetsConfiguration { get; set; } + + public Guid PageBuilderWidgetsGuid { get; set; } + + public DateTime PageBuilderWidgetsLastModified { get; set; } + + public string? PageBuilderTemplateConfiguration { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs b/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs index 80d11672..03cd666f 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsAclitemItemsAndOperator.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsAclitemItemsAndOperator -{ - [Column("ACLOwnerNodeID")] - public int AclownerNodeId { get; set; } - - [Column("ACLItemID")] - public int AclitemId { get; set; } - - public int Allowed { get; set; } - - public int Denied { get; set; } - - [StringLength(51)] - public string? Operator { get; set; } - - [StringLength(100)] - public string? OperatorName { get; set; } - - [Column("ACLID")] - public int Aclid { get; set; } - - [StringLength(450)] - public string? OperatorFullName { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [Column("RoleID")] - public int? RoleId { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsAclitemItemsAndOperator +{ + [Column("ACLOwnerNodeID")] + public int AclownerNodeId { get; set; } + + [Column("ACLItemID")] + public int AclitemId { get; set; } + + public int Allowed { get; set; } + + public int Denied { get; set; } + + [StringLength(51)] + public string? Operator { get; set; } + + [StringLength(100)] + public string? OperatorName { get; set; } + + [Column("ACLID")] + public int Aclid { get; set; } + + [StringLength(450)] + public string? OperatorFullName { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [Column("RoleID")] + public int? RoleId { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs index 37404d7a..c86109f8 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsObjectVersionHistoryUserJoined.cs @@ -1,122 +1,121 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsObjectVersionHistoryUserJoined -{ - [Column("VersionID")] - public int VersionId { get; set; } - - [Column("VersionObjectID")] - public int? VersionObjectId { get; set; } - - [StringLength(100)] - public string VersionObjectType { get; set; } = null!; - - [Column("VersionObjectSiteID")] - public int? VersionObjectSiteId { get; set; } - - [StringLength(450)] - public string VersionObjectDisplayName { get; set; } = null!; - - [Column("VersionXML")] - public string VersionXml { get; set; } = null!; - - [Column("VersionBinaryDataXML")] - public string? VersionBinaryDataXml { get; set; } - - [Column("VersionModifiedByUserID")] - public int? VersionModifiedByUserId { get; set; } - - public DateTime VersionModifiedWhen { get; set; } - - [Column("VersionDeletedByUserID")] - public int? VersionDeletedByUserId { get; set; } - - public DateTime? VersionDeletedWhen { get; set; } - - [StringLength(50)] - public string VersionNumber { get; set; } = null!; - - [Column("VersionSiteBindingIDs")] - public string? VersionSiteBindingIds { get; set; } - - public string? VersionComment { get; set; } - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(100)] - public string? UserName { get; set; } - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string? UserPassword { get; set; } - - [StringLength(50)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(50)] - public string? PreferredUicultureCode { get; set; } - - public bool? UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid? UserGuid { get; set; } - - public DateTime? UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int? UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsObjectVersionHistoryUserJoined +{ + [Column("VersionID")] + public int VersionId { get; set; } + + [Column("VersionObjectID")] + public int? VersionObjectId { get; set; } + + [StringLength(100)] + public string VersionObjectType { get; set; } = null!; + + [Column("VersionObjectSiteID")] + public int? VersionObjectSiteId { get; set; } + + [StringLength(450)] + public string VersionObjectDisplayName { get; set; } = null!; + + [Column("VersionXML")] + public string VersionXml { get; set; } = null!; + + [Column("VersionBinaryDataXML")] + public string? VersionBinaryDataXml { get; set; } + + [Column("VersionModifiedByUserID")] + public int? VersionModifiedByUserId { get; set; } + + public DateTime VersionModifiedWhen { get; set; } + + [Column("VersionDeletedByUserID")] + public int? VersionDeletedByUserId { get; set; } + + public DateTime? VersionDeletedWhen { get; set; } + + [StringLength(50)] + public string VersionNumber { get; set; } = null!; + + [Column("VersionSiteBindingIDs")] + public string? VersionSiteBindingIds { get; set; } + + public string? VersionComment { get; set; } + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(100)] + public string? UserName { get; set; } + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string? UserPassword { get; set; } + + [StringLength(50)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(50)] + public string? PreferredUicultureCode { get; set; } + + public bool? UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid? UserGuid { get; set; } + + public DateTime? UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int? UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs index b6861204..047f1150 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsPageTemplateCategoryPageTemplateJoined.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsPageTemplateCategoryPageTemplateJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string? CodeName { get; set; } - - [StringLength(200)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryTemplateChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [StringLength(20)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - [StringLength(10)] - public string? PageTemplateType { get; set; } - - [StringLength(200)] - public string? PageTemplateIconClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsPageTemplateCategoryPageTemplateJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string? CodeName { get; set; } + + [StringLength(200)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryTemplateChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [StringLength(20)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + [StringLength(10)] + public string? PageTemplateType { get; set; } + + [StringLength(200)] + public string? PageTemplateIconClass { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs index 30e0281f..0621665e 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsRelationshipJoined.cs @@ -1,57 +1,56 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsRelationshipJoined -{ - [Column("LeftNodeID")] - public int LeftNodeId { get; set; } - - [Column("LeftNodeGUID")] - public Guid LeftNodeGuid { get; set; } - - [StringLength(100)] - public string LeftNodeName { get; set; } = null!; - - [Column("LeftNodeSiteID")] - public int LeftNodeSiteId { get; set; } - - [StringLength(200)] - public string RelationshipName { get; set; } = null!; - - [Column("RelationshipNameID")] - public int RelationshipNameId { get; set; } - - [Column("RightNodeID")] - public int RightNodeId { get; set; } - - [Column("RightNodeGUID")] - public Guid RightNodeGuid { get; set; } - - [StringLength(100)] - public string RightNodeName { get; set; } = null!; - - [Column("RightNodeSiteID")] - public int RightNodeSiteId { get; set; } - - [StringLength(200)] - public string RelationshipDisplayName { get; set; } = null!; - - public string? RelationshipCustomData { get; set; } - - [Column("LeftClassID")] - public int LeftClassId { get; set; } - - [Column("RightClassID")] - public int RightClassId { get; set; } - - [Column("RelationshipID")] - public int RelationshipId { get; set; } - - public int? RelationshipOrder { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsRelationshipJoined +{ + [Column("LeftNodeID")] + public int LeftNodeId { get; set; } + + [Column("LeftNodeGUID")] + public Guid LeftNodeGuid { get; set; } + + [StringLength(100)] + public string LeftNodeName { get; set; } = null!; + + [Column("LeftNodeSiteID")] + public int LeftNodeSiteId { get; set; } + + [StringLength(200)] + public string RelationshipName { get; set; } = null!; + + [Column("RelationshipNameID")] + public int RelationshipNameId { get; set; } + + [Column("RightNodeID")] + public int RightNodeId { get; set; } + + [Column("RightNodeGUID")] + public Guid RightNodeGuid { get; set; } + + [StringLength(100)] + public string RightNodeName { get; set; } = null!; + + [Column("RightNodeSiteID")] + public int RightNodeSiteId { get; set; } + + [StringLength(200)] + public string RelationshipDisplayName { get; set; } = null!; + + public string? RelationshipCustomData { get; set; } + + [Column("LeftClassID")] + public int LeftClassId { get; set; } + + [Column("RightClassID")] + public int RightClassId { get; set; } + + [Column("RelationshipID")] + public int RelationshipId { get; set; } + + public int? RelationshipOrder { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs index 59f1eed5..27255935 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsResourceStringJoined.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsResourceStringJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("TranslationID")] - public int? TranslationId { get; set; } - - [Column("TranslationStringID")] - public int? TranslationStringId { get; set; } - - [Column("TranslationCultureID")] - public int? TranslationCultureId { get; set; } - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int? CultureId { get; set; } - - [StringLength(200)] - public string? CultureName { get; set; } - - [StringLength(50)] - public string? CultureCode { get; set; } - - [Column("CultureGUID")] - public Guid? CultureGuid { get; set; } - - public DateTime? CultureLastModified { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsResourceStringJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("TranslationID")] + public int? TranslationId { get; set; } + + [Column("TranslationStringID")] + public int? TranslationStringId { get; set; } + + [Column("TranslationCultureID")] + public int? TranslationCultureId { get; set; } + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int? CultureId { get; set; } + + [StringLength(200)] + public string? CultureName { get; set; } + + [StringLength(50)] + public string? CultureCode { get; set; } + + [Column("CultureGUID")] + public Guid? CultureGuid { get; set; } + + public DateTime? CultureLastModified { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs index 192e3c0b..79765c88 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsResourceTranslatedJoined.cs @@ -1,28 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsResourceTranslatedJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsResourceTranslatedJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs index 78ccbeee..a888854c 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsRoleResourcePermissionJoined.cs @@ -1,23 +1,22 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsRoleResourcePermissionJoined -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [StringLength(100)] - public string PermissionName { get; set; } = null!; - - [Column("PermissionID")] - public int PermissionId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsRoleResourcePermissionJoined +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [StringLength(100)] + public string PermissionName { get; set; } = null!; + + [Column("PermissionID")] + public int PermissionId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs b/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs index 13af4f92..1375f4a7 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsSiteDocumentCount.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsSiteDocumentCount -{ - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - [StringLength(200)] - public string SiteDisplayName { get; set; } = null!; - - public string? SiteDescription { get; set; } - - [StringLength(20)] - public string SiteStatus { get; set; } = null!; - - [StringLength(400)] - public string SiteDomainName { get; set; } = null!; - - [StringLength(50)] - public string? SiteDefaultVisitorCulture { get; set; } - - [Column("SiteGUID")] - public Guid SiteGuid { get; set; } - - public DateTime SiteLastModified { get; set; } - - [StringLength(400)] - public string SitePresentationUrl { get; set; } = null!; - - public int? Documents { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsSiteDocumentCount +{ + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + [StringLength(200)] + public string SiteDisplayName { get; set; } = null!; + + public string? SiteDescription { get; set; } + + [StringLength(20)] + public string SiteStatus { get; set; } = null!; + + [StringLength(400)] + public string SiteDomainName { get; set; } = null!; + + [StringLength(50)] + public string? SiteDefaultVisitorCulture { get; set; } + + [Column("SiteGUID")] + public Guid SiteGuid { get; set; } + + public DateTime SiteLastModified { get; set; } + + [StringLength(400)] + public string SitePresentationUrl { get; set; } = null!; + + public int? Documents { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs index 4a5df558..6eaf84bd 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsSiteRoleResourceUielementJoined.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsSiteRoleResourceUielementJoined -{ - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(200)] - public string ElementName { get; set; } = null!; - - [StringLength(100)] - public string? SiteName { get; set; } - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - [Column("RoleSiteID")] - public int? RoleSiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsSiteRoleResourceUielementJoined +{ + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(200)] + public string ElementName { get; set; } = null!; + + [StringLength(100)] + public string? SiteName { get; set; } + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + [Column("RoleSiteID")] + public int? RoleSiteId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs index 18ce59df..6cf9a512 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsTreeJoined.cs @@ -1,171 +1,170 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsTreeJoined -{ - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(100)] - public string NodeName { get; set; } = null!; - - [StringLength(50)] - public string NodeAlias { get; set; } = null!; - - [Column("NodeClassID")] - public int NodeClassId { get; set; } - - [Column("NodeParentID")] - public int? NodeParentId { get; set; } - - public int NodeLevel { get; set; } - - [Column("NodeACLID")] - public int? NodeAclid { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeGUID")] - public Guid NodeGuid { get; set; } - - public int? NodeOrder { get; set; } - - public bool? IsSecuredNode { get; set; } - - [Column("NodeSKUID")] - public int? NodeSkuid { get; set; } - - [Column("NodeLinkedNodeID")] - public int? NodeLinkedNodeId { get; set; } - - public int? NodeOwner { get; set; } - - public string? NodeCustomData { get; set; } - - [Column("NodeLinkedNodeSiteID")] - public int? NodeLinkedNodeSiteId { get; set; } - - public bool? NodeHasChildren { get; set; } - - public bool? NodeHasLinks { get; set; } - - [Column("NodeOriginalNodeID")] - public int? NodeOriginalNodeId { get; set; } - - [Column("NodeIsACLOwner")] - public bool NodeIsAclowner { get; set; } - - [Column("DocumentID")] - public int DocumentId { get; set; } - - [StringLength(100)] - public string DocumentName { get; set; } = null!; - - public DateTime? DocumentModifiedWhen { get; set; } - - [Column("DocumentModifiedByUserID")] - public int? DocumentModifiedByUserId { get; set; } - - public int? DocumentForeignKeyValue { get; set; } - - [Column("DocumentCreatedByUserID")] - public int? DocumentCreatedByUserId { get; set; } - - public DateTime? DocumentCreatedWhen { get; set; } - - [Column("DocumentCheckedOutByUserID")] - public int? DocumentCheckedOutByUserId { get; set; } - - public DateTime? DocumentCheckedOutWhen { get; set; } - - [Column("DocumentCheckedOutVersionHistoryID")] - public int? DocumentCheckedOutVersionHistoryId { get; set; } - - [Column("DocumentPublishedVersionHistoryID")] - public int? DocumentPublishedVersionHistoryId { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - public DateTime? DocumentPublishFrom { get; set; } - - public DateTime? DocumentPublishTo { get; set; } - - [StringLength(50)] - public string DocumentCulture { get; set; } = null!; - - [Column("DocumentNodeID")] - public int DocumentNodeId { get; set; } - - public string? DocumentPageTitle { get; set; } - - public string? DocumentPageKeyWords { get; set; } - - public string? DocumentPageDescription { get; set; } - - public string? DocumentContent { get; set; } - - public string? DocumentCustomData { get; set; } - - public string? DocumentTags { get; set; } - - [Column("DocumentTagGroupID")] - public int? DocumentTagGroupId { get; set; } - - public DateTime? DocumentLastPublished { get; set; } - - public bool? DocumentSearchExcluded { get; set; } - - [StringLength(50)] - public string? DocumentLastVersionNumber { get; set; } - - public bool? DocumentIsArchived { get; set; } - - [Column("DocumentGUID")] - public Guid? DocumentGuid { get; set; } - - [Column("DocumentWorkflowCycleGUID")] - public Guid? DocumentWorkflowCycleGuid { get; set; } - - public bool? DocumentIsWaitingForTranslation { get; set; } - - [Column("DocumentSKUName")] - [StringLength(440)] - public string? DocumentSkuname { get; set; } - - [Column("DocumentSKUDescription")] - public string? DocumentSkudescription { get; set; } - - [Column("DocumentSKUShortDescription")] - public string? DocumentSkushortDescription { get; set; } - - [StringLength(450)] - public string? DocumentWorkflowActionStatus { get; set; } - - public bool DocumentCanBePublished { get; set; } - - public string? DocumentPageBuilderWidgets { get; set; } - - public string? DocumentPageTemplateConfiguration { get; set; } - - [Column("DocumentABTestConfiguration")] - public string? DocumentAbtestConfiguration { get; set; } - - public bool DocumentShowInMenu { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsTreeJoined +{ + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(100)] + public string NodeName { get; set; } = null!; + + [StringLength(50)] + public string NodeAlias { get; set; } = null!; + + [Column("NodeClassID")] + public int NodeClassId { get; set; } + + [Column("NodeParentID")] + public int? NodeParentId { get; set; } + + public int NodeLevel { get; set; } + + [Column("NodeACLID")] + public int? NodeAclid { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeGUID")] + public Guid NodeGuid { get; set; } + + public int? NodeOrder { get; set; } + + public bool? IsSecuredNode { get; set; } + + [Column("NodeSKUID")] + public int? NodeSkuid { get; set; } + + [Column("NodeLinkedNodeID")] + public int? NodeLinkedNodeId { get; set; } + + public int? NodeOwner { get; set; } + + public string? NodeCustomData { get; set; } + + [Column("NodeLinkedNodeSiteID")] + public int? NodeLinkedNodeSiteId { get; set; } + + public bool? NodeHasChildren { get; set; } + + public bool? NodeHasLinks { get; set; } + + [Column("NodeOriginalNodeID")] + public int? NodeOriginalNodeId { get; set; } + + [Column("NodeIsACLOwner")] + public bool NodeIsAclowner { get; set; } + + [Column("DocumentID")] + public int DocumentId { get; set; } + + [StringLength(100)] + public string DocumentName { get; set; } = null!; + + public DateTime? DocumentModifiedWhen { get; set; } + + [Column("DocumentModifiedByUserID")] + public int? DocumentModifiedByUserId { get; set; } + + public int? DocumentForeignKeyValue { get; set; } + + [Column("DocumentCreatedByUserID")] + public int? DocumentCreatedByUserId { get; set; } + + public DateTime? DocumentCreatedWhen { get; set; } + + [Column("DocumentCheckedOutByUserID")] + public int? DocumentCheckedOutByUserId { get; set; } + + public DateTime? DocumentCheckedOutWhen { get; set; } + + [Column("DocumentCheckedOutVersionHistoryID")] + public int? DocumentCheckedOutVersionHistoryId { get; set; } + + [Column("DocumentPublishedVersionHistoryID")] + public int? DocumentPublishedVersionHistoryId { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + public DateTime? DocumentPublishFrom { get; set; } + + public DateTime? DocumentPublishTo { get; set; } + + [StringLength(50)] + public string DocumentCulture { get; set; } = null!; + + [Column("DocumentNodeID")] + public int DocumentNodeId { get; set; } + + public string? DocumentPageTitle { get; set; } + + public string? DocumentPageKeyWords { get; set; } + + public string? DocumentPageDescription { get; set; } + + public string? DocumentContent { get; set; } + + public string? DocumentCustomData { get; set; } + + public string? DocumentTags { get; set; } + + [Column("DocumentTagGroupID")] + public int? DocumentTagGroupId { get; set; } + + public DateTime? DocumentLastPublished { get; set; } + + public bool? DocumentSearchExcluded { get; set; } + + [StringLength(50)] + public string? DocumentLastVersionNumber { get; set; } + + public bool? DocumentIsArchived { get; set; } + + [Column("DocumentGUID")] + public Guid? DocumentGuid { get; set; } + + [Column("DocumentWorkflowCycleGUID")] + public Guid? DocumentWorkflowCycleGuid { get; set; } + + public bool? DocumentIsWaitingForTranslation { get; set; } + + [Column("DocumentSKUName")] + [StringLength(440)] + public string? DocumentSkuname { get; set; } + + [Column("DocumentSKUDescription")] + public string? DocumentSkudescription { get; set; } + + [Column("DocumentSKUShortDescription")] + public string? DocumentSkushortDescription { get; set; } + + [StringLength(450)] + public string? DocumentWorkflowActionStatus { get; set; } + + public bool DocumentCanBePublished { get; set; } + + public string? DocumentPageBuilderWidgets { get; set; } + + public string? DocumentPageTemplateConfiguration { get; set; } + + [Column("DocumentABTestConfiguration")] + public string? DocumentAbtestConfiguration { get; set; } + + public bool DocumentShowInMenu { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUser.cs b/Migration.Toolkit.KX13/Models/ViewCmsUser.cs index 7c36dbf8..d804da2f 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUser.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUser.cs @@ -1,174 +1,173 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsUser -{ - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? MiddleName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - [StringLength(50)] - public string? PreferredCultureCode { get; set; } - - [Column("PreferredUICultureCode")] - [StringLength(50)] - public string? PreferredUicultureCode { get; set; } - - public bool UserEnabled { get; set; } - - public bool? UserIsExternal { get; set; } - - [StringLength(10)] - public string? UserPasswordFormat { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [StringLength(200)] - public string? UserStartingAliasPath { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - public string? UserLastLogonInfo { get; set; } - - public bool? UserIsHidden { get; set; } - - public bool? UserIsDomain { get; set; } - - public bool? UserHasAllowedCultures { get; set; } - - [Column("UserMFRequired")] - public bool? UserMfrequired { get; set; } - - public int UserPrivilegeLevel { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - [Column("UserMFSecret")] - public byte[]? UserMfsecret { get; set; } - - [Column("UserMFTimestep")] - public long? UserMftimestep { get; set; } - - [Column("UserSettingsID")] - public int? UserSettingsId { get; set; } - - [StringLength(200)] - public string? UserNickName { get; set; } - - public string? UserSignature { get; set; } - - [Column("UserURLReferrer")] - [StringLength(450)] - public string? UserUrlreferrer { get; set; } - - [StringLength(200)] - public string? UserCampaign { get; set; } - - public string? UserCustomData { get; set; } - - public string? UserRegistrationInfo { get; set; } - - public DateTime? UserActivationDate { get; set; } - - [Column("UserActivatedByUserID")] - public int? UserActivatedByUserId { get; set; } - - [Column("UserTimeZoneID")] - public int? UserTimeZoneId { get; set; } - - [Column("UserAvatarID")] - public int? UserAvatarId { get; set; } - - public int? UserGender { get; set; } - - public DateTime? UserDateOfBirth { get; set; } - - [Column("UserSettingsUserGUID")] - public Guid? UserSettingsUserGuid { get; set; } - - [Column("UserSettingsUserID")] - public int? UserSettingsUserId { get; set; } - - public bool? UserWaitingForApproval { get; set; } - - public string? UserDialogsConfiguration { get; set; } - - public string? UserDescription { get; set; } - - [Column("UserAuthenticationGUID")] - public Guid? UserAuthenticationGuid { get; set; } - - [StringLength(100)] - public string? UserSkype { get; set; } - - [Column("UserIM")] - [StringLength(100)] - public string? UserIm { get; set; } - - [StringLength(26)] - public string? UserPhone { get; set; } - - [StringLength(200)] - public string? UserPosition { get; set; } - - public bool? UserLogActivities { get; set; } - - [StringLength(100)] - public string? UserPasswordRequestHash { get; set; } - - public int? UserInvalidLogOnAttempts { get; set; } - - [StringLength(100)] - public string? UserInvalidLogOnAttemptsHash { get; set; } - - public int? UserAccountLockReason { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool? UserShowIntroductionTile { get; set; } - - public string? UserDashboardApplications { get; set; } - - public string? UserDismissedSmartTips { get; set; } - - [Column("AvatarID")] - public int? AvatarId { get; set; } - - [StringLength(200)] - public string? AvatarFileName { get; set; } - - [Column("AvatarGUID")] - public Guid? AvatarGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsUser +{ + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? MiddleName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + [StringLength(50)] + public string? PreferredCultureCode { get; set; } + + [Column("PreferredUICultureCode")] + [StringLength(50)] + public string? PreferredUicultureCode { get; set; } + + public bool UserEnabled { get; set; } + + public bool? UserIsExternal { get; set; } + + [StringLength(10)] + public string? UserPasswordFormat { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [StringLength(200)] + public string? UserStartingAliasPath { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + public string? UserLastLogonInfo { get; set; } + + public bool? UserIsHidden { get; set; } + + public bool? UserIsDomain { get; set; } + + public bool? UserHasAllowedCultures { get; set; } + + [Column("UserMFRequired")] + public bool? UserMfrequired { get; set; } + + public int UserPrivilegeLevel { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + [Column("UserMFSecret")] + public byte[]? UserMfsecret { get; set; } + + [Column("UserMFTimestep")] + public long? UserMftimestep { get; set; } + + [Column("UserSettingsID")] + public int? UserSettingsId { get; set; } + + [StringLength(200)] + public string? UserNickName { get; set; } + + public string? UserSignature { get; set; } + + [Column("UserURLReferrer")] + [StringLength(450)] + public string? UserUrlreferrer { get; set; } + + [StringLength(200)] + public string? UserCampaign { get; set; } + + public string? UserCustomData { get; set; } + + public string? UserRegistrationInfo { get; set; } + + public DateTime? UserActivationDate { get; set; } + + [Column("UserActivatedByUserID")] + public int? UserActivatedByUserId { get; set; } + + [Column("UserTimeZoneID")] + public int? UserTimeZoneId { get; set; } + + [Column("UserAvatarID")] + public int? UserAvatarId { get; set; } + + public int? UserGender { get; set; } + + public DateTime? UserDateOfBirth { get; set; } + + [Column("UserSettingsUserGUID")] + public Guid? UserSettingsUserGuid { get; set; } + + [Column("UserSettingsUserID")] + public int? UserSettingsUserId { get; set; } + + public bool? UserWaitingForApproval { get; set; } + + public string? UserDialogsConfiguration { get; set; } + + public string? UserDescription { get; set; } + + [Column("UserAuthenticationGUID")] + public Guid? UserAuthenticationGuid { get; set; } + + [StringLength(100)] + public string? UserSkype { get; set; } + + [Column("UserIM")] + [StringLength(100)] + public string? UserIm { get; set; } + + [StringLength(26)] + public string? UserPhone { get; set; } + + [StringLength(200)] + public string? UserPosition { get; set; } + + public bool? UserLogActivities { get; set; } + + [StringLength(100)] + public string? UserPasswordRequestHash { get; set; } + + public int? UserInvalidLogOnAttempts { get; set; } + + [StringLength(100)] + public string? UserInvalidLogOnAttemptsHash { get; set; } + + public int? UserAccountLockReason { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool? UserShowIntroductionTile { get; set; } + + public string? UserDashboardApplications { get; set; } + + public string? UserDismissedSmartTips { get; set; } + + [Column("AvatarID")] + public int? AvatarId { get; set; } + + [StringLength(200)] + public string? AvatarFileName { get; set; } + + [Column("AvatarGUID")] + public Guid? AvatarGuid { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs index 0c9b5f79..56f6cbeb 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserDocument.cs @@ -1,53 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsUserDocument -{ - [StringLength(100)] - public string? DocumentName { get; set; } - - [Column("NodeSiteID")] - public int NodeSiteId { get; set; } - - [Column("NodeID")] - public int NodeId { get; set; } - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - public DateTime? DocumentModifiedWhen { get; set; } - - [StringLength(50)] - public string DocumentCulture { get; set; } = null!; - - [StringLength(200)] - public string? CultureName { get; set; } - - [Column("UserID1")] - public int? UserId1 { get; set; } - - [Column("UserID2")] - public int? UserId2 { get; set; } - - [Column("UserID3")] - public int? UserId3 { get; set; } - - [Column("DocumentWorkflowStepID")] - public int? DocumentWorkflowStepId { get; set; } - - [StringLength(450)] - public string NodeAliasPath { get; set; } = null!; - - [StringLength(12)] - [Unicode(false)] - public string Type { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsUserDocument +{ + [StringLength(100)] + public string? DocumentName { get; set; } + + [Column("NodeSiteID")] + public int NodeSiteId { get; set; } + + [Column("NodeID")] + public int NodeId { get; set; } + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + public DateTime? DocumentModifiedWhen { get; set; } + + [StringLength(50)] + public string DocumentCulture { get; set; } = null!; + + [StringLength(200)] + public string? CultureName { get; set; } + + [Column("UserID1")] + public int? UserId1 { get; set; } + + [Column("UserID2")] + public int? UserId2 { get; set; } + + [Column("UserID3")] + public int? UserId3 { get; set; } + + [Column("DocumentWorkflowStepID")] + public int? DocumentWorkflowStepId { get; set; } + + [StringLength(450)] + public string NodeAliasPath { get; set; } = null!; + + [StringLength(12)] + [Unicode(false)] + public string Type { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs index b1d44246..d0a9cf27 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleJoined.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsUserRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - [Column("SiteID")] - public int? SiteId { get; set; } - - [StringLength(100)] - public string? SiteName { get; set; } - - [Column("SiteGUID")] - public Guid? SiteGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsUserRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + [Column("SiteID")] + public int? SiteId { get; set; } + + [StringLength(100)] + public string? SiteName { get; set; } + + [Column("SiteGUID")] + public Guid? SiteGuid { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs index 18e872a6..37f72e34 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRole.cs @@ -1,25 +1,24 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsUserRoleMembershipRole -{ - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [Column("SiteID")] - public int? SiteId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - public DateTime? ValidTo { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRole +{ + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [Column("SiteID")] + public int? SiteId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs index 4a72d538..eedac5c0 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserRoleMembershipRoleValidOnlyJoined.cs @@ -1,19 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsUserRoleMembershipRoleValidOnlyJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - public DateTime? ValidTo { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsUserRoleMembershipRoleValidOnlyJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + public DateTime? ValidTo { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs index 0ab10b50..88b85558 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsUserSettingsRoleJoined.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsUserSettingsRoleJoined -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("SiteID")] - public int SiteId { get; set; } - - [StringLength(100)] - public string SiteName { get; set; } = null!; - - public bool UserEnabled { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsUserSettingsRoleJoined +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("SiteID")] + public int SiteId { get; set; } + + [StringLength(100)] + public string SiteName { get; set; } = null!; + + public bool UserEnabled { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs index 0986165f..a4c2d2db 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsWebPartCategoryWebpartJoined.cs @@ -1,68 +1,67 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsWebPartCategoryWebpartJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryWebPartChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WebPartParentID")] - public int? WebPartParentId { get; set; } - - [StringLength(100)] - public string? WebPartFileName { get; set; } - - [Column("WebPartGUID")] - public Guid? WebPartGuid { get; set; } - - public int? WebPartType { get; set; } - - [StringLength(1000)] - public string? WebPartDescription { get; set; } - - [StringLength(15)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; - - [Column("ThumbnailGUID")] - public Guid? ThumbnailGuid { get; set; } - - [StringLength(200)] - public string? IconClass { get; set; } - - public bool? WebPartSkipInsertProperties { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsWebPartCategoryWebpartJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryWebPartChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WebPartParentID")] + public int? WebPartParentId { get; set; } + + [StringLength(100)] + public string? WebPartFileName { get; set; } + + [Column("WebPartGUID")] + public Guid? WebPartGuid { get; set; } + + public int? WebPartType { get; set; } + + [StringLength(1000)] + public string? WebPartDescription { get; set; } + + [StringLength(15)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; + + [Column("ThumbnailGUID")] + public Guid? ThumbnailGuid { get; set; } + + [StringLength(200)] + public string? IconClass { get; set; } + + public bool? WebPartSkipInsertProperties { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs b/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs index 9d3da0ce..28e6b0b9 100644 --- a/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewCmsWidgetCategoryWidgetJoined.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewCmsWidgetCategoryWidgetJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(100)] - public string CodeName { get; set; } = null!; - - [StringLength(100)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? WidgetCategoryImagePath { get; set; } - - [StringLength(551)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? WidgetCategoryChildCount { get; set; } - - public int? WidgetCategoryWidgetChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - [Column("WidgetWebPartID")] - public int? WidgetWebPartId { get; set; } - - public int WidgetSecurity { get; set; } - - [Column("WidgetGUID")] - public Guid? WidgetGuid { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewCmsWidgetCategoryWidgetJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(100)] + public string CodeName { get; set; } = null!; + + [StringLength(100)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? WidgetCategoryImagePath { get; set; } + + [StringLength(551)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? WidgetCategoryChildCount { get; set; } + + public int? WidgetCategoryWidgetChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + [Column("WidgetWebPartID")] + public int? WidgetWebPartId { get; set; } + + public int WidgetSecurity { get; set; } + + [Column("WidgetGUID")] + public Guid? WidgetGuid { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs b/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs index 2d18895e..711fcab9 100644 --- a/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewComSkuoptionCategoryOptionCategoryJoined.cs @@ -1,64 +1,63 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewComSkuoptionCategoryOptionCategoryJoined -{ - [Column("SKUID")] - public int Skuid { get; set; } - - [Column("CategoryID")] - public int CategoryId { get; set; } - - public bool? AllowAllOptions { get; set; } - - [Column("SKUCategoryID")] - public int SkucategoryId { get; set; } - - [Column("SKUCategoryOrder")] - public int? SkucategoryOrder { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CategoryName { get; set; } = null!; - - [StringLength(200)] - public string CategorySelectionType { get; set; } = null!; - - [StringLength(200)] - public string? CategoryDefaultOptions { get; set; } - - public string? CategoryDescription { get; set; } - - [StringLength(200)] - public string? CategoryDefaultRecord { get; set; } - - public bool CategoryEnabled { get; set; } - - [Column("CategoryGUID")] - public Guid CategoryGuid { get; set; } - - public DateTime CategoryLastModified { get; set; } - - public bool? CategoryDisplayPrice { get; set; } - - [Column("CategorySiteID")] - public int? CategorySiteId { get; set; } - - public int? CategoryTextMaxLength { get; set; } - - [StringLength(20)] - public string? CategoryType { get; set; } - - public int? CategoryTextMinLength { get; set; } - - [StringLength(200)] - public string? CategoryLiveSiteDisplayName { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewComSkuoptionCategoryOptionCategoryJoined +{ + [Column("SKUID")] + public int Skuid { get; set; } + + [Column("CategoryID")] + public int CategoryId { get; set; } + + public bool? AllowAllOptions { get; set; } + + [Column("SKUCategoryID")] + public int SkucategoryId { get; set; } + + [Column("SKUCategoryOrder")] + public int? SkucategoryOrder { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CategoryName { get; set; } = null!; + + [StringLength(200)] + public string CategorySelectionType { get; set; } = null!; + + [StringLength(200)] + public string? CategoryDefaultOptions { get; set; } + + public string? CategoryDescription { get; set; } + + [StringLength(200)] + public string? CategoryDefaultRecord { get; set; } + + public bool CategoryEnabled { get; set; } + + [Column("CategoryGUID")] + public Guid CategoryGuid { get; set; } + + public DateTime CategoryLastModified { get; set; } + + public bool? CategoryDisplayPrice { get; set; } + + [Column("CategorySiteID")] + public int? CategorySiteId { get; set; } + + public int? CategoryTextMaxLength { get; set; } + + [StringLength(20)] + public string? CategoryType { get; set; } + + public int? CategoryTextMinLength { get; set; } + + [StringLength(200)] + public string? CategoryLiveSiteDisplayName { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs b/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs index 78969f31..58eb3ad5 100644 --- a/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewIntegrationTaskJoined.cs @@ -1,65 +1,64 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewIntegrationTaskJoined -{ - [Column("SynchronizationID")] - public int? SynchronizationId { get; set; } - - [Column("SynchronizationTaskID")] - public int? SynchronizationTaskId { get; set; } - - [Column("SynchronizationConnectorID")] - public int? SynchronizationConnectorId { get; set; } - - public DateTime? SynchronizationLastRun { get; set; } - - public string? SynchronizationErrorMessage { get; set; } - - public bool? SynchronizationIsRunning { get; set; } - - [Column("TaskID")] - public int TaskId { get; set; } - - [Column("TaskNodeID")] - public int? TaskNodeId { get; set; } - - [Column("TaskDocumentID")] - public int? TaskDocumentId { get; set; } - - [StringLength(450)] - public string? TaskNodeAliasPath { get; set; } - - [StringLength(450)] - public string TaskTitle { get; set; } = null!; - - public DateTime TaskTime { get; set; } - - [StringLength(50)] - public string TaskType { get; set; } = null!; - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - public bool TaskIsInbound { get; set; } - - [StringLength(50)] - public string? TaskProcessType { get; set; } - - public string TaskData { get; set; } = null!; - - [Column("TaskSiteID")] - public int? TaskSiteId { get; set; } - - [StringLength(50)] - public string? TaskDataType { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewIntegrationTaskJoined +{ + [Column("SynchronizationID")] + public int? SynchronizationId { get; set; } + + [Column("SynchronizationTaskID")] + public int? SynchronizationTaskId { get; set; } + + [Column("SynchronizationConnectorID")] + public int? SynchronizationConnectorId { get; set; } + + public DateTime? SynchronizationLastRun { get; set; } + + public string? SynchronizationErrorMessage { get; set; } + + public bool? SynchronizationIsRunning { get; set; } + + [Column("TaskID")] + public int TaskId { get; set; } + + [Column("TaskNodeID")] + public int? TaskNodeId { get; set; } + + [Column("TaskDocumentID")] + public int? TaskDocumentId { get; set; } + + [StringLength(450)] + public string? TaskNodeAliasPath { get; set; } + + [StringLength(450)] + public string TaskTitle { get; set; } = null!; + + public DateTime TaskTime { get; set; } + + [StringLength(50)] + public string TaskType { get; set; } = null!; + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + public bool TaskIsInbound { get; set; } + + [StringLength(50)] + public string? TaskProcessType { get; set; } + + public string TaskData { get; set; } = null!; + + [Column("TaskSiteID")] + public int? TaskSiteId { get; set; } + + [StringLength(50)] + public string? TaskDataType { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs b/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs index 2c5ea881..fb0c0702 100644 --- a/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewMembershipMembershipUserJoined.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewMembershipMembershipUserJoined -{ - [StringLength(200)] - public string MembershipDisplayName { get; set; } = null!; - - [Column("MembershipID")] - public int MembershipId { get; set; } - - public DateTime? ValidTo { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(450)] - public string? FullName { get; set; } - - [StringLength(100)] - public string UserName { get; set; } = null!; - - [Column("MembershipSiteID")] - public int? MembershipSiteId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewMembershipMembershipUserJoined +{ + [StringLength(200)] + public string MembershipDisplayName { get; set; } = null!; + + [Column("MembershipID")] + public int MembershipId { get; set; } + + public DateTime? ValidTo { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(450)] + public string? FullName { get; set; } + + [StringLength(100)] + public string UserName { get; set; } = null!; + + [Column("MembershipSiteID")] + public int? MembershipSiteId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs b/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs index 946551b8..afbbe77b 100644 --- a/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewNewsletterSubscriptionsJoined.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewNewsletterSubscriptionsJoined -{ - [Column("SubscriberID")] - public int SubscriberId { get; set; } - - [StringLength(440)] - public string? SubscriberFullName { get; set; } - - [StringLength(254)] - public string? SubscriberEmail { get; set; } - - public bool? SubscriptionApproved { get; set; } - - [Column("NewsletterID")] - public int NewsletterId { get; set; } - - [StringLength(100)] - public string? SubscriberType { get; set; } - - public int? SubscriberBounces { get; set; } - - [StringLength(250)] - public string NewsletterDisplayName { get; set; } = null!; - - [Column("SubscriberRelatedID")] - public int SubscriberRelatedId { get; set; } - - [Column("SubscriberNewsletterID")] - public int SubscriberNewsletterId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewNewsletterSubscriptionsJoined +{ + [Column("SubscriberID")] + public int SubscriberId { get; set; } + + [StringLength(440)] + public string? SubscriberFullName { get; set; } + + [StringLength(254)] + public string? SubscriberEmail { get; set; } + + public bool? SubscriptionApproved { get; set; } + + [Column("NewsletterID")] + public int NewsletterId { get; set; } + + [StringLength(100)] + public string? SubscriberType { get; set; } + + public int? SubscriberBounces { get; set; } + + [StringLength(250)] + public string NewsletterDisplayName { get; set; } = null!; + + [Column("SubscriberRelatedID")] + public int SubscriberRelatedId { get; set; } + + [Column("SubscriberNewsletterID")] + public int SubscriberNewsletterId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs index c1b7ecc3..2ba5828d 100644 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewOmAccountContactAccountJoined.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewOmAccountContactAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewOmAccountContactAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs index 022cfc52..7e675184 100644 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewOmAccountContactContactJoined.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewOmAccountContactContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewOmAccountContactContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs index 1228688e..65e520e7 100644 --- a/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewOmAccountJoined.cs @@ -1,102 +1,101 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewOmAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [StringLength(100)] - public string? PrimaryContactFirstName { get; set; } - - [StringLength(100)] - public string? PrimaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? PrimaryContactLastName { get; set; } - - [StringLength(100)] - public string? SecondaryContactFirstName { get; set; } - - [StringLength(100)] - public string? SecondaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? SecondaryContactLastName { get; set; } - - [StringLength(200)] - public string? SubsidiaryOfName { get; set; } - - [StringLength(302)] - public string PrimaryContactFullName { get; set; } = null!; - - [StringLength(302)] - public string SecondaryContactFullName { get; set; } = null!; - - [StringLength(201)] - public string AccountFullAddress { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewOmAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [StringLength(100)] + public string? PrimaryContactFirstName { get; set; } + + [StringLength(100)] + public string? PrimaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? PrimaryContactLastName { get; set; } + + [StringLength(100)] + public string? SecondaryContactFirstName { get; set; } + + [StringLength(100)] + public string? SecondaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? SecondaryContactLastName { get; set; } + + [StringLength(200)] + public string? SubsidiaryOfName { get; set; } + + [StringLength(302)] + public string PrimaryContactFullName { get; set; } = null!; + + [StringLength(302)] + public string SecondaryContactFullName { get; set; } = null!; + + [StringLength(201)] + public string AccountFullAddress { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs index 8e1a545f..f4de7652 100644 --- a/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -1,78 +1,77 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewOmContactGroupMemberAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewOmContactGroupMemberAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } +} diff --git a/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs b/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs index b35920a0..984638a0 100644 --- a/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs +++ b/Migration.Toolkit.KX13/Models/ViewReportingCategoryReportJoined.cs @@ -1,52 +1,51 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KX13.Models; - -[Keyless] -public partial class ViewReportingCategoryReportJoined -{ - [Column("ObjectID")] - public int ObjectId { get; set; } - - [StringLength(200)] - public string CodeName { get; set; } = null!; - - [StringLength(440)] - public string DisplayName { get; set; } = null!; - - [Column("ParentID")] - public int? ParentId { get; set; } - - [Column("GUID")] - public Guid Guid { get; set; } - - public DateTime LastModified { get; set; } - - [StringLength(450)] - public string? CategoryImagePath { get; set; } - - [StringLength(651)] - public string? ObjectPath { get; set; } - - public int? ObjectLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - public int? CategoryReportChildCount { get; set; } - - public int? CompleteChildCount { get; set; } - - public string? ReportLayout { get; set; } - - public string? ReportParameters { get; set; } - - public int? ReportAccess { get; set; } - - [StringLength(14)] - [Unicode(false)] - public string ObjectType { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KX13.Models; + +[Keyless] +public class ViewReportingCategoryReportJoined +{ + [Column("ObjectID")] + public int ObjectId { get; set; } + + [StringLength(200)] + public string CodeName { get; set; } = null!; + + [StringLength(440)] + public string DisplayName { get; set; } = null!; + + [Column("ParentID")] + public int? ParentId { get; set; } + + [Column("GUID")] + public Guid Guid { get; set; } + + public DateTime LastModified { get; set; } + + [StringLength(450)] + public string? CategoryImagePath { get; set; } + + [StringLength(651)] + public string? ObjectPath { get; set; } + + public int? ObjectLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + public int? CategoryReportChildCount { get; set; } + + public int? CompleteChildCount { get; set; } + + public string? ReportLayout { get; set; } + + public string? ReportParameters { get; set; } + + public int? ReportAccess { get; set; } + + [StringLength(14)] + [Unicode(false)] + public string ObjectType { get; set; } = null!; +} diff --git a/Migration.Toolkit.KX13/SettingsKeys.cs b/Migration.Toolkit.KX13/SettingsKeys.cs index b407d8ef..97e7489d 100644 --- a/Migration.Toolkit.KX13/SettingsKeys.cs +++ b/Migration.Toolkit.KX13/SettingsKeys.cs @@ -1,479 +1,479 @@ -// ReSharper disable InconsistentNaming -// ReSharper disable IdentifierTypo -namespace Migration.Toolkit.KX13; - -public static class SettingsKeys -{ - public const string CMSABTestingEnabled = "CMSABTestingEnabled"; - public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; - public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; - public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; - public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; - public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; - public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; - public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; - public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; - public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; - public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; - public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; - public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; - public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; - public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; - public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; - public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; - public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; - public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; - public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; - public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; - public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; - public const string CMSApplicationState = "CMSApplicationState"; - public const string CMSArchiveEmails = "CMSArchiveEmails"; - public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; - public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; - public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; - public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; - public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; - public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; - public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; - public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; - public const string CMSAvatarHeight = "CMSAvatarHeight"; - public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; - public const string CMSAvatarWidth = "CMSAvatarWidth"; - public const string CMSAzureComputerVisionAPIEndpoint = "CMSAzureComputerVisionAPIEndpoint"; - public const string CMSAzureComputerVisionAPIKey = "CMSAzureComputerVisionAPIKey"; - public const string CMSAzureComputerVisionConfidence = "CMSAzureComputerVisionConfidence"; - public const string CMSAzureTextAnalyticsAPIEndpoint = "CMSAzureTextAnalyticsAPIEndpoint"; - public const string CMSAzureTextAnalyticsAPIKey = "CMSAzureTextAnalyticsAPIKey"; - public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; - public const string CMSBitlyLogin = "CMSBitlyLogin"; - public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; - public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; - public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; - public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; - public const string CMSCacheImages = "CMSCacheImages"; - public const string CMSCacheMinutes = "CMSCacheMinutes"; - public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; - public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; - public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; - public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; - public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; - public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; - public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; - public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; - public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; - public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; - public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; - public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; - public const string CMSCMCustomActivities = "CMSCMCustomActivities"; - public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; - public const string CMSCMEmailOpening = "CMSCMEmailOpening"; - public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; - public const string CMSCMExternalSearch = "CMSCMExternalSearch"; - public const string CMSCMGeoCity = "CMSCMGeoCity"; - public const string CMSCMGeoCountry = "CMSCMGeoCountry"; - public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; - public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; - public const string CMSCMGeoMetro = "CMSCMGeoMetro"; - public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; - public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; - public const string CMSCMGeoPostal = "CMSCMGeoPostal"; - public const string CMSCMGeoState = "CMSCMGeoState"; - public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; - public const string CMSCMLandingPage = "CMSCMLandingPage"; - public const string CMSCMLegitimateInterestActivitiesEnabled = "CMSCMLegitimateInterestActivitiesEnabled"; - public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; - public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; - public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; - public const string CMSCMPageVisits = "CMSCMPageVisits"; - public const string CMSCMPurchase = "CMSCMPurchase"; - public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; - public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; - public const string CMSCMSearch = "CMSCMSearch"; - public const string CMSCMStamp = "CMSCMStamp"; - public const string CMSCMUserLogin = "CMSCMUserLogin"; - public const string CMSCMUserRegistration = "CMSCMUserRegistration"; - public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; - public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; - public const string CMSConfirmChanges = "CMSConfirmChanges"; - public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; - public const string CMSDataVersion = "CMSDataVersion"; - public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; - public const string CMSDBVersion = "CMSDBVersion"; - public const string CMSDebugAllCache = "CMSDebugAllCache"; - public const string CMSDebugAllFiles = "CMSDebugAllFiles"; - public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; - public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; - public const string CMSDebugAllMacros = "CMSDebugAllMacros"; - public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; - public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; - public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; - public const string CMSDebugCache = "CMSDebugCache"; - public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; - public const string CMSDebugCacheStack = "CMSDebugCacheStack"; - public const string CMSDebugEverything = "CMSDebugEverything"; - public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; - public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; - public const string CMSDebugFiles = "CMSDebugFiles"; - public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; - public const string CMSDebugFilesStack = "CMSDebugFilesStack"; - public const string CMSDebugHandlers = "CMSDebugHandlers"; - public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; - public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; - public const string CMSDebugImportExport = "CMSDebugImportExport"; - public const string CMSDebugMacros = "CMSDebugMacros"; - public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; - public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; - public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; - public const string CMSDebugResources = "CMSDebugResources"; - public const string CMSDebugScheduler = "CMSDebugScheduler"; - public const string CMSDebugSecurity = "CMSDebugSecurity"; - public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; - public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; - public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; - public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; - public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; - public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; - public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; - public const string CMSDebugWebFarm = "CMSDebugWebFarm"; - public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; - public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; - public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; - public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; - public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; - public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; - public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; - public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; - public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; - public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; - public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; - public const string CMSDefaultControlForText = "CMSDefaultControlForText"; - public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; - public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; - public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; - public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; - public const string CMSDefaultUserID = "CMSDefaultUserID"; - public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; - public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; - public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; - public const string CMSDeploymentMode = "CMSDeploymentMode"; - public const string CMSDisableDebug = "CMSDisableDebug"; - public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; - public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; - public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; - public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; - public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; - public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; - public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; - public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; - public const string CMSEmailBatchSize = "CMSEmailBatchSize"; - public const string CMSEmailEncoding = "CMSEmailEncoding"; - public const string CMSEmailFormat = "CMSEmailFormat"; - public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; - public const string CMSEmailsEnabled = "CMSEmailsEnabled"; - public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; - public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; - public const string CMSEnableCI = "CMSEnableCI"; - public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; - public const string CMSEnableImageRecognition = "CMSEnableImageRecognition"; - public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; - public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; - public const string CMSEnableSentimentAnalysis = "CMSEnableSentimentAnalysis"; - public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; - public const string CMSEnableTranslations = "CMSEnableTranslations"; - public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; - public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; - public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; - public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; - public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; - public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; - public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; - public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; - public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; - public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; - public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; - public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; - public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; - public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; - public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; - public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; - public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; - public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; - public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; - public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; - public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; - public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; - public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; - public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; - public const string CMSFilesFolder = "CMSFilesFolder"; - public const string CMSFilesLocationType = "CMSFilesLocationType"; - public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; - public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; - public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; - public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; - public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; - public const string CMSHideLanguagePrefixForDefaultCultureURL = "CMSHideLanguagePrefixForDefaultCultureURL"; - public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; - public const string CMSHomePagePath = "CMSHomePagePath"; - public const string CMSHomePageURLBehavior = "CMSHomePageURLBehavior"; - public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; - public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; - public const string CMSHotfixVersion = "CMSHotfixVersion"; - public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; - public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; - public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; - public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; - public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; - public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; - public const string CMSJwtTokenEncryptionKey = "CMSJwtTokenEncryptionKey"; - public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; - public const string CMSLogCache = "CMSLogCache"; - public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; - public const string CMSLogFiles = "CMSLogFiles"; - public const string CMSLogHandlers = "CMSLogHandlers"; - public const string CMSLogMacros = "CMSLogMacros"; - public const string CMSLogMetadata = "CMSLogMetadata"; - public const string CMSLogSecurity = "CMSLogSecurity"; - public const string CMSLogSize = "CMSLogSize"; - public const string CMSLogSQLQueries = "CMSLogSQLQueries"; - public const string CMSLogToDatabase = "CMSLogToDatabase"; - public const string CMSLogToFileSystem = "CMSLogToFileSystem"; - public const string CMSLogToTrace = "CMSLogToTrace"; - public const string CMSLogWebFarm = "CMSLogWebFarm"; - public const string CMSLowercaseURLs = "CMSLowercaseURLs"; - public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; - public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; - public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; - public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; - public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; - public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; - public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; - public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; - public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; - public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; - public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; - public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; - public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; - public const string CMSMembershipReminder = "CMSMembershipReminder"; - public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; - public const string CMSMFEnabled = "CMSMFEnabled"; - public const string CMSMFRequired = "CMSMFRequired"; - public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; - public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; - public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; - public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; - public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; - public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; - public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; - public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; - public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; - public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; - public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; - public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; - public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; - public const string CMSOptInInterval = "CMSOptInInterval"; - public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; - public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; - public const string CMSPageTitleFormat = "CMSPageTitleFormat"; - public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; - public const string CMSPasswordExpiration = "CMSPasswordExpiration"; - public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; - public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; - public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; - public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; - public const string CMSPasswordFormat = "CMSPasswordFormat"; - public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; - public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; - public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; - public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; - public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; - public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; - public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; - public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; - public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; - public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; - public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; - public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; - public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; - public const string CMSPOP3Password = "CMSPOP3Password"; - public const string CMSPOP3ServerName = "CMSPOP3ServerName"; - public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; - public const string CMSPOP3UserName = "CMSPOP3UserName"; - public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; - public const string CMSPriceRounding = "CMSPriceRounding"; - public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; - public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; - public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; - public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; - public const string CMSRememberUniGridState = "CMSRememberUniGridState"; - public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; - public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; - public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; - public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; - public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; - public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; - public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; - public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; - public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; - public const string CMSRestoreObjects = "CMSRestoreObjects"; - public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; - public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; - public const string CMSRESTUrlHashSalt = "CMSRESTUrlHashSalt"; - public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; - public const string CMSRichTextEditorLicense = "CMSRichTextEditorLicense"; - public const string CMSRichTextEditorStylesheetURL = "CMSRichTextEditorStylesheetURL"; - public const string CMSRoutingMode = "CMSRoutingMode"; - public const string CMSRoutingURLCultureFormat = "CMSRoutingURLCultureFormat"; - public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; - public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; - public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; - public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; - public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; - public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; - public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; - public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; - public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; - public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; - public const string CMSSchedulerInterval = "CMSSchedulerInterval"; - public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; - public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; - public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; - public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; - public const string CMSScreenLockInterval = "CMSScreenLockInterval"; - public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; - public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; - public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; - public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; - public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; - public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; - public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; - public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; - public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; - public const string CMSServerTimeZone = "CMSServerTimeZone"; - public const string CMSSharePointCache = "CMSSharePointCache"; - public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; - public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; - public const string CMSShoppingCartURL = "CMSShoppingCartURL"; - public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; - public const string CMSSiteTimeZone = "CMSSiteTimeZone"; - public const string CMSSMTPServer = "CMSSMTPServer"; - public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; - public const string CMSSMTPServerTip = "CMSSMTPServerTip"; - public const string CMSSMTPServerUser = "CMSSMTPServerUser"; - public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; - public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; - public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; - public const string CMSStagingLogChanges = "CMSStagingLogChanges"; - public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; - public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; - public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; - public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; - public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; - public const string CMSStagingServicePassword = "CMSStagingServicePassword"; - public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; - public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; - public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; - public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; - public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; - public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; - public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; - public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; - public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; - public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; - public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; - public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; - public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; - public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; - public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; - public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; - public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; - public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; - public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; - public const string CMSStoreFormerUrls = "CMSStoreFormerUrls"; - public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; - public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; - public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; - public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; - public const string CMSStoreMassUnit = "CMSStoreMassUnit"; - public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; - public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; - public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; - public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; - public const string CMSStoreProductsTree = "CMSStoreProductsTree"; - public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; - public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; - public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; - public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; - public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; - public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; - public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; - public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; - public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; - public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; - public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; - public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; - public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; - public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; - public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; - public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; - public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; - public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; - public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; - public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; - public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; - public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; - public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; - public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; - public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; - public const string CMSTrackExitPages = "CMSTrackExitPages"; - public const string CMSTrackLandingPages = "CMSTrackLandingPages"; - public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; - public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; - public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; - public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; - public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; - public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; - public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; - public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; - public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; - public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; - public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; - public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; - public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; - public const string CMSUploadExtensions = "CMSUploadExtensions"; - public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; - public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; - public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; - public const string CMSUseCultureAliasAsLanguagePrefixInUrl = "CMSUseCultureAliasAsLanguagePrefixInUrl"; - public const string CMSUseEventLogListener = "CMSUseEventLogListener"; - public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; - public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; - public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; - public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; - public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; - public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; - public const string CMSUseSSL = "CMSUseSSL"; - public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; - public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; - public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; - public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; - public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; - public const string CMSWebFarmMode = "CMSWebFarmMode"; - public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; - public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; - public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; - public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; - public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; - public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; - public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; - public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; - public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; - public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; - public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; - public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; - public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; - public const string CMSWIFEnabled = "CMSWIFEnabled"; - public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; - public const string CMSWIFRealm = "CMSWIFRealm"; - public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; - public const string CMSWishlistURL = "CMSWishlistURL"; -} \ No newline at end of file +// ReSharper disable InconsistentNaming +// ReSharper disable IdentifierTypo +namespace Migration.Toolkit.KX13; + +public static class SettingsKeys +{ + public const string CMSABTestingEnabled = "CMSABTestingEnabled"; + public const string CMSAdminEmailAddress = "CMSAdminEmailAddress"; + public const string CMSAllowAttachmentTranslation = "CMSAllowAttachmentTranslation"; + public const string CMSAllowDynamicNewsletters = "CMSAllowDynamicNewsletters"; + public const string CMSAllowedURLCharacters = "CMSAllowedURLCharacters"; + public const string CMSAllowGlobalCategories = "CMSAllowGlobalCategories"; + public const string CMSAllowPermanentPreviewLink = "CMSAllowPermanentPreviewLink"; + public const string CMSAlternativeURLsConstraint = "CMSAlternativeURLsConstraint"; + public const string CMSAlternativeURLsErrorMessage = "CMSAlternativeURLsErrorMessage"; + public const string CMSAlternativeURLsExcludedURLs = "CMSAlternativeURLsExcludedURLs"; + public const string CMSAlternativeURLsMode = "CMSAlternativeURLsMode"; + public const string CMSAlternativeUrlUIEnabled = "CMSAlternativeUrlUIEnabled"; + public const string CMSAnalyticsEnabled = "CMSAnalyticsEnabled"; + public const string CMSAnalyticsExcludedIPs = "CMSAnalyticsExcludedIPs"; + public const string CMSAnalyticsExcludedURLs = "CMSAnalyticsExcludedURLs"; + public const string CMSAnalyticsExcludeSearchEngines = "CMSAnalyticsExcludeSearchEngines"; + public const string CMSAnalyticsTrackBrowserTypes = "CMSAnalyticsTrackBrowserTypes"; + public const string CMSAnalyticsTrackCountries = "CMSAnalyticsTrackCountries"; + public const string CMSAnalyticsTrackInvalidPages = "CMSAnalyticsTrackInvalidPages"; + public const string CMSAnalyticsTrackPageViews = "CMSAnalyticsTrackPageViews"; + public const string CMSAnalyticsTrackReferrals = "CMSAnalyticsTrackReferrals"; + public const string CMSAnalyticsTrackVisits = "CMSAnalyticsTrackVisits"; + public const string CMSApplicationState = "CMSApplicationState"; + public const string CMSArchiveEmails = "CMSArchiveEmails"; + public const string CMSAuthorizeNETAPILogin = "CMSAuthorizeNETAPILogin"; + public const string CMSAuthorizeNETTransactionKey = "CMSAuthorizeNETTransactionKey"; + public const string CMSAuthorizeNETTransactionType = "CMSAuthorizeNETTransactionType"; + public const string CMSAutocompleteEnableForLogin = "CMSAutocompleteEnableForLogin"; + public const string CMSAutomaticallySignInUser = "CMSAutomaticallySignInUser"; + public const string CMSAutoResizeImageHeight = "CMSAutoResizeImageHeight"; + public const string CMSAutoResizeImageMaxSideSize = "CMSAutoResizeImageMaxSideSize"; + public const string CMSAutoResizeImageWidth = "CMSAutoResizeImageWidth"; + public const string CMSAvatarHeight = "CMSAvatarHeight"; + public const string CMSAvatarMaxSideSize = "CMSAvatarMaxSideSize"; + public const string CMSAvatarWidth = "CMSAvatarWidth"; + public const string CMSAzureComputerVisionAPIEndpoint = "CMSAzureComputerVisionAPIEndpoint"; + public const string CMSAzureComputerVisionAPIKey = "CMSAzureComputerVisionAPIKey"; + public const string CMSAzureComputerVisionConfidence = "CMSAzureComputerVisionConfidence"; + public const string CMSAzureTextAnalyticsAPIEndpoint = "CMSAzureTextAnalyticsAPIEndpoint"; + public const string CMSAzureTextAnalyticsAPIKey = "CMSAzureTextAnalyticsAPIKey"; + public const string CMSBitlyAPIKey = "CMSBitlyAPIKey"; + public const string CMSBitlyLogin = "CMSBitlyLogin"; + public const string CMSBizFormFilesFolder = "CMSBizFormFilesFolder"; + public const string CMSBlockSubscribersGlobally = "CMSBlockSubscribersGlobally"; + public const string CMSBouncedEmailAddress = "CMSBouncedEmailAddress"; + public const string CMSBouncedEmailsLimit = "CMSBouncedEmailsLimit"; + public const string CMSCacheImages = "CMSCacheImages"; + public const string CMSCacheMinutes = "CMSCacheMinutes"; + public const string CMSCheapestVariantAdvertising = "CMSCheapestVariantAdvertising"; + public const string CMSCheckDocumentPermissions = "CMSCheckDocumentPermissions"; + public const string CMSCheckFilesPermissions = "CMSCheckFilesPermissions"; + public const string CMSCheckMediaFilePermissions = "CMSCheckMediaFilePermissions"; + public const string CMSCheckPagePermissions = "CMSCheckPagePermissions"; + public const string CMSCheckPublishedFiles = "CMSCheckPublishedFiles"; + public const string CMSClientCacheMinutes = "CMSClientCacheMinutes"; + public const string CMSCMActivitiesEnabled = "CMSCMActivitiesEnabled"; + public const string CMSCMAddingProductToSC = "CMSCMAddingProductToSC"; + public const string CMSCMAddingProductToWL = "CMSCMAddingProductToWL"; + public const string CMSCMBizFormSubmission = "CMSCMBizFormSubmission"; + public const string CMSCMClickthroughTracking = "CMSCMClickthroughTracking"; + public const string CMSCMCustomActivities = "CMSCMCustomActivities"; + public const string CMSCMCustomTableForm = "CMSCMCustomTableForm"; + public const string CMSCMEmailOpening = "CMSCMEmailOpening"; + public const string CMSCMEnableGeolocation = "CMSCMEnableGeolocation"; + public const string CMSCMExternalSearch = "CMSCMExternalSearch"; + public const string CMSCMGeoCity = "CMSCMGeoCity"; + public const string CMSCMGeoCountry = "CMSCMGeoCountry"; + public const string CMSCMGeoLatitude = "CMSCMGeoLatitude"; + public const string CMSCMGeoLongitude = "CMSCMGeoLongitude"; + public const string CMSCMGeoMetro = "CMSCMGeoMetro"; + public const string CMSCMGeoNewDB = "CMSCMGeoNewDB"; + public const string CMSCMGeoOrganization = "CMSCMGeoOrganization"; + public const string CMSCMGeoPostal = "CMSCMGeoPostal"; + public const string CMSCMGeoState = "CMSCMGeoState"; + public const string CMSCMGeoSuffix = "CMSCMGeoSuffix"; + public const string CMSCMLandingPage = "CMSCMLandingPage"; + public const string CMSCMLegitimateInterestActivitiesEnabled = "CMSCMLegitimateInterestActivitiesEnabled"; + public const string CMSCMNewsletterSubscribe = "CMSCMNewsletterSubscribe"; + public const string CMSCMNewsletterUnsubscribe = "CMSCMNewsletterUnsubscribe"; + public const string CMSCMNewsletterUnsubscribedFromAll = "CMSCMNewsletterUnsubscribedFromAll"; + public const string CMSCMPageVisits = "CMSCMPageVisits"; + public const string CMSCMPurchase = "CMSCMPurchase"; + public const string CMSCMPurchasedProduct = "CMSCMPurchasedProduct"; + public const string CMSCMRemovingProductFromSC = "CMSCMRemovingProductFromSC"; + public const string CMSCMSearch = "CMSCMSearch"; + public const string CMSCMStamp = "CMSCMStamp"; + public const string CMSCMUserLogin = "CMSCMUserLogin"; + public const string CMSCMUserRegistration = "CMSCMUserRegistration"; + public const string CMSCodeNamePrefix = "CMSCodeNamePrefix"; + public const string CMSCombineWithDefaultCulture = "CMSCombineWithDefaultCulture"; + public const string CMSConfirmChanges = "CMSConfirmChanges"; + public const string CMSContentPersonalizationEnabled = "CMSContentPersonalizationEnabled"; + public const string CMSDataVersion = "CMSDataVersion"; + public const string CMSDBSeparationStartedByServer = "CMSDBSeparationStartedByServer"; + public const string CMSDBVersion = "CMSDBVersion"; + public const string CMSDebugAllCache = "CMSDebugAllCache"; + public const string CMSDebugAllFiles = "CMSDebugAllFiles"; + public const string CMSDebugAllForEverything = "CMSDebugAllForEverything"; + public const string CMSDebugAllHandlers = "CMSDebugAllHandlers"; + public const string CMSDebugAllMacros = "CMSDebugAllMacros"; + public const string CMSDebugAllSecurity = "CMSDebugAllSecurity"; + public const string CMSDebugAllSQLQueries = "CMSDebugAllSQLQueries"; + public const string CMSDebugAllWebFarm = "CMSDebugAllWebFarm"; + public const string CMSDebugCache = "CMSDebugCache"; + public const string CMSDebugCacheLogLength = "CMSDebugCacheLogLength"; + public const string CMSDebugCacheStack = "CMSDebugCacheStack"; + public const string CMSDebugEverything = "CMSDebugEverything"; + public const string CMSDebugEverythingEverywhere = "CMSDebugEverythingEverywhere"; + public const string CMSDebugEverythingLogLength = "CMSDebugEverythingLogLength"; + public const string CMSDebugFiles = "CMSDebugFiles"; + public const string CMSDebugFilesLogLength = "CMSDebugFilesLogLength"; + public const string CMSDebugFilesStack = "CMSDebugFilesStack"; + public const string CMSDebugHandlers = "CMSDebugHandlers"; + public const string CMSDebugHandlersLogLength = "CMSDebugHandlersLogLength"; + public const string CMSDebugHandlersStack = "CMSDebugHandlersStack"; + public const string CMSDebugImportExport = "CMSDebugImportExport"; + public const string CMSDebugMacros = "CMSDebugMacros"; + public const string CMSDebugMacrosDetailed = "CMSDebugMacrosDetailed"; + public const string CMSDebugMacrosLogLength = "CMSDebugMacrosLogLength"; + public const string CMSDebugMacrosStack = "CMSDebugMacrosStack"; + public const string CMSDebugResources = "CMSDebugResources"; + public const string CMSDebugScheduler = "CMSDebugScheduler"; + public const string CMSDebugSecurity = "CMSDebugSecurity"; + public const string CMSDebugSecurityLogLength = "CMSDebugSecurityLogLength"; + public const string CMSDebugSecurityStack = "CMSDebugSecurityStack"; + public const string CMSDebugSQLConnections = "CMSDebugSQLConnections"; + public const string CMSDebugSQLQueries = "CMSDebugSQLQueries"; + public const string CMSDebugSQLQueriesLogLength = "CMSDebugSQLQueriesLogLength"; + public const string CMSDebugSQLQueriesStack = "CMSDebugSQLQueriesStack"; + public const string CMSDebugStackForEverything = "CMSDebugStackForEverything"; + public const string CMSDebugWebFarm = "CMSDebugWebFarm"; + public const string CMSDebugWebFarmLogLength = "CMSDebugWebFarmLogLength"; + public const string CMSDebugWebFarmStack = "CMSDebugWebFarmStack"; + public const string CMSDefaultControlForBoolean = "CMSDefaultControlForBoolean"; + public const string CMSDefaultControlForDateTime = "CMSDefaultControlForDateTime"; + public const string CMSDefaultControlForDecimal = "CMSDefaultControlForDecimal"; + public const string CMSDefaultControlForDocAttachments = "CMSDefaultControlForDocAttachments"; + public const string CMSDefaultControlForDocRelationships = "CMSDefaultControlForDocRelationships"; + public const string CMSDefaultControlForFile = "CMSDefaultControlForFile"; + public const string CMSDefaultControlForGUID = "CMSDefaultControlForGUID"; + public const string CMSDefaultControlForInteger = "CMSDefaultControlForInteger"; + public const string CMSDefaultControlForLongText = "CMSDefaultControlForLongText"; + public const string CMSDefaultControlForText = "CMSDefaultControlForText"; + public const string CMSDefaultCookieLevel = "CMSDefaultCookieLevel"; + public const string CMSDefaultCultureCode = "CMSDefaultCultureCode"; + public const string CMSDefaultProductImageUrl = "CMSDefaultProductImageUrl"; + public const string CMSDefaultReportConnectionString = "CMSDefaultReportConnectionString"; + public const string CMSDefaultUserID = "CMSDefaultUserID"; + public const string CMSDeleteInactiveContactsLastXDays = "CMSDeleteInactiveContactsLastXDays"; + public const string CMSDeleteInactiveContactsMethod = "CMSDeleteInactiveContactsMethod"; + public const string CMSDeleteNonActivatedUserAfter = "CMSDeleteNonActivatedUserAfter"; + public const string CMSDeploymentMode = "CMSDeploymentMode"; + public const string CMSDisableDebug = "CMSDisableDebug"; + public const string CMSDisplayAccountLockInformation = "CMSDisplayAccountLockInformation"; + public const string CMSDisplayArchivedIcon = "CMSDisplayArchivedIcon"; + public const string CMSDisplayCheckedOutIcon = "CMSDisplayCheckedOutIcon"; + public const string CMSDisplayLinkedIcon = "CMSDisplayLinkedIcon"; + public const string CMSDisplayNotPublishedIcon = "CMSDisplayNotPublishedIcon"; + public const string CMSDisplayNotTranslatedIcon = "CMSDisplayNotTranslatedIcon"; + public const string CMSDisplayPublishedIcon = "CMSDisplayPublishedIcon"; + public const string CMSDisplayVersionNotPublishedIcon = "CMSDisplayVersionNotPublishedIcon"; + public const string CMSEmailBatchSize = "CMSEmailBatchSize"; + public const string CMSEmailEncoding = "CMSEmailEncoding"; + public const string CMSEmailFormat = "CMSEmailFormat"; + public const string CMSEmailQueueEnabled = "CMSEmailQueueEnabled"; + public const string CMSEmailsEnabled = "CMSEmailsEnabled"; + public const string CMSEmailTranslationFrom = "CMSEmailTranslationFrom"; + public const string CMSEmailTranslationRecipients = "CMSEmailTranslationRecipients"; + public const string CMSEnableCI = "CMSEnableCI"; + public const string CMSEnableCodeEditSiteAdministrators = "CMSEnableCodeEditSiteAdministrators"; + public const string CMSEnableImageRecognition = "CMSEnableImageRecognition"; + public const string CMSEnableObjectsVersioning = "CMSEnableObjectsVersioning"; + public const string CMSEnableOnlineMarketing = "CMSEnableOnlineMarketing"; + public const string CMSEnableSentimentAnalysis = "CMSEnableSentimentAnalysis"; + public const string CMSEnableTranlsationRESTService = "CMSEnableTranlsationRESTService"; + public const string CMSEnableTranslations = "CMSEnableTranslations"; + public const string CMSEnableVersioningCMSAlternativeForm = "CMSEnableVersioningCMSAlternativeForm"; + public const string CMSEnableVersioningCMSCustomTable = "CMSEnableVersioningCMSCustomTable"; + public const string CMSEnableVersioningCMSDocumentType = "CMSEnableVersioningCMSDocumentType"; + public const string CMSEnableVersioningCMSEmailTemplate = "CMSEnableVersioningCMSEmailTemplate"; + public const string CMSEnableVersioningCMSForm = "CMSEnableVersioningCMSForm"; + public const string CMSEnableVersioningCMSLayout = "CMSEnableVersioningCMSLayout"; + public const string CMSEnableVersioningCMSPageTemplate = "CMSEnableVersioningCMSPageTemplate"; + public const string CMSEnableVersioningCMSQuery = "CMSEnableVersioningCMSQuery"; + public const string CMSEnableVersioningCMSTransformation = "CMSEnableVersioningCMSTransformation"; + public const string CMSEnableVersioningCMSUIElement = "CMSEnableVersioningCMSUIElement"; + public const string CMSEnableVersioningCMSWebPartLayout = "CMSEnableVersioningCMSWebPartLayout"; + public const string CMSEnableVersioningCMSWorkflow = "CMSEnableVersioningCMSWorkflow"; + public const string CMSEnableVersioningMAAutomationProcess = "CMSEnableVersioningMAAutomationProcess"; + public const string CMSEnableVersioningMediaFile = "CMSEnableVersioningMediaFile"; + public const string CMSEnableVersioningNewsletterEmailTemplate = "CMSEnableVersioningNewsletterEmailTemplate"; + public const string CMSEnableVersioningNewsletterEmailWidget = "CMSEnableVersioningNewsletterEmailWidget"; + public const string CMSEnableVersioningNewsletterIssue = "CMSEnableVersioningNewsletterIssue"; + public const string CMSEnableVersioningReportingReport = "CMSEnableVersioningReportingReport"; + public const string CMSEnableVersioningReportingReportGraph = "CMSEnableVersioningReportingReportGraph"; + public const string CMSEnableVersioningReportingReportTable = "CMSEnableVersioningReportingReportTable"; + public const string CMSEnableVersioningReportingReportValue = "CMSEnableVersioningReportingReportValue"; + public const string CMSExcludeDocumentsFromSearch = "CMSExcludeDocumentsFromSearch"; + public const string CMSExcludeDocumentTypesFromSearch = "CMSExcludeDocumentTypesFromSearch"; + public const string CMSExportLogObjectChanges = "CMSExportLogObjectChanges"; + public const string CMSFilesFolder = "CMSFilesFolder"; + public const string CMSFilesLocationType = "CMSFilesLocationType"; + public const string CMSForbiddenCharactersReplacement = "CMSForbiddenCharactersReplacement"; + public const string CMSForbiddenURLCharacters = "CMSForbiddenURLCharacters"; + public const string CMSGenerateNewsletters = "CMSGenerateNewsletters"; + public const string CMSGenerateThumbnails = "CMSGenerateThumbnails"; + public const string CMSGoogleTranslateAPIKey = "CMSGoogleTranslateAPIKey"; + public const string CMSHideLanguagePrefixForDefaultCultureURL = "CMSHideLanguagePrefixForDefaultCultureURL"; + public const string CMSHideUnavailableUserInterface = "CMSHideUnavailableUserInterface"; + public const string CMSHomePagePath = "CMSHomePagePath"; + public const string CMSHomePageURLBehavior = "CMSHomePageURLBehavior"; + public const string CMSHotfixDataVersion = "CMSHotfixDataVersion"; + public const string CMSHotfixProcedureInProgress = "CMSHotfixProcedureInProgress"; + public const string CMSHotfixVersion = "CMSHotfixVersion"; + public const string CMSIncludeTaxInPrices = "CMSIncludeTaxInPrices"; + public const string CMSIntegrationEnabled = "CMSIntegrationEnabled"; + public const string CMSIntegrationLogExternal = "CMSIntegrationLogExternal"; + public const string CMSIntegrationLogInternal = "CMSIntegrationLogInternal"; + public const string CMSIntegrationProcessExternal = "CMSIntegrationProcessExternal"; + public const string CMSIntegrationProcessInternal = "CMSIntegrationProcessInternal"; + public const string CMSJwtTokenEncryptionKey = "CMSJwtTokenEncryptionKey"; + public const string CMSKeepNewCheckedOut = "CMSKeepNewCheckedOut"; + public const string CMSLogCache = "CMSLogCache"; + public const string CMSLogEverythingToFile = "CMSLogEverythingToFile"; + public const string CMSLogFiles = "CMSLogFiles"; + public const string CMSLogHandlers = "CMSLogHandlers"; + public const string CMSLogMacros = "CMSLogMacros"; + public const string CMSLogMetadata = "CMSLogMetadata"; + public const string CMSLogSecurity = "CMSLogSecurity"; + public const string CMSLogSize = "CMSLogSize"; + public const string CMSLogSQLQueries = "CMSLogSQLQueries"; + public const string CMSLogToDatabase = "CMSLogToDatabase"; + public const string CMSLogToFileSystem = "CMSLogToFileSystem"; + public const string CMSLogToTrace = "CMSLogToTrace"; + public const string CMSLogWebFarm = "CMSLogWebFarm"; + public const string CMSLowercaseURLs = "CMSLowercaseURLs"; + public const string CMSManualTranslationDeleteSuccessfulSubmissions = "CMSManualTranslationDeleteSuccessfulSubmissions"; + public const string CMSManualTranslationExportFolder = "CMSManualTranslationExportFolder"; + public const string CMSManualTranslationImportFolder = "CMSManualTranslationImportFolder"; + public const string CMSMarkShoppingCartAsAbandonedPeriod = "CMSMarkShoppingCartAsAbandonedPeriod"; + public const string CMSMaxCacheFileSize = "CMSMaxCacheFileSize"; + public const string CMSMaximumInvalidLogonAttempts = "CMSMaximumInvalidLogonAttempts"; + public const string CMSMaxTreeNodes = "CMSMaxTreeNodes"; + public const string CMSMaxUITreeNodes = "CMSMaxUITreeNodes"; + public const string CMSMediaFileAllowedExtensions = "CMSMediaFileAllowedExtensions"; + public const string CMSMediaFileHiddenFolder = "CMSMediaFileHiddenFolder"; + public const string CMSMediaFilePreviewSuffix = "CMSMediaFilePreviewSuffix"; + public const string CMSMediaLibrariesFolder = "CMSMediaLibrariesFolder"; + public const string CMSMediaLibraryMaxSubFolders = "CMSMediaLibraryMaxSubFolders"; + public const string CMSMembershipReminder = "CMSMembershipReminder"; + public const string CMSMFDisplayInitToken = "CMSMFDisplayInitToken"; + public const string CMSMFEnabled = "CMSMFEnabled"; + public const string CMSMFRequired = "CMSMFRequired"; + public const string CMSModuleUsageTrackingEnabled = "CMSModuleUsageTrackingEnabled"; + public const string CMSModuleUsageTrackingIdentity = "CMSModuleUsageTrackingIdentity"; + public const string CMSMonitorBouncedEmails = "CMSMonitorBouncedEmails"; + public const string CMSMSTranslatorTextAPISubscriptionKey = "CMSMSTranslatorTextAPISubscriptionKey"; + public const string CMSNewDocumentOrder = "CMSNewDocumentOrder"; + public const string CMSNewsletterUnsubscriptionURL = "CMSNewsletterUnsubscriptionURL"; + public const string CMSNewsletterUseExternalService = "CMSNewsletterUseExternalService"; + public const string CMSNoreplyEmailAddress = "CMSNoreplyEmailAddress"; + public const string CMSObjectVersionHistoryLength = "CMSObjectVersionHistoryLength"; + public const string CMSObjectVersionHistoryMajorVersionsLength = "CMSObjectVersionHistoryMajorVersionsLength"; + public const string CMSObjectVersionHistoryPromoteToMajorTimeInterval = "CMSObjectVersionHistoryPromoteToMajorTimeInterval"; + public const string CMSObjectVersionHistoryUseLastVersionInterval = "CMSObjectVersionHistoryUseLastVersionInterval"; + public const string CMSOptInApprovalURL = "CMSOptInApprovalURL"; + public const string CMSOptInInterval = "CMSOptInInterval"; + public const string CMSPageDescriptionPrefix = "CMSPageDescriptionPrefix"; + public const string CMSPageKeyWordsPrefix = "CMSPageKeyWordsPrefix"; + public const string CMSPageTitleFormat = "CMSPageTitleFormat"; + public const string CMSPageTitlePrefix = "CMSPageTitlePrefix"; + public const string CMSPasswordExpiration = "CMSPasswordExpiration"; + public const string CMSPasswordExpirationBehaviour = "CMSPasswordExpirationBehaviour"; + public const string CMSPasswordExpirationEmail = "CMSPasswordExpirationEmail"; + public const string CMSPasswordExpirationPeriod = "CMSPasswordExpirationPeriod"; + public const string CMSPasswordExpirationWarningPeriod = "CMSPasswordExpirationWarningPeriod"; + public const string CMSPasswordFormat = "CMSPasswordFormat"; + public const string CMSPaypalCancelReturnUrl = "CMSPaypalCancelReturnUrl"; + public const string CMSPayPalCredentialsAccountType = "CMSPayPalCredentialsAccountType"; + public const string CMSPayPalCredentialsClientId = "CMSPayPalCredentialsClientId"; + public const string CMSPayPalCredentialsClientSecret = "CMSPayPalCredentialsClientSecret"; + public const string CMSPayPalReturnUrl = "CMSPayPalReturnUrl"; + public const string CMSPayPalTransactionType = "CMSPayPalTransactionType"; + public const string CMSPersonalizeUserInterface = "CMSPersonalizeUserInterface"; + public const string CMSPolicyForcePolicyOnLogon = "CMSPolicyForcePolicyOnLogon"; + public const string CMSPolicyMinimalLength = "CMSPolicyMinimalLength"; + public const string CMSPolicyNumberOfNonAlphaNumChars = "CMSPolicyNumberOfNonAlphaNumChars"; + public const string CMSPolicyRegularExpression = "CMSPolicyRegularExpression"; + public const string CMSPolicyViolationMessage = "CMSPolicyViolationMessage"; + public const string CMSPOP3AuthenticationMethod = "CMSPOP3AuthenticationMethod"; + public const string CMSPOP3Password = "CMSPOP3Password"; + public const string CMSPOP3ServerName = "CMSPOP3ServerName"; + public const string CMSPOP3ServerPort = "CMSPOP3ServerPort"; + public const string CMSPOP3UserName = "CMSPOP3UserName"; + public const string CMSPOP3UseSSL = "CMSPOP3UseSSL"; + public const string CMSPriceRounding = "CMSPriceRounding"; + public const string CMSReCaptchaPrivateKey = "CMSReCaptchaPrivateKey"; + public const string CMSReCaptchaPublicKey = "CMSReCaptchaPublicKey"; + public const string CMSRedirectFilesToDisk = "CMSRedirectFilesToDisk"; + public const string CMSRegistrationAdministratorApproval = "CMSRegistrationAdministratorApproval"; + public const string CMSRememberUniGridState = "CMSRememberUniGridState"; + public const string CMSResetPasswordInterval = "CMSResetPasswordInterval"; + public const string CMSRESTAllowedDocTypes = "CMSRESTAllowedDocTypes"; + public const string CMSRESTAllowedObjectTypes = "CMSRESTAllowedObjectTypes"; + public const string CMSRESTAllowSensitiveFields = "CMSRESTAllowSensitiveFields"; + public const string CMSRESTDefaultEncoding = "CMSRESTDefaultEncoding"; + public const string CMSRESTDocumentsReadOnly = "CMSRESTDocumentsReadOnly"; + public const string CMSRESTDocumentsSecurityCheck = "CMSRESTDocumentsSecurityCheck"; + public const string CMSRESTGenerateHash = "CMSRESTGenerateHash"; + public const string CMSRESTObjectsReadOnly = "CMSRESTObjectsReadOnly"; + public const string CMSRestoreObjects = "CMSRestoreObjects"; + public const string CMSRESTServiceEnabled = "CMSRESTServiceEnabled"; + public const string CMSRESTServiceTypeEnabled = "CMSRESTServiceTypeEnabled"; + public const string CMSRESTUrlHashSalt = "CMSRESTUrlHashSalt"; + public const string CMSRevalidateClientCache = "CMSRevalidateClientCache"; + public const string CMSRichTextEditorLicense = "CMSRichTextEditorLicense"; + public const string CMSRichTextEditorStylesheetURL = "CMSRichTextEditorStylesheetURL"; + public const string CMSRoutingMode = "CMSRoutingMode"; + public const string CMSRoutingURLCultureFormat = "CMSRoutingURLCultureFormat"; + public const string CMSSalesForceCredentials = "CMSSalesForceCredentials"; + public const string CMSSalesForceLeadReplicationBatchSize = "CMSSalesForceLeadReplicationBatchSize"; + public const string CMSSalesForceLeadReplicationDefaultCompanyName = "CMSSalesForceLeadReplicationDefaultCompanyName"; + public const string CMSSalesForceLeadReplicationEnabled = "CMSSalesForceLeadReplicationEnabled"; + public const string CMSSalesForceLeadReplicationLeadDescription = "CMSSalesForceLeadReplicationLeadDescription"; + public const string CMSSalesForceLeadReplicationMapping = "CMSSalesForceLeadReplicationMapping"; + public const string CMSSalesForceLeadReplicationMappingDateTime = "CMSSalesForceLeadReplicationMappingDateTime"; + public const string CMSSalesForceLeadReplicationMinScoreValue = "CMSSalesForceLeadReplicationMinScoreValue"; + public const string CMSSalesForceLeadReplicationScoreID = "CMSSalesForceLeadReplicationScoreID"; + public const string CMSSalesForceLeadReplicationUpdateEnabled = "CMSSalesForceLeadReplicationUpdateEnabled"; + public const string CMSSchedulerInterval = "CMSSchedulerInterval"; + public const string CMSSchedulerServiceInterval = "CMSSchedulerServiceInterval"; + public const string CMSSchedulerTasksEnabled = "CMSSchedulerTasksEnabled"; + public const string CMSSchedulerUseExternalService = "CMSSchedulerUseExternalService"; + public const string CMSScreenLockEnabled = "CMSScreenLockEnabled"; + public const string CMSScreenLockInterval = "CMSScreenLockInterval"; + public const string CMSScreenLockWarningInterval = "CMSScreenLockWarningInterval"; + public const string CMSSearchAllowedFileTypes = "CMSSearchAllowedFileTypes"; + public const string CMSSearchIndexingEnabled = "CMSSearchIndexingEnabled"; + public const string CMSSendAccountUnlockEmail = "CMSSendAccountUnlockEmail"; + public const string CMSSendEmailNotificationsFrom = "CMSSendEmailNotificationsFrom"; + public const string CMSSendErrorNotificationTo = "CMSSendErrorNotificationTo"; + public const string CMSSendPasswordEmailsFrom = "CMSSendPasswordEmailsFrom"; + public const string CMSSendWorkflowEmails = "CMSSendWorkflowEmails"; + public const string CMSSendWorkflowEmailsFrom = "CMSSendWorkflowEmailsFrom"; + public const string CMSServerTimeZone = "CMSServerTimeZone"; + public const string CMSSharePointCache = "CMSSharePointCache"; + public const string CMSSharePointCacheSizeLimit = "CMSSharePointCacheSizeLimit"; + public const string CMSShoppingCartExpirationPeriod = "CMSShoppingCartExpirationPeriod"; + public const string CMSShoppingCartURL = "CMSShoppingCartURL"; + public const string CMSSiteSharedAccounts = "CMSSiteSharedAccounts"; + public const string CMSSiteTimeZone = "CMSSiteTimeZone"; + public const string CMSSMTPServer = "CMSSMTPServer"; + public const string CMSSMTPServerPassword = "CMSSMTPServerPassword"; + public const string CMSSMTPServerTip = "CMSSMTPServerTip"; + public const string CMSSMTPServerUser = "CMSSMTPServerUser"; + public const string CMSSocialMarketingURLShorteningFacebook = "CMSSocialMarketingURLShorteningFacebook"; + public const string CMSSocialMarketingURLShorteningLinkedIn = "CMSSocialMarketingURLShorteningLinkedIn"; + public const string CMSSocialMarketingURLShorteningTwitter = "CMSSocialMarketingURLShorteningTwitter"; + public const string CMSStagingLogChanges = "CMSStagingLogChanges"; + public const string CMSStagingLogDataChanges = "CMSStagingLogDataChanges"; + public const string CMSStagingLogObjectChanges = "CMSStagingLogObjectChanges"; + public const string CMSStagingLogStagingChanges = "CMSStagingLogStagingChanges"; + public const string CMSStagingServiceAuthentication = "CMSStagingServiceAuthentication"; + public const string CMSStagingServiceEnabled = "CMSStagingServiceEnabled"; + public const string CMSStagingServicePassword = "CMSStagingServicePassword"; + public const string CMSStagingServiceUsername = "CMSStagingServiceUsername"; + public const string CMSStagingServiceX509ClientBase64KeyId = "CMSStagingServiceX509ClientBase64KeyId"; + public const string CMSStagingServiceX509ServerBase64KeyId = "CMSStagingServiceX509ServerBase64KeyId"; + public const string CMSStoreAllowAnonymousCustomers = "CMSStoreAllowAnonymousCustomers"; + public const string CMSStoreAllowGlobalDepartments = "CMSStoreAllowGlobalDepartments"; + public const string CMSStoreAllowGlobalManufacturers = "CMSStoreAllowGlobalManufacturers"; + public const string CMSStoreAllowGlobalPaymentMethods = "CMSStoreAllowGlobalPaymentMethods"; + public const string CMSStoreAllowGlobalProductOptions = "CMSStoreAllowGlobalProductOptions"; + public const string CMSStoreAllowGlobalProducts = "CMSStoreAllowGlobalProducts"; + public const string CMSStoreAllowGlobalSuppliers = "CMSStoreAllowGlobalSuppliers"; + public const string CMSStoreAllowProductsWithoutDocuments = "CMSStoreAllowProductsWithoutDocuments"; + public const string CMSStoreAltFormLayoutsInFS = "CMSStoreAltFormLayoutsInFS"; + public const string CMSStoreApplyTaxesBasedOn = "CMSStoreApplyTaxesBasedOn"; + public const string CMSStoreAutoRegisterCustomer = "CMSStoreAutoRegisterCustomer"; + public const string CMSStoreAutoRegistrationEmailTemplate = "CMSStoreAutoRegistrationEmailTemplate"; + public const string CMSStoreCheckoutProcess = "CMSStoreCheckoutProcess"; + public const string CMSStoreDefaultCountryName = "CMSStoreDefaultCountryName"; + public const string CMSStoreDisplayProductsInSectionsTree = "CMSStoreDisplayProductsInSectionsTree"; + public const string CMSStoreEProductsReminder = "CMSStoreEProductsReminder"; + public const string CMSStoreFormerUrls = "CMSStoreFormerUrls"; + public const string CMSStoreFormLayoutsInFS = "CMSStoreFormLayoutsInFS"; + public const string CMSStoreInvoiceNumberPattern = "CMSStoreInvoiceNumberPattern"; + public const string CMSStoreInvoiceTemplate = "CMSStoreInvoiceTemplate"; + public const string CMSStoreLayoutsInFS = "CMSStoreLayoutsInFS"; + public const string CMSStoreMassUnit = "CMSStoreMassUnit"; + public const string CMSStoreNewProductStatus = "CMSStoreNewProductStatus"; + public const string CMSStorePageTemplatesInFS = "CMSStorePageTemplatesInFS"; + public const string CMSStoreProductsAreNewFor = "CMSStoreProductsAreNewFor"; + public const string CMSStoreProductsStartingPath = "CMSStoreProductsStartingPath"; + public const string CMSStoreProductsTree = "CMSStoreProductsTree"; + public const string CMSStoreRedirectToShoppingCart = "CMSStoreRedirectToShoppingCart"; + public const string CMSStoreRelatedProductsRelationshipName = "CMSStoreRelatedProductsRelationshipName"; + public const string CMSStoreRequireCompanyInfo = "CMSStoreRequireCompanyInfo"; + public const string CMSStoreSendEmailsFrom = "CMSStoreSendEmailsFrom"; + public const string CMSStoreSendEmailsTo = "CMSStoreSendEmailsTo"; + public const string CMSStoreSendOrderNotification = "CMSStoreSendOrderNotification"; + public const string CMSStoreSendPaymentNotification = "CMSStoreSendPaymentNotification"; + public const string CMSStoreShowOrganizationID = "CMSStoreShowOrganizationID"; + public const string CMSStoreShowTaxRegistrationID = "CMSStoreShowTaxRegistrationID"; + public const string CMSStoreTransformationsInFS = "CMSStoreTransformationsInFS"; + public const string CMSStoreUseCustomerCultureForEmails = "CMSStoreUseCustomerCultureForEmails"; + public const string CMSStoreUseExtraCompanyAddress = "CMSStoreUseExtraCompanyAddress"; + public const string CMSStoreUseGlobalCredit = "CMSStoreUseGlobalCredit"; + public const string CMSStoreUseGlobalCurrencies = "CMSStoreUseGlobalCurrencies"; + public const string CMSStoreUseGlobalExchangeRates = "CMSStoreUseGlobalExchangeRates"; + public const string CMSStoreUseGlobalInternalStatus = "CMSStoreUseGlobalInternalStatus"; + public const string CMSStoreUseGlobalInvoice = "CMSStoreUseGlobalInvoice"; + public const string CMSStoreUseGlobalOrderStatus = "CMSStoreUseGlobalOrderStatus"; + public const string CMSStoreUseGlobalPublicStatus = "CMSStoreUseGlobalPublicStatus"; + public const string CMSStoreUseGlobalTaxClasses = "CMSStoreUseGlobalTaxClasses"; + public const string CMSStoreWebpartContainersInFS = "CMSStoreWebpartContainersInFS"; + public const string CMSStoreWebPartLayoutsInFS = "CMSStoreWebPartLayoutsInFS"; + public const string CMSStoreWeightFormattingString = "CMSStoreWeightFormattingString"; + public const string CMSTimeZonesEnable = "CMSTimeZonesEnable"; + public const string CMSTrackAverageTimeOnPage = "CMSTrackAverageTimeOnPage"; + public const string CMSTrackExitPages = "CMSTrackExitPages"; + public const string CMSTrackLandingPages = "CMSTrackLandingPages"; + public const string CMSTrackMobileDevices = "CMSTrackMobileDevices"; + public const string CMSTrackOnSiteKeywords = "CMSTrackOnSiteKeywords"; + public const string CMSTrackReferringSitesDirect = "CMSTrackReferringSitesDirect"; + public const string CMSTrackReferringSitesLocal = "CMSTrackReferringSitesLocal"; + public const string CMSTrackReferringSitesReferring = "CMSTrackReferringSitesReferring"; + public const string CMSTrackSearchCrawlers = "CMSTrackSearchCrawlers"; + public const string CMSTrackSearchEngines = "CMSTrackSearchEngines"; + public const string CMSTrackSearchKeywords = "CMSTrackSearchKeywords"; + public const string CMSTranslateFileTypes = "CMSTranslateFileTypes"; + public const string CMSTranslationsAutoImport = "CMSTranslationsAutoImport"; + public const string CMSTranslationsEncoding = "CMSTranslationsEncoding"; + public const string CMSTranslationsLastStatusCheck = "CMSTranslationsLastStatusCheck"; + public const string CMSUpdateDocumentAlias = "CMSUpdateDocumentAlias"; + public const string CMSUploadExtensions = "CMSUploadExtensions"; + public const string CMSUseAutomaticVersionNumbering = "CMSUseAutomaticVersionNumbering"; + public const string CMSUseBizFormsSiteFolder = "CMSUseBizFormsSiteFolder"; + public const string CMSUseCheckinCheckout = "CMSUseCheckinCheckout"; + public const string CMSUseCultureAliasAsLanguagePrefixInUrl = "CMSUseCultureAliasAsLanguagePrefixInUrl"; + public const string CMSUseEventLogListener = "CMSUseEventLogListener"; + public const string CMSUseFilesSiteFolder = "CMSUseFilesSiteFolder"; + public const string CMSUseMediaLibrariesSiteFolder = "CMSUseMediaLibrariesSiteFolder"; + public const string CMSUseObjectCheckinCheckout = "CMSUseObjectCheckinCheckout"; + public const string CMSUsePasswordPolicy = "CMSUsePasswordPolicy"; + public const string CMSUserAccountUnlockPath = "CMSUserAccountUnlockPath"; + public const string CMSUserUniqueEmail = "CMSUserUniqueEmail"; + public const string CMSUseSSL = "CMSUseSSL"; + public const string CMSUseURLsWithTrailingSlash = "CMSUseURLsWithTrailingSlash"; + public const string CMSVersionHistoryLength = "CMSVersionHistoryLength"; + public const string CMSVersioningExtensionsMediaFile = "CMSVersioningExtensionsMediaFile"; + public const string CMSVisitorStatusIdle = "CMSVisitorStatusIdle"; + public const string CMSWebFarmMaxFileSize = "CMSWebFarmMaxFileSize"; + public const string CMSWebFarmMode = "CMSWebFarmMode"; + public const string CMSWebFarmSynchronizeAttachments = "CMSWebFarmSynchronizeAttachments"; + public const string CMSWebFarmSynchronizeAvatars = "CMSWebFarmSynchronizeAvatars"; + public const string CMSWebFarmSynchronizeBizFormFiles = "CMSWebFarmSynchronizeBizFormFiles"; + public const string CMSWebFarmSynchronizeCache = "CMSWebFarmSynchronizeCache"; + public const string CMSWebFarmSynchronizeDeleteFiles = "CMSWebFarmSynchronizeDeleteFiles"; + public const string CMSWebFarmSynchronizeFiles = "CMSWebFarmSynchronizeFiles"; + public const string CMSWebFarmSynchronizeMediaFiles = "CMSWebFarmSynchronizeMediaFiles"; + public const string CMSWebFarmSynchronizeMetaFiles = "CMSWebFarmSynchronizeMetaFiles"; + public const string CMSWebFarmSynchronizePhysicalFiles = "CMSWebFarmSynchronizePhysicalFiles"; + public const string CMSWebFarmSynchronizeSmartSearch = "CMSWebFarmSynchronizeSmartSearch"; + public const string CMSWebFarmSyncInterval = "CMSWebFarmSyncInterval"; + public const string CMSWIFAllowedAudienceUris = "CMSWIFAllowedAudienceUris"; + public const string CMSWIFCertificateValidator = "CMSWIFCertificateValidator"; + public const string CMSWIFEnabled = "CMSWIFEnabled"; + public const string CMSWIFIdentityProviderURL = "CMSWIFIdentityProviderURL"; + public const string CMSWIFRealm = "CMSWIFRealm"; + public const string CMSWIFTrustedCertificateThumbprint = "CMSWIFTrustedCertificateThumbprint"; + public const string CMSWishlistURL = "CMSWishlistURL"; +} diff --git a/Migration.Toolkit.KX13/SettingsKeys.tt b/Migration.Toolkit.KX13/SettingsKeys.tt index 7df50143..d9db544d 100644 --- a/Migration.Toolkit.KX13/SettingsKeys.tt +++ b/Migration.Toolkit.KX13/SettingsKeys.tt @@ -1,6 +1,4 @@ <#@ template language="C#" #> -<#@ import namespace="System.Text" #> -<#@ import namespace="System.Collections.Generic" #> <#@ import namespace="System.Data.SqlClient" #> // ReSharper disable InconsistentNaming // ReSharper disable IdentifierTypo diff --git a/Migration.Toolkit.KX13/genModel.ps1 b/Migration.Toolkit.KX13/genModel.ps1 index 5e048e89..f5039c03 100644 --- a/Migration.Toolkit.KX13/genModel.ps1 +++ b/Migration.Toolkit.KX13/genModel.ps1 @@ -8,9 +8,9 @@ $contextPath = "$workDir\Context\KX13Context.cs" $contextText = [System.IO.File]::ReadAllText($contextPath) #$result = $contextText -replace '(?i-mn).*if \(\!optionsBuilder\.IsConfigured\)[\s\S]*?\}',''; #$result = $result -replace '(?i-mn).*protected override void OnConfiguring[\s\S]*?\}',''; -$result = $contextText -replace '.*optionsBuilder.UseSqlServer.*',''; -$result = $result -replace '.*protected override void OnConfiguring.*',''; -$result = $result -replace '.*#warning To protect potentially sensitive information in your connection string, .*',''; +$result = $contextText -replace '.*optionsBuilder.UseSqlServer.*', ''; +$result = $result -replace '.*protected override void OnConfiguring.*', ''; +$result = $result -replace '.*#warning To protect potentially sensitive information in your connection string, .*', ''; [System.IO.File]::WriteAllText($contextPath, $result) # ./genModel.ps1 -connection "Server=.;Database=KX13_20220324;Integrated Security=True" \ No newline at end of file diff --git a/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs b/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs index f503c1c3..ed40a649 100644 --- a/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs +++ b/Migration.Toolkit.KXP.Api/Auxiliary/DummyFormFile.cs @@ -1,36 +1,30 @@ -namespace Migration.Toolkit.KXP.Api.Auxiliary; - -using CMS.Base; - -public class DummyUploadedFile : IUploadedFile -{ - public Stream InputStream { get; } - - public string ContentType { get; } - - public long Length { get; } - - public string FileName { get; } - - private DummyUploadedFile(Stream stream, string contentType, long length, string fileName) - { - InputStream = stream; - FileName = fileName; - Length = length; - ContentType = contentType; - } - - public static IUploadedFile FromStream(Stream stream, string contentType, long length, string fileName) - { - return new DummyUploadedFile(stream, contentType, length, fileName); - } - - public static IUploadedFile FromByteArray(byte[] byteArray, string contentType, long length, string fileName) - { - return new DummyUploadedFile(new MemoryStream(byteArray), contentType, length, fileName); - } - - public Stream OpenReadStream() => InputStream; - - public bool CanOpenReadStream => InputStream.CanRead; -} \ No newline at end of file +using CMS.Base; + +namespace Migration.Toolkit.KXP.Api.Auxiliary; + +public class DummyUploadedFile : IUploadedFile +{ + private DummyUploadedFile(Stream stream, string contentType, long length, string fileName) + { + InputStream = stream; + FileName = fileName; + Length = length; + ContentType = contentType; + } + + public Stream InputStream { get; } + + public string ContentType { get; } + + public long Length { get; } + + public string FileName { get; } + + public Stream OpenReadStream() => InputStream; + + public bool CanOpenReadStream => InputStream.CanRead; + + public static IUploadedFile FromStream(Stream stream, string contentType, long length, string fileName) => new DummyUploadedFile(stream, contentType, length, fileName); + + public static IUploadedFile FromByteArray(byte[] byteArray, string contentType, long length, string fileName) => new DummyUploadedFile(new MemoryStream(byteArray), contentType, length, fileName); +} diff --git a/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs b/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs index ee925aa0..4b8a40d5 100644 --- a/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs +++ b/Migration.Toolkit.KXP.Api/Auxiliary/FormComponents.cs @@ -1,146 +1,253 @@ -namespace Migration.Toolkit.KXP.Api.Auxiliary; - -public class FormComponents -{ - ///Form component value type: Kentico.Forms.Web.Mvc.BoolFieldValueTypes - public static string MvcBoolComparisonTypeSelectorComponent => Kentico.Forms.Web.Mvc.BoolComparisonTypeSelectorComponent.IDENTIFIER; - ///Form component value type: System.Boolean - public static string MvcCheckBoxComponent => Kentico.Forms.Web.Mvc.CheckBoxComponent.IDENTIFIER; - ///Form component value type: System.Guid - public static string MvcCompareToFieldSelectorComponent => Kentico.Forms.Web.Mvc.CompareToFieldSelectorComponent.IDENTIFIER; - ///Form component value type: System.Nullable`1[[System.Guid, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - public static string MvcConsentAgreementComponent => Kentico.Forms.Web.Mvc.ConsentAgreementComponent.IDENTIFIER; - public static string MvcConsentSelectorComponent => Kentico.Forms.Web.Mvc.ConsentSelectorComponent.IDENTIFIER; - ///Form component value type: Kentico.Forms.Web.Mvc.DropDownProperties - public static string MvcDropDownComponent => Kentico.Forms.Web.Mvc.DropDownComponent.IDENTIFIER; - ///Form component value type: System.String - public static string MvcEmailInputComponent => Kentico.Forms.Web.Mvc.EmailInputComponent.IDENTIFIER; - ///Form component value type: CMS.OnlineForms.BizFormUploadFile - public static string MvcFileUploaderComponent => Kentico.Forms.Web.Mvc.FileUploaderComponent.IDENTIFIER; - ///Form component value type: System.Guid - public static string MvcHiddenGuidInputComponent => Kentico.Forms.Web.Mvc.HiddenGuidInputComponent.IDENTIFIER; - ///Form component value type: System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - public static string MvcIntInputComponent => Kentico.Forms.Web.Mvc.IntInputComponent.IDENTIFIER; - public static string MvcNameComponent => Kentico.Forms.Web.Mvc.NameComponent.IDENTIFIER; - ///Form component value type: Kentico.Forms.Web.Mvc.NumericFieldComparisonTypes - public static string MvcNumericComparisonTypeSelectorComponent => Kentico.Forms.Web.Mvc.NumericComparisonTypeSelectorComponent.IDENTIFIER; - ///Form component value type: Kentico.Forms.Web.Mvc.RadioButtonsProperties - public static string MvcRadioButtonsComponent => Kentico.Forms.Web.Mvc.RadioButtonsComponent.IDENTIFIER; - ///Form component value type: System.String - public static string MvcRecaptchaComponent => Kentico.Forms.Web.Mvc.RecaptchaComponent.IDENTIFIER; - ///Form component value type: Kentico.Forms.Web.Mvc.StringFieldComparisonTypes - public static string MvcStringComparisonTypeSelectorComponent => Kentico.Forms.Web.Mvc.StringComparisonTypeSelectorComponent.IDENTIFIER; - ///Form component value type: System.String - public static string MvcTextAreaComponent => Kentico.Forms.Web.Mvc.TextAreaComponent.IDENTIFIER; - ///Form component value type: System.String - public static string MvcTextInputComponent => Kentico.Forms.Web.Mvc.TextInputComponent.IDENTIFIER; - ///Form component value type: System.String - public static string MvcUSPhoneComponent => Kentico.Forms.Web.Mvc.USPhoneComponent.IDENTIFIER; - ///Form component value type: System.Nullable`1[[System.Double, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - public static string MvcInternal_DoubleInputComponent => Kentico.Forms.Web.Mvc.Internal.DoubleInputComponent.IDENTIFIER; - ///Form component value type: Kentico.Content.Web.Mvc.MultiSelectorProperties - public static string Kentico_Content_Web_Mvc_MultipleChoiceComponent => Kentico.Content.Web.Mvc.MultipleChoiceComponent.IDENTIFIER; - ///Form component value type: System.String - public static string MvcFcRichTextComponent => Kentico.Components.Web.Mvc.FormComponents.RichTextComponent.IDENTIFIER; - ///Form component value type: System.Collections.Generic.IEnumerable`1[[Kentico.Components.Web.Mvc.FormComponents.MediaFilesSelectorItem, Kentico.Content.Web.Mvc, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] - public static string MvcFcMediaFilesSelector => Kentico.Components.Web.Mvc.FormComponents.MediaFilesSelector.IDENTIFIER; - ///Form component value type: Kentico.Components.Web.Mvc.FormComponents.GeneralSelectorItem - public static string MvcFcGeneralSelector => Kentico.Components.Web.Mvc.FormComponents.GeneralSelector.IDENTIFIER; - ///Form component value type: Kentico.Components.Web.Mvc.FormComponents.ObjectSelectorItem - public static string MvcFcObjectSelector => Kentico.Components.Web.Mvc.FormComponents.ObjectSelector.IDENTIFIER; - ///Form component value type: Kentico.Components.Web.Mvc.FormComponents.PageSelectorItem - public static string MvcFcPageSelector => Kentico.Components.Web.Mvc.FormComponents.PageSelector.IDENTIFIER; - ///Form component value type: Kentico.Components.Web.Mvc.FormComponents.PathSelectorItem - public static string MvcFcPathSelector => Kentico.Components.Web.Mvc.FormComponents.PathSelector.IDENTIFIER; - ///Form component value type: System.String - public static string MvcFcUrlSelector => Kentico.Components.Web.Mvc.FormComponents.UrlSelector.IDENTIFIER; - ///Form component value type: System.Collections.Generic.IEnumerable`1[[CMS.MediaLibrary.AssetRelatedItem, CMS.MediaLibrary, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] - public static string AdminAssetSelectorComponent => Kentico.Xperience.Admin.Base.Forms.AssetSelectorComponent.IDENTIFIER; - ///Form component value type: System.Boolean - public static string AdminCheckBoxComponent => Kentico.Xperience.Admin.Base.Forms.CheckBoxComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminCodeEditorComponent => Kentico.Xperience.Admin.Base.Forms.CodeEditorComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminConditionBuilderComponent => Kentico.Xperience.Admin.Base.Forms.ConditionBuilderComponent.IDENTIFIER; - ///Form component value type: CMS.ContentEngine.ContentItemAssetMetadata - public static string AdminContentItemAssetUploaderComponent => Kentico.Xperience.Admin.Base.Forms.ContentItemAssetUploaderComponent.IDENTIFIER; - ///Form component value type: Kentico.Xperience.Admin.Base.Forms.ContentItemSelectorProperties - public static string AdminContentItemSelectorComponent => Kentico.Xperience.Admin.Base.Forms.ContentItemSelectorComponent.IDENTIFIER; - ///Form component value type: System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - public static string AdminDateInputComponent => Kentico.Xperience.Admin.Base.Forms.DateInputComponent.IDENTIFIER; - ///Form component value type: System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - public static string AdminDateTimeInputComponent => Kentico.Xperience.Admin.Base.Forms.DateTimeInputComponent.IDENTIFIER; - ///Form component value type: System.Nullable`1[[System.Decimal, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - public static string AdminDecimalNumberInputComponent => Kentico.Xperience.Admin.Base.Forms.DecimalNumberInputComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminDropDownComponent => Kentico.Xperience.Admin.Base.Forms.DropDownComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminExtensionSelectorComponent => Kentico.Xperience.Admin.Base.Forms.ExtensionSelectorComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminIconSelectorComponent => Kentico.Xperience.Admin.Base.Forms.IconSelectorComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminLinkComponent => Kentico.Xperience.Admin.Base.Forms.LinkComponent.IDENTIFIER; - ///Form component value type: System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - public static string AdminNumberInputComponent => Kentico.Xperience.Admin.Base.Forms.NumberInputComponent.IDENTIFIER; - ///Form component value type: System.Int32 - public static string AdminNumberWithLabelComponent => Kentico.Xperience.Admin.Base.Forms.NumberWithLabelComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminObjectCodeNameSelectorComponent => Kentico.Xperience.Admin.Base.Forms.ObjectCodeNameSelectorComponent.IDENTIFIER; - ///Form component value type: System.Guid - public static string AdminObjectGuidSelectorComponent => Kentico.Xperience.Admin.Base.Forms.ObjectGuidSelectorComponent.IDENTIFIER; - ///Form component value type: System.Int32 - public static string AdminObjectIdSelectorComponent => Kentico.Xperience.Admin.Base.Forms.ObjectIdSelectorComponent.IDENTIFIER; - ///Form component value type: System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] - public static string AdminSingleObjectIdSelectorComponent => Kentico.Xperience.Admin.Base.Forms.SingleObjectIdSelectorComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminPasswordComponent => Kentico.Xperience.Admin.Base.Forms.PasswordComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminRadioGroupComponent => Kentico.Xperience.Admin.Base.Forms.RadioGroupComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminRichTextEditorComponent => Kentico.Xperience.Admin.Base.Forms.RichTextEditorComponent.IDENTIFIER; - ///Form component value type: System.Collections.Generic.IEnumerable`1[[CMS.ContentEngine.TagReference, CMS.ContentEngine, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] - public static string AdminTagSelectorComponent => Kentico.Xperience.Admin.Base.Forms.TagSelectorComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminTextAreaComponent => Kentico.Xperience.Admin.Base.Forms.TextAreaComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminTextInputComponent => Kentico.Xperience.Admin.Base.Forms.TextInputComponent.IDENTIFIER; - ///Form component value type: System.String - public static string AdminTextWithLabelComponent => Kentico.Xperience.Admin.Base.Forms.TextWithLabelComponent.IDENTIFIER; - ///Form component value type: Kentico.Xperience.Admin.Base.Forms.TileSelectorItem - public static string AdminTileSelectorComponent => Kentico.Xperience.Admin.Base.Forms.TileSelectorComponent.IDENTIFIER; - ///Form component value type: System.Collections.Generic.IEnumerable`1[[CMS.EmailLibrary.EmailRelatedItem, CMS.EmailMarketing, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] - public static string Kentico_Xperience_Admin_DigitalMarketing_Forms_EmailSelectorComponent => Kentico.Xperience.Admin.DigitalMarketing.Forms.EmailSelectorComponent.IDENTIFIER; - ///Form component value type: Kentico.Xperience.Admin.Headless.Forms.HeadlessItemSelectorProperties - public static string Kentico_Xperience_Admin_Headless_Forms_HeadlessItemSelectorComponent => Kentico.Xperience.Admin.Headless.Forms.HeadlessItemSelectorComponent.IDENTIFIER; - ///Form component value type: System.Collections.Generic.IEnumerable`1[[CMS.Websites.WebPageRelatedItem, CMS.Websites, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] - public static string Kentico_Xperience_Admin_Websites_WebPageSelectorComponent => Kentico.Xperience.Admin.Websites.WebPageSelectorComponent.IDENTIFIER; - ///Form component value type: System.String - public static string Kentico_Xperience_Admin_Websites_Forms_UrlSelectorComponent => Kentico.Xperience.Admin.Websites.Forms.UrlSelectorComponent.IDENTIFIER; - - - // Abstract control: Kentico.Forms.Web.Mvc.ComparisonTypeSelectorComponent`1 - // Abstract control: Kentico.Forms.Web.Mvc.SelectorFormComponent`1 - // No identity prop control: Kentico.Forms.Web.Mvc.InvalidComponent - // Abstract control: Kentico.Content.Web.Mvc.MultiSelectorFormComponent`1 - // Abstract control: Kentico.Components.Web.Mvc.Selectors.Internal.ObjectSelectorComponentBase`2 - // Abstract control: Kentico.Components.Web.Mvc.FormComponents.Internal.PageSelectorBase`2 - // Internal control: Kentico.Xperience.Admin.Base.Forms.AdditionalActionListComponent - // Abstract control: Kentico.Xperience.Admin.Base.Forms.FormComponentWithNestedComponents`3 - // Abstract control: Kentico.Xperience.Admin.Base.Forms.FormComponent`2 - // Internal control: Kentico.Xperience.Admin.Base.Forms.CodeNameComponent - // Abstract control: Kentico.Xperience.Admin.Base.Forms.ContentItemSelectorComponentBase`1 - // Internal control: Kentico.Xperience.Admin.Base.Forms.DateRangeInputComponent - // Internal control: Kentico.Xperience.Admin.Base.Forms.DoubleNumberInputComponent - // No identity prop control: Kentico.Xperience.Admin.Base.Forms.GeneralSelectorComponent - // No identity prop control: Kentico.Xperience.Admin.Base.Forms.SingleGeneralSelectorComponent - // Internal control: Kentico.Xperience.Admin.Base.Forms.MacroWrapperComponent - // Internal control: Kentico.Xperience.Admin.Base.Forms.NamespaceCodeNameComponent - // Abstract control: Kentico.Xperience.Admin.Base.Forms.MultipleObjectSelectorBase`2 - // Abstract control: Kentico.Xperience.Admin.Base.Forms.ObjectSelectorBase`4 - // No identity prop control: Kentico.Xperience.Admin.Base.Forms.ObjectSelectorComponent - // Abstract control: Kentico.Xperience.Admin.Base.Forms.SingleObjectSelectorBase`2 - // Internal control: Kentico.Xperience.Admin.Base.Forms.ValidationRuleListComponent - // Abstract control: Kentico.Xperience.Admin.Base.Forms.Internal.DateInputComponentBase`3 - // Abstract control: Kentico.Xperience.Admin.Base.Forms.Internal.GeneralSelectorComponentBase`3 - // No identity prop control: Kentico.Xperience.Admin.DigitalMarketing.Forms.FormSelectorComponent -} \ No newline at end of file +using Kentico.Components.Web.Mvc.FormComponents; +using Kentico.Content.Web.Mvc; +using Kentico.Forms.Web.Mvc; +using Kentico.Forms.Web.Mvc.Internal; +using Kentico.Xperience.Admin.Base.Forms; +using Kentico.Xperience.Admin.DigitalMarketing.Forms; +using Kentico.Xperience.Admin.Headless.Forms; +using Kentico.Xperience.Admin.Websites; +using Kentico.Xperience.Admin.Websites.Forms; + +namespace Migration.Toolkit.KXP.Api.Auxiliary; + +public class FormComponents +{ + ///Form component value type: Kentico.Forms.Web.Mvc.BoolFieldValueTypes + public static string MvcBoolComparisonTypeSelectorComponent => BoolComparisonTypeSelectorComponent.IDENTIFIER; + + ///Form component value type: System.Boolean + public static string MvcCheckBoxComponent => Kentico.Forms.Web.Mvc.CheckBoxComponent.IDENTIFIER; + + ///Form component value type: System.Guid + public static string MvcCompareToFieldSelectorComponent => CompareToFieldSelectorComponent.IDENTIFIER; + + /// + /// Form component value type: System.Nullable`1[[System.Guid, System.Private.CoreLib, Version=8.0.0.0, + /// Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + /// + public static string MvcConsentAgreementComponent => ConsentAgreementComponent.IDENTIFIER; + + public static string MvcConsentSelectorComponent => ConsentSelectorComponent.IDENTIFIER; + + ///Form component value type: Kentico.Forms.Web.Mvc.DropDownProperties + public static string MvcDropDownComponent => Kentico.Forms.Web.Mvc.DropDownComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string MvcEmailInputComponent => EmailInputComponent.IDENTIFIER; + + ///Form component value type: CMS.OnlineForms.BizFormUploadFile + public static string MvcFileUploaderComponent => FileUploaderComponent.IDENTIFIER; + + ///Form component value type: System.Guid + public static string MvcHiddenGuidInputComponent => HiddenGuidInputComponent.IDENTIFIER; + + /// + /// Form component value type: System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, + /// Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + /// + public static string MvcIntInputComponent => IntInputComponent.IDENTIFIER; + + public static string MvcNameComponent => NameComponent.IDENTIFIER; + + ///Form component value type: Kentico.Forms.Web.Mvc.NumericFieldComparisonTypes + public static string MvcNumericComparisonTypeSelectorComponent => NumericComparisonTypeSelectorComponent.IDENTIFIER; + + ///Form component value type: Kentico.Forms.Web.Mvc.RadioButtonsProperties + public static string MvcRadioButtonsComponent => RadioButtonsComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string MvcRecaptchaComponent => RecaptchaComponent.IDENTIFIER; + + ///Form component value type: Kentico.Forms.Web.Mvc.StringFieldComparisonTypes + public static string MvcStringComparisonTypeSelectorComponent => StringComparisonTypeSelectorComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string MvcTextAreaComponent => Kentico.Forms.Web.Mvc.TextAreaComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string MvcTextInputComponent => Kentico.Forms.Web.Mvc.TextInputComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string MvcUSPhoneComponent => USPhoneComponent.IDENTIFIER; + + /// + /// Form component value type: System.Nullable`1[[System.Double, System.Private.CoreLib, Version=8.0.0.0, + /// Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + /// + public static string MvcInternal_DoubleInputComponent => DoubleInputComponent.IDENTIFIER; + + ///Form component value type: Kentico.Content.Web.Mvc.MultiSelectorProperties + public static string Kentico_Content_Web_Mvc_MultipleChoiceComponent => MultipleChoiceComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string MvcFcRichTextComponent => RichTextComponent.IDENTIFIER; + + /// + /// Form component value type: + /// System.Collections.Generic.IEnumerable`1[[Kentico.Components.Web.Mvc.FormComponents.MediaFilesSelectorItem, + /// Kentico.Content.Web.Mvc, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] + /// + public static string MvcFcMediaFilesSelector => MediaFilesSelector.IDENTIFIER; + + ///Form component value type: Kentico.Components.Web.Mvc.FormComponents.GeneralSelectorItem + public static string MvcFcGeneralSelector => GeneralSelector.IDENTIFIER; + + ///Form component value type: Kentico.Components.Web.Mvc.FormComponents.ObjectSelectorItem + public static string MvcFcObjectSelector => ObjectSelector.IDENTIFIER; + + ///Form component value type: Kentico.Components.Web.Mvc.FormComponents.PageSelectorItem + public static string MvcFcPageSelector => PageSelector.IDENTIFIER; + + ///Form component value type: Kentico.Components.Web.Mvc.FormComponents.PathSelectorItem + public static string MvcFcPathSelector => PathSelector.IDENTIFIER; + + ///Form component value type: System.String + public static string MvcFcUrlSelector => UrlSelector.IDENTIFIER; + + /// + /// Form component value type: System.Collections.Generic.IEnumerable`1[[CMS.MediaLibrary.AssetRelatedItem, + /// CMS.MediaLibrary, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] + /// + public static string AdminAssetSelectorComponent => AssetSelectorComponent.IDENTIFIER; + + ///Form component value type: System.Boolean + public static string AdminCheckBoxComponent => Kentico.Xperience.Admin.Base.Forms.CheckBoxComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminCodeEditorComponent => CodeEditorComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminConditionBuilderComponent => ConditionBuilderComponent.IDENTIFIER; + + ///Form component value type: CMS.ContentEngine.ContentItemAssetMetadata + public static string AdminContentItemAssetUploaderComponent => ContentItemAssetUploaderComponent.IDENTIFIER; + + ///Form component value type: Kentico.Xperience.Admin.Base.Forms.ContentItemSelectorProperties + public static string AdminContentItemSelectorComponent => ContentItemSelectorComponent.IDENTIFIER; + + /// + /// Form component value type: System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=8.0.0.0, + /// Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + /// + public static string AdminDateInputComponent => DateInputComponent.IDENTIFIER; + + /// + /// Form component value type: System.Nullable`1[[System.DateTime, System.Private.CoreLib, Version=8.0.0.0, + /// Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + /// + public static string AdminDateTimeInputComponent => DateTimeInputComponent.IDENTIFIER; + + /// + /// Form component value type: System.Nullable`1[[System.Decimal, System.Private.CoreLib, Version=8.0.0.0, + /// Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + /// + public static string AdminDecimalNumberInputComponent => DecimalNumberInputComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminDropDownComponent => Kentico.Xperience.Admin.Base.Forms.DropDownComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminExtensionSelectorComponent => ExtensionSelectorComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminIconSelectorComponent => IconSelectorComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminLinkComponent => LinkComponent.IDENTIFIER; + + /// + /// Form component value type: System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, + /// Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + /// + public static string AdminNumberInputComponent => NumberInputComponent.IDENTIFIER; + + ///Form component value type: System.Int32 + public static string AdminNumberWithLabelComponent => NumberWithLabelComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminObjectCodeNameSelectorComponent => ObjectCodeNameSelectorComponent.IDENTIFIER; + + ///Form component value type: System.Guid + public static string AdminObjectGuidSelectorComponent => ObjectGuidSelectorComponent.IDENTIFIER; + + ///Form component value type: System.Int32 + public static string AdminObjectIdSelectorComponent => ObjectIdSelectorComponent.IDENTIFIER; + + /// + /// Form component value type: System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=8.0.0.0, + /// Culture=neutral, PublicKeyToken=7cec85d7bea7798e]] + /// + public static string AdminSingleObjectIdSelectorComponent => SingleObjectIdSelectorComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminPasswordComponent => PasswordComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminRadioGroupComponent => RadioGroupComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminRichTextEditorComponent => RichTextEditorComponent.IDENTIFIER; + + /// + /// Form component value type: System.Collections.Generic.IEnumerable`1[[CMS.ContentEngine.TagReference, + /// CMS.ContentEngine, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] + /// + public static string AdminTagSelectorComponent => TagSelectorComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminTextAreaComponent => Kentico.Xperience.Admin.Base.Forms.TextAreaComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminTextInputComponent => Kentico.Xperience.Admin.Base.Forms.TextInputComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string AdminTextWithLabelComponent => TextWithLabelComponent.IDENTIFIER; + + ///Form component value type: Kentico.Xperience.Admin.Base.Forms.TileSelectorItem + public static string AdminTileSelectorComponent => TileSelectorComponent.IDENTIFIER; + + /// + /// Form component value type: System.Collections.Generic.IEnumerable`1[[CMS.EmailLibrary.EmailRelatedItem, + /// CMS.EmailMarketing, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] + /// + public static string Kentico_Xperience_Admin_DigitalMarketing_Forms_EmailSelectorComponent => EmailSelectorComponent.IDENTIFIER; + + ///Form component value type: Kentico.Xperience.Admin.Headless.Forms.HeadlessItemSelectorProperties + public static string Kentico_Xperience_Admin_Headless_Forms_HeadlessItemSelectorComponent => HeadlessItemSelectorComponent.IDENTIFIER; + + /// + /// Form component value type: System.Collections.Generic.IEnumerable`1[[CMS.Websites.WebPageRelatedItem, + /// CMS.Websites, Version=28.4.1.0, Culture=neutral, PublicKeyToken=834b12a258f213f9]] + /// + public static string Kentico_Xperience_Admin_Websites_WebPageSelectorComponent => WebPageSelectorComponent.IDENTIFIER; + + ///Form component value type: System.String + public static string Kentico_Xperience_Admin_Websites_Forms_UrlSelectorComponent => UrlSelectorComponent.IDENTIFIER; + + + // Abstract control: Kentico.Forms.Web.Mvc.ComparisonTypeSelectorComponent`1 + // Abstract control: Kentico.Forms.Web.Mvc.SelectorFormComponent`1 + // No identity prop control: Kentico.Forms.Web.Mvc.InvalidComponent + // Abstract control: Kentico.Content.Web.Mvc.MultiSelectorFormComponent`1 + // Abstract control: Kentico.Components.Web.Mvc.Selectors.Internal.ObjectSelectorComponentBase`2 + // Abstract control: Kentico.Components.Web.Mvc.FormComponents.Internal.PageSelectorBase`2 + // Internal control: Kentico.Xperience.Admin.Base.Forms.AdditionalActionListComponent + // Abstract control: Kentico.Xperience.Admin.Base.Forms.FormComponentWithNestedComponents`3 + // Abstract control: Kentico.Xperience.Admin.Base.Forms.FormComponent`2 + // Internal control: Kentico.Xperience.Admin.Base.Forms.CodeNameComponent + // Abstract control: Kentico.Xperience.Admin.Base.Forms.ContentItemSelectorComponentBase`1 + // Internal control: Kentico.Xperience.Admin.Base.Forms.DateRangeInputComponent + // Internal control: Kentico.Xperience.Admin.Base.Forms.DoubleNumberInputComponent + // No identity prop control: Kentico.Xperience.Admin.Base.Forms.GeneralSelectorComponent + // No identity prop control: Kentico.Xperience.Admin.Base.Forms.SingleGeneralSelectorComponent + // Internal control: Kentico.Xperience.Admin.Base.Forms.MacroWrapperComponent + // Internal control: Kentico.Xperience.Admin.Base.Forms.NamespaceCodeNameComponent + // Abstract control: Kentico.Xperience.Admin.Base.Forms.MultipleObjectSelectorBase`2 + // Abstract control: Kentico.Xperience.Admin.Base.Forms.ObjectSelectorBase`4 + // No identity prop control: Kentico.Xperience.Admin.Base.Forms.ObjectSelectorComponent + // Abstract control: Kentico.Xperience.Admin.Base.Forms.SingleObjectSelectorBase`2 + // Internal control: Kentico.Xperience.Admin.Base.Forms.ValidationRuleListComponent + // Abstract control: Kentico.Xperience.Admin.Base.Forms.Internal.DateInputComponentBase`3 + // Abstract control: Kentico.Xperience.Admin.Base.Forms.Internal.GeneralSelectorComponentBase`3 + // No identity prop control: Kentico.Xperience.Admin.DigitalMarketing.Forms.FormSelectorComponent +} diff --git a/Migration.Toolkit.KXP.Api/Auxiliary/UserHelper.cs b/Migration.Toolkit.KXP.Api/Auxiliary/UserHelper.cs new file mode 100644 index 00000000..9ccc1cbd --- /dev/null +++ b/Migration.Toolkit.KXP.Api/Auxiliary/UserHelper.cs @@ -0,0 +1,9 @@ +using Migration.Toolkit.KXP.Api.Enums; + +namespace Migration.Toolkit.KXP.Api.Auxiliary; + +public class UserHelper +{ + public static int[] PrivilegeLevelsMigratedAsAdminUser => [(int)UserPrivilegeLevelEnum.Editor, (int)UserPrivilegeLevelEnum.Admin, (int)UserPrivilegeLevelEnum.GlobalAdmin]; + public static int[] PrivilegeLevelsMigratedAsMemberUser => [(int)UserPrivilegeLevelEnum.None]; +} diff --git a/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs b/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs index 9d788fc2..ecfea274 100644 --- a/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.KXP.Api/DependencyInjectionExtensions.cs @@ -1,26 +1,29 @@ -namespace Migration.Toolkit.KXP.Api; - -using CMS.Core; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.KXP.Api.Services.CmsClass; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKxpApi(this IServiceCollection services, IConfiguration configuration, string? applicationPhysicalPath = null) - { - Service.Use(configuration); - if (applicationPhysicalPath != null && Directory.Exists(applicationPhysicalPath)) - { - CMS.Base.SystemContext.WebApplicationPhysicalPath = applicationPhysicalPath; - } - - services.AddSingleton(); - services.AddSingleton(); - - services.AddSingleton(); - services.AddSingleton(); - - return services; - } -} \ No newline at end of file +using CMS.Base; +using CMS.Core; + +using Microsoft.Extensions.Configuration; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Toolkit.KXP.Api.Services.CmsClass; + +namespace Migration.Toolkit.KXP.Api; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKxpApi(this IServiceCollection services, IConfiguration configuration, string? applicationPhysicalPath = null) + { + Service.Use(configuration); + if (applicationPhysicalPath != null && Directory.Exists(applicationPhysicalPath)) + { + SystemContext.WebApplicationPhysicalPath = applicationPhysicalPath; + } + + services.AddSingleton(); + services.AddSingleton(); + + services.AddSingleton(); + services.AddSingleton(); + + return services; + } +} diff --git a/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs b/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs index 1f2b9583..ceefe219 100644 --- a/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs +++ b/Migration.Toolkit.KXP.Api/Enums/UserPrivilegeLevelEnum.cs @@ -1,20 +1,23 @@ -namespace Migration.Toolkit.KXP.Api.Enums; - -/// -/// copy from Kentico Xperience 13 -/// -public enum UserPrivilegeLevelEnum -{ - /// User has no privilege level - None = 0, - /// User is able to use administration interface - Editor = 1, - /// - /// User can use all applications except the global applications and functionality - /// - Admin = 2, - /// - /// User can use all applications and functionality without any exceptions - /// - GlobalAdmin = 3, -} \ No newline at end of file +namespace Migration.Toolkit.KXP.Api.Enums; + +/// +/// copy from Kentico Xperience 13 +/// +public enum UserPrivilegeLevelEnum +{ + /// User has no privilege level + None = 0, + + /// User is able to use administration interface + Editor = 1, + + /// + /// User can use all applications except the global applications and functionality + /// + Admin = 2, + + /// + /// User can use all applications and functionality without any exceptions + /// + GlobalAdmin = 3 +} diff --git a/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs b/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs index 3bef3582..782d1f53 100644 --- a/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs +++ b/Migration.Toolkit.KXP.Api/KxpApiInitializer.cs @@ -1,33 +1,32 @@ -namespace Migration.Toolkit.KXP.Api; - -using CMS.DataEngine; -using Microsoft.Extensions.Logging; - -public class KxpApiInitializer(ILogger logger) -{ - private bool _apiInitializationCalled = false; - - public bool EnsureApiIsInitialized() - { - if (!_apiInitializationCalled) - { - logger.LogTrace("Kxp api initialization called"); - if (!CMSApplication.Init()) - { - logger.LogError("Kxp api initialization failed!"); - return false; - } - else - { - _apiInitializationCalled = true; - logger.LogInformation("Kxp api initialization finished"); - } - } - else - { - logger.LogTrace("Kxp api initialization already called, skipping init"); - } - - return true; - } -} \ No newline at end of file +using CMS.DataEngine; + +using Microsoft.Extensions.Logging; + +namespace Migration.Toolkit.KXP.Api; + +public class KxpApiInitializer(ILogger logger) +{ + private bool apiInitializationCalled; + + public bool EnsureApiIsInitialized() + { + if (!apiInitializationCalled) + { + logger.LogTrace("Kxp api initialization called"); + if (!CMSApplication.Init()) + { + logger.LogError("Kxp api initialization failed!"); + return false; + } + + apiInitializationCalled = true; + logger.LogInformation("Kxp api initialization finished"); + } + else + { + logger.LogTrace("Kxp api initialization already called, skipping init"); + } + + return true; + } +} diff --git a/Migration.Toolkit.KXP.Api/KxpClassFacade.cs b/Migration.Toolkit.KXP.Api/KxpClassFacade.cs index 273e6d16..d68c1f74 100644 --- a/Migration.Toolkit.KXP.Api/KxpClassFacade.cs +++ b/Migration.Toolkit.KXP.Api/KxpClassFacade.cs @@ -1,81 +1,72 @@ -namespace Migration.Toolkit.KXP.Api; - -using System.Diagnostics; -using CMS.DataEngine; -using CMS.FormEngine; -using Migration.Toolkit.Common.Enumerations; - -public record CustomizedFieldInfo(string FieldName); - -public class KxpClassFacade -{ - public KxpClassFacade(KxpApiInitializer kxpApiInitializer) - { - kxpApiInitializer.EnsureApiIsInitialized(); - } - - public DataClassInfo SetClass(DataClassInfo dataClassInfo) - { - // TODO tk: 2022-05-30 dataClassInfo.ClassConnectionString - check, might cause unexpected behavior - DataClassInfoProvider.SetDataClassInfo(dataClassInfo); - Debug.Assert(dataClassInfo.ClassID != 0, "dataClassInfo.ClassID != 0"); - - // assert class form is well formed - // var formInfo = FormHelper.GetFormInfo(dataClassInfo.ClassName, false); - // var formElements = formInfo.GetFormElements(true, true); - - return dataClassInfo; - } - - public DataClassInfo GetClass(Guid classGuid) - { - return DataClassInfoProvider.GetDataClassInfo(classGuid); - } - - public DataClassInfo GetClass(string className) - { - return DataClassInfoProvider.GetDataClassInfo(className); - } - - - public IEnumerable GetCustomizedFieldInfos(string className) - { - var dci = DataClassInfoProvider.GetDataClassInfo(className); - var fi = new FormInfo(dci.ClassFormDefinition); - foreach (var columnName in fi.GetColumnNames()) - { - var field = fi.GetFormField(columnName); - if (!field.System) - { - yield return new CustomizedFieldInfo(columnName); - } - } - } - - public IEnumerable GetCustomizedFieldInfos(FormInfo formInfo) - { - foreach (var columnName in formInfo.GetColumnNames()) - { - var field = formInfo.GetFormField(columnName); - if (!field.System) - { - yield return new CustomizedFieldInfo(columnName); - } - } - } - - public IEnumerable GetCustomizedFieldInfosAll(string className) - { - var dci = DataClassInfoProvider.GetDataClassInfo(className); - - var fi = new FormInfo(dci.ClassFormDefinition); - foreach (var columnName in fi.GetColumnNames()) - { - var field = fi.GetFormField(columnName); - if (!field.System) - { - yield return new CustomizedFieldInfo(columnName); - } - } - } -} \ No newline at end of file +using System.Diagnostics; + +using CMS.DataEngine; +using CMS.FormEngine; + +namespace Migration.Toolkit.KXP.Api; + +public record CustomizedFieldInfo(string FieldName); + +public class KxpClassFacade +{ + public KxpClassFacade(KxpApiInitializer kxpApiInitializer) => kxpApiInitializer.EnsureApiIsInitialized(); + + public DataClassInfo SetClass(DataClassInfo dataClassInfo) + { + // TODO tk: 2022-05-30 dataClassInfo.ClassConnectionString - check, might cause unexpected behavior + DataClassInfoProvider.SetDataClassInfo(dataClassInfo); + Debug.Assert(dataClassInfo.ClassID != 0, "dataClassInfo.ClassID != 0"); + + // assert class form is well formed + // var formInfo = FormHelper.GetFormInfo(dataClassInfo.ClassName, false); + // var formElements = formInfo.GetFormElements(true, true); + + return dataClassInfo; + } + + public DataClassInfo GetClass(Guid classGuid) => DataClassInfoProvider.GetDataClassInfo(classGuid); + + public DataClassInfo GetClass(string className) => DataClassInfoProvider.GetDataClassInfo(className); + + + public IEnumerable GetCustomizedFieldInfos(string className) + { + var dci = DataClassInfoProvider.GetDataClassInfo(className); + var fi = new FormInfo(dci.ClassFormDefinition); + foreach (string? columnName in fi.GetColumnNames()) + { + var field = fi.GetFormField(columnName); + if (!field.System) + { + yield return new CustomizedFieldInfo(columnName); + } + } + } + + public IEnumerable GetCustomizedFieldInfos(FormInfo formInfo) + { + foreach (string? columnName in formInfo.GetColumnNames()) + { + var field = formInfo.GetFormField(columnName); + if (!field.System) + { + yield return new CustomizedFieldInfo(columnName); + } + } + } + + public IEnumerable GetCustomizedFieldInfosAll(string className) + { + var dci = DataClassInfoProvider.GetDataClassInfo(className); + + var fi = new FormInfo(dci.ClassFormDefinition); + foreach (string? columnName in fi.GetColumnNames()) + { + var field = fi.GetFormField(columnName); + if (!field.System) + { + yield return new CustomizedFieldInfo(columnName); + } + } + } +} diff --git a/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs b/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs index 607cc3a7..e85a50be 100644 --- a/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs +++ b/Migration.Toolkit.KXP.Api/KxpMediaFileFacade.cs @@ -1,86 +1,78 @@ -namespace Migration.Toolkit.KXP.Api; - -using System.Diagnostics; -using CMS.DataEngine; -using CMS.MediaLibrary; -using Microsoft.Extensions.Logging; - -public class KxpMediaFileFacade -{ - private readonly ILogger _logger; - public KxpMediaFileFacade(ILogger logger, KxpApiInitializer kxpApiInitializer) - { - _logger = logger; - kxpApiInitializer.EnsureApiIsInitialized(); - } - - public void SetMediaFile(MediaFileInfo mfi, bool newInstance) - { - Debug.Assert((newInstance && mfi.FileID == 0) || (!newInstance && mfi.FileID != 0), "newInstance && mfi.FileID == 0"); - - if (newInstance) - { - mfi.SaveFileToDisk(true); - mfi.Insert(); - } - else - { - mfi.Update(); - } - } - - public MediaFileInfo? GetMediaFile(Guid mediaFileGuid) - { - return MediaFileInfoProvider.GetMediaFiles("").Where(nameof(MediaFileInfo.FileGUID), QueryOperator.Equals, mediaFileGuid).SingleOrDefault(); - } - - // flaky feature - can be supported only at cost of performance & data integrity hit - // public MediaFileInfo? GetMediaFileByPath(string siteName, string? path) - // { - // if (string.IsNullOrWhiteSpace(path)) return null; - // MediaFileInfoProvider.GetMediaFileInfo(siteName, ) - // return MediaFileInfoProvider.GetMediaFiles("").Where(nameof(MediaFileInfo.FileGUID), QueryOperator.Equals, mediaFileGuid).SingleOrDefault(); - // } - - public MediaLibraryInfo GetMediaLibraryInfo(Guid mediaLibraryGuid) - { - return MediaLibraryInfoProvider.ProviderObject.Get(mediaLibraryGuid); - } - - public void EnsureMediaFilePathExistsInLibrary(MediaFileInfo mfi, int libraryId) - { - var librarySubDir = System.IO.Path.GetDirectoryName(mfi.FilePath); - // TODOV27 tomas.krch: 2023-09-05: media library => obsolete create method with sitename - MediaLibraryInfoProvider.CreateMediaLibraryFolder(libraryId, $"{librarySubDir}", false); - } - - public MediaLibraryInfo CreateMediaLibrary(int siteId, string libraryFolder, string libraryDescription, string libraryName, string libraryDisplayName) - { - // Creates a new media library object - MediaLibraryInfo newLibrary = new MediaLibraryInfo(); - - // Sets the library properties - newLibrary.LibraryDisplayName = libraryDisplayName; - newLibrary.LibraryName = libraryName; - newLibrary.LibraryDescription = libraryDescription; - newLibrary.LibraryFolder = libraryFolder; - - // TODO tomas.krch: 2023-11-02 ?? newLibrary.LibraryUseDirectPathForContent - // TODOV27 tomas.krch: 2023-09-05: library site id ref (replace with channel?) - // newLibrary.LibrarySiteID = siteId; - - // Saves the new media library to the database - MediaLibraryInfo.Provider.Set(newLibrary); - - return newLibrary; - } - - public MediaLibraryInfo SetMediaLibrary(MediaLibraryInfo mfi) - { - MediaLibraryInfo.Provider.Set(mfi); - - Debug.Assert(mfi.LibraryID != 0, "mfi.LibraryID != 0"); - - return mfi; - } -} \ No newline at end of file +using System.Diagnostics; +using CMS.DataEngine; +using CMS.MediaLibrary; +using Microsoft.Extensions.Logging; + +namespace Migration.Toolkit.KXP.Api; + +public class KxpMediaFileFacade +{ + private readonly ILogger logger; + + public KxpMediaFileFacade(ILogger logger, KxpApiInitializer kxpApiInitializer) + { + this.logger = logger; + kxpApiInitializer.EnsureApiIsInitialized(); + } + + public void SetMediaFile(MediaFileInfo mfi, bool newInstance) + { + Debug.Assert((newInstance && mfi.FileID == 0) || (!newInstance && mfi.FileID != 0), "newInstance && mfi.FileID == 0"); + + if (newInstance) + { + mfi.SaveFileToDisk(true); + mfi.Insert(); + } + else + { + mfi.Update(); + } + } + + public MediaFileInfo? GetMediaFile(Guid mediaFileGuid) => MediaFileInfoProvider.GetMediaFiles("").Where(nameof(MediaFileInfo.FileGUID), QueryOperator.Equals, mediaFileGuid).SingleOrDefault(); + + public MediaLibraryInfo GetMediaLibraryInfo(Guid mediaLibraryGuid) => MediaLibraryInfoProvider.ProviderObject.Get(mediaLibraryGuid); + + public void EnsureMediaFilePathExistsInLibrary(MediaFileInfo mfi, int libraryId) + { + string? librarySubDir = System.IO.Path.GetDirectoryName(mfi.FilePath); + MediaLibraryInfoProvider.CreateMediaLibraryFolder(libraryId, $"{librarySubDir}"); + } + + public MediaLibraryInfo CreateMediaLibrary(int siteId, string libraryFolder, string libraryDescription, string libraryName, string libraryDisplayName) + { + // Creates a new media library object + var newLibrary = new MediaLibraryInfo + { + // Sets the library properties + LibraryDisplayName = libraryDisplayName, + LibraryName = libraryName, + LibraryDescription = libraryDescription, + LibraryFolder = libraryFolder + }; + + // Saves the new media library to the database + MediaLibraryInfo.Provider.Set(newLibrary); + + logger.LogTrace("Emit library {Info}", new + { + siteId, + libraryFolder, + libraryDescription, + libraryName, + libraryDisplayName + }); + + return newLibrary; + } + + public MediaLibraryInfo SetMediaLibrary(MediaLibraryInfo mfi) + { + MediaLibraryInfo.Provider.Set(mfi); + + Debug.Assert(mfi.LibraryID != 0, "mfi.LibraryID != 0"); + + return mfi; + } +} diff --git a/Migration.Toolkit.KXP.Api/Migration.Toolkit.KXP.Api.csproj b/Migration.Toolkit.KXP.Api/Migration.Toolkit.KXP.Api.csproj index 3b9a57bd..accbc42d 100644 --- a/Migration.Toolkit.KXP.Api/Migration.Toolkit.KXP.Api.csproj +++ b/Migration.Toolkit.KXP.Api/Migration.Toolkit.KXP.Api.csproj @@ -6,16 +6,16 @@ - + - - + + - + diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs b/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs index 092a70fc..0cb65327 100644 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs +++ b/Migration.Toolkit.KXP.Api/Services/CmsClass/FieldMigrationService.cs @@ -1,85 +1,87 @@ -namespace Migration.Toolkit.KXP.Api.Services.CmsClass; - -using System.Text.RegularExpressions; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; - -public class FieldMigrationService // shall be singleton to cache necessary data -{ - private readonly ILogger _logger; - private readonly FieldMigration[] _userDefinedMigrations; - - public FieldMigrationService(ToolkitConfiguration configuration, ILogger logger) - { - _logger = logger; - - var allUserDefinedMigrations = configuration.OptInFeatures?.CustomMigration?.FieldMigrations?.Select(fm => - new FieldMigration( - fm.SourceDataType!, - fm.TargetDataType!, - fm.SourceFormControl!, - fm.TargetFormComponent!, - fm.Actions, - fm.FieldNameRegex != null ? new Regex(fm.FieldNameRegex, RegexOptions.Compiled | RegexOptions.IgnoreCase) : null - ) - ).ToArray() ?? Array.Empty(); - _userDefinedMigrations = allUserDefinedMigrations; - } - - public FieldMigration? GetFieldMigration(string sourceDataType, string? sourceFormControl, string? fieldName) - { - if (sourceFormControl == null) - { - _logger.LogDebug("Source field has no control defined '{SourceDataType}', field '{FieldName}'", sourceDataType, fieldName); - return null; - } - - var userDefined = GetFieldMigrationInternal(_userDefinedMigrations, sourceDataType, sourceFormControl, fieldName); - if (userDefined is { }) - { - _logger.LogDebug("Field migration matched: '{MatchType}', {Migration}", "UserDefined", userDefined); - return userDefined; - } - - var preDefined = GetFieldMigrationInternal(FieldMappingInstance.BuiltInFieldMigrations, sourceDataType, sourceFormControl, fieldName); - if (preDefined is { }) - { - _logger.LogDebug("Field migration matched: '{MatchType}', {Migration}", "BuiltIn", preDefined); - return preDefined; - } - - throw new InvalidOperationException($"No migration found for combination of '{sourceDataType}' datatype and '{sourceFormControl}'"); - } - - private static FieldMigration? GetFieldMigrationInternal(FieldMigration[] migrations, string sourceDataType, string? sourceFormControl, string? fieldName) - { - var matchedByDtFc = migrations.Where(x => - string.Equals(x.SourceDataType, sourceDataType, StringComparison.InvariantCultureIgnoreCase) && - string.Equals(x.SourceFormControl, sourceFormControl, StringComparison.InvariantCultureIgnoreCase) - ).ToArray(); - - if (matchedByDtFc is { Length: > 0 }) - { - if (matchedByDtFc.LastOrDefault(x => fieldName != null && (x.FieldNameRegex?.IsMatch(fieldName) ?? false)) is { } exactMatch) - { - return exactMatch; - } - - if (matchedByDtFc.LastOrDefault() is { } looseMatch) - { - return looseMatch; - } - } - - var generalMatch = migrations.LastOrDefault(x => - string.Equals(x.SourceDataType, sourceDataType, StringComparison.InvariantCultureIgnoreCase) && - string.Equals(x.SourceFormControl, SfcDirective.CatchAnyNonMatching, StringComparison.InvariantCultureIgnoreCase) - ); - if (generalMatch is { }) - { - return generalMatch; - } - - return null; - } -} \ No newline at end of file +using System.Text.RegularExpressions; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.KXP.Api.Services.CmsClass; + +public class FieldMigrationService // shall be singleton to cache necessary data +{ + private readonly ILogger logger; + private readonly FieldMigration[] userDefinedMigrations; + + public FieldMigrationService(ToolkitConfiguration configuration, ILogger logger) + { + this.logger = logger; + + var allUserDefinedMigrations = configuration.OptInFeatures?.CustomMigration?.FieldMigrations?.Select(fm => + new FieldMigration( + fm.SourceDataType!, + fm.TargetDataType!, + fm.SourceFormControl!, + fm.TargetFormComponent!, + fm.Actions, + fm.FieldNameRegex != null ? new Regex(fm.FieldNameRegex, RegexOptions.Compiled | RegexOptions.IgnoreCase) : null + ) + ).ToArray() ?? Array.Empty(); + userDefinedMigrations = allUserDefinedMigrations; + } + + public FieldMigration? GetFieldMigration(string sourceDataType, string? sourceFormControl, string? fieldName) + { + if (sourceFormControl == null) + { + logger.LogDebug("Source field has no control defined '{SourceDataType}', field '{FieldName}'", sourceDataType, fieldName); + return null; + } + + var userDefined = GetFieldMigrationInternal(userDefinedMigrations, sourceDataType, sourceFormControl, fieldName); + if (userDefined is not null) + { + logger.LogDebug("Field migration matched: '{MatchType}', {Migration}", "UserDefined", userDefined); + return userDefined; + } + + var preDefined = GetFieldMigrationInternal(FieldMappingInstance.BuiltInFieldMigrations, sourceDataType, sourceFormControl, fieldName); + if (preDefined is not null) + { + logger.LogDebug("Field migration matched: '{MatchType}', {Migration}", "BuiltIn", preDefined); + return preDefined; + } + + throw new InvalidOperationException($"No migration found for combination of '{sourceDataType}' datatype and '{sourceFormControl}'"); + } + + private static FieldMigration? GetFieldMigrationInternal(FieldMigration[] migrations, string sourceDataType, string? sourceFormControl, string? fieldName) + { + var matchedByDtFc = migrations.Where(x => + string.Equals(x.SourceDataType, sourceDataType, StringComparison.InvariantCultureIgnoreCase) && + string.Equals(x.SourceFormControl, sourceFormControl, StringComparison.InvariantCultureIgnoreCase) + ).ToArray(); + + if (matchedByDtFc is { Length: > 0 }) + { + if (matchedByDtFc.LastOrDefault(x => fieldName != null && (x.FieldNameRegex?.IsMatch(fieldName) ?? false)) is { } exactMatch) + { + return exactMatch; + } + + if (matchedByDtFc.LastOrDefault() is { } looseMatch) + { + return looseMatch; + } + } + + var generalMatch = migrations.LastOrDefault(x => + string.Equals(x.SourceDataType, sourceDataType, StringComparison.InvariantCultureIgnoreCase) && + string.Equals(x.SourceFormControl, SfcDirective.CatchAnyNonMatching, StringComparison.InvariantCultureIgnoreCase) + ); + if (generalMatch is not null) + { + return generalMatch; + } + + return null; + } +} diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs index dd30298a..2c078cd5 100644 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs +++ b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormDefinitionPatcher.cs @@ -1,418 +1,425 @@ -namespace Migration.Toolkit.KXP.Api.Services.CmsClass; - -using System.Xml.Linq; -using System.Xml.XPath; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; - -public class FormDefinitionPatcher -{ - private const string CATEGORY_ELEM = "category"; - private const string CATEGORY_ATTR_NAME = FIELD_ATTR_NAME; - private const string FIELD_ATTR_COLUMN = "column"; - private const string FIELD_ATTR_COLUMNTYPE = "columntype"; - private const string FIELD_ATTR_ENABLED = "enabled"; - private const string FIELD_ATTR_GUID = "guid"; - private const string FIELD_ATTR_ISPK = "isPK"; - private const string FIELD_ATTR_NAME = "name"; - private const string FIELD_ATTR_SIZE = "size"; - private const int FIELD_ATTR_SIZE_ZERO = 0; - private const string FIELD_ATTR_SYSTEM = "system"; - private const string FIELD_ATTR_VISIBLE = "visible"; - private const string FIELD_ELEM = "field"; - private const string FIELD_ELEM_PROPERTIES = "properties"; - private const string FIELD_ELEM_SETTINGS = "settings"; - private const string PROPERTIES_ELEM_DEFAULTVALUE = "defaultvalue"; - private const string SETTINGS_ELEM_CONTROLNAME = "controlname"; - private const string SETTINGS_MAXIMUMASSETS = "MaximumAssets"; - private const string SETTINGS_MAXIMUMASSETS_FALLBACK = "99"; - private const string SETTINGS_MAXIMUMPAGES = "MaximumPages"; - private const string SETTINGS_MAXIMUMPAGES_FALLBACK = "99"; - private const string SETTINGS_ROOTPATH = "RootPath"; - private const string SETTINGS_ROOTPATH_FALLBACK = "/"; - - private readonly ILogger _logger; - private readonly string _formDefinitionXml; - private readonly FieldMigrationService _fieldMigrationService; - private readonly bool _classIsForm; - private readonly bool _classIsDocumentType; - private readonly bool _discardSysFields; - private readonly bool _classIsCustom; - private readonly bool _altForm; - private readonly XDocument _xDoc; - - private readonly IReadOnlySet _allowedFieldAttributes = new HashSet([ - // taken from FormFieldInfo.GetAttributes() method - "column", - "visible", - "enabled", - "columntype", - "allowempty", - "isPK", - "system", - "columnsize", - "columnprecision", - "guid", - "external", - "isinherited", - "mappedtofield", - "dummy", - "isunique", - "refobjtype", - "reftype", - "resolvedefaultvalue", - ], StringComparer.InvariantCultureIgnoreCase); - - public FormDefinitionPatcher(ILogger logger, - string formDefinitionXml, - FieldMigrationService fieldMigrationService, - bool classIsForm, - bool classIsDocumentType, - bool discardSysFields, - bool classIsCustom, - bool altForm = false) - { - _logger = logger; - _formDefinitionXml = formDefinitionXml; - _fieldMigrationService = fieldMigrationService; - _classIsForm = classIsForm; - _classIsDocumentType = classIsDocumentType; - _discardSysFields = discardSysFields; - _classIsCustom = classIsCustom; - _altForm = altForm; - _xDoc = XDocument.Parse(_formDefinitionXml); - } - - public IEnumerable GetFieldNames() - { - return _xDoc.XPathSelectElements($"//{FIELD_ELEM}").Select(x => x.Attribute(FIELD_ATTR_COLUMN)?.Value); - } - - public void RemoveCategories() - { - var categories = (_xDoc.Root?.XPathSelectElements($"//{CATEGORY_ELEM}") ?? Enumerable.Empty()).ToList(); - foreach (var xElement in categories) - { - var elementDescriptor = xElement.ToString(); - if (xElement.Attribute(FIELD_ATTR_NAME)?.Value is { } name) - { - elementDescriptor = name; - } - - _logger.LogDebug("Removing category '{CategoryDescriptor}'", elementDescriptor); - xElement.Remove(); - } - } - - public void RemoveFields(string diffAgainstDefinition) - { - var otherDoc = XDocument.Parse(diffAgainstDefinition); - - if (otherDoc.Root?.Elements() is { } elements) - { - var elementList = elements.ToList(); - foreach (XElement field in elementList) - { - if (field.Attribute(FIELD_ATTR_COLUMN)?.Value is { } fieldToRemoveName) - { - if (_xDoc.XPathSelectElements($"//{FIELD_ELEM}[@column={fieldToRemoveName}]") is { } fieldToRemove) - { - _logger.LogDebug("Field {FieldName} removed from definition", fieldToRemoveName); - fieldToRemove.Remove(); - } - else - { - _logger.LogDebug("Field {FieldName} not found, cannot remove from definition", fieldToRemoveName); - } - } - } - } - else - { - _logger.LogError("Unable to parse form definition: {FormDefinition}", diffAgainstDefinition); - } - } - - public void PatchFields() - { - if (_xDoc.Root?.Elements() is { } elements) - { - var elementList = elements.ToList(); - foreach (var fieldOrCategory in elementList) - { - if (fieldOrCategory.Name == FIELD_ELEM) - { - PatchField(fieldOrCategory); - } - else if (fieldOrCategory.Name == CATEGORY_ELEM) - { - _logger.LogDebug("Category '{Category}' skipped", fieldOrCategory.Attribute(CATEGORY_ATTR_NAME)?.Value ?? ""); - } - else - { - _logger.LogWarning("Unknown element '{Element}'", fieldOrCategory.Name); - } - } - } - else - { - _logger.LogError("Unable to parse form definition: {FormDefinition}", _formDefinitionXml); - } - } - - public string? GetPatched() - { - return _xDoc.Root?.ToString(); - } - - private void PatchField(XElement field) - { - var columnAttr = field.Attribute(FIELD_ATTR_COLUMN); - var systemAttr = field.Attribute(FIELD_ATTR_SYSTEM); - var isPkAttr = field.Attribute(FIELD_ATTR_ISPK); - var columnTypeAttr = field.Attribute(FIELD_ATTR_COLUMNTYPE); - var visibleAttr = field.Attribute(FIELD_ATTR_VISIBLE); - var enabledAttr = field.Attribute(FIELD_ATTR_ENABLED); - var guidAttr = field.Attribute(FIELD_ATTR_GUID); - - var isPk = bool.TryParse(isPkAttr?.Value, out var isPkParsed) && isPkParsed; - var system = bool.TryParse(systemAttr?.Value, out var sysParsed) && sysParsed; - - var fieldDescriptor = (columnAttr ?? guidAttr)?.Value ?? ""; - - // cleanup of no longer supported fields - foreach (var a in field.Attributes()) - { - var an = a.Name.ToString(); - if (!_allowedFieldAttributes.Contains(an)) - { - a.Remove(); - _logger.LogTrace("Removing attribute '{AttributeName}'='{Value}' from field with column '{ColumnName}'", an, a.Value, columnAttr?.Value); - } - } - - if (_discardSysFields && (system || isPk)) - { - _logger.LogDebug("Discard sys filed == true => Removing field sys '{Field}'", fieldDescriptor); - field.Remove(); - return; - } - - var columnType = columnTypeAttr?.Value; - if (columnType == null) - { - if (isPk) return; - - _logger.LogError("Field ('{Field}') 'columnType' attribute is required", fieldDescriptor); - return; - } - - - var controlNameElem = field.XPathSelectElement($"{FIELD_ELEM_SETTINGS}/{SETTINGS_ELEM_CONTROLNAME}"); - var controlName = controlNameElem?.Value; - - if (_fieldMigrationService.GetFieldMigration(columnType, controlName, columnAttr?.Value) is var (sourceDataType, targetDataType, sourceFormControl, targetFormComponent, actions, fieldNameRegex)) - { - _logger.LogDebug("Field {FieldDescriptor} DataType: {SourceDataType} => {TargetDataType}", fieldDescriptor, columnType, targetDataType); - columnTypeAttr?.SetValue(targetDataType); - switch (targetFormComponent) - { - case TfcDirective.DoNothing: - _logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective}", fieldDescriptor, targetFormComponent); - PerformActionsOnField(field, fieldDescriptor, actions); - break; - case TfcDirective.Clear: - _logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective}", fieldDescriptor, targetFormComponent); - field.RemoveNodes(); - visibleAttr?.SetValue(false); - break; - case TfcDirective.CopySourceControl: - // TODO tk: 2022-10-06 support only for custom controls - _logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective} => {ControlName}", fieldDescriptor, targetFormComponent, controlName); - controlNameElem?.SetValue(controlName); - PerformActionsOnField(field, fieldDescriptor, actions); - break; - default: - { - _logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:NONE => from control '{ControlName}' => {TargetFormComponent}", fieldDescriptor, controlName, targetFormComponent); - controlNameElem?.SetValue(targetFormComponent); - PerformActionsOnField(field, fieldDescriptor, actions); - break; - } - } - } - - - if (!_classIsForm && !_classIsDocumentType) - { - var hasVisibleAttribute = visibleAttr != null; - if (enabledAttr is { } enabled) - { - enabled.Remove(); - _logger.LogDebug("Removing field '{Field}' attribute '{Attribute}'", fieldDescriptor, FIELD_ATTR_ENABLED); - } - - if (system && _classIsCustom) - { - systemAttr?.Remove(); - _logger.LogDebug("Removing field '{Field}' attribute '{Attribute}'", fieldDescriptor, systemAttr?.Name); - } - - if (hasVisibleAttribute && visibleAttr?.Value is { } visibleValue) - { - field.Add(new XAttribute(FIELD_ATTR_ENABLED, visibleValue)); - _logger.LogDebug("Set field '{Field}' attribute '{Attribute}' to value '{Value}' from attribute '{SourceAttribute}'", fieldDescriptor, FIELD_ATTR_ENABLED, visibleValue, FIELD_ATTR_VISIBLE); - } - - if (!_altForm) - { - if (hasVisibleAttribute) - { - visibleAttr?.Remove(); - _logger.LogDebug("Removing field '{Field}' attribute '{Attribute}'", fieldDescriptor, FIELD_ATTR_VISIBLE); - } - } - - foreach (var fieldChildNode in field.Elements().ToList()) - { - _logger.LogDebug("Patching filed child '{FieldChildName}'", fieldChildNode.Name); - switch (fieldChildNode.Name.ToString()) - { - case FIELD_ELEM_PROPERTIES: - { - PatchProperties(fieldChildNode); - break; - } - case FIELD_ELEM_SETTINGS: - { - if (_altForm) - { - PatchSettings(fieldChildNode); - } - else - { - // XbK Resource / Module class no longer supports visual representation - ClearSettings(fieldChildNode); - } - break; - } - default: - { - _logger.LogDebug("Removing field element '{ElementName}'", fieldChildNode.Name); - fieldChildNode.Remove(); - break; - } - } - } - } - - if (_classIsForm || _classIsDocumentType) - { - if (field.Attribute(FIELD_ATTR_VISIBLE) is { } visible) - { - field.Add(new XAttribute(FIELD_ATTR_ENABLED, visible.Value)); - _logger.LogDebug("Set field '{Field}' attribute '{Attribute}' to value '{Value}' from attribute '{SourceAttribute}'", fieldDescriptor, FIELD_ATTR_ENABLED, visible, FIELD_ATTR_VISIBLE); - } - } - } - - private void ClearSettings(XElement settingsElem) - { - var elementsToRemove = settingsElem.Elements().ToList(); - foreach (var element in elementsToRemove) - { - _logger.LogDebug("Removing settings element '{ElementName}'", element.Name); - element.Remove(); - } - - if (!settingsElem.Elements().Any()) - { - settingsElem.Remove(); - } - } - - private void PatchSettings(XElement settingsElem) - { - var elementsToRemove = settingsElem.Elements() - .Where(element => element.Name != SETTINGS_ELEM_CONTROLNAME) - .ToList(); - - foreach (var element in elementsToRemove) - { - _logger.LogDebug("Removing settings element '{ElementName}'", element.Name); - element.Remove(); - } - - if (!settingsElem.Elements().Any()) - { - settingsElem.Remove(); - } - } - - - private void PatchProperties(XElement properties) - { - var elementsToRemove = properties.Elements() - .Where(element => element.Name != PROPERTIES_ELEM_DEFAULTVALUE) - .ToList(); - - foreach (var element in elementsToRemove) - { - _logger.LogDebug("Removing properties element '{ElementName}'", element.Name); - element.Remove(); - } - - if (!properties.Elements().Any()) - { - _logger.LogDebug("Properties element is empty => removing"); - properties.Remove(); - } - } - - private void PerformActionsOnField(XElement field, string fieldDescriptor, string[]? actions) - { - if (actions == null) return; - - foreach (var action in actions) - { - _logger.LogDebug("Field {FieldDescriptor} Action: {Action}", fieldDescriptor, action); - switch (action) - { - case TcaDirective.ClearSettings: - { - field.Element(FIELD_ELEM_SETTINGS)?.Remove(); - break; - } - case TcaDirective.ClearMacroTable: - { - // TODO tk: 2022-10-11 really needed? - break; - } - case TcaDirective.ConvertToAsset: - { - field - .EnsureElement(FIELD_ELEM_SETTINGS) - .EnsureElement(SETTINGS_MAXIMUMASSETS, maxAssets => maxAssets.Value = SETTINGS_MAXIMUMASSETS_FALLBACK); - break; - } - case TcaDirective.ConvertToPages: - { - field - .EnsureElement(FIELD_ELEM_SETTINGS, settings => - { - settings.EnsureElement(SETTINGS_MAXIMUMPAGES, maxAssets => maxAssets.Value = SETTINGS_MAXIMUMPAGES_FALLBACK); - settings.EnsureElement(SETTINGS_ROOTPATH, maxAssets => maxAssets.Value = SETTINGS_ROOTPATH_FALLBACK); // TODO tk: 2022-08-31 describe why? - }); - - field.SetAttributeValue(FIELD_ATTR_SIZE, FIELD_ATTR_SIZE_ZERO); // TODO tk: 2022-08-31 describe why? - - var settings = field.EnsureElement(FIELD_ELEM_SETTINGS); - settings.EnsureElement("TreePath", element => element.Value = settings.Element("RootPath")?.Value ?? ""); - settings.EnsureElement("RootPath").Remove(); - - break; - } - } - } - } -} \ No newline at end of file +using System.Xml.Linq; +using System.Xml.XPath; + +using Microsoft.Extensions.Logging; + +using Migration.Toolkit.Common; + +namespace Migration.Toolkit.KXP.Api.Services.CmsClass; + +public class FormDefinitionPatcher +{ + private const string CategoryElem = "category"; + private const string CategoryAttrName = FieldAttrName; + private const string FieldAttrColumn = "column"; + private const string FieldAttrColumntype = "columntype"; + private const string FieldAttrEnabled = "enabled"; + private const string FieldAttrGuid = "guid"; + private const string FieldAttrIspk = "isPK"; + private const string FieldAttrName = "name"; + private const string FieldAttrSize = "size"; + private const int FieldAttrSizeZero = 0; + private const string FieldAttrSystem = "system"; + private const string FieldAttrVisible = "visible"; + private const string FieldElem = "field"; + private const string FieldElemProperties = "properties"; + private const string FieldElemSettings = "settings"; + private const string PropertiesElemDefaultvalue = "defaultvalue"; + private const string SettingsElemControlname = "controlname"; + private const string SettingsMaximumassets = "MaximumAssets"; + private const string SettingsMaximumassetsFallback = "99"; + private const string SettingsMaximumpages = "MaximumPages"; + private const string SettingsMaximumpagesFallback = "99"; + private const string SettingsRootpath = "RootPath"; + private const string SettingsRootpathFallback = "/"; + + private readonly IReadOnlySet allowedFieldAttributes = new HashSet([ + // taken from FormFieldInfo.GetAttributes() method + "column", + "visible", + "enabled", + "columntype", + "allowempty", + "isPK", + "system", + "columnsize", + "columnprecision", + "guid", + "external", + "isinherited", + "mappedtofield", + "dummy", + "isunique", + "refobjtype", + "reftype", + "resolvedefaultvalue" + ], StringComparer.InvariantCultureIgnoreCase); + + private readonly bool altForm; + private readonly bool classIsCustom; + private readonly bool classIsDocumentType; + private readonly bool classIsForm; + private readonly bool discardSysFields; + private readonly FieldMigrationService fieldMigrationService; + private readonly string formDefinitionXml; + + private readonly ILogger logger; + private readonly XDocument xDoc; + + public FormDefinitionPatcher(ILogger logger, + string formDefinitionXml, + FieldMigrationService fieldMigrationService, + bool classIsForm, + bool classIsDocumentType, + bool discardSysFields, + bool classIsCustom, + bool altForm = false) + { + this.logger = logger; + this.formDefinitionXml = formDefinitionXml; + this.fieldMigrationService = fieldMigrationService; + this.classIsForm = classIsForm; + this.classIsDocumentType = classIsDocumentType; + this.discardSysFields = discardSysFields; + this.classIsCustom = classIsCustom; + this.altForm = altForm; + xDoc = XDocument.Parse(this.formDefinitionXml); + } + + public IEnumerable GetFieldNames() => xDoc.XPathSelectElements($"//{FieldElem}").Select(x => x.Attribute(FieldAttrColumn)?.Value); + + public void RemoveCategories() + { + var categories = (xDoc.Root?.XPathSelectElements($"//{CategoryElem}") ?? Enumerable.Empty()).ToList(); + foreach (var xElement in categories) + { + string elementDescriptor = xElement.ToString(); + if (xElement.Attribute(FieldAttrName)?.Value is { } name) + { + elementDescriptor = name; + } + + logger.LogDebug("Removing category '{CategoryDescriptor}'", elementDescriptor); + xElement.Remove(); + } + } + + public void RemoveFields(string diffAgainstDefinition) + { + var otherDoc = XDocument.Parse(diffAgainstDefinition); + + if (otherDoc.Root?.Elements() is { } elements) + { + var elementList = elements.ToList(); + foreach (var field in elementList) + { + if (field.Attribute(FieldAttrColumn)?.Value is { } fieldToRemoveName) + { + if (xDoc.XPathSelectElements($"//{FieldElem}[@column={fieldToRemoveName}]") is { } fieldToRemove) + { + logger.LogDebug("Field {FieldName} removed from definition", fieldToRemoveName); + fieldToRemove.Remove(); + } + else + { + logger.LogDebug("Field {FieldName} not found, cannot remove from definition", fieldToRemoveName); + } + } + } + } + else + { + logger.LogError("Unable to parse form definition: {FormDefinition}", diffAgainstDefinition); + } + } + + public void PatchFields() + { + if (xDoc.Root?.Elements() is { } elements) + { + var elementList = elements.ToList(); + foreach (var fieldOrCategory in elementList) + { + if (fieldOrCategory.Name == FieldElem) + { + PatchField(fieldOrCategory); + } + else if (fieldOrCategory.Name == CategoryElem) + { + logger.LogDebug("Category '{Category}' skipped", fieldOrCategory.Attribute(CategoryAttrName)?.Value ?? ""); + } + else + { + logger.LogWarning("Unknown element '{Element}'", fieldOrCategory.Name); + } + } + } + else + { + logger.LogError("Unable to parse form definition: {FormDefinition}", formDefinitionXml); + } + } + + public string? GetPatched() => xDoc.Root?.ToString(); + + private void PatchField(XElement field) + { + var columnAttr = field.Attribute(FieldAttrColumn); + var systemAttr = field.Attribute(FieldAttrSystem); + var isPkAttr = field.Attribute(FieldAttrIspk); + var columnTypeAttr = field.Attribute(FieldAttrColumntype); + var visibleAttr = field.Attribute(FieldAttrVisible); + var enabledAttr = field.Attribute(FieldAttrEnabled); + var guidAttr = field.Attribute(FieldAttrGuid); + + bool isPk = bool.TryParse(isPkAttr?.Value, out bool isPkParsed) && isPkParsed; + bool system = bool.TryParse(systemAttr?.Value, out bool sysParsed) && sysParsed; + + string fieldDescriptor = (columnAttr ?? guidAttr)?.Value ?? ""; + + // cleanup of no longer supported fields + foreach (var a in field.Attributes()) + { + string an = a.Name.ToString(); + if (!allowedFieldAttributes.Contains(an)) + { + a.Remove(); + logger.LogTrace("Removing attribute '{AttributeName}'='{Value}' from field with column '{ColumnName}'", an, a.Value, columnAttr?.Value); + } + } + + if (discardSysFields && (system || isPk)) + { + logger.LogDebug("Discard sys filed == true => Removing field sys '{Field}'", fieldDescriptor); + field.Remove(); + return; + } + + string? columnType = columnTypeAttr?.Value; + if (columnType == null) + { + if (isPk) + { + return; + } + + logger.LogError("Field ('{Field}') 'columnType' attribute is required", fieldDescriptor); + return; + } + + + var controlNameElem = field.XPathSelectElement($"{FieldElemSettings}/{SettingsElemControlname}"); + string? controlName = controlNameElem?.Value; + + if (fieldMigrationService.GetFieldMigration(columnType, controlName, columnAttr?.Value) is var (_, targetDataType, _, targetFormComponent, actions, _)) + { + logger.LogDebug("Field {FieldDescriptor} DataType: {SourceDataType} => {TargetDataType}", fieldDescriptor, columnType, targetDataType); + columnTypeAttr?.SetValue(targetDataType); + switch (targetFormComponent) + { + case TfcDirective.DoNothing: + logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective}", fieldDescriptor, targetFormComponent); + PerformActionsOnField(field, fieldDescriptor, actions); + break; + case TfcDirective.Clear: + logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective}", fieldDescriptor, targetFormComponent); + field.RemoveNodes(); + visibleAttr?.SetValue(false); + break; + case TfcDirective.CopySourceControl: + // TODO tk: 2022-10-06 support only for custom controls + logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:{TcaDirective} => {ControlName}", fieldDescriptor, targetFormComponent, controlName); + controlNameElem?.SetValue(controlName); + PerformActionsOnField(field, fieldDescriptor, actions); + break; + default: + { + logger.LogDebug("Field {FieldDescriptor} ControlName: Tca:NONE => from control '{ControlName}' => {TargetFormComponent}", fieldDescriptor, controlName, targetFormComponent); + controlNameElem?.SetValue(targetFormComponent); + PerformActionsOnField(field, fieldDescriptor, actions); + break; + } + } + } + + + if (!classIsForm && !classIsDocumentType) + { + bool hasVisibleAttribute = visibleAttr != null; + if (enabledAttr is { } enabled) + { + enabled.Remove(); + logger.LogDebug("Removing field '{Field}' attribute '{Attribute}'", fieldDescriptor, FieldAttrEnabled); + } + + if (system && classIsCustom) + { + systemAttr?.Remove(); + logger.LogDebug("Removing field '{Field}' attribute '{Attribute}'", fieldDescriptor, systemAttr?.Name); + } + + if (hasVisibleAttribute && visibleAttr?.Value is { } visibleValue) + { + field.Add(new XAttribute(FieldAttrEnabled, visibleValue)); + logger.LogDebug("Set field '{Field}' attribute '{Attribute}' to value '{Value}' from attribute '{SourceAttribute}'", fieldDescriptor, FieldAttrEnabled, visibleValue, FieldAttrVisible); + } + + if (!altForm) + { + if (hasVisibleAttribute) + { + visibleAttr?.Remove(); + logger.LogDebug("Removing field '{Field}' attribute '{Attribute}'", fieldDescriptor, FieldAttrVisible); + } + } + + foreach (var fieldChildNode in field.Elements().ToList()) + { + logger.LogDebug("Patching filed child '{FieldChildName}'", fieldChildNode.Name); + switch (fieldChildNode.Name.ToString()) + { + case FieldElemProperties: + { + PatchProperties(fieldChildNode); + break; + } + case FieldElemSettings: + { + if (altForm) + { + PatchSettings(fieldChildNode); + } + else + { + // XbK Resource / Module class no longer supports visual representation + ClearSettings(fieldChildNode); + } + + break; + } + default: + { + logger.LogDebug("Removing field element '{ElementName}'", fieldChildNode.Name); + fieldChildNode.Remove(); + break; + } + } + } + } + + if (classIsForm || classIsDocumentType) + { + if (field.Attribute(FieldAttrVisible) is { } visible) + { + field.Add(new XAttribute(FieldAttrEnabled, visible.Value)); + logger.LogDebug("Set field '{Field}' attribute '{Attribute}' to value '{Value}' from attribute '{SourceAttribute}'", fieldDescriptor, FieldAttrEnabled, visible, FieldAttrVisible); + } + } + } + + private void ClearSettings(XElement settingsElem) + { + var elementsToRemove = settingsElem.Elements().ToList(); + foreach (var element in elementsToRemove) + { + logger.LogDebug("Removing settings element '{ElementName}'", element.Name); + element.Remove(); + } + + if (!settingsElem.Elements().Any()) + { + settingsElem.Remove(); + } + } + + private void PatchSettings(XElement settingsElem) + { + var elementsToRemove = settingsElem.Elements() + .Where(element => element.Name != SettingsElemControlname) + .ToList(); + + foreach (var element in elementsToRemove) + { + logger.LogDebug("Removing settings element '{ElementName}'", element.Name); + element.Remove(); + } + + if (!settingsElem.Elements().Any()) + { + settingsElem.Remove(); + } + } + + + private void PatchProperties(XElement properties) + { + var elementsToRemove = properties.Elements() + .Where(element => element.Name != PropertiesElemDefaultvalue) + .ToList(); + + foreach (var element in elementsToRemove) + { + logger.LogDebug("Removing properties element '{ElementName}'", element.Name); + element.Remove(); + } + + if (!properties.Elements().Any()) + { + logger.LogDebug("Properties element is empty => removing"); + properties.Remove(); + } + } + + private void PerformActionsOnField(XElement field, string fieldDescriptor, string[]? actions) + { + if (actions == null) + { + return; + } + + foreach (string action in actions) + { + logger.LogDebug("Field {FieldDescriptor} Action: {Action}", fieldDescriptor, action); + switch (action) + { + case TcaDirective.ClearSettings: + { + field.Element(FieldElemSettings)?.Remove(); + break; + } + case TcaDirective.ClearMacroTable: + { + // TODO tk: 2022-10-11 really needed? + break; + } + case TcaDirective.ConvertToAsset: + { + field + .EnsureElement(FieldElemSettings) + .EnsureElement(SettingsMaximumassets, maxAssets => maxAssets.Value = SettingsMaximumassetsFallback); + break; + } + case TcaDirective.ConvertToPages: + { + field + .EnsureElement(FieldElemSettings, settings => + { + settings.EnsureElement(SettingsMaximumpages, maxAssets => maxAssets.Value = SettingsMaximumpagesFallback); + settings.EnsureElement(SettingsRootpath, maxAssets => maxAssets.Value = SettingsRootpathFallback); // TODO tk: 2022-08-31 describe why? + }); + + field.SetAttributeValue(FieldAttrSize, FieldAttrSizeZero); // TODO tk: 2022-08-31 describe why? + + var settings = field.EnsureElement(FieldElemSettings); + settings.EnsureElement("TreePath", element => element.Value = settings.Element("RootPath")?.Value ?? ""); + settings.EnsureElement("RootPath").Remove(); + + break; + } + + default: + break; + } + } + } +} diff --git a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs index 77a63060..d829d6b6 100644 --- a/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs +++ b/Migration.Toolkit.KXP.Api/Services/CmsClass/FormFieldMappingModel.cs @@ -1,97 +1,100 @@ -namespace Migration.Toolkit.KXP.Api.Services.CmsClass; - -using System.Text.RegularExpressions; -using CMS.DataEngine; -using CMS.OnlineForms; -using Migration.Toolkit.Common.Enumerations; -using Migration.Toolkit.KXP.Api.Auxiliary; -using FcText = Common.Enumerations.Kx13FormControls.UserControlForText; -using FcLongText = Common.Enumerations.Kx13FormControls.UserControlForLongText; - -public record FormComponentReplacement(string OldFormComponent, string NewFormComponent); - -public record DataTypeMigrationModel( - FieldMigration[] FieldMigrations, - FormComponentReplacement[] NotSupportedInKxpLegacyMode, - [property: Obsolete("Legacy mode is no longer supported")] - string[] SupportedInKxpLegacyMode -); -public record FieldMigration(string SourceDataType, string TargetDataType, string SourceFormControl, string? TargetFormComponent, string[]? Actions = null, Regex? FieldNameRegex = null); - -/// -/// Tca = target control action -/// -public static partial class TcaDirective -{ - public const string ClearSettings = "clear settings"; - public const string ClearMacroTable = "clear hashtable"; - public const string ConvertToAsset = "convert to asset"; - public const string ConvertToPages = "convert to pages"; -} - -/// -/// Tfc = Target form component -/// -public static class TfcDirective -{ - public const string CopySourceControl = "#copy-source-control#"; - public const string DoNothing = "#nothing#"; - public const string Clear = "#clear#"; -} - -/// -/// Sfc = source form control -/// -public static class SfcDirective -{ - public const string CatchAnyNonMatching = "#any#"; -} - -public static class FieldMappingInstance -{ - public static FieldMigration[] BuiltInFieldMigrations => - [ - new(KsFieldDataType.ALL, FieldDataType.ALL, SfcDirective.CatchAnyNonMatching, null, [TfcDirective.Clear]), - new(KsFieldDataType.Unknown, FieldDataType.Unknown, SfcDirective.CatchAnyNonMatching, null, [TfcDirective.Clear]), - new(KsFieldDataType.Text, FieldDataType.Text, FcText.TextBoxControl, FormComponents.AdminTextInputComponent), - new(KsFieldDataType.Text, FieldDataType.Text, FcText.DropDownListControl, FormComponents.AdminDropDownComponent), - new(KsFieldDataType.Text, FieldDataType.Text, FcText.IconSelector, FormComponents.AdminIconSelectorComponent), - new(KsFieldDataType.Text, FieldDataType.Text, FcText.Password, FormComponents.AdminPasswordComponent), - new(KsFieldDataType.Text, FieldDataType.Text, FcText.RadioButtonsControl, FormComponents.AdminRadioGroupComponent), - new(KsFieldDataType.Text, FieldDataType.Text, FcText.TextAreaControl, FormComponents.AdminTextAreaComponent), - new(KsFieldDataType.Text, FieldDataType.Text, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent), - new(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.HtmlAreaControl, FormComponents.AdminRichTextEditorComponent), - new(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.TextBoxControl, FormComponents.AdminTextInputComponent), - new(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.DropDownListControl, FormComponents.AdminDropDownComponent), - new(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.TextAreaControl, FormComponents.AdminTextAreaComponent), - new(KsFieldDataType.LongText, FieldDataType.LongText, SfcDirective.CatchAnyNonMatching, FormComponents.AdminRichTextEditorComponent), - new(KsFieldDataType.Integer, FieldDataType.Integer, SfcDirective.CatchAnyNonMatching, FormComponents.AdminNumberInputComponent), - new(KsFieldDataType.LongInteger, FieldDataType.LongInteger, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear, [TfcDirective.Clear]),//FormComponents.AdminNumberInputComponent), - new(KsFieldDataType.Double, FieldDataType.Double, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear, [TfcDirective.Clear]),// FormComponents.AdminNumberInputComponent), - new(KsFieldDataType.Decimal, FieldDataType.Decimal, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDecimalNumberInputComponent), - new(KsFieldDataType.DateTime, FieldDataType.DateTime, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDateTimeInputComponent), - new(KsFieldDataType.Date, FieldDataType.Date, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDateInputComponent), - new(KsFieldDataType.TimeSpan, FieldDataType.TimeSpan, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent), - new(KsFieldDataType.Boolean, FieldDataType.Boolean, SfcDirective.CatchAnyNonMatching, FormComponents.AdminCheckBoxComponent), - new(KsFieldDataType.DocAttachments, FieldDataType.Assets, SfcDirective.CatchAnyNonMatching, FormComponents.AdminAssetSelectorComponent, [TcaDirective.ConvertToAsset]), - new(KsFieldDataType.File, FieldDataType.Assets, SfcDirective.CatchAnyNonMatching, FormComponents.AdminAssetSelectorComponent, [TcaDirective.ConvertToAsset]), - new(KsFieldDataType.Guid, FieldDataType.LongText, "RelatedDocuments", FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent, [TcaDirective.ConvertToPages]), - new(KsFieldDataType.Guid, FieldDataType.Guid, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear), - new(KsFieldDataType.Binary, FieldDataType.Binary, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear), - new(KsFieldDataType.Xml, FieldDataType.Xml, SfcDirective.CatchAnyNonMatching, FormComponents.AdminNumberWithLabelComponent), - new(KsFieldDataType.DocRelationships, FieldDataType.WebPages, SfcDirective.CatchAnyNonMatching, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent, [TcaDirective.ConvertToPages]), - - new(KsFieldDataType.TimeSpan, FieldDataType.TimeSpan, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent, [TcaDirective.ConvertToPages]), - new(KsFieldDataType.BizFormFile, BizFormUploadFile.DATATYPE_FORMFILE, SfcDirective.CatchAnyNonMatching, FormComponents.MvcFileUploaderComponent, []), - ]; - - public static DataTypeMigrationModel BuiltInModel => new( - BuiltInFieldMigrations, - [ - new(Kx13FormComponents.Kentico_AttachmentSelector, FormComponents.AdminAssetSelectorComponent), - new(Kx13FormComponents.Kentico_PageSelector, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent), - // new(Kx13FormComponents.Kentico_PathSelector, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent) - ], - [] // legacy mode is no more - ); -} \ No newline at end of file +using System.Text.RegularExpressions; + +using CMS.DataEngine; +using CMS.OnlineForms; + +using Migration.Toolkit.Common.Enumerations; +using Migration.Toolkit.KXP.Api.Auxiliary; + +using FcLongText = Migration.Toolkit.Common.Enumerations.Kx13FormControls.UserControlForLongText; +using FcText = Migration.Toolkit.Common.Enumerations.Kx13FormControls.UserControlForText; + +namespace Migration.Toolkit.KXP.Api.Services.CmsClass; + +public record FormComponentReplacement(string OldFormComponent, string NewFormComponent); + +public record DataTypeMigrationModel( + FieldMigration[] FieldMigrations, + FormComponentReplacement[] NotSupportedInKxpLegacyMode, + [property: Obsolete("Legacy mode is no longer supported")] string[] SupportedInKxpLegacyMode +); + +public record FieldMigration(string SourceDataType, string TargetDataType, string SourceFormControl, string? TargetFormComponent, string[]? Actions = null, Regex? FieldNameRegex = null); + +/// +/// Tca = target control action +/// +public static class TcaDirective +{ + public const string ClearSettings = "clear settings"; + public const string ClearMacroTable = "clear hashtable"; + public const string ConvertToAsset = "convert to asset"; + public const string ConvertToPages = "convert to pages"; +} + +/// +/// Tfc = Target form component +/// +public static class TfcDirective +{ + public const string CopySourceControl = "#copy-source-control#"; + public const string DoNothing = "#nothing#"; + public const string Clear = "#clear#"; +} + +/// +/// Sfc = source form control +/// +public static class SfcDirective +{ + public const string CatchAnyNonMatching = "#any#"; +} + +public static class FieldMappingInstance +{ + public static FieldMigration[] BuiltInFieldMigrations => + [ + new FieldMigration(KsFieldDataType.ALL, FieldDataType.ALL, SfcDirective.CatchAnyNonMatching, null, [TfcDirective.Clear]), + new FieldMigration(KsFieldDataType.Unknown, FieldDataType.Unknown, SfcDirective.CatchAnyNonMatching, null, [TfcDirective.Clear]), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.TextBoxControl, FormComponents.AdminTextInputComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.DropDownListControl, FormComponents.AdminDropDownComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.IconSelector, FormComponents.AdminIconSelectorComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.Password, FormComponents.AdminPasswordComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.RadioButtonsControl, FormComponents.AdminRadioGroupComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, FcText.TextAreaControl, FormComponents.AdminTextAreaComponent), + new FieldMigration(KsFieldDataType.Text, FieldDataType.Text, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.HtmlAreaControl, FormComponents.AdminRichTextEditorComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.TextBoxControl, FormComponents.AdminTextInputComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.DropDownListControl, FormComponents.AdminDropDownComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, FcLongText.TextAreaControl, FormComponents.AdminTextAreaComponent), + new FieldMigration(KsFieldDataType.LongText, FieldDataType.LongText, SfcDirective.CatchAnyNonMatching, FormComponents.AdminRichTextEditorComponent), + new FieldMigration(KsFieldDataType.Integer, FieldDataType.Integer, SfcDirective.CatchAnyNonMatching, FormComponents.AdminNumberInputComponent), + new FieldMigration(KsFieldDataType.LongInteger, FieldDataType.LongInteger, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear, [TfcDirective.Clear]), //FormComponents.AdminNumberInputComponent), + new FieldMigration(KsFieldDataType.Double, FieldDataType.Double, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear, [TfcDirective.Clear]), // FormComponents.AdminNumberInputComponent), + new FieldMigration(KsFieldDataType.Decimal, FieldDataType.Decimal, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDecimalNumberInputComponent), + new FieldMigration(KsFieldDataType.DateTime, FieldDataType.DateTime, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDateTimeInputComponent), + new FieldMigration(KsFieldDataType.Date, FieldDataType.Date, SfcDirective.CatchAnyNonMatching, FormComponents.AdminDateInputComponent), + new FieldMigration(KsFieldDataType.TimeSpan, FieldDataType.TimeSpan, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent), + new FieldMigration(KsFieldDataType.Boolean, FieldDataType.Boolean, SfcDirective.CatchAnyNonMatching, FormComponents.AdminCheckBoxComponent), + new FieldMigration(KsFieldDataType.DocAttachments, FieldDataType.Assets, SfcDirective.CatchAnyNonMatching, FormComponents.AdminAssetSelectorComponent, [TcaDirective.ConvertToAsset]), + new FieldMigration(KsFieldDataType.File, FieldDataType.Assets, SfcDirective.CatchAnyNonMatching, FormComponents.AdminAssetSelectorComponent, [TcaDirective.ConvertToAsset]), + new FieldMigration(KsFieldDataType.Guid, FieldDataType.LongText, "RelatedDocuments", FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent, [TcaDirective.ConvertToPages]), + new FieldMigration(KsFieldDataType.Guid, FieldDataType.Guid, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear), + new FieldMigration(KsFieldDataType.Binary, FieldDataType.Binary, SfcDirective.CatchAnyNonMatching, TfcDirective.Clear), + new FieldMigration(KsFieldDataType.Xml, FieldDataType.Xml, SfcDirective.CatchAnyNonMatching, FormComponents.AdminNumberWithLabelComponent), + new FieldMigration(KsFieldDataType.DocRelationships, FieldDataType.WebPages, SfcDirective.CatchAnyNonMatching, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent, [TcaDirective.ConvertToPages]), + + new FieldMigration(KsFieldDataType.TimeSpan, FieldDataType.TimeSpan, SfcDirective.CatchAnyNonMatching, FormComponents.AdminTextInputComponent, [TcaDirective.ConvertToPages]), + new FieldMigration(KsFieldDataType.BizFormFile, BizFormUploadFile.DATATYPE_FORMFILE, SfcDirective.CatchAnyNonMatching, FormComponents.MvcFileUploaderComponent, []) + ]; + + public static DataTypeMigrationModel BuiltInModel => new( + BuiltInFieldMigrations, + [ + new FormComponentReplacement(Kx13FormComponents.Kentico_AttachmentSelector, FormComponents.AdminAssetSelectorComponent), + new FormComponentReplacement(Kx13FormComponents.Kentico_PageSelector, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent) + // new(Kx13FormComponents.Kentico_PathSelector, FormComponents.Kentico_Xperience_Admin_Websites_WebPageSelectorComponent) + ], + [] // legacy mode is no more + ); +} diff --git a/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs b/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs index 165c7f6a..26142ab3 100644 --- a/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs +++ b/Migration.Toolkit.KXP.Extensions/LegacyAttachmentHandler.cs @@ -1,101 +1,89 @@ -using System; -using System.IO; -using System.Linq; -using System.Reflection; -using CMS; -using CMS.Core; -using CMS.Base; -using CMS.Base.Routing; -using CMS.Helpers; -using CMS.MediaLibrary; -using CMS.Routing.Web; - -[assembly: RegisterImplementation(typeof(AttachmentsService), typeof(AttachmentsService), Lifestyle = Lifestyle.Transient, Priority = RegistrationPriority.SystemDefault)] -[assembly: RegisterModule(typeof(LegacyAttachmentHandler))] - -public class LegacyAttachmentHandler : CMS.DataEngine.Module -{ - public LegacyAttachmentHandler() - : base("LegacyAttachmentHandler.Handler") - { - } - - /// - /// Handles the module pre-initialization. - /// - protected override void OnPreInit() - { - base.OnPreInit(); - RegisterMediaFileHandler("getimage/{fileguid:guid}/{filename}", 4); - RegisterMediaFileHandler("getattachment/{fileguid:guid}/{filename}", 5); - RegisterMediaFileHandler("getattachment/{*pathandfilename}", 6, typeof(AttachmentsService)); - } - - private static void RegisterMediaFileHandler(string routeTemplate, int order, Type customHandlerType = null) - { - var registerMethod = HttpHandlerRouteTable.Default.GetType().GetMethod("Register", BindingFlags.NonPublic | BindingFlags.Instance); - var handlerType = customHandlerType ?? typeof(MediaFileInfo).Assembly.GetType("CMS.MediaLibrary.GetMediaService"); - - registerMethod.Invoke(HttpHandlerRouteTable.Default, new object[] - { - new RegisterHttpHandlerAttribute(routeTemplate, handlerType) - { - Order = order - } - }); - } -} - -public class AttachmentsService : ActionResultServiceBase -{ - private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; - - protected override RequestStatusEnum RequestStatusEnum => RequestStatusEnum.GetFileHandler; - - protected override CMSActionResult GetActionResultInternal() - { - var pathAndFileName = QueryHelper.GetString("pathandfilename", null); - if (pathAndFileName != null) - { - pathAndFileName = pathAndFileName.TrimEnd('/'); - var dir = System.IO.Path.GetDirectoryName(pathAndFileName)?.Replace("\\", "/"); - var fileName = System.IO.Path.GetFileNameWithoutExtension(pathAndFileName); - - var mediaFiles = MediaFileInfoProvider.ProviderObject.Get() - .Columns( - nameof(MediaFileInfo.FileID), nameof(MediaFileInfo.FilePath), nameof(MediaFileInfo.FileCustomData), - nameof(MediaFileInfo.FileLibraryID), nameof(MediaFileInfo.FileName), nameof(MediaFileInfo.FileMimeType) - ) - .WhereEquals(nameof(MediaFileInfo.FileName), fileName) - .WhereStartsWith(nameof(MediaFileInfo.FilePath), $"{dir}") - .ToArray(); - - MediaFileInfo mediaFile; - if (mediaFiles.Length > 1) - { - var narrowedByOriginalPath = mediaFiles - .Where(mf => mf.FileCustomData.GetValue(LEGACY_ORIGINAL_PATH)?.ToString() - ?.Equals($"/{dir}", StringComparison.InvariantCultureIgnoreCase) == true) - .ToArray(); - - mediaFile = narrowedByOriginalPath.Length > 1 - ? null - : narrowedByOriginalPath.FirstOrDefault(); - } - else - { - mediaFile = mediaFiles.FirstOrDefault(); - } - - var mediaPath = MediaFileInfoProvider.GetMediaFilePath(mediaFile.FilePath, mediaFile.FileLibraryID, SystemContext.WebApplicationPhysicalPath); - var result = new CMSPhysicalFileResult(mediaPath) - { - ContentType = mediaFile.FileMimeType, - ContentDisposition = HTTPHelper.GetFileDisposition(mediaPath, System.IO.Path.GetExtension(mediaPath)) - }; - return result; - } - - return new CMSNotFoundResult(); - } -} \ No newline at end of file +using System.Reflection; + +using CMS; +using CMS.Base; +using CMS.Base.Routing; +using CMS.Core; +using CMS.Helpers; +using CMS.MediaLibrary; +using CMS.Routing.Web; + +[assembly: RegisterImplementation(typeof(AttachmentsService), typeof(AttachmentsService), Lifestyle = Lifestyle.Transient, Priority = RegistrationPriority.SystemDefault)] +[assembly: RegisterModule(typeof(LegacyAttachmentHandler))] + +public class LegacyAttachmentHandler : CMS.DataEngine.Module +{ + public LegacyAttachmentHandler() + : base("LegacyAttachmentHandler.Handler") + { + } + + /// + /// Handles the module pre-initialization. + /// + protected override void OnPreInit() + { + base.OnPreInit(); + RegisterMediaFileHandler("getimage/{fileguid:guid}/{filename}", 4); + RegisterMediaFileHandler("getattachment/{fileguid:guid}/{filename}", 5); + RegisterMediaFileHandler("getattachment/{*pathandfilename}", 6, typeof(AttachmentsService)); + } + + private static void RegisterMediaFileHandler(string routeTemplate, int order, Type customHandlerType = null) + { + var registerMethod = HttpHandlerRouteTable.Default.GetType().GetMethod("Register", BindingFlags.NonPublic | BindingFlags.Instance); + var handlerType = customHandlerType ?? typeof(MediaFileInfo).Assembly.GetType("CMS.MediaLibrary.GetMediaService"); + + registerMethod.Invoke(HttpHandlerRouteTable.Default, new object[] { new RegisterHttpHandlerAttribute(routeTemplate, handlerType) { Order = order } }); + } +} + +public class AttachmentsService : ActionResultServiceBase +{ + private const string LEGACY_ORIGINAL_PATH = "__LegacyOriginalPath"; + + protected override RequestStatusEnum RequestStatusEnum => RequestStatusEnum.GetFileHandler; + + protected override CMSActionResult GetActionResultInternal() + { + string pathAndFileName = QueryHelper.GetString("pathandfilename", null); + if (pathAndFileName != null) + { + pathAndFileName = pathAndFileName.TrimEnd('/'); + string dir = System.IO.Path.GetDirectoryName(pathAndFileName)?.Replace("\\", "/"); + string fileName = System.IO.Path.GetFileNameWithoutExtension(pathAndFileName); + + var mediaFiles = MediaFileInfoProvider.ProviderObject.Get() + .Columns( + nameof(MediaFileInfo.FileID), nameof(MediaFileInfo.FilePath), nameof(MediaFileInfo.FileCustomData), + nameof(MediaFileInfo.FileLibraryID), nameof(MediaFileInfo.FileName), nameof(MediaFileInfo.FileMimeType) + ) + .WhereEquals(nameof(MediaFileInfo.FileName), fileName) + .WhereStartsWith(nameof(MediaFileInfo.FilePath), $"{dir}") + .ToArray(); + + MediaFileInfo mediaFile; + if (mediaFiles.Length > 1) + { + var narrowedByOriginalPath = mediaFiles + .Where(mf => mf.FileCustomData.GetValue(LEGACY_ORIGINAL_PATH)?.ToString() + ?.Equals($"/{dir}", StringComparison.InvariantCultureIgnoreCase) == true) + .ToArray(); + + mediaFile = narrowedByOriginalPath.Length > 1 + ? null + : narrowedByOriginalPath.FirstOrDefault(); + } + else + { + mediaFile = mediaFiles.FirstOrDefault(); + } + + string mediaPath = MediaFileInfoProvider.GetMediaFilePath(mediaFile.FilePath, mediaFile.FileLibraryID, SystemContext.WebApplicationPhysicalPath); + var result = new CMSPhysicalFileResult(mediaPath) { ContentType = mediaFile.FileMimeType, ContentDisposition = HTTPHelper.GetFileDisposition(mediaPath, System.IO.Path.GetExtension(mediaPath)) }; + return result; + } + + return new CMSNotFoundResult(); + } +} diff --git a/Migration.Toolkit.KXP.Extensions/Migration.Toolkit.KXP.Extensions.csproj b/Migration.Toolkit.KXP.Extensions/Migration.Toolkit.KXP.Extensions.csproj index a150f68e..06f22952 100644 --- a/Migration.Toolkit.KXP.Extensions/Migration.Toolkit.KXP.Extensions.csproj +++ b/Migration.Toolkit.KXP.Extensions/Migration.Toolkit.KXP.Extensions.csproj @@ -1,16 +1,16 @@ - + enable disable - - - - + + + + diff --git a/Migration.Toolkit.KXP.Extensions/README.MD b/Migration.Toolkit.KXP.Extensions/README.MD index c91e2056..72dc362b 100644 --- a/Migration.Toolkit.KXP.Extensions/README.MD +++ b/Migration.Toolkit.KXP.Extensions/README.MD @@ -1,30 +1,39 @@ ## Handler for legacy attachment URLs -Page attachments are not supported in Xperience by Kentico. Instead, the [Migration toolkit](/README.md) transfers attachment files into [media libraries](https://docs.xperience.io/x/agKiCQ). +Page attachments are not supported in Xperience by Kentico. Instead, the [Migration toolkit](/README.md) transfers +attachment files into [media libraries](https://docs.xperience.io/x/agKiCQ). -Any attachment files in the content of pages migrated from the source instance (KX13/K12) still use the old attachment handler URLs and will no longer work (return 404 errors). For example, this can include images and file download links. If you wish to continue using these legacy attachment URLs, you need to [add a custom handler](#add-the-handler-to-your-project) to your Xperience by Kentico project. +Any attachment files in the content of pages migrated from the source instance (KX13/K12) still use the old attachment +handler URLs and will no longer work (return 404 errors). For example, this can include images and file download links. +If you wish to continue using these legacy attachment URLs, you need +to [add a custom handler](#add-the-handler-to-your-project) to your Xperience by Kentico project. ### Prerequisite -To ensure that the handler provided in the `LegacyAttachmentHandler.cs` file works correctly, you need to [migrate](/Migration.Toolkit.CLI/README.md) your page attachments into a media library, and **keep the default folder structure and file names**. +To ensure that the handler provided in the `LegacyAttachmentHandler.cs` file works correctly, you need +to [migrate](/Migration.Toolkit.CLI/README.md) your page attachments into a media library, and **keep the default folder +structure and file names**. ### Attachment URLs in content The `LegacyAttachmentHandler.cs` handler can serve the following legacy attachment URLs: * `/getimage/[AttachmentGUID]/[AttachmentName].[AttachmentExtension]` - * Example: `/getimage/454BD7D7-200F-4976-AD21-8B5D70CBE7FD/image.jpg` -* `/getattachment/[NodeAliasPath]/[AttachmentName].[AttachmentExtension]` - * Example: `/getattachment/news/article1/image.jpg` + * Example: `/getimage/454BD7D7-200F-4976-AD21-8B5D70CBE7FD/image.jpg` +* `/getattachment/[NodeAliasPath]/[AttachmentName].[AttachmentExtension]` + * Example: `/getattachment/news/article1/image.jpg` * `/getattachment/[AttachmentGUID]/[AttachmentName].[AttachmentExtension]` - * Example: `/getattachment/454BD7D7-200F-4976-AD21-8B5D70CBE7FD/image.jpg` + * Example: `/getattachment/454BD7D7-200F-4976-AD21-8B5D70CBE7FD/image.jpg` ### Add the handler to your project - 1. Open your Xperience by Kentico solution in Visual Studio. - 2. Add a custom assembly (_Class Library_ project) to your solution or re-use an existing one. See the [Integrate custom code](https://docs.xperience.io/x/QoXWCQ) documentation for details. - 3. Copy the `[Migration toolkit repository]\Migration.Toolkit.KXP.Extensions\LegacyAttachmentHandler.cs` file into your custom class library. - 4. Change the default `Migration.Toolkit.KXP.Extensions` namespace in the class's code to fit your project and company. - 5. Rebuild your Xperience by Kentico solution. - -The handler now processes legacy attachment URLs in your website's migrated content and returns matching media library files. +1. Open your Xperience by Kentico solution in Visual Studio. +2. Add a custom assembly (_Class Library_ project) to your solution or re-use an existing one. See + the [Integrate custom code](https://docs.xperience.io/x/QoXWCQ) documentation for details. +3. Copy the `[Migration toolkit repository]\Migration.Toolkit.KXP.Extensions\LegacyAttachmentHandler.cs` file into your + custom class library. +4. Change the default `Migration.Toolkit.KXP.Extensions` namespace in the class's code to fit your project and company. +5. Rebuild your Xperience by Kentico solution. + +The handler now processes legacy attachment URLs in your website's migrated content and returns matching media library +files. diff --git a/Migration.Toolkit.KXP/Context/KxpContext.cs b/Migration.Toolkit.KXP/Context/KxpContext.cs index 96732613..ff85bc8e 100644 --- a/Migration.Toolkit.KXP/Context/KxpContext.cs +++ b/Migration.Toolkit.KXP/Context/KxpContext.cs @@ -1,1323 +1,1270 @@ -using System; -using System.Collections.Generic; -using Microsoft.EntityFrameworkCore; -using Migration.Toolkit.KXP.Models; - -namespace Migration.Toolkit.KXP.Context; - -public partial class KxpContext : DbContext -{ - public KxpContext() - { - } - - public KxpContext(DbContextOptions options) - : base(options) - { - } - - public virtual DbSet CdMigrations { get; set; } - - public virtual DbSet CiFileMetadata { get; set; } - - public virtual DbSet CiMigrations { get; set; } - - public virtual DbSet CmsAlternativeForms { get; set; } - - public virtual DbSet CmsApplicationPermissions { get; set; } - - public virtual DbSet CmsAutomationHistories { get; set; } - - public virtual DbSet CmsAutomationStates { get; set; } - - public virtual DbSet CmsAutomationTemplates { get; set; } - - public virtual DbSet CmsChannels { get; set; } - - public virtual DbSet CmsClasses { get; set; } - - public virtual DbSet CmsConsents { get; set; } - - public virtual DbSet CmsConsentAgreements { get; set; } - - public virtual DbSet CmsConsentArchives { get; set; } - - public virtual DbSet CmsContentFolders { get; set; } - - public virtual DbSet CmsContentItems { get; set; } - - public virtual DbSet CmsContentItemCommonData { get; set; } - - public virtual DbSet CmsContentItemLanguageMetadata { get; set; } - - public virtual DbSet CmsContentItemReferences { get; set; } - - public virtual DbSet CmsContentItemTags { get; set; } - - public virtual DbSet CmsContentLanguages { get; set; } - - public virtual DbSet CmsContentTypeChannels { get; set; } - - public virtual DbSet CmsContentWorkflows { get; set; } - - public virtual DbSet CmsContentWorkflowContentTypes { get; set; } - - public virtual DbSet CmsContentWorkflowSteps { get; set; } - - public virtual DbSet CmsContentWorkflowStepRoles { get; set; } - - public virtual DbSet CmsCountries { get; set; } - - public virtual DbSet CmsCultures { get; set; } - - public virtual DbSet CmsEmails { get; set; } - - public virtual DbSet CmsEmailAttachments { get; set; } - - public virtual DbSet CmsEventLogs { get; set; } - - public virtual DbSet CmsExternalLogins { get; set; } - - public virtual DbSet CmsForms { get; set; } - - public virtual DbSet CmsFormFeaturedFields { get; set; } - - public virtual DbSet CmsHeadlessChannels { get; set; } - - public virtual DbSet CmsHeadlessItems { get; set; } - - public virtual DbSet CmsHeadlessTokens { get; set; } - - public virtual DbSet CmsLicenseKeys { get; set; } - - public virtual DbSet CmsMacroIdentities { get; set; } - - public virtual DbSet CmsMacroRules { get; set; } - - public virtual DbSet CmsMacroRuleCategories { get; set; } - - public virtual DbSet CmsMacroRuleMacroRuleCategories { get; set; } - - public virtual DbSet CmsMembers { get; set; } - - public virtual DbSet CmsMemberExternalLogins { get; set; } - - public virtual DbSet CmsObjectWorkflowTriggers { get; set; } - - public virtual DbSet CmsPageTemplateConfigurations { get; set; } - - public virtual DbSet CmsQueries { get; set; } - - public virtual DbSet CmsResources { get; set; } - - public virtual DbSet CmsResourceStrings { get; set; } - - public virtual DbSet CmsResourceTranslations { get; set; } - - public virtual DbSet CmsRoles { get; set; } - - public virtual DbSet CmsScheduledTasks { get; set; } - - public virtual DbSet CmsSettingsCategories { get; set; } - - public virtual DbSet CmsSettingsKeys { get; set; } - - public virtual DbSet CmsStates { get; set; } - - public virtual DbSet CmsTags { get; set; } - - public virtual DbSet CmsTaxonomies { get; set; } - - public virtual DbSet CmsUsers { get; set; } - - public virtual DbSet CmsUserMacroIdentities { get; set; } - - public virtual DbSet CmsUserRoles { get; set; } - - public virtual DbSet CmsWebFarmServers { get; set; } - - public virtual DbSet CmsWebFarmServerLogs { get; set; } - - public virtual DbSet CmsWebFarmServerMonitorings { get; set; } - - public virtual DbSet CmsWebFarmServerTasks { get; set; } - - public virtual DbSet CmsWebFarmTasks { get; set; } - - public virtual DbSet CmsWebPageFormerUrlPaths { get; set; } - - public virtual DbSet CmsWebPageItems { get; set; } - - public virtual DbSet CmsWebPageUrlPaths { get; set; } - - public virtual DbSet CmsWebsiteCaptchaSettings { get; set; } - - public virtual DbSet CmsWebsiteChannels { get; set; } - - public virtual DbSet CmsWorkflows { get; set; } - - public virtual DbSet CmsWorkflowActions { get; set; } - - public virtual DbSet CmsWorkflowSteps { get; set; } - - public virtual DbSet CmsWorkflowTransitions { get; set; } - - public virtual DbSet EmailLibraryEmailBounces { get; set; } - - public virtual DbSet EmailLibraryEmailChannels { get; set; } - - public virtual DbSet EmailLibraryEmailChannelSenders { get; set; } - - public virtual DbSet EmailLibraryEmailConfigurations { get; set; } - - public virtual DbSet EmailLibraryEmailLinks { get; set; } - - public virtual DbSet EmailLibraryEmailMarketingRecipients { get; set; } - - public virtual DbSet EmailLibraryEmailStatistics { get; set; } - - public virtual DbSet EmailLibraryEmailStatisticsHits { get; set; } - - public virtual DbSet EmailLibraryEmailSubscriptionConfirmations { get; set; } - - public virtual DbSet EmailLibraryEmailTemplates { get; set; } - - public virtual DbSet EmailLibraryEmailTemplateContentTypes { get; set; } - - public virtual DbSet EmailLibraryRecipientListSettings { get; set; } - - public virtual DbSet EmailLibrarySendConfigurations { get; set; } - - public virtual DbSet MediaFiles { get; set; } - - public virtual DbSet MediaLibraries { get; set; } - - public virtual DbSet OmAccounts { get; set; } - - public virtual DbSet OmAccountContacts { get; set; } - - public virtual DbSet OmAccountStatuses { get; set; } - - public virtual DbSet OmActivities { get; set; } - - public virtual DbSet OmActivityRecalculationQueues { get; set; } - - public virtual DbSet OmActivityTypes { get; set; } - - public virtual DbSet OmContacts { get; set; } - - public virtual DbSet OmContactChangeRecalculationQueues { get; set; } - - public virtual DbSet OmContactGroups { get; set; } - - public virtual DbSet OmContactGroupMembers { get; set; } - - public virtual DbSet OmContactRoles { get; set; } - - public virtual DbSet OmContactStatuses { get; set; } - - public virtual DbSet OmTrackedWebsites { get; set; } - - public virtual DbSet OmVisitorToContacts { get; set; } - - public virtual DbSet TempFiles { get; set; } - - public virtual DbSet TempPageBuilderWidgets { get; set; } - - public virtual DbSet ViewCmsResourceStringJoineds { get; set; } - - public virtual DbSet ViewCmsResourceTranslatedJoineds { get; set; } - - public virtual DbSet ViewOmAccountContactAccountJoineds { get; set; } - - public virtual DbSet ViewOmAccountContactContactJoineds { get; set; } - - public virtual DbSet ViewOmAccountJoineds { get; set; } - - public virtual DbSet ViewOmContactGroupMemberAccountJoineds { get; set; } - - protected override void OnModelCreating(ModelBuilder modelBuilder) - { - modelBuilder.Entity(entity => - { - entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.FileLocation).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.FormName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FormClass).WithMany(p => p.CmsAlternativeFormFormClasses) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AlternativeForm_FormClassID_CMS_Class"); - - entity.HasOne(d => d.FormCoupledClass).WithMany(p => p.CmsAlternativeFormFormCoupledClasses).HasConstraintName("FK_CMS_AlternativeForm_FormCoupledClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ApplicationName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PermissionName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.Role).WithMany(p => p.CmsApplicationPermissions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ApplicationPermission_RoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HistoryRejected).HasDefaultValueSql("((0))"); - entity.Property(e => e.HistoryStepDisplayName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.HistoryApprovedByUser).WithMany(p => p.CmsAutomationHistories).HasConstraintName("FK_CMS_AutomationHistory_HistoryApprovedByUserID"); - - entity.HasOne(d => d.HistoryState).WithMany(p => p.CmsAutomationHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationHistory_HistoryStateID"); - - entity.HasOne(d => d.HistoryStep).WithMany(p => p.CmsAutomationHistoryHistorySteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryStepID"); - - entity.HasOne(d => d.HistoryTargetStep).WithMany(p => p.CmsAutomationHistoryHistoryTargetSteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryTargetStepID"); - - entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsAutomationHistories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationHistory_HistoryWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.StateStep).WithMany(p => p.CmsAutomationStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationState_StateStepID"); - - entity.HasOne(d => d.StateUser).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateUserID_CMS_User"); - - entity.HasOne(d => d.StateWorkflow).WithMany(p => p.CmsAutomationStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AutomationState_StateWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TemplateDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TemplateLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ChannelDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ChannelName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ChannelType).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ClassId).IsClustered(false); - - entity.HasIndex(e => new { e.ClassId, e.ClassName, e.ClassDisplayName }, "IX_CMS_Class_ClassID_ClassName_ClassDisplayName").IsClustered(); - - entity.HasIndex(e => e.ClassShortName, "IX_CMS_Class_ClassShortName") - .IsUnique() - .HasFilter("([ClassShortName] IS NOT NULL)"); - - entity.Property(e => e.ClassType).HasDefaultValueSql("('Other')"); - - entity.HasOne(d => d.ClassResource).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ConsentName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentAgreementTime).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ConsentAgreementConsent).WithMany(p => p.CmsConsentAgreements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementConsentID_CMS_Consent"); - - entity.HasOne(d => d.ConsentAgreementContact).WithMany(p => p.CmsConsentAgreements) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementContactID_OM_Contact"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ConsentArchiveContent).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentArchiveHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ConsentArchiveLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ConsentArchiveConsent).WithMany(p => p.CmsConsentArchives) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ConsentArchive_ConsentArchiveConsentID_CMS_Consent"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContentFolderCreatedWhen).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ContentFolderDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ContentFolderModifiedWhen).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ContentFolderName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ContentFolderCreatedByUser).WithMany(p => p.CmsContentFolderContentFolderCreatedByUsers).HasConstraintName("FK_CMS_ContentFolder_ContentFolderCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.ContentFolderModifiedByUser).WithMany(p => p.CmsContentFolderContentFolderModifiedByUsers).HasConstraintName("FK_CMS_ContentFolder_ContentFolderModifiedByUserID_CMS_User"); - - entity.HasOne(d => d.ContentFolderParentFolder).WithMany(p => p.InverseContentFolderParentFolder).HasConstraintName("FK_CMS_ContentFolder_ContentFolderParentFolderID_CMS_ContentFolder"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.ContentItemChannelId, "IX_CMS_ContentItem_ContentItemChannelID").HasFilter("([ContentItemChannelID] IS NOT NULL)"); - - entity.Property(e => e.ContentItemName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ContentItemChannel).WithMany(p => p.CmsContentItems).HasConstraintName("FK_CMS_ContentItem_ContentItemChannelID"); - - entity.HasOne(d => d.ContentItemContentFolder).WithMany(p => p.CmsContentItems).HasConstraintName("FK_CMS_ContentItem_ContentItemContentFolderID_CMS_ContentFolder"); - - entity.HasOne(d => d.ContentItemContentType).WithMany(p => p.CmsContentItems).HasConstraintName("FK_CMS_ContentItem_ContentItemContentTypeID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContentItemCommonDataContentItem).WithMany(p => p.CmsContentItemCommonData) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentItemCommonData_ContentItemCommonDataContentItemID_CMS_ContentItem"); - - entity.HasOne(d => d.ContentItemCommonDataContentLanguage).WithMany(p => p.CmsContentItemCommonData) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentItemCommonData_ContentItemCommonDataContentLanguageID_CMS_ContentLanguage"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContentItemLanguageMetadataCreatedWhen).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ContentItemLanguageMetadataDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ContentItemLanguageMetadataModifiedWhen).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.ContentItemLanguageMetadataContentItem).WithMany(p => p.CmsContentItemLanguageMetadata) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataContentItemID_CMS_ContentItem"); - - entity.HasOne(d => d.ContentItemLanguageMetadataContentLanguage).WithMany(p => p.CmsContentItemLanguageMetadata) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataContentLanguageID_CMS_ContentLanguage"); - - entity.HasOne(d => d.ContentItemLanguageMetadataContentWorkflowStep).WithMany(p => p.CmsContentItemLanguageMetadata).HasConstraintName("FK_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataContentWorkflowStepID_CMS_ContentWorkflowStep"); - - entity.HasOne(d => d.ContentItemLanguageMetadataCreatedByUser).WithMany(p => p.CmsContentItemLanguageMetadatumContentItemLanguageMetadataCreatedByUsers).HasConstraintName("FK_CMS_ContentItemLanguageMetadata_CMS_ContentItemLanguageMetadataCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.ContentItemLanguageMetadataModifiedByUser).WithMany(p => p.CmsContentItemLanguageMetadatumContentItemLanguageMetadataModifiedByUsers).HasConstraintName("FK_CMS_ContentItemLanguageMetadata_CMS_ContentItemLanguageMetadataModifiedByUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContentItemReferenceSourceCommonData).WithMany(p => p.CmsContentItemReferences) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentItemReference_ContentItemReferenceSourceCommonDataID_CMS_ContentItemCommonData"); - - entity.HasOne(d => d.ContentItemReferenceTargetItem).WithMany(p => p.CmsContentItemReferences) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentItemReference_ContentItemReferenceTargetItemID_CMS_ContentItem"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContentItemTagContentItemLanguageMetadata).WithMany(p => p.CmsContentItemTags) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentItemTag_ContentItemTagContentItemLanguageMetadataID_CMS_ContentItemLanguageMetadata"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContentLanguageCultureFormat).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ContentLanguageDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ContentLanguageName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContentTypeChannelChannel).WithMany(p => p.CmsContentTypeChannels) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentTypeChannel_ContentTypeChannelChannelID_CMS_Channel"); - - entity.HasOne(d => d.ContentTypeChannelContentType).WithMany(p => p.CmsContentTypeChannels) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentTypeChannel_ContentTypeChannelConentTypeID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContentWorkflowDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ContentWorkflowLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ContentWorkflowName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContentWorkflowContentTypeContentType).WithMany(p => p.CmsContentWorkflowContentTypes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentTypeID_CMS_Class"); - - entity.HasOne(d => d.ContentWorkflowContentTypeContentWorkflow).WithMany(p => p.CmsContentWorkflowContentTypes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentWorkflowID_CMS_ContentWorkflow"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContentWorkflowStepDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ContentWorkflowStepIconClass).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ContentWorkflowStepLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.ContentWorkflowStepName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.ContentWorkflowStepWorkflow).WithMany(p => p.CmsContentWorkflowSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentWorkflowStep_ContentWorkflowStepWorkflowID_CMS_ContentWorkflow"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ContentWorkflowStepRoleContentWorkflowStep).WithMany(p => p.CmsContentWorkflowStepRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleContentWorkflowStepID_CMS_ContentWorkflowStep"); - - entity.HasOne(d => d.ContentWorkflowStepRoleRole).WithMany(p => p.CmsContentWorkflowStepRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleRoleID_CMS_Role"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CountryId).IsClustered(false); - - entity.HasIndex(e => e.CountryDisplayName, "IX_CMS_Country_CountryDisplayName").IsClustered(); - - entity.Property(e => e.CountryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CountryLastModified).HasDefaultValueSql("('11/14/2013 1:43:04 PM')"); - entity.Property(e => e.CountryName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CultureId).IsClustered(false); - - entity.HasIndex(e => e.CultureName, "IX_CMS_Culture_CultureName").IsClustered(); - - entity.Property(e => e.CultureIsUiculture).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailFrom).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailSubject).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.EmailEmailConfiguration).WithMany(p => p.CmsEmails).HasConstraintName("FK_CMS_Email_EmailEmailConfigurationID_EmailLibrary_EmailConfiguration"); - - entity.HasMany(d => d.Attachments).WithMany(p => p.Emails) - .UsingEntity>( - "CmsAttachmentForEmail", - r => r.HasOne().WithMany() - .HasForeignKey("AttachmentId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentForEmail_AttachmentID_CMS_EmailAttachment"), - l => l.HasOne().WithMany() - .HasForeignKey("EmailId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_AttachmentForEmail_EmailID_CMS_Email"), - j => - { - j.HasKey("EmailId", "AttachmentId"); - j.ToTable("CMS_AttachmentForEmail"); - j.HasIndex(new[] { "AttachmentId" }, "IX_CMS_AttachmentForEmail_AttachmentID"); - j.IndexerProperty("EmailId").HasColumnName("EmailID"); - j.IndexerProperty("AttachmentId").HasColumnName("AttachmentID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EventCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventMachineName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventTime).HasDefaultValueSql("('4/21/2015 8:21:43 AM')"); - entity.Property(e => e.EventType).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventUrl).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EventUrlReferrer).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Ipaddress).HasDefaultValueSql("(N'')"); - entity.Property(e => e.Source).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.IdentityKey).HasDefaultValueSql("(N'')"); - entity.Property(e => e.LoginProvider).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsExternalLogins) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ExternalLogin_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.FormId).IsClustered(false); - - entity.HasIndex(e => e.FormDisplayName, "IX_CMS_Form_FormDisplayName").IsClustered(); - - entity.Property(e => e.FormDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormLastModified).HasDefaultValueSql("('9/17/2012 1:37:08 PM')"); - entity.Property(e => e.FormLogActivity).HasDefaultValueSql("((1))"); - entity.Property(e => e.FormName).HasDefaultValueSql("('')"); - entity.Property(e => e.FormSubmitButtonText).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.FormClass).WithMany(p => p.CmsForms) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Form_FormClassID_CMS_Class"); - - entity.HasMany(d => d.Roles).WithMany(p => p.Forms) - .UsingEntity>( - "CmsFormRole", - r => r.HasOne().WithMany() - .HasForeignKey("RoleId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_FormRole_RoleID_CMS_Role"), - l => l.HasOne().WithMany() - .HasForeignKey("FormId") - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_FormRole_FormID_CMS_Form"), - j => - { - j.HasKey("FormId", "RoleId"); - j.ToTable("CMS_FormRole"); - j.HasIndex(new[] { "RoleId" }, "IX_CMS_FormRole_RoleID"); - j.IndexerProperty("FormId").HasColumnName("FormID"); - j.IndexerProperty("RoleId").HasColumnName("RoleID"); - }); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FormFeaturedFieldEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.FormFeaturedFieldMapping).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.HeadlessChannelChannel).WithMany(p => p.CmsHeadlessChannels) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_HeadlessChannel_HeadlessChannelChannelID_CMS_Channel"); - - entity.HasOne(d => d.HeadlessChannelPrimaryContentLanguage).WithMany(p => p.CmsHeadlessChannels) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_HeadlessChannel_HeadlessChannelPrimaryContentLanguageID_CMS_ContentLanguage"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HeadlessItemName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.HeadlessItemContentItem).WithMany(p => p.CmsHeadlessItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_HeadlessItem_HeadlessItemContentItemID_CMS_ContentItem"); - - entity.HasOne(d => d.HeadlessItemHeadlessChannel).WithMany(p => p.CmsHeadlessItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_HeadlessItem_HeadlessItemHeadlessChannelID_CMS_HeadlessChannel"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.HeadlessTokenAccessType).HasDefaultValueSql("(N'Published')"); - entity.Property(e => e.HeadlessTokenCreatedWhen).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.HeadlessTokenDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.HeadlessTokenEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.HeadlessTokenHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.HeadlessTokenModifiedWhen).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.HeadlessTokenCreatedByUser).WithMany(p => p.CmsHeadlessTokenHeadlessTokenCreatedByUsers).HasConstraintName("FK_CMS_HeadlessToken_HeadlessTokenCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.HeadlessTokenHeadlessChannel).WithMany(p => p.CmsHeadlessTokens) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_HeadlessToken_HeadlessTokenHeadlessChannelID_CMS_HeadlessChannel"); - - entity.HasOne(d => d.HeadlessTokenModifiedByUser).WithMany(p => p.CmsHeadlessTokenHeadlessTokenModifiedByUsers).HasConstraintName("FK_CMS_HeadlessToken_HeadlessTokenModifiedByUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.LicenseKeyId).IsClustered(false); - - entity.HasIndex(e => e.LicenseDomain, "IX_CMS_LicenseKey_LicenseDomain").IsClustered(); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.MacroIdentityName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.MacroIdentityEffectiveUser).WithMany(p => p.CmsMacroIdentities).HasConstraintName("FK_CMS_MacroIdentity_MacroIdentityEffectiveUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MacroRuleCondition).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MacroRuleDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.MacroRuleEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.MacroRuleIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.MacroRuleLastModified).HasDefaultValueSql("('5/1/2012 8:46:33 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.MacroRuleCategory).WithMany(p => p.CmsMacroRuleMacroRuleCategories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MacroRuleMacroRuleCategory_MacroRuleCategoryID_CMS_MacroRuleMacroRuleCategory"); - - entity.HasOne(d => d.MacroRule).WithMany(p => p.CmsMacroRuleMacroRuleCategories) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_MacroRuleMacroRuleCategory_MacroRuleID_CMS_MacroRule"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.MemberEmail, "IX_CMS_Member_MemberEmail") - .IsUnique() - .HasFilter("([MemberEmail] IS NOT NULL AND [MemberEmail]<>'')"); - - entity.HasIndex(e => e.MemberName, "IX_CMS_Member_MemberName") - .IsUnique() - .HasFilter("([MemberName] IS NOT NULL AND [MemberName]<>'')"); - - entity.Property(e => e.MemberCreated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.MemberExternalLoginIdentityKey).HasDefaultValueSql("(N'')"); - entity.Property(e => e.MemberExternalLoginLoginProvider).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TriggerDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.TriggerObjectType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.TriggerWorkflow).WithMany(p => p.CmsObjectWorkflowTriggers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ObjectWorkflowTrigger_TriggerWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PageTemplateConfigurationIcon).HasDefaultValueSql("(N'xp-layout')"); - entity.Property(e => e.PageTemplateConfigurationLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.PageTemplateConfigurationName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.PageTemplateConfigurationTemplate).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.QueryIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.QueryName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.Class).WithMany(p => p.CmsQueries).HasConstraintName("FK_CMS_Query_ClassID_CMS_Class"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ResourceId).IsClustered(false); - - entity.HasIndex(e => e.ResourceDisplayName, "IX_CMS_Resource_ResourceDisplayName").IsClustered(); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TranslationCulture).WithMany(p => p.CmsResourceTranslations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceTranslation_TranslationCultureID_CMS_Culture"); - - entity.HasOne(d => d.TranslationString).WithMany(p => p.CmsResourceTranslations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_ResourceTranslation_TranslationStringID_CMS_ResourceString"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskExecutingServerName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TaskInterval).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.TaskUser).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.CategoryId).IsClustered(false); - - entity.HasIndex(e => e.CategoryOrder, "IX_CMS_SettingsCategory_CategoryOrder").IsClustered(); - - entity.Property(e => e.CategoryDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.CategoryIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.CategoryIsGroup).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_SettingsCategory_CMS_SettingsCategory1"); - - entity.HasOne(d => d.CategoryResource).WithMany(p => p.CmsSettingsCategories).HasConstraintName("FK_CMS_SettingsCategory_CategoryResourceID_CMS_Resource"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.KeyDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.KeyExplanationText).HasDefaultValueSql("(N'')"); - entity.Property(e => e.KeyIsCustom).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyIsHidden).HasDefaultValueSql("((0))"); - entity.Property(e => e.KeyName).HasDefaultValueSql("('')"); - entity.Property(e => e.KeyType).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.KeyCategory).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_KeyCategoryID_CMS_SettingsCategory"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.StateId).IsClustered(false); - - entity.HasIndex(e => e.StateDisplayName, "IX_CMS_State_CountryID_StateDisplayName").IsClustered(); - - entity.Property(e => e.StateDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.StateName).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.Country).WithMany(p => p.CmsStates) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_State_CountryID_CMS_Country"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TagLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.TagName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TagTitle).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.TagParent).WithMany(p => p.InverseTagParent).HasConstraintName("FK_CMS_Tag_TagParentID_CMS_Tag"); - - entity.HasOne(d => d.TagTaxonomy).WithMany(p => p.CmsTags) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_Tag_TagTaxonomyID_CMS_Taxonomy"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaxonomyLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.TaxonomyName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TaxonomyTitle).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasIndex(e => e.Email, "IX_CMS_User_Email") - .IsUnique() - .HasFilter("([Email] IS NOT NULL AND [Email]<>'')"); - - entity.Property(e => e.UserName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.UserPassword).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.UserMacroIdentityLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.UserMacroIdentityMacroIdentity).WithMany(p => p.CmsUserMacroIdentities).HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID_CMS_MacroIdentity"); - - entity.HasOne(d => d.UserMacroIdentityUser).WithOne(p => p.CmsUserMacroIdentity) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Role).WithMany(p => p.CmsUserRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserRole_RoleID_CMS_Role"); - - entity.HasOne(d => d.User).WithMany(p => p.CmsUserRoles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_UserRole_UserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ServerDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.ServerLastModified).HasDefaultValueSql("('9/17/2013 12:18:06 PM')"); - entity.Property(e => e.ServerName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.LogCode).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Server).WithMany(p => p.CmsWebFarmServerTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer"); - - entity.HasOne(d => d.Task).WithMany(p => p.CmsWebFarmServerTasks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebFarmServerTask_TaskID_CMS_WebFarmTask"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TaskGuid).HasDefaultValueSql("('00000000-0000-0000-0000-000000000000')"); - entity.Property(e => e.TaskIsMemory).HasDefaultValueSql("((0))"); - entity.Property(e => e.TaskType).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.WebPageFormerUrlPath).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPageFormerUrlPathHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPageFormerUrlPathLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.WebPageFormerUrlPathContentLanguage).WithMany(p => p.CmsWebPageFormerUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathContentLanguageID_CMS_ContentLanguage"); - - entity.HasOne(d => d.WebPageFormerUrlPathWebPageItem).WithMany(p => p.CmsWebPageFormerUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathWebPageItemID_CMS_WebPageItem"); - - entity.HasOne(d => d.WebPageFormerUrlPathWebsiteChannel).WithMany(p => p.CmsWebPageFormerUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathWebsiteChannelID_CMS_WebsiteChannel"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.WebPageItemName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPageItemTreePath).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.WebPageItemContentItem).WithMany(p => p.CmsWebPageItems).HasConstraintName("FK_CMS_WebPageItem_WebPageItemContentItemID_CMS_ContentItem"); - - entity.HasOne(d => d.WebPageItemParent).WithMany(p => p.InverseWebPageItemParent).HasConstraintName("FK_CMS_WebPageItem_WebPageItemParentID_CMS_WebPageItem"); - - entity.HasOne(d => d.WebPageItemWebsiteChannel).WithMany(p => p.CmsWebPageItems) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPageItem_WebPageItemWebsiteChannelID_CMS_WebsiteChannel"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.WebPageUrlPath).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPageUrlPathHash).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebPageUrlPathIsLatest).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.WebPageUrlPathContentLanguage).WithMany(p => p.CmsWebPageUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPageUrlPath_WebPageUrlPathContentLanguageID_CMS_ContentLanguage"); - - entity.HasOne(d => d.WebPageUrlPathWebPageItem).WithMany(p => p.CmsWebPageUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPageUrlPath_WebPageUrlPathWebPageItemID_CMS_WebPageItem"); - - entity.HasOne(d => d.WebPageUrlPathWebsiteChannel).WithMany(p => p.CmsWebPageUrlPaths) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebPageUrlPath_WebPageUrlPathWebsiteChannelID_CMS_WebsiteChannel"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.WebsiteCaptchaSettingsReCaptchaSecretKey).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebsiteCaptchaSettingsReCaptchaSiteKey).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.WebsiteChannelDefaultCookieLevel).HasDefaultValueSql("((1000))"); - entity.Property(e => e.WebsiteChannelDomain).HasDefaultValueSql("(N'')"); - entity.Property(e => e.WebsiteChannelStoreFormerUrls).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.WebsiteChannelChannel).WithMany(p => p.CmsWebsiteChannels) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebsiteChannel_WebsiteChannelChannelID_CMS_Channel"); - - entity.HasOne(d => d.WebsiteChannelPrimaryContentLanguage).WithMany(p => p.CmsWebsiteChannels) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WebsiteChannel_WebsiteChannelPrimaryContentLanguageID_CMS_ContentLanguage"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.WorkflowId).IsClustered(false); - - entity.HasIndex(e => e.WorkflowDisplayName, "IX_CMS_Workflow_WorkflowDisplayName").IsClustered(); - - entity.Property(e => e.WorkflowAutoPublishChanges).HasDefaultValueSql("((0))"); - entity.Property(e => e.WorkflowDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.WorkflowEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowName).HasDefaultValueSql("('')"); - entity.Property(e => e.WorkflowSendApproveEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendArchiveEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendPublishEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendReadyForApprovalEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowSendRejectEmails).HasDefaultValueSql("((1))"); - entity.Property(e => e.WorkflowUseCheckinCheckout).HasDefaultValueSql("((0))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ActionEnabled).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.ActionResource).WithMany(p => p.CmsWorkflowActions).HasConstraintName("FK_CMS_WorkflowAction_ActionResourceID"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.StepAllowPublish).HasDefaultValueSql("((0))"); - entity.Property(e => e.StepAllowReject).HasDefaultValueSql("((1))"); - - entity.HasOne(d => d.StepAction).WithMany(p => p.CmsWorkflowSteps).HasConstraintName("FK_CMS_WorkflowStep_StepActionID"); - - entity.HasOne(d => d.StepWorkflow).WithMany(p => p.CmsWorkflowSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowStep_StepWorkflowID"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.TransitionEndStep).WithMany(p => p.CmsWorkflowTransitionTransitionEndSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionEndStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TransitionStartStep).WithMany(p => p.CmsWorkflowTransitionTransitionStartSteps) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionStartStepID_CMS_WorkflowStep"); - - entity.HasOne(d => d.TransitionWorkflow).WithMany(p => p.CmsWorkflowTransitions) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_CMS_WorkflowTransition_TransitionWorkflowID_CMS_Workflow"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailChannelSendingDomain).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailChannelServiceDomain).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailChannelChannel).WithMany(p => p.EmailLibraryEmailChannels) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailChannel_EmailChannelChannelID_CMS_Channel"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailChannelSenderCreated).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.EmailChannelSenderDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailChannelSenderName).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailChannelSenderEmailChannel).WithMany(p => p.EmailLibraryEmailChannelSenders) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailChannelSender_EmailChannelSenderEmailChannelID_EmailLibrary_EmailChannel"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailConfigurationLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.EmailConfigurationName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailConfigurationPurpose).HasDefaultValueSql("(N'Regular')"); - - entity.HasOne(d => d.EmailConfigurationContentItem).WithMany(p => p.EmailLibraryEmailConfigurations).HasConstraintName("FK_EmailLibrary_EmailConfiguration_EmailConfigurationContentItemID_CMS_ContentItem"); - - entity.HasOne(d => d.EmailConfigurationEmailChannel).WithMany(p => p.EmailLibraryEmailConfigurations).HasConstraintName("FK_EmailLibrary_EmailConfiguration_EmailConfigurationEmailChannelID_EmailLibrary_EmailChannel"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailLinkDescription).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailLinkTarget).HasDefaultValueSql("(N'')"); - - entity.HasOne(d => d.EmailLinkEmailConfiguration).WithMany(p => p.EmailLibraryEmailLinks) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailLink_EmailLinkEmailConfigurationID_EmailLibrary_EmailConfiguration"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailMarketingRecipientContactEmail).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailMarketingRecipientLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.EmailMarketingRecipientContact).WithMany(p => p.EmailLibraryEmailMarketingRecipients) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientContactID_OM_Contact"); - - entity.HasOne(d => d.EmailMarketingRecipientEmailConfiguration).WithMany(p => p.EmailLibraryEmailMarketingRecipients) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientEmailConfigurationID_EmailLibrary_EmailConfiguration"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.EmailStatisticsEmailConfiguration).WithMany(p => p.EmailLibraryEmailStatistics) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailStatistics_EmailStatisticsEmailConfigurationID_EmailLibrary_EmailConfiguration"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailStatisticsHitsTime).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.EmailStatisticsHitsEmailConfiguration).WithMany(p => p.EmailLibraryEmailStatisticsHits) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailConfigurationID_EmailLibrary_EmailConfiguration"); - - entity.HasOne(d => d.EmailStatisticsHitsEmailLink).WithMany(p => p.EmailLibraryEmailStatisticsHits).HasConstraintName("FK_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailLinkID_EmailLibrary_EmailLink"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailSubscriptionConfirmationDate).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - - entity.HasOne(d => d.EmailSubscriptionConfirmationContact).WithMany(p => p.EmailLibraryEmailSubscriptionConfirmations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationContactID_OM_Contact"); - - entity.HasOne(d => d.EmailSubscriptionConfirmationRecipientList).WithMany(p => p.EmailLibraryEmailSubscriptionConfirmations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationRecipientListID_OM_ContactGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.EmailTemplateCode).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailTemplateDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.EmailTemplateLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - entity.Property(e => e.EmailTemplateName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.EmailTemplateContentTypeContentType).WithMany(p => p.EmailLibraryEmailTemplateContentTypes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeContentTypeID_CMS_Class"); - - entity.HasOne(d => d.EmailTemplateContentTypeEmailTemplate).WithMany(p => p.EmailLibraryEmailTemplateContentTypes) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeEmailTemplateID_EmailLibrary_EmailTemplate"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.RecipientListSettingsRecipientList).WithMany(p => p.EmailLibraryRecipientListSettings) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_RecipientListSettings_RecipientListSettingsRecipientListID_OM_ContactGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.SendConfigurationEmailConfiguration).WithOne(p => p.EmailLibrarySendConfiguration) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_SendConfiguration_SendConfigurationEmailConfigurationID_EmailLibrary_EmailConfiguration"); - - entity.HasOne(d => d.SendConfigurationRecipientList).WithMany(p => p.EmailLibrarySendConfigurations) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_EmailLibrary_SendConfiguration_SendConfigurationRecipientListID_OM_ContactGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.FileId).IsClustered(false); - - entity.HasIndex(e => e.FilePath, "IX_Media_File_FilePath").IsClustered(); - - entity.Property(e => e.FileCreatedWhen).HasDefaultValueSql("('11/11/2008 4:10:00 PM')"); - entity.Property(e => e.FileModifiedWhen).HasDefaultValueSql("('11/11/2008 4:11:15 PM')"); - entity.Property(e => e.FileTitle).HasDefaultValueSql("('')"); - - entity.HasOne(d => d.FileCreatedByUser).WithMany(p => p.MediaFileFileCreatedByUsers).HasConstraintName("FK_Media_File_FileCreatedByUserID_CMS_User"); - - entity.HasOne(d => d.FileLibrary).WithMany(p => p.MediaFiles) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_Media_File_FileLibraryID_Media_Library"); - - entity.HasOne(d => d.FileModifiedByUser).WithMany(p => p.MediaFileFileModifiedByUsers).HasConstraintName("FK_Media_File_FileModifiedByUserID_CMS_User"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.LibraryId).IsClustered(false); - - entity.HasIndex(e => e.LibraryDisplayName, "IX_Media_Library_LibraryDisplayName").IsClustered(); - - entity.Property(e => e.LibraryName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.AccountCountry).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_Country"); - - entity.HasOne(d => d.AccountOwnerUser).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_User"); - - entity.HasOne(d => d.AccountPrimaryContact).WithMany(p => p.OmAccountAccountPrimaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_PrimaryContact"); - - entity.HasOne(d => d.AccountSecondaryContact).WithMany(p => p.OmAccountAccountSecondaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_SecondaryContact"); - - entity.HasOne(d => d.AccountState).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_State"); - - entity.HasOne(d => d.AccountStatus).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_OM_AccountStatus"); - - entity.HasOne(d => d.AccountSubsidiaryOf).WithMany(p => p.InverseAccountSubsidiaryOf).HasConstraintName("FK_OM_Account_OM_Account_SubsidiaryOf"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.Account).WithMany(p => p.OmAccountContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_AccountContact_OM_Account"); - - entity.HasOne(d => d.Contact).WithMany(p => p.OmAccountContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_AccountContact_OM_Contact"); - - entity.HasOne(d => d.ContactRole).WithMany(p => p.OmAccountContacts).HasConstraintName("FK_OM_AccountContact_OM_ContactRole"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.ActivityChannel).WithMany(p => p.OmActivities).HasConstraintName("FK_OM_Activity_ActivityChannelID_CMS_Channel"); - - entity.HasOne(d => d.ActivityLanguage).WithMany(p => p.OmActivities).HasConstraintName("FK_OM_Activity_ActivityLanguageID_CMS_ContentLanguage"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ActivityTypeEnabled).HasDefaultValueSql("((1))"); - entity.Property(e => e.ActivityTypeIsCustom).HasDefaultValueSql("((1))"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactCreated).HasDefaultValueSql("('5/3/2011 10:51:13 AM')"); - entity.Property(e => e.ContactMonitored).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactSalesForceLeadReplicationDisabled).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactSalesForceLeadReplicationRequired).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ContactCountry).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_Country"); - - entity.HasOne(d => d.ContactOwnerUser).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_User"); - - entity.HasOne(d => d.ContactState).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_State"); - - entity.HasOne(d => d.ContactStatus).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_OM_ContactStatus"); - }); - - modelBuilder.Entity(entity => - { - entity.HasKey(e => e.ContactGroupId).HasName("PK_CMS_ContactGroup"); - - entity.Property(e => e.ContactGroupIsRecipientList).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactGroupName).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactGroupMemberFromCondition).HasDefaultValueSql("((0))"); - entity.Property(e => e.ContactGroupMemberFromManual).HasDefaultValueSql("((0))"); - - entity.HasOne(d => d.ContactGroupMemberContactGroup).WithMany(p => p.OmContactGroupMembers) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_ContactGroupMembers_OM_ContactGroup"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactRoleDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContactRoleName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.ContactStatusDisplayName).HasDefaultValueSql("('')"); - entity.Property(e => e.ContactStatusName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.TrackedWebsiteDisplayName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TrackedWebsiteEnabled).HasDefaultValueSql("((0))"); - entity.Property(e => e.TrackedWebsiteName).HasDefaultValueSql("(N'')"); - entity.Property(e => e.TrackedWebsiteUrl).HasDefaultValueSql("(N'')"); - }); - - modelBuilder.Entity(entity => - { - entity.HasOne(d => d.VisitorToContactContact).WithMany(p => p.OmVisitorToContacts) - .OnDelete(DeleteBehavior.ClientSetNull) - .HasConstraintName("FK_OM_VisitorToContact_OM_Contact_Cascade"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.FileDirectory).HasDefaultValueSql("('')"); - entity.Property(e => e.FileExtension).HasDefaultValueSql("('')"); - entity.Property(e => e.FileLastModified).HasDefaultValueSql("('6/29/2010 1:57:54 PM')"); - entity.Property(e => e.FileMimeType).HasDefaultValueSql("('')"); - entity.Property(e => e.FileName).HasDefaultValueSql("('')"); - }); - - modelBuilder.Entity(entity => - { - entity.Property(e => e.PageBuilderWidgetsLastModified).HasDefaultValueSql("('1/1/0001 12:00:00 AM')"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ResourceString_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_CMS_ResourceTranslated_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_AccountContact_AccountJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_AccountContact_ContactJoined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_Account_Joined"); - }); - - modelBuilder.Entity(entity => - { - entity.ToView("View_OM_ContactGroupMember_AccountJoined"); - }); - - OnModelCreatingPartial(modelBuilder); - } - - partial void OnModelCreatingPartial(ModelBuilder modelBuilder); -} \ No newline at end of file +using Microsoft.EntityFrameworkCore; + +using Migration.Toolkit.KXP.Models; + +namespace Migration.Toolkit.KXP.Context; + +public partial class KxpContext : DbContext +{ + public KxpContext() + { + } + + public KxpContext(DbContextOptions options) + : base(options) + { + } + + public virtual DbSet CdMigrations { get; set; } + + public virtual DbSet CiFileMetadata { get; set; } + + public virtual DbSet CiMigrations { get; set; } + + public virtual DbSet CmsAlternativeForms { get; set; } + + public virtual DbSet CmsApplicationPermissions { get; set; } + + public virtual DbSet CmsAutomationHistories { get; set; } + + public virtual DbSet CmsAutomationStates { get; set; } + + public virtual DbSet CmsAutomationTemplates { get; set; } + + public virtual DbSet CmsChannels { get; set; } + + public virtual DbSet CmsClasses { get; set; } + + public virtual DbSet CmsConsents { get; set; } + + public virtual DbSet CmsConsentAgreements { get; set; } + + public virtual DbSet CmsConsentArchives { get; set; } + + public virtual DbSet CmsContentFolders { get; set; } + + public virtual DbSet CmsContentItems { get; set; } + + public virtual DbSet CmsContentItemCommonData { get; set; } + + public virtual DbSet CmsContentItemLanguageMetadata { get; set; } + + public virtual DbSet CmsContentItemReferences { get; set; } + + public virtual DbSet CmsContentItemTags { get; set; } + + public virtual DbSet CmsContentLanguages { get; set; } + + public virtual DbSet CmsContentTypeChannels { get; set; } + + public virtual DbSet CmsContentWorkflows { get; set; } + + public virtual DbSet CmsContentWorkflowContentTypes { get; set; } + + public virtual DbSet CmsContentWorkflowSteps { get; set; } + + public virtual DbSet CmsContentWorkflowStepRoles { get; set; } + + public virtual DbSet CmsCountries { get; set; } + + public virtual DbSet CmsCultures { get; set; } + + public virtual DbSet CmsEmails { get; set; } + + public virtual DbSet CmsEmailAttachments { get; set; } + + public virtual DbSet CmsEventLogs { get; set; } + + public virtual DbSet CmsExternalLogins { get; set; } + + public virtual DbSet CmsForms { get; set; } + + public virtual DbSet CmsFormFeaturedFields { get; set; } + + public virtual DbSet CmsHeadlessChannels { get; set; } + + public virtual DbSet CmsHeadlessItems { get; set; } + + public virtual DbSet CmsHeadlessTokens { get; set; } + + public virtual DbSet CmsLicenseKeys { get; set; } + + public virtual DbSet CmsMacroIdentities { get; set; } + + public virtual DbSet CmsMacroRules { get; set; } + + public virtual DbSet CmsMacroRuleCategories { get; set; } + + public virtual DbSet CmsMacroRuleMacroRuleCategories { get; set; } + + public virtual DbSet CmsMembers { get; set; } + + public virtual DbSet CmsMemberExternalLogins { get; set; } + + public virtual DbSet CmsObjectWorkflowTriggers { get; set; } + + public virtual DbSet CmsPageTemplateConfigurations { get; set; } + + public virtual DbSet CmsQueries { get; set; } + + public virtual DbSet CmsResources { get; set; } + + public virtual DbSet CmsResourceStrings { get; set; } + + public virtual DbSet CmsResourceTranslations { get; set; } + + public virtual DbSet CmsRoles { get; set; } + + public virtual DbSet CmsScheduledTasks { get; set; } + + public virtual DbSet CmsSettingsCategories { get; set; } + + public virtual DbSet CmsSettingsKeys { get; set; } + + public virtual DbSet CmsSmartFolders { get; set; } + + public virtual DbSet CmsStates { get; set; } + + public virtual DbSet CmsTags { get; set; } + + public virtual DbSet CmsTaxonomies { get; set; } + + public virtual DbSet CmsUsers { get; set; } + + public virtual DbSet CmsUserMacroIdentities { get; set; } + + public virtual DbSet CmsUserRoles { get; set; } + + public virtual DbSet CmsWebFarmServers { get; set; } + + public virtual DbSet CmsWebFarmServerLogs { get; set; } + + public virtual DbSet CmsWebFarmServerMonitorings { get; set; } + + public virtual DbSet CmsWebFarmServerTasks { get; set; } + + public virtual DbSet CmsWebFarmTasks { get; set; } + + public virtual DbSet CmsWebPageFormerUrlPaths { get; set; } + + public virtual DbSet CmsWebPageItems { get; set; } + + public virtual DbSet CmsWebPageUrlPaths { get; set; } + + public virtual DbSet CmsWebsiteCaptchaSettings { get; set; } + + public virtual DbSet CmsWebsiteChannels { get; set; } + + public virtual DbSet CmsWorkflows { get; set; } + + public virtual DbSet CmsWorkflowActions { get; set; } + + public virtual DbSet CmsWorkflowSteps { get; set; } + + public virtual DbSet CmsWorkflowTransitions { get; set; } + + public virtual DbSet EmailLibraryEmailBounces { get; set; } + + public virtual DbSet EmailLibraryEmailChannels { get; set; } + + public virtual DbSet EmailLibraryEmailChannelSenders { get; set; } + + public virtual DbSet EmailLibraryEmailConfigurations { get; set; } + + public virtual DbSet EmailLibraryEmailLinks { get; set; } + + public virtual DbSet EmailLibraryEmailMarketingRecipients { get; set; } + + public virtual DbSet EmailLibraryEmailStatistics { get; set; } + + public virtual DbSet EmailLibraryEmailStatisticsHits { get; set; } + + public virtual DbSet EmailLibraryEmailSubscriptionConfirmations { get; set; } + + public virtual DbSet EmailLibraryEmailTemplates { get; set; } + + public virtual DbSet EmailLibraryEmailTemplateContentTypes { get; set; } + + public virtual DbSet EmailLibraryRecipientListSettings { get; set; } + + public virtual DbSet EmailLibrarySendConfigurations { get; set; } + + public virtual DbSet MediaFiles { get; set; } + + public virtual DbSet MediaLibraries { get; set; } + + public virtual DbSet OmAccounts { get; set; } + + public virtual DbSet OmAccountContacts { get; set; } + + public virtual DbSet OmAccountStatuses { get; set; } + + public virtual DbSet OmActivities { get; set; } + + public virtual DbSet OmActivityRecalculationQueues { get; set; } + + public virtual DbSet OmActivityTypes { get; set; } + + public virtual DbSet OmContacts { get; set; } + + public virtual DbSet OmContactChangeRecalculationQueues { get; set; } + + public virtual DbSet OmContactGroups { get; set; } + + public virtual DbSet OmContactGroupMembers { get; set; } + + public virtual DbSet OmContactRoles { get; set; } + + public virtual DbSet OmContactStatuses { get; set; } + + public virtual DbSet OmTrackedWebsites { get; set; } + + public virtual DbSet OmVisitorToContacts { get; set; } + + public virtual DbSet TempFiles { get; set; } + + public virtual DbSet TempPageBuilderWidgets { get; set; } + + public virtual DbSet ViewCmsResourceStringJoineds { get; set; } + + public virtual DbSet ViewCmsResourceTranslatedJoineds { get; set; } + + public virtual DbSet ViewOmAccountContactAccountJoineds { get; set; } + + public virtual DbSet ViewOmAccountContactContactJoineds { get; set; } + + public virtual DbSet ViewOmAccountJoineds { get; set; } + + public virtual DbSet ViewOmContactGroupMemberAccountJoineds { get; set; } + + protected override void OnModelCreating(ModelBuilder modelBuilder) + { + modelBuilder.Entity(entity => + { + entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())"); + entity.Property(e => e.RowsAffected).HasDefaultValueSql("(NULL)"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FileHash).HasDefaultValue(""); + entity.Property(e => e.FileLocation).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.DateApplied).HasDefaultValueSql("(sysdatetime())"); + entity.Property(e => e.RowsAffected).HasDefaultValueSql("(NULL)"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormDisplayName).HasDefaultValue(""); + entity.Property(e => e.FormIsCustom).HasDefaultValue(false); + entity.Property(e => e.FormName).HasDefaultValue(""); + + entity.HasOne(d => d.FormClass).WithMany(p => p.CmsAlternativeFormFormClasses) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AlternativeForm_FormClassID_CMS_Class"); + + entity.HasOne(d => d.FormCoupledClass).WithMany(p => p.CmsAlternativeFormFormCoupledClasses).HasConstraintName("FK_CMS_AlternativeForm_FormCoupledClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ApplicationName).HasDefaultValue(""); + entity.Property(e => e.PermissionName).HasDefaultValue(""); + + entity.HasOne(d => d.Role).WithMany(p => p.CmsApplicationPermissions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ApplicationPermission_RoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HistoryRejected).HasDefaultValue(false); + entity.Property(e => e.HistoryStepDisplayName).HasDefaultValue(""); + + entity.HasOne(d => d.HistoryApprovedByUser).WithMany(p => p.CmsAutomationHistories).HasConstraintName("FK_CMS_AutomationHistory_HistoryApprovedByUserID"); + + entity.HasOne(d => d.HistoryState).WithMany(p => p.CmsAutomationHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationHistory_HistoryStateID"); + + entity.HasOne(d => d.HistoryStep).WithMany(p => p.CmsAutomationHistoryHistorySteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryStepID"); + + entity.HasOne(d => d.HistoryTargetStep).WithMany(p => p.CmsAutomationHistoryHistoryTargetSteps).HasConstraintName("FK_CMS_AutomationHistory_HistoryTargetStepID"); + + entity.HasOne(d => d.HistoryWorkflow).WithMany(p => p.CmsAutomationHistories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationHistory_HistoryWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.StateStep).WithMany(p => p.CmsAutomationStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationState_StateStepID"); + + entity.HasOne(d => d.StateUser).WithMany(p => p.CmsAutomationStates).HasConstraintName("FK_CMS_AutomationState_StateUserID_CMS_User"); + + entity.HasOne(d => d.StateWorkflow).WithMany(p => p.CmsAutomationStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AutomationState_StateWorkflowID"); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.TemplateDisplayName).HasDefaultValue("")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ChannelDisplayName).HasDefaultValue(""); + entity.Property(e => e.ChannelName).HasDefaultValue(""); + entity.Property(e => e.ChannelSize).HasDefaultValue("Standard"); + entity.Property(e => e.ChannelType).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ClassId).IsClustered(false); + + entity.HasIndex(e => new { e.ClassId, e.ClassName, e.ClassDisplayName }, "IX_CMS_Class_ClassID_ClassName_ClassDisplayName").IsClustered(); + + entity.HasIndex(e => e.ClassShortName, "IX_CMS_Class_ClassShortName") + .IsUnique() + .HasFilter("([ClassShortName] IS NOT NULL)"); + + entity.Property(e => e.ClassType).HasDefaultValue("Other"); + + entity.HasOne(d => d.ClassResource).WithMany(p => p.CmsClasses).HasConstraintName("FK_CMS_Class_ClassResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentContent).HasDefaultValue(""); + entity.Property(e => e.ConsentDisplayName).HasDefaultValue(""); + entity.Property(e => e.ConsentHash).HasDefaultValue(""); + entity.Property(e => e.ConsentName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ConsentAgreementConsent).WithMany(p => p.CmsConsentAgreements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementConsentID_CMS_Consent"); + + entity.HasOne(d => d.ConsentAgreementContact).WithMany(p => p.CmsConsentAgreements) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentAgreement_ConsentAgreementContactID_OM_Contact"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ConsentArchiveContent).HasDefaultValue(""); + entity.Property(e => e.ConsentArchiveHash).HasDefaultValue(""); + + entity.HasOne(d => d.ConsentArchiveConsent).WithMany(p => p.CmsConsentArchives) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ConsentArchive_ConsentArchiveConsentID_CMS_Consent"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContentFolderDisplayName).HasDefaultValue(""); + entity.Property(e => e.ContentFolderName).HasDefaultValue(""); + + entity.HasOne(d => d.ContentFolderCreatedByUser).WithMany(p => p.CmsContentFolderContentFolderCreatedByUsers).HasConstraintName("FK_CMS_ContentFolder_ContentFolderCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.ContentFolderModifiedByUser).WithMany(p => p.CmsContentFolderContentFolderModifiedByUsers).HasConstraintName("FK_CMS_ContentFolder_ContentFolderModifiedByUserID_CMS_User"); + + entity.HasOne(d => d.ContentFolderParentFolder).WithMany(p => p.InverseContentFolderParentFolder).HasConstraintName("FK_CMS_ContentFolder_ContentFolderParentFolderID_CMS_ContentFolder"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.ContentItemChannelId, "IX_CMS_ContentItem_ContentItemChannelID").HasFilter("([ContentItemChannelID] IS NOT NULL)"); + + entity.Property(e => e.ContentItemName).HasDefaultValue(""); + + entity.HasOne(d => d.ContentItemChannel).WithMany(p => p.CmsContentItems).HasConstraintName("FK_CMS_ContentItem_ContentItemChannelID"); + + entity.HasOne(d => d.ContentItemContentFolder).WithMany(p => p.CmsContentItems).HasConstraintName("FK_CMS_ContentItem_ContentItemContentFolderID_CMS_ContentFolder"); + + entity.HasOne(d => d.ContentItemContentType).WithMany(p => p.CmsContentItems).HasConstraintName("FK_CMS_ContentItem_ContentItemContentTypeID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ContentItemCommonDataContentItem).WithMany(p => p.CmsContentItemCommonData) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentItemCommonData_ContentItemCommonDataContentItemID_CMS_ContentItem"); + + entity.HasOne(d => d.ContentItemCommonDataContentLanguage).WithMany(p => p.CmsContentItemCommonData) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentItemCommonData_ContentItemCommonDataContentLanguageID_CMS_ContentLanguage"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContentItemLanguageMetadataDisplayName).HasDefaultValue(""); + + entity.HasOne(d => d.ContentItemLanguageMetadataContentItem).WithMany(p => p.CmsContentItemLanguageMetadata) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataContentItemID_CMS_ContentItem"); + + entity.HasOne(d => d.ContentItemLanguageMetadataContentLanguage).WithMany(p => p.CmsContentItemLanguageMetadata) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataContentLanguageID_CMS_ContentLanguage"); + + entity.HasOne(d => d.ContentItemLanguageMetadataContentWorkflowStep).WithMany(p => p.CmsContentItemLanguageMetadata) + .HasConstraintName("FK_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataContentWorkflowStepID_CMS_ContentWorkflowStep"); + + entity.HasOne(d => d.ContentItemLanguageMetadataCreatedByUser).WithMany(p => p.CmsContentItemLanguageMetadatumContentItemLanguageMetadataCreatedByUsers) + .HasConstraintName("FK_CMS_ContentItemLanguageMetadata_CMS_ContentItemLanguageMetadataCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.ContentItemLanguageMetadataModifiedByUser).WithMany(p => p.CmsContentItemLanguageMetadatumContentItemLanguageMetadataModifiedByUsers) + .HasConstraintName("FK_CMS_ContentItemLanguageMetadata_CMS_ContentItemLanguageMetadataModifiedByUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ContentItemReferenceSourceCommonData).WithMany(p => p.CmsContentItemReferences) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentItemReference_ContentItemReferenceSourceCommonDataID_CMS_ContentItemCommonData"); + + entity.HasOne(d => d.ContentItemReferenceTargetItem).WithMany(p => p.CmsContentItemReferences) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentItemReference_ContentItemReferenceTargetItemID_CMS_ContentItem"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.ContentItemTagContentItemLanguageMetadata).WithMany(p => p.CmsContentItemTags) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentItemTag_ContentItemTagContentItemLanguageMetadataID_CMS_ContentItemLanguageMetadata")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContentLanguageCultureFormat).HasDefaultValue(""); + entity.Property(e => e.ContentLanguageDisplayName).HasDefaultValue(""); + entity.Property(e => e.ContentLanguageName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ContentTypeChannelChannel).WithMany(p => p.CmsContentTypeChannels) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentTypeChannel_ContentTypeChannelChannelID_CMS_Channel"); + + entity.HasOne(d => d.ContentTypeChannelContentType).WithMany(p => p.CmsContentTypeChannels) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentTypeChannel_ContentTypeChannelConentTypeID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContentWorkflowDisplayName).HasDefaultValue(""); + entity.Property(e => e.ContentWorkflowName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ContentWorkflowContentTypeContentType).WithMany(p => p.CmsContentWorkflowContentTypes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentTypeID_CMS_Class"); + + entity.HasOne(d => d.ContentWorkflowContentTypeContentWorkflow).WithMany(p => p.CmsContentWorkflowContentTypes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentWorkflowID_CMS_ContentWorkflow"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContentWorkflowStepDisplayName).HasDefaultValue(""); + entity.Property(e => e.ContentWorkflowStepIconClass).HasDefaultValue(""); + entity.Property(e => e.ContentWorkflowStepName).HasDefaultValue(""); + + entity.HasOne(d => d.ContentWorkflowStepWorkflow).WithMany(p => p.CmsContentWorkflowSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentWorkflowStep_ContentWorkflowStepWorkflowID_CMS_ContentWorkflow"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ContentWorkflowStepRoleContentWorkflowStep).WithMany(p => p.CmsContentWorkflowStepRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleContentWorkflowStepID_CMS_ContentWorkflowStep"); + + entity.HasOne(d => d.ContentWorkflowStepRoleRole).WithMany(p => p.CmsContentWorkflowStepRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleRoleID_CMS_Role"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CountryId).IsClustered(false); + + entity.HasIndex(e => e.CountryDisplayName, "IX_CMS_Country_CountryDisplayName").IsClustered(); + + entity.Property(e => e.CountryDisplayName).HasDefaultValue(""); + entity.Property(e => e.CountryLastModified).HasDefaultValueSql("('11/14/2013 1:43:04 PM')"); + entity.Property(e => e.CountryName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CultureId).IsClustered(false); + + entity.HasIndex(e => e.CultureName, "IX_CMS_Culture_CultureName").IsClustered(); + + entity.Property(e => e.CultureIsUiculture).HasDefaultValue(false); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailFrom).HasDefaultValue(""); + entity.Property(e => e.EmailSubject).HasDefaultValue(""); + + entity.HasOne(d => d.EmailEmailConfiguration).WithMany(p => p.CmsEmails).HasConstraintName("FK_CMS_Email_EmailEmailConfigurationID_EmailLibrary_EmailConfiguration"); + + entity.HasMany(d => d.Attachments).WithMany(p => p.Emails) + .UsingEntity>( + "CmsAttachmentForEmail", + r => r.HasOne().WithMany() + .HasForeignKey("AttachmentId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentForEmail_AttachmentID_CMS_EmailAttachment"), + l => l.HasOne().WithMany() + .HasForeignKey("EmailId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_AttachmentForEmail_EmailID_CMS_Email"), + j => + { + j.HasKey("EmailId", "AttachmentId"); + j.ToTable("CMS_AttachmentForEmail"); + j.HasIndex(new[] { "AttachmentId" }, "IX_CMS_AttachmentForEmail_AttachmentID"); + j.IndexerProperty("EmailId").HasColumnName("EmailID"); + j.IndexerProperty("AttachmentId").HasColumnName("AttachmentID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EventCode).HasDefaultValue(""); + entity.Property(e => e.EventMachineName).HasDefaultValue(""); + entity.Property(e => e.EventTime).HasDefaultValueSql("('4/21/2015 8:21:43 AM')"); + entity.Property(e => e.EventType).HasDefaultValue(""); + entity.Property(e => e.EventUrl).HasDefaultValue(""); + entity.Property(e => e.EventUrlReferrer).HasDefaultValue(""); + entity.Property(e => e.Ipaddress).HasDefaultValue(""); + entity.Property(e => e.Source).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.IdentityKey).HasDefaultValue(""); + entity.Property(e => e.LoginProvider).HasDefaultValue(""); + + entity.HasOne(d => d.User).WithMany(p => p.CmsExternalLogins) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ExternalLogin_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FormId).IsClustered(false); + + entity.HasIndex(e => e.FormDisplayName, "IX_CMS_Form_FormDisplayName").IsClustered(); + + entity.Property(e => e.FormDisplayName).HasDefaultValue(""); + entity.Property(e => e.FormLastModified).HasDefaultValueSql("('9/17/2012 1:37:08 PM')"); + entity.Property(e => e.FormLogActivity).HasDefaultValue(true); + entity.Property(e => e.FormName).HasDefaultValue(""); + entity.Property(e => e.FormSubmitButtonText).HasDefaultValue(""); + + entity.HasOne(d => d.FormClass).WithMany(p => p.CmsForms) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Form_FormClassID_CMS_Class"); + + entity.HasMany(d => d.Roles).WithMany(p => p.Forms) + .UsingEntity>( + "CmsFormRole", + r => r.HasOne().WithMany() + .HasForeignKey("RoleId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_FormRole_RoleID_CMS_Role"), + l => l.HasOne().WithMany() + .HasForeignKey("FormId") + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_FormRole_FormID_CMS_Form"), + j => + { + j.HasKey("FormId", "RoleId"); + j.ToTable("CMS_FormRole"); + j.HasIndex(new[] { "RoleId" }, "IX_CMS_FormRole_RoleID"); + j.IndexerProperty("FormId").HasColumnName("FormID"); + j.IndexerProperty("RoleId").HasColumnName("RoleID"); + }); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FormFeaturedFieldEnabled).HasDefaultValue(true); + entity.Property(e => e.FormFeaturedFieldMapping).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.HeadlessChannelChannel).WithMany(p => p.CmsHeadlessChannels) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_HeadlessChannel_HeadlessChannelChannelID_CMS_Channel"); + + entity.HasOne(d => d.HeadlessChannelPrimaryContentLanguage).WithMany(p => p.CmsHeadlessChannels) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_HeadlessChannel_HeadlessChannelPrimaryContentLanguageID_CMS_ContentLanguage"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HeadlessItemName).HasDefaultValue(""); + + entity.HasOne(d => d.HeadlessItemContentItem).WithMany(p => p.CmsHeadlessItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_HeadlessItem_HeadlessItemContentItemID_CMS_ContentItem"); + + entity.HasOne(d => d.HeadlessItemHeadlessChannel).WithMany(p => p.CmsHeadlessItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_HeadlessItem_HeadlessItemHeadlessChannelID_CMS_HeadlessChannel"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.HeadlessTokenAccessType).HasDefaultValue("Published"); + entity.Property(e => e.HeadlessTokenDisplayName).HasDefaultValue(""); + entity.Property(e => e.HeadlessTokenEnabled).HasDefaultValue(true); + entity.Property(e => e.HeadlessTokenHash).HasDefaultValue(""); + + entity.HasOne(d => d.HeadlessTokenCreatedByUser).WithMany(p => p.CmsHeadlessTokenHeadlessTokenCreatedByUsers).HasConstraintName("FK_CMS_HeadlessToken_HeadlessTokenCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.HeadlessTokenHeadlessChannel).WithMany(p => p.CmsHeadlessTokens) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_HeadlessToken_HeadlessTokenHeadlessChannelID_CMS_HeadlessChannel"); + + entity.HasOne(d => d.HeadlessTokenModifiedByUser).WithMany(p => p.CmsHeadlessTokenHeadlessTokenModifiedByUsers).HasConstraintName("FK_CMS_HeadlessToken_HeadlessTokenModifiedByUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LicenseKeyId).IsClustered(false); + + entity.HasIndex(e => e.LicenseDomain, "IX_CMS_LicenseKey_LicenseDomain").IsClustered(); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MacroIdentityName).HasDefaultValue(""); + + entity.HasOne(d => d.MacroIdentityEffectiveUser).WithMany(p => p.CmsMacroIdentities).HasConstraintName("FK_CMS_MacroIdentity_MacroIdentityEffectiveUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MacroRuleCondition).HasDefaultValue(""); + entity.Property(e => e.MacroRuleDisplayName).HasDefaultValue(""); + entity.Property(e => e.MacroRuleEnabled).HasDefaultValue(true); + entity.Property(e => e.MacroRuleIsCustom).HasDefaultValue(false); + entity.Property(e => e.MacroRuleLastModified).HasDefaultValue(new DateTime(2012, 1, 5, 8, 46, 33, 0, DateTimeKind.Unspecified)); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.MacroRuleCategory).WithMany(p => p.CmsMacroRuleMacroRuleCategories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MacroRuleMacroRuleCategory_MacroRuleCategoryID_CMS_MacroRuleMacroRuleCategory"); + + entity.HasOne(d => d.MacroRule).WithMany(p => p.CmsMacroRuleMacroRuleCategories) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_MacroRuleMacroRuleCategory_MacroRuleID_CMS_MacroRule"); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.MemberEmail, "IX_CMS_Member_MemberEmail") + .IsUnique() + .HasFilter("([MemberEmail] IS NOT NULL AND [MemberEmail]<>'')"); + + entity.HasIndex(e => e.MemberName, "IX_CMS_Member_MemberName") + .IsUnique() + .HasFilter("([MemberName] IS NOT NULL AND [MemberName]<>'')"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.MemberExternalLoginIdentityKey).HasDefaultValue(""); + entity.Property(e => e.MemberExternalLoginLoginProvider).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TriggerDisplayName).HasDefaultValue(""); + entity.Property(e => e.TriggerObjectType).HasDefaultValue(""); + + entity.HasOne(d => d.TriggerWorkflow).WithMany(p => p.CmsObjectWorkflowTriggers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ObjectWorkflowTrigger_TriggerWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.PageTemplateConfigurationIcon).HasDefaultValue("xp-layout"); + entity.Property(e => e.PageTemplateConfigurationName).HasDefaultValue(""); + entity.Property(e => e.PageTemplateConfigurationTemplate).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.QueryIsCustom).HasDefaultValue(false); + entity.Property(e => e.QueryName).HasDefaultValue(""); + + entity.HasOne(d => d.Class).WithMany(p => p.CmsQueries).HasConstraintName("FK_CMS_Query_ClassID_CMS_Class"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ResourceId).IsClustered(false); + + entity.HasIndex(e => e.ResourceDisplayName, "IX_CMS_Resource_ResourceDisplayName").IsClustered(); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TranslationCulture).WithMany(p => p.CmsResourceTranslations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceTranslation_TranslationCultureID_CMS_Culture"); + + entity.HasOne(d => d.TranslationString).WithMany(p => p.CmsResourceTranslations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_ResourceTranslation_TranslationStringID_CMS_ResourceString"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskExecutingServerName).HasDefaultValue(""); + entity.Property(e => e.TaskInterval).HasDefaultValue(""); + + entity.HasOne(d => d.TaskUser).WithMany(p => p.CmsScheduledTasks).HasConstraintName("FK_CMS_ScheduledTask_TaskUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.CategoryId).IsClustered(false); + + entity.HasIndex(e => e.CategoryOrder, "IX_CMS_SettingsCategory_CategoryOrder").IsClustered(); + + entity.Property(e => e.CategoryDisplayName).HasDefaultValue(""); + entity.Property(e => e.CategoryIsCustom).HasDefaultValue(false); + entity.Property(e => e.CategoryIsGroup).HasDefaultValue(false); + + entity.HasOne(d => d.CategoryParent).WithMany(p => p.InverseCategoryParent).HasConstraintName("FK_CMS_SettingsCategory_CMS_SettingsCategory1"); + + entity.HasOne(d => d.CategoryResource).WithMany(p => p.CmsSettingsCategories).HasConstraintName("FK_CMS_SettingsCategory_CategoryResourceID_CMS_Resource"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.KeyDisplayName).HasDefaultValue(""); + entity.Property(e => e.KeyExplanationText).HasDefaultValue(""); + entity.Property(e => e.KeyIsCustom).HasDefaultValue(false); + entity.Property(e => e.KeyIsHidden).HasDefaultValue(false); + entity.Property(e => e.KeyName).HasDefaultValue(""); + entity.Property(e => e.KeyType).HasDefaultValue(""); + + entity.HasOne(d => d.KeyCategory).WithMany(p => p.CmsSettingsKeys).HasConstraintName("FK_CMS_SettingsKey_KeyCategoryID_CMS_SettingsCategory"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.SmartFolderDisplayName).HasDefaultValue(""); + entity.Property(e => e.SmartFolderFilter).HasDefaultValue(""); + entity.Property(e => e.SmartFolderName).HasDefaultValue(""); + + entity.HasOne(d => d.SmartFolderCreatedByUser).WithMany(p => p.CmsSmartFolderSmartFolderCreatedByUsers).HasConstraintName("FK_CMS_SmartFolder_SmartFolderCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.SmartFolderModifiedByUser).WithMany(p => p.CmsSmartFolderSmartFolderModifiedByUsers).HasConstraintName("FK_CMS_SmartFolder_SmartFolderModifiedByUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.StateId).IsClustered(false); + + entity.HasIndex(e => e.StateDisplayName, "IX_CMS_State_CountryID_StateDisplayName").IsClustered(); + + entity.Property(e => e.StateDisplayName).HasDefaultValue(""); + entity.Property(e => e.StateName).HasDefaultValue(""); + + entity.HasOne(d => d.Country).WithMany(p => p.CmsStates) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_State_CountryID_CMS_Country"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TagName).HasDefaultValue(""); + entity.Property(e => e.TagTitle).HasDefaultValue(""); + + entity.HasOne(d => d.TagParent).WithMany(p => p.InverseTagParent).HasConstraintName("FK_CMS_Tag_TagParentID_CMS_Tag"); + + entity.HasOne(d => d.TagTaxonomy).WithMany(p => p.CmsTags) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_Tag_TagTaxonomyID_CMS_Taxonomy"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaxonomyName).HasDefaultValue(""); + entity.Property(e => e.TaxonomyTitle).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasIndex(e => e.Email, "IX_CMS_User_Email") + .IsUnique() + .HasFilter("([Email] IS NOT NULL AND [Email]<>'')"); + + entity.Property(e => e.UserName).HasDefaultValue(""); + entity.Property(e => e.UserPassword).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.UserMacroIdentityMacroIdentity).WithMany(p => p.CmsUserMacroIdentities).HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID_CMS_MacroIdentity"); + + entity.HasOne(d => d.UserMacroIdentityUser).WithOne(p => p.CmsUserMacroIdentity) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserMacroIdentity_UserMacroIdentityUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Role).WithMany(p => p.CmsUserRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserRole_RoleID_CMS_Role"); + + entity.HasOne(d => d.User).WithMany(p => p.CmsUserRoles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_UserRole_UserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ServerDisplayName).HasDefaultValue(""); + entity.Property(e => e.ServerLastModified).HasDefaultValueSql("('9/17/2013 12:18:06 PM')"); + entity.Property(e => e.ServerName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => entity.Property(e => e.LogCode).HasDefaultValue("")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Server).WithMany(p => p.CmsWebFarmServerTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebFarmServerTask_ServerID_CMS_WebFarmServer"); + + entity.HasOne(d => d.Task).WithMany(p => p.CmsWebFarmServerTasks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebFarmServerTask_TaskID_CMS_WebFarmTask"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TaskGuid).HasDefaultValue(new Guid("00000000-0000-0000-0000-000000000000")); + entity.Property(e => e.TaskIsMemory).HasDefaultValue(false); + entity.Property(e => e.TaskType).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.WebPageFormerUrlPath).HasDefaultValue(""); + entity.Property(e => e.WebPageFormerUrlPathHash).HasDefaultValue(""); + + entity.HasOne(d => d.WebPageFormerUrlPathContentLanguage).WithMany(p => p.CmsWebPageFormerUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathContentLanguageID_CMS_ContentLanguage"); + + entity.HasOne(d => d.WebPageFormerUrlPathWebPageItem).WithMany(p => p.CmsWebPageFormerUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathWebPageItemID_CMS_WebPageItem"); + + entity.HasOne(d => d.WebPageFormerUrlPathWebsiteChannel).WithMany(p => p.CmsWebPageFormerUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathWebsiteChannelID_CMS_WebsiteChannel"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.WebPageItemName).HasDefaultValue(""); + entity.Property(e => e.WebPageItemTreePath).HasDefaultValue(""); + + entity.HasOne(d => d.WebPageItemContentItem).WithMany(p => p.CmsWebPageItems).HasConstraintName("FK_CMS_WebPageItem_WebPageItemContentItemID_CMS_ContentItem"); + + entity.HasOne(d => d.WebPageItemParent).WithMany(p => p.InverseWebPageItemParent).HasConstraintName("FK_CMS_WebPageItem_WebPageItemParentID_CMS_WebPageItem"); + + entity.HasOne(d => d.WebPageItemWebsiteChannel).WithMany(p => p.CmsWebPageItems) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPageItem_WebPageItemWebsiteChannelID_CMS_WebsiteChannel"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.WebPageUrlPath).HasDefaultValue(""); + entity.Property(e => e.WebPageUrlPathHash).HasDefaultValue(""); + entity.Property(e => e.WebPageUrlPathIsLatest).HasDefaultValue(true); + + entity.HasOne(d => d.WebPageUrlPathContentLanguage).WithMany(p => p.CmsWebPageUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPageUrlPath_WebPageUrlPathContentLanguageID_CMS_ContentLanguage"); + + entity.HasOne(d => d.WebPageUrlPathWebPageItem).WithMany(p => p.CmsWebPageUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPageUrlPath_WebPageUrlPathWebPageItemID_CMS_WebPageItem"); + + entity.HasOne(d => d.WebPageUrlPathWebsiteChannel).WithMany(p => p.CmsWebPageUrlPaths) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebPageUrlPath_WebPageUrlPathWebsiteChannelID_CMS_WebsiteChannel"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.WebsiteCaptchaSettingsReCaptchaSecretKey).HasDefaultValue(""); + entity.Property(e => e.WebsiteCaptchaSettingsReCaptchaSiteKey).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.WebsiteChannelDefaultCookieLevel).HasDefaultValue(1000); + entity.Property(e => e.WebsiteChannelDomain).HasDefaultValue(""); + entity.Property(e => e.WebsiteChannelStoreFormerUrls).HasDefaultValue(true); + + entity.HasOne(d => d.WebsiteChannelChannel).WithMany(p => p.CmsWebsiteChannels) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebsiteChannel_WebsiteChannelChannelID_CMS_Channel"); + + entity.HasOne(d => d.WebsiteChannelPrimaryContentLanguage).WithMany(p => p.CmsWebsiteChannels) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WebsiteChannel_WebsiteChannelPrimaryContentLanguageID_CMS_ContentLanguage"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.WorkflowId).IsClustered(false); + + entity.HasIndex(e => e.WorkflowDisplayName, "IX_CMS_Workflow_WorkflowDisplayName").IsClustered(); + + entity.Property(e => e.WorkflowAutoPublishChanges).HasDefaultValue(false); + entity.Property(e => e.WorkflowDisplayName).HasDefaultValue(""); + entity.Property(e => e.WorkflowEnabled).HasDefaultValue(true); + entity.Property(e => e.WorkflowName).HasDefaultValue(""); + entity.Property(e => e.WorkflowSendApproveEmails).HasDefaultValue(true); + entity.Property(e => e.WorkflowSendArchiveEmails).HasDefaultValue(true); + entity.Property(e => e.WorkflowSendPublishEmails).HasDefaultValue(true); + entity.Property(e => e.WorkflowSendReadyForApprovalEmails).HasDefaultValue(true); + entity.Property(e => e.WorkflowSendRejectEmails).HasDefaultValue(true); + entity.Property(e => e.WorkflowUseCheckinCheckout).HasDefaultValue(false); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ActionEnabled).HasDefaultValue(true); + + entity.HasOne(d => d.ActionResource).WithMany(p => p.CmsWorkflowActions).HasConstraintName("FK_CMS_WorkflowAction_ActionResourceID"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.StepAllowPublish).HasDefaultValue(false); + entity.Property(e => e.StepAllowReject).HasDefaultValue(true); + + entity.HasOne(d => d.StepAction).WithMany(p => p.CmsWorkflowSteps).HasConstraintName("FK_CMS_WorkflowStep_StepActionID"); + + entity.HasOne(d => d.StepWorkflow).WithMany(p => p.CmsWorkflowSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowStep_StepWorkflowID"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.TransitionEndStep).WithMany(p => p.CmsWorkflowTransitionTransitionEndSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionEndStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TransitionStartStep).WithMany(p => p.CmsWorkflowTransitionTransitionStartSteps) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionStartStepID_CMS_WorkflowStep"); + + entity.HasOne(d => d.TransitionWorkflow).WithMany(p => p.CmsWorkflowTransitions) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_CMS_WorkflowTransition_TransitionWorkflowID_CMS_Workflow"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailChannelSendingDomain).HasDefaultValue(""); + entity.Property(e => e.EmailChannelServiceDomain).HasDefaultValue(""); + + entity.HasOne(d => d.EmailChannelChannel).WithMany(p => p.EmailLibraryEmailChannels) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailChannel_EmailChannelChannelID_CMS_Channel"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailChannelSenderDisplayName).HasDefaultValue(""); + entity.Property(e => e.EmailChannelSenderName).HasDefaultValue(""); + + entity.HasOne(d => d.EmailChannelSenderEmailChannel).WithMany(p => p.EmailLibraryEmailChannelSenders) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailChannelSender_EmailChannelSenderEmailChannelID_EmailLibrary_EmailChannel"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailConfigurationName).HasDefaultValue(""); + entity.Property(e => e.EmailConfigurationPurpose).HasDefaultValue("Regular"); + + entity.HasOne(d => d.EmailConfigurationContentItem).WithMany(p => p.EmailLibraryEmailConfigurations).HasConstraintName("FK_EmailLibrary_EmailConfiguration_EmailConfigurationContentItemID_CMS_ContentItem"); + + entity.HasOne(d => d.EmailConfigurationEmailChannel).WithMany(p => p.EmailLibraryEmailConfigurations).HasConstraintName("FK_EmailLibrary_EmailConfiguration_EmailConfigurationEmailChannelID_EmailLibrary_EmailChannel"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailLinkDescription).HasDefaultValue(""); + entity.Property(e => e.EmailLinkTarget).HasDefaultValue(""); + + entity.HasOne(d => d.EmailLinkEmailConfiguration).WithMany(p => p.EmailLibraryEmailLinks) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailLink_EmailLinkEmailConfigurationID_EmailLibrary_EmailConfiguration"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailMarketingRecipientContactEmail).HasDefaultValue(""); + + entity.HasOne(d => d.EmailMarketingRecipientContact).WithMany(p => p.EmailLibraryEmailMarketingRecipients) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientContactID_OM_Contact"); + + entity.HasOne(d => d.EmailMarketingRecipientEmailConfiguration).WithMany(p => p.EmailLibraryEmailMarketingRecipients) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientEmailConfigurationID_EmailLibrary_EmailConfiguration"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.EmailStatisticsEmailConfiguration).WithMany(p => p.EmailLibraryEmailStatistics) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailStatistics_EmailStatisticsEmailConfigurationID_EmailLibrary_EmailConfiguration")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailStatisticsHitsEmailConfiguration).WithMany(p => p.EmailLibraryEmailStatisticsHits) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailConfigurationID_EmailLibrary_EmailConfiguration"); + + entity.HasOne(d => d.EmailStatisticsHitsEmailLink).WithMany(p => p.EmailLibraryEmailStatisticsHits).HasConstraintName("FK_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailLinkID_EmailLibrary_EmailLink"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailSubscriptionConfirmationContact).WithMany(p => p.EmailLibraryEmailSubscriptionConfirmations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationContactID_OM_Contact"); + + entity.HasOne(d => d.EmailSubscriptionConfirmationRecipientList).WithMany(p => p.EmailLibraryEmailSubscriptionConfirmations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationRecipientListID_OM_ContactGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.EmailTemplateCode).HasDefaultValue(""); + entity.Property(e => e.EmailTemplateDisplayName).HasDefaultValue(""); + entity.Property(e => e.EmailTemplateName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.EmailTemplateContentTypeContentType).WithMany(p => p.EmailLibraryEmailTemplateContentTypes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeContentTypeID_CMS_Class"); + + entity.HasOne(d => d.EmailTemplateContentTypeEmailTemplate).WithMany(p => p.EmailLibraryEmailTemplateContentTypes) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeEmailTemplateID_EmailLibrary_EmailTemplate"); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.RecipientListSettingsRecipientList).WithMany(p => p.EmailLibraryRecipientListSettings) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_RecipientListSettings_RecipientListSettingsRecipientListID_OM_ContactGroup")); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.SendConfigurationEmailConfiguration).WithOne(p => p.EmailLibrarySendConfiguration) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_SendConfiguration_SendConfigurationEmailConfigurationID_EmailLibrary_EmailConfiguration"); + + entity.HasOne(d => d.SendConfigurationRecipientList).WithMany(p => p.EmailLibrarySendConfigurations) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_EmailLibrary_SendConfiguration_SendConfigurationRecipientListID_OM_ContactGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.FileId).IsClustered(false); + + entity.HasIndex(e => e.FilePath, "IX_Media_File_FilePath").IsClustered(); + + entity.Property(e => e.FileCreatedWhen).HasDefaultValue(new DateTime(2008, 11, 11, 16, 10, 0, 0, DateTimeKind.Unspecified)); + entity.Property(e => e.FileModifiedWhen).HasDefaultValue(new DateTime(2008, 11, 11, 16, 11, 15, 0, DateTimeKind.Unspecified)); + entity.Property(e => e.FileTitle).HasDefaultValue(""); + + entity.HasOne(d => d.FileCreatedByUser).WithMany(p => p.MediaFileFileCreatedByUsers).HasConstraintName("FK_Media_File_FileCreatedByUserID_CMS_User"); + + entity.HasOne(d => d.FileLibrary).WithMany(p => p.MediaFiles) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_Media_File_FileLibraryID_Media_Library"); + + entity.HasOne(d => d.FileModifiedByUser).WithMany(p => p.MediaFileFileModifiedByUsers).HasConstraintName("FK_Media_File_FileModifiedByUserID_CMS_User"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.LibraryId).IsClustered(false); + + entity.HasIndex(e => e.LibraryDisplayName, "IX_Media_Library_LibraryDisplayName").IsClustered(); + + entity.Property(e => e.LibraryName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.AccountCountry).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_Country"); + + entity.HasOne(d => d.AccountOwnerUser).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_User"); + + entity.HasOne(d => d.AccountPrimaryContact).WithMany(p => p.OmAccountAccountPrimaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_PrimaryContact"); + + entity.HasOne(d => d.AccountSecondaryContact).WithMany(p => p.OmAccountAccountSecondaryContacts).HasConstraintName("FK_OM_Account_OM_Contact_SecondaryContact"); + + entity.HasOne(d => d.AccountState).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_CMS_State"); + + entity.HasOne(d => d.AccountStatus).WithMany(p => p.OmAccounts).HasConstraintName("FK_OM_Account_OM_AccountStatus"); + + entity.HasOne(d => d.AccountSubsidiaryOf).WithMany(p => p.InverseAccountSubsidiaryOf).HasConstraintName("FK_OM_Account_OM_Account_SubsidiaryOf"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.Account).WithMany(p => p.OmAccountContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_AccountContact_OM_Account"); + + entity.HasOne(d => d.Contact).WithMany(p => p.OmAccountContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_AccountContact_OM_Contact"); + + entity.HasOne(d => d.ContactRole).WithMany(p => p.OmAccountContacts).HasConstraintName("FK_OM_AccountContact_OM_ContactRole"); + }); + + modelBuilder.Entity(entity => + { + entity.HasOne(d => d.ActivityChannel).WithMany(p => p.OmActivities).HasConstraintName("FK_OM_Activity_ActivityChannelID_CMS_Channel"); + + entity.HasOne(d => d.ActivityLanguage).WithMany(p => p.OmActivities).HasConstraintName("FK_OM_Activity_ActivityLanguageID_CMS_ContentLanguage"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ActivityTypeEnabled).HasDefaultValue(true); + entity.Property(e => e.ActivityTypeIsCustom).HasDefaultValue(true); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactCreated).HasDefaultValue(new DateTime(2011, 3, 5, 10, 51, 13, 0, DateTimeKind.Unspecified)); + entity.Property(e => e.ContactMonitored).HasDefaultValue(false); + entity.Property(e => e.ContactSalesForceLeadReplicationDisabled).HasDefaultValue(false); + entity.Property(e => e.ContactSalesForceLeadReplicationRequired).HasDefaultValue(false); + + entity.HasOne(d => d.ContactCountry).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_Country"); + + entity.HasOne(d => d.ContactOwnerUser).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_User"); + + entity.HasOne(d => d.ContactState).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_CMS_State"); + + entity.HasOne(d => d.ContactStatus).WithMany(p => p.OmContacts).HasConstraintName("FK_OM_Contact_OM_ContactStatus"); + }); + + modelBuilder.Entity(entity => + { + entity.HasKey(e => e.ContactGroupId).HasName("PK_CMS_ContactGroup"); + + entity.Property(e => e.ContactGroupIsRecipientList).HasDefaultValue(false); + entity.Property(e => e.ContactGroupName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactGroupMemberFromCondition).HasDefaultValue(false); + entity.Property(e => e.ContactGroupMemberFromManual).HasDefaultValue(false); + + entity.HasOne(d => d.ContactGroupMemberContactGroup).WithMany(p => p.OmContactGroupMembers) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_ContactGroupMembers_OM_ContactGroup"); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactRoleDisplayName).HasDefaultValue(""); + entity.Property(e => e.ContactRoleName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.ContactStatusDisplayName).HasDefaultValue(""); + entity.Property(e => e.ContactStatusName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.TrackedWebsiteDisplayName).HasDefaultValue(""); + entity.Property(e => e.TrackedWebsiteEnabled).HasDefaultValue(false); + entity.Property(e => e.TrackedWebsiteName).HasDefaultValue(""); + entity.Property(e => e.TrackedWebsiteUrl).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => entity.HasOne(d => d.VisitorToContactContact).WithMany(p => p.OmVisitorToContacts) + .OnDelete(DeleteBehavior.ClientSetNull) + .HasConstraintName("FK_OM_VisitorToContact_OM_Contact_Cascade")); + + modelBuilder.Entity(entity => + { + entity.Property(e => e.FileDirectory).HasDefaultValue(""); + entity.Property(e => e.FileExtension).HasDefaultValue(""); + entity.Property(e => e.FileLastModified).HasDefaultValueSql("('6/29/2010 1:57:54 PM')"); + entity.Property(e => e.FileMimeType).HasDefaultValue(""); + entity.Property(e => e.FileName).HasDefaultValue(""); + }); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ResourceString_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_CMS_ResourceTranslated_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_AccountContact_AccountJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_AccountContact_ContactJoined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_Account_Joined")); + + modelBuilder.Entity(entity => entity.ToView("View_OM_ContactGroupMember_AccountJoined")); + + OnModelCreatingPartial(modelBuilder); + } + + partial void OnModelCreatingPartial(ModelBuilder modelBuilder); +} diff --git a/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs b/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs index 843afc84..2b36c575 100644 --- a/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs +++ b/Migration.Toolkit.KXP/DependencyInjectionExtensions.cs @@ -1,20 +1,22 @@ -namespace Migration.Toolkit.KXP; - -using System.Diagnostics; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.DependencyInjection; -using Migration.Toolkit.Common; -using Migration.Toolkit.KXP.Context; - -public static class DependencyInjectionExtensions -{ - public static IServiceCollection UseKxpDbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) - { - services.AddDbContextFactory(options => - { - Debug.Assert(toolkitConfiguration.XbKConnectionString != null, "toolkitConfiguration.XbKConnectionString != null"); - options.UseSqlServer(toolkitConfiguration.XbKConnectionString); - }); - return services; - } -} \ No newline at end of file +using System.Diagnostics; + +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; + +using Migration.Toolkit.Common; +using Migration.Toolkit.KXP.Context; + +namespace Migration.Toolkit.KXP; + +public static class DependencyInjectionExtensions +{ + public static IServiceCollection UseKxpDbContext(this IServiceCollection services, ToolkitConfiguration toolkitConfiguration) + { + services.AddDbContextFactory(options => + { + Debug.Assert(toolkitConfiguration.XbKConnectionString != null, "toolkitConfiguration.XbKConnectionString != null"); + options.UseSqlServer(toolkitConfiguration.XbKConnectionString); + }); + return services; + } +} diff --git a/Migration.Toolkit.KXP/Migration.Toolkit.KXP.csproj b/Migration.Toolkit.KXP/Migration.Toolkit.KXP.csproj index 18addd88..fd625e95 100644 --- a/Migration.Toolkit.KXP/Migration.Toolkit.KXP.csproj +++ b/Migration.Toolkit.KXP/Migration.Toolkit.KXP.csproj @@ -6,25 +6,25 @@ - - runtime; build; native; contentfiles; analyzers; buildtransitive - all - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - + + runtime; build; native; contentfiles; analyzers; buildtransitive + all + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + - + - + diff --git a/Migration.Toolkit.KXP/Models/CdMigration.cs b/Migration.Toolkit.KXP/Models/CdMigration.cs index 4e4b4861..c7c31273 100644 --- a/Migration.Toolkit.KXP/Models/CdMigration.cs +++ b/Migration.Toolkit.KXP/Models/CdMigration.cs @@ -1,24 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CD_Migration")] -[Index("MigrationName", Name = "IX_CD_Migration_MigrationName", IsUnique = true)] -public partial class CdMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CD_Migration")] +[Index("MigrationName", Name = "IX_CD_Migration_MigrationName", IsUnique = true)] +public class CdMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs b/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs index c5075ed9..353f55fc 100644 --- a/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs +++ b/Migration.Toolkit.KXP/Models/CiFileMetadatum.cs @@ -1,22 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CI_FileMetadata")] -[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] -public partial class CiFileMetadatum -{ - [Key] - [Column("FileMetadataID")] - public int FileMetadataId { get; set; } - - [StringLength(260)] - public string FileLocation { get; set; } = null!; - - [StringLength(32)] - public string FileHash { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CI_FileMetadata")] +[Index("FileLocation", Name = "UQ_CI_FileMetadata_FileLocation", IsUnique = true)] +public class CiFileMetadatum +{ + [Key] + [Column("FileMetadataID")] + public int FileMetadataId { get; set; } + + [StringLength(260)] + public string FileLocation { get; set; } = null!; + + [StringLength(32)] + public string FileHash { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CiMigration.cs b/Migration.Toolkit.KXP/Models/CiMigration.cs index c1fe2006..57cc9e0f 100644 --- a/Migration.Toolkit.KXP/Models/CiMigration.cs +++ b/Migration.Toolkit.KXP/Models/CiMigration.cs @@ -1,24 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CI_Migration")] -[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] -public partial class CiMigration -{ - [Key] - [Column("MigrationID")] - public int MigrationId { get; set; } - - [StringLength(255)] - public string MigrationName { get; set; } = null!; - - [Precision(3)] - public DateTime DateApplied { get; set; } - - public int? RowsAffected { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CI_Migration")] +[Index("MigrationName", Name = "IX_CI_Migration_MigrationName", IsUnique = true)] +public class CiMigration +{ + [Key] + [Column("MigrationID")] + public int MigrationId { get; set; } + + [StringLength(255)] + public string MigrationName { get; set; } = null!; + + [Precision(3)] + public DateTime DateApplied { get; set; } + + public int? RowsAffected { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs b/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs index 3cd4effb..0c9f22c4 100644 --- a/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs +++ b/Migration.Toolkit.KXP/Models/CmsAlternativeForm.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_AlternativeForm")] -[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] -[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] -public partial class CmsAlternativeForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(50)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public string? FormDefinition { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Column("FormCoupledClassID")] - public int? FormCoupledClassId { get; set; } - - [StringLength(400)] - public string? FormCustomizedColumns { get; set; } - - public bool? FormIsCustom { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsAlternativeFormFormClasses")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormCoupledClassId")] - [InverseProperty("CmsAlternativeFormFormCoupledClasses")] - public virtual CmsClass? FormCoupledClass { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_AlternativeForm")] +[Index("FormClassId", "FormName", Name = "IX_CMS_AlternativeForm_FormClassID_FormName")] +[Index("FormCoupledClassId", Name = "IX_CMS_AlternativeForm_FormCoupledClassID")] +public class CmsAlternativeForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(50)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public string? FormDefinition { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + [Column("FormCoupledClassID")] + public int? FormCoupledClassId { get; set; } + + [StringLength(400)] + public string? FormCustomizedColumns { get; set; } + + public bool? FormIsCustom { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsAlternativeFormFormClasses")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormCoupledClassId")] + [InverseProperty("CmsAlternativeFormFormCoupledClasses")] + public virtual CmsClass? FormCoupledClass { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs b/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs index ea0ec286..cf81af8f 100644 --- a/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs +++ b/Migration.Toolkit.KXP/Models/CmsApplicationPermission.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ApplicationPermission")] -[Index("RoleId", Name = "IX_CMS_ApplicationPermission_RoleID")] -[Index("RoleId", "PermissionName", "ApplicationName", Name = "IX_CMS_ApplicationPermission_RoleID_PermissionName_ApplicationName", IsUnique = true)] -public partial class CmsApplicationPermission -{ - [Key] - [Column("ApplicationPermissionID")] - public int ApplicationPermissionId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string ApplicationName { get; set; } = null!; - - [StringLength(50)] - public string PermissionName { get; set; } = null!; - - public Guid ApplicationPermissionGuid { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsApplicationPermissions")] - public virtual CmsRole Role { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ApplicationPermission")] +[Index("RoleId", Name = "IX_CMS_ApplicationPermission_RoleID")] +[Index("RoleId", "PermissionName", "ApplicationName", Name = "IX_CMS_ApplicationPermission_RoleID_PermissionName_ApplicationName", IsUnique = true)] +public class CmsApplicationPermission +{ + [Key] + [Column("ApplicationPermissionID")] + public int ApplicationPermissionId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string ApplicationName { get; set; } = null!; + + [StringLength(50)] + public string PermissionName { get; set; } = null!; + + public Guid ApplicationPermissionGuid { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsApplicationPermissions")] + public virtual CmsRole Role { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs b/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs index 04cd7cad..6de0bc59 100644 --- a/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs +++ b/Migration.Toolkit.KXP/Models/CmsAutomationHistory.cs @@ -1,82 +1,81 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_AutomationHistory")] -[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] -[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] -[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] -[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] -[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] -[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] -public partial class CmsAutomationHistory -{ - [Key] - [Column("HistoryID")] - public int HistoryId { get; set; } - - [Column("HistoryStepID")] - public int? HistoryStepId { get; set; } - - [StringLength(440)] - public string? HistoryStepName { get; set; } - - [StringLength(450)] - public string HistoryStepDisplayName { get; set; } = null!; - - public int? HistoryStepType { get; set; } - - [Column("HistoryTargetStepID")] - public int? HistoryTargetStepId { get; set; } - - [StringLength(440)] - public string? HistoryTargetStepName { get; set; } - - [StringLength(450)] - public string? HistoryTargetStepDisplayName { get; set; } - - public int? HistoryTargetStepType { get; set; } - - [Column("HistoryApprovedByUserID")] - public int? HistoryApprovedByUserId { get; set; } - - public DateTime? HistoryApprovedWhen { get; set; } - - public string? HistoryComment { get; set; } - - public int? HistoryTransitionType { get; set; } - - [Column("HistoryWorkflowID")] - public int HistoryWorkflowId { get; set; } - - public bool? HistoryRejected { get; set; } - - public bool HistoryWasRejected { get; set; } - - [Column("HistoryStateID")] - public int HistoryStateId { get; set; } - - [ForeignKey("HistoryApprovedByUserId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsUser? HistoryApprovedByUser { get; set; } - - [ForeignKey("HistoryStateId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsAutomationState HistoryState { get; set; } = null!; - - [ForeignKey("HistoryStepId")] - [InverseProperty("CmsAutomationHistoryHistorySteps")] - public virtual CmsWorkflowStep? HistoryStep { get; set; } - - [ForeignKey("HistoryTargetStepId")] - [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] - public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } - - [ForeignKey("HistoryWorkflowId")] - [InverseProperty("CmsAutomationHistories")] - public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_AutomationHistory")] +[Index("HistoryApprovedByUserId", Name = "IX_CMS_AutomationHistory_HistoryApprovedByUserID")] +[Index("HistoryApprovedWhen", Name = "IX_CMS_AutomationHistory_HistoryApprovedWhen")] +[Index("HistoryStateId", Name = "IX_CMS_AutomationHistory_HistoryStateID")] +[Index("HistoryStepId", Name = "IX_CMS_AutomationHistory_HistoryStepID")] +[Index("HistoryTargetStepId", Name = "IX_CMS_AutomationHistory_HistoryTargetStepID")] +[Index("HistoryWorkflowId", Name = "IX_CMS_AutomationHistory_HistoryWorkflowID")] +public class CmsAutomationHistory +{ + [Key] + [Column("HistoryID")] + public int HistoryId { get; set; } + + [Column("HistoryStepID")] + public int? HistoryStepId { get; set; } + + [StringLength(440)] + public string? HistoryStepName { get; set; } + + [StringLength(450)] + public string HistoryStepDisplayName { get; set; } = null!; + + public int? HistoryStepType { get; set; } + + [Column("HistoryTargetStepID")] + public int? HistoryTargetStepId { get; set; } + + [StringLength(440)] + public string? HistoryTargetStepName { get; set; } + + [StringLength(450)] + public string? HistoryTargetStepDisplayName { get; set; } + + public int? HistoryTargetStepType { get; set; } + + [Column("HistoryApprovedByUserID")] + public int? HistoryApprovedByUserId { get; set; } + + public DateTime? HistoryApprovedWhen { get; set; } + + public string? HistoryComment { get; set; } + + public int? HistoryTransitionType { get; set; } + + [Column("HistoryWorkflowID")] + public int HistoryWorkflowId { get; set; } + + public bool? HistoryRejected { get; set; } + + public bool HistoryWasRejected { get; set; } + + [Column("HistoryStateID")] + public int HistoryStateId { get; set; } + + [ForeignKey("HistoryApprovedByUserId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsUser? HistoryApprovedByUser { get; set; } + + [ForeignKey("HistoryStateId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsAutomationState HistoryState { get; set; } = null!; + + [ForeignKey("HistoryStepId")] + [InverseProperty("CmsAutomationHistoryHistorySteps")] + public virtual CmsWorkflowStep? HistoryStep { get; set; } + + [ForeignKey("HistoryTargetStepId")] + [InverseProperty("CmsAutomationHistoryHistoryTargetSteps")] + public virtual CmsWorkflowStep? HistoryTargetStep { get; set; } + + [ForeignKey("HistoryWorkflowId")] + [InverseProperty("CmsAutomationHistories")] + public virtual CmsWorkflow HistoryWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationState.cs b/Migration.Toolkit.KXP/Models/CmsAutomationState.cs index d6c14c67..16c3f2b8 100644 --- a/Migration.Toolkit.KXP/Models/CmsAutomationState.cs +++ b/Migration.Toolkit.KXP/Models/CmsAutomationState.cs @@ -1,63 +1,62 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_AutomationState")] -[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] -[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] -[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] -[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] -public partial class CmsAutomationState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [Column("StateStepID")] - public int StateStepId { get; set; } - - [Column("StateObjectID")] - public int StateObjectId { get; set; } - - [StringLength(100)] - public string StateObjectType { get; set; } = null!; - - [StringLength(450)] - public string? StateActionStatus { get; set; } - - public DateTime? StateCreated { get; set; } - - public DateTime? StateLastModified { get; set; } - - [Column("StateWorkflowID")] - public int StateWorkflowId { get; set; } - - public int? StateStatus { get; set; } - - [Column("StateUserID")] - public int? StateUserId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public string? StateCustomData { get; set; } - - [InverseProperty("HistoryState")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [ForeignKey("StateStepId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflowStep StateStep { get; set; } = null!; - - [ForeignKey("StateUserId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsUser? StateUser { get; set; } - - [ForeignKey("StateWorkflowId")] - [InverseProperty("CmsAutomationStates")] - public virtual CmsWorkflow StateWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_AutomationState")] +[Index("StateObjectId", "StateObjectType", Name = "IX_CMS_AutomationState_StateObjectID_StateObjectType")] +[Index("StateStepId", Name = "IX_CMS_AutomationState_StateStepID")] +[Index("StateUserId", Name = "IX_CMS_AutomationState_StateUserID")] +[Index("StateWorkflowId", Name = "IX_CMS_AutomationState_StateWorkflowID")] +public class CmsAutomationState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [Column("StateStepID")] + public int StateStepId { get; set; } + + [Column("StateObjectID")] + public int StateObjectId { get; set; } + + [StringLength(100)] + public string StateObjectType { get; set; } = null!; + + [StringLength(450)] + public string? StateActionStatus { get; set; } + + public DateTime? StateCreated { get; set; } + + public DateTime? StateLastModified { get; set; } + + [Column("StateWorkflowID")] + public int StateWorkflowId { get; set; } + + public int? StateStatus { get; set; } + + [Column("StateUserID")] + public int? StateUserId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public string? StateCustomData { get; set; } + + [InverseProperty("HistoryState")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [ForeignKey("StateStepId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflowStep StateStep { get; set; } = null!; + + [ForeignKey("StateUserId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsUser? StateUser { get; set; } + + [ForeignKey("StateWorkflowId")] + [InverseProperty("CmsAutomationStates")] + public virtual CmsWorkflow StateWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs b/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs index 86188ce8..9dedb728 100644 --- a/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs +++ b/Migration.Toolkit.KXP/Models/CmsAutomationTemplate.cs @@ -1,30 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_AutomationTemplate")] -[Index("TemplateDisplayName", Name = "IX_CMS_AutomationTemplate_TemplateDisplayName")] -public partial class CmsAutomationTemplate -{ - [Key] - [Column("TemplateID")] - public int TemplateId { get; set; } - - [StringLength(250)] - public string TemplateDisplayName { get; set; } = null!; - - public string? TemplateDescription { get; set; } - - [StringLength(200)] - public string? TemplateIconClass { get; set; } - - public string? TemplateConfiguration { get; set; } - - public Guid TemplateGuid { get; set; } - - public DateTime TemplateLastModified { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_AutomationTemplate")] +[Index("TemplateDisplayName", Name = "IX_CMS_AutomationTemplate_TemplateDisplayName")] +public class CmsAutomationTemplate +{ + [Key] + [Column("TemplateID")] + public int TemplateId { get; set; } + + [StringLength(250)] + public string TemplateDisplayName { get; set; } = null!; + + public string? TemplateDescription { get; set; } + + [StringLength(200)] + public string? TemplateIconClass { get; set; } + + public string? TemplateConfiguration { get; set; } + + public Guid TemplateGuid { get; set; } + + public DateTime TemplateLastModified { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsChannel.cs b/Migration.Toolkit.KXP/Models/CmsChannel.cs index 0879584f..4fd418a4 100644 --- a/Migration.Toolkit.KXP/Models/CmsChannel.cs +++ b/Migration.Toolkit.KXP/Models/CmsChannel.cs @@ -1,45 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Channel")] -public partial class CmsChannel -{ - [Key] - [Column("ChannelID")] - public int ChannelId { get; set; } - - [StringLength(200)] - public string ChannelDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ChannelName { get; set; } = null!; - - [StringLength(200)] - public string ChannelType { get; set; } = null!; - - [Column("ChannelGUID")] - public Guid ChannelGuid { get; set; } - - [InverseProperty("ContentItemChannel")] - public virtual ICollection CmsContentItems { get; set; } = new List(); - - [InverseProperty("ContentTypeChannelChannel")] - public virtual ICollection CmsContentTypeChannels { get; set; } = new List(); - - [InverseProperty("HeadlessChannelChannel")] - public virtual ICollection CmsHeadlessChannels { get; set; } = new List(); - - [InverseProperty("WebsiteChannelChannel")] - public virtual ICollection CmsWebsiteChannels { get; set; } = new List(); - - [InverseProperty("EmailChannelChannel")] - public virtual ICollection EmailLibraryEmailChannels { get; set; } = new List(); - - [InverseProperty("ActivityChannel")] - public virtual ICollection OmActivities { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Channel")] +public class CmsChannel +{ + [Key] + [Column("ChannelID")] + public int ChannelId { get; set; } + + [StringLength(200)] + public string ChannelDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ChannelName { get; set; } = null!; + + [StringLength(200)] + public string ChannelType { get; set; } = null!; + + [Column("ChannelGUID")] + public Guid ChannelGuid { get; set; } + + [StringLength(20)] + public string ChannelSize { get; set; } = null!; + + [InverseProperty("ContentItemChannel")] + public virtual ICollection CmsContentItems { get; set; } = new List(); + + [InverseProperty("ContentTypeChannelChannel")] + public virtual ICollection CmsContentTypeChannels { get; set; } = new List(); + + [InverseProperty("HeadlessChannelChannel")] + public virtual ICollection CmsHeadlessChannels { get; set; } = new List(); + + [InverseProperty("WebsiteChannelChannel")] + public virtual ICollection CmsWebsiteChannels { get; set; } = new List(); + + [InverseProperty("EmailChannelChannel")] + public virtual ICollection EmailLibraryEmailChannels { get; set; } = new List(); + + [InverseProperty("ActivityChannel")] + public virtual ICollection OmActivities { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsClass.cs b/Migration.Toolkit.KXP/Models/CmsClass.cs index 06241796..c5c76abe 100644 --- a/Migration.Toolkit.KXP/Models/CmsClass.cs +++ b/Migration.Toolkit.KXP/Models/CmsClass.cs @@ -1,97 +1,96 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Class")] -[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] -[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] -[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] -public partial class CmsClass -{ - [Key] - [Column("ClassID")] - public int ClassId { get; set; } - - [StringLength(100)] - public string ClassDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ClassName { get; set; } = null!; - - public string ClassXmlSchema { get; set; } = null!; - - public string ClassFormDefinition { get; set; } = null!; - - [StringLength(100)] - public string? ClassTableName { get; set; } - - public bool? ClassShowTemplateSelection { get; set; } - - public DateTime ClassLastModified { get; set; } - - [Column("ClassGUID")] - public Guid ClassGuid { get; set; } - - public string? ClassContactMapping { get; set; } - - public bool? ClassContactOverwriteEnabled { get; set; } - - [StringLength(100)] - public string? ClassConnectionString { get; set; } - - [StringLength(100)] - public string? ClassDefaultObjectType { get; set; } - - [Column("ClassResourceID")] - public int? ClassResourceId { get; set; } - - public string? ClassCodeGenerationSettings { get; set; } - - [StringLength(200)] - public string? ClassIconClass { get; set; } - - public bool ClassHasUnmanagedDbSchema { get; set; } - - [StringLength(10)] - public string ClassType { get; set; } = null!; - - [StringLength(10)] - public string? ClassContentTypeType { get; set; } - - public bool? ClassWebPageHasUrl { get; set; } - - [StringLength(100)] - public string? ClassShortName { get; set; } - - [ForeignKey("ClassResourceId")] - [InverseProperty("CmsClasses")] - public virtual CmsResource? ClassResource { get; set; } - - [InverseProperty("FormClass")] - public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); - - [InverseProperty("FormCoupledClass")] - public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); - - [InverseProperty("ContentItemContentType")] - public virtual ICollection CmsContentItems { get; set; } = new List(); - - [InverseProperty("ContentTypeChannelContentType")] - public virtual ICollection CmsContentTypeChannels { get; set; } = new List(); - - [InverseProperty("ContentWorkflowContentTypeContentType")] - public virtual ICollection CmsContentWorkflowContentTypes { get; set; } = new List(); - - [InverseProperty("FormClass")] - public virtual ICollection CmsForms { get; set; } = new List(); - - [InverseProperty("Class")] - public virtual ICollection CmsQueries { get; set; } = new List(); - - [InverseProperty("EmailTemplateContentTypeContentType")] - public virtual ICollection EmailLibraryEmailTemplateContentTypes { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Class")] +[Index("ClassName", Name = "IX_CMS_Class_ClassName", IsUnique = true)] +[Index("ClassName", "ClassGuid", Name = "IX_CMS_Class_ClassName_ClassGUID")] +[Index("ClassResourceId", Name = "IX_CMS_Class_ClassResourceID")] +public class CmsClass +{ + [Key] + [Column("ClassID")] + public int ClassId { get; set; } + + [StringLength(100)] + public string ClassDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ClassName { get; set; } = null!; + + public string ClassXmlSchema { get; set; } = null!; + + public string ClassFormDefinition { get; set; } = null!; + + [StringLength(100)] + public string? ClassTableName { get; set; } + + public bool? ClassShowTemplateSelection { get; set; } + + public DateTime ClassLastModified { get; set; } + + [Column("ClassGUID")] + public Guid ClassGuid { get; set; } + + public string? ClassContactMapping { get; set; } + + public bool? ClassContactOverwriteEnabled { get; set; } + + [StringLength(100)] + public string? ClassConnectionString { get; set; } + + [StringLength(100)] + public string? ClassDefaultObjectType { get; set; } + + [Column("ClassResourceID")] + public int? ClassResourceId { get; set; } + + public string? ClassCodeGenerationSettings { get; set; } + + [StringLength(200)] + public string? ClassIconClass { get; set; } + + public bool ClassHasUnmanagedDbSchema { get; set; } + + [StringLength(10)] + public string ClassType { get; set; } = null!; + + [StringLength(10)] + public string? ClassContentTypeType { get; set; } + + public bool? ClassWebPageHasUrl { get; set; } + + [StringLength(100)] + public string? ClassShortName { get; set; } + + [ForeignKey("ClassResourceId")] + [InverseProperty("CmsClasses")] + public virtual CmsResource? ClassResource { get; set; } + + [InverseProperty("FormClass")] + public virtual ICollection CmsAlternativeFormFormClasses { get; set; } = new List(); + + [InverseProperty("FormCoupledClass")] + public virtual ICollection CmsAlternativeFormFormCoupledClasses { get; set; } = new List(); + + [InverseProperty("ContentItemContentType")] + public virtual ICollection CmsContentItems { get; set; } = new List(); + + [InverseProperty("ContentTypeChannelContentType")] + public virtual ICollection CmsContentTypeChannels { get; set; } = new List(); + + [InverseProperty("ContentWorkflowContentTypeContentType")] + public virtual ICollection CmsContentWorkflowContentTypes { get; set; } = new List(); + + [InverseProperty("FormClass")] + public virtual ICollection CmsForms { get; set; } = new List(); + + [InverseProperty("Class")] + public virtual ICollection CmsQueries { get; set; } = new List(); + + [InverseProperty("EmailTemplateContentTypeContentType")] + public virtual ICollection EmailLibraryEmailTemplateContentTypes { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsConsent.cs b/Migration.Toolkit.KXP/Models/CmsConsent.cs index c5fba218..1207aaa8 100644 --- a/Migration.Toolkit.KXP/Models/CmsConsent.cs +++ b/Migration.Toolkit.KXP/Models/CmsConsent.cs @@ -1,36 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Consent")] -public partial class CmsConsent -{ - [Key] - [Column("ConsentID")] - public int ConsentId { get; set; } - - [StringLength(200)] - public string ConsentDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ConsentName { get; set; } = null!; - - public string ConsentContent { get; set; } = null!; - - public Guid ConsentGuid { get; set; } - - public DateTime ConsentLastModified { get; set; } - - [StringLength(100)] - public string ConsentHash { get; set; } = null!; - - [InverseProperty("ConsentAgreementConsent")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [InverseProperty("ConsentArchiveConsent")] - public virtual ICollection CmsConsentArchives { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Consent")] +public class CmsConsent +{ + [Key] + [Column("ConsentID")] + public int ConsentId { get; set; } + + [StringLength(200)] + public string ConsentDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ConsentName { get; set; } = null!; + + public string ConsentContent { get; set; } = null!; + + public Guid ConsentGuid { get; set; } + + public DateTime ConsentLastModified { get; set; } + + [StringLength(100)] + public string ConsentHash { get; set; } = null!; + + [InverseProperty("ConsentAgreementConsent")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [InverseProperty("ConsentArchiveConsent")] + public virtual ICollection CmsConsentArchives { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs b/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs index d166d637..09a47584 100644 --- a/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs +++ b/Migration.Toolkit.KXP/Models/CmsConsentAgreement.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ConsentAgreement")] -[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] -public partial class CmsConsentAgreement -{ - [Key] - [Column("ConsentAgreementID")] - public int ConsentAgreementId { get; set; } - - public Guid ConsentAgreementGuid { get; set; } - - public bool ConsentAgreementRevoked { get; set; } - - [Column("ConsentAgreementContactID")] - public int ConsentAgreementContactId { get; set; } - - [Column("ConsentAgreementConsentID")] - public int ConsentAgreementConsentId { get; set; } - - [StringLength(100)] - public string? ConsentAgreementConsentHash { get; set; } - - public DateTime ConsentAgreementTime { get; set; } - - [ForeignKey("ConsentAgreementConsentId")] - [InverseProperty("CmsConsentAgreements")] - public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; - - [ForeignKey("ConsentAgreementContactId")] - [InverseProperty("CmsConsentAgreements")] - public virtual OmContact ConsentAgreementContact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ConsentAgreement")] +[Index("ConsentAgreementContactId", "ConsentAgreementConsentId", Name = "IX_CMS_ConsentAgreement_ConsentAgreementContactID_ConsentAgreementConsentID")] +public class CmsConsentAgreement +{ + [Key] + [Column("ConsentAgreementID")] + public int ConsentAgreementId { get; set; } + + public Guid ConsentAgreementGuid { get; set; } + + public bool ConsentAgreementRevoked { get; set; } + + [Column("ConsentAgreementContactID")] + public int ConsentAgreementContactId { get; set; } + + [Column("ConsentAgreementConsentID")] + public int ConsentAgreementConsentId { get; set; } + + [StringLength(100)] + public string? ConsentAgreementConsentHash { get; set; } + + public DateTime ConsentAgreementTime { get; set; } + + [ForeignKey("ConsentAgreementConsentId")] + [InverseProperty("CmsConsentAgreements")] + public virtual CmsConsent ConsentAgreementConsent { get; set; } = null!; + + [ForeignKey("ConsentAgreementContactId")] + [InverseProperty("CmsConsentAgreements")] + public virtual OmContact ConsentAgreementContact { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs b/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs index b08db150..0de47344 100644 --- a/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs +++ b/Migration.Toolkit.KXP/Models/CmsConsentArchive.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ConsentArchive")] -[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] -public partial class CmsConsentArchive -{ - [Key] - [Column("ConsentArchiveID")] - public int ConsentArchiveId { get; set; } - - public Guid ConsentArchiveGuid { get; set; } - - public DateTime ConsentArchiveLastModified { get; set; } - - [Column("ConsentArchiveConsentID")] - public int ConsentArchiveConsentId { get; set; } - - [StringLength(100)] - public string ConsentArchiveHash { get; set; } = null!; - - public string ConsentArchiveContent { get; set; } = null!; - - [ForeignKey("ConsentArchiveConsentId")] - [InverseProperty("CmsConsentArchives")] - public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ConsentArchive")] +[Index("ConsentArchiveConsentId", Name = "IX_ConsentArchive_ConsentArchiveConsentID")] +public class CmsConsentArchive +{ + [Key] + [Column("ConsentArchiveID")] + public int ConsentArchiveId { get; set; } + + public Guid ConsentArchiveGuid { get; set; } + + public DateTime ConsentArchiveLastModified { get; set; } + + [Column("ConsentArchiveConsentID")] + public int ConsentArchiveConsentId { get; set; } + + [StringLength(100)] + public string ConsentArchiveHash { get; set; } = null!; + + public string ConsentArchiveContent { get; set; } = null!; + + [ForeignKey("ConsentArchiveConsentId")] + [InverseProperty("CmsConsentArchives")] + public virtual CmsConsent ConsentArchiveConsent { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentFolder.cs b/Migration.Toolkit.KXP/Models/CmsContentFolder.cs index 01c240e0..e5541ece 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentFolder.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentFolder.cs @@ -1,63 +1,62 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentFolder")] -[Index("ContentFolderCreatedByUserId", Name = "IX_CMS_ContentFolder_ContentFolderCreatedByUserID")] -[Index("ContentFolderDisplayName", "ContentFolderParentFolderId", Name = "IX_CMS_ContentFolder_ContentFolderDisplayName_ContentFolderParentID", IsUnique = true)] -[Index("ContentFolderGuid", Name = "IX_CMS_ContentFolder_ContentFolderGUID_Unique", IsUnique = true)] -[Index("ContentFolderModifiedByUserId", Name = "IX_CMS_ContentFolder_ContentFolderModifiedByUserID")] -[Index("ContentFolderParentFolderId", Name = "IX_CMS_ContentFolder_ContentFolderParentFolderID")] -public partial class CmsContentFolder -{ - [Key] - [Column("ContentFolderID")] - public int ContentFolderId { get; set; } - - [Column("ContentFolderGUID")] - public Guid ContentFolderGuid { get; set; } - - [StringLength(50)] - public string ContentFolderName { get; set; } = null!; - - [StringLength(50)] - public string ContentFolderDisplayName { get; set; } = null!; - - [StringLength(1020)] - public string? ContentFolderTreePath { get; set; } - - public DateTime ContentFolderCreatedWhen { get; set; } - - [Column("ContentFolderCreatedByUserID")] - public int? ContentFolderCreatedByUserId { get; set; } - - public DateTime ContentFolderModifiedWhen { get; set; } - - [Column("ContentFolderModifiedByUserID")] - public int? ContentFolderModifiedByUserId { get; set; } - - [Column("ContentFolderParentFolderID")] - public int? ContentFolderParentFolderId { get; set; } - - [InverseProperty("ContentItemContentFolder")] - public virtual ICollection CmsContentItems { get; set; } = new List(); - - [ForeignKey("ContentFolderCreatedByUserId")] - [InverseProperty("CmsContentFolderContentFolderCreatedByUsers")] - public virtual CmsUser? ContentFolderCreatedByUser { get; set; } - - [ForeignKey("ContentFolderModifiedByUserId")] - [InverseProperty("CmsContentFolderContentFolderModifiedByUsers")] - public virtual CmsUser? ContentFolderModifiedByUser { get; set; } - - [ForeignKey("ContentFolderParentFolderId")] - [InverseProperty("InverseContentFolderParentFolder")] - public virtual CmsContentFolder? ContentFolderParentFolder { get; set; } - - [InverseProperty("ContentFolderParentFolder")] - public virtual ICollection InverseContentFolderParentFolder { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentFolder")] +[Index("ContentFolderCreatedByUserId", Name = "IX_CMS_ContentFolder_ContentFolderCreatedByUserID")] +[Index("ContentFolderParentFolderId", Name = "IX_CMS_ContentFolder_ContentFolderDisplayName_ContentFolderParentID")] +[Index("ContentFolderGuid", Name = "IX_CMS_ContentFolder_ContentFolderGUID_Unique", IsUnique = true)] +[Index("ContentFolderModifiedByUserId", Name = "IX_CMS_ContentFolder_ContentFolderModifiedByUserID")] +[Index("ContentFolderParentFolderId", Name = "IX_CMS_ContentFolder_ContentFolderParentFolderID")] +public class CmsContentFolder +{ + [Key] + [Column("ContentFolderID")] + public int ContentFolderId { get; set; } + + [Column("ContentFolderGUID")] + public Guid ContentFolderGuid { get; set; } + + [StringLength(50)] + public string ContentFolderName { get; set; } = null!; + + [StringLength(50)] + public string ContentFolderDisplayName { get; set; } = null!; + + [StringLength(1020)] + public string? ContentFolderTreePath { get; set; } + + public DateTime ContentFolderCreatedWhen { get; set; } + + [Column("ContentFolderCreatedByUserID")] + public int? ContentFolderCreatedByUserId { get; set; } + + public DateTime ContentFolderModifiedWhen { get; set; } + + [Column("ContentFolderModifiedByUserID")] + public int? ContentFolderModifiedByUserId { get; set; } + + [Column("ContentFolderParentFolderID")] + public int? ContentFolderParentFolderId { get; set; } + + [InverseProperty("ContentItemContentFolder")] + public virtual ICollection CmsContentItems { get; set; } = new List(); + + [ForeignKey("ContentFolderCreatedByUserId")] + [InverseProperty("CmsContentFolderContentFolderCreatedByUsers")] + public virtual CmsUser? ContentFolderCreatedByUser { get; set; } + + [ForeignKey("ContentFolderModifiedByUserId")] + [InverseProperty("CmsContentFolderContentFolderModifiedByUsers")] + public virtual CmsUser? ContentFolderModifiedByUser { get; set; } + + [ForeignKey("ContentFolderParentFolderId")] + [InverseProperty("InverseContentFolderParentFolder")] + public virtual CmsContentFolder? ContentFolderParentFolder { get; set; } + + [InverseProperty("ContentFolderParentFolder")] + public virtual ICollection InverseContentFolderParentFolder { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentItem.cs b/Migration.Toolkit.KXP/Models/CmsContentItem.cs index 20e90a0b..2121b16b 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItem.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItem.cs @@ -1,67 +1,66 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentItem")] -[Index("ContentItemContentFolderId", Name = "IX_CMS_ContentItem_ContentItemContentFolderID")] -[Index("ContentItemContentTypeId", Name = "IX_CMS_ContentItem_ContentItemContentTypeID")] -[Index("ContentItemName", Name = "IX_CMS_ContentItem_ContentItemName", IsUnique = true)] -public partial class CmsContentItem -{ - [Key] - [Column("ContentItemID")] - public int ContentItemId { get; set; } - - [Column("ContentItemGUID")] - public Guid ContentItemGuid { get; set; } - - [StringLength(100)] - public string ContentItemName { get; set; } = null!; - - public bool ContentItemIsReusable { get; set; } - - public bool ContentItemIsSecured { get; set; } - - [Column("ContentItemContentTypeID")] - public int? ContentItemContentTypeId { get; set; } - - [Column("ContentItemChannelID")] - public int? ContentItemChannelId { get; set; } - - [Column("ContentItemContentFolderID")] - public int? ContentItemContentFolderId { get; set; } - - [InverseProperty("ContentItemCommonDataContentItem")] - public virtual ICollection CmsContentItemCommonData { get; set; } = new List(); - - [InverseProperty("ContentItemLanguageMetadataContentItem")] - public virtual ICollection CmsContentItemLanguageMetadata { get; set; } = new List(); - - [InverseProperty("ContentItemReferenceTargetItem")] - public virtual ICollection CmsContentItemReferences { get; set; } = new List(); - - [InverseProperty("HeadlessItemContentItem")] - public virtual ICollection CmsHeadlessItems { get; set; } = new List(); - - [InverseProperty("WebPageItemContentItem")] - public virtual ICollection CmsWebPageItems { get; set; } = new List(); - - [ForeignKey("ContentItemChannelId")] - [InverseProperty("CmsContentItems")] - public virtual CmsChannel? ContentItemChannel { get; set; } - - [ForeignKey("ContentItemContentFolderId")] - [InverseProperty("CmsContentItems")] - public virtual CmsContentFolder? ContentItemContentFolder { get; set; } - - [ForeignKey("ContentItemContentTypeId")] - [InverseProperty("CmsContentItems")] - public virtual CmsClass? ContentItemContentType { get; set; } - - [InverseProperty("EmailConfigurationContentItem")] - public virtual ICollection EmailLibraryEmailConfigurations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentItem")] +[Index("ContentItemContentFolderId", Name = "IX_CMS_ContentItem_ContentItemContentFolderID")] +[Index("ContentItemContentTypeId", Name = "IX_CMS_ContentItem_ContentItemContentTypeID")] +[Index("ContentItemName", Name = "IX_CMS_ContentItem_ContentItemName", IsUnique = true)] +public class CmsContentItem +{ + [Key] + [Column("ContentItemID")] + public int ContentItemId { get; set; } + + [Column("ContentItemGUID")] + public Guid ContentItemGuid { get; set; } + + [StringLength(100)] + public string ContentItemName { get; set; } = null!; + + public bool ContentItemIsReusable { get; set; } + + public bool ContentItemIsSecured { get; set; } + + [Column("ContentItemContentTypeID")] + public int? ContentItemContentTypeId { get; set; } + + [Column("ContentItemChannelID")] + public int? ContentItemChannelId { get; set; } + + [Column("ContentItemContentFolderID")] + public int? ContentItemContentFolderId { get; set; } + + [InverseProperty("ContentItemCommonDataContentItem")] + public virtual ICollection CmsContentItemCommonData { get; set; } = new List(); + + [InverseProperty("ContentItemLanguageMetadataContentItem")] + public virtual ICollection CmsContentItemLanguageMetadata { get; set; } = new List(); + + [InverseProperty("ContentItemReferenceTargetItem")] + public virtual ICollection CmsContentItemReferences { get; set; } = new List(); + + [InverseProperty("HeadlessItemContentItem")] + public virtual ICollection CmsHeadlessItems { get; set; } = new List(); + + [InverseProperty("WebPageItemContentItem")] + public virtual ICollection CmsWebPageItems { get; set; } = new List(); + + [ForeignKey("ContentItemChannelId")] + [InverseProperty("CmsContentItems")] + public virtual CmsChannel? ContentItemChannel { get; set; } + + [ForeignKey("ContentItemContentFolderId")] + [InverseProperty("CmsContentItems")] + public virtual CmsContentFolder? ContentItemContentFolder { get; set; } + + [ForeignKey("ContentItemContentTypeId")] + [InverseProperty("CmsContentItems")] + public virtual CmsClass? ContentItemContentType { get; set; } + + [InverseProperty("EmailConfigurationContentItem")] + public virtual ICollection EmailLibraryEmailConfigurations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs b/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs index d53caf90..6f6daefe 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItemCommonDatum.cs @@ -1,49 +1,48 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentItemCommonData")] -[Index("ContentItemCommonDataContentItemId", "ContentItemCommonDataContentLanguageId", "ContentItemCommonDataIsLatest", Name = "IX_CMS_ContentItemCommonData_ContentItemID_ContentLanguageID_IsLatest", IsUnique = true)] -[Index("ContentItemCommonDataContentItemId", "ContentItemCommonDataContentLanguageId", "ContentItemCommonDataVersionStatus", Name = "IX_CMS_ContentItemCommonData_ContentItemID_ContentLanguageID_VersionStatus", IsUnique = true)] -public partial class CmsContentItemCommonDatum -{ - [Key] - [Column("ContentItemCommonDataID")] - public int ContentItemCommonDataId { get; set; } - - [Column("ContentItemCommonDataGUID")] - public Guid ContentItemCommonDataGuid { get; set; } - - [Column("ContentItemCommonDataContentItemID")] - public int ContentItemCommonDataContentItemId { get; set; } - - [Column("ContentItemCommonDataContentLanguageID")] - public int ContentItemCommonDataContentLanguageId { get; set; } - - public int ContentItemCommonDataVersionStatus { get; set; } - - public bool ContentItemCommonDataIsLatest { get; set; } - - public string? ContentItemCommonDataPageBuilderWidgets { get; set; } - - public string? ContentItemCommonDataPageTemplateConfiguration { get; set; } - - public DateTime? ContentItemCommonDataFirstPublishedWhen { get; set; } - - public DateTime? ContentItemCommonDataLastPublishedWhen { get; set; } - - [InverseProperty("ContentItemReferenceSourceCommonData")] - public virtual ICollection CmsContentItemReferences { get; set; } = new List(); - - [ForeignKey("ContentItemCommonDataContentItemId")] - [InverseProperty("CmsContentItemCommonData")] - public virtual CmsContentItem ContentItemCommonDataContentItem { get; set; } = null!; - - [ForeignKey("ContentItemCommonDataContentLanguageId")] - [InverseProperty("CmsContentItemCommonData")] - public virtual CmsContentLanguage ContentItemCommonDataContentLanguage { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentItemCommonData")] +[Index("ContentItemCommonDataContentItemId", "ContentItemCommonDataContentLanguageId", "ContentItemCommonDataIsLatest", Name = "IX_CMS_ContentItemCommonData_ContentItemID_ContentLanguageID_IsLatest", IsUnique = true)] +[Index("ContentItemCommonDataContentItemId", "ContentItemCommonDataContentLanguageId", "ContentItemCommonDataVersionStatus", Name = "IX_CMS_ContentItemCommonData_ContentItemID_ContentLanguageID_VersionStatus", IsUnique = true)] +public class CmsContentItemCommonDatum +{ + [Key] + [Column("ContentItemCommonDataID")] + public int ContentItemCommonDataId { get; set; } + + [Column("ContentItemCommonDataGUID")] + public Guid ContentItemCommonDataGuid { get; set; } + + [Column("ContentItemCommonDataContentItemID")] + public int ContentItemCommonDataContentItemId { get; set; } + + [Column("ContentItemCommonDataContentLanguageID")] + public int ContentItemCommonDataContentLanguageId { get; set; } + + public int ContentItemCommonDataVersionStatus { get; set; } + + public bool ContentItemCommonDataIsLatest { get; set; } + + public string? ContentItemCommonDataPageBuilderWidgets { get; set; } + + public string? ContentItemCommonDataPageTemplateConfiguration { get; set; } + + public DateTime? ContentItemCommonDataFirstPublishedWhen { get; set; } + + public DateTime? ContentItemCommonDataLastPublishedWhen { get; set; } + + [InverseProperty("ContentItemReferenceSourceCommonData")] + public virtual ICollection CmsContentItemReferences { get; set; } = new List(); + + [ForeignKey("ContentItemCommonDataContentItemId")] + [InverseProperty("CmsContentItemCommonData")] + public virtual CmsContentItem ContentItemCommonDataContentItem { get; set; } = null!; + + [ForeignKey("ContentItemCommonDataContentLanguageId")] + [InverseProperty("CmsContentItemCommonData")] + public virtual CmsContentLanguage ContentItemCommonDataContentLanguage { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs b/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs index 817f826f..ab1c3682 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItemLanguageMetadatum.cs @@ -1,73 +1,75 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentItemLanguageMetadata")] -[Index("ContentItemLanguageMetadataContentItemId", "ContentItemLanguageMetadataContentLanguageId", "ContentItemLanguageMetadataLatestVersionStatus", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemID_ContentLanguageID_LatestVersionStatus", IsUnique = true)] -[Index("ContentItemLanguageMetadataContentWorkflowStepId", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataContentWorkflowStepID")] -[Index("ContentItemLanguageMetadataCreatedByUserId", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataCreatedByUserID")] -[Index("ContentItemLanguageMetadataModifiedByUserId", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataModifiedByUserID")] -public partial class CmsContentItemLanguageMetadatum -{ - [Key] - [Column("ContentItemLanguageMetadataID")] - public int ContentItemLanguageMetadataId { get; set; } - - [Column("ContentItemLanguageMetadataContentItemID")] - public int ContentItemLanguageMetadataContentItemId { get; set; } - - [StringLength(100)] - public string ContentItemLanguageMetadataDisplayName { get; set; } = null!; - - public int ContentItemLanguageMetadataLatestVersionStatus { get; set; } - - [Column("ContentItemLanguageMetadataGUID")] - public Guid ContentItemLanguageMetadataGuid { get; set; } - - public DateTime ContentItemLanguageMetadataCreatedWhen { get; set; } - - [Column("ContentItemLanguageMetadataCreatedByUserID")] - public int? ContentItemLanguageMetadataCreatedByUserId { get; set; } - - public DateTime ContentItemLanguageMetadataModifiedWhen { get; set; } - - [Column("ContentItemLanguageMetadataModifiedByUserID")] - public int? ContentItemLanguageMetadataModifiedByUserId { get; set; } - - public bool ContentItemLanguageMetadataHasImageAsset { get; set; } - - [Column("ContentItemLanguageMetadataContentLanguageID")] - public int ContentItemLanguageMetadataContentLanguageId { get; set; } - - [Column("ContentItemLanguageMetadataContentWorkflowStepID")] - public int? ContentItemLanguageMetadataContentWorkflowStepId { get; set; } - - public DateTime? ContentItemLanguageMetadataScheduledPublishWhen { get; set; } - - [InverseProperty("ContentItemTagContentItemLanguageMetadata")] - public virtual ICollection CmsContentItemTags { get; set; } = new List(); - - [ForeignKey("ContentItemLanguageMetadataContentItemId")] - [InverseProperty("CmsContentItemLanguageMetadata")] - public virtual CmsContentItem ContentItemLanguageMetadataContentItem { get; set; } = null!; - - [ForeignKey("ContentItemLanguageMetadataContentLanguageId")] - [InverseProperty("CmsContentItemLanguageMetadata")] - public virtual CmsContentLanguage ContentItemLanguageMetadataContentLanguage { get; set; } = null!; - - [ForeignKey("ContentItemLanguageMetadataContentWorkflowStepId")] - [InverseProperty("CmsContentItemLanguageMetadata")] - public virtual CmsContentWorkflowStep? ContentItemLanguageMetadataContentWorkflowStep { get; set; } - - [ForeignKey("ContentItemLanguageMetadataCreatedByUserId")] - [InverseProperty("CmsContentItemLanguageMetadatumContentItemLanguageMetadataCreatedByUsers")] - public virtual CmsUser? ContentItemLanguageMetadataCreatedByUser { get; set; } - - [ForeignKey("ContentItemLanguageMetadataModifiedByUserId")] - [InverseProperty("CmsContentItemLanguageMetadatumContentItemLanguageMetadataModifiedByUsers")] - public virtual CmsUser? ContentItemLanguageMetadataModifiedByUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentItemLanguageMetadata")] +[Index("ContentItemLanguageMetadataContentItemId", "ContentItemLanguageMetadataContentLanguageId", "ContentItemLanguageMetadataLatestVersionStatus", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemID_ContentLanguageID_LatestVersionStatus", + IsUnique = true)] +[Index("ContentItemLanguageMetadataContentWorkflowStepId", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataContentWorkflowStepID")] +[Index("ContentItemLanguageMetadataCreatedByUserId", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataCreatedByUserID")] +[Index("ContentItemLanguageMetadataModifiedByUserId", Name = "IX_CMS_ContentItemLanguageMetadata_ContentItemLanguageMetadataModifiedByUserID")] +public class CmsContentItemLanguageMetadatum +{ + [Key] + [Column("ContentItemLanguageMetadataID")] + public int ContentItemLanguageMetadataId { get; set; } + + [Column("ContentItemLanguageMetadataContentItemID")] + public int ContentItemLanguageMetadataContentItemId { get; set; } + + [StringLength(100)] + public string ContentItemLanguageMetadataDisplayName { get; set; } = null!; + + public int ContentItemLanguageMetadataLatestVersionStatus { get; set; } + + [Column("ContentItemLanguageMetadataGUID")] + public Guid ContentItemLanguageMetadataGuid { get; set; } + + public DateTime ContentItemLanguageMetadataCreatedWhen { get; set; } + + [Column("ContentItemLanguageMetadataCreatedByUserID")] + public int? ContentItemLanguageMetadataCreatedByUserId { get; set; } + + public DateTime ContentItemLanguageMetadataModifiedWhen { get; set; } + + [Column("ContentItemLanguageMetadataModifiedByUserID")] + public int? ContentItemLanguageMetadataModifiedByUserId { get; set; } + + public bool ContentItemLanguageMetadataHasImageAsset { get; set; } + + [Column("ContentItemLanguageMetadataContentLanguageID")] + public int ContentItemLanguageMetadataContentLanguageId { get; set; } + + [Column("ContentItemLanguageMetadataContentWorkflowStepID")] + public int? ContentItemLanguageMetadataContentWorkflowStepId { get; set; } + + public DateTime? ContentItemLanguageMetadataScheduledPublishWhen { get; set; } + + public DateTime? ContentItemLanguageMetadataScheduledUnpublishWhen { get; set; } + + [InverseProperty("ContentItemTagContentItemLanguageMetadata")] + public virtual ICollection CmsContentItemTags { get; set; } = new List(); + + [ForeignKey("ContentItemLanguageMetadataContentItemId")] + [InverseProperty("CmsContentItemLanguageMetadata")] + public virtual CmsContentItem ContentItemLanguageMetadataContentItem { get; set; } = null!; + + [ForeignKey("ContentItemLanguageMetadataContentLanguageId")] + [InverseProperty("CmsContentItemLanguageMetadata")] + public virtual CmsContentLanguage ContentItemLanguageMetadataContentLanguage { get; set; } = null!; + + [ForeignKey("ContentItemLanguageMetadataContentWorkflowStepId")] + [InverseProperty("CmsContentItemLanguageMetadata")] + public virtual CmsContentWorkflowStep? ContentItemLanguageMetadataContentWorkflowStep { get; set; } + + [ForeignKey("ContentItemLanguageMetadataCreatedByUserId")] + [InverseProperty("CmsContentItemLanguageMetadatumContentItemLanguageMetadataCreatedByUsers")] + public virtual CmsUser? ContentItemLanguageMetadataCreatedByUser { get; set; } + + [ForeignKey("ContentItemLanguageMetadataModifiedByUserId")] + [InverseProperty("CmsContentItemLanguageMetadatumContentItemLanguageMetadataModifiedByUsers")] + public virtual CmsUser? ContentItemLanguageMetadataModifiedByUser { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs b/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs index 5e8a2376..e9562e8d 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItemReference.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentItemReference")] -[Index("ContentItemReferenceSourceCommonDataId", Name = "IX_CMS_ContentItemReference_ContentItemReferenceSourceCommonDataID")] -[Index("ContentItemReferenceSourceCommonDataId", "ContentItemReferenceTargetItemId", "ContentItemReferenceGroupGuid", Name = "IX_CMS_ContentItemReference_ContentItemReferenceSourceCommonDataID_TargetItemID_GroupGUID", IsUnique = true)] -[Index("ContentItemReferenceTargetItemId", Name = "IX_CMS_ContentItemReference_ContentItemReferenceTargetItemID")] -public partial class CmsContentItemReference -{ - [Key] - [Column("ContentItemReferenceID")] - public int ContentItemReferenceId { get; set; } - - [Column("ContentItemReferenceGUID")] - public Guid ContentItemReferenceGuid { get; set; } - - [Column("ContentItemReferenceSourceCommonDataID")] - public int ContentItemReferenceSourceCommonDataId { get; set; } - - [Column("ContentItemReferenceTargetItemID")] - public int ContentItemReferenceTargetItemId { get; set; } - - [Column("ContentItemReferenceGroupGUID")] - public Guid ContentItemReferenceGroupGuid { get; set; } - - [ForeignKey("ContentItemReferenceSourceCommonDataId")] - [InverseProperty("CmsContentItemReferences")] - public virtual CmsContentItemCommonDatum ContentItemReferenceSourceCommonData { get; set; } = null!; - - [ForeignKey("ContentItemReferenceTargetItemId")] - [InverseProperty("CmsContentItemReferences")] - public virtual CmsContentItem ContentItemReferenceTargetItem { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentItemReference")] +[Index("ContentItemReferenceSourceCommonDataId", Name = "IX_CMS_ContentItemReference_ContentItemReferenceSourceCommonDataID")] +[Index("ContentItemReferenceSourceCommonDataId", "ContentItemReferenceTargetItemId", "ContentItemReferenceGroupGuid", Name = "IX_CMS_ContentItemReference_ContentItemReferenceSourceCommonDataID_TargetItemID_GroupGUID", IsUnique = true)] +[Index("ContentItemReferenceTargetItemId", Name = "IX_CMS_ContentItemReference_ContentItemReferenceTargetItemID")] +public class CmsContentItemReference +{ + [Key] + [Column("ContentItemReferenceID")] + public int ContentItemReferenceId { get; set; } + + [Column("ContentItemReferenceGUID")] + public Guid ContentItemReferenceGuid { get; set; } + + [Column("ContentItemReferenceSourceCommonDataID")] + public int ContentItemReferenceSourceCommonDataId { get; set; } + + [Column("ContentItemReferenceTargetItemID")] + public int ContentItemReferenceTargetItemId { get; set; } + + [Column("ContentItemReferenceGroupGUID")] + public Guid ContentItemReferenceGroupGuid { get; set; } + + [ForeignKey("ContentItemReferenceSourceCommonDataId")] + [InverseProperty("CmsContentItemReferences")] + public virtual CmsContentItemCommonDatum ContentItemReferenceSourceCommonData { get; set; } = null!; + + [ForeignKey("ContentItemReferenceTargetItemId")] + [InverseProperty("CmsContentItemReferences")] + public virtual CmsContentItem ContentItemReferenceTargetItem { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs b/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs index 2c58da44..65d85459 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentItemTag.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentItemTag")] -[Index("ContentItemTagContentItemLanguageMetadataId", Name = "IX_CMS_ContentItemTag_ContentItemTagContentItemLanguageMetadataID")] -[Index("ContentItemTagFieldGuid", Name = "IX_CMS_ContentItemTag_ContentItemTagFieldGUID")] -[Index("ContentItemTagTagGuid", Name = "IX_CMS_ContentItemTag_ContentItemTagTagGUID")] -[Index("ContentItemTagTagGuid", "ContentItemTagFieldGuid", "ContentItemTagContentItemLanguageMetadataId", Name = "IX_CMS_ContentItemTag_ContentItemTagTagGUID_ContentItemTagFieldGUID_ContentItemTagContentItemLanguageMetadataID", IsUnique = true)] -public partial class CmsContentItemTag -{ - [Key] - [Column("ContentItemTagID")] - public int ContentItemTagId { get; set; } - - [Column("ContentItemTagContentItemLanguageMetadataID")] - public int ContentItemTagContentItemLanguageMetadataId { get; set; } - - [Column("ContentItemTagFieldGUID")] - public Guid ContentItemTagFieldGuid { get; set; } - - [Column("ContentItemTagTagGUID")] - public Guid ContentItemTagTagGuid { get; set; } - - [ForeignKey("ContentItemTagContentItemLanguageMetadataId")] - [InverseProperty("CmsContentItemTags")] - public virtual CmsContentItemLanguageMetadatum ContentItemTagContentItemLanguageMetadata { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentItemTag")] +[Index("ContentItemTagContentItemLanguageMetadataId", Name = "IX_CMS_ContentItemTag_ContentItemTagContentItemLanguageMetadataID")] +[Index("ContentItemTagFieldGuid", Name = "IX_CMS_ContentItemTag_ContentItemTagFieldGUID")] +[Index("ContentItemTagTagGuid", Name = "IX_CMS_ContentItemTag_ContentItemTagTagGUID")] +[Index("ContentItemTagTagGuid", "ContentItemTagFieldGuid", "ContentItemTagContentItemLanguageMetadataId", Name = "IX_CMS_ContentItemTag_ContentItemTagTagGUID_ContentItemTagFieldGUID_ContentItemTagContentItemLanguageMetadataID", IsUnique = true)] +public class CmsContentItemTag +{ + [Key] + [Column("ContentItemTagID")] + public int ContentItemTagId { get; set; } + + [Column("ContentItemTagContentItemLanguageMetadataID")] + public int ContentItemTagContentItemLanguageMetadataId { get; set; } + + [Column("ContentItemTagFieldGUID")] + public Guid ContentItemTagFieldGuid { get; set; } + + [Column("ContentItemTagTagGUID")] + public Guid ContentItemTagTagGuid { get; set; } + + [ForeignKey("ContentItemTagContentItemLanguageMetadataId")] + [InverseProperty("CmsContentItemTags")] + public virtual CmsContentItemLanguageMetadatum ContentItemTagContentItemLanguageMetadata { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs b/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs index f989d5db..ec38b1dc 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentLanguage.cs @@ -1,53 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentLanguage")] -public partial class CmsContentLanguage -{ - [Key] - [Column("ContentLanguageID")] - public int ContentLanguageId { get; set; } - - [StringLength(200)] - public string ContentLanguageDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContentLanguageName { get; set; } = null!; - - public bool ContentLanguageIsDefault { get; set; } - - [Column("ContentLanguageFallbackContentLanguageID")] - public int? ContentLanguageFallbackContentLanguageId { get; set; } - - [StringLength(200)] - public string ContentLanguageCultureFormat { get; set; } = null!; - - [Column("ContentLanguageGUID")] - public Guid ContentLanguageGuid { get; set; } - - [InverseProperty("ContentItemCommonDataContentLanguage")] - public virtual ICollection CmsContentItemCommonData { get; set; } = new List(); - - [InverseProperty("ContentItemLanguageMetadataContentLanguage")] - public virtual ICollection CmsContentItemLanguageMetadata { get; set; } = new List(); - - [InverseProperty("HeadlessChannelPrimaryContentLanguage")] - public virtual ICollection CmsHeadlessChannels { get; set; } = new List(); - - [InverseProperty("WebPageFormerUrlPathContentLanguage")] - public virtual ICollection CmsWebPageFormerUrlPaths { get; set; } = new List(); - - [InverseProperty("WebPageUrlPathContentLanguage")] - public virtual ICollection CmsWebPageUrlPaths { get; set; } = new List(); - - [InverseProperty("WebsiteChannelPrimaryContentLanguage")] - public virtual ICollection CmsWebsiteChannels { get; set; } = new List(); - - [InverseProperty("ActivityLanguage")] - public virtual ICollection OmActivities { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentLanguage")] +public class CmsContentLanguage +{ + [Key] + [Column("ContentLanguageID")] + public int ContentLanguageId { get; set; } + + [StringLength(200)] + public string ContentLanguageDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContentLanguageName { get; set; } = null!; + + public bool ContentLanguageIsDefault { get; set; } + + [Column("ContentLanguageFallbackContentLanguageID")] + public int? ContentLanguageFallbackContentLanguageId { get; set; } + + [StringLength(200)] + public string ContentLanguageCultureFormat { get; set; } = null!; + + [Column("ContentLanguageGUID")] + public Guid ContentLanguageGuid { get; set; } + + [InverseProperty("ContentItemCommonDataContentLanguage")] + public virtual ICollection CmsContentItemCommonData { get; set; } = new List(); + + [InverseProperty("ContentItemLanguageMetadataContentLanguage")] + public virtual ICollection CmsContentItemLanguageMetadata { get; set; } = new List(); + + [InverseProperty("HeadlessChannelPrimaryContentLanguage")] + public virtual ICollection CmsHeadlessChannels { get; set; } = new List(); + + [InverseProperty("WebPageFormerUrlPathContentLanguage")] + public virtual ICollection CmsWebPageFormerUrlPaths { get; set; } = new List(); + + [InverseProperty("WebPageUrlPathContentLanguage")] + public virtual ICollection CmsWebPageUrlPaths { get; set; } = new List(); + + [InverseProperty("WebsiteChannelPrimaryContentLanguage")] + public virtual ICollection CmsWebsiteChannels { get; set; } = new List(); + + [InverseProperty("ActivityLanguage")] + public virtual ICollection OmActivities { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs b/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs index 84f71fbb..f7dc1314 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentTypeChannel.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentTypeChannel")] -[Index("ContentTypeChannelChannelId", "ContentTypeChannelContentTypeId", Name = "IX_CMS_ContentTypeChannel_ContentTypeChannelChannelID_ContentTypeChannelContentTypeID", IsUnique = true)] -[Index("ContentTypeChannelContentTypeId", Name = "IX_CMS_ContentTypeChannel_ContentTypeChannelContentTypeID")] -public partial class CmsContentTypeChannel -{ - [Key] - [Column("ContentTypeChannelID")] - public int ContentTypeChannelId { get; set; } - - [Column("ContentTypeChannelChannelID")] - public int ContentTypeChannelChannelId { get; set; } - - [Column("ContentTypeChannelContentTypeID")] - public int ContentTypeChannelContentTypeId { get; set; } - - [ForeignKey("ContentTypeChannelChannelId")] - [InverseProperty("CmsContentTypeChannels")] - public virtual CmsChannel ContentTypeChannelChannel { get; set; } = null!; - - [ForeignKey("ContentTypeChannelContentTypeId")] - [InverseProperty("CmsContentTypeChannels")] - public virtual CmsClass ContentTypeChannelContentType { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentTypeChannel")] +[Index("ContentTypeChannelChannelId", "ContentTypeChannelContentTypeId", Name = "IX_CMS_ContentTypeChannel_ContentTypeChannelChannelID_ContentTypeChannelContentTypeID", IsUnique = true)] +[Index("ContentTypeChannelContentTypeId", Name = "IX_CMS_ContentTypeChannel_ContentTypeChannelContentTypeID")] +public class CmsContentTypeChannel +{ + [Key] + [Column("ContentTypeChannelID")] + public int ContentTypeChannelId { get; set; } + + [Column("ContentTypeChannelChannelID")] + public int ContentTypeChannelChannelId { get; set; } + + [Column("ContentTypeChannelContentTypeID")] + public int ContentTypeChannelContentTypeId { get; set; } + + [ForeignKey("ContentTypeChannelChannelId")] + [InverseProperty("CmsContentTypeChannels")] + public virtual CmsChannel ContentTypeChannelChannel { get; set; } = null!; + + [ForeignKey("ContentTypeChannelContentTypeId")] + [InverseProperty("CmsContentTypeChannels")] + public virtual CmsClass ContentTypeChannelContentType { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs b/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs index 35ef1f99..d51546fc 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentWorkflow.cs @@ -1,32 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentWorkflow")] -public partial class CmsContentWorkflow -{ - [Key] - [Column("ContentWorkflowID")] - public int ContentWorkflowId { get; set; } - - [StringLength(200)] - public string ContentWorkflowName { get; set; } = null!; - - [StringLength(200)] - public string ContentWorkflowDisplayName { get; set; } = null!; - - [Column("ContentWorkflowGUID")] - public Guid ContentWorkflowGuid { get; set; } - - public DateTime ContentWorkflowLastModified { get; set; } - - [InverseProperty("ContentWorkflowContentTypeContentWorkflow")] - public virtual ICollection CmsContentWorkflowContentTypes { get; set; } = new List(); - - [InverseProperty("ContentWorkflowStepWorkflow")] - public virtual ICollection CmsContentWorkflowSteps { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentWorkflow")] +public class CmsContentWorkflow +{ + [Key] + [Column("ContentWorkflowID")] + public int ContentWorkflowId { get; set; } + + [StringLength(200)] + public string ContentWorkflowName { get; set; } = null!; + + [StringLength(200)] + public string ContentWorkflowDisplayName { get; set; } = null!; + + [Column("ContentWorkflowGUID")] + public Guid ContentWorkflowGuid { get; set; } + + public DateTime ContentWorkflowLastModified { get; set; } + + [InverseProperty("ContentWorkflowContentTypeContentWorkflow")] + public virtual ICollection CmsContentWorkflowContentTypes { get; set; } = new List(); + + [InverseProperty("ContentWorkflowStepWorkflow")] + public virtual ICollection CmsContentWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs b/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs index f197d6d3..9aeaea2a 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentWorkflowContentType.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentWorkflowContentType")] -[Index("ContentWorkflowContentTypeContentTypeId", Name = "IX_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentTypeID")] -[Index("ContentWorkflowContentTypeContentWorkflowId", Name = "IX_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentWorkflowID")] -public partial class CmsContentWorkflowContentType -{ - [Key] - [Column("ContentWorkflowContentTypeID")] - public int ContentWorkflowContentTypeId { get; set; } - - [Column("ContentWorkflowContentTypeContentWorkflowID")] - public int ContentWorkflowContentTypeContentWorkflowId { get; set; } - - [Column("ContentWorkflowContentTypeContentTypeID")] - public int ContentWorkflowContentTypeContentTypeId { get; set; } - - [ForeignKey("ContentWorkflowContentTypeContentTypeId")] - [InverseProperty("CmsContentWorkflowContentTypes")] - public virtual CmsClass ContentWorkflowContentTypeContentType { get; set; } = null!; - - [ForeignKey("ContentWorkflowContentTypeContentWorkflowId")] - [InverseProperty("CmsContentWorkflowContentTypes")] - public virtual CmsContentWorkflow ContentWorkflowContentTypeContentWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentWorkflowContentType")] +[Index("ContentWorkflowContentTypeContentTypeId", Name = "IX_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentTypeID")] +[Index("ContentWorkflowContentTypeContentWorkflowId", Name = "IX_CMS_ContentWorkflowContentType_ContentWorkflowContentTypeContentWorkflowID")] +public class CmsContentWorkflowContentType +{ + [Key] + [Column("ContentWorkflowContentTypeID")] + public int ContentWorkflowContentTypeId { get; set; } + + [Column("ContentWorkflowContentTypeContentWorkflowID")] + public int ContentWorkflowContentTypeContentWorkflowId { get; set; } + + [Column("ContentWorkflowContentTypeContentTypeID")] + public int ContentWorkflowContentTypeContentTypeId { get; set; } + + [ForeignKey("ContentWorkflowContentTypeContentTypeId")] + [InverseProperty("CmsContentWorkflowContentTypes")] + public virtual CmsClass ContentWorkflowContentTypeContentType { get; set; } = null!; + + [ForeignKey("ContentWorkflowContentTypeContentWorkflowId")] + [InverseProperty("CmsContentWorkflowContentTypes")] + public virtual CmsContentWorkflow ContentWorkflowContentTypeContentWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs b/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs index c799c952..c75e012a 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentWorkflowStep.cs @@ -1,48 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentWorkflowStep")] -[Index("ContentWorkflowStepName", Name = "IX_CMS_ContentWorkflowStep_ContentWorkflowStepName", IsUnique = true)] -[Index("ContentWorkflowStepWorkflowId", Name = "IX_CMS_ContentWorkflowStep_ContentWorkflowStepWorkflowID")] -public partial class CmsContentWorkflowStep -{ - [Key] - [Column("ContentWorkflowStepID")] - public int ContentWorkflowStepId { get; set; } - - [Column("ContentWorkflowStepGUID")] - public Guid ContentWorkflowStepGuid { get; set; } - - [Column("ContentWorkflowStepWorkflowID")] - public int ContentWorkflowStepWorkflowId { get; set; } - - public DateTime ContentWorkflowStepLastModified { get; set; } - - [StringLength(200)] - public string ContentWorkflowStepName { get; set; } = null!; - - [StringLength(200)] - public string ContentWorkflowStepDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ContentWorkflowStepIconClass { get; set; } = null!; - - public int ContentWorkflowStepOrder { get; set; } - - public int ContentWorkflowStepType { get; set; } - - [InverseProperty("ContentItemLanguageMetadataContentWorkflowStep")] - public virtual ICollection CmsContentItemLanguageMetadata { get; set; } = new List(); - - [InverseProperty("ContentWorkflowStepRoleContentWorkflowStep")] - public virtual ICollection CmsContentWorkflowStepRoles { get; set; } = new List(); - - [ForeignKey("ContentWorkflowStepWorkflowId")] - [InverseProperty("CmsContentWorkflowSteps")] - public virtual CmsContentWorkflow ContentWorkflowStepWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentWorkflowStep")] +[Index("ContentWorkflowStepName", Name = "IX_CMS_ContentWorkflowStep_ContentWorkflowStepName", IsUnique = true)] +[Index("ContentWorkflowStepWorkflowId", Name = "IX_CMS_ContentWorkflowStep_ContentWorkflowStepWorkflowID")] +public class CmsContentWorkflowStep +{ + [Key] + [Column("ContentWorkflowStepID")] + public int ContentWorkflowStepId { get; set; } + + [Column("ContentWorkflowStepGUID")] + public Guid ContentWorkflowStepGuid { get; set; } + + [Column("ContentWorkflowStepWorkflowID")] + public int ContentWorkflowStepWorkflowId { get; set; } + + public DateTime ContentWorkflowStepLastModified { get; set; } + + [StringLength(200)] + public string ContentWorkflowStepName { get; set; } = null!; + + [StringLength(200)] + public string ContentWorkflowStepDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ContentWorkflowStepIconClass { get; set; } = null!; + + public int ContentWorkflowStepOrder { get; set; } + + public int ContentWorkflowStepType { get; set; } + + [InverseProperty("ContentItemLanguageMetadataContentWorkflowStep")] + public virtual ICollection CmsContentItemLanguageMetadata { get; set; } = new List(); + + [InverseProperty("ContentWorkflowStepRoleContentWorkflowStep")] + public virtual ICollection CmsContentWorkflowStepRoles { get; set; } = new List(); + + [ForeignKey("ContentWorkflowStepWorkflowId")] + [InverseProperty("CmsContentWorkflowSteps")] + public virtual CmsContentWorkflow ContentWorkflowStepWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs b/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs index 22067cc7..1861251c 100644 --- a/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs +++ b/Migration.Toolkit.KXP/Models/CmsContentWorkflowStepRole.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ContentWorkflowStepRole")] -[Index("ContentWorkflowStepRoleContentWorkflowStepId", Name = "IX_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleContentWorkflowStepID")] -[Index("ContentWorkflowStepRoleRoleId", Name = "IX_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleRoleID")] -public partial class CmsContentWorkflowStepRole -{ - [Key] - [Column("ContentWorkflowStepRoleID")] - public int ContentWorkflowStepRoleId { get; set; } - - [Column("ContentWorkflowStepRoleContentWorkflowStepID")] - public int ContentWorkflowStepRoleContentWorkflowStepId { get; set; } - - [Column("ContentWorkflowStepRoleRoleID")] - public int ContentWorkflowStepRoleRoleId { get; set; } - - [ForeignKey("ContentWorkflowStepRoleContentWorkflowStepId")] - [InverseProperty("CmsContentWorkflowStepRoles")] - public virtual CmsContentWorkflowStep ContentWorkflowStepRoleContentWorkflowStep { get; set; } = null!; - - [ForeignKey("ContentWorkflowStepRoleRoleId")] - [InverseProperty("CmsContentWorkflowStepRoles")] - public virtual CmsRole ContentWorkflowStepRoleRole { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ContentWorkflowStepRole")] +[Index("ContentWorkflowStepRoleContentWorkflowStepId", Name = "IX_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleContentWorkflowStepID")] +[Index("ContentWorkflowStepRoleRoleId", Name = "IX_CMS_ContentWorkflowStepRole_ContentWorkflowStepRoleRoleID")] +public class CmsContentWorkflowStepRole +{ + [Key] + [Column("ContentWorkflowStepRoleID")] + public int ContentWorkflowStepRoleId { get; set; } + + [Column("ContentWorkflowStepRoleContentWorkflowStepID")] + public int ContentWorkflowStepRoleContentWorkflowStepId { get; set; } + + [Column("ContentWorkflowStepRoleRoleID")] + public int ContentWorkflowStepRoleRoleId { get; set; } + + [ForeignKey("ContentWorkflowStepRoleContentWorkflowStepId")] + [InverseProperty("CmsContentWorkflowStepRoles")] + public virtual CmsContentWorkflowStep ContentWorkflowStepRoleContentWorkflowStep { get; set; } = null!; + + [ForeignKey("ContentWorkflowStepRoleRoleId")] + [InverseProperty("CmsContentWorkflowStepRoles")] + public virtual CmsRole ContentWorkflowStepRoleRole { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsCountry.cs b/Migration.Toolkit.KXP/Models/CmsCountry.cs index 85856650..017234f5 100644 --- a/Migration.Toolkit.KXP/Models/CmsCountry.cs +++ b/Migration.Toolkit.KXP/Models/CmsCountry.cs @@ -1,41 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Country")] -public partial class CmsCountry -{ - [Key] - [Column("CountryID")] - public int CountryId { get; set; } - - [StringLength(200)] - public string CountryDisplayName { get; set; } = null!; - - [StringLength(200)] - public string CountryName { get; set; } = null!; - - [Column("CountryGUID")] - public Guid CountryGuid { get; set; } - - public DateTime CountryLastModified { get; set; } - - [StringLength(2)] - public string? CountryTwoLetterCode { get; set; } - - [StringLength(3)] - public string? CountryThreeLetterCode { get; set; } - - [InverseProperty("Country")] - public virtual ICollection CmsStates { get; set; } = new List(); - - [InverseProperty("AccountCountry")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactCountry")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Country")] +public class CmsCountry +{ + [Key] + [Column("CountryID")] + public int CountryId { get; set; } + + [StringLength(200)] + public string CountryDisplayName { get; set; } = null!; + + [StringLength(200)] + public string CountryName { get; set; } = null!; + + [Column("CountryGUID")] + public Guid CountryGuid { get; set; } + + public DateTime CountryLastModified { get; set; } + + [StringLength(2)] + public string? CountryTwoLetterCode { get; set; } + + [StringLength(3)] + public string? CountryThreeLetterCode { get; set; } + + [InverseProperty("Country")] + public virtual ICollection CmsStates { get; set; } = new List(); + + [InverseProperty("AccountCountry")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactCountry")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsCulture.cs b/Migration.Toolkit.KXP/Models/CmsCulture.cs index b759b91f..a15c13f0 100644 --- a/Migration.Toolkit.KXP/Models/CmsCulture.cs +++ b/Migration.Toolkit.KXP/Models/CmsCulture.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Culture")] -[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] -[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] -public partial class CmsCulture -{ - [Key] - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; - - [StringLength(200)] - public string CultureShortName { get; set; } = null!; - - [Column("CultureGUID")] - public Guid CultureGuid { get; set; } - - public DateTime CultureLastModified { get; set; } - - [StringLength(100)] - public string? CultureAlias { get; set; } - - [Column("CultureIsUICulture")] - public bool? CultureIsUiculture { get; set; } - - [InverseProperty("TranslationCulture")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Culture")] +[Index("CultureAlias", Name = "IX_CMS_CulturAlias")] +[Index("CultureCode", Name = "IX_CMS_Culture_CultureCode")] +public class CmsCulture +{ + [Key] + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; + + [StringLength(200)] + public string CultureShortName { get; set; } = null!; + + [Column("CultureGUID")] + public Guid CultureGuid { get; set; } + + public DateTime CultureLastModified { get; set; } + + [StringLength(100)] + public string? CultureAlias { get; set; } + + [Column("CultureIsUICulture")] + public bool? CultureIsUiculture { get; set; } + + [InverseProperty("TranslationCulture")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsEmail.cs b/Migration.Toolkit.KXP/Models/CmsEmail.cs index d7d24e8c..c9aa77d1 100644 --- a/Migration.Toolkit.KXP/Models/CmsEmail.cs +++ b/Migration.Toolkit.KXP/Models/CmsEmail.cs @@ -1,69 +1,68 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Email")] -[Index("EmailEmailConfigurationId", Name = "IX_CMS_Email_EmailEmailConfigurationID")] -[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] -public partial class CmsEmail -{ - [Key] - [Column("EmailID")] - public int EmailId { get; set; } - - [StringLength(254)] - public string EmailFrom { get; set; } = null!; - - [StringLength(998)] - public string? EmailTo { get; set; } - - [StringLength(998)] - public string? EmailCc { get; set; } - - [StringLength(998)] - public string? EmailBcc { get; set; } - - [StringLength(450)] - public string EmailSubject { get; set; } = null!; - - public string? EmailBody { get; set; } - - public string? EmailPlainTextBody { get; set; } - - public int EmailFormat { get; set; } - - public int EmailPriority { get; set; } - - public string? EmailLastSendResult { get; set; } - - public DateTime? EmailLastSendAttempt { get; set; } - - [Column("EmailGUID")] - public Guid EmailGuid { get; set; } - - public int? EmailStatus { get; set; } - - [StringLength(254)] - public string? EmailReplyTo { get; set; } - - public string? EmailHeaders { get; set; } - - public DateTime? EmailCreated { get; set; } - - [Column("EmailEmailConfigurationID")] - public int? EmailEmailConfigurationId { get; set; } - - public Guid? EmailMailoutGuid { get; set; } - - [ForeignKey("EmailEmailConfigurationId")] - [InverseProperty("CmsEmails")] - public virtual EmailLibraryEmailConfiguration? EmailEmailConfiguration { get; set; } - - [ForeignKey("EmailId")] - [InverseProperty("Emails")] - public virtual ICollection Attachments { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Email")] +[Index("EmailEmailConfigurationId", Name = "IX_CMS_Email_EmailEmailConfigurationID")] +[Index("EmailPriority", "EmailId", Name = "IX_CMS_Email_EmailPriority_EmailID", IsUnique = true, IsDescending = new[] { true, false })] +public class CmsEmail +{ + [Key] + [Column("EmailID")] + public int EmailId { get; set; } + + [StringLength(254)] + public string EmailFrom { get; set; } = null!; + + [StringLength(998)] + public string? EmailTo { get; set; } + + [StringLength(998)] + public string? EmailCc { get; set; } + + [StringLength(998)] + public string? EmailBcc { get; set; } + + [StringLength(450)] + public string EmailSubject { get; set; } = null!; + + public string? EmailBody { get; set; } + + public string? EmailPlainTextBody { get; set; } + + public int EmailFormat { get; set; } + + public int EmailPriority { get; set; } + + public string? EmailLastSendResult { get; set; } + + public DateTime? EmailLastSendAttempt { get; set; } + + [Column("EmailGUID")] + public Guid EmailGuid { get; set; } + + public int? EmailStatus { get; set; } + + [StringLength(254)] + public string? EmailReplyTo { get; set; } + + public string? EmailHeaders { get; set; } + + public DateTime? EmailCreated { get; set; } + + [Column("EmailEmailConfigurationID")] + public int? EmailEmailConfigurationId { get; set; } + + public Guid? EmailMailoutGuid { get; set; } + + [ForeignKey("EmailEmailConfigurationId")] + [InverseProperty("CmsEmails")] + public virtual EmailLibraryEmailConfiguration? EmailEmailConfiguration { get; set; } + + [ForeignKey("EmailId")] + [InverseProperty("Emails")] + public virtual ICollection Attachments { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs b/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs index 29e070be..61c34863 100644 --- a/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs +++ b/Migration.Toolkit.KXP/Models/CmsEmailAttachment.cs @@ -1,41 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_EmailAttachment")] -public partial class CmsEmailAttachment -{ - [Key] - [Column("AttachmentID")] - public int AttachmentId { get; set; } - - [StringLength(255)] - public string AttachmentName { get; set; } = null!; - - [StringLength(50)] - public string AttachmentExtension { get; set; } = null!; - - public int AttachmentSize { get; set; } - - [StringLength(100)] - public string AttachmentMimeType { get; set; } = null!; - - public byte[] AttachmentBinary { get; set; } = null!; - - [Column("AttachmentGUID")] - public Guid AttachmentGuid { get; set; } - - public DateTime AttachmentLastModified { get; set; } - - [Column("AttachmentContentID")] - [StringLength(255)] - public string? AttachmentContentId { get; set; } - - [ForeignKey("AttachmentId")] - [InverseProperty("Attachments")] - public virtual ICollection Emails { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_EmailAttachment")] +public class CmsEmailAttachment +{ + [Key] + [Column("AttachmentID")] + public int AttachmentId { get; set; } + + [StringLength(255)] + public string AttachmentName { get; set; } = null!; + + [StringLength(50)] + public string AttachmentExtension { get; set; } = null!; + + public int AttachmentSize { get; set; } + + [StringLength(100)] + public string AttachmentMimeType { get; set; } = null!; + + public byte[] AttachmentBinary { get; set; } = null!; + + [Column("AttachmentGUID")] + public Guid AttachmentGuid { get; set; } + + public DateTime AttachmentLastModified { get; set; } + + [Column("AttachmentContentID")] + [StringLength(255)] + public string? AttachmentContentId { get; set; } + + [ForeignKey("AttachmentId")] + [InverseProperty("Attachments")] + public virtual ICollection Emails { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsEventLog.cs b/Migration.Toolkit.KXP/Models/CmsEventLog.cs index 2432714b..b1621124 100644 --- a/Migration.Toolkit.KXP/Models/CmsEventLog.cs +++ b/Migration.Toolkit.KXP/Models/CmsEventLog.cs @@ -1,47 +1,44 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_EventLog")] -public partial class CmsEventLog -{ - [Key] - [Column("EventID")] - public int EventId { get; set; } - - [StringLength(5)] - public string EventType { get; set; } = null!; - - public DateTime EventTime { get; set; } - - [StringLength(100)] - public string Source { get; set; } = null!; - - [StringLength(100)] - public string EventCode { get; set; } = null!; - - [Column("UserID")] - public int? UserId { get; set; } - - [StringLength(250)] - public string? UserName { get; set; } - - [Column("IPAddress")] - [StringLength(100)] - public string? Ipaddress { get; set; } - - public string? EventDescription { get; set; } - - public string? EventUrl { get; set; } - - [StringLength(100)] - public string? EventMachineName { get; set; } - - public string? EventUserAgent { get; set; } - - public string? EventUrlReferrer { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_EventLog")] +public class CmsEventLog +{ + [Key] + [Column("EventID")] + public int EventId { get; set; } + + [StringLength(5)] + public string EventType { get; set; } = null!; + + public DateTime EventTime { get; set; } + + [StringLength(100)] + public string Source { get; set; } = null!; + + [StringLength(100)] + public string EventCode { get; set; } = null!; + + [Column("UserID")] + public int? UserId { get; set; } + + [StringLength(250)] + public string? UserName { get; set; } + + [Column("IPAddress")] + [StringLength(100)] + public string? Ipaddress { get; set; } + + public string? EventDescription { get; set; } + + public string? EventUrl { get; set; } + + [StringLength(100)] + public string? EventMachineName { get; set; } + + public string? EventUserAgent { get; set; } + + public string? EventUrlReferrer { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs b/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs index e1d677dd..92901e85 100644 --- a/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs +++ b/Migration.Toolkit.KXP/Models/CmsExternalLogin.cs @@ -1,29 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ExternalLogin")] -[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] -public partial class CmsExternalLogin -{ - [Key] - [Column("ExternalLoginID")] - public int ExternalLoginId { get; set; } - - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(100)] - public string LoginProvider { get; set; } = null!; - - [StringLength(100)] - public string IdentityKey { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsExternalLogins")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ExternalLogin")] +[Index("UserId", Name = "IX_CMS_ExternalLogin_UserID")] +public class CmsExternalLogin +{ + [Key] + [Column("ExternalLoginID")] + public int ExternalLoginId { get; set; } + + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(100)] + public string LoginProvider { get; set; } = null!; + + [StringLength(100)] + public string IdentityKey { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsExternalLogins")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsForm.cs b/Migration.Toolkit.KXP/Models/CmsForm.cs index cf357f52..4dddb38f 100644 --- a/Migration.Toolkit.KXP/Models/CmsForm.cs +++ b/Migration.Toolkit.KXP/Models/CmsForm.cs @@ -1,55 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Form")] -[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] -public partial class CmsForm -{ - [Key] - [Column("FormID")] - public int FormId { get; set; } - - [StringLength(100)] - public string FormDisplayName { get; set; } = null!; - - [StringLength(100)] - public string FormName { get; set; } = null!; - - [Column("FormClassID")] - public int FormClassId { get; set; } - - public int FormItems { get; set; } - - public string? FormReportFields { get; set; } - - [StringLength(400)] - public string? FormSubmitButtonText { get; set; } - - public int? FormAccess { get; set; } - - [StringLength(255)] - public string? FormSubmitButtonImage { get; set; } - - [Column("FormGUID")] - public Guid FormGuid { get; set; } - - public DateTime FormLastModified { get; set; } - - [Required] - public bool? FormLogActivity { get; set; } - - public string? FormBuilderLayout { get; set; } - - [ForeignKey("FormClassId")] - [InverseProperty("CmsForms")] - public virtual CmsClass FormClass { get; set; } = null!; - - [ForeignKey("FormId")] - [InverseProperty("Forms")] - public virtual ICollection Roles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Form")] +[Index("FormClassId", Name = "IX_CMS_Form_FormClassID")] +public class CmsForm +{ + [Key] + [Column("FormID")] + public int FormId { get; set; } + + [StringLength(100)] + public string FormDisplayName { get; set; } = null!; + + [StringLength(100)] + public string FormName { get; set; } = null!; + + [Column("FormClassID")] + public int FormClassId { get; set; } + + public int FormItems { get; set; } + + public string? FormReportFields { get; set; } + + [StringLength(400)] + public string? FormSubmitButtonText { get; set; } + + public int? FormAccess { get; set; } + + [StringLength(255)] + public string? FormSubmitButtonImage { get; set; } + + [Column("FormGUID")] + public Guid FormGuid { get; set; } + + public DateTime FormLastModified { get; set; } + + public bool FormLogActivity { get; set; } + + public string? FormBuilderLayout { get; set; } + + [ForeignKey("FormClassId")] + [InverseProperty("CmsForms")] + public virtual CmsClass FormClass { get; set; } = null!; + + [ForeignKey("FormId")] + [InverseProperty("Forms")] + public virtual ICollection Roles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs b/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs index 59df3689..717be636 100644 --- a/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs +++ b/Migration.Toolkit.KXP/Models/CmsFormFeaturedField.cs @@ -1,40 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_FormFeaturedField")] -public partial class CmsFormFeaturedField -{ - [Key] - [Column("FormFeaturedFieldID")] - public int FormFeaturedFieldId { get; set; } - - public Guid FormFeaturedFieldGuid { get; set; } - - public DateTime FormFeaturedFieldLastModified { get; set; } - - [StringLength(200)] - public string FormFeaturedFieldDisplayName { get; set; } = null!; - - public string FormFeaturedFieldFormDefinition { get; set; } = null!; - - [StringLength(200)] - public string? FormFeaturedFieldMapping { get; set; } - - public int FormFeaturedFieldOrder { get; set; } - - public string? FormFeaturedFieldDescription { get; set; } - - [StringLength(200)] - public string FormFeaturedFieldName { get; set; } = null!; - - [StringLength(200)] - public string FormFeaturedFieldIconClass { get; set; } = null!; - - [Required] - public bool? FormFeaturedFieldEnabled { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_FormFeaturedField")] +public class CmsFormFeaturedField +{ + [Key] + [Column("FormFeaturedFieldID")] + public int FormFeaturedFieldId { get; set; } + + public Guid FormFeaturedFieldGuid { get; set; } + + public DateTime FormFeaturedFieldLastModified { get; set; } + + [StringLength(200)] + public string FormFeaturedFieldDisplayName { get; set; } = null!; + + public string FormFeaturedFieldFormDefinition { get; set; } = null!; + + [StringLength(200)] + public string? FormFeaturedFieldMapping { get; set; } + + public int FormFeaturedFieldOrder { get; set; } + + public string? FormFeaturedFieldDescription { get; set; } + + [StringLength(200)] + public string FormFeaturedFieldName { get; set; } = null!; + + [StringLength(200)] + public string FormFeaturedFieldIconClass { get; set; } = null!; + + public bool FormFeaturedFieldEnabled { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs b/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs index cdb5c697..32056386 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs +++ b/Migration.Toolkit.KXP/Models/CmsHeadlessChannel.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_HeadlessChannel")] -[Index("HeadlessChannelChannelId", Name = "IX_CMS_HeadlessChannel_HeadlessChannelChannelID")] -[Index("HeadlessChannelPrimaryContentLanguageId", Name = "IX_CMS_HeadlessChannel_HeadlessChannelPrimaryContentLanguageID")] -public partial class CmsHeadlessChannel -{ - [Key] - [Column("HeadlessChannelID")] - public int HeadlessChannelId { get; set; } - - [Column("HeadlessChannelGUID")] - public Guid HeadlessChannelGuid { get; set; } - - [Column("HeadlessChannelChannelID")] - public int HeadlessChannelChannelId { get; set; } - - [Column("HeadlessChannelPrimaryContentLanguageID")] - public int HeadlessChannelPrimaryContentLanguageId { get; set; } - - [Column("HeadlessChannelPreviewURL")] - [StringLength(200)] - public string? HeadlessChannelPreviewUrl { get; set; } - - [InverseProperty("HeadlessItemHeadlessChannel")] - public virtual ICollection CmsHeadlessItems { get; set; } = new List(); - - [InverseProperty("HeadlessTokenHeadlessChannel")] - public virtual ICollection CmsHeadlessTokens { get; set; } = new List(); - - [ForeignKey("HeadlessChannelChannelId")] - [InverseProperty("CmsHeadlessChannels")] - public virtual CmsChannel HeadlessChannelChannel { get; set; } = null!; - - [ForeignKey("HeadlessChannelPrimaryContentLanguageId")] - [InverseProperty("CmsHeadlessChannels")] - public virtual CmsContentLanguage HeadlessChannelPrimaryContentLanguage { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_HeadlessChannel")] +[Index("HeadlessChannelChannelId", Name = "IX_CMS_HeadlessChannel_HeadlessChannelChannelID")] +[Index("HeadlessChannelPrimaryContentLanguageId", Name = "IX_CMS_HeadlessChannel_HeadlessChannelPrimaryContentLanguageID")] +public class CmsHeadlessChannel +{ + [Key] + [Column("HeadlessChannelID")] + public int HeadlessChannelId { get; set; } + + [Column("HeadlessChannelGUID")] + public Guid HeadlessChannelGuid { get; set; } + + [Column("HeadlessChannelChannelID")] + public int HeadlessChannelChannelId { get; set; } + + [Column("HeadlessChannelPrimaryContentLanguageID")] + public int HeadlessChannelPrimaryContentLanguageId { get; set; } + + [Column("HeadlessChannelPreviewURL")] + [StringLength(200)] + public string? HeadlessChannelPreviewUrl { get; set; } + + [InverseProperty("HeadlessItemHeadlessChannel")] + public virtual ICollection CmsHeadlessItems { get; set; } = new List(); + + [InverseProperty("HeadlessTokenHeadlessChannel")] + public virtual ICollection CmsHeadlessTokens { get; set; } = new List(); + + [ForeignKey("HeadlessChannelChannelId")] + [InverseProperty("CmsHeadlessChannels")] + public virtual CmsChannel HeadlessChannelChannel { get; set; } = null!; + + [ForeignKey("HeadlessChannelPrimaryContentLanguageId")] + [InverseProperty("CmsHeadlessChannels")] + public virtual CmsContentLanguage HeadlessChannelPrimaryContentLanguage { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs b/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs index 22aa8af0..6c66a1a5 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs +++ b/Migration.Toolkit.KXP/Models/CmsHeadlessItem.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_HeadlessItem")] -[Index("HeadlessItemContentItemId", Name = "IX_CMS_HeadlessItem_HeadlessItemContentItemID")] -[Index("HeadlessItemHeadlessChannelId", Name = "IX_CMS_HeadlessItem_HeadlessItemHeadlessChannelID")] -public partial class CmsHeadlessItem -{ - [Key] - [Column("HeadlessItemID")] - public int HeadlessItemId { get; set; } - - [Column("HeadlessItemGUID")] - public Guid HeadlessItemGuid { get; set; } - - [Column("HeadlessItemHeadlessChannelID")] - public int HeadlessItemHeadlessChannelId { get; set; } - - [Column("HeadlessItemContentItemID")] - public int HeadlessItemContentItemId { get; set; } - - [StringLength(200)] - public string HeadlessItemName { get; set; } = null!; - - [ForeignKey("HeadlessItemContentItemId")] - [InverseProperty("CmsHeadlessItems")] - public virtual CmsContentItem HeadlessItemContentItem { get; set; } = null!; - - [ForeignKey("HeadlessItemHeadlessChannelId")] - [InverseProperty("CmsHeadlessItems")] - public virtual CmsHeadlessChannel HeadlessItemHeadlessChannel { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_HeadlessItem")] +[Index("HeadlessItemContentItemId", Name = "IX_CMS_HeadlessItem_HeadlessItemContentItemID")] +[Index("HeadlessItemHeadlessChannelId", Name = "IX_CMS_HeadlessItem_HeadlessItemHeadlessChannelID")] +public class CmsHeadlessItem +{ + [Key] + [Column("HeadlessItemID")] + public int HeadlessItemId { get; set; } + + [Column("HeadlessItemGUID")] + public Guid HeadlessItemGuid { get; set; } + + [Column("HeadlessItemHeadlessChannelID")] + public int HeadlessItemHeadlessChannelId { get; set; } + + [Column("HeadlessItemContentItemID")] + public int HeadlessItemContentItemId { get; set; } + + [StringLength(200)] + public string HeadlessItemName { get; set; } = null!; + + [ForeignKey("HeadlessItemContentItemId")] + [InverseProperty("CmsHeadlessItems")] + public virtual CmsContentItem HeadlessItemContentItem { get; set; } = null!; + + [ForeignKey("HeadlessItemHeadlessChannelId")] + [InverseProperty("CmsHeadlessItems")] + public virtual CmsHeadlessChannel HeadlessItemHeadlessChannel { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs b/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs index 0eac3573..bbefd6cf 100644 --- a/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs +++ b/Migration.Toolkit.KXP/Models/CmsHeadlessToken.cs @@ -1,59 +1,57 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_HeadlessToken")] -[Index("HeadlessTokenCreatedByUserId", Name = "IX_CMS_HeadlessToken_HeadlessTokenCreatedByUserID")] -[Index("HeadlessTokenHash", Name = "IX_CMS_HeadlessToken_HeadlessTokenHash")] -[Index("HeadlessTokenHeadlessChannelId", Name = "IX_CMS_HeadlessToken_HeadlessTokenHeadlessChannelID")] -[Index("HeadlessTokenModifiedByUserId", Name = "IX_CMS_HeadlessToken_HeadlessTokenModifiedByUserID")] -public partial class CmsHeadlessToken -{ - [Key] - [Column("HeadlessTokenID")] - public int HeadlessTokenId { get; set; } - - [Column("HeadlessTokenGUID")] - public Guid HeadlessTokenGuid { get; set; } - - [Column("HeadlessTokenHeadlessChannelID")] - public int HeadlessTokenHeadlessChannelId { get; set; } - - [StringLength(200)] - public string HeadlessTokenDisplayName { get; set; } = null!; - - [Required] - public bool? HeadlessTokenEnabled { get; set; } - - public DateTime HeadlessTokenCreatedWhen { get; set; } - - [Column("HeadlessTokenCreatedByUserID")] - public int? HeadlessTokenCreatedByUserId { get; set; } - - public DateTime HeadlessTokenModifiedWhen { get; set; } - - [Column("HeadlessTokenModifiedByUserID")] - public int? HeadlessTokenModifiedByUserId { get; set; } - - [StringLength(64)] - public string HeadlessTokenHash { get; set; } = null!; - - [StringLength(200)] - public string HeadlessTokenAccessType { get; set; } = null!; - - [ForeignKey("HeadlessTokenCreatedByUserId")] - [InverseProperty("CmsHeadlessTokenHeadlessTokenCreatedByUsers")] - public virtual CmsUser? HeadlessTokenCreatedByUser { get; set; } - - [ForeignKey("HeadlessTokenHeadlessChannelId")] - [InverseProperty("CmsHeadlessTokens")] - public virtual CmsHeadlessChannel HeadlessTokenHeadlessChannel { get; set; } = null!; - - [ForeignKey("HeadlessTokenModifiedByUserId")] - [InverseProperty("CmsHeadlessTokenHeadlessTokenModifiedByUsers")] - public virtual CmsUser? HeadlessTokenModifiedByUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_HeadlessToken")] +[Index("HeadlessTokenCreatedByUserId", Name = "IX_CMS_HeadlessToken_HeadlessTokenCreatedByUserID")] +[Index("HeadlessTokenHash", Name = "IX_CMS_HeadlessToken_HeadlessTokenHash")] +[Index("HeadlessTokenHeadlessChannelId", Name = "IX_CMS_HeadlessToken_HeadlessTokenHeadlessChannelID")] +[Index("HeadlessTokenModifiedByUserId", Name = "IX_CMS_HeadlessToken_HeadlessTokenModifiedByUserID")] +public class CmsHeadlessToken +{ + [Key] + [Column("HeadlessTokenID")] + public int HeadlessTokenId { get; set; } + + [Column("HeadlessTokenGUID")] + public Guid HeadlessTokenGuid { get; set; } + + [Column("HeadlessTokenHeadlessChannelID")] + public int HeadlessTokenHeadlessChannelId { get; set; } + + [StringLength(200)] + public string HeadlessTokenDisplayName { get; set; } = null!; + + public bool HeadlessTokenEnabled { get; set; } + + public DateTime HeadlessTokenCreatedWhen { get; set; } + + [Column("HeadlessTokenCreatedByUserID")] + public int? HeadlessTokenCreatedByUserId { get; set; } + + public DateTime HeadlessTokenModifiedWhen { get; set; } + + [Column("HeadlessTokenModifiedByUserID")] + public int? HeadlessTokenModifiedByUserId { get; set; } + + [StringLength(64)] + public string HeadlessTokenHash { get; set; } = null!; + + [StringLength(200)] + public string HeadlessTokenAccessType { get; set; } = null!; + + [ForeignKey("HeadlessTokenCreatedByUserId")] + [InverseProperty("CmsHeadlessTokenHeadlessTokenCreatedByUsers")] + public virtual CmsUser? HeadlessTokenCreatedByUser { get; set; } + + [ForeignKey("HeadlessTokenHeadlessChannelId")] + [InverseProperty("CmsHeadlessTokens")] + public virtual CmsHeadlessChannel HeadlessTokenHeadlessChannel { get; set; } = null!; + + [ForeignKey("HeadlessTokenModifiedByUserId")] + [InverseProperty("CmsHeadlessTokenHeadlessTokenModifiedByUsers")] + public virtual CmsUser? HeadlessTokenModifiedByUser { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs b/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs index 8b97f848..13f68bdb 100644 --- a/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs +++ b/Migration.Toolkit.KXP/Models/CmsLicenseKey.cs @@ -1,28 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_LicenseKey")] -public partial class CmsLicenseKey -{ - [Key] - [Column("LicenseKeyID")] - public int LicenseKeyId { get; set; } - - [StringLength(255)] - public string? LicenseDomain { get; set; } - - public string? LicenseKey { get; set; } - - [StringLength(200)] - public string? LicenseEdition { get; set; } - - [StringLength(200)] - public string? LicenseExpiration { get; set; } - - public int? LicenseServers { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_LicenseKey")] +public class CmsLicenseKey +{ + [Key] + [Column("LicenseKeyID")] + public int LicenseKeyId { get; set; } + + [StringLength(255)] + public string? LicenseDomain { get; set; } + + public string? LicenseKey { get; set; } + + [StringLength(200)] + public string? LicenseEdition { get; set; } + + [StringLength(200)] + public string? LicenseExpiration { get; set; } + + public int? LicenseServers { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs b/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs index 3e27aacb..21388438 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs +++ b/Migration.Toolkit.KXP/Models/CmsMacroIdentity.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_MacroIdentity")] -[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] -public partial class CmsMacroIdentity -{ - [Key] - [Column("MacroIdentityID")] - public int MacroIdentityId { get; set; } - - public Guid MacroIdentityGuid { get; set; } - - public DateTime MacroIdentityLastModified { get; set; } - - [StringLength(200)] - public string MacroIdentityName { get; set; } = null!; - - [Column("MacroIdentityEffectiveUserID")] - public int? MacroIdentityEffectiveUserId { get; set; } - - [InverseProperty("UserMacroIdentityMacroIdentity")] - public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); - - [ForeignKey("MacroIdentityEffectiveUserId")] - [InverseProperty("CmsMacroIdentities")] - public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_MacroIdentity")] +[Index("MacroIdentityEffectiveUserId", Name = "IX_CMS_MacroIdentity_MacroIdentityEffectiveUserID")] +public class CmsMacroIdentity +{ + [Key] + [Column("MacroIdentityID")] + public int MacroIdentityId { get; set; } + + public Guid MacroIdentityGuid { get; set; } + + public DateTime MacroIdentityLastModified { get; set; } + + [StringLength(200)] + public string MacroIdentityName { get; set; } = null!; + + [Column("MacroIdentityEffectiveUserID")] + public int? MacroIdentityEffectiveUserId { get; set; } + + [InverseProperty("UserMacroIdentityMacroIdentity")] + public virtual ICollection CmsUserMacroIdentities { get; set; } = new List(); + + [ForeignKey("MacroIdentityEffectiveUserId")] + [InverseProperty("CmsMacroIdentities")] + public virtual CmsUser? MacroIdentityEffectiveUser { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRule.cs b/Migration.Toolkit.KXP/Models/CmsMacroRule.cs index 982a9aa9..1af2baa5 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroRule.cs +++ b/Migration.Toolkit.KXP/Models/CmsMacroRule.cs @@ -1,43 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_MacroRule")] -public partial class CmsMacroRule -{ - [Key] - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [StringLength(200)] - public string MacroRuleName { get; set; } = null!; - - [StringLength(1000)] - public string MacroRuleText { get; set; } = null!; - - public string? MacroRuleParameters { get; set; } - - public DateTime MacroRuleLastModified { get; set; } - - [Column("MacroRuleGUID")] - public Guid MacroRuleGuid { get; set; } - - public string MacroRuleCondition { get; set; } = null!; - - [StringLength(500)] - public string MacroRuleDisplayName { get; set; } = null!; - - public bool? MacroRuleIsCustom { get; set; } - - [StringLength(450)] - public string? MacroRuleDescription { get; set; } - - public bool? MacroRuleEnabled { get; set; } - - [InverseProperty("MacroRule")] - public virtual ICollection CmsMacroRuleMacroRuleCategories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_MacroRule")] +public class CmsMacroRule +{ + [Key] + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [StringLength(200)] + public string MacroRuleName { get; set; } = null!; + + [StringLength(1000)] + public string MacroRuleText { get; set; } = null!; + + public string? MacroRuleParameters { get; set; } + + public DateTime MacroRuleLastModified { get; set; } + + [Column("MacroRuleGUID")] + public Guid MacroRuleGuid { get; set; } + + public string MacroRuleCondition { get; set; } = null!; + + [StringLength(500)] + public string MacroRuleDisplayName { get; set; } = null!; + + public bool? MacroRuleIsCustom { get; set; } + + [StringLength(450)] + public string? MacroRuleDescription { get; set; } + + public bool? MacroRuleEnabled { get; set; } + + [InverseProperty("MacroRule")] + public virtual ICollection CmsMacroRuleMacroRuleCategories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs b/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs index b328ebb5..0dff1624 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs +++ b/Migration.Toolkit.KXP/Models/CmsMacroRuleCategory.cs @@ -1,33 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_MacroRuleCategory")] -public partial class CmsMacroRuleCategory -{ - [Key] - [Column("MacroRuleCategoryID")] - public int MacroRuleCategoryId { get; set; } - - public Guid MacroRuleCategoryGuid { get; set; } - - public DateTime MacroRuleCategoryLastModified { get; set; } - - [StringLength(200)] - public string MacroRuleCategoryName { get; set; } = null!; - - [StringLength(200)] - public string MacroRuleCategoryDisplayName { get; set; } = null!; - - [StringLength(450)] - public string? MacroRuleCategoryDescription { get; set; } - - public bool MacroRuleCategoryEnabled { get; set; } - - [InverseProperty("MacroRuleCategory")] - public virtual ICollection CmsMacroRuleMacroRuleCategories { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_MacroRuleCategory")] +public class CmsMacroRuleCategory +{ + [Key] + [Column("MacroRuleCategoryID")] + public int MacroRuleCategoryId { get; set; } + + public Guid MacroRuleCategoryGuid { get; set; } + + public DateTime MacroRuleCategoryLastModified { get; set; } + + [StringLength(200)] + public string MacroRuleCategoryName { get; set; } = null!; + + [StringLength(200)] + public string MacroRuleCategoryDisplayName { get; set; } = null!; + + [StringLength(450)] + public string? MacroRuleCategoryDescription { get; set; } + + public bool MacroRuleCategoryEnabled { get; set; } + + [InverseProperty("MacroRuleCategory")] + public virtual ICollection CmsMacroRuleMacroRuleCategories { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs b/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs index 3bcf619c..085ed09b 100644 --- a/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs +++ b/Migration.Toolkit.KXP/Models/CmsMacroRuleMacroRuleCategory.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_MacroRuleMacroRuleCategory")] -[Index("MacroRuleCategoryId", Name = "IX_CMS_MacroRuleMacroRuleCategory_MacroRuleCategoryID")] -[Index("MacroRuleId", Name = "IX_CMS_MacroRuleMacroRuleCategory_MacroRuleID")] -public partial class CmsMacroRuleMacroRuleCategory -{ - [Key] - [Column("MacroRuleMacroRuleCategoryID")] - public int MacroRuleMacroRuleCategoryId { get; set; } - - [Column("MacroRuleID")] - public int MacroRuleId { get; set; } - - [Column("MacroRuleCategoryID")] - public int MacroRuleCategoryId { get; set; } - - [ForeignKey("MacroRuleId")] - [InverseProperty("CmsMacroRuleMacroRuleCategories")] - public virtual CmsMacroRule MacroRule { get; set; } = null!; - - [ForeignKey("MacroRuleCategoryId")] - [InverseProperty("CmsMacroRuleMacroRuleCategories")] - public virtual CmsMacroRuleCategory MacroRuleCategory { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_MacroRuleMacroRuleCategory")] +[Index("MacroRuleCategoryId", Name = "IX_CMS_MacroRuleMacroRuleCategory_MacroRuleCategoryID")] +[Index("MacroRuleId", Name = "IX_CMS_MacroRuleMacroRuleCategory_MacroRuleID")] +public class CmsMacroRuleMacroRuleCategory +{ + [Key] + [Column("MacroRuleMacroRuleCategoryID")] + public int MacroRuleMacroRuleCategoryId { get; set; } + + [Column("MacroRuleID")] + public int MacroRuleId { get; set; } + + [Column("MacroRuleCategoryID")] + public int MacroRuleCategoryId { get; set; } + + [ForeignKey("MacroRuleId")] + [InverseProperty("CmsMacroRuleMacroRuleCategories")] + public virtual CmsMacroRule MacroRule { get; set; } = null!; + + [ForeignKey("MacroRuleCategoryId")] + [InverseProperty("CmsMacroRuleMacroRuleCategories")] + public virtual CmsMacroRuleCategory MacroRuleCategory { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsMember.cs b/Migration.Toolkit.KXP/Models/CmsMember.cs index c6037d26..f64dc462 100644 --- a/Migration.Toolkit.KXP/Models/CmsMember.cs +++ b/Migration.Toolkit.KXP/Models/CmsMember.cs @@ -1,35 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Member")] -public partial class CmsMember -{ - [Key] - [Column("MemberID")] - public int MemberId { get; set; } - - [StringLength(254)] - public string? MemberEmail { get; set; } - - public bool MemberEnabled { get; set; } - - public DateTime MemberCreated { get; set; } - - public Guid MemberGuid { get; set; } - - [StringLength(254)] - public string? MemberName { get; set; } - - [StringLength(100)] - public string? MemberPassword { get; set; } - - public bool MemberIsExternal { get; set; } - - [StringLength(72)] - public string? MemberSecurityStamp { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Member")] +public class CmsMember +{ + [Key] + [Column("MemberID")] + public int MemberId { get; set; } + + [StringLength(254)] + public string? MemberEmail { get; set; } + + public bool MemberEnabled { get; set; } + + public DateTime MemberCreated { get; set; } + + public Guid MemberGuid { get; set; } + + [StringLength(254)] + public string? MemberName { get; set; } + + [StringLength(100)] + public string? MemberPassword { get; set; } + + public bool MemberIsExternal { get; set; } + + [StringLength(72)] + public string? MemberSecurityStamp { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs b/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs index c2b3d245..3921e726 100644 --- a/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs +++ b/Migration.Toolkit.KXP/Models/CmsMemberExternalLogin.cs @@ -1,26 +1,25 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_MemberExternalLogin")] -[Index("MemberExternalLoginLoginProvider", "MemberExternalLoginIdentityKey", Name = "IX_CMS_MemberExternalLogin_MemberExternalLoginLoginProvider_MemberExternalLoginIdentityKey", IsUnique = true)] -[Index("MemberExternalLoginMemberId", Name = "IX_CMS_MemberExternalLogin_MemberExternalLoginMemberID")] -public partial class CmsMemberExternalLogin -{ - [Key] - [Column("MemberExternalLoginID")] - public int MemberExternalLoginId { get; set; } - - [Column("MemberExternalLoginMemberID")] - public int MemberExternalLoginMemberId { get; set; } - - [StringLength(100)] - public string MemberExternalLoginLoginProvider { get; set; } = null!; - - [StringLength(100)] - public string MemberExternalLoginIdentityKey { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_MemberExternalLogin")] +[Index("MemberExternalLoginLoginProvider", "MemberExternalLoginIdentityKey", Name = "IX_CMS_MemberExternalLogin_MemberExternalLoginLoginProvider_MemberExternalLoginIdentityKey", IsUnique = true)] +[Index("MemberExternalLoginMemberId", Name = "IX_CMS_MemberExternalLogin_MemberExternalLoginMemberID")] +public class CmsMemberExternalLogin +{ + [Key] + [Column("MemberExternalLoginID")] + public int MemberExternalLoginId { get; set; } + + [Column("MemberExternalLoginMemberID")] + public int MemberExternalLoginMemberId { get; set; } + + [StringLength(100)] + public string MemberExternalLoginLoginProvider { get; set; } = null!; + + [StringLength(100)] + public string MemberExternalLoginIdentityKey { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs b/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs index d29e2e45..92686b2b 100644 --- a/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs +++ b/Migration.Toolkit.KXP/Models/CmsObjectWorkflowTrigger.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ObjectWorkflowTrigger")] -[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] -public partial class CmsObjectWorkflowTrigger -{ - [Key] - [Column("TriggerID")] - public int TriggerId { get; set; } - - [Column("TriggerGUID")] - public Guid TriggerGuid { get; set; } - - public DateTime TriggerLastModified { get; set; } - - public int TriggerType { get; set; } - - public string? TriggerMacroCondition { get; set; } - - [Column("TriggerWorkflowID")] - public int TriggerWorkflowId { get; set; } - - [StringLength(450)] - public string TriggerDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TriggerObjectType { get; set; } = null!; - - public string? TriggerParameters { get; set; } - - [StringLength(100)] - public string? TriggerTargetObjectType { get; set; } - - [Column("TriggerTargetObjectID")] - public int? TriggerTargetObjectId { get; set; } - - [ForeignKey("TriggerWorkflowId")] - [InverseProperty("CmsObjectWorkflowTriggers")] - public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ObjectWorkflowTrigger")] +[Index("TriggerWorkflowId", Name = "IX_CMS_ObjectWorkflowTrigger_TriggerWorkflowID")] +public class CmsObjectWorkflowTrigger +{ + [Key] + [Column("TriggerID")] + public int TriggerId { get; set; } + + [Column("TriggerGUID")] + public Guid TriggerGuid { get; set; } + + public DateTime TriggerLastModified { get; set; } + + public int TriggerType { get; set; } + + public string? TriggerMacroCondition { get; set; } + + [Column("TriggerWorkflowID")] + public int TriggerWorkflowId { get; set; } + + [StringLength(450)] + public string TriggerDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TriggerObjectType { get; set; } = null!; + + public string? TriggerParameters { get; set; } + + [StringLength(100)] + public string? TriggerTargetObjectType { get; set; } + + [Column("TriggerTargetObjectID")] + public int? TriggerTargetObjectId { get; set; } + + [ForeignKey("TriggerWorkflowId")] + [InverseProperty("CmsObjectWorkflowTriggers")] + public virtual CmsWorkflow TriggerWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs b/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs index 7bc6d6c3..e35748e7 100644 --- a/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs +++ b/Migration.Toolkit.KXP/Models/CmsPageTemplateConfiguration.cs @@ -1,32 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_PageTemplateConfiguration")] -public partial class CmsPageTemplateConfiguration -{ - [Key] - [Column("PageTemplateConfigurationID")] - public int PageTemplateConfigurationId { get; set; } - - [Column("PageTemplateConfigurationGUID")] - public Guid PageTemplateConfigurationGuid { get; set; } - - public DateTime PageTemplateConfigurationLastModified { get; set; } - - [StringLength(200)] - public string PageTemplateConfigurationName { get; set; } = null!; - - public string? PageTemplateConfigurationDescription { get; set; } - - public string PageTemplateConfigurationTemplate { get; set; } = null!; - - public string? PageTemplateConfigurationWidgets { get; set; } - - [StringLength(200)] - public string PageTemplateConfigurationIcon { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_PageTemplateConfiguration")] +public class CmsPageTemplateConfiguration +{ + [Key] + [Column("PageTemplateConfigurationID")] + public int PageTemplateConfigurationId { get; set; } + + [Column("PageTemplateConfigurationGUID")] + public Guid PageTemplateConfigurationGuid { get; set; } + + public DateTime PageTemplateConfigurationLastModified { get; set; } + + [StringLength(200)] + public string PageTemplateConfigurationName { get; set; } = null!; + + public string? PageTemplateConfigurationDescription { get; set; } + + public string PageTemplateConfigurationTemplate { get; set; } = null!; + + public string? PageTemplateConfigurationWidgets { get; set; } + + [StringLength(200)] + public string PageTemplateConfigurationIcon { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsQuery.cs b/Migration.Toolkit.KXP/Models/CmsQuery.cs index d1eb246c..18b1b8fe 100644 --- a/Migration.Toolkit.KXP/Models/CmsQuery.cs +++ b/Migration.Toolkit.KXP/Models/CmsQuery.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Query")] -[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] -public partial class CmsQuery -{ - [Key] - [Column("QueryID")] - public int QueryId { get; set; } - - [StringLength(100)] - public string QueryName { get; set; } = null!; - - [Column("QueryTypeID")] - public int QueryTypeId { get; set; } - - public string QueryText { get; set; } = null!; - - public bool QueryRequiresTransaction { get; set; } - - [Column("ClassID")] - public int? ClassId { get; set; } - - public DateTime QueryLastModified { get; set; } - - [Column("QueryGUID")] - public Guid QueryGuid { get; set; } - - public bool? QueryIsCustom { get; set; } - - [StringLength(100)] - public string? QueryConnectionString { get; set; } - - [ForeignKey("ClassId")] - [InverseProperty("CmsQueries")] - public virtual CmsClass? Class { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Query")] +[Index("ClassId", "QueryName", Name = "IX_CMS_Query_QueryClassID_QueryName")] +public class CmsQuery +{ + [Key] + [Column("QueryID")] + public int QueryId { get; set; } + + [StringLength(100)] + public string QueryName { get; set; } = null!; + + [Column("QueryTypeID")] + public int QueryTypeId { get; set; } + + public string QueryText { get; set; } = null!; + + public bool QueryRequiresTransaction { get; set; } + + [Column("ClassID")] + public int? ClassId { get; set; } + + public DateTime QueryLastModified { get; set; } + + [Column("QueryGUID")] + public Guid QueryGuid { get; set; } + + public bool? QueryIsCustom { get; set; } + + [StringLength(100)] + public string? QueryConnectionString { get; set; } + + [ForeignKey("ClassId")] + [InverseProperty("CmsQueries")] + public virtual CmsClass? Class { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsResource.cs b/Migration.Toolkit.KXP/Models/CmsResource.cs index 8b94979f..25a160df 100644 --- a/Migration.Toolkit.KXP/Models/CmsResource.cs +++ b/Migration.Toolkit.KXP/Models/CmsResource.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Resource")] -[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] -public partial class CmsResource -{ - [Key] - [Column("ResourceID")] - public int ResourceId { get; set; } - - [StringLength(100)] - public string ResourceDisplayName { get; set; } = null!; - - [StringLength(100)] - public string ResourceName { get; set; } = null!; - - public string? ResourceDescription { get; set; } - - [Column("ResourceGUID")] - public Guid ResourceGuid { get; set; } - - public DateTime ResourceLastModified { get; set; } - - public bool? ResourceIsInDevelopment { get; set; } - - [InverseProperty("ClassResource")] - public virtual ICollection CmsClasses { get; set; } = new List(); - - [InverseProperty("CategoryResource")] - public virtual ICollection CmsSettingsCategories { get; set; } = new List(); - - [InverseProperty("ActionResource")] - public virtual ICollection CmsWorkflowActions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Resource")] +[Index("ResourceName", Name = "IX_CMS_Resource_ResourceName")] +public class CmsResource +{ + [Key] + [Column("ResourceID")] + public int ResourceId { get; set; } + + [StringLength(100)] + public string ResourceDisplayName { get; set; } = null!; + + [StringLength(100)] + public string ResourceName { get; set; } = null!; + + public string? ResourceDescription { get; set; } + + [Column("ResourceGUID")] + public Guid ResourceGuid { get; set; } + + public DateTime ResourceLastModified { get; set; } + + public bool? ResourceIsInDevelopment { get; set; } + + [InverseProperty("ClassResource")] + public virtual ICollection CmsClasses { get; set; } = new List(); + + [InverseProperty("CategoryResource")] + public virtual ICollection CmsSettingsCategories { get; set; } = new List(); + + [InverseProperty("ActionResource")] + public virtual ICollection CmsWorkflowActions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsResourceString.cs b/Migration.Toolkit.KXP/Models/CmsResourceString.cs index 2c34cc26..dad6a202 100644 --- a/Migration.Toolkit.KXP/Models/CmsResourceString.cs +++ b/Migration.Toolkit.KXP/Models/CmsResourceString.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ResourceString")] -[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] -public partial class CmsResourceString -{ - [Key] - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("StringGUID")] - public Guid StringGuid { get; set; } - - [InverseProperty("TranslationString")] - public virtual ICollection CmsResourceTranslations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ResourceString")] +[Index("StringKey", Name = "IX_CMS_ResourceString_StringKey")] +public class CmsResourceString +{ + [Key] + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("StringGUID")] + public Guid StringGuid { get; set; } + + [InverseProperty("TranslationString")] + public virtual ICollection CmsResourceTranslations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs b/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs index e8f53d59..f81e9cd2 100644 --- a/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs +++ b/Migration.Toolkit.KXP/Models/CmsResourceTranslation.cs @@ -1,33 +1,32 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ResourceTranslation")] -[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] -[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] -public partial class CmsResourceTranslation -{ - [Key] - [Column("TranslationID")] - public int TranslationId { get; set; } - - [Column("TranslationStringID")] - public int TranslationStringId { get; set; } - - public string? TranslationText { get; set; } - - [Column("TranslationCultureID")] - public int TranslationCultureId { get; set; } - - [ForeignKey("TranslationCultureId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsCulture TranslationCulture { get; set; } = null!; - - [ForeignKey("TranslationStringId")] - [InverseProperty("CmsResourceTranslations")] - public virtual CmsResourceString TranslationString { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ResourceTranslation")] +[Index("TranslationCultureId", Name = "IX_CMS_ResourceTranslation_TranslationCultureID")] +[Index("TranslationStringId", Name = "IX_CMS_ResourceTranslation_TranslationStringID")] +public class CmsResourceTranslation +{ + [Key] + [Column("TranslationID")] + public int TranslationId { get; set; } + + [Column("TranslationStringID")] + public int TranslationStringId { get; set; } + + public string? TranslationText { get; set; } + + [Column("TranslationCultureID")] + public int TranslationCultureId { get; set; } + + [ForeignKey("TranslationCultureId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsCulture TranslationCulture { get; set; } = null!; + + [ForeignKey("TranslationStringId")] + [InverseProperty("CmsResourceTranslations")] + public virtual CmsResourceString TranslationString { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsRole.cs b/Migration.Toolkit.KXP/Models/CmsRole.cs index 37a750d6..f2a42502 100644 --- a/Migration.Toolkit.KXP/Models/CmsRole.cs +++ b/Migration.Toolkit.KXP/Models/CmsRole.cs @@ -1,41 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Role")] -public partial class CmsRole -{ - [Key] - [Column("RoleID")] - public int RoleId { get; set; } - - [StringLength(100)] - public string RoleDisplayName { get; set; } = null!; - - [StringLength(100)] - public string RoleName { get; set; } = null!; - - public string? RoleDescription { get; set; } - - [Column("RoleGUID")] - public Guid RoleGuid { get; set; } - - public DateTime RoleLastModified { get; set; } - - [InverseProperty("Role")] - public virtual ICollection CmsApplicationPermissions { get; set; } = new List(); - - [InverseProperty("ContentWorkflowStepRoleRole")] - public virtual ICollection CmsContentWorkflowStepRoles { get; set; } = new List(); - - [InverseProperty("Role")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [ForeignKey("RoleId")] - [InverseProperty("Roles")] - public virtual ICollection Forms { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Role")] +public class CmsRole +{ + [Key] + [Column("RoleID")] + public int RoleId { get; set; } + + [StringLength(100)] + public string RoleDisplayName { get; set; } = null!; + + [StringLength(100)] + public string RoleName { get; set; } = null!; + + public string? RoleDescription { get; set; } + + [Column("RoleGUID")] + public Guid RoleGuid { get; set; } + + public DateTime RoleLastModified { get; set; } + + [InverseProperty("Role")] + public virtual ICollection CmsApplicationPermissions { get; set; } = new List(); + + [InverseProperty("ContentWorkflowStepRoleRole")] + public virtual ICollection CmsContentWorkflowStepRoles { get; set; } = new List(); + + [InverseProperty("Role")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [ForeignKey("RoleId")] + [InverseProperty("Roles")] + public virtual ICollection Forms { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs b/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs index bff6fcc1..fd47d4f0 100644 --- a/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs +++ b/Migration.Toolkit.KXP/Models/CmsScheduledTask.cs @@ -1,74 +1,73 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_ScheduledTask")] -[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] -[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] -public partial class CmsScheduledTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(200)] - public string TaskName { get; set; } = null!; - - [StringLength(200)] - public string TaskDisplayName { get; set; } = null!; - - [StringLength(200)] - public string TaskAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string? TaskClass { get; set; } - - [StringLength(1000)] - public string TaskInterval { get; set; } = null!; - - public string TaskData { get; set; } = null!; - - public DateTime? TaskLastRunTime { get; set; } - - public DateTime? TaskNextRunTime { get; set; } - - public string? TaskLastResult { get; set; } - - public bool? TaskDeleteAfterLastRun { get; set; } - - [StringLength(100)] - public string? TaskServerName { get; set; } - - [Column("TaskGUID")] - public Guid TaskGuid { get; set; } - - public DateTime TaskLastModified { get; set; } - - public int? TaskExecutions { get; set; } - - [Column("TaskUserID")] - public int? TaskUserId { get; set; } - - public int? TaskType { get; set; } - - [StringLength(100)] - public string? TaskObjectType { get; set; } - - [Column("TaskObjectID")] - public int? TaskObjectId { get; set; } - - [StringLength(200)] - public string? TaskExecutingServerName { get; set; } - - public bool TaskEnabled { get; set; } - - public bool TaskIsRunning { get; set; } - - [ForeignKey("TaskUserId")] - [InverseProperty("CmsScheduledTasks")] - public virtual CmsUser? TaskUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_ScheduledTask")] +[Index("TaskNextRunTime", "TaskEnabled", "TaskServerName", Name = "IX_CMS_ScheduledTask_TaskNextRunTime_TaskEnabled_TaskServerName")] +[Index("TaskUserId", Name = "IX_CMS_ScheduledTask_TaskUserID")] +public class CmsScheduledTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(200)] + public string TaskName { get; set; } = null!; + + [StringLength(200)] + public string TaskDisplayName { get; set; } = null!; + + [StringLength(200)] + public string TaskAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string? TaskClass { get; set; } + + [StringLength(1000)] + public string TaskInterval { get; set; } = null!; + + public string TaskData { get; set; } = null!; + + public DateTime? TaskLastRunTime { get; set; } + + public DateTime? TaskNextRunTime { get; set; } + + public string? TaskLastResult { get; set; } + + public bool? TaskDeleteAfterLastRun { get; set; } + + [StringLength(100)] + public string? TaskServerName { get; set; } + + [Column("TaskGUID")] + public Guid TaskGuid { get; set; } + + public DateTime TaskLastModified { get; set; } + + public int? TaskExecutions { get; set; } + + [Column("TaskUserID")] + public int? TaskUserId { get; set; } + + public int? TaskType { get; set; } + + [StringLength(100)] + public string? TaskObjectType { get; set; } + + [Column("TaskObjectID")] + public int? TaskObjectId { get; set; } + + [StringLength(200)] + public string? TaskExecutingServerName { get; set; } + + public bool TaskEnabled { get; set; } + + public bool TaskIsRunning { get; set; } + + [ForeignKey("TaskUserId")] + [InverseProperty("CmsScheduledTasks")] + public virtual CmsUser? TaskUser { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs b/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs index dd8ad9c9..44bed3b0 100644 --- a/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs +++ b/Migration.Toolkit.KXP/Models/CmsSettingsCategory.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_SettingsCategory")] -[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] -[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] -public partial class CmsSettingsCategory -{ - [Key] - [Column("CategoryID")] - public int CategoryId { get; set; } - - [StringLength(200)] - public string CategoryDisplayName { get; set; } = null!; - - public int? CategoryOrder { get; set; } - - [StringLength(100)] - public string? CategoryName { get; set; } - - [Column("CategoryParentID")] - public int? CategoryParentId { get; set; } - - [Column("CategoryIDPath")] - [StringLength(450)] - public string? CategoryIdpath { get; set; } - - public int? CategoryLevel { get; set; } - - public int? CategoryChildCount { get; set; } - - [StringLength(200)] - public string? CategoryIconPath { get; set; } - - public bool? CategoryIsGroup { get; set; } - - public bool? CategoryIsCustom { get; set; } - - [Column("CategoryResourceID")] - public int? CategoryResourceId { get; set; } - - [ForeignKey("CategoryParentId")] - [InverseProperty("InverseCategoryParent")] - public virtual CmsSettingsCategory? CategoryParent { get; set; } - - [ForeignKey("CategoryResourceId")] - [InverseProperty("CmsSettingsCategories")] - public virtual CmsResource? CategoryResource { get; set; } - - [InverseProperty("KeyCategory")] - public virtual ICollection CmsSettingsKeys { get; set; } = new List(); - - [InverseProperty("CategoryParent")] - public virtual ICollection InverseCategoryParent { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_SettingsCategory")] +[Index("CategoryParentId", Name = "IX_CMS_SettingsCategory_CategoryParentID")] +[Index("CategoryResourceId", Name = "IX_CMS_SettingsCategory_CategoryResourceID")] +public class CmsSettingsCategory +{ + [Key] + [Column("CategoryID")] + public int CategoryId { get; set; } + + [StringLength(200)] + public string CategoryDisplayName { get; set; } = null!; + + public int? CategoryOrder { get; set; } + + [StringLength(100)] + public string? CategoryName { get; set; } + + [Column("CategoryParentID")] + public int? CategoryParentId { get; set; } + + [Column("CategoryIDPath")] + [StringLength(450)] + public string? CategoryIdpath { get; set; } + + public int? CategoryLevel { get; set; } + + public int? CategoryChildCount { get; set; } + + [StringLength(200)] + public string? CategoryIconPath { get; set; } + + public bool? CategoryIsGroup { get; set; } + + public bool? CategoryIsCustom { get; set; } + + [Column("CategoryResourceID")] + public int? CategoryResourceId { get; set; } + + [ForeignKey("CategoryParentId")] + [InverseProperty("InverseCategoryParent")] + public virtual CmsSettingsCategory? CategoryParent { get; set; } + + [ForeignKey("CategoryResourceId")] + [InverseProperty("CmsSettingsCategories")] + public virtual CmsResource? CategoryResource { get; set; } + + [InverseProperty("KeyCategory")] + public virtual ICollection CmsSettingsKeys { get; set; } = new List(); + + [InverseProperty("CategoryParent")] + public virtual ICollection InverseCategoryParent { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs b/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs index 46d98081..f3fc64da 100644 --- a/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs +++ b/Migration.Toolkit.KXP/Models/CmsSettingsKey.cs @@ -1,58 +1,57 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_SettingsKey")] -[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] -[Index("KeyName", Name = "IX_CMS_SettingsKey_KeyName")] -public partial class CmsSettingsKey -{ - [Key] - [Column("KeyID")] - public int KeyId { get; set; } - - [StringLength(100)] - public string KeyName { get; set; } = null!; - - [StringLength(200)] - public string KeyDisplayName { get; set; } = null!; - - public string? KeyDescription { get; set; } - - public string? KeyValue { get; set; } - - [StringLength(50)] - public string KeyType { get; set; } = null!; - - [Column("KeyCategoryID")] - public int? KeyCategoryId { get; set; } - - [Column("KeyGUID")] - public Guid KeyGuid { get; set; } - - public DateTime KeyLastModified { get; set; } - - public int? KeyOrder { get; set; } - - [StringLength(255)] - public string? KeyValidation { get; set; } - - [StringLength(200)] - public string? KeyEditingControlPath { get; set; } - - public bool? KeyIsCustom { get; set; } - - public bool? KeyIsHidden { get; set; } - - public string? KeyFormControlSettings { get; set; } - - public string? KeyExplanationText { get; set; } - - [ForeignKey("KeyCategoryId")] - [InverseProperty("CmsSettingsKeys")] - public virtual CmsSettingsCategory? KeyCategory { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_SettingsKey")] +[Index("KeyCategoryId", Name = "IX_CMS_SettingsKey_KeyCategoryID")] +[Index("KeyName", Name = "IX_CMS_SettingsKey_KeyName")] +public class CmsSettingsKey +{ + [Key] + [Column("KeyID")] + public int KeyId { get; set; } + + [StringLength(100)] + public string KeyName { get; set; } = null!; + + [StringLength(200)] + public string KeyDisplayName { get; set; } = null!; + + public string? KeyDescription { get; set; } + + public string? KeyValue { get; set; } + + [StringLength(50)] + public string KeyType { get; set; } = null!; + + [Column("KeyCategoryID")] + public int? KeyCategoryId { get; set; } + + [Column("KeyGUID")] + public Guid KeyGuid { get; set; } + + public DateTime KeyLastModified { get; set; } + + public int? KeyOrder { get; set; } + + [StringLength(255)] + public string? KeyValidation { get; set; } + + [StringLength(200)] + public string? KeyEditingControlPath { get; set; } + + public bool? KeyIsCustom { get; set; } + + public bool? KeyIsHidden { get; set; } + + public string? KeyFormControlSettings { get; set; } + + public string? KeyExplanationText { get; set; } + + [ForeignKey("KeyCategoryId")] + [InverseProperty("CmsSettingsKeys")] + public virtual CmsSettingsCategory? KeyCategory { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsSmartFolder.cs b/Migration.Toolkit.KXP/Models/CmsSmartFolder.cs new file mode 100644 index 00000000..98f28ae2 --- /dev/null +++ b/Migration.Toolkit.KXP/Models/CmsSmartFolder.cs @@ -0,0 +1,46 @@ +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_SmartFolder")] +[Index("SmartFolderCreatedByUserId", Name = "IX_CMS_SmartFolder_SmartFolderCreatedByUserID")] +[Index("SmartFolderGuid", Name = "IX_CMS_SmartFolder_SmartFolderGUID_Unique", IsUnique = true)] +[Index("SmartFolderModifiedByUserId", Name = "IX_CMS_SmartFolder_SmartFolderModifiedByUserID")] +public class CmsSmartFolder +{ + [Key] + [Column("SmartFolderID")] + public int SmartFolderId { get; set; } + + [Column("SmartFolderGUID")] + public Guid SmartFolderGuid { get; set; } + + [StringLength(50)] + public string SmartFolderName { get; set; } = null!; + + [StringLength(50)] + public string SmartFolderDisplayName { get; set; } = null!; + + public DateTime SmartFolderCreatedWhen { get; set; } + + [Column("SmartFolderCreatedByUserID")] + public int? SmartFolderCreatedByUserId { get; set; } + + public DateTime? SmartFolderModifiedWhen { get; set; } + + [Column("SmartFolderModifiedByUserID")] + public int? SmartFolderModifiedByUserId { get; set; } + + public string SmartFolderFilter { get; set; } = null!; + + [ForeignKey("SmartFolderCreatedByUserId")] + [InverseProperty("CmsSmartFolderSmartFolderCreatedByUsers")] + public virtual CmsUser? SmartFolderCreatedByUser { get; set; } + + [ForeignKey("SmartFolderModifiedByUserId")] + [InverseProperty("CmsSmartFolderSmartFolderModifiedByUsers")] + public virtual CmsUser? SmartFolderModifiedByUser { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsState.cs b/Migration.Toolkit.KXP/Models/CmsState.cs index 38f2e33d..4e7d8c06 100644 --- a/Migration.Toolkit.KXP/Models/CmsState.cs +++ b/Migration.Toolkit.KXP/Models/CmsState.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_State")] -[Index("CountryId", Name = "IX_CMS_State_CountryID")] -[Index("StateCode", Name = "IX_CMS_State_StateCode")] -public partial class CmsState -{ - [Key] - [Column("StateID")] - public int StateId { get; set; } - - [StringLength(200)] - public string StateDisplayName { get; set; } = null!; - - [StringLength(200)] - public string StateName { get; set; } = null!; - - [StringLength(100)] - public string? StateCode { get; set; } - - [Column("CountryID")] - public int CountryId { get; set; } - - [Column("StateGUID")] - public Guid StateGuid { get; set; } - - public DateTime StateLastModified { get; set; } - - [ForeignKey("CountryId")] - [InverseProperty("CmsStates")] - public virtual CmsCountry Country { get; set; } = null!; - - [InverseProperty("AccountState")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactState")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_State")] +[Index("CountryId", Name = "IX_CMS_State_CountryID")] +[Index("StateCode", Name = "IX_CMS_State_StateCode")] +public class CmsState +{ + [Key] + [Column("StateID")] + public int StateId { get; set; } + + [StringLength(200)] + public string StateDisplayName { get; set; } = null!; + + [StringLength(200)] + public string StateName { get; set; } = null!; + + [StringLength(100)] + public string? StateCode { get; set; } + + [Column("CountryID")] + public int CountryId { get; set; } + + [Column("StateGUID")] + public Guid StateGuid { get; set; } + + public DateTime StateLastModified { get; set; } + + [ForeignKey("CountryId")] + [InverseProperty("CmsStates")] + public virtual CmsCountry Country { get; set; } = null!; + + [InverseProperty("AccountState")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactState")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsTag.cs b/Migration.Toolkit.KXP/Models/CmsTag.cs index f78f7f4c..31a7e305 100644 --- a/Migration.Toolkit.KXP/Models/CmsTag.cs +++ b/Migration.Toolkit.KXP/Models/CmsTag.cs @@ -1,52 +1,50 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Tag")] -[Index("TagParentId", Name = "IX_CMS_Tag_TagParentID")] -[Index("TagTaxonomyId", Name = "IX_CMS_Tag_TagTaxonomyID")] -[Index("TagTitle", "TagTaxonomyId", Name = "IX_CMS_Tag_TagTitle_TagTaxonomyID_Unique", IsUnique = true)] -public partial class CmsTag -{ - [Key] - [Column("TagID")] - public int TagId { get; set; } - - [StringLength(200)] - public string TagName { get; set; } = null!; - - [Column("TagGUID")] - public Guid TagGuid { get; set; } - - [Column("TagTaxonomyID")] - public int TagTaxonomyId { get; set; } - - [Column("TagParentID")] - public int? TagParentId { get; set; } - - public int? TagOrder { get; set; } - - public string? TagMetadata { get; set; } - - public DateTime TagLastModified { get; set; } - - [StringLength(200)] - public string TagTitle { get; set; } = null!; - - public string? TagDescription { get; set; } - - [InverseProperty("TagParent")] - public virtual ICollection InverseTagParent { get; set; } = new List(); - - [ForeignKey("TagParentId")] - [InverseProperty("InverseTagParent")] - public virtual CmsTag? TagParent { get; set; } - - [ForeignKey("TagTaxonomyId")] - [InverseProperty("CmsTags")] - public virtual CmsTaxonomy TagTaxonomy { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Tag")] +[Index("TagParentId", Name = "IX_CMS_Tag_TagParentID")] +[Index("TagTaxonomyId", Name = "IX_CMS_Tag_TagTaxonomyID")] +public class CmsTag +{ + [Key] + [Column("TagID")] + public int TagId { get; set; } + + [StringLength(200)] + public string TagName { get; set; } = null!; + + [Column("TagGUID")] + public Guid TagGuid { get; set; } + + [Column("TagTaxonomyID")] + public int TagTaxonomyId { get; set; } + + [Column("TagParentID")] + public int? TagParentId { get; set; } + + public int? TagOrder { get; set; } + + public string? TagMetadata { get; set; } + + public DateTime TagLastModified { get; set; } + + [StringLength(200)] + public string TagTitle { get; set; } = null!; + + public string? TagDescription { get; set; } + + [InverseProperty("TagParent")] + public virtual ICollection InverseTagParent { get; set; } = new List(); + + [ForeignKey("TagParentId")] + [InverseProperty("InverseTagParent")] + public virtual CmsTag? TagParent { get; set; } + + [ForeignKey("TagTaxonomyId")] + [InverseProperty("CmsTags")] + public virtual CmsTaxonomy TagTaxonomy { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs b/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs index 221686cd..7a472a08 100644 --- a/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs +++ b/Migration.Toolkit.KXP/Models/CmsTaxonomy.cs @@ -1,34 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Taxonomy")] -[Index("TaxonomyTitle", Name = "IX_CMS_Taxonomy_TaxonomyTitle_Unique", IsUnique = true)] -public partial class CmsTaxonomy -{ - [Key] - [Column("TaxonomyID")] - public int TaxonomyId { get; set; } - - [StringLength(200)] - public string TaxonomyName { get; set; } = null!; - - [Column("TaxonomyGUID")] - public Guid TaxonomyGuid { get; set; } - - public string? TaxonomyMetadata { get; set; } - - public DateTime TaxonomyLastModified { get; set; } - - [StringLength(200)] - public string TaxonomyTitle { get; set; } = null!; - - public string? TaxonomyDescription { get; set; } - - [InverseProperty("TagTaxonomy")] - public virtual ICollection CmsTags { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Taxonomy")] +public class CmsTaxonomy +{ + [Key] + [Column("TaxonomyID")] + public int TaxonomyId { get; set; } + + [StringLength(200)] + public string TaxonomyName { get; set; } = null!; + + [Column("TaxonomyGUID")] + public Guid TaxonomyGuid { get; set; } + + public string? TaxonomyMetadata { get; set; } + + public DateTime TaxonomyLastModified { get; set; } + + [StringLength(200)] + public string TaxonomyTitle { get; set; } = null!; + + public string? TaxonomyDescription { get; set; } + + [InverseProperty("TagTaxonomy")] + public virtual ICollection CmsTags { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsUser.cs b/Migration.Toolkit.KXP/Models/CmsUser.cs index a35ee1e4..dba8b27c 100644 --- a/Migration.Toolkit.KXP/Models/CmsUser.cs +++ b/Migration.Toolkit.KXP/Models/CmsUser.cs @@ -1,107 +1,112 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_User")] -[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] -[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] -public partial class CmsUser -{ - [Key] - [Column("UserID")] - public int UserId { get; set; } - - [StringLength(254)] - public string UserName { get; set; } = null!; - - [StringLength(100)] - public string? FirstName { get; set; } - - [StringLength(100)] - public string? LastName { get; set; } - - [StringLength(254)] - public string? Email { get; set; } - - [StringLength(100)] - public string UserPassword { get; set; } = null!; - - public bool UserEnabled { get; set; } - - public DateTime? UserCreated { get; set; } - - public DateTime? LastLogon { get; set; } - - [Column("UserGUID")] - public Guid UserGuid { get; set; } - - public DateTime UserLastModified { get; set; } - - [StringLength(72)] - public string? UserSecurityStamp { get; set; } - - public DateTime? UserPasswordLastChanged { get; set; } - - public bool UserIsPendingRegistration { get; set; } - - public DateTime? UserRegistrationLinkExpiration { get; set; } - - public bool UserAdministrationAccess { get; set; } - - public bool UserIsExternal { get; set; } - - [InverseProperty("HistoryApprovedByUser")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateUser")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("ContentFolderCreatedByUser")] - public virtual ICollection CmsContentFolderContentFolderCreatedByUsers { get; set; } = new List(); - - [InverseProperty("ContentFolderModifiedByUser")] - public virtual ICollection CmsContentFolderContentFolderModifiedByUsers { get; set; } = new List(); - - [InverseProperty("ContentItemLanguageMetadataCreatedByUser")] - public virtual ICollection CmsContentItemLanguageMetadatumContentItemLanguageMetadataCreatedByUsers { get; set; } = new List(); - - [InverseProperty("ContentItemLanguageMetadataModifiedByUser")] - public virtual ICollection CmsContentItemLanguageMetadatumContentItemLanguageMetadataModifiedByUsers { get; set; } = new List(); - - [InverseProperty("User")] - public virtual ICollection CmsExternalLogins { get; set; } = new List(); - - [InverseProperty("HeadlessTokenCreatedByUser")] - public virtual ICollection CmsHeadlessTokenHeadlessTokenCreatedByUsers { get; set; } = new List(); - - [InverseProperty("HeadlessTokenModifiedByUser")] - public virtual ICollection CmsHeadlessTokenHeadlessTokenModifiedByUsers { get; set; } = new List(); - - [InverseProperty("MacroIdentityEffectiveUser")] - public virtual ICollection CmsMacroIdentities { get; set; } = new List(); - - [InverseProperty("TaskUser")] - public virtual ICollection CmsScheduledTasks { get; set; } = new List(); - - [InverseProperty("UserMacroIdentityUser")] - public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } - - [InverseProperty("User")] - public virtual ICollection CmsUserRoles { get; set; } = new List(); - - [InverseProperty("FileCreatedByUser")] - public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); - - [InverseProperty("FileModifiedByUser")] - public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); - - [InverseProperty("AccountOwnerUser")] - public virtual ICollection OmAccounts { get; set; } = new List(); - - [InverseProperty("ContactOwnerUser")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_User")] +[Index("UserGuid", Name = "IX_CMS_User_UserGUID", IsUnique = true)] +[Index("UserName", Name = "IX_CMS_User_UserName", IsUnique = true)] +public class CmsUser +{ + [Key] + [Column("UserID")] + public int UserId { get; set; } + + [StringLength(254)] + public string UserName { get; set; } = null!; + + [StringLength(100)] + public string? FirstName { get; set; } + + [StringLength(100)] + public string? LastName { get; set; } + + [StringLength(254)] + public string? Email { get; set; } + + [StringLength(100)] + public string UserPassword { get; set; } = null!; + + public bool UserEnabled { get; set; } + + public DateTime? UserCreated { get; set; } + + public DateTime? LastLogon { get; set; } + + [Column("UserGUID")] + public Guid UserGuid { get; set; } + + public DateTime UserLastModified { get; set; } + + [StringLength(72)] + public string? UserSecurityStamp { get; set; } + + public DateTime? UserPasswordLastChanged { get; set; } + + public bool UserIsPendingRegistration { get; set; } + + public DateTime? UserRegistrationLinkExpiration { get; set; } + + public bool UserAdministrationAccess { get; set; } + + public bool UserIsExternal { get; set; } + + [InverseProperty("HistoryApprovedByUser")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateUser")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("ContentFolderCreatedByUser")] + public virtual ICollection CmsContentFolderContentFolderCreatedByUsers { get; set; } = new List(); + + [InverseProperty("ContentFolderModifiedByUser")] + public virtual ICollection CmsContentFolderContentFolderModifiedByUsers { get; set; } = new List(); + + [InverseProperty("ContentItemLanguageMetadataCreatedByUser")] + public virtual ICollection CmsContentItemLanguageMetadatumContentItemLanguageMetadataCreatedByUsers { get; set; } = new List(); + + [InverseProperty("ContentItemLanguageMetadataModifiedByUser")] + public virtual ICollection CmsContentItemLanguageMetadatumContentItemLanguageMetadataModifiedByUsers { get; set; } = new List(); + + [InverseProperty("User")] + public virtual ICollection CmsExternalLogins { get; set; } = new List(); + + [InverseProperty("HeadlessTokenCreatedByUser")] + public virtual ICollection CmsHeadlessTokenHeadlessTokenCreatedByUsers { get; set; } = new List(); + + [InverseProperty("HeadlessTokenModifiedByUser")] + public virtual ICollection CmsHeadlessTokenHeadlessTokenModifiedByUsers { get; set; } = new List(); + + [InverseProperty("MacroIdentityEffectiveUser")] + public virtual ICollection CmsMacroIdentities { get; set; } = new List(); + + [InverseProperty("TaskUser")] + public virtual ICollection CmsScheduledTasks { get; set; } = new List(); + + [InverseProperty("SmartFolderCreatedByUser")] + public virtual ICollection CmsSmartFolderSmartFolderCreatedByUsers { get; set; } = new List(); + + [InverseProperty("SmartFolderModifiedByUser")] + public virtual ICollection CmsSmartFolderSmartFolderModifiedByUsers { get; set; } = new List(); + + [InverseProperty("UserMacroIdentityUser")] + public virtual CmsUserMacroIdentity? CmsUserMacroIdentity { get; set; } + + [InverseProperty("User")] + public virtual ICollection CmsUserRoles { get; set; } = new List(); + + [InverseProperty("FileCreatedByUser")] + public virtual ICollection MediaFileFileCreatedByUsers { get; set; } = new List(); + + [InverseProperty("FileModifiedByUser")] + public virtual ICollection MediaFileFileModifiedByUsers { get; set; } = new List(); + + [InverseProperty("AccountOwnerUser")] + public virtual ICollection OmAccounts { get; set; } = new List(); + + [InverseProperty("ContactOwnerUser")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs b/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs index 39d229f1..d8aa716e 100644 --- a/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs +++ b/Migration.Toolkit.KXP/Models/CmsUserMacroIdentity.cs @@ -1,35 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_UserMacroIdentity")] -[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] -[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] -public partial class CmsUserMacroIdentity -{ - [Key] - [Column("UserMacroIdentityID")] - public int UserMacroIdentityId { get; set; } - - public DateTime UserMacroIdentityLastModified { get; set; } - - [Column("UserMacroIdentityUserID")] - public int UserMacroIdentityUserId { get; set; } - - [Column("UserMacroIdentityMacroIdentityID")] - public int? UserMacroIdentityMacroIdentityId { get; set; } - - public Guid UserMacroIdentityUserGuid { get; set; } - - [ForeignKey("UserMacroIdentityMacroIdentityId")] - [InverseProperty("CmsUserMacroIdentities")] - public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } - - [ForeignKey("UserMacroIdentityUserId")] - [InverseProperty("CmsUserMacroIdentity")] - public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_UserMacroIdentity")] +[Index("UserMacroIdentityMacroIdentityId", Name = "IX_CMS_UserMacroIdentity_UserMacroIdentityMacroIdentityID")] +[Index("UserMacroIdentityUserId", Name = "UQ_CMS_UserMacroIdentity_UserMacroIdentityUserID", IsUnique = true)] +public class CmsUserMacroIdentity +{ + [Key] + [Column("UserMacroIdentityID")] + public int UserMacroIdentityId { get; set; } + + public DateTime UserMacroIdentityLastModified { get; set; } + + [Column("UserMacroIdentityUserID")] + public int UserMacroIdentityUserId { get; set; } + + [Column("UserMacroIdentityMacroIdentityID")] + public int? UserMacroIdentityMacroIdentityId { get; set; } + + public Guid UserMacroIdentityUserGuid { get; set; } + + [ForeignKey("UserMacroIdentityMacroIdentityId")] + [InverseProperty("CmsUserMacroIdentities")] + public virtual CmsMacroIdentity? UserMacroIdentityMacroIdentity { get; set; } + + [ForeignKey("UserMacroIdentityUserId")] + [InverseProperty("CmsUserMacroIdentity")] + public virtual CmsUser UserMacroIdentityUser { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsUserRole.cs b/Migration.Toolkit.KXP/Models/CmsUserRole.cs index b03a8e66..90659046 100644 --- a/Migration.Toolkit.KXP/Models/CmsUserRole.cs +++ b/Migration.Toolkit.KXP/Models/CmsUserRole.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_UserRole")] -[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] -[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] -public partial class CmsUserRole -{ - [Column("UserID")] - public int UserId { get; set; } - - [Column("RoleID")] - public int RoleId { get; set; } - - [Key] - [Column("UserRoleID")] - public int UserRoleId { get; set; } - - [ForeignKey("RoleId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsRole Role { get; set; } = null!; - - [ForeignKey("UserId")] - [InverseProperty("CmsUserRoles")] - public virtual CmsUser User { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_UserRole")] +[Index("RoleId", Name = "IX_CMS_UserRole_RoleID")] +[Index("UserId", "RoleId", Name = "IX_CMS_UserRole_UserID_RoleID", IsUnique = true)] +public class CmsUserRole +{ + [Column("UserID")] + public int UserId { get; set; } + + [Column("RoleID")] + public int RoleId { get; set; } + + [Key] + [Column("UserRoleID")] + public int UserRoleId { get; set; } + + [ForeignKey("RoleId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsRole Role { get; set; } = null!; + + [ForeignKey("UserId")] + [InverseProperty("CmsUserRoles")] + public virtual CmsUser User { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs index ff85e4b7..15fc5a70 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmServer.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebFarmServer")] -[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] -public partial class CmsWebFarmServer -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [StringLength(300)] - public string ServerDisplayName { get; set; } = null!; - - [StringLength(300)] - public string ServerName { get; set; } = null!; - - [Column("ServerGUID")] - public Guid? ServerGuid { get; set; } - - public DateTime ServerLastModified { get; set; } - - public bool ServerEnabled { get; set; } - - [InverseProperty("Server")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebFarmServer")] +[Index("ServerName", Name = "IX_CMS_WebFarmServer_ServerName", IsUnique = true)] +public class CmsWebFarmServer +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [StringLength(300)] + public string ServerDisplayName { get; set; } = null!; + + [StringLength(300)] + public string ServerName { get; set; } = null!; + + [Column("ServerGUID")] + public Guid? ServerGuid { get; set; } + + public DateTime ServerLastModified { get; set; } + + public bool ServerEnabled { get; set; } + + [InverseProperty("Server")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs index 28862381..59883950 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmServerLog.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebFarmServerLog")] -public partial class CmsWebFarmServerLog -{ - [Key] - [Column("WebFarmServerLogID")] - public int WebFarmServerLogId { get; set; } - - public DateTime LogTime { get; set; } - - [StringLength(200)] - public string LogCode { get; set; } = null!; - - [Column("ServerID")] - public int ServerId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebFarmServerLog")] +public class CmsWebFarmServerLog +{ + [Key] + [Column("WebFarmServerLogID")] + public int WebFarmServerLogId { get; set; } + + public DateTime LogTime { get; set; } + + [StringLength(200)] + public string LogCode { get; set; } = null!; + + [Column("ServerID")] + public int ServerId { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs index 2fb37037..3b9e907a 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmServerMonitoring.cs @@ -1,20 +1,17 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebFarmServerMonitoring")] -public partial class CmsWebFarmServerMonitoring -{ - [Key] - [Column("WebFarmServerMonitoringID")] - public int WebFarmServerMonitoringId { get; set; } - - [Column("ServerID")] - public int ServerId { get; set; } - - public DateTime? ServerPing { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebFarmServerMonitoring")] +public class CmsWebFarmServerMonitoring +{ + [Key] + [Column("WebFarmServerMonitoringID")] + public int WebFarmServerMonitoringId { get; set; } + + [Column("ServerID")] + public int ServerId { get; set; } + + public DateTime? ServerPing { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs index 2a901693..9fdc5689 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmServerTask.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[PrimaryKey("ServerId", "TaskId")] -[Table("CMS_WebFarmServerTask")] -[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] -public partial class CmsWebFarmServerTask -{ - [Key] - [Column("ServerID")] - public int ServerId { get; set; } - - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - public string? ErrorMessage { get; set; } - - [ForeignKey("ServerId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmServer Server { get; set; } = null!; - - [ForeignKey("TaskId")] - [InverseProperty("CmsWebFarmServerTasks")] - public virtual CmsWebFarmTask Task { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[PrimaryKey("ServerId", "TaskId")] +[Table("CMS_WebFarmServerTask")] +[Index("TaskId", Name = "IX_CMS_WebFarmServerTask_TaskID")] +public class CmsWebFarmServerTask +{ + [Key] + [Column("ServerID")] + public int ServerId { get; set; } + + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + public string? ErrorMessage { get; set; } + + [ForeignKey("ServerId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmServer Server { get; set; } = null!; + + [ForeignKey("TaskId")] + [InverseProperty("CmsWebFarmServerTasks")] + public virtual CmsWebFarmTask Task { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs b/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs index 2cac07b3..fc29c367 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebFarmTask.cs @@ -1,42 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebFarmTask")] -[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] -public partial class CmsWebFarmTask -{ - [Key] - [Column("TaskID")] - public int TaskId { get; set; } - - [StringLength(100)] - public string TaskType { get; set; } = null!; - - public string? TaskTextData { get; set; } - - public byte[]? TaskBinaryData { get; set; } - - public DateTime? TaskCreated { get; set; } - - public string? TaskTarget { get; set; } - - [StringLength(450)] - public string? TaskMachineName { get; set; } - - [Column("TaskGUID")] - public Guid? TaskGuid { get; set; } - - public bool? TaskIsAnonymous { get; set; } - - public string? TaskErrorMessage { get; set; } - - public bool? TaskIsMemory { get; set; } - - [InverseProperty("Task")] - public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebFarmTask")] +[Index("TaskIsMemory", "TaskCreated", Name = "IX_CMS_WebFarmTask_TaskIsMemory_TaskCreated")] +public class CmsWebFarmTask +{ + [Key] + [Column("TaskID")] + public int TaskId { get; set; } + + [StringLength(100)] + public string TaskType { get; set; } = null!; + + public string? TaskTextData { get; set; } + + public byte[]? TaskBinaryData { get; set; } + + public DateTime? TaskCreated { get; set; } + + public string? TaskTarget { get; set; } + + [StringLength(450)] + public string? TaskMachineName { get; set; } + + [Column("TaskGUID")] + public Guid? TaskGuid { get; set; } + + public bool? TaskIsAnonymous { get; set; } + + public string? TaskErrorMessage { get; set; } + + public bool? TaskIsMemory { get; set; } + + [InverseProperty("Task")] + public virtual ICollection CmsWebFarmServerTasks { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs b/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs index 1591ccb9..240d2345 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebPageFormerUrlPath.cs @@ -1,47 +1,46 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebPageFormerUrlPath")] -[Index("WebPageFormerUrlPathContentLanguageId", Name = "IX_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathContentLanguageID")] -[Index("WebPageFormerUrlPathWebPageItemId", Name = "IX_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathWebPageItemID")] -[Index("WebPageFormerUrlPathWebsiteChannelId", Name = "IX_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathWebsiteChannelID")] -public partial class CmsWebPageFormerUrlPath -{ - [Key] - [Column("WebPageFormerUrlPathID")] - public int WebPageFormerUrlPathId { get; set; } - - [StringLength(2000)] - public string WebPageFormerUrlPath { get; set; } = null!; - - [StringLength(64)] - public string WebPageFormerUrlPathHash { get; set; } = null!; - - [Column("WebPageFormerUrlPathContentLanguageID")] - public int WebPageFormerUrlPathContentLanguageId { get; set; } - - [Column("WebPageFormerUrlPathWebPageItemID")] - public int WebPageFormerUrlPathWebPageItemId { get; set; } - - [Column("WebPageFormerUrlPathWebsiteChannelID")] - public int WebPageFormerUrlPathWebsiteChannelId { get; set; } - - public DateTime WebPageFormerUrlPathLastModified { get; set; } - - [ForeignKey("WebPageFormerUrlPathContentLanguageId")] - [InverseProperty("CmsWebPageFormerUrlPaths")] - public virtual CmsContentLanguage WebPageFormerUrlPathContentLanguage { get; set; } = null!; - - [ForeignKey("WebPageFormerUrlPathWebPageItemId")] - [InverseProperty("CmsWebPageFormerUrlPaths")] - public virtual CmsWebPageItem WebPageFormerUrlPathWebPageItem { get; set; } = null!; - - [ForeignKey("WebPageFormerUrlPathWebsiteChannelId")] - [InverseProperty("CmsWebPageFormerUrlPaths")] - public virtual CmsWebsiteChannel WebPageFormerUrlPathWebsiteChannel { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebPageFormerUrlPath")] +[Index("WebPageFormerUrlPathContentLanguageId", Name = "IX_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathContentLanguageID")] +[Index("WebPageFormerUrlPathWebPageItemId", Name = "IX_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathWebPageItemID")] +[Index("WebPageFormerUrlPathWebsiteChannelId", Name = "IX_CMS_WebPageFormerUrlPath_WebPageFormerUrlPathWebsiteChannelID")] +public class CmsWebPageFormerUrlPath +{ + [Key] + [Column("WebPageFormerUrlPathID")] + public int WebPageFormerUrlPathId { get; set; } + + [StringLength(2000)] + public string WebPageFormerUrlPath { get; set; } = null!; + + [StringLength(64)] + public string WebPageFormerUrlPathHash { get; set; } = null!; + + [Column("WebPageFormerUrlPathContentLanguageID")] + public int WebPageFormerUrlPathContentLanguageId { get; set; } + + [Column("WebPageFormerUrlPathWebPageItemID")] + public int WebPageFormerUrlPathWebPageItemId { get; set; } + + [Column("WebPageFormerUrlPathWebsiteChannelID")] + public int WebPageFormerUrlPathWebsiteChannelId { get; set; } + + public DateTime WebPageFormerUrlPathLastModified { get; set; } + + [ForeignKey("WebPageFormerUrlPathContentLanguageId")] + [InverseProperty("CmsWebPageFormerUrlPaths")] + public virtual CmsContentLanguage WebPageFormerUrlPathContentLanguage { get; set; } = null!; + + [ForeignKey("WebPageFormerUrlPathWebPageItemId")] + [InverseProperty("CmsWebPageFormerUrlPaths")] + public virtual CmsWebPageItem WebPageFormerUrlPathWebPageItem { get; set; } = null!; + + [ForeignKey("WebPageFormerUrlPathWebsiteChannelId")] + [InverseProperty("CmsWebPageFormerUrlPaths")] + public virtual CmsWebsiteChannel WebPageFormerUrlPathWebsiteChannel { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs b/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs index 576bfc46..278cc90e 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebPageItem.cs @@ -1,62 +1,61 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebPageItem")] -[Index("WebPageItemContentItemId", Name = "IX_CMS_WebPageItem_WebPageItemContentItemID")] -[Index("WebPageItemGuid", Name = "IX_CMS_WebPageItem_WebPageItemGUID_Unique", IsUnique = true)] -[Index("WebPageItemName", Name = "IX_CMS_WebPageItem_WebPageItemName_Unique", IsUnique = true)] -[Index("WebPageItemParentId", Name = "IX_CMS_WebPageItem_WebPageItemParentID")] -[Index("WebPageItemTreePath", "WebPageItemWebsiteChannelId", Name = "IX_CMS_WebPageItem_WebPageItemTreePath_WebPageItemWebsiteChannelID_Unique", IsUnique = true)] -[Index("WebPageItemWebsiteChannelId", Name = "IX_CMS_WebPageItem_WebPageItemWebsiteChannelID")] -public partial class CmsWebPageItem -{ - [Key] - [Column("WebPageItemID")] - public int WebPageItemId { get; set; } - - [Column("WebPageItemParentID")] - public int? WebPageItemParentId { get; set; } - - [Column("WebPageItemGUID")] - public Guid WebPageItemGuid { get; set; } - - [StringLength(100)] - public string WebPageItemName { get; set; } = null!; - - [StringLength(850)] - public string WebPageItemTreePath { get; set; } = null!; - - [Column("WebPageItemWebsiteChannelID")] - public int WebPageItemWebsiteChannelId { get; set; } - - [Column("WebPageItemContentItemID")] - public int? WebPageItemContentItemId { get; set; } - - public int? WebPageItemOrder { get; set; } - - [InverseProperty("WebPageFormerUrlPathWebPageItem")] - public virtual ICollection CmsWebPageFormerUrlPaths { get; set; } = new List(); - - [InverseProperty("WebPageUrlPathWebPageItem")] - public virtual ICollection CmsWebPageUrlPaths { get; set; } = new List(); - - [InverseProperty("WebPageItemParent")] - public virtual ICollection InverseWebPageItemParent { get; set; } = new List(); - - [ForeignKey("WebPageItemContentItemId")] - [InverseProperty("CmsWebPageItems")] - public virtual CmsContentItem? WebPageItemContentItem { get; set; } - - [ForeignKey("WebPageItemParentId")] - [InverseProperty("InverseWebPageItemParent")] - public virtual CmsWebPageItem? WebPageItemParent { get; set; } - - [ForeignKey("WebPageItemWebsiteChannelId")] - [InverseProperty("CmsWebPageItems")] - public virtual CmsWebsiteChannel WebPageItemWebsiteChannel { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebPageItem")] +[Index("WebPageItemContentItemId", Name = "IX_CMS_WebPageItem_WebPageItemContentItemID")] +[Index("WebPageItemGuid", Name = "IX_CMS_WebPageItem_WebPageItemGUID_Unique", IsUnique = true)] +[Index("WebPageItemName", Name = "IX_CMS_WebPageItem_WebPageItemName_Unique", IsUnique = true)] +[Index("WebPageItemParentId", Name = "IX_CMS_WebPageItem_WebPageItemParentID")] +[Index("WebPageItemTreePath", "WebPageItemWebsiteChannelId", Name = "IX_CMS_WebPageItem_WebPageItemTreePath_WebPageItemWebsiteChannelID_Unique", IsUnique = true)] +[Index("WebPageItemWebsiteChannelId", Name = "IX_CMS_WebPageItem_WebPageItemWebsiteChannelID")] +public class CmsWebPageItem +{ + [Key] + [Column("WebPageItemID")] + public int WebPageItemId { get; set; } + + [Column("WebPageItemParentID")] + public int? WebPageItemParentId { get; set; } + + [Column("WebPageItemGUID")] + public Guid WebPageItemGuid { get; set; } + + [StringLength(100)] + public string WebPageItemName { get; set; } = null!; + + [StringLength(850)] + public string WebPageItemTreePath { get; set; } = null!; + + [Column("WebPageItemWebsiteChannelID")] + public int WebPageItemWebsiteChannelId { get; set; } + + [Column("WebPageItemContentItemID")] + public int? WebPageItemContentItemId { get; set; } + + public int? WebPageItemOrder { get; set; } + + [InverseProperty("WebPageFormerUrlPathWebPageItem")] + public virtual ICollection CmsWebPageFormerUrlPaths { get; set; } = new List(); + + [InverseProperty("WebPageUrlPathWebPageItem")] + public virtual ICollection CmsWebPageUrlPaths { get; set; } = new List(); + + [InverseProperty("WebPageItemParent")] + public virtual ICollection InverseWebPageItemParent { get; set; } = new List(); + + [ForeignKey("WebPageItemContentItemId")] + [InverseProperty("CmsWebPageItems")] + public virtual CmsContentItem? WebPageItemContentItem { get; set; } + + [ForeignKey("WebPageItemParentId")] + [InverseProperty("InverseWebPageItemParent")] + public virtual CmsWebPageItem? WebPageItemParent { get; set; } + + [ForeignKey("WebPageItemWebsiteChannelId")] + [InverseProperty("CmsWebPageItems")] + public virtual CmsWebsiteChannel WebPageItemWebsiteChannel { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs b/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs index b396f9c3..c75523ec 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebPageUrlPath.cs @@ -1,54 +1,53 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebPageUrlPath")] -[Index("WebPageUrlPathContentLanguageId", Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathContentLanguageID")] -[Index("WebPageUrlPathHash", "WebPageUrlPathWebsiteChannelId", "WebPageUrlPathContentLanguageId", "WebPageUrlPathIsDraft", Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathHash_WebPageUrlPathWebsiteChannelID_WebPageUrlPathContentLanguageID_WebPageUrlPathIsDraft", IsUnique = true)] -[Index("WebPageUrlPathWebPageItemId", Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathWebPageItemID")] -[Index("WebPageUrlPathWebsiteChannelId", Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathWebsiteChannelID")] -public partial class CmsWebPageUrlPath -{ - [Key] - [Column("WebPageUrlPathID")] - public int WebPageUrlPathId { get; set; } - - [StringLength(2000)] - public string WebPageUrlPath { get; set; } = null!; - - [StringLength(64)] - public string WebPageUrlPathHash { get; set; } = null!; - - [Column("WebPageUrlPathWebPageItemID")] - public int WebPageUrlPathWebPageItemId { get; set; } - - [Required] - public bool? WebPageUrlPathIsLatest { get; set; } - - [Column("WebPageUrlPathGUID")] - public Guid WebPageUrlPathGuid { get; set; } - - [Column("WebPageUrlPathWebsiteChannelID")] - public int WebPageUrlPathWebsiteChannelId { get; set; } - - [Column("WebPageUrlPathContentLanguageID")] - public int WebPageUrlPathContentLanguageId { get; set; } - - public bool WebPageUrlPathIsDraft { get; set; } - - [ForeignKey("WebPageUrlPathContentLanguageId")] - [InverseProperty("CmsWebPageUrlPaths")] - public virtual CmsContentLanguage WebPageUrlPathContentLanguage { get; set; } = null!; - - [ForeignKey("WebPageUrlPathWebPageItemId")] - [InverseProperty("CmsWebPageUrlPaths")] - public virtual CmsWebPageItem WebPageUrlPathWebPageItem { get; set; } = null!; - - [ForeignKey("WebPageUrlPathWebsiteChannelId")] - [InverseProperty("CmsWebPageUrlPaths")] - public virtual CmsWebsiteChannel WebPageUrlPathWebsiteChannel { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebPageUrlPath")] +[Index("WebPageUrlPathContentLanguageId", Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathContentLanguageID")] +[Index("WebPageUrlPathHash", "WebPageUrlPathWebsiteChannelId", "WebPageUrlPathContentLanguageId", "WebPageUrlPathIsDraft", + Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathHash_WebPageUrlPathWebsiteChannelID_WebPageUrlPathContentLanguageID_WebPageUrlPathIsDraft", IsUnique = true)] +[Index("WebPageUrlPathWebPageItemId", Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathWebPageItemID")] +[Index("WebPageUrlPathWebsiteChannelId", Name = "IX_CMS_WebPageUrlPath_WebPageUrlPathWebsiteChannelID")] +public class CmsWebPageUrlPath +{ + [Key] + [Column("WebPageUrlPathID")] + public int WebPageUrlPathId { get; set; } + + [StringLength(2000)] + public string WebPageUrlPath { get; set; } = null!; + + [StringLength(64)] + public string WebPageUrlPathHash { get; set; } = null!; + + [Column("WebPageUrlPathWebPageItemID")] + public int WebPageUrlPathWebPageItemId { get; set; } + + public bool WebPageUrlPathIsLatest { get; set; } + + [Column("WebPageUrlPathGUID")] + public Guid WebPageUrlPathGuid { get; set; } + + [Column("WebPageUrlPathWebsiteChannelID")] + public int WebPageUrlPathWebsiteChannelId { get; set; } + + [Column("WebPageUrlPathContentLanguageID")] + public int WebPageUrlPathContentLanguageId { get; set; } + + public bool WebPageUrlPathIsDraft { get; set; } + + [ForeignKey("WebPageUrlPathContentLanguageId")] + [InverseProperty("CmsWebPageUrlPaths")] + public virtual CmsContentLanguage WebPageUrlPathContentLanguage { get; set; } = null!; + + [ForeignKey("WebPageUrlPathWebPageItemId")] + [InverseProperty("CmsWebPageUrlPaths")] + public virtual CmsWebPageItem WebPageUrlPathWebPageItem { get; set; } = null!; + + [ForeignKey("WebPageUrlPathWebsiteChannelId")] + [InverseProperty("CmsWebPageUrlPaths")] + public virtual CmsWebsiteChannel WebPageUrlPathWebsiteChannel { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs b/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs index 7f9ab1e2..afd48ad6 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebsiteCaptchaSetting.cs @@ -1,31 +1,28 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebsiteCaptchaSettings")] -public partial class CmsWebsiteCaptchaSetting -{ - [Key] - [Column("WebsiteCaptchaSettingsID")] - public int WebsiteCaptchaSettingsId { get; set; } - - [Column("WebsiteCaptchaSettingsWebsiteChannelID")] - public int WebsiteCaptchaSettingsWebsiteChannelId { get; set; } - - [StringLength(200)] - public string WebsiteCaptchaSettingsReCaptchaSiteKey { get; set; } = null!; - - [StringLength(200)] - public string WebsiteCaptchaSettingsReCaptchaSecretKey { get; set; } = null!; - - public double? WebsiteCaptchaSettingsReCaptchaThreshold { get; set; } - - public int WebsiteCaptchaSettingsReCaptchaVersion { get; set; } - - [Column("WebsiteCaptchaSettingsGUID")] - public Guid WebsiteCaptchaSettingsGuid { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebsiteCaptchaSettings")] +public class CmsWebsiteCaptchaSetting +{ + [Key] + [Column("WebsiteCaptchaSettingsID")] + public int WebsiteCaptchaSettingsId { get; set; } + + [Column("WebsiteCaptchaSettingsWebsiteChannelID")] + public int WebsiteCaptchaSettingsWebsiteChannelId { get; set; } + + [StringLength(200)] + public string WebsiteCaptchaSettingsReCaptchaSiteKey { get; set; } = null!; + + [StringLength(200)] + public string WebsiteCaptchaSettingsReCaptchaSecretKey { get; set; } = null!; + + public double? WebsiteCaptchaSettingsReCaptchaThreshold { get; set; } + + public int WebsiteCaptchaSettingsReCaptchaVersion { get; set; } + + [Column("WebsiteCaptchaSettingsGUID")] + public Guid WebsiteCaptchaSettingsGuid { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs b/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs index 3766c661..fa7be83e 100644 --- a/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs +++ b/Migration.Toolkit.KXP/Models/CmsWebsiteChannel.cs @@ -1,54 +1,52 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WebsiteChannel")] -[Index("WebsiteChannelChannelId", Name = "IX_CMS_WebsiteChannel_WebsiteChannelChannelID")] -[Index("WebsiteChannelPrimaryContentLanguageId", Name = "IX_CMS_WebsiteChannel_WebsiteChannelPrimaryContentLanguageID")] -public partial class CmsWebsiteChannel -{ - [Key] - [Column("WebsiteChannelID")] - public int WebsiteChannelId { get; set; } - - [Column("WebsiteChannelGUID")] - public Guid WebsiteChannelGuid { get; set; } - - [StringLength(400)] - public string WebsiteChannelDomain { get; set; } = null!; - - [Column("WebsiteChannelChannelID")] - public int WebsiteChannelChannelId { get; set; } - - [StringLength(200)] - public string? WebsiteChannelHomePage { get; set; } - - [Column("WebsiteChannelPrimaryContentLanguageID")] - public int WebsiteChannelPrimaryContentLanguageId { get; set; } - - public int WebsiteChannelDefaultCookieLevel { get; set; } - - [Required] - public bool? WebsiteChannelStoreFormerUrls { get; set; } - - [InverseProperty("WebPageFormerUrlPathWebsiteChannel")] - public virtual ICollection CmsWebPageFormerUrlPaths { get; set; } = new List(); - - [InverseProperty("WebPageItemWebsiteChannel")] - public virtual ICollection CmsWebPageItems { get; set; } = new List(); - - [InverseProperty("WebPageUrlPathWebsiteChannel")] - public virtual ICollection CmsWebPageUrlPaths { get; set; } = new List(); - - [ForeignKey("WebsiteChannelChannelId")] - [InverseProperty("CmsWebsiteChannels")] - public virtual CmsChannel WebsiteChannelChannel { get; set; } = null!; - - [ForeignKey("WebsiteChannelPrimaryContentLanguageId")] - [InverseProperty("CmsWebsiteChannels")] - public virtual CmsContentLanguage WebsiteChannelPrimaryContentLanguage { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WebsiteChannel")] +[Index("WebsiteChannelChannelId", Name = "IX_CMS_WebsiteChannel_WebsiteChannelChannelID")] +[Index("WebsiteChannelPrimaryContentLanguageId", Name = "IX_CMS_WebsiteChannel_WebsiteChannelPrimaryContentLanguageID")] +public class CmsWebsiteChannel +{ + [Key] + [Column("WebsiteChannelID")] + public int WebsiteChannelId { get; set; } + + [Column("WebsiteChannelGUID")] + public Guid WebsiteChannelGuid { get; set; } + + [StringLength(400)] + public string WebsiteChannelDomain { get; set; } = null!; + + [Column("WebsiteChannelChannelID")] + public int WebsiteChannelChannelId { get; set; } + + [StringLength(200)] + public string? WebsiteChannelHomePage { get; set; } + + [Column("WebsiteChannelPrimaryContentLanguageID")] + public int WebsiteChannelPrimaryContentLanguageId { get; set; } + + public int WebsiteChannelDefaultCookieLevel { get; set; } + + public bool WebsiteChannelStoreFormerUrls { get; set; } + + [InverseProperty("WebPageFormerUrlPathWebsiteChannel")] + public virtual ICollection CmsWebPageFormerUrlPaths { get; set; } = new List(); + + [InverseProperty("WebPageItemWebsiteChannel")] + public virtual ICollection CmsWebPageItems { get; set; } = new List(); + + [InverseProperty("WebPageUrlPathWebsiteChannel")] + public virtual ICollection CmsWebPageUrlPaths { get; set; } = new List(); + + [ForeignKey("WebsiteChannelChannelId")] + [InverseProperty("CmsWebsiteChannels")] + public virtual CmsChannel WebsiteChannelChannel { get; set; } = null!; + + [ForeignKey("WebsiteChannelPrimaryContentLanguageId")] + [InverseProperty("CmsWebsiteChannels")] + public virtual CmsContentLanguage WebsiteChannelPrimaryContentLanguage { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflow.cs b/Migration.Toolkit.KXP/Models/CmsWorkflow.cs index 584e7433..5110faf8 100644 --- a/Migration.Toolkit.KXP/Models/CmsWorkflow.cs +++ b/Migration.Toolkit.KXP/Models/CmsWorkflow.cs @@ -1,83 +1,79 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_Workflow")] -public partial class CmsWorkflow -{ - [Key] - [Column("WorkflowID")] - public int WorkflowId { get; set; } - - public string WorkflowDisplayName { get; set; } = null!; - - [StringLength(450)] - public string WorkflowName { get; set; } = null!; - - [Column("WorkflowGUID")] - public Guid WorkflowGuid { get; set; } - - public DateTime WorkflowLastModified { get; set; } - - public bool? WorkflowAutoPublishChanges { get; set; } - - public bool? WorkflowUseCheckinCheckout { get; set; } - - public int? WorkflowType { get; set; } - - public bool? WorkflowSendEmails { get; set; } - - public bool? WorkflowSendApproveEmails { get; set; } - - public bool? WorkflowSendRejectEmails { get; set; } - - public bool? WorkflowSendPublishEmails { get; set; } - - public bool? WorkflowSendArchiveEmails { get; set; } - - [StringLength(200)] - public string? WorkflowApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowPublishedTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowArchivedTemplateName { get; set; } - - public bool? WorkflowSendReadyForApprovalEmails { get; set; } - - [StringLength(200)] - public string? WorkflowReadyForApprovalTemplateName { get; set; } - - [StringLength(200)] - public string? WorkflowNotificationTemplateName { get; set; } - - public string? WorkflowAllowedObjects { get; set; } - - public int? WorkflowRecurrenceType { get; set; } - - [Required] - public bool? WorkflowEnabled { get; set; } - - [InverseProperty("HistoryWorkflow")] - public virtual ICollection CmsAutomationHistories { get; set; } = new List(); - - [InverseProperty("StateWorkflow")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TriggerWorkflow")] - public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); - - [InverseProperty("StepWorkflow")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); - - [InverseProperty("TransitionWorkflow")] - public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_Workflow")] +public class CmsWorkflow +{ + [Key] + [Column("WorkflowID")] + public int WorkflowId { get; set; } + + public string WorkflowDisplayName { get; set; } = null!; + + [StringLength(450)] + public string WorkflowName { get; set; } = null!; + + [Column("WorkflowGUID")] + public Guid WorkflowGuid { get; set; } + + public DateTime WorkflowLastModified { get; set; } + + public bool? WorkflowAutoPublishChanges { get; set; } + + public bool? WorkflowUseCheckinCheckout { get; set; } + + public int? WorkflowType { get; set; } + + public bool? WorkflowSendEmails { get; set; } + + public bool? WorkflowSendApproveEmails { get; set; } + + public bool? WorkflowSendRejectEmails { get; set; } + + public bool? WorkflowSendPublishEmails { get; set; } + + public bool? WorkflowSendArchiveEmails { get; set; } + + [StringLength(200)] + public string? WorkflowApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowPublishedTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowArchivedTemplateName { get; set; } + + public bool? WorkflowSendReadyForApprovalEmails { get; set; } + + [StringLength(200)] + public string? WorkflowReadyForApprovalTemplateName { get; set; } + + [StringLength(200)] + public string? WorkflowNotificationTemplateName { get; set; } + + public string? WorkflowAllowedObjects { get; set; } + + public int? WorkflowRecurrenceType { get; set; } + + public bool WorkflowEnabled { get; set; } + + [InverseProperty("HistoryWorkflow")] + public virtual ICollection CmsAutomationHistories { get; set; } = new List(); + + [InverseProperty("StateWorkflow")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TriggerWorkflow")] + public virtual ICollection CmsObjectWorkflowTriggers { get; set; } = new List(); + + [InverseProperty("StepWorkflow")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); + + [InverseProperty("TransitionWorkflow")] + public virtual ICollection CmsWorkflowTransitions { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs index c4a4afe2..6c2bf70a 100644 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs +++ b/Migration.Toolkit.KXP/Models/CmsWorkflowAction.cs @@ -1,66 +1,64 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WorkflowAction")] -[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] -public partial class CmsWorkflowAction -{ - [Key] - [Column("ActionID")] - public int ActionId { get; set; } - - [StringLength(200)] - public string ActionDisplayName { get; set; } = null!; - - [StringLength(200)] - public string ActionName { get; set; } = null!; - - public string? ActionParameters { get; set; } - - public string? ActionDescription { get; set; } - - [StringLength(200)] - public string ActionAssemblyName { get; set; } = null!; - - [StringLength(200)] - public string ActionClass { get; set; } = null!; - - [Column("ActionResourceID")] - public int? ActionResourceId { get; set; } - - [Column("ActionGUID")] - public Guid ActionGuid { get; set; } - - public DateTime ActionLastModified { get; set; } - - [Required] - public bool? ActionEnabled { get; set; } - - public string? ActionAllowedObjects { get; set; } - - public int? ActionWorkflowType { get; set; } - - [StringLength(200)] - public string? ActionIconClass { get; set; } - - [StringLength(200)] - public string? ActionThumbnailClass { get; set; } - - [StringLength(200)] - public string? ActionDataProviderClass { get; set; } - - [StringLength(200)] - public string? ActionDataProviderAssemblyName { get; set; } - - [ForeignKey("ActionResourceId")] - [InverseProperty("CmsWorkflowActions")] - public virtual CmsResource? ActionResource { get; set; } - - [InverseProperty("StepAction")] - public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WorkflowAction")] +[Index("ActionResourceId", Name = "IX_CMS_WorkflowAction_ActionResourceID")] +public class CmsWorkflowAction +{ + [Key] + [Column("ActionID")] + public int ActionId { get; set; } + + [StringLength(200)] + public string ActionDisplayName { get; set; } = null!; + + [StringLength(200)] + public string ActionName { get; set; } = null!; + + public string? ActionParameters { get; set; } + + public string? ActionDescription { get; set; } + + [StringLength(200)] + public string ActionAssemblyName { get; set; } = null!; + + [StringLength(200)] + public string ActionClass { get; set; } = null!; + + [Column("ActionResourceID")] + public int? ActionResourceId { get; set; } + + [Column("ActionGUID")] + public Guid ActionGuid { get; set; } + + public DateTime ActionLastModified { get; set; } + + public bool ActionEnabled { get; set; } + + public string? ActionAllowedObjects { get; set; } + + public int? ActionWorkflowType { get; set; } + + [StringLength(200)] + public string? ActionIconClass { get; set; } + + [StringLength(200)] + public string? ActionThumbnailClass { get; set; } + + [StringLength(200)] + public string? ActionDataProviderClass { get; set; } + + [StringLength(200)] + public string? ActionDataProviderAssemblyName { get; set; } + + [ForeignKey("ActionResourceId")] + [InverseProperty("CmsWorkflowActions")] + public virtual CmsResource? ActionResource { get; set; } + + [InverseProperty("StepAction")] + public virtual ICollection CmsWorkflowSteps { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs index 18aac65c..239dd3df 100644 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs +++ b/Migration.Toolkit.KXP/Models/CmsWorkflowStep.cs @@ -1,94 +1,93 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WorkflowStep")] -[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] -[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] -[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] -[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] -public partial class CmsWorkflowStep -{ - [Key] - [Column("StepID")] - public int StepId { get; set; } - - [StringLength(450)] - public string StepDisplayName { get; set; } = null!; - - [StringLength(440)] - public string? StepName { get; set; } - - public int? StepOrder { get; set; } - - [Column("StepWorkflowID")] - public int StepWorkflowId { get; set; } - - [Column("StepGUID")] - public Guid StepGuid { get; set; } - - public DateTime StepLastModified { get; set; } - - public int? StepType { get; set; } - - public bool? StepAllowReject { get; set; } - - public string? StepDefinition { get; set; } - - public int? StepRolesSecurity { get; set; } - - public int? StepUsersSecurity { get; set; } - - [StringLength(200)] - public string? StepApprovedTemplateName { get; set; } - - [StringLength(200)] - public string? StepRejectedTemplateName { get; set; } - - [StringLength(200)] - public string? StepReadyforApprovalTemplateName { get; set; } - - public bool? StepSendApproveEmails { get; set; } - - public bool? StepSendRejectEmails { get; set; } - - public bool? StepSendReadyForApprovalEmails { get; set; } - - public bool? StepSendEmails { get; set; } - - public bool? StepAllowPublish { get; set; } - - [Column("StepActionID")] - public int? StepActionId { get; set; } - - public string? StepActionParameters { get; set; } - - public int? StepWorkflowType { get; set; } - - [InverseProperty("HistoryStep")] - public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); - - [InverseProperty("HistoryTargetStep")] - public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); - - [InverseProperty("StateStep")] - public virtual ICollection CmsAutomationStates { get; set; } = new List(); - - [InverseProperty("TransitionEndStep")] - public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); - - [InverseProperty("TransitionStartStep")] - public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); - - [ForeignKey("StepActionId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflowAction? StepAction { get; set; } - - [ForeignKey("StepWorkflowId")] - [InverseProperty("CmsWorkflowSteps")] - public virtual CmsWorkflow StepWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WorkflowStep")] +[Index("StepActionId", Name = "IX_CMS_WorkflowStep_StepActionID")] +[Index("StepId", "StepName", Name = "IX_CMS_WorkflowStep_StepID_StepName")] +[Index("StepWorkflowId", "StepName", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepName", IsUnique = true)] +[Index("StepWorkflowId", "StepOrder", Name = "IX_CMS_WorkflowStep_StepWorkflowID_StepOrder")] +public class CmsWorkflowStep +{ + [Key] + [Column("StepID")] + public int StepId { get; set; } + + [StringLength(450)] + public string StepDisplayName { get; set; } = null!; + + [StringLength(440)] + public string? StepName { get; set; } + + public int? StepOrder { get; set; } + + [Column("StepWorkflowID")] + public int StepWorkflowId { get; set; } + + [Column("StepGUID")] + public Guid StepGuid { get; set; } + + public DateTime StepLastModified { get; set; } + + public int? StepType { get; set; } + + public bool? StepAllowReject { get; set; } + + public string? StepDefinition { get; set; } + + public int? StepRolesSecurity { get; set; } + + public int? StepUsersSecurity { get; set; } + + [StringLength(200)] + public string? StepApprovedTemplateName { get; set; } + + [StringLength(200)] + public string? StepRejectedTemplateName { get; set; } + + [StringLength(200)] + public string? StepReadyforApprovalTemplateName { get; set; } + + public bool? StepSendApproveEmails { get; set; } + + public bool? StepSendRejectEmails { get; set; } + + public bool? StepSendReadyForApprovalEmails { get; set; } + + public bool? StepSendEmails { get; set; } + + public bool? StepAllowPublish { get; set; } + + [Column("StepActionID")] + public int? StepActionId { get; set; } + + public string? StepActionParameters { get; set; } + + public int? StepWorkflowType { get; set; } + + [InverseProperty("HistoryStep")] + public virtual ICollection CmsAutomationHistoryHistorySteps { get; set; } = new List(); + + [InverseProperty("HistoryTargetStep")] + public virtual ICollection CmsAutomationHistoryHistoryTargetSteps { get; set; } = new List(); + + [InverseProperty("StateStep")] + public virtual ICollection CmsAutomationStates { get; set; } = new List(); + + [InverseProperty("TransitionEndStep")] + public virtual ICollection CmsWorkflowTransitionTransitionEndSteps { get; set; } = new List(); + + [InverseProperty("TransitionStartStep")] + public virtual ICollection CmsWorkflowTransitionTransitionStartSteps { get; set; } = new List(); + + [ForeignKey("StepActionId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflowAction? StepAction { get; set; } + + [ForeignKey("StepWorkflowId")] + [InverseProperty("CmsWorkflowSteps")] + public virtual CmsWorkflow StepWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs b/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs index c9caaaed..a211e807 100644 --- a/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs +++ b/Migration.Toolkit.KXP/Models/CmsWorkflowTransition.cs @@ -1,46 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("CMS_WorkflowTransition")] -[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] -[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] -[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] -public partial class CmsWorkflowTransition -{ - [Key] - [Column("TransitionID")] - public int TransitionId { get; set; } - - [Column("TransitionStartStepID")] - public int TransitionStartStepId { get; set; } - - [Column("TransitionEndStepID")] - public int TransitionEndStepId { get; set; } - - public int TransitionType { get; set; } - - public DateTime TransitionLastModified { get; set; } - - [Column("TransitionSourcePointGUID")] - public Guid? TransitionSourcePointGuid { get; set; } - - [Column("TransitionWorkflowID")] - public int TransitionWorkflowId { get; set; } - - [ForeignKey("TransitionEndStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] - public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; - - [ForeignKey("TransitionStartStepId")] - [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] - public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; - - [ForeignKey("TransitionWorkflowId")] - [InverseProperty("CmsWorkflowTransitions")] - public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("CMS_WorkflowTransition")] +[Index("TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionEndStepID")] +[Index("TransitionStartStepId", "TransitionSourcePointGuid", "TransitionEndStepId", Name = "IX_CMS_WorkflowTransition_TransitionStartStepID_TransitionSourcePointGUID_TransitionEndStepID", IsUnique = true)] +[Index("TransitionWorkflowId", Name = "IX_CMS_WorkflowTransition_TransitionWorkflowID")] +public class CmsWorkflowTransition +{ + [Key] + [Column("TransitionID")] + public int TransitionId { get; set; } + + [Column("TransitionStartStepID")] + public int TransitionStartStepId { get; set; } + + [Column("TransitionEndStepID")] + public int TransitionEndStepId { get; set; } + + public int TransitionType { get; set; } + + public DateTime TransitionLastModified { get; set; } + + [Column("TransitionSourcePointGUID")] + public Guid? TransitionSourcePointGuid { get; set; } + + [Column("TransitionWorkflowID")] + public int TransitionWorkflowId { get; set; } + + [ForeignKey("TransitionEndStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionEndSteps")] + public virtual CmsWorkflowStep TransitionEndStep { get; set; } = null!; + + [ForeignKey("TransitionStartStepId")] + [InverseProperty("CmsWorkflowTransitionTransitionStartSteps")] + public virtual CmsWorkflowStep TransitionStartStep { get; set; } = null!; + + [ForeignKey("TransitionWorkflowId")] + [InverseProperty("CmsWorkflowTransitions")] + public virtual CmsWorkflow TransitionWorkflow { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs index 00d56fb2..00efcfd0 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailBounce.cs @@ -1,23 +1,22 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailBounce")] -[Index("EmailBounceEmailAddress", Name = "IX_EmailLibrary_EmailBounce_EmailBounceEmailAddress", IsUnique = true)] -public partial class EmailLibraryEmailBounce -{ - [Key] - [Column("EmailBounceID")] - public int EmailBounceId { get; set; } - - [StringLength(256)] - public string EmailBounceEmailAddress { get; set; } = null!; - - public bool EmailBounceIsHardBounce { get; set; } - - public int EmailBounceSoftBounceCount { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailBounce")] +[Index("EmailBounceEmailAddress", Name = "IX_EmailLibrary_EmailBounce_EmailBounceEmailAddress", IsUnique = true)] +public class EmailLibraryEmailBounce +{ + [Key] + [Column("EmailBounceID")] + public int EmailBounceId { get; set; } + + [StringLength(256)] + public string EmailBounceEmailAddress { get; set; } = null!; + + public bool EmailBounceIsHardBounce { get; set; } + + public int EmailBounceSoftBounceCount { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs index 46ac24c6..6ffdc15a 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannel.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailChannel")] -[Index("EmailChannelChannelId", Name = "IX_EmailLibrary_EmailChannel_EmailChannelChannelID")] -public partial class EmailLibraryEmailChannel -{ - [Key] - [Column("EmailChannelID")] - public int EmailChannelId { get; set; } - - [Column("EmailChannelGUID")] - public Guid EmailChannelGuid { get; set; } - - [Column("EmailChannelChannelID")] - public int EmailChannelChannelId { get; set; } - - [StringLength(252)] - public string EmailChannelSendingDomain { get; set; } = null!; - - [StringLength(400)] - public string EmailChannelServiceDomain { get; set; } = null!; - - [Column("EmailChannelPrimaryContentLanguageID")] - public int EmailChannelPrimaryContentLanguageId { get; set; } - - [ForeignKey("EmailChannelChannelId")] - [InverseProperty("EmailLibraryEmailChannels")] - public virtual CmsChannel EmailChannelChannel { get; set; } = null!; - - [InverseProperty("EmailChannelSenderEmailChannel")] - public virtual ICollection EmailLibraryEmailChannelSenders { get; set; } = new List(); - - [InverseProperty("EmailConfigurationEmailChannel")] - public virtual ICollection EmailLibraryEmailConfigurations { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailChannel")] +[Index("EmailChannelChannelId", Name = "IX_EmailLibrary_EmailChannel_EmailChannelChannelID")] +public class EmailLibraryEmailChannel +{ + [Key] + [Column("EmailChannelID")] + public int EmailChannelId { get; set; } + + [Column("EmailChannelGUID")] + public Guid EmailChannelGuid { get; set; } + + [Column("EmailChannelChannelID")] + public int EmailChannelChannelId { get; set; } + + [StringLength(252)] + public string EmailChannelSendingDomain { get; set; } = null!; + + [StringLength(400)] + public string EmailChannelServiceDomain { get; set; } = null!; + + [Column("EmailChannelPrimaryContentLanguageID")] + public int EmailChannelPrimaryContentLanguageId { get; set; } + + [ForeignKey("EmailChannelChannelId")] + [InverseProperty("EmailLibraryEmailChannels")] + public virtual CmsChannel EmailChannelChannel { get; set; } = null!; + + [InverseProperty("EmailChannelSenderEmailChannel")] + public virtual ICollection EmailLibraryEmailChannelSenders { get; set; } = new List(); + + [InverseProperty("EmailConfigurationEmailChannel")] + public virtual ICollection EmailLibraryEmailConfigurations { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs index 24da3132..c8519526 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailChannelSender.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailChannelSender")] -[Index("EmailChannelSenderEmailChannelId", Name = "IX_EmailLibrary_EmailChannelSender_EmailChannelSenderEmailChannelID")] -public partial class EmailLibraryEmailChannelSender -{ - [Key] - [Column("EmailChannelSenderID")] - public int EmailChannelSenderId { get; set; } - - [Column("EmailChannelSenderEmailChannelID")] - public int EmailChannelSenderEmailChannelId { get; set; } - - [StringLength(250)] - public string EmailChannelSenderName { get; set; } = null!; - - [StringLength(250)] - public string EmailChannelSenderDisplayName { get; set; } = null!; - - [Column("EmailChannelSenderGUID")] - public Guid EmailChannelSenderGuid { get; set; } - - public DateTime EmailChannelSenderCreated { get; set; } - - [ForeignKey("EmailChannelSenderEmailChannelId")] - [InverseProperty("EmailLibraryEmailChannelSenders")] - public virtual EmailLibraryEmailChannel EmailChannelSenderEmailChannel { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailChannelSender")] +[Index("EmailChannelSenderEmailChannelId", Name = "IX_EmailLibrary_EmailChannelSender_EmailChannelSenderEmailChannelID")] +public class EmailLibraryEmailChannelSender +{ + [Key] + [Column("EmailChannelSenderID")] + public int EmailChannelSenderId { get; set; } + + [Column("EmailChannelSenderEmailChannelID")] + public int EmailChannelSenderEmailChannelId { get; set; } + + [StringLength(250)] + public string EmailChannelSenderName { get; set; } = null!; + + [StringLength(250)] + public string EmailChannelSenderDisplayName { get; set; } = null!; + + [Column("EmailChannelSenderGUID")] + public Guid EmailChannelSenderGuid { get; set; } + + public DateTime EmailChannelSenderCreated { get; set; } + + [ForeignKey("EmailChannelSenderEmailChannelId")] + [InverseProperty("EmailLibraryEmailChannelSenders")] + public virtual EmailLibraryEmailChannel EmailChannelSenderEmailChannel { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs index 42d65da5..47d08ec5 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailConfiguration.cs @@ -1,60 +1,59 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailConfiguration")] -[Index("EmailConfigurationContentItemId", Name = "IX_EmailLibrary_EmailConfiguration_EmailConfigurationContentItemID")] -[Index("EmailConfigurationEmailChannelId", Name = "IX_EmailLibrary_EmailConfiguration_EmailConfigurationEmailChannelID")] -public partial class EmailLibraryEmailConfiguration -{ - [Key] - [Column("EmailConfigurationID")] - public int EmailConfigurationId { get; set; } - - [StringLength(250)] - public string EmailConfigurationName { get; set; } = null!; - - [Column("EmailConfigurationGUID")] - public Guid EmailConfigurationGuid { get; set; } - - public DateTime EmailConfigurationLastModified { get; set; } - - [StringLength(50)] - public string EmailConfigurationPurpose { get; set; } = null!; - - [Column("EmailConfigurationEmailChannelID")] - public int? EmailConfigurationEmailChannelId { get; set; } - - [Column("EmailConfigurationContentItemID")] - public int? EmailConfigurationContentItemId { get; set; } - - [InverseProperty("EmailEmailConfiguration")] - public virtual ICollection CmsEmails { get; set; } = new List(); - - [ForeignKey("EmailConfigurationContentItemId")] - [InverseProperty("EmailLibraryEmailConfigurations")] - public virtual CmsContentItem? EmailConfigurationContentItem { get; set; } - - [ForeignKey("EmailConfigurationEmailChannelId")] - [InverseProperty("EmailLibraryEmailConfigurations")] - public virtual EmailLibraryEmailChannel? EmailConfigurationEmailChannel { get; set; } - - [InverseProperty("EmailLinkEmailConfiguration")] - public virtual ICollection EmailLibraryEmailLinks { get; set; } = new List(); - - [InverseProperty("EmailMarketingRecipientEmailConfiguration")] - public virtual ICollection EmailLibraryEmailMarketingRecipients { get; set; } = new List(); - - [InverseProperty("EmailStatisticsEmailConfiguration")] - public virtual ICollection EmailLibraryEmailStatistics { get; set; } = new List(); - - [InverseProperty("EmailStatisticsHitsEmailConfiguration")] - public virtual ICollection EmailLibraryEmailStatisticsHits { get; set; } = new List(); - - [InverseProperty("SendConfigurationEmailConfiguration")] - public virtual EmailLibrarySendConfiguration? EmailLibrarySendConfiguration { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailConfiguration")] +[Index("EmailConfigurationContentItemId", Name = "IX_EmailLibrary_EmailConfiguration_EmailConfigurationContentItemID")] +[Index("EmailConfigurationEmailChannelId", Name = "IX_EmailLibrary_EmailConfiguration_EmailConfigurationEmailChannelID")] +public class EmailLibraryEmailConfiguration +{ + [Key] + [Column("EmailConfigurationID")] + public int EmailConfigurationId { get; set; } + + [StringLength(250)] + public string EmailConfigurationName { get; set; } = null!; + + [Column("EmailConfigurationGUID")] + public Guid EmailConfigurationGuid { get; set; } + + public DateTime EmailConfigurationLastModified { get; set; } + + [StringLength(50)] + public string EmailConfigurationPurpose { get; set; } = null!; + + [Column("EmailConfigurationEmailChannelID")] + public int? EmailConfigurationEmailChannelId { get; set; } + + [Column("EmailConfigurationContentItemID")] + public int? EmailConfigurationContentItemId { get; set; } + + [InverseProperty("EmailEmailConfiguration")] + public virtual ICollection CmsEmails { get; set; } = new List(); + + [ForeignKey("EmailConfigurationContentItemId")] + [InverseProperty("EmailLibraryEmailConfigurations")] + public virtual CmsContentItem? EmailConfigurationContentItem { get; set; } + + [ForeignKey("EmailConfigurationEmailChannelId")] + [InverseProperty("EmailLibraryEmailConfigurations")] + public virtual EmailLibraryEmailChannel? EmailConfigurationEmailChannel { get; set; } + + [InverseProperty("EmailLinkEmailConfiguration")] + public virtual ICollection EmailLibraryEmailLinks { get; set; } = new List(); + + [InverseProperty("EmailMarketingRecipientEmailConfiguration")] + public virtual ICollection EmailLibraryEmailMarketingRecipients { get; set; } = new List(); + + [InverseProperty("EmailStatisticsEmailConfiguration")] + public virtual ICollection EmailLibraryEmailStatistics { get; set; } = new List(); + + [InverseProperty("EmailStatisticsHitsEmailConfiguration")] + public virtual ICollection EmailLibraryEmailStatisticsHits { get; set; } = new List(); + + [InverseProperty("SendConfigurationEmailConfiguration")] + public virtual EmailLibrarySendConfiguration? EmailLibrarySendConfiguration { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs index 5ddafc2e..8dd593b2 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailLink.cs @@ -1,34 +1,33 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailLink")] -[Index("EmailLinkEmailConfigurationId", Name = "IX_EmailLibrary_EmailLink_EmailLinkEmailConfigurationID")] -public partial class EmailLibraryEmailLink -{ - [Key] - [Column("EmailLinkID")] - public int EmailLinkId { get; set; } - - [Column("EmailLinkEmailConfigurationID")] - public int EmailLinkEmailConfigurationId { get; set; } - - public string EmailLinkTarget { get; set; } = null!; - - [StringLength(450)] - public string EmailLinkDescription { get; set; } = null!; - - [Column("EmailLinkGUID")] - public Guid EmailLinkGuid { get; set; } - - [InverseProperty("EmailStatisticsHitsEmailLink")] - public virtual ICollection EmailLibraryEmailStatisticsHits { get; set; } = new List(); - - [ForeignKey("EmailLinkEmailConfigurationId")] - [InverseProperty("EmailLibraryEmailLinks")] - public virtual EmailLibraryEmailConfiguration EmailLinkEmailConfiguration { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailLink")] +[Index("EmailLinkEmailConfigurationId", Name = "IX_EmailLibrary_EmailLink_EmailLinkEmailConfigurationID")] +public class EmailLibraryEmailLink +{ + [Key] + [Column("EmailLinkID")] + public int EmailLinkId { get; set; } + + [Column("EmailLinkEmailConfigurationID")] + public int EmailLinkEmailConfigurationId { get; set; } + + public string EmailLinkTarget { get; set; } = null!; + + [StringLength(450)] + public string EmailLinkDescription { get; set; } = null!; + + [Column("EmailLinkGUID")] + public Guid EmailLinkGuid { get; set; } + + [InverseProperty("EmailStatisticsHitsEmailLink")] + public virtual ICollection EmailLibraryEmailStatisticsHits { get; set; } = new List(); + + [ForeignKey("EmailLinkEmailConfigurationId")] + [InverseProperty("EmailLibraryEmailLinks")] + public virtual EmailLibraryEmailConfiguration EmailLinkEmailConfiguration { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs index 7ccc4e48..18e5b4b8 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailMarketingRecipient.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailMarketingRecipient")] -[Index("EmailMarketingRecipientContactId", Name = "IX_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientContactID")] -[Index("EmailMarketingRecipientEmailConfigurationId", Name = "IX_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientEmailConfigurationID")] -public partial class EmailLibraryEmailMarketingRecipient -{ - [Key] - [Column("EmailMarketingRecipientID")] - public int EmailMarketingRecipientId { get; set; } - - [Column("EmailMarketingRecipientEmailConfigurationID")] - public int EmailMarketingRecipientEmailConfigurationId { get; set; } - - [Column("EmailMarketingRecipientContactID")] - public int EmailMarketingRecipientContactId { get; set; } - - [StringLength(254)] - public string EmailMarketingRecipientContactEmail { get; set; } = null!; - - public int EmailMarketingRecipientStatus { get; set; } - - [StringLength(500)] - public string? EmailMarketingRecipientErrorMessage { get; set; } - - public DateTime EmailMarketingRecipientLastModified { get; set; } - - public int EmailMarketingRecipientRetryAttempt { get; set; } - - [ForeignKey("EmailMarketingRecipientContactId")] - [InverseProperty("EmailLibraryEmailMarketingRecipients")] - public virtual OmContact EmailMarketingRecipientContact { get; set; } = null!; - - [ForeignKey("EmailMarketingRecipientEmailConfigurationId")] - [InverseProperty("EmailLibraryEmailMarketingRecipients")] - public virtual EmailLibraryEmailConfiguration EmailMarketingRecipientEmailConfiguration { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailMarketingRecipient")] +[Index("EmailMarketingRecipientContactId", Name = "IX_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientContactID")] +[Index("EmailMarketingRecipientEmailConfigurationId", Name = "IX_EmailLibrary_EmailMarketingRecipient_EmailMarketingRecipientEmailConfigurationID")] +public class EmailLibraryEmailMarketingRecipient +{ + [Key] + [Column("EmailMarketingRecipientID")] + public int EmailMarketingRecipientId { get; set; } + + [Column("EmailMarketingRecipientEmailConfigurationID")] + public int EmailMarketingRecipientEmailConfigurationId { get; set; } + + [Column("EmailMarketingRecipientContactID")] + public int EmailMarketingRecipientContactId { get; set; } + + [StringLength(254)] + public string EmailMarketingRecipientContactEmail { get; set; } = null!; + + public int EmailMarketingRecipientStatus { get; set; } + + [StringLength(500)] + public string? EmailMarketingRecipientErrorMessage { get; set; } + + public DateTime EmailMarketingRecipientLastModified { get; set; } + + public int EmailMarketingRecipientRetryAttempt { get; set; } + + [ForeignKey("EmailMarketingRecipientContactId")] + [InverseProperty("EmailLibraryEmailMarketingRecipients")] + public virtual OmContact EmailMarketingRecipientContact { get; set; } = null!; + + [ForeignKey("EmailMarketingRecipientEmailConfigurationId")] + [InverseProperty("EmailLibraryEmailMarketingRecipients")] + public virtual EmailLibraryEmailConfiguration EmailMarketingRecipientEmailConfiguration { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs index cbae7b82..916a6933 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatistic.cs @@ -1,43 +1,42 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailStatistics")] -[Index("EmailStatisticsEmailConfigurationId", Name = "IX_EmailLibrary_EmailStatistics_EmailStatisticsEmailConfigurationID")] -public partial class EmailLibraryEmailStatistic -{ - [Key] - [Column("EmailStatisticsID")] - public int EmailStatisticsId { get; set; } - - [Column("EmailStatisticsEmailConfigurationID")] - public int EmailStatisticsEmailConfigurationId { get; set; } - - public int EmailStatisticsEmailOpens { get; set; } - - public int EmailStatisticsEmailUniqueOpens { get; set; } - - public int EmailStatisticsEmailClicks { get; set; } - - public int EmailStatisticsEmailUniqueClicks { get; set; } - - public int EmailStatisticsTotalSent { get; set; } - - public int? EmailStatisticsEmailSoftBounces { get; set; } - - public int? EmailStatisticsEmailHardBounces { get; set; } - - public int EmailStatisticsEmailsDelivered { get; set; } - - public int EmailStatisticsUniqueUnsubscribes { get; set; } - - public int? EmailStatisticsSpamReports { get; set; } - - [ForeignKey("EmailStatisticsEmailConfigurationId")] - [InverseProperty("EmailLibraryEmailStatistics")] - public virtual EmailLibraryEmailConfiguration EmailStatisticsEmailConfiguration { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailStatistics")] +[Index("EmailStatisticsEmailConfigurationId", Name = "IX_EmailLibrary_EmailStatistics_EmailStatisticsEmailConfigurationID")] +public class EmailLibraryEmailStatistic +{ + [Key] + [Column("EmailStatisticsID")] + public int EmailStatisticsId { get; set; } + + [Column("EmailStatisticsEmailConfigurationID")] + public int EmailStatisticsEmailConfigurationId { get; set; } + + public int EmailStatisticsEmailOpens { get; set; } + + public int EmailStatisticsEmailUniqueOpens { get; set; } + + public int EmailStatisticsEmailClicks { get; set; } + + public int EmailStatisticsEmailUniqueClicks { get; set; } + + public int EmailStatisticsTotalSent { get; set; } + + public int? EmailStatisticsEmailSoftBounces { get; set; } + + public int? EmailStatisticsEmailHardBounces { get; set; } + + public int EmailStatisticsEmailsDelivered { get; set; } + + public int EmailStatisticsUniqueUnsubscribes { get; set; } + + public int? EmailStatisticsSpamReports { get; set; } + + [ForeignKey("EmailStatisticsEmailConfigurationId")] + [InverseProperty("EmailLibraryEmailStatistics")] + public virtual EmailLibraryEmailConfiguration EmailStatisticsEmailConfiguration { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs index 8bd2fa7b..b9a7ff99 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailStatisticsHit.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailStatisticsHits")] -[Index("EmailStatisticsHitsEmailConfigurationId", Name = "IX_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailConfigurationID")] -[Index("EmailStatisticsHitsEmailLinkId", Name = "IX_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailLinkID")] -public partial class EmailLibraryEmailStatisticsHit -{ - [Key] - [Column("EmailStatisticsHitsID")] - public long EmailStatisticsHitsId { get; set; } - - [Column("EmailStatisticsHitsEmailConfigurationID")] - public int EmailStatisticsHitsEmailConfigurationId { get; set; } - - public int EmailStatisticsHitsType { get; set; } - - public DateTime EmailStatisticsHitsTime { get; set; } - - [Column("EmailStatisticsHitsMailoutGUID")] - public Guid EmailStatisticsHitsMailoutGuid { get; set; } - - [Column("EmailStatisticsHitsEmailLinkID")] - public int? EmailStatisticsHitsEmailLinkId { get; set; } - - [ForeignKey("EmailStatisticsHitsEmailConfigurationId")] - [InverseProperty("EmailLibraryEmailStatisticsHits")] - public virtual EmailLibraryEmailConfiguration EmailStatisticsHitsEmailConfiguration { get; set; } = null!; - - [ForeignKey("EmailStatisticsHitsEmailLinkId")] - [InverseProperty("EmailLibraryEmailStatisticsHits")] - public virtual EmailLibraryEmailLink? EmailStatisticsHitsEmailLink { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailStatisticsHits")] +[Index("EmailStatisticsHitsEmailConfigurationId", Name = "IX_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailConfigurationID")] +[Index("EmailStatisticsHitsEmailLinkId", Name = "IX_EmailLibrary_EmailStatisticsHits_EmailStatisticsHitsEmailLinkID")] +public class EmailLibraryEmailStatisticsHit +{ + [Key] + [Column("EmailStatisticsHitsID")] + public long EmailStatisticsHitsId { get; set; } + + [Column("EmailStatisticsHitsEmailConfigurationID")] + public int EmailStatisticsHitsEmailConfigurationId { get; set; } + + public int EmailStatisticsHitsType { get; set; } + + public DateTime EmailStatisticsHitsTime { get; set; } + + [Column("EmailStatisticsHitsMailoutGUID")] + public Guid EmailStatisticsHitsMailoutGuid { get; set; } + + [Column("EmailStatisticsHitsEmailLinkID")] + public int? EmailStatisticsHitsEmailLinkId { get; set; } + + [ForeignKey("EmailStatisticsHitsEmailConfigurationId")] + [InverseProperty("EmailLibraryEmailStatisticsHits")] + public virtual EmailLibraryEmailConfiguration EmailStatisticsHitsEmailConfiguration { get; set; } = null!; + + [ForeignKey("EmailStatisticsHitsEmailLinkId")] + [InverseProperty("EmailLibraryEmailStatisticsHits")] + public virtual EmailLibraryEmailLink? EmailStatisticsHitsEmailLink { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs index b1fde4e5..28218f02 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailSubscriptionConfirmation.cs @@ -1,38 +1,37 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailSubscriptionConfirmation")] -[Index("EmailSubscriptionConfirmationContactId", Name = "IX_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationContactID")] -[Index("EmailSubscriptionConfirmationRecipientListId", Name = "IX_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationRecipientListID")] -public partial class EmailLibraryEmailSubscriptionConfirmation -{ - [Key] - [Column("EmailSubscriptionConfirmationID")] - public int EmailSubscriptionConfirmationId { get; set; } - - [Column("EmailSubscriptionConfirmationContactID")] - public int EmailSubscriptionConfirmationContactId { get; set; } - - [Column("EmailSubscriptionConfirmationRecipientListID")] - public int EmailSubscriptionConfirmationRecipientListId { get; set; } - - public bool EmailSubscriptionConfirmationIsApproved { get; set; } - - public DateTime EmailSubscriptionConfirmationDate { get; set; } - - [Column("EmailSubscriptionConfirmationGUID")] - public Guid EmailSubscriptionConfirmationGuid { get; set; } - - [ForeignKey("EmailSubscriptionConfirmationContactId")] - [InverseProperty("EmailLibraryEmailSubscriptionConfirmations")] - public virtual OmContact EmailSubscriptionConfirmationContact { get; set; } = null!; - - [ForeignKey("EmailSubscriptionConfirmationRecipientListId")] - [InverseProperty("EmailLibraryEmailSubscriptionConfirmations")] - public virtual OmContactGroup EmailSubscriptionConfirmationRecipientList { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailSubscriptionConfirmation")] +[Index("EmailSubscriptionConfirmationContactId", Name = "IX_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationContactID")] +[Index("EmailSubscriptionConfirmationRecipientListId", Name = "IX_EmailLibrary_EmailSubscriptionConfirmation_EmailSubscriptionConfirmationRecipientListID")] +public class EmailLibraryEmailSubscriptionConfirmation +{ + [Key] + [Column("EmailSubscriptionConfirmationID")] + public int EmailSubscriptionConfirmationId { get; set; } + + [Column("EmailSubscriptionConfirmationContactID")] + public int EmailSubscriptionConfirmationContactId { get; set; } + + [Column("EmailSubscriptionConfirmationRecipientListID")] + public int EmailSubscriptionConfirmationRecipientListId { get; set; } + + public bool EmailSubscriptionConfirmationIsApproved { get; set; } + + public DateTime EmailSubscriptionConfirmationDate { get; set; } + + [Column("EmailSubscriptionConfirmationGUID")] + public Guid EmailSubscriptionConfirmationGuid { get; set; } + + [ForeignKey("EmailSubscriptionConfirmationContactId")] + [InverseProperty("EmailLibraryEmailSubscriptionConfirmations")] + public virtual OmContact EmailSubscriptionConfirmationContact { get; set; } = null!; + + [ForeignKey("EmailSubscriptionConfirmationRecipientListId")] + [InverseProperty("EmailLibraryEmailSubscriptionConfirmations")] + public virtual OmContactGroup EmailSubscriptionConfirmationRecipientList { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs index 9d3c1d0c..029f3739 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplate.cs @@ -1,32 +1,29 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailTemplate")] -public partial class EmailLibraryEmailTemplate -{ - [Key] - [Column("EmailTemplateID")] - public int EmailTemplateId { get; set; } - - [StringLength(250)] - public string EmailTemplateName { get; set; } = null!; - - [StringLength(250)] - public string EmailTemplateDisplayName { get; set; } = null!; - - public string? EmailTemplateDescription { get; set; } - - public string EmailTemplateCode { get; set; } = null!; - - public Guid EmailTemplateGuid { get; set; } - - public DateTime EmailTemplateLastModified { get; set; } - - [InverseProperty("EmailTemplateContentTypeEmailTemplate")] - public virtual ICollection EmailLibraryEmailTemplateContentTypes { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailTemplate")] +public class EmailLibraryEmailTemplate +{ + [Key] + [Column("EmailTemplateID")] + public int EmailTemplateId { get; set; } + + [StringLength(250)] + public string EmailTemplateName { get; set; } = null!; + + [StringLength(250)] + public string EmailTemplateDisplayName { get; set; } = null!; + + public string? EmailTemplateDescription { get; set; } + + public string EmailTemplateCode { get; set; } = null!; + + public Guid EmailTemplateGuid { get; set; } + + public DateTime EmailTemplateLastModified { get; set; } + + [InverseProperty("EmailTemplateContentTypeEmailTemplate")] + public virtual ICollection EmailLibraryEmailTemplateContentTypes { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs b/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs index d4a4eec7..33a431f4 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryEmailTemplateContentType.cs @@ -1,31 +1,30 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_EmailTemplateContentType")] -[Index("EmailTemplateContentTypeContentTypeId", Name = "IX_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeContentTypeID")] -[Index("EmailTemplateContentTypeEmailTemplateId", Name = "IX_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeEmailTemplateID")] -public partial class EmailLibraryEmailTemplateContentType -{ - [Key] - [Column("EmailTemplateContentTypeID")] - public int EmailTemplateContentTypeId { get; set; } - - [Column("EmailTemplateContentTypeContentTypeID")] - public int EmailTemplateContentTypeContentTypeId { get; set; } - - [Column("EmailTemplateContentTypeEmailTemplateID")] - public int EmailTemplateContentTypeEmailTemplateId { get; set; } - - [ForeignKey("EmailTemplateContentTypeContentTypeId")] - [InverseProperty("EmailLibraryEmailTemplateContentTypes")] - public virtual CmsClass EmailTemplateContentTypeContentType { get; set; } = null!; - - [ForeignKey("EmailTemplateContentTypeEmailTemplateId")] - [InverseProperty("EmailLibraryEmailTemplateContentTypes")] - public virtual EmailLibraryEmailTemplate EmailTemplateContentTypeEmailTemplate { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_EmailTemplateContentType")] +[Index("EmailTemplateContentTypeContentTypeId", Name = "IX_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeContentTypeID")] +[Index("EmailTemplateContentTypeEmailTemplateId", Name = "IX_EmailLibrary_EmailTemplateContentType_EmailTemplateContentTypeEmailTemplateID")] +public class EmailLibraryEmailTemplateContentType +{ + [Key] + [Column("EmailTemplateContentTypeID")] + public int EmailTemplateContentTypeId { get; set; } + + [Column("EmailTemplateContentTypeContentTypeID")] + public int EmailTemplateContentTypeContentTypeId { get; set; } + + [Column("EmailTemplateContentTypeEmailTemplateID")] + public int EmailTemplateContentTypeEmailTemplateId { get; set; } + + [ForeignKey("EmailTemplateContentTypeContentTypeId")] + [InverseProperty("EmailLibraryEmailTemplateContentTypes")] + public virtual CmsClass EmailTemplateContentTypeContentType { get; set; } = null!; + + [ForeignKey("EmailTemplateContentTypeEmailTemplateId")] + [InverseProperty("EmailLibraryEmailTemplateContentTypes")] + public virtual EmailLibraryEmailTemplate EmailTemplateContentTypeEmailTemplate { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs b/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs index 1df1e79d..32e2217a 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibraryRecipientListSetting.cs @@ -1,40 +1,39 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_RecipientListSettings")] -[Index("RecipientListSettingsRecipientListId", Name = "IX_EmailLibrary_RecipientListSettings_RecipientListSettingsRecipientListID")] -public partial class EmailLibraryRecipientListSetting -{ - [Key] - [Column("RecipientListSettingsID")] - public int RecipientListSettingsId { get; set; } - - [Column("RecipientListSettingsRecipientListID")] - public int RecipientListSettingsRecipientListId { get; set; } - - public Guid? RecipientListSettingsAfterUnsubscriptionPage { get; set; } - - public bool RecipientListSettingsSendUnsubscriptionConfirmationEmail { get; set; } - - [Column("RecipientListSettingsUnsubscriptionConfirmationEmailID")] - public int? RecipientListSettingsUnsubscriptionConfirmationEmailId { get; set; } - - public Guid? RecipientListSettingsAfterConfirmationPage { get; set; } - - public bool RecipientListSettingsSendSubscriptionConfirmationEmail { get; set; } - - [Column("RecipientListSettingsSubscriptionConfirmationEmailID")] - public int? RecipientListSettingsSubscriptionConfirmationEmailId { get; set; } - - [Column("RecipientListSettingsGUID")] - public Guid RecipientListSettingsGuid { get; set; } - - [ForeignKey("RecipientListSettingsRecipientListId")] - [InverseProperty("EmailLibraryRecipientListSettings")] - public virtual OmContactGroup RecipientListSettingsRecipientList { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_RecipientListSettings")] +[Index("RecipientListSettingsRecipientListId", Name = "IX_EmailLibrary_RecipientListSettings_RecipientListSettingsRecipientListID")] +public class EmailLibraryRecipientListSetting +{ + [Key] + [Column("RecipientListSettingsID")] + public int RecipientListSettingsId { get; set; } + + [Column("RecipientListSettingsRecipientListID")] + public int RecipientListSettingsRecipientListId { get; set; } + + public Guid? RecipientListSettingsAfterUnsubscriptionPage { get; set; } + + public bool RecipientListSettingsSendUnsubscriptionConfirmationEmail { get; set; } + + [Column("RecipientListSettingsUnsubscriptionConfirmationEmailID")] + public int? RecipientListSettingsUnsubscriptionConfirmationEmailId { get; set; } + + public Guid? RecipientListSettingsAfterConfirmationPage { get; set; } + + public bool RecipientListSettingsSendSubscriptionConfirmationEmail { get; set; } + + [Column("RecipientListSettingsSubscriptionConfirmationEmailID")] + public int? RecipientListSettingsSubscriptionConfirmationEmailId { get; set; } + + [Column("RecipientListSettingsGUID")] + public Guid RecipientListSettingsGuid { get; set; } + + [ForeignKey("RecipientListSettingsRecipientListId")] + [InverseProperty("EmailLibraryRecipientListSettings")] + public virtual OmContactGroup RecipientListSettingsRecipientList { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs b/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs index 85f2e3b6..32a2caba 100644 --- a/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs +++ b/Migration.Toolkit.KXP/Models/EmailLibrarySendConfiguration.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("EmailLibrary_SendConfiguration")] -[Index("SendConfigurationEmailConfigurationId", Name = "IX_EmailLibrary_SendConfiguration_SendConfigurationEmailConfigurationID")] -[Index("SendConfigurationRecipientListId", Name = "IX_EmailLibrary_SendConfiguration_SendConfigurationRecipientListID")] -[Index("SendConfigurationEmailConfigurationId", Name = "UQ_EmailLibrary_SendConfiguration_SendConfigurationEmailConfigurationID", IsUnique = true)] -public partial class EmailLibrarySendConfiguration -{ - [Key] - [Column("SendConfigurationID")] - public int SendConfigurationId { get; set; } - - [Column("SendConfigurationEmailConfigurationID")] - public int SendConfigurationEmailConfigurationId { get; set; } - - [Column("SendConfigurationRecipientListID")] - public int SendConfigurationRecipientListId { get; set; } - - public DateTime? SendConfigurationScheduledTime { get; set; } - - [Column("SendConfigurationGUID")] - public Guid SendConfigurationGuid { get; set; } - - public int SendConfigurationStatus { get; set; } - - [ForeignKey("SendConfigurationEmailConfigurationId")] - [InverseProperty("EmailLibrarySendConfiguration")] - public virtual EmailLibraryEmailConfiguration SendConfigurationEmailConfiguration { get; set; } = null!; - - [ForeignKey("SendConfigurationRecipientListId")] - [InverseProperty("EmailLibrarySendConfigurations")] - public virtual OmContactGroup SendConfigurationRecipientList { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("EmailLibrary_SendConfiguration")] +[Index("SendConfigurationEmailConfigurationId", Name = "IX_EmailLibrary_SendConfiguration_SendConfigurationEmailConfigurationID")] +[Index("SendConfigurationRecipientListId", Name = "IX_EmailLibrary_SendConfiguration_SendConfigurationRecipientListID")] +[Index("SendConfigurationEmailConfigurationId", Name = "UQ_EmailLibrary_SendConfiguration_SendConfigurationEmailConfigurationID", IsUnique = true)] +public class EmailLibrarySendConfiguration +{ + [Key] + [Column("SendConfigurationID")] + public int SendConfigurationId { get; set; } + + [Column("SendConfigurationEmailConfigurationID")] + public int SendConfigurationEmailConfigurationId { get; set; } + + [Column("SendConfigurationRecipientListID")] + public int SendConfigurationRecipientListId { get; set; } + + public DateTime? SendConfigurationScheduledTime { get; set; } + + [Column("SendConfigurationGUID")] + public Guid SendConfigurationGuid { get; set; } + + public int SendConfigurationStatus { get; set; } + + [ForeignKey("SendConfigurationEmailConfigurationId")] + [InverseProperty("EmailLibrarySendConfiguration")] + public virtual EmailLibraryEmailConfiguration SendConfigurationEmailConfiguration { get; set; } = null!; + + [ForeignKey("SendConfigurationRecipientListId")] + [InverseProperty("EmailLibrarySendConfigurations")] + public virtual OmContactGroup SendConfigurationRecipientList { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/MediaFile.cs b/Migration.Toolkit.KXP/Models/MediaFile.cs index eccd2aa7..9e2544de 100644 --- a/Migration.Toolkit.KXP/Models/MediaFile.cs +++ b/Migration.Toolkit.KXP/Models/MediaFile.cs @@ -1,71 +1,70 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("Media_File")] -[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] -[Index("FileGuid", Name = "IX_Media_File_FileGUID")] -[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] -[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] -public partial class MediaFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [StringLength(250)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string FileTitle { get; set; } = null!; - - public string FileDescription { get; set; } = null!; - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public string FilePath { get; set; } = null!; - - public long FileSize { get; set; } - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - [Column("FileLibraryID")] - public int FileLibraryId { get; set; } - - [Column("FileCreatedByUserID")] - public int? FileCreatedByUserId { get; set; } - - public DateTime FileCreatedWhen { get; set; } - - [Column("FileModifiedByUserID")] - public int? FileModifiedByUserId { get; set; } - - public DateTime FileModifiedWhen { get; set; } - - public string? FileCustomData { get; set; } - - [ForeignKey("FileCreatedByUserId")] - [InverseProperty("MediaFileFileCreatedByUsers")] - public virtual CmsUser? FileCreatedByUser { get; set; } - - [ForeignKey("FileLibraryId")] - [InverseProperty("MediaFiles")] - public virtual MediaLibrary FileLibrary { get; set; } = null!; - - [ForeignKey("FileModifiedByUserId")] - [InverseProperty("MediaFileFileModifiedByUsers")] - public virtual CmsUser? FileModifiedByUser { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("Media_File")] +[Index("FileCreatedByUserId", Name = "IX_Media_File_FileCreatedByUserID")] +[Index("FileGuid", Name = "IX_Media_File_FileGUID")] +[Index("FileLibraryId", Name = "IX_Media_File_FileLibraryID")] +[Index("FileModifiedByUserId", Name = "IX_Media_File_FileModifiedByUserID")] +public class MediaFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [StringLength(250)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string FileTitle { get; set; } = null!; + + public string FileDescription { get; set; } = null!; + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public string FilePath { get; set; } = null!; + + public long FileSize { get; set; } + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + [Column("FileLibraryID")] + public int FileLibraryId { get; set; } + + [Column("FileCreatedByUserID")] + public int? FileCreatedByUserId { get; set; } + + public DateTime FileCreatedWhen { get; set; } + + [Column("FileModifiedByUserID")] + public int? FileModifiedByUserId { get; set; } + + public DateTime FileModifiedWhen { get; set; } + + public string? FileCustomData { get; set; } + + [ForeignKey("FileCreatedByUserId")] + [InverseProperty("MediaFileFileCreatedByUsers")] + public virtual CmsUser? FileCreatedByUser { get; set; } + + [ForeignKey("FileLibraryId")] + [InverseProperty("MediaFiles")] + public virtual MediaLibrary FileLibrary { get; set; } = null!; + + [ForeignKey("FileModifiedByUserId")] + [InverseProperty("MediaFileFileModifiedByUsers")] + public virtual CmsUser? FileModifiedByUser { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/MediaLibrary.cs b/Migration.Toolkit.KXP/Models/MediaLibrary.cs index f65d2f29..3d337beb 100644 --- a/Migration.Toolkit.KXP/Models/MediaLibrary.cs +++ b/Migration.Toolkit.KXP/Models/MediaLibrary.cs @@ -1,37 +1,36 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("Media_Library")] -[Index("LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] -public partial class MediaLibrary -{ - [Key] - [Column("LibraryID")] - public int LibraryId { get; set; } - - [StringLength(250)] - public string LibraryName { get; set; } = null!; - - [StringLength(250)] - public string LibraryDisplayName { get; set; } = null!; - - public string? LibraryDescription { get; set; } - - [StringLength(250)] - public string LibraryFolder { get; set; } = null!; - - public int? LibraryAccess { get; set; } - - [Column("LibraryGUID")] - public Guid? LibraryGuid { get; set; } - - public DateTime? LibraryLastModified { get; set; } - - [InverseProperty("FileLibrary")] - public virtual ICollection MediaFiles { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("Media_Library")] +[Index("LibraryName", "LibraryGuid", Name = "IX_Media_Library_LibrarySiteID_LibraryName_LibraryGUID", IsUnique = true)] +public class MediaLibrary +{ + [Key] + [Column("LibraryID")] + public int LibraryId { get; set; } + + [StringLength(250)] + public string LibraryName { get; set; } = null!; + + [StringLength(250)] + public string LibraryDisplayName { get; set; } = null!; + + public string? LibraryDescription { get; set; } + + [StringLength(250)] + public string LibraryFolder { get; set; } = null!; + + public int? LibraryAccess { get; set; } + + [Column("LibraryGUID")] + public Guid? LibraryGuid { get; set; } + + public DateTime? LibraryLastModified { get; set; } + + [InverseProperty("FileLibrary")] + public virtual ICollection MediaFiles { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/OmAccount.cs b/Migration.Toolkit.KXP/Models/OmAccount.cs index e67e0195..e4d1039b 100644 --- a/Migration.Toolkit.KXP/Models/OmAccount.cs +++ b/Migration.Toolkit.KXP/Models/OmAccount.cs @@ -1,114 +1,113 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_Account")] -[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] -[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] -[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] -[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] -[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] -[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] -[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] -public partial class OmAccount -{ - [Key] - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [ForeignKey("AccountCountryId")] - [InverseProperty("OmAccounts")] - public virtual CmsCountry? AccountCountry { get; set; } - - [ForeignKey("AccountOwnerUserId")] - [InverseProperty("OmAccounts")] - public virtual CmsUser? AccountOwnerUser { get; set; } - - [ForeignKey("AccountPrimaryContactId")] - [InverseProperty("OmAccountAccountPrimaryContacts")] - public virtual OmContact? AccountPrimaryContact { get; set; } - - [ForeignKey("AccountSecondaryContactId")] - [InverseProperty("OmAccountAccountSecondaryContacts")] - public virtual OmContact? AccountSecondaryContact { get; set; } - - [ForeignKey("AccountStateId")] - [InverseProperty("OmAccounts")] - public virtual CmsState? AccountState { get; set; } - - [ForeignKey("AccountStatusId")] - [InverseProperty("OmAccounts")] - public virtual OmAccountStatus? AccountStatus { get; set; } - - [ForeignKey("AccountSubsidiaryOfId")] - [InverseProperty("InverseAccountSubsidiaryOf")] - public virtual OmAccount? AccountSubsidiaryOf { get; set; } - - [InverseProperty("AccountSubsidiaryOf")] - public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); - - [InverseProperty("Account")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_Account")] +[Index("AccountCountryId", Name = "IX_OM_Account_AccountCountryID")] +[Index("AccountOwnerUserId", Name = "IX_OM_Account_AccountOwnerUserID")] +[Index("AccountPrimaryContactId", Name = "IX_OM_Account_AccountPrimaryContactID")] +[Index("AccountSecondaryContactId", Name = "IX_OM_Account_AccountSecondaryContactID")] +[Index("AccountStateId", Name = "IX_OM_Account_AccountStateID")] +[Index("AccountStatusId", Name = "IX_OM_Account_AccountStatusID")] +[Index("AccountSubsidiaryOfId", Name = "IX_OM_Account_AccountSubsidiaryOfID")] +public class OmAccount +{ + [Key] + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [ForeignKey("AccountCountryId")] + [InverseProperty("OmAccounts")] + public virtual CmsCountry? AccountCountry { get; set; } + + [ForeignKey("AccountOwnerUserId")] + [InverseProperty("OmAccounts")] + public virtual CmsUser? AccountOwnerUser { get; set; } + + [ForeignKey("AccountPrimaryContactId")] + [InverseProperty("OmAccountAccountPrimaryContacts")] + public virtual OmContact? AccountPrimaryContact { get; set; } + + [ForeignKey("AccountSecondaryContactId")] + [InverseProperty("OmAccountAccountSecondaryContacts")] + public virtual OmContact? AccountSecondaryContact { get; set; } + + [ForeignKey("AccountStateId")] + [InverseProperty("OmAccounts")] + public virtual CmsState? AccountState { get; set; } + + [ForeignKey("AccountStatusId")] + [InverseProperty("OmAccounts")] + public virtual OmAccountStatus? AccountStatus { get; set; } + + [ForeignKey("AccountSubsidiaryOfId")] + [InverseProperty("InverseAccountSubsidiaryOf")] + public virtual OmAccount? AccountSubsidiaryOf { get; set; } + + [InverseProperty("AccountSubsidiaryOf")] + public virtual ICollection InverseAccountSubsidiaryOf { get; set; } = new List(); + + [InverseProperty("Account")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/OmAccountContact.cs b/Migration.Toolkit.KXP/Models/OmAccountContact.cs index 7d694bc8..ffee7d57 100644 --- a/Migration.Toolkit.KXP/Models/OmAccountContact.cs +++ b/Migration.Toolkit.KXP/Models/OmAccountContact.cs @@ -1,39 +1,38 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_AccountContact")] -[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] -[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] -[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] -public partial class OmAccountContact -{ - [Key] - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("ContactID")] - public int ContactId { get; set; } - - [ForeignKey("AccountId")] - [InverseProperty("OmAccountContacts")] - public virtual OmAccount Account { get; set; } = null!; - - [ForeignKey("ContactId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContact Contact { get; set; } = null!; - - [ForeignKey("ContactRoleId")] - [InverseProperty("OmAccountContacts")] - public virtual OmContactRole? ContactRole { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_AccountContact")] +[Index("AccountId", Name = "IX_OM_AccountContact_AccountID")] +[Index("ContactId", Name = "IX_OM_AccountContact_ContactID")] +[Index("ContactRoleId", Name = "IX_OM_AccountContact_ContactRoleID")] +public class OmAccountContact +{ + [Key] + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("ContactID")] + public int ContactId { get; set; } + + [ForeignKey("AccountId")] + [InverseProperty("OmAccountContacts")] + public virtual OmAccount Account { get; set; } = null!; + + [ForeignKey("ContactId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContact Contact { get; set; } = null!; + + [ForeignKey("ContactRoleId")] + [InverseProperty("OmAccountContacts")] + public virtual OmContactRole? ContactRole { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/OmAccountStatus.cs b/Migration.Toolkit.KXP/Models/OmAccountStatus.cs index fdd34cee..7ef6da94 100644 --- a/Migration.Toolkit.KXP/Models/OmAccountStatus.cs +++ b/Migration.Toolkit.KXP/Models/OmAccountStatus.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_AccountStatus")] -public partial class OmAccountStatus -{ - [Key] - [Column("AccountStatusID")] - public int AccountStatusId { get; set; } - - [StringLength(200)] - public string AccountStatusName { get; set; } = null!; - - [StringLength(200)] - public string AccountStatusDisplayName { get; set; } = null!; - - public string? AccountStatusDescription { get; set; } - - [InverseProperty("AccountStatus")] - public virtual ICollection OmAccounts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_AccountStatus")] +public class OmAccountStatus +{ + [Key] + [Column("AccountStatusID")] + public int AccountStatusId { get; set; } + + [StringLength(200)] + public string AccountStatusName { get; set; } = null!; + + [StringLength(200)] + public string AccountStatusDisplayName { get; set; } = null!; + + public string? AccountStatusDescription { get; set; } + + [InverseProperty("AccountStatus")] + public virtual ICollection OmAccounts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/OmActivity.cs b/Migration.Toolkit.KXP/Models/OmActivity.cs index a3b53cf0..e6c76d3b 100644 --- a/Migration.Toolkit.KXP/Models/OmActivity.cs +++ b/Migration.Toolkit.KXP/Models/OmActivity.cs @@ -1,77 +1,76 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_Activity")] -[Index("ActivityChannelId", Name = "IX_OM_Activity_ActivityChannelID")] -[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] -[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] -[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] -[Index("ActivityLanguageId", Name = "IX_OM_Activity_ActivityLanguageID")] -[Index("ActivityType", "ActivityItemId", "ActivityWebPageItemGuid", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityWebPageItemGUID_ActivityUTMSource_ActivityUTMContent")] -public partial class OmActivity -{ - [Key] - [Column("ActivityID")] - public int ActivityId { get; set; } - - [Column("ActivityContactID")] - public int ActivityContactId { get; set; } - - public DateTime? ActivityCreated { get; set; } - - [StringLength(250)] - public string ActivityType { get; set; } = null!; - - [Column("ActivityItemID")] - public int? ActivityItemId { get; set; } - - [Column("ActivityItemDetailID")] - public int? ActivityItemDetailId { get; set; } - - [StringLength(250)] - public string? ActivityValue { get; set; } - - [Column("ActivityURL")] - public string? ActivityUrl { get; set; } - - [StringLength(250)] - public string? ActivityTitle { get; set; } - - public string? ActivityComment { get; set; } - - [Column("ActivityURLReferrer")] - public string? ActivityUrlreferrer { get; set; } - - [Column("ActivityUTMSource")] - [StringLength(200)] - public string? ActivityUtmsource { get; set; } - - [Column("ActivityUTMContent")] - [StringLength(200)] - public string? ActivityUtmcontent { get; set; } - - [Column("ActivityTrackedWebsiteID")] - public int? ActivityTrackedWebsiteId { get; set; } - - [Column("ActivityWebPageItemGUID")] - public Guid? ActivityWebPageItemGuid { get; set; } - - [Column("ActivityLanguageID")] - public int? ActivityLanguageId { get; set; } - - [Column("ActivityChannelID")] - public int? ActivityChannelId { get; set; } - - [ForeignKey("ActivityChannelId")] - [InverseProperty("OmActivities")] - public virtual CmsChannel? ActivityChannel { get; set; } - - [ForeignKey("ActivityLanguageId")] - [InverseProperty("OmActivities")] - public virtual CmsContentLanguage? ActivityLanguage { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_Activity")] +[Index("ActivityChannelId", Name = "IX_OM_Activity_ActivityChannelID")] +[Index("ActivityContactId", Name = "IX_OM_Activity_ActivityContactID")] +[Index("ActivityCreated", Name = "IX_OM_Activity_ActivityCreated")] +[Index("ActivityItemDetailId", Name = "IX_OM_Activity_ActivityItemDetailID")] +[Index("ActivityLanguageId", Name = "IX_OM_Activity_ActivityLanguageID")] +[Index("ActivityType", "ActivityItemId", "ActivityWebPageItemGuid", Name = "IX_OM_Activity_ActivityType_ActivityItemID_ActivityWebPageItemGUID_ActivityUTMSource_ActivityUTMContent")] +public class OmActivity +{ + [Key] + [Column("ActivityID")] + public int ActivityId { get; set; } + + [Column("ActivityContactID")] + public int ActivityContactId { get; set; } + + public DateTime? ActivityCreated { get; set; } + + [StringLength(250)] + public string ActivityType { get; set; } = null!; + + [Column("ActivityItemID")] + public int? ActivityItemId { get; set; } + + [Column("ActivityItemDetailID")] + public int? ActivityItemDetailId { get; set; } + + [StringLength(250)] + public string? ActivityValue { get; set; } + + [Column("ActivityURL")] + public string? ActivityUrl { get; set; } + + [StringLength(250)] + public string? ActivityTitle { get; set; } + + public string? ActivityComment { get; set; } + + [Column("ActivityURLReferrer")] + public string? ActivityUrlreferrer { get; set; } + + [Column("ActivityUTMSource")] + [StringLength(200)] + public string? ActivityUtmsource { get; set; } + + [Column("ActivityUTMContent")] + [StringLength(200)] + public string? ActivityUtmcontent { get; set; } + + [Column("ActivityTrackedWebsiteID")] + public int? ActivityTrackedWebsiteId { get; set; } + + [Column("ActivityWebPageItemGUID")] + public Guid? ActivityWebPageItemGuid { get; set; } + + [Column("ActivityLanguageID")] + public int? ActivityLanguageId { get; set; } + + [Column("ActivityChannelID")] + public int? ActivityChannelId { get; set; } + + [ForeignKey("ActivityChannelId")] + [InverseProperty("OmActivities")] + public virtual CmsChannel? ActivityChannel { get; set; } + + [ForeignKey("ActivityLanguageId")] + [InverseProperty("OmActivities")] + public virtual CmsContentLanguage? ActivityLanguage { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs b/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs index 26eb379d..caf1179e 100644 --- a/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs +++ b/Migration.Toolkit.KXP/Models/OmActivityRecalculationQueue.cs @@ -1,18 +1,15 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ActivityRecalculationQueue")] -public partial class OmActivityRecalculationQueue -{ - [Key] - [Column("ActivityRecalculationQueueID")] - public int ActivityRecalculationQueueId { get; set; } - - [Column("ActivityRecalculationQueueActivityID")] - public int ActivityRecalculationQueueActivityId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_ActivityRecalculationQueue")] +public class OmActivityRecalculationQueue +{ + [Key] + [Column("ActivityRecalculationQueueID")] + public int ActivityRecalculationQueueId { get; set; } + + [Column("ActivityRecalculationQueueActivityID")] + public int ActivityRecalculationQueueActivityId { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/OmActivityType.cs b/Migration.Toolkit.KXP/Models/OmActivityType.cs index 994a9827..dccc96d8 100644 --- a/Migration.Toolkit.KXP/Models/OmActivityType.cs +++ b/Migration.Toolkit.KXP/Models/OmActivityType.cs @@ -1,44 +1,41 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ActivityType")] -public partial class OmActivityType -{ - [Key] - [Column("ActivityTypeID")] - public int ActivityTypeId { get; set; } - - [StringLength(250)] - public string ActivityTypeDisplayName { get; set; } = null!; - - [StringLength(250)] - public string ActivityTypeName { get; set; } = null!; - - public bool? ActivityTypeEnabled { get; set; } - - public bool? ActivityTypeIsCustom { get; set; } - - public string? ActivityTypeDescription { get; set; } - - public bool? ActivityTypeManualCreationAllowed { get; set; } - - [StringLength(200)] - public string? ActivityTypeMainFormControl { get; set; } - - [StringLength(200)] - public string? ActivityTypeDetailFormControl { get; set; } - - [StringLength(7)] - public string? ActivityTypeColor { get; set; } - - [StringLength(200)] - public string? ActivityTypeItemObjectType { get; set; } - - [StringLength(200)] - public string? ActivityTypeItemDetailObjectType { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_ActivityType")] +public class OmActivityType +{ + [Key] + [Column("ActivityTypeID")] + public int ActivityTypeId { get; set; } + + [StringLength(250)] + public string ActivityTypeDisplayName { get; set; } = null!; + + [StringLength(250)] + public string ActivityTypeName { get; set; } = null!; + + public bool? ActivityTypeEnabled { get; set; } + + public bool? ActivityTypeIsCustom { get; set; } + + public string? ActivityTypeDescription { get; set; } + + public bool? ActivityTypeManualCreationAllowed { get; set; } + + [StringLength(200)] + public string? ActivityTypeMainFormControl { get; set; } + + [StringLength(200)] + public string? ActivityTypeDetailFormControl { get; set; } + + [StringLength(7)] + public string? ActivityTypeColor { get; set; } + + [StringLength(200)] + public string? ActivityTypeItemObjectType { get; set; } + + [StringLength(200)] + public string? ActivityTypeItemDetailObjectType { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/OmContact.cs b/Migration.Toolkit.KXP/Models/OmContact.cs index 6872dcfe..786f9c68 100644 --- a/Migration.Toolkit.KXP/Models/OmContact.cs +++ b/Migration.Toolkit.KXP/Models/OmContact.cs @@ -1,137 +1,136 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_Contact")] -[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] -[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] -[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] -[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] -[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] -[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] -[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] -public partial class OmContact -{ - [Key] - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(50)] - public string? ContactJobTitle { get; set; } - - [StringLength(100)] - public string? ContactAddress1 { get; set; } - - [StringLength(100)] - public string? ContactCity { get; set; } - - [Column("ContactZIP")] - [StringLength(100)] - public string? ContactZip { get; set; } - - [Column("ContactStateID")] - public int? ContactStateId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [StringLength(26)] - public string? ContactMobilePhone { get; set; } - - [StringLength(26)] - public string? ContactBusinessPhone { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - public DateTime? ContactBirthday { get; set; } - - public int? ContactGender { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - public string? ContactNotes { get; set; } - - [Column("ContactOwnerUserID")] - public int? ContactOwnerUserId { get; set; } - - public bool? ContactMonitored { get; set; } - - [Column("ContactGUID")] - public Guid ContactGuid { get; set; } - - public DateTime ContactLastModified { get; set; } - - public DateTime ContactCreated { get; set; } - - public int? ContactBounces { get; set; } - - [StringLength(200)] - public string? ContactCampaign { get; set; } - - [Column("ContactSalesForceLeadID")] - [StringLength(18)] - public string? ContactSalesForceLeadId { get; set; } - - public bool? ContactSalesForceLeadReplicationDisabled { get; set; } - - public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } - - public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } - - [StringLength(100)] - public string? ContactCompanyName { get; set; } - - public bool? ContactSalesForceLeadReplicationRequired { get; set; } - - [InverseProperty("ConsentAgreementContact")] - public virtual ICollection CmsConsentAgreements { get; set; } = new List(); - - [ForeignKey("ContactCountryId")] - [InverseProperty("OmContacts")] - public virtual CmsCountry? ContactCountry { get; set; } - - [ForeignKey("ContactOwnerUserId")] - [InverseProperty("OmContacts")] - public virtual CmsUser? ContactOwnerUser { get; set; } - - [ForeignKey("ContactStateId")] - [InverseProperty("OmContacts")] - public virtual CmsState? ContactState { get; set; } - - [ForeignKey("ContactStatusId")] - [InverseProperty("OmContacts")] - public virtual OmContactStatus? ContactStatus { get; set; } - - [InverseProperty("EmailMarketingRecipientContact")] - public virtual ICollection EmailLibraryEmailMarketingRecipients { get; set; } = new List(); - - [InverseProperty("EmailSubscriptionConfirmationContact")] - public virtual ICollection EmailLibraryEmailSubscriptionConfirmations { get; set; } = new List(); - - [InverseProperty("AccountPrimaryContact")] - public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); - - [InverseProperty("AccountSecondaryContact")] - public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); - - [InverseProperty("Contact")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); - - [InverseProperty("VisitorToContactContact")] - public virtual ICollection OmVisitorToContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_Contact")] +[Index("ContactCountryId", Name = "IX_OM_Contact_ContactCountryID")] +[Index("ContactEmail", Name = "IX_OM_Contact_ContactEmail")] +[Index("ContactGuid", Name = "IX_OM_Contact_ContactGUID", IsUnique = true)] +[Index("ContactLastName", Name = "IX_OM_Contact_ContactLastName")] +[Index("ContactOwnerUserId", Name = "IX_OM_Contact_ContactOwnerUserID")] +[Index("ContactStateId", Name = "IX_OM_Contact_ContactStateID")] +[Index("ContactStatusId", Name = "IX_OM_Contact_ContactStatusID")] +public class OmContact +{ + [Key] + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(50)] + public string? ContactJobTitle { get; set; } + + [StringLength(100)] + public string? ContactAddress1 { get; set; } + + [StringLength(100)] + public string? ContactCity { get; set; } + + [Column("ContactZIP")] + [StringLength(100)] + public string? ContactZip { get; set; } + + [Column("ContactStateID")] + public int? ContactStateId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [StringLength(26)] + public string? ContactMobilePhone { get; set; } + + [StringLength(26)] + public string? ContactBusinessPhone { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + public DateTime? ContactBirthday { get; set; } + + public int? ContactGender { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + public string? ContactNotes { get; set; } + + [Column("ContactOwnerUserID")] + public int? ContactOwnerUserId { get; set; } + + public bool? ContactMonitored { get; set; } + + [Column("ContactGUID")] + public Guid ContactGuid { get; set; } + + public DateTime ContactLastModified { get; set; } + + public DateTime ContactCreated { get; set; } + + public int? ContactBounces { get; set; } + + [StringLength(200)] + public string? ContactCampaign { get; set; } + + [Column("ContactSalesForceLeadID")] + [StringLength(18)] + public string? ContactSalesForceLeadId { get; set; } + + public bool? ContactSalesForceLeadReplicationDisabled { get; set; } + + public DateTime? ContactSalesForceLeadReplicationDateTime { get; set; } + + public DateTime? ContactSalesForceLeadReplicationSuspensionDateTime { get; set; } + + [StringLength(100)] + public string? ContactCompanyName { get; set; } + + public bool? ContactSalesForceLeadReplicationRequired { get; set; } + + [InverseProperty("ConsentAgreementContact")] + public virtual ICollection CmsConsentAgreements { get; set; } = new List(); + + [ForeignKey("ContactCountryId")] + [InverseProperty("OmContacts")] + public virtual CmsCountry? ContactCountry { get; set; } + + [ForeignKey("ContactOwnerUserId")] + [InverseProperty("OmContacts")] + public virtual CmsUser? ContactOwnerUser { get; set; } + + [ForeignKey("ContactStateId")] + [InverseProperty("OmContacts")] + public virtual CmsState? ContactState { get; set; } + + [ForeignKey("ContactStatusId")] + [InverseProperty("OmContacts")] + public virtual OmContactStatus? ContactStatus { get; set; } + + [InverseProperty("EmailMarketingRecipientContact")] + public virtual ICollection EmailLibraryEmailMarketingRecipients { get; set; } = new List(); + + [InverseProperty("EmailSubscriptionConfirmationContact")] + public virtual ICollection EmailLibraryEmailSubscriptionConfirmations { get; set; } = new List(); + + [InverseProperty("AccountPrimaryContact")] + public virtual ICollection OmAccountAccountPrimaryContacts { get; set; } = new List(); + + [InverseProperty("AccountSecondaryContact")] + public virtual ICollection OmAccountAccountSecondaryContacts { get; set; } = new List(); + + [InverseProperty("Contact")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); + + [InverseProperty("VisitorToContactContact")] + public virtual ICollection OmVisitorToContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs b/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs index 85c047a9..f61627b5 100644 --- a/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs +++ b/Migration.Toolkit.KXP/Models/OmContactChangeRecalculationQueue.cs @@ -1,24 +1,21 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactChangeRecalculationQueue")] -public partial class OmContactChangeRecalculationQueue -{ - [Key] - [Column("ContactChangeRecalculationQueueID")] - public int ContactChangeRecalculationQueueId { get; set; } - - [Column("ContactChangeRecalculationQueueContactID")] - public int ContactChangeRecalculationQueueContactId { get; set; } - - public string? ContactChangeRecalculationQueueChangedColumns { get; set; } - - public bool ContactChangeRecalculationQueueContactIsNew { get; set; } - - public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_ContactChangeRecalculationQueue")] +public class OmContactChangeRecalculationQueue +{ + [Key] + [Column("ContactChangeRecalculationQueueID")] + public int ContactChangeRecalculationQueueId { get; set; } + + [Column("ContactChangeRecalculationQueueContactID")] + public int ContactChangeRecalculationQueueContactId { get; set; } + + public string? ContactChangeRecalculationQueueChangedColumns { get; set; } + + public bool ContactChangeRecalculationQueueContactIsNew { get; set; } + + public bool ContactChangeRecalculationQueueContactWasMerged { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/OmContactGroup.cs b/Migration.Toolkit.KXP/Models/OmContactGroup.cs index 1c3b416b..e5619d41 100644 --- a/Migration.Toolkit.KXP/Models/OmContactGroup.cs +++ b/Migration.Toolkit.KXP/Models/OmContactGroup.cs @@ -1,48 +1,45 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactGroup")] -public partial class OmContactGroup -{ - [Key] - [Column("ContactGroupID")] - public int ContactGroupId { get; set; } - - [StringLength(200)] - public string ContactGroupName { get; set; } = null!; - - [StringLength(200)] - public string ContactGroupDisplayName { get; set; } = null!; - - public string? ContactGroupDescription { get; set; } - - public string? ContactGroupDynamicCondition { get; set; } - - public bool? ContactGroupEnabled { get; set; } - - public DateTime? ContactGroupLastModified { get; set; } - - [Column("ContactGroupGUID")] - public Guid? ContactGroupGuid { get; set; } - - public int? ContactGroupStatus { get; set; } - - public bool? ContactGroupIsRecipientList { get; set; } - - [InverseProperty("EmailSubscriptionConfirmationRecipientList")] - public virtual ICollection EmailLibraryEmailSubscriptionConfirmations { get; set; } = new List(); - - [InverseProperty("RecipientListSettingsRecipientList")] - public virtual ICollection EmailLibraryRecipientListSettings { get; set; } = new List(); - - [InverseProperty("SendConfigurationRecipientList")] - public virtual ICollection EmailLibrarySendConfigurations { get; set; } = new List(); - - [InverseProperty("ContactGroupMemberContactGroup")] - public virtual ICollection OmContactGroupMembers { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_ContactGroup")] +public class OmContactGroup +{ + [Key] + [Column("ContactGroupID")] + public int ContactGroupId { get; set; } + + [StringLength(200)] + public string ContactGroupName { get; set; } = null!; + + [StringLength(200)] + public string ContactGroupDisplayName { get; set; } = null!; + + public string? ContactGroupDescription { get; set; } + + public string? ContactGroupDynamicCondition { get; set; } + + public bool? ContactGroupEnabled { get; set; } + + public DateTime? ContactGroupLastModified { get; set; } + + [Column("ContactGroupGUID")] + public Guid? ContactGroupGuid { get; set; } + + public int? ContactGroupStatus { get; set; } + + public bool? ContactGroupIsRecipientList { get; set; } + + [InverseProperty("EmailSubscriptionConfirmationRecipientList")] + public virtual ICollection EmailLibraryEmailSubscriptionConfirmations { get; set; } = new List(); + + [InverseProperty("RecipientListSettingsRecipientList")] + public virtual ICollection EmailLibraryRecipientListSettings { get; set; } = new List(); + + [InverseProperty("SendConfigurationRecipientList")] + public virtual ICollection EmailLibrarySendConfigurations { get; set; } = new List(); + + [InverseProperty("ContactGroupMemberContactGroup")] + public virtual ICollection OmContactGroupMembers { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs b/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs index a32a9ffa..1142d0a6 100644 --- a/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs +++ b/Migration.Toolkit.KXP/Models/OmContactGroupMember.cs @@ -1,36 +1,35 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactGroupMember")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] -[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] -[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] -public partial class OmContactGroupMember -{ - [Key] - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - public int ContactGroupMemberType { get; set; } - - [Column("ContactGroupMemberRelatedID")] - public int ContactGroupMemberRelatedId { get; set; } - - public bool? ContactGroupMemberFromCondition { get; set; } - - public bool? ContactGroupMemberFromAccount { get; set; } - - public bool? ContactGroupMemberFromManual { get; set; } - - [ForeignKey("ContactGroupMemberContactGroupId")] - [InverseProperty("OmContactGroupMembers")] - public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_ContactGroupMember")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_MemberID_RelatedID_FromCondition_FromAccount_FromManual")] +[Index("ContactGroupMemberContactGroupId", "ContactGroupMemberType", "ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupID_Type_RelatedID", IsUnique = true)] +[Index("ContactGroupMemberRelatedId", Name = "IX_OM_ContactGroupMember_ContactGroupMemberRelatedID")] +public class OmContactGroupMember +{ + [Key] + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + public int ContactGroupMemberType { get; set; } + + [Column("ContactGroupMemberRelatedID")] + public int ContactGroupMemberRelatedId { get; set; } + + public bool? ContactGroupMemberFromCondition { get; set; } + + public bool? ContactGroupMemberFromAccount { get; set; } + + public bool? ContactGroupMemberFromManual { get; set; } + + [ForeignKey("ContactGroupMemberContactGroupId")] + [InverseProperty("OmContactGroupMembers")] + public virtual OmContactGroup ContactGroupMemberContactGroup { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/OmContactRole.cs b/Migration.Toolkit.KXP/Models/OmContactRole.cs index b9dc2a6c..efde5179 100644 --- a/Migration.Toolkit.KXP/Models/OmContactRole.cs +++ b/Migration.Toolkit.KXP/Models/OmContactRole.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactRole")] -public partial class OmContactRole -{ - [Key] - [Column("ContactRoleID")] - public int ContactRoleId { get; set; } - - [StringLength(200)] - public string ContactRoleName { get; set; } = null!; - - [StringLength(200)] - public string ContactRoleDisplayName { get; set; } = null!; - - public string? ContactRoleDescription { get; set; } - - [InverseProperty("ContactRole")] - public virtual ICollection OmAccountContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_ContactRole")] +public class OmContactRole +{ + [Key] + [Column("ContactRoleID")] + public int ContactRoleId { get; set; } + + [StringLength(200)] + public string ContactRoleName { get; set; } = null!; + + [StringLength(200)] + public string ContactRoleDisplayName { get; set; } = null!; + + public string? ContactRoleDescription { get; set; } + + [InverseProperty("ContactRole")] + public virtual ICollection OmAccountContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/OmContactStatus.cs b/Migration.Toolkit.KXP/Models/OmContactStatus.cs index 05d8ad6f..510a7ea6 100644 --- a/Migration.Toolkit.KXP/Models/OmContactStatus.cs +++ b/Migration.Toolkit.KXP/Models/OmContactStatus.cs @@ -1,26 +1,23 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_ContactStatus")] -public partial class OmContactStatus -{ - [Key] - [Column("ContactStatusID")] - public int ContactStatusId { get; set; } - - [StringLength(200)] - public string ContactStatusName { get; set; } = null!; - - [StringLength(200)] - public string ContactStatusDisplayName { get; set; } = null!; - - public string? ContactStatusDescription { get; set; } - - [InverseProperty("ContactStatus")] - public virtual ICollection OmContacts { get; set; } = new List(); -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_ContactStatus")] +public class OmContactStatus +{ + [Key] + [Column("ContactStatusID")] + public int ContactStatusId { get; set; } + + [StringLength(200)] + public string ContactStatusName { get; set; } = null!; + + [StringLength(200)] + public string ContactStatusDisplayName { get; set; } = null!; + + public string? ContactStatusDescription { get; set; } + + [InverseProperty("ContactStatus")] + public virtual ICollection OmContacts { get; set; } = new List(); +} diff --git a/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs b/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs index 5ac33451..f2d51329 100644 --- a/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs +++ b/Migration.Toolkit.KXP/Models/OmTrackedWebsite.cs @@ -1,37 +1,34 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_TrackedWebsite")] -public partial class OmTrackedWebsite -{ - [Key] - [Column("TrackedWebsiteID")] - public int TrackedWebsiteId { get; set; } - - [Column("TrackedWebsiteGUID")] - public Guid? TrackedWebsiteGuid { get; set; } - - [StringLength(200)] - public string TrackedWebsiteDisplayName { get; set; } = null!; - - [StringLength(100)] - public string TrackedWebsiteName { get; set; } = null!; - - [Column("TrackedWebsiteURL")] - [StringLength(400)] - public string TrackedWebsiteUrl { get; set; } = null!; - - public string? TrackedWebsiteDescription { get; set; } - - public bool? TrackedWebsiteEnabled { get; set; } - - public DateTime? TrackedWebsiteLastModified { get; set; } - - [Column("TrackedWebsiteChannelID")] - public int TrackedWebsiteChannelId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_TrackedWebsite")] +public class OmTrackedWebsite +{ + [Key] + [Column("TrackedWebsiteID")] + public int TrackedWebsiteId { get; set; } + + [Column("TrackedWebsiteGUID")] + public Guid? TrackedWebsiteGuid { get; set; } + + [StringLength(200)] + public string TrackedWebsiteDisplayName { get; set; } = null!; + + [StringLength(100)] + public string TrackedWebsiteName { get; set; } = null!; + + [Column("TrackedWebsiteURL")] + [StringLength(400)] + public string TrackedWebsiteUrl { get; set; } = null!; + + public string? TrackedWebsiteDescription { get; set; } + + public bool? TrackedWebsiteEnabled { get; set; } + + public DateTime? TrackedWebsiteLastModified { get; set; } + + [Column("TrackedWebsiteChannelID")] + public int TrackedWebsiteChannelId { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs b/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs index 91c1ac8a..a89494bf 100644 --- a/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs +++ b/Migration.Toolkit.KXP/Models/OmVisitorToContact.cs @@ -1,27 +1,26 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("OM_VisitorToContact")] -[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] -[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] -public partial class OmVisitorToContact -{ - [Key] - [Column("VisitorToContactID")] - public int VisitorToContactId { get; set; } - - [Column("VisitorToContactVisitorGUID")] - public Guid VisitorToContactVisitorGuid { get; set; } - - [Column("VisitorToContactContactID")] - public int VisitorToContactContactId { get; set; } - - [ForeignKey("VisitorToContactContactId")] - [InverseProperty("OmVisitorToContacts")] - public virtual OmContact VisitorToContactContact { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Table("OM_VisitorToContact")] +[Index("VisitorToContactContactId", Name = "IX_OM_VisitorToContact_VisitorToContactContactID")] +[Index("VisitorToContactVisitorGuid", Name = "IX_OM_VisitorToContact_VisitorToContactVisitorGUID", IsUnique = true)] +public class OmVisitorToContact +{ + [Key] + [Column("VisitorToContactID")] + public int VisitorToContactId { get; set; } + + [Column("VisitorToContactVisitorGUID")] + public Guid VisitorToContactVisitorGuid { get; set; } + + [Column("VisitorToContactContactID")] + public int VisitorToContactContactId { get; set; } + + [ForeignKey("VisitorToContactContactId")] + [InverseProperty("OmVisitorToContacts")] + public virtual OmContact VisitorToContactContact { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/TempFile.cs b/Migration.Toolkit.KXP/Models/TempFile.cs index 52f779cc..27644dc4 100644 --- a/Migration.Toolkit.KXP/Models/TempFile.cs +++ b/Migration.Toolkit.KXP/Models/TempFile.cs @@ -1,50 +1,47 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("Temp_File")] -public partial class TempFile -{ - [Key] - [Column("FileID")] - public int FileId { get; set; } - - [Column("FileParentGUID")] - public Guid FileParentGuid { get; set; } - - public int FileNumber { get; set; } - - [StringLength(50)] - public string FileExtension { get; set; } = null!; - - public long FileSize { get; set; } - - [StringLength(100)] - public string FileMimeType { get; set; } = null!; - - public int? FileImageWidth { get; set; } - - public int? FileImageHeight { get; set; } - - public byte[]? FileBinary { get; set; } - - [Column("FileGUID")] - public Guid FileGuid { get; set; } - - public DateTime FileLastModified { get; set; } - - [StringLength(200)] - public string FileDirectory { get; set; } = null!; - - [StringLength(200)] - public string FileName { get; set; } = null!; - - [StringLength(250)] - public string? FileTitle { get; set; } - - public string? FileDescription { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("Temp_File")] +public class TempFile +{ + [Key] + [Column("FileID")] + public int FileId { get; set; } + + [Column("FileParentGUID")] + public Guid FileParentGuid { get; set; } + + public int FileNumber { get; set; } + + [StringLength(50)] + public string FileExtension { get; set; } = null!; + + public long FileSize { get; set; } + + [StringLength(100)] + public string FileMimeType { get; set; } = null!; + + public int? FileImageWidth { get; set; } + + public int? FileImageHeight { get; set; } + + public byte[]? FileBinary { get; set; } + + [Column("FileGUID")] + public Guid FileGuid { get; set; } + + public DateTime FileLastModified { get; set; } + + [StringLength(200)] + public string FileDirectory { get; set; } = null!; + + [StringLength(200)] + public string FileName { get; set; } = null!; + + [StringLength(250)] + public string? FileTitle { get; set; } + + public string? FileDescription { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs b/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs index 645dc1dc..3c64a9a3 100644 --- a/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs +++ b/Migration.Toolkit.KXP/Models/TempPageBuilderWidget.cs @@ -1,23 +1,20 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Table("Temp_PageBuilderWidgets")] -public partial class TempPageBuilderWidget -{ - [Key] - [Column("PageBuilderWidgetsID")] - public int PageBuilderWidgetsId { get; set; } - - public string? PageBuilderWidgetsConfiguration { get; set; } - - public Guid PageBuilderWidgetsGuid { get; set; } - - public DateTime PageBuilderWidgetsLastModified { get; set; } - - public string? PageBuilderTemplateConfiguration { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Migration.Toolkit.KXP.Models; + +[Table("Temp_PageBuilderWidgets")] +public class TempPageBuilderWidget +{ + [Key] + [Column("PageBuilderWidgetsID")] + public int PageBuilderWidgetsId { get; set; } + + public string? PageBuilderWidgetsConfiguration { get; set; } + + public Guid PageBuilderWidgetsGuid { get; set; } + + public DateTime PageBuilderWidgetsLastModified { get; set; } + + public string? PageBuilderTemplateConfiguration { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs b/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs index d584553e..1c48896c 100644 --- a/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewCmsResourceStringJoined.cs @@ -1,44 +1,43 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public partial class ViewCmsResourceStringJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public bool StringIsCustom { get; set; } - - [Column("TranslationID")] - public int? TranslationId { get; set; } - - [Column("TranslationStringID")] - public int? TranslationStringId { get; set; } - - [Column("TranslationCultureID")] - public int? TranslationCultureId { get; set; } - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int? CultureId { get; set; } - - [StringLength(200)] - public string? CultureName { get; set; } - - [StringLength(50)] - public string? CultureCode { get; set; } - - [Column("CultureGUID")] - public Guid? CultureGuid { get; set; } - - public DateTime? CultureLastModified { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Keyless] +public class ViewCmsResourceStringJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public bool StringIsCustom { get; set; } + + [Column("TranslationID")] + public int? TranslationId { get; set; } + + [Column("TranslationStringID")] + public int? TranslationStringId { get; set; } + + [Column("TranslationCultureID")] + public int? TranslationCultureId { get; set; } + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int? CultureId { get; set; } + + [StringLength(200)] + public string? CultureName { get; set; } + + [StringLength(50)] + public string? CultureCode { get; set; } + + [Column("CultureGUID")] + public Guid? CultureGuid { get; set; } + + public DateTime? CultureLastModified { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs b/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs index a1d06f4a..b6082023 100644 --- a/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewCmsResourceTranslatedJoined.cs @@ -1,28 +1,27 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public partial class ViewCmsResourceTranslatedJoined -{ - [Column("StringID")] - public int StringId { get; set; } - - [StringLength(200)] - public string StringKey { get; set; } = null!; - - public string? TranslationText { get; set; } - - [Column("CultureID")] - public int CultureId { get; set; } - - [StringLength(200)] - public string CultureName { get; set; } = null!; - - [StringLength(50)] - public string CultureCode { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Keyless] +public class ViewCmsResourceTranslatedJoined +{ + [Column("StringID")] + public int StringId { get; set; } + + [StringLength(200)] + public string StringKey { get; set; } = null!; + + public string? TranslationText { get; set; } + + [Column("CultureID")] + public int CultureId { get; set; } + + [StringLength(200)] + public string CultureName { get; set; } = null!; + + [StringLength(50)] + public string CultureCode { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs index d24fca9b..e00f2b47 100644 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewOmAccountContactAccountJoined.cs @@ -1,32 +1,31 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public partial class ViewOmAccountContactAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [Column("ContactID")] - public int ContactId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Keyless] +public class ViewOmAccountContactAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [Column("ContactID")] + public int ContactId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs index b47bcb04..3ee15fa9 100644 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewOmAccountContactContactJoined.cs @@ -1,41 +1,40 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public partial class ViewOmAccountContactContactJoined -{ - [Column("ContactID")] - public int ContactId { get; set; } - - [StringLength(100)] - public string? ContactFirstName { get; set; } - - [StringLength(100)] - public string? ContactMiddleName { get; set; } - - [StringLength(100)] - public string? ContactLastName { get; set; } - - [StringLength(254)] - public string? ContactEmail { get; set; } - - [Column("AccountID")] - public int AccountId { get; set; } - - [Column("AccountContactID")] - public int AccountContactId { get; set; } - - [Column("ContactCountryID")] - public int? ContactCountryId { get; set; } - - [Column("ContactStatusID")] - public int? ContactStatusId { get; set; } - - [Column("ContactRoleID")] - public int? ContactRoleId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Keyless] +public class ViewOmAccountContactContactJoined +{ + [Column("ContactID")] + public int ContactId { get; set; } + + [StringLength(100)] + public string? ContactFirstName { get; set; } + + [StringLength(100)] + public string? ContactMiddleName { get; set; } + + [StringLength(100)] + public string? ContactLastName { get; set; } + + [StringLength(254)] + public string? ContactEmail { get; set; } + + [Column("AccountID")] + public int AccountId { get; set; } + + [Column("AccountContactID")] + public int AccountContactId { get; set; } + + [Column("ContactCountryID")] + public int? ContactCountryId { get; set; } + + [Column("ContactStatusID")] + public int? ContactStatusId { get; set; } + + [Column("ContactRoleID")] + public int? ContactRoleId { get; set; } +} diff --git a/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs index 5065c083..7c466bc8 100644 --- a/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewOmAccountJoined.cs @@ -1,102 +1,101 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public partial class ViewOmAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [StringLength(100)] - public string? PrimaryContactFirstName { get; set; } - - [StringLength(100)] - public string? PrimaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? PrimaryContactLastName { get; set; } - - [StringLength(100)] - public string? SecondaryContactFirstName { get; set; } - - [StringLength(100)] - public string? SecondaryContactMiddleName { get; set; } - - [StringLength(100)] - public string? SecondaryContactLastName { get; set; } - - [StringLength(200)] - public string? SubsidiaryOfName { get; set; } - - [StringLength(302)] - public string PrimaryContactFullName { get; set; } = null!; - - [StringLength(302)] - public string SecondaryContactFullName { get; set; } = null!; - - [StringLength(201)] - public string AccountFullAddress { get; set; } = null!; -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Keyless] +public class ViewOmAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [StringLength(100)] + public string? PrimaryContactFirstName { get; set; } + + [StringLength(100)] + public string? PrimaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? PrimaryContactLastName { get; set; } + + [StringLength(100)] + public string? SecondaryContactFirstName { get; set; } + + [StringLength(100)] + public string? SecondaryContactMiddleName { get; set; } + + [StringLength(100)] + public string? SecondaryContactLastName { get; set; } + + [StringLength(200)] + public string? SubsidiaryOfName { get; set; } + + [StringLength(302)] + public string PrimaryContactFullName { get; set; } = null!; + + [StringLength(302)] + public string SecondaryContactFullName { get; set; } = null!; + + [StringLength(201)] + public string AccountFullAddress { get; set; } = null!; +} diff --git a/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs b/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs index c11a65ec..23d00a33 100644 --- a/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs +++ b/Migration.Toolkit.KXP/Models/ViewOmContactGroupMemberAccountJoined.cs @@ -1,78 +1,77 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; -using Microsoft.EntityFrameworkCore; - -namespace Migration.Toolkit.KXP.Models; - -[Keyless] -public partial class ViewOmContactGroupMemberAccountJoined -{ - [Column("AccountID")] - public int AccountId { get; set; } - - [StringLength(200)] - public string AccountName { get; set; } = null!; - - [StringLength(100)] - public string? AccountAddress1 { get; set; } - - [StringLength(100)] - public string? AccountAddress2 { get; set; } - - [StringLength(100)] - public string? AccountCity { get; set; } - - [Column("AccountZIP")] - [StringLength(20)] - public string? AccountZip { get; set; } - - [Column("AccountStateID")] - public int? AccountStateId { get; set; } - - [Column("AccountCountryID")] - public int? AccountCountryId { get; set; } - - [StringLength(200)] - public string? AccountWebSite { get; set; } - - [StringLength(26)] - public string? AccountPhone { get; set; } - - [StringLength(254)] - public string? AccountEmail { get; set; } - - [StringLength(26)] - public string? AccountFax { get; set; } - - [Column("AccountPrimaryContactID")] - public int? AccountPrimaryContactId { get; set; } - - [Column("AccountSecondaryContactID")] - public int? AccountSecondaryContactId { get; set; } - - [Column("AccountStatusID")] - public int? AccountStatusId { get; set; } - - public string? AccountNotes { get; set; } - - [Column("AccountOwnerUserID")] - public int? AccountOwnerUserId { get; set; } - - [Column("AccountSubsidiaryOfID")] - public int? AccountSubsidiaryOfId { get; set; } - - [Column("AccountGUID")] - public Guid AccountGuid { get; set; } - - public DateTime AccountLastModified { get; set; } - - public DateTime AccountCreated { get; set; } - - [Column("ContactGroupMemberContactGroupID")] - public int ContactGroupMemberContactGroupId { get; set; } - - [Column("ContactGroupMemberID")] - public int ContactGroupMemberId { get; set; } -} \ No newline at end of file +using System.ComponentModel.DataAnnotations; +using System.ComponentModel.DataAnnotations.Schema; + +using Microsoft.EntityFrameworkCore; + +namespace Migration.Toolkit.KXP.Models; + +[Keyless] +public class ViewOmContactGroupMemberAccountJoined +{ + [Column("AccountID")] + public int AccountId { get; set; } + + [StringLength(200)] + public string AccountName { get; set; } = null!; + + [StringLength(100)] + public string? AccountAddress1 { get; set; } + + [StringLength(100)] + public string? AccountAddress2 { get; set; } + + [StringLength(100)] + public string? AccountCity { get; set; } + + [Column("AccountZIP")] + [StringLength(20)] + public string? AccountZip { get; set; } + + [Column("AccountStateID")] + public int? AccountStateId { get; set; } + + [Column("AccountCountryID")] + public int? AccountCountryId { get; set; } + + [StringLength(200)] + public string? AccountWebSite { get; set; } + + [StringLength(26)] + public string? AccountPhone { get; set; } + + [StringLength(254)] + public string? AccountEmail { get; set; } + + [StringLength(26)] + public string? AccountFax { get; set; } + + [Column("AccountPrimaryContactID")] + public int? AccountPrimaryContactId { get; set; } + + [Column("AccountSecondaryContactID")] + public int? AccountSecondaryContactId { get; set; } + + [Column("AccountStatusID")] + public int? AccountStatusId { get; set; } + + public string? AccountNotes { get; set; } + + [Column("AccountOwnerUserID")] + public int? AccountOwnerUserId { get; set; } + + [Column("AccountSubsidiaryOfID")] + public int? AccountSubsidiaryOfId { get; set; } + + [Column("AccountGUID")] + public Guid AccountGuid { get; set; } + + public DateTime AccountLastModified { get; set; } + + public DateTime AccountCreated { get; set; } + + [Column("ContactGroupMemberContactGroupID")] + public int ContactGroupMemberContactGroupId { get; set; } + + [Column("ContactGroupMemberID")] + public int ContactGroupMemberId { get; set; } +} diff --git a/Migration.Toolkit.TestConsole/ConfigurationValidator.cs b/Migration.Toolkit.TestConsole/ConfigurationValidator.cs deleted file mode 100644 index 62f77147..00000000 --- a/Migration.Toolkit.TestConsole/ConfigurationValidator.cs +++ /dev/null @@ -1,102 +0,0 @@ -namespace Migration.Toolkit.TestConsole; - -using System.Diagnostics.Contracts; -using Microsoft.Extensions.Configuration; -using Migration.Toolkit.Common; -using Migration.Toolkit.Common.Helpers; -using Migration.Toolkit.Core.KX13.Helpers; - -public enum ValidationMessageType -{ - Error, - Warning, -} - -public record ValidationMessage(ValidationMessageType Type, string Message, string? RecommendedFix = null); - -public static class ConfigurationValidator -{ - [Pure] - public static IEnumerable GetValidationErrors(IConfigurationRoot root) - { - var settings = root.GetSection("Settings"); - - if (settings is null) - { - yield return new ValidationMessage(ValidationMessageType.Error, "Section 'Settings' is required"); - } - - if (CheckCfgValue(settings?.GetValue("SourceConnectionString"))) - { - yield return new ValidationMessage(ValidationMessageType.Error, - "Configuration value in path 'Settings.SourceConnectionString' is required"); - } - - if (CheckCfgValue(settings?.GetValue("SourceCmsDirPath"))) - { - yield return new ValidationMessage(ValidationMessageType.Warning, - "Configuration value in path 'Settings.SourceCmsDirPath' is empty, it is recommended to set source instance filesystem path"); - } - - if (CheckCfgValue(settings?.GetValue("TargetConnectionString"))) - { - yield return new ValidationMessage(ValidationMessageType.Error, - "Configuration value in path 'Settings.TargetConnectionString' is required"); - } - - if (CheckCfgValue(settings?.GetValue("TargetCmsDirPath"))) - { - yield return new ValidationMessage(ValidationMessageType.Error, - "Configuration value in path 'Settings.TargetCmsDirPath' is required"); - } - - var targetKxoApiSettings = settings?.GetSection("TargetKxoApiSettings"); - if (targetKxoApiSettings is null) - { - yield return new ValidationMessage(ValidationMessageType.Error, "Section 'Settings.TargetKxoApiSettings' is required"); - } - - var connectionStrings = targetKxoApiSettings?.GetSection("ConnectionStrings"); - if (connectionStrings is null) - { - yield return new ValidationMessage(ValidationMessageType.Error, - "Section 'Settings.TargetKxoApiSettings.ConnectionStrings' is required"); - } - - if (CheckCfgValue(connectionStrings?.GetValue("CMSConnectionString"))) - { - yield return new ValidationMessage(ValidationMessageType.Error, - "Configuration value in path 'Settings.TargetKxoApiSettings.ConnectionStrings.CMSConnectionString' is required"); - } - - if (!StringIsNullOrFitsOneOf(connectionStrings?.GetValue("UseOmActivityNodeRelationAutofix"))) - { - yield return new ValidationMessage(ValidationMessageType.Error, - $"Configuration value in path 'Settings.UseOmActivityNodeRelationAutofix' must fit one of: {Printer.PrintEnumValues(", ")}" - ); - } - - if (!StringIsNullOrFitsOneOf(connectionStrings?.GetValue("UseOmActivitySiteRelationAutofix"))) - { - yield return new ValidationMessage(ValidationMessageType.Error, - $"Configuration value in path 'Settings.UseOmActivitySiteRelationAutofix' must fit one of: {Printer.PrintEnumValues(", ")}" - ); - } - } - - #region "Helper methods" - - [Pure] - private static bool StringIsNullOrFitsOneOf(string? s) where TEnum : Enum - { - return s is null || Enum.TryParse(ReflectionHelper.CurrentType, s, out var _); - } - - [Pure] - private static bool CheckCfgValue(string? s) - { - return string.IsNullOrWhiteSpace(s) || s == "[TODO]"; - } - - #endregion -} \ No newline at end of file diff --git a/Migration.Toolkit.TestConsole/ConsoleHelper.cs b/Migration.Toolkit.TestConsole/ConsoleHelper.cs deleted file mode 100644 index 4f2f941e..00000000 --- a/Migration.Toolkit.TestConsole/ConsoleHelper.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace Migration.Toolkit.TestConsole; - -using System.Runtime.InteropServices; - -public class ConsoleHelper -{ - const int STD_OUTPUT_HANDLE = -11; - const uint ENABLE_VIRTUAL_TERMINAL_PROCESSING = 4; - - [DllImport("kernel32.dll", SetLastError = true)] - static extern IntPtr GetStdHandle(int nStdHandle); - - [DllImport("kernel32.dll")] - static extern bool GetConsoleMode(IntPtr hConsoleHandle, out uint lpMode); - - [DllImport("kernel32.dll")] - static extern bool SetConsoleMode(IntPtr hConsoleHandle, uint dwMode); - - public static void EnableVirtualTerminalProcessing() - { - var handle = GetStdHandle(STD_OUTPUT_HANDLE); - uint mode; - GetConsoleMode(handle, out mode); - mode |= ENABLE_VIRTUAL_TERMINAL_PROCESSING; - SetConsoleMode(handle, mode); - } -} \ No newline at end of file diff --git a/Migration.Toolkit.TestConsole/DocumentPageBuilderWidgetsModel.cs b/Migration.Toolkit.TestConsole/DocumentPageBuilderWidgetsModel.cs deleted file mode 100644 index bd8beb46..00000000 --- a/Migration.Toolkit.TestConsole/DocumentPageBuilderWidgetsModel.cs +++ /dev/null @@ -1,187 +0,0 @@ -namespace Migration.Toolkit.TestConsole; - -using System.Runtime.Serialization; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - - -#region Copied from Kentico assembly - -[DataContract(Name = "Configuration", Namespace = "")] -public sealed class EditableAreasConfiguration -{ - /// Editable areas within the page. - [DataMember] - [JsonProperty("editableAreas")] - public List EditableAreas { get; private set; } - - /// - /// Creates an instance of class. - /// - public EditableAreasConfiguration() => this.EditableAreas = new List(); -} - -/// -/// Represents configuration of editable area within the instance. -/// -[DataContract(Name = "EditableArea", Namespace = "")] -public sealed class EditableAreaConfiguration -{ - /// Identifier of the editable area. - [DataMember] - [JsonProperty("identifier")] - public string Identifier { get; set; } - - /// Sections within editable area. - [DataMember] - [JsonProperty("sections")] - public List Sections { get; private set; } - - /// - /// A flag indicating whether the output of the individual widgets within the editable area can be cached. The default value is false. - /// - public bool AllowWidgetOutputCache { get; set; } - - /// - /// An absolute expiration date for the cached output of the individual widgets. - /// - public DateTimeOffset? WidgetOutputCacheExpiresOn { get; set; } - - /// - /// The length of time from the first request to cache the output of the individual widgets. - /// - public TimeSpan? WidgetOutputCacheExpiresAfter { get; set; } - - /// - /// The time after which the cached output of the individual widgets should be evicted if it has not been accessed. - /// - public TimeSpan? WidgetOutputCacheExpiresSliding { get; set; } - - /// - /// Creates an instance of class. - /// - public EditableAreaConfiguration() => this.Sections = new List(); -} - -/// -/// Represents configuration of section within the instance. -/// -[DataContract(Name = "Section", Namespace = "")] -public sealed class SectionConfiguration -{ - /// Identifier of the section. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type section identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Section properties. - [DataMember] - [JsonProperty("properties")] - // public ISectionProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Zones within the section. - [DataMember] - [JsonProperty("zones")] - public List Zones { get; private set; } - - /// - /// Creates an instance of class. - /// - public SectionConfiguration() => this.Zones = new List(); -} - -/// -/// Represents the zone within the configuration class. -/// -[DataContract(Name = "Zone", Namespace = "")] -public sealed class ZoneConfiguration -{ - /// Identifier of the widget zone. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Name of the widget zone. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// List of widgets within the zone. - [DataMember] - [JsonProperty("widgets")] - public List Widgets { get; private set; } - - /// - /// Creates an instance of class. - /// - public ZoneConfiguration() => this.Widgets = new List(); -} - -/// -/// Represents the configuration of a widget within the list. -/// -[DataContract(Name = "Widget", Namespace = "")] -public sealed class WidgetConfiguration -{ - /// Identifier of the widget instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Type widget identifier. - [DataMember] - [JsonProperty("type")] - public string TypeIdentifier { get; set; } - - /// Personalization condition type identifier. - [DataMember] - [JsonProperty("conditionType")] - public string PersonalizationConditionTypeIdentifier { get; set; } - - /// List of widget variants. - [DataMember] - [JsonProperty("variants")] - public List Variants { get; set; } - - /// - /// Creates an instance of class. - /// - public WidgetConfiguration() => this.Variants = new List(); -} - -/// -/// Represents the configuration variant of a widget within the list. -/// -[DataContract(Name = "Variant", Namespace = "")] -public sealed class WidgetVariantConfiguration -{ - /// Identifier of the variant instance. - [DataMember] - [JsonProperty("identifier")] - public Guid Identifier { get; set; } - - /// Widget variant name. - [DataMember] - [JsonProperty("name")] - public string Name { get; set; } - - /// Widget variant properties. - [DataMember] - [JsonProperty("properties")] - // public IWidgetProperties Properties { get; set; } - public JObject Properties { get; set; } - - /// Widget variant personalization condition type. - /// Only personalization condition type parameters are serialized to JSON. - [DataMember] - [JsonProperty("conditionTypeParameters")] - public JObject PersonalizationConditionType { get; set; } -} - -#endregion \ No newline at end of file diff --git a/Migration.Toolkit.TestConsole/GenHelper.cs b/Migration.Toolkit.TestConsole/GenHelper.cs deleted file mode 100644 index 5d7ce75e..00000000 --- a/Migration.Toolkit.TestConsole/GenHelper.cs +++ /dev/null @@ -1,21 +0,0 @@ -// namespace Migration.Toolkit.TestConsole; -// -// using System.Text; -// using Migration.Toolkit.Core.Services.CmsClass; -// -// public static class GenHelper -// { -// public static void AppendFieldMappingDefinitionAsMarkdown(StringBuilder builder) -// { -// builder.AppendLine("|Source data type|Target data type|Source control|Target component|Actions|"); -// builder.AppendLine("|---|---|---|---|---|"); -// foreach (var (sourceDataType, value) in FieldMappingInstance.Default) -// { -// foreach (var (sourceComponent, targetComponent) in value.FormComponents) -// { -// builder.AppendLine( -// $"|{string.Join("|", sourceDataType, value.TargetDataType, sourceComponent, targetComponent.TargetFormComponent, string.Join(",", targetComponent.Actions))}|"); -// } -// } -// } -// } \ No newline at end of file diff --git a/Migration.Toolkit.TestConsole/Migration.Toolkit.TestConsole.csproj b/Migration.Toolkit.TestConsole/Migration.Toolkit.TestConsole.csproj deleted file mode 100644 index eb55acc7..00000000 --- a/Migration.Toolkit.TestConsole/Migration.Toolkit.TestConsole.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - Exe - - - - - - - - - - - - - - - - - - - - - - Always - - - Always - - - Always - - - - diff --git a/Migration.Toolkit.TestConsole/Program.cs b/Migration.Toolkit.TestConsole/Program.cs deleted file mode 100644 index ff8506ad..00000000 --- a/Migration.Toolkit.TestConsole/Program.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System.Reflection; -using System.Text; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using Migration.Toolkit.Common; -using Migration.Toolkit.Core; -using Migration.Toolkit.Core.KX13; -using Migration.Toolkit.Core.KX13.Contexts; -using Migration.Toolkit.Core.KX13.Services; -using Migration.Toolkit.KX13; -using Migration.Toolkit.KXP; -using Migration.Toolkit.KXP.Api; -using Migration.Toolkit.KXP.Context; -using Migration.Toolkit.TestConsole; -using Newtonsoft.Json; -using Newtonsoft.Json.Linq; - -ConsoleHelper.EnableVirtualTerminalProcessing(); - -// https://docs.microsoft.com/en-us/dotnet/core/extensions/configuration - -var config = new ConfigurationBuilder() - .SetBasePath(Environment.CurrentDirectory) - .AddJsonFile("appsettings.json", optional: false, reloadOnChange: false) - .AddJsonFile("appsettings.local.json", optional: true, reloadOnChange: false) - // .AddEnvironmentVariables() - .Build() - ; - -var settings = config.GetRequiredSection("Settings").Get(); - -var services = new ServiceCollection(); - -services - .AddLogging(builder => - { - builder.AddConfiguration(config.GetSection("Logging")); - builder.AddSimpleConsole(options => - { - options.IncludeScopes = true; - options.SingleLine = true; - options.TimestampFormat = "hh:mm:ss.fff "; - }); - builder.AddFile(config.GetSection("Logging")); - }); - -services.UseKx13DbContext(settings); -services.UseKxpDbContext(settings); -services.UseKxpApi(config.GetRequiredSection("Settings").GetRequiredSection(ConfigurationNames.XbKApiSettings), settings.XbKDirPath); -services.AddSingleton(settings); -services.UseKx13ToolkitCore(); - -await using var serviceProvider = services.BuildServiceProvider(); -using var scope = serviceProvider.CreateScope(); -var logger = scope.ServiceProvider.GetRequiredService>(); -var mappingContext = scope.ServiceProvider.GetRequiredService(); -var toolkitConfiguration = scope.ServiceProvider.GetRequiredService(); -var tableTypeLookupService = scope.ServiceProvider.GetRequiredService(); -// var mediatr = scope.ServiceProvider.GetRequiredService(); -var kxpContext = scope.ServiceProvider.GetRequiredService>().CreateDbContext(); - -var json = @"{ - ""editableAreas"": [ - { - ""identifier"": ""ContactUs"", - ""sections"": [ - { - ""identifier"": ""737e5d34-f1de-42bb-a4df-588f4dffb9b6"", - ""type"": ""DancingGoat.SingleColumnSection"", - ""properties"": { - ""theme"": null - }, - ""zones"": [ - { - ""identifier"": ""a78772f4-9850-464d-8f6a-0400e71a6b05"", - ""widgets"": [ - { - ""identifier"": ""ccd51ab9-b7e2-4a93-a5c6-172cb8e270b7"", - ""type"": ""Kentico.FormWidget"", - ""variants"": [ - { - ""identifier"": ""77a99ac8-d93f-4cf9-bfb1-45b16f5dedcf"", - ""properties"": { - ""selectedForm"": ""DancingGoatCoreContactUsNew"", - ""anotherf"": ""DancingGoatCoreContactUsNew"" - } - } - ] - } - ] - } - ] - } - ] -} -] -}"; - - -// var editableAreas = JsonConvert.DeserializeObject(json); -// -// foreach (var area in editableAreas.EditableAreas) -// { -// foreach (var section in area.Sections) -// { -// // TODO tomas.krch: 2022-09-12 section properties -// // section.Properties -// Console.WriteLine($"{section.TypeIdentifier}"); -// Console.WriteLine($"{section.Properties}"); -// -// foreach (var zone in section.Zones) -// { -// foreach (var widget in zone.Widgets) -// { -// Console.WriteLine($"{widget.TypeIdentifier}"); -// foreach (var widgetVariant in widget.Variants) -// { -// // TODO tomas.krch: 2022-09-12 widgetVariant.Properties -// Console.WriteLine($"{widgetVariant.Properties}"); -// } -// } -// } -// } -// } - - -var jo = JObject.Parse(json); - -var allProperties = jo.SelectTokens("$..properties").ToList(); -foreach (var properties in allProperties) -{ - Console.WriteLine("-----------------------"); - var propertiesContainer = properties.Parent; - Console.WriteLine($"{propertiesContainer}"); - - var propsOf = propertiesContainer.Parent.Parent.Parent; - Console.WriteLine($"{propsOf}"); - - var c = 1; -} -// dynamic dynJson = JsonConvert.DeserializeObject(json); -// foreach (var item in dynJson) -// { -// Console.WriteLine("{0} {1} {2} {3}\n", item.id, item.displayName, -// item.slug, item.imageUrl); -// } - - -// var sb = new StringBuilder(); -// GenHelper.AppendFieldMappingDefinitionAsMarkdown(sb); -// var def = sb.ToString(); -// Console.WriteLine(def); - -// var countryMigrator = scope.ServiceProvider.GetRequiredService(); -// -// countryMigrator.MigrateCountriesAndStates(); - -// var classService = scope.ServiceProvider.GetRequiredService(); -// var classFields = classService.GetClassFields(new Guid("C1C4DEDA-9280-436C-9BF7-F1A0C706EC80")); // custom.News -// -// foreach (var classColumnModel in classFields) -// { -// logger.LogInformation("{classColumnModel}", classColumnModel); -// } -// -// kxpContext.Dispose(); \ No newline at end of file diff --git a/Migration.Toolkit.TestConsole/appsettings.json b/Migration.Toolkit.TestConsole/appsettings.json deleted file mode 100644 index 9e71430e..00000000 --- a/Migration.Toolkit.TestConsole/appsettings.json +++ /dev/null @@ -1,49 +0,0 @@ -{ - "Logging": { - "LogLevel": { - "Default": "Information", - "System": "Warning", - "Microsoft": "Warning" - }, - "MinimumLevel": { - "Default": "Information", - "System": "Warning", - "Microsoft": "Warning" - }, - "pathFormat": "logs/log.txt" - }, - "Settings": { - "SourceConnectionString": "[TODO]", - "SourceCmsDirPath": "[TODO]", - "TargetConnectionString": "[TODO]", - "TargetCmsDirPath": "[TODO]", - "MigrateOnlyMediaFileInfo": false, - "TargetKxoApiSettings": { - "ConnectionStrings": { - "CMSConnectionString": "[TODO]" - } - }, - "UseOmActivityNodeRelationAutofix": "AttemptFix", - "UseOmActivitySiteRelationAutofix": "AttemptFix", - "EntityConfigurations": { - "CMS_Class": { - "ExcludeCodeNames": [ - "CMS.File", - "CMS.ImageGallery", - "CMS.News", - "CMS.MenuItem", - "CMS.Article", - "CMS.Blog", - "CMS.Job", - "CMS.Office", - "CMS.BlogPost" - ] - }, - "CMS_SettingsKey": { - "ExcludeCodeNames": [ - - ] - } - } - } -} \ No newline at end of file diff --git a/Migration.Toolkit.Tests/MediaHelperTest.cs b/Migration.Toolkit.Tests/MediaHelperTest.cs index 621044e6..a5825911 100644 --- a/Migration.Toolkit.Tests/MediaHelperTest.cs +++ b/Migration.Toolkit.Tests/MediaHelperTest.cs @@ -1,63 +1,62 @@ -namespace Migration.Toolkit.Tests; - -using Migration.Toolkit.Common.Helpers; - -public class UnitTest1 -{ - [Theory()] - // relative permanent link media file - [InlineData("~/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] - // relative permanent link media file with query - [InlineData("~/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] - // absolute permanent link media file with query (http) - [InlineData("http://somedomain.com/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] - // absolute permanent link media file with query (https) - [InlineData("https://somedomain.com/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] - // absolute permanent link media file with query (//) - [InlineData("//somedomain.com/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] - // relative permanent link attachment file with query - [InlineData("~/getattachment/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.Attachment, MediaLinkKind.Guid)] - // relative permanent link attachment file with query and owner NodeAliasPath - [InlineData("~/getattachment/NicePath/To/my/somefile.jpeg?width=300&height=100", "/NicePath/To/my/somefile.jpeg", null, true, MediaKind.Attachment, MediaLinkKind.Path)] - // absolute permanent link attachment file with query and owner NodeAliasPath - [InlineData("www.hello.local/getattachment/NicePath/To/my/somefile.jpeg?width=300&height=100", "/NicePath/To/my/somefile.jpeg", null, true, MediaKind.Attachment, MediaLinkKind.Path)] - // absolute permanent link attachment file with query and owner NodeAliasPath, missing start / - [InlineData("getattachment/NicePath/To/my/somefile.jpeg?width=300&height=100", "/NicePath/To/my/somefile.jpeg", null, true, MediaKind.Attachment, MediaLinkKind.Path)] - // not supported format in portal engine, false positive - TODO - [InlineData("~/getmedia/hello/somefile.jpeg?width=300&height=100", "/hello/somefile.jpeg", null, true, MediaKind.MediaFile, MediaLinkKind.Path)] - // not supported format in portal engine - [InlineData("~/get-media/hello/somefile.jpeg?width=300&height=100", null, null, false, MediaKind.None, MediaLinkKind.None)] - // invalid format - [InlineData("~/getmedia/", null, null, false, MediaKind.None, MediaLinkKind.None)] - // invalid format - [InlineData("https://some.local/CCEAD0F0-E2BF-459B-814A-36699E5C773E/myfile.jpeg", null, null, false, MediaKind.None, MediaLinkKind.None)] - // invalid format - [InlineData("/CCEAD0F0-E2BF-459B-814A-36699E5C773E/myfile.jpeg", null, null, false, MediaKind.None, MediaLinkKind.None)] - // invalid format - [InlineData(null, null, null, false, MediaKind.None, MediaLinkKind.None)] - - /* - * Direct file path – a direct path to the media file on the file system. For example: ~/MediaLibraryFolder/sample_image.jpg. These URLs change whenever the file is renamed or moved to a different media library (directory on the file system). - * also depends on storage settings - Settings -> Content -> Media -> Media libraries folder !!! - */ - // to successfully implement next 2 instances, context will be needed - SiteName, Custom library path setting value - // ~/[SITENAME] /media/[LibraryName] /[LibDir]/[LibDir] /[MediaFileName].[ext]?[query] - // [InlineData("~/mysitename/media/mylibraryname/sub-dir/sub-sub-dir/somefile.png?ext=.png", "/mysitename/media/mylibraryname/sub-dir/sub-sub-dir/somefile.png", null, true, MediaKind.MediaFile, MediaLinkKind.DirectMediaPath)] - // ~/[CustomDir]/media/[LibraryName] /[LibDir]/[LibDir] /[MediaFileName].[ext]?[query] - // [InlineData("~/custom_library_global_dir/mysite/sub-dir/sub-sub-dir/somefile.png?ext=.png", "/custom_library_global_dir/mysite/sub-dir/sub-sub-dir/somefile.png", null, true, MediaKind.MediaFile, MediaLinkKind.DirectMediaPath)] - // direct media path is not supported for absolute physical paths eg. C:\MyLibraries - // direct media path is not supported for absolute network share paths eg. \\myserver\MyLibraries - public void ParseMediaLink(string mediaUri, string? expectedPath, string? expectedGuid, bool expectSuccess, MediaKind expectedMediaKind, MediaLinkKind expectedMediaLinkKind) - { - Guid? expectedMediaId = Guid.TryParse(expectedGuid ?? "", out var eg) ? eg : null; - - var (success, mediaLinkKind, mediaKind, path, mediaGuid) = MediaHelper.MatchMediaLink(mediaUri); - - Assert.Equal(expectedMediaKind, mediaKind); - Assert.Equal(expectedMediaLinkKind, mediaLinkKind); - - Assert.Equal(expectedMediaId, mediaGuid); - Assert.Equal(expectedPath, path); - Assert.Equal(expectSuccess, success); - } -} \ No newline at end of file +using Migration.Toolkit.Common.Helpers; + +namespace Migration.Toolkit.Tests; + +public class UnitTest1 +{ + [Theory] + // relative permanent link media file + [InlineData("~/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] + // relative permanent link media file with query + [InlineData("~/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] + // absolute permanent link media file with query (http) + [InlineData("http://somedomain.com/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] + // absolute permanent link media file with query (https) + [InlineData("https://somedomain.com/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] + // absolute permanent link media file with query (//) + [InlineData("//somedomain.com/getmedia/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.MediaFile, MediaLinkKind.Guid)] + // relative permanent link attachment file with query + [InlineData("~/getattachment/CCEAD0F0-E2BF-459B-814A-36699E5C773E/somefile.jpeg?width=300&height=100", null, "CCEAD0F0-E2BF-459B-814A-36699E5C773E", true, MediaKind.Attachment, MediaLinkKind.Guid)] + // relative permanent link attachment file with query and owner NodeAliasPath + [InlineData("~/getattachment/NicePath/To/my/somefile.jpeg?width=300&height=100", "/NicePath/To/my/somefile.jpeg", null, true, MediaKind.Attachment, MediaLinkKind.Path)] + // absolute permanent link attachment file with query and owner NodeAliasPath + [InlineData("www.hello.local/getattachment/NicePath/To/my/somefile.jpeg?width=300&height=100", "/NicePath/To/my/somefile.jpeg", null, true, MediaKind.Attachment, MediaLinkKind.Path)] + // absolute permanent link attachment file with query and owner NodeAliasPath, missing start / + [InlineData("getattachment/NicePath/To/my/somefile.jpeg?width=300&height=100", "/NicePath/To/my/somefile.jpeg", null, true, MediaKind.Attachment, MediaLinkKind.Path)] + // not supported format in portal engine, false positive - TODO + [InlineData("~/getmedia/hello/somefile.jpeg?width=300&height=100", "/hello/somefile.jpeg", null, true, MediaKind.MediaFile, MediaLinkKind.Path)] + // not supported format in portal engine + [InlineData("~/get-media/hello/somefile.jpeg?width=300&height=100", null, null, false, MediaKind.None, MediaLinkKind.None)] + // invalid format + [InlineData("~/getmedia/", null, null, false, MediaKind.None, MediaLinkKind.None)] + // invalid format + [InlineData("https://some.local/CCEAD0F0-E2BF-459B-814A-36699E5C773E/myfile.jpeg", null, null, false, MediaKind.None, MediaLinkKind.None)] + // invalid format + [InlineData("/CCEAD0F0-E2BF-459B-814A-36699E5C773E/myfile.jpeg", null, null, false, MediaKind.None, MediaLinkKind.None)] + // invalid format + [InlineData(null, null, null, false, MediaKind.None, MediaLinkKind.None)] + /* + * Direct file path – a direct path to the media file on the file system. For example: ~/MediaLibraryFolder/sample_image.jpg. These URLs change whenever the file is renamed or moved to a different media library (directory on the file system). + * also depends on storage settings - Settings -> Content -> Media -> Media libraries folder !!! + */ + // to successfully implement next 2 instances, context will be needed - SiteName, Custom library path setting value + // ~/[SITENAME] /media/[LibraryName] /[LibDir]/[LibDir] /[MediaFileName].[ext]?[query] + // [InlineData("~/mysitename/media/mylibraryname/sub-dir/sub-sub-dir/somefile.png?ext=.png", "/mysitename/media/mylibraryname/sub-dir/sub-sub-dir/somefile.png", null, true, MediaKind.MediaFile, MediaLinkKind.DirectMediaPath)] + // ~/[CustomDir]/media/[LibraryName] /[LibDir]/[LibDir] /[MediaFileName].[ext]?[query] + // [InlineData("~/custom_library_global_dir/mysite/sub-dir/sub-sub-dir/somefile.png?ext=.png", "/custom_library_global_dir/mysite/sub-dir/sub-sub-dir/somefile.png", null, true, MediaKind.MediaFile, MediaLinkKind.DirectMediaPath)] + // direct media path is not supported for absolute physical paths eg. C:\MyLibraries + // direct media path is not supported for absolute network share paths eg. \\myserver\MyLibraries + public void ParseMediaLink(string? mediaUri, string? expectedPath, string? expectedGuid, bool expectSuccess, MediaKind expectedMediaKind, MediaLinkKind expectedMediaLinkKind) + { + Guid? expectedMediaId = Guid.TryParse(expectedGuid ?? "", out var eg) ? eg : null; + + (bool success, var mediaLinkKind, var mediaKind, string? path, var mediaGuid) = MediaHelper.MatchMediaLink(mediaUri); + + Assert.Equal(expectedMediaKind, mediaKind); + Assert.Equal(expectedMediaLinkKind, mediaLinkKind); + + Assert.Equal(expectedMediaId, mediaGuid); + Assert.Equal(expectedPath, path); + Assert.Equal(expectSuccess, success); + } +} diff --git a/Migration.Toolkit.Tests/Migration.Toolkit.Tests.csproj b/Migration.Toolkit.Tests/Migration.Toolkit.Tests.csproj index fecc6e41..ef1822bb 100644 --- a/Migration.Toolkit.Tests/Migration.Toolkit.Tests.csproj +++ b/Migration.Toolkit.Tests/Migration.Toolkit.Tests.csproj @@ -5,20 +5,20 @@ - - - + + + runtime; build; native; contentfiles; analyzers; buildtransitive all - + runtime; build; native; contentfiles; analyzers; buildtransitive all - + diff --git a/Migration.Toolkit.Tests/Usings.cs b/Migration.Toolkit.Tests/Usings.cs index 8c927eb7..c802f448 100644 --- a/Migration.Toolkit.Tests/Usings.cs +++ b/Migration.Toolkit.Tests/Usings.cs @@ -1 +1 @@ -global using Xunit; \ No newline at end of file +global using Xunit; diff --git a/Migration.Toolkit.sln b/Migration.Toolkit.sln index 197df4ac..705245a9 100644 --- a/Migration.Toolkit.sln +++ b/Migration.Toolkit.sln @@ -12,8 +12,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.Core.KX13 EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.KXP.Api", "Migration.Toolkit.KXP.Api\Migration.Toolkit.KXP.Api.csproj", "{8E806DDF-6405-4386-B69E-B6FAA672A188}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.TestConsole", "Migration.Toolkit.TestConsole\Migration.Toolkit.TestConsole.csproj", "{DD3C628C-A38F-423F-B930-3A0F7270BF92}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.KXP.Extensions", "Migration.Toolkit.KXP.Extensions\Migration.Toolkit.KXP.Extensions.csproj", "{B601194D-192B-4539-8AB0-9813130EFAD7}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Instance.Extensions", "Instance.Extensions", "{D06721D3-6E2D-4235-B146-2BB80DF2DBA9}" @@ -22,8 +20,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Instance.Extensions", "Inst KX13.NET48.Extensions\ToolkitApiController.NET48.cs = KX13.NET48.Extensions\ToolkitApiController.NET48.cs EndProjectSection EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Experiments", "Experiments", "{ECDC90AD-5A66-4C0E-BD87-C328E3B6A287}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.Tests", "Migration.Toolkit.Tests\Migration.Toolkit.Tests.csproj", "{FEA68426-F772-419D-989D-C6ADDA757344}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Migration.Toolkit.KX12", "Migration.Toolkit.KX12\Migration.Toolkit.KX12.csproj", "{CAC43720-697A-43C2-8F75-2D029AD2ABFD}" @@ -75,10 +71,6 @@ Global {8E806DDF-6405-4386-B69E-B6FAA672A188}.Debug|Any CPU.Build.0 = Debug|Any CPU {8E806DDF-6405-4386-B69E-B6FAA672A188}.Release|Any CPU.ActiveCfg = Release|Any CPU {8E806DDF-6405-4386-B69E-B6FAA672A188}.Release|Any CPU.Build.0 = Release|Any CPU - {DD3C628C-A38F-423F-B930-3A0F7270BF92}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD3C628C-A38F-423F-B930-3A0F7270BF92}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD3C628C-A38F-423F-B930-3A0F7270BF92}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD3C628C-A38F-423F-B930-3A0F7270BF92}.Release|Any CPU.Build.0 = Release|Any CPU {B601194D-192B-4539-8AB0-9813130EFAD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B601194D-192B-4539-8AB0-9813130EFAD7}.Debug|Any CPU.Build.0 = Debug|Any CPU {B601194D-192B-4539-8AB0-9813130EFAD7}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -111,7 +103,6 @@ Global {C565B800-032C-44E4-A913-659C24E9A3EC}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(NestedProjects) = preSolution - {DD3C628C-A38F-423F-B930-3A0F7270BF92} = {ECDC90AD-5A66-4C0E-BD87-C328E3B6A287} {8094319D-85E5-430C-BBC0-345C9AA8CBF2} = {F823E280-75D2-4C82-825E-CB6FB00E7067} {CAC43720-697A-43C2-8F75-2D029AD2ABFD} = {F823E280-75D2-4C82-825E-CB6FB00E7067} {1F7DC18B-CF87-4AB2-A5CC-094125246954} = {5695AAC9-FF68-4AC2-ABFC-0FD5A512D3C3}